Skip to content

Commit

Permalink
chore: update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 committed Oct 17, 2024
1 parent 9c3abab commit 07d5871
Show file tree
Hide file tree
Showing 10 changed files with 3,965 additions and 1,763 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.13.1
v20.18.0
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
"email": "blockchain-lab@um.si",
"url": "https://blockchain-lab.um.si"
},
"workspaces": ["packages/*", "apps/**/*", "libs/**/*"],
"workspaces": [
"packages/*",
"apps/**/*",
"libs/**/*"
],
"scripts": {
"build": "pnpm nx run-many --target=build",
"build:docker": "./scripts/build-docker.sh",
Expand Down Expand Up @@ -61,13 +65,13 @@
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
"packageManager": "pnpm@9.1.1",
"packageManager": "pnpm@9.12.2",
"engines": {
"node": ">=20.13.1"
"node": ">=20.18.0"
},
"volta": {
"node": "20.13.1",
"pnpm": "9.1.0"
"node": "20.18.0",
"pnpm": "9.12.2"
},
"pnpm": {
"patchedDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"@iden3/js-merkletree": "1.2.0",
"@metamask/key-tree": "^9.0.0",
"@metamask/providers": "17.1.2",
"@metamask/snaps-sdk": "6.3.0",
"@metamask/utils": "9.2.1",
"@metamask/snaps-sdk": "6.9.0",
"@metamask/utils": "9.3.0",
"@veramo/core": "6.0.0",
"@veramo/credential-eip712": "6.0.0",
"@veramo/credential-ld": "6.0.0",
Expand Down Expand Up @@ -101,8 +101,8 @@
},
"devDependencies": {
"@ceramicnetwork/streamid": "2.17.0",
"@metamask/snaps-cli": "6.3.1",
"@metamask/snaps-utils": "8.0.1",
"@metamask/snaps-cli": "6.5.0",
"@metamask/snaps-utils": "8.4.1",
"@types/elliptic": "^6.4.18",
"@types/jsonpath": "^0.2.4",
"@types/lodash.clonedeep": "^4.5.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"./files/circuits/credentialAtomicQuerySigV2/circuit_final.zkey",
"./files/circuits/credentialAtomicQuerySigV2/verification_key.json"
],
"shasum": "3oSq0uvWj5nwDmZZy5BDfmxPXXwTWlZA2LcIoWKFO9Q="
"shasum": "fbJBH7IuDe6slJiZm/Vr3Bv+cByFnKBOnDcl2hunNLc="
},
"initialPermissions": {
"endowment:ethereum-provider": {},
Expand Down
55 changes: 54 additions & 1 deletion packages/snap/src/UI.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
Italic,
Link,
type JSXElement,
type SnapComponent,
} from '@metamask/snaps-sdk/jsx';
import type { W3CVerifiableCredential } from '@veramo/core';

Expand All @@ -38,6 +39,58 @@ const permissionExtraText: Record<string, string> = {
'You will no longer see a popup on this dApp when credentials are requested!',
};

export const InteractiveForm: SnapComponent = () => {
return (
<Box>
<Heading>Interactive UI Example Snap</Heading>
<Form name="example-form">
<Field label="Example Input">
<Input name="example-input" placeholder="Enter something..." />
</Field>
<Field label="Example Dropdown">
<Dropdown name="example-dropdown">
<Option value="option1">Option 1</Option>
<Option value="option2">Option 2</Option>
<Option value="option3">Option 3</Option>
</Dropdown>
</Field>
<Field label="Example RadioGroup">
<RadioGroup name="example-radiogroup">
<Radio value="option1">Option 1</Radio>
<Radio value="option2">Option 2</Radio>
<Radio value="option3">Option 3</Radio>
</RadioGroup>
</Field>
<Field label="Example Checkbox">
<Checkbox name="example-checkbox" label="Checkbox" />
</Field>
<Field label="Example Selector">
<Selector
name="example-selector"
title="Choose an option"
value="option1"
>
<SelectorOption value="option1">
<Card title="Option 1" value="option1" />
</SelectorOption>
<SelectorOption value="option2">
<Card title="Option 2" value="option2" />
</SelectorOption>
<SelectorOption value="option3">
<Card title="Option 3" value="option3" />
</SelectorOption>
</Selector>
</Field>
<Box center>
<Button type="submit" name="submit">
Submit
</Button>
</Box>
</Form>
</Box>
);
};

