diff --git a/package-lock.json b/package-lock.json index 9c81f237..315c608c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@noble/curves": "^1.4.0", "@radixdlt/babylon-gateway-api-sdk": "^1.2.7", "@radixdlt/radix-connect-webrtc": "^1.2.1", - "@radixdlt/radix-dapp-toolkit": "2.0.0-v2.14", + "@radixdlt/radix-dapp-toolkit": "2.2.0-dev.9", "@stitches/react": "^1.2.8", "@types/blake2b": "^2.1.0", "bech32": "^2.0.0", @@ -36,7 +36,7 @@ "react-use": "^17.4.0", "rxjs": "^7.8.1", "tslog": "4.8.0", - "valibot": "^0.30.0", + "valibot": "0.42.1", "zod": "^3.19.1" }, "devDependencies": { @@ -6640,20 +6640,23 @@ } }, "node_modules/@radixdlt/radix-dapp-toolkit": { - "version": "2.0.0-v2.14", - "resolved": "https://registry.npmjs.org/@radixdlt/radix-dapp-toolkit/-/radix-dapp-toolkit-2.0.0-v2.14.tgz", - "integrity": "sha512-TmVvglgiTkJyKrLg8qtVss3bd1DWvZnErrQhuOYMIgU0I2JoSVOePSKzIhIhjMMNDQsw/fIVoJ1A9SDJyma4aw==", + "version": "2.2.0-dev.9", + "resolved": "https://registry.npmjs.org/@radixdlt/radix-dapp-toolkit/-/radix-dapp-toolkit-2.2.0-dev.9.tgz", + "integrity": "sha512-LEn8ljNcr4FCHgklJX87lqvfm7qdfqbmLE08k7KvZ3UdLxbV+qjGSsSfNOP5NXbMR68BdAp+Hp/Mr+EiacMzRA==", "dependencies": { "@noble/curves": "^1.4.0", + "base64url": "^3.0.1", + "blakejs": "^1.2.1", "bowser": "^2.11.0", "buffer": "^6.0.3", "immer": "^10.0.4", "lit": "^3.1.2", "lit-html": "^3.1.2", - "neverthrow": "^6.1.0", + "neverthrow": "^8.0.0", "rxjs": "^7.8.1", - "tslog": "^4.8.2", - "valibot": "^0.30.0" + "tslog": ">=4.8.0", + "uuid": "^10.0.0", + "valibot": "0.42.1" }, "engines": { "node": ">=18" @@ -6695,6 +6698,17 @@ "@types/trusted-types": "^2.0.2" } }, + "node_modules/@radixdlt/radix-dapp-toolkit/node_modules/neverthrow": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/neverthrow/-/neverthrow-8.1.1.tgz", + "integrity": "sha512-DpbZ/UDI0B+TxJB1JysXSfi1++3YK2xLBqQLTlRN0b4zxlZ2MoiB+dKKV8dMRzt1fAFjRKDknXOVJgpl+a4Amw==", + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "^4.24.0" + } + }, "node_modules/@radixdlt/radix-dapp-toolkit/node_modules/tslog": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/tslog/-/tslog-4.9.2.tgz", @@ -6706,6 +6720,18 @@ "url": "https://github.com/fullstack-build/tslog?sponsor=1" } }, + "node_modules/@radixdlt/radix-dapp-toolkit/node_modules/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@react-native-community/cli": { "version": "11.3.10", "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-11.3.10.tgz", @@ -8316,6 +8342,18 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.26.0.tgz", + "integrity": "sha512-ZuwpfjCwjPkAOxpjAEjabg6LRSfL7cAJb6gSQGZYjGhadlzKKywDkCUnJ+KEfrNY1jH5EEoSIKLCb572jSiglA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@saithodev/semantic-release-backmerge": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/@saithodev/semantic-release-backmerge/-/semantic-release-backmerge-3.2.1.tgz", @@ -11222,6 +11260,14 @@ } ] }, + "node_modules/base64url": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", + "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/bech32": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", @@ -11356,6 +11402,11 @@ "nanoassert": "^2.0.0" } }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + }, "node_modules/blueimp-md5": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", @@ -30056,7 +30107,7 @@ "version": "5.4.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", - "dev": true, + "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -30376,9 +30427,17 @@ } }, "node_modules/valibot": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.30.0.tgz", - "integrity": "sha512-5POBdbSkM+3nvJ6ZlyQHsggisfRtyT4tVTo1EIIShs6qCdXJnyWU5TJ68vr8iTg5zpOLjXLRiBqNx+9zwZz/rA==" + "version": "0.42.1", + "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.42.1.tgz", + "integrity": "sha512-3keXV29Ar5b//Hqi4MbSdV7lfVp6zuYLZuA9V1PvQUsXqogr+u5lvLPLk3A4f74VUXDnf/JfWMN6sB+koJ/FFw==", + "peerDependencies": { + "typescript": ">=5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } }, "node_modules/valid-url": { "version": "1.0.9", diff --git a/package.json b/package.json index 30683966..f15efeff 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@mui/material": "^5.14.0", "@noble/curves": "^1.4.0", "@radixdlt/babylon-gateway-api-sdk": "^1.2.7", - "@radixdlt/radix-dapp-toolkit": "2.0.0-v2.14", + "@radixdlt/radix-dapp-toolkit": "2.2.0-dev.9", "@radixdlt/radix-connect-webrtc": "^1.2.1", "@stitches/react": "^1.2.8", "@types/blake2b": "^2.1.0", @@ -53,7 +53,7 @@ "react-use": "^17.4.0", "rxjs": "^7.8.1", "tslog": "4.8.0", - "valibot": "^0.30.0", + "valibot": "0.42.1", "zod": "^3.19.1" }, "devDependencies": { diff --git a/src/chrome/dapp/schemas.ts b/src/chrome/dapp/schemas.ts index c55d0cde..778ec962 100644 --- a/src/chrome/dapp/schemas.ts +++ b/src/chrome/dapp/schemas.ts @@ -4,28 +4,20 @@ import { WalletInteractionItems, extensionInteractionDiscriminator, } from '@radixdlt/radix-dapp-toolkit' -import { - Output, - literal, - merge, - object, - optional, - string, - union, -} from 'valibot' +import { InferOutput, literal, object, optional, string, union } from 'valibot' -export type MetadataWithOptionalOrigin = Output< +export type MetadataWithOptionalOrigin = InferOutput< typeof MetadataWithOptionalOrigin > -export const MetadataWithOptionalOrigin = merge([ - Metadata, - object({ +export const MetadataWithOptionalOrigin = object({ + ...Metadata.entries, + ...object({ origin: optional(string()), - }), -]) + }).entries, +}) -export type WalletInteractionWithOptionalOrigin = Output< +export type WalletInteractionWithOptionalOrigin = InferOutput< typeof WalletInteractionWithOptionalOrigin > @@ -35,7 +27,7 @@ export const WalletInteractionWithOptionalOrigin = object({ items: WalletInteractionItems, }) -export type WalletInteractionExtensionInteractionOptionalOrigin = Output< +export type WalletInteractionExtensionInteractionOptionalOrigin = InferOutput< typeof WalletInteractionExtensionInteractionOptionalOrigin > @@ -46,9 +38,8 @@ export const WalletInteractionExtensionInteractionOptionalOrigin = object({ sessionId: optional(string()), }) -export type CancelWalletInteractionExtensionInteractionOptionalOrigin = Output< - typeof CancelWalletInteractionExtensionInteractionOptionalOrigin -> +export type CancelWalletInteractionExtensionInteractionOptionalOrigin = + InferOutput export const CancelWalletInteractionExtensionInteractionOptionalOrigin = object( { @@ -60,7 +51,7 @@ export const CancelWalletInteractionExtensionInteractionOptionalOrigin = object( }, ) -export type ExtenstionInteractionOptionalOrigin = Output< +export type ExtenstionInteractionOptionalOrigin = InferOutput< typeof ExtenstionInteractionOptionalOrigin >