class UIService {
static originHostname: string;

Expand All @@ -46,7 +99,7 @@ class UIService {
static async init(origin: string) {
UIService.originHostname = new URL(origin).hostname; // hostname
UIService.originWrapper = [
<Box key={'originWrapperBox'}>
<Box key="originWrapperBox">
<Text>
Origin: <Bold>{UIService.originHostname}</Bold>
</Text>
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@0xpolygonid/js-sdk": "1.12.0",
"@blockchain-lab-um/utils": "1.4.0-beta.1",
"@veramo/core": "6.0.0",
"typia": "^6.0.3"
"typia": "^6.11.2"
},
"devDependencies": {
"tsup": "^8.0.2"
Expand Down
105 changes: 28 additions & 77 deletions patches/@metamask__snaps-sdk.patch
Original file line number Diff line number Diff line change
@@ -1,81 +1,32 @@
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 9b9d71ae550e6ff391c8ca89288279b6f4c0d35f..0000000000000000000000000000000000000000
diff --git a/dist/types/jsx/components/Box.d.ts b/dist/types/jsx/components/Box.d.ts
index 3fa60de4501d68b2c21dd9dff216caa10f051372..8ae79319ba9bace884ac0f3b1152d14ca441fcd9 100644
--- a/dist/types/jsx/components/Box.d.ts
+++ b/dist/types/jsx/components/Box.d.ts
@@ -7,7 +7,7 @@ import type { GenericSnapElement, SnapsChildren } from '../component';
* @property alignment - The alignment mode to use within the box. Defaults to `start`.
index d5680ca38f3f85dabe9fd9572792bd8965640ab3..0000000000000000000000000000000000000000
diff --git a/dist/types/global.d.cts b/dist/types/global.d.cts
index 191cfd41e60028fee90725533f9196468dcc2a1f..e3060ee4fd1a32af75458db55bfd2ef0e9dd93c8 100644
--- a/dist/types/global.d.cts
+++ b/dist/types/global.d.cts
@@ -3,7 +3,7 @@ import type { SnapsEthereumProvider, SnapsProvider } from "./provider.cjs";
* Constants that are available globally in the Snap.
*/
export type BoxProps = {
- children: SnapsChildren<GenericSnapElement>;
+ children?: SnapsChildren<GenericSnapElement>;
direction?: 'vertical' | 'horizontal' | undefined;
alignment?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | undefined;
};
diff --git a/dist/types/jsx/components/Heading.d.ts b/dist/types/jsx/components/Heading.d.ts
index 5b1eb69011c65280536cf20821e0e5c8c875922a..a6150e23cb34070821cfb10bbd73e967794b50e4 100644
--- a/dist/types/jsx/components/Heading.d.ts
+++ b/dist/types/jsx/components/Heading.d.ts
@@ -5,7 +5,7 @@ import type { StringElement } from '../component';
* @property children - The text to display in the heading.
declare global {
- const ethereum: SnapsEthereumProvider;
- const snap: SnapsProvider;
+ var ethereum: SnapsEthereumProvider;
+ var snap: SnapsProvider;
}
//# sourceMappingURL=global.d.cts.map
\ No newline at end of file
diff --git a/dist/types/global.d.mts b/dist/types/global.d.mts
index 911b7ce1230849b05a4de03de08f83694fbc0d22..643d0d824d7964eb22bcfd48bec73c95bf7e9c04 100644
--- a/dist/types/global.d.mts
+++ b/dist/types/global.d.mts
@@ -3,7 +3,7 @@ import type { SnapsEthereumProvider, SnapsProvider } from "./provider.mjs";
* Constants that are available globally in the Snap.
*/
type HeadingProps = {
- children: StringElement;
+ children?: StringElement;
};
/**
* A heading component, which is used to display heading text.
diff --git a/dist/types/jsx/components/Link.d.ts b/dist/types/jsx/components/Link.d.ts
index c3d0ece0a4e963b840276255cdfe2a86dd00f896..22f94ffdb5e063ba0aedea0634ee3530a19ceb1f 100644
--- a/dist/types/jsx/components/Link.d.ts
+++ b/dist/types/jsx/components/Link.d.ts
@@ -12,7 +12,7 @@ export type LinkChildren = SnapsChildren<string | StandardFormattingElement>;
* `http` is not allowed.
*/
export type LinkProps = {
- children: LinkChildren;
+ children?: LinkChildren;
href: string;
};
/**
diff --git a/dist/types/jsx/components/Text.d.ts b/dist/types/jsx/components/Text.d.ts
index af2413ac7b2586389939fcb6319ca175b07ce37c..520b609dc272b9ec9eaa0cb5c3a4f931a0e0814e 100644
--- a/dist/types/jsx/components/Text.d.ts
+++ b/dist/types/jsx/components/Text.d.ts
@@ -16,7 +16,7 @@ export type TextColors = 'default' | 'alternative' | 'muted' | 'error' | 'succes
* @property children - The text to display.
*/
export type TextProps = {
- children: TextChildren;
+ children?: TextChildren;
alignment?: 'start' | 'center' | 'end' | undefined;
color?: TextColors | undefined;
};
diff --git a/dist/types/jsx/components/formatting/Bold.d.ts b/dist/types/jsx/components/formatting/Bold.d.ts
index 36561185dcabb9077d803aaaae3b0a29dc96d983..e39a9b58e94851584f11ec7274ce2bdf1da8be9f 100644
--- a/dist/types/jsx/components/formatting/Bold.d.ts
+++ b/dist/types/jsx/components/formatting/Bold.d.ts
@@ -9,7 +9,7 @@ export type BoldChildren = SnapsChildren<string | SnapElement<JsonObject, 'Itali
* @property children - The text to display in bold.
*/
export type BoldProps = {
- children: BoldChildren;
+ children?: BoldChildren;
};
/**
* A bold component, which is used to display text in bold. This component can
diff --git a/dist/types/jsx/components/formatting/Italic.d.ts b/dist/types/jsx/components/formatting/Italic.d.ts
index 2c835e3b566e6886fd8fba59f72bcf7d744b4104..97f5fdec81f03ad8dfd3dab36b0ca35bd51236bc 100644
--- a/dist/types/jsx/components/formatting/Italic.d.ts
+++ b/dist/types/jsx/components/formatting/Italic.d.ts
@@ -10,7 +10,7 @@ export type ItalicChildren = SnapsChildren<string | SnapElement<JsonObject, 'Bol
* or an array of strings.
*/
export type ItalicProps = {
- children: ItalicChildren;
+ children?: ItalicChildren;
};
/**
* An italic component, which is used to display text in italic. This componen
declare global {
- const ethereum: SnapsEthereumProvider;
- const snap: SnapsProvider;
+ var ethereum: SnapsEthereumProvider;
+ var snap: SnapsProvider;
}
//# sourceMappingURL=global.d.mts.map
16 changes: 0 additions & 16 deletions patches/@metamask__snaps-sdk@3.2.0.patch

This file was deleted.

Loading

0 comments on commit 07d5871

Please sign in to comment.