From f0cc1cd55e671323cf4d3a7e8677e7946a757bd5 Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Thu, 8 Feb 2024 17:31:02 +0000 Subject: [PATCH 01/11] feat: poc --- package.json | 15 +- pnpm-lock.yaml | 1138 ++++++++++++----- .../argentMobile/helpers/inAppBrowser.ts | 7 +- src/connectors/argentMobile/modal/index.ts | 8 +- src/connectors/connector.ts | 5 +- src/connectors/injected/index.ts | 90 +- src/connectors/webwallet/helpers/trpc.ts | 28 +- src/connectors/webwallet/index.ts | 55 +- .../argentStarknetWindowObject.ts | 55 +- src/helpers/getWallets.ts | 2 +- src/helpers/mapModalWallets.ts | 21 +- src/helpers/mapTargetUrlToNetworkId.ts | 2 +- src/main.ts | 47 +- src/modal/Modal.svelte | 2 +- src/types/legacy.ts | 16 + src/types/modal.ts | 9 +- src/types/window.ts | 14 + tsconfig.json | 3 +- 18 files changed, 1091 insertions(+), 426 deletions(-) create mode 100644 src/types/legacy.ts diff --git a/package.json b/package.json index 1a0eee3..26908bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starknetkit", - "version": "1.1.3", + "version": "2.0.0", "repository": "github:argentlabs/starknetkit", "private": false, "browser": { @@ -57,12 +57,13 @@ "dependencies": { "@trpc/client": "^10.38.1", "@trpc/server": "^10.38.1", - "@walletconnect/sign-client": "^2.10.1", + "@walletconnect/sign-client": "^2.11.0", "bowser": "^2.11.0", "detect-browser": "^5.3.0", "eventemitter3": "^5.0.1", "events": "^3.3.0", - "get-starknet-core": "^3.1.0", + "get-starknet-core": "4.0.0", + "get-starknet-coreV3": "npm:get-starknet-core@3.2.0", "lodash-es": "^4.17.21", "svelte-forms": "^2.3.1", "trpc-browser": "^1.3.2" @@ -77,11 +78,11 @@ "@types/lodash-es": "^4.17.8", "@types/node": "^20.5.7", "@typescript-eslint/eslint-plugin": "^6.5.0", - "@walletconnect/ethereum-provider": "^2.7.7", + "@walletconnect/ethereum-provider": "^2.11.0", "@walletconnect/jsonrpc-provider": "^1.0.13", - "@walletconnect/signer-connection": "^2.7.7", - "@walletconnect/types": "^2.7.7", - "@walletconnect/utils": "^2.10.0", + "@walletconnect/signer-connection": "^2.11.0", + "@walletconnect/types": "^2.11.0", + "@walletconnect/utils": "^2.11.0", "autoprefixer": "^10.4.7", "eslint": "^8.48.0", "eslint-config-next": "^13.4.19", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ebeffe8..74c60c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -12,8 +12,8 @@ dependencies: specifier: ^10.38.1 version: 10.38.1 '@walletconnect/sign-client': - specifier: ^2.10.1 - version: 2.10.1 + specifier: ^2.11.0 + version: 2.11.0 bowser: specifier: ^2.11.0 version: 2.11.0 @@ -26,9 +26,9 @@ dependencies: events: specifier: ^3.3.0 version: 3.3.0 - get-starknet-core: - specifier: ^3.1.0 - version: 3.1.0(starknet@5.24.3) + get-starknet-coreV3: + specifier: npm:get-starknet-core@3.2.0 + version: /get-starknet-core@3.2.0(starknet@5.24.3) lodash-es: specifier: ^4.17.21 version: 4.17.21 @@ -71,20 +71,20 @@ devDependencies: specifier: ^6.5.0 version: 6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.48.0)(typescript@5.1.6) '@walletconnect/ethereum-provider': - specifier: ^2.7.7 - version: 2.7.7 + specifier: ^2.11.0 + version: 2.11.0(react@18.2.0) '@walletconnect/jsonrpc-provider': specifier: ^1.0.13 version: 1.0.13 '@walletconnect/signer-connection': - specifier: ^2.7.7 - version: 2.7.7 + specifier: ^2.11.0 + version: 2.11.0 '@walletconnect/types': - specifier: ^2.7.7 - version: 2.7.7 + specifier: ^2.11.0 + version: 2.11.0 '@walletconnect/utils': - specifier: ^2.10.0 - version: 2.10.0 + specifier: ^2.11.0 + version: 2.11.0 autoprefixer: specifier: ^10.4.7 version: 10.4.7(postcss@8.4.29) @@ -796,6 +796,9 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true + /@ioredis/commands@1.2.0: + resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} @@ -833,33 +836,14 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@json-rpc-tools/provider@1.7.6: - resolution: {integrity: sha512-z7D3xvJ33UfCGv77n40lbzOYjZKVM3k2+5cV7xS8G6SCvKTzMkhkUYuD/qzQUNT4cG/lv0e9mRToweEEVLVVmA==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - dependencies: - '@json-rpc-tools/utils': 1.7.6 - axios: 0.21.4 - safe-json-utils: 1.1.1 - ws: 7.5.9 - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate + /@lit-labs/ssr-dom-shim@1.1.2: + resolution: {integrity: sha512-jnOD+/+dSrfTWYfSXBXlo5l5f0q1UuJo3tkbMDCYA2lKUYq79jaxqtGEvnRoh049nt1vdo1+45RinipU6FGY2g==} dev: true - /@json-rpc-tools/types@1.7.6: - resolution: {integrity: sha512-nDSqmyRNEqEK9TZHtM15uNnDljczhCUdBmRhpNZ95bIPKEDQ+nTDmGMFd2lLin3upc5h2VVVd9tkTDdbXUhDIQ==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + /@lit/reactive-element@1.6.3: + resolution: {integrity: sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==} dependencies: - keyvaluestorage-interface: 1.0.0 - dev: true - - /@json-rpc-tools/utils@1.7.6: - resolution: {integrity: sha512-HjA8x/U/Q78HRRe19yh8HVKoZ+Iaoo3YZjakJYxR+rw52NHo6jM+VE9b8+7ygkCFXl/EHID5wh/MkXaE/jGyYw==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - dependencies: - '@json-rpc-tools/types': 1.7.6 - '@pedrouid/environment': 1.0.1 + '@lit-labs/ssr-dom-shim': 1.1.2 dev: true /@microsoft/api-extractor-model@7.27.6(@types/node@20.5.7): @@ -905,6 +889,68 @@ packages: resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} dev: true + /@motionone/animation@10.17.0: + resolution: {integrity: sha512-ANfIN9+iq1kGgsZxs+Nz96uiNcPLGTXwfNo2Xz/fcJXniPYpaz/Uyrfa+7I5BPLxCP82sh7quVDudf1GABqHbg==} + dependencies: + '@motionone/easing': 10.17.0 + '@motionone/types': 10.17.0 + '@motionone/utils': 10.17.0 + tslib: 2.4.0 + dev: true + + /@motionone/dom@10.17.0: + resolution: {integrity: sha512-cMm33swRlCX/qOPHWGbIlCl0K9Uwi6X5RiL8Ma6OrlJ/TP7Q+Np5GE4xcZkFptysFjMTi4zcZzpnNQGQ5D6M0Q==} + dependencies: + '@motionone/animation': 10.17.0 + '@motionone/generators': 10.17.0 + '@motionone/types': 10.17.0 + '@motionone/utils': 10.17.0 + hey-listen: 1.0.8 + tslib: 2.4.0 + dev: true + + /@motionone/easing@10.17.0: + resolution: {integrity: sha512-Bxe2wSuLu/qxqW4rBFS5m9tMLOw+QBh8v5A7Z5k4Ul4sTj5jAOfZG5R0bn5ywmk+Fs92Ij1feZ5pmC4TeXA8Tg==} + dependencies: + '@motionone/utils': 10.17.0 + tslib: 2.4.0 + dev: true + + /@motionone/generators@10.17.0: + resolution: {integrity: sha512-T6Uo5bDHrZWhIfxG/2Aut7qyWQyJIWehk6OB4qNvr/jwA/SRmixwbd7SOrxZi1z5rH3LIeFFBKK1xHnSbGPZSQ==} + dependencies: + '@motionone/types': 10.17.0 + '@motionone/utils': 10.17.0 + tslib: 2.4.0 + dev: true + + /@motionone/svelte@10.16.4: + resolution: {integrity: sha512-zRVqk20lD1xqe+yEDZhMYgftsuHc25+9JSo+r0a0OWUJFocjSV9D/+UGhX4xgJsuwB9acPzXLr20w40VnY2PQA==} + dependencies: + '@motionone/dom': 10.17.0 + tslib: 2.4.0 + dev: true + + /@motionone/types@10.17.0: + resolution: {integrity: sha512-EgeeqOZVdRUTEHq95Z3t8Rsirc7chN5xFAPMYFobx8TPubkEfRSm5xihmMUkbaR2ErKJTUw3347QDPTHIW12IA==} + dev: true + + /@motionone/utils@10.17.0: + resolution: {integrity: sha512-bGwrki4896apMWIj9yp5rAS2m0xyhxblg6gTB/leWDPt+pb410W8lYWsxyurX+DH+gO1zsQsfx2su/c1/LtTpg==} + dependencies: + '@motionone/types': 10.17.0 + hey-listen: 1.0.8 + tslib: 2.4.0 + dev: true + + /@motionone/vue@10.16.4: + resolution: {integrity: sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg==} + deprecated: Motion One for Vue is deprecated. Use Oku Motion instead https://oku-ui.com/motion + dependencies: + '@motionone/dom': 10.17.0 + tslib: 2.4.0 + dev: true + /@next/eslint-plugin-next@13.4.19: resolution: {integrity: sha512-N/O+zGb6wZQdwu6atMZHbR7T9Np5SUFUjZqCbj0sXm+MwQO35M8TazVB4otm87GkXYs2l6OPwARd3/PUWhZBVQ==} dependencies: @@ -1042,9 +1088,132 @@ packages: '@octokit/openapi-types': 18.0.0 dev: true - /@pedrouid/environment@1.0.1: - resolution: {integrity: sha512-HaW78NszGzRZd9SeoI3JD11JqY+lubnaOx7Pewj5pfjqWXOEATpeKIFb9Z4t2WBUK2iryiXX3lzWwmYWgUL0Ug==} - dev: true + /@parcel/watcher-android-arm64@2.4.0: + resolution: {integrity: sha512-+fPtO/GsbYX1LJnCYCaDVT3EOBjvSFdQN9Mrzh9zWAOOfvidPWyScTrHIZHHfJBvlHzNA0Gy0U3NXFA/M7PHUA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [android] + requiresBuild: true + optional: true + + /@parcel/watcher-darwin-arm64@2.4.0: + resolution: {integrity: sha512-T/At5pansFuQ8VJLRx0C6C87cgfqIYhW2N/kBfLCUvDhCah0EnLLwaD/6MW3ux+rpgkpQAnMELOCTKlbwncwiA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + optional: true + + /@parcel/watcher-darwin-x64@2.4.0: + resolution: {integrity: sha512-vZMv9jl+szz5YLsSqEGCMSllBl1gU1snfbRL5ysJU03MEa6gkVy9OMcvXV1j4g0++jHEcvzhs3Z3LpeEbVmY6Q==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [darwin] + requiresBuild: true + optional: true + + /@parcel/watcher-freebsd-x64@2.4.0: + resolution: {integrity: sha512-dHTRMIplPDT1M0+BkXjtMN+qLtqq24sLDUhmU+UxxLP2TEY2k8GIoqIJiVrGWGomdWsy5IO27aDV1vWyQ6gfHA==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + optional: true + + /@parcel/watcher-linux-arm-glibc@2.4.0: + resolution: {integrity: sha512-9NQXD+qk46RwATNC3/UB7HWurscY18CnAPMTFcI9Y8CTbtm63/eex1SNt+BHFinEQuLBjaZwR2Lp+n7pmEJPpQ==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + requiresBuild: true + optional: true + + /@parcel/watcher-linux-arm64-glibc@2.4.0: + resolution: {integrity: sha512-QuJTAQdsd7PFW9jNGaV9Pw+ZMWV9wKThEzzlY3Lhnnwy7iW23qtQFPql8iEaSFMCVI5StNNmONUopk+MFKpiKg==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + + /@parcel/watcher-linux-arm64-musl@2.4.0: + resolution: {integrity: sha512-oyN+uA9xcTDo/45bwsd6TFHa7Lc7hKujyMlvwrCLvSckvWogndCEoVYFNfZ6JJ2KNL/6fFiGPcbjp8jJmEh5Ng==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + + /@parcel/watcher-linux-x64-glibc@2.4.0: + resolution: {integrity: sha512-KphV8awJmxU3q52JQvJot0QMu07CIyEjV+2Tb2ZtbucEgqyRcxOBDMsqp1JNq5nuDXtcCC0uHQICeiEz38dPBQ==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + + /@parcel/watcher-linux-x64-musl@2.4.0: + resolution: {integrity: sha512-7jzcOonpXNWcSijPpKD5IbC6xC7yTibjJw9jviVzZostYLGxbz8LDJLUnLzLzhASPlPGgpeKLtFUMjAAzM+gSA==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + + /@parcel/watcher-wasm@2.3.0: + resolution: {integrity: sha512-ejBAX8H0ZGsD8lSICDNyMbSEtPMWgDL0WFCt/0z7hyf5v8Imz4rAM8xY379mBsECkq/Wdqa5WEDLqtjZ+6NxfA==} + engines: {node: '>= 10.0.0'} + dependencies: + is-glob: 4.0.3 + micromatch: 4.0.5 + bundledDependencies: + - napi-wasm + + /@parcel/watcher-win32-arm64@2.4.0: + resolution: {integrity: sha512-NOej2lqlq8bQNYhUMnOD0nwvNql8ToQF+1Zhi9ULZoG+XTtJ9hNnCFfyICxoZLXor4bBPTOnzs/aVVoefYnjIg==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [win32] + requiresBuild: true + optional: true + + /@parcel/watcher-win32-ia32@2.4.0: + resolution: {integrity: sha512-IO/nM+K2YD/iwjWAfHFMBPz4Zqn6qBDqZxY4j2n9s+4+OuTSRM/y/irksnuqcspom5DjkSeF9d0YbO+qpys+JA==} + engines: {node: '>= 10.0.0'} + cpu: [ia32] + os: [win32] + requiresBuild: true + optional: true + + /@parcel/watcher-win32-x64@2.4.0: + resolution: {integrity: sha512-pAUyUVjfFjWaf/pShmJpJmNxZhbMvJASUpdes9jL6bTEJ+gDxPRSpXTIemNyNsb9AtbiGXs9XduP1reThmd+dA==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [win32] + requiresBuild: true + optional: true + + /@parcel/watcher@2.4.0: + resolution: {integrity: sha512-XJLGVL0DEclX5pcWa2N9SX1jCGTDd8l972biNooLFtjneuGqodupPQh6XseXIBBeVIMaaJ7bTcs3qGvXwsp4vg==} + engines: {node: '>= 10.0.0'} + dependencies: + detect-libc: 1.0.3 + is-glob: 4.0.3 + micromatch: 4.0.5 + node-addon-api: 7.1.0 + optionalDependencies: + '@parcel/watcher-android-arm64': 2.4.0 + '@parcel/watcher-darwin-arm64': 2.4.0 + '@parcel/watcher-darwin-x64': 2.4.0 + '@parcel/watcher-freebsd-x64': 2.4.0 + '@parcel/watcher-linux-arm-glibc': 2.4.0 + '@parcel/watcher-linux-arm64-glibc': 2.4.0 + '@parcel/watcher-linux-arm64-musl': 2.4.0 + '@parcel/watcher-linux-x64-glibc': 2.4.0 + '@parcel/watcher-linux-x64-musl': 2.4.0 + '@parcel/watcher-win32-arm64': 2.4.0 + '@parcel/watcher-win32-ia32': 2.4.0 + '@parcel/watcher-win32-x64': 2.4.0 /@pnpm/config.env-replace@1.1.0: resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} @@ -1474,6 +1643,10 @@ packages: resolution: {integrity: sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==} dev: true + /@types/trusted-types@2.0.7: + resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + dev: true + /@typescript-eslint/eslint-plugin@6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.48.0)(typescript@5.1.6): resolution: {integrity: sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1677,86 +1850,80 @@ packages: - typescript dev: true - /@walletconnect/core@2.10.1: - resolution: {integrity: sha512-WAoXfmj+Zy5q48TnrKUjmHXJCBahzKwbul+noepRZf7JDtUAZ9IOWpUjg+UPRbfK5EiWZ0TF42S6SXidf7EHoQ==} + /@walletconnect/core@2.11.0: + resolution: {integrity: sha512-2Tjp5BCevI7dbmqo/OrCjX4tqgMqwJNQLlQAlphqPfvwlF9+tIu6pGcVbSN3U9zyXzWIZCeleqEaWUeSeET4Ew==} dependencies: '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/jsonrpc-ws-connection': 1.0.13 - '@walletconnect/keyvaluestorage': 1.0.2 + '@walletconnect/jsonrpc-ws-connection': 1.0.14 + '@walletconnect/keyvaluestorage': 1.1.1 '@walletconnect/logger': 2.0.1 '@walletconnect/relay-api': 1.0.9 '@walletconnect/relay-auth': 1.0.4 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.10.1 - '@walletconnect/utils': 2.10.1 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 events: 3.3.0 + isomorphic-unfetch: 3.1.0 lodash.isequal: 4.5.0 uint8arrays: 3.1.1 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' - bufferutil - - lokijs - - utf-8-validate - dev: false - - /@walletconnect/core@2.7.7: - resolution: {integrity: sha512-/Tmrjx9XDG8qylsUFU2fWvMoxlDwW+zzUcCgTaebMAmssCZ8NSknbBdjAdAKiey1TaLEgFkaCxXgXfioinWNYg==} - dependencies: - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-provider': 1.0.13 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/jsonrpc-ws-connection': 1.0.13 - '@walletconnect/keyvaluestorage': 1.0.2 - '@walletconnect/logger': 2.0.1 - '@walletconnect/relay-api': 1.0.9 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.7.7 - '@walletconnect/utils': 2.7.7 - events: 3.3.0 - lodash.isequal: 4.5.0 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - lokijs + - encoding + - supports-color - utf-8-validate - dev: true /@walletconnect/environment@1.0.1: resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} dependencies: tslib: 1.14.1 - /@walletconnect/ethereum-provider@2.7.7: - resolution: {integrity: sha512-wVVMgpMMcPySBKHAPu7QfL18TMrjAgOePz/mfuOjWal+vT9yVSPA34oFyHlzJKvcQ/abP7Zj3AzDtZbyXWRxwQ==} - peerDependencies: - '@web3modal/standalone': '>=2' - peerDependenciesMeta: - '@web3modal/standalone': - optional: true + /@walletconnect/ethereum-provider@2.11.0(react@18.2.0): + resolution: {integrity: sha512-YrTeHVjuSuhlUw7SQ6xBJXDuJ6iAC+RwINm9nVhoKYJSHAy3EVSJZOofMKrnecL0iRMtD29nj57mxAInIBRuZA==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.7 '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/sign-client': 2.7.7 - '@walletconnect/types': 2.7.7 - '@walletconnect/universal-provider': 2.7.7 - '@walletconnect/utils': 2.7.7 + '@walletconnect/modal': 2.6.2(react@18.2.0) + '@walletconnect/sign-client': 2.11.0 + '@walletconnect/types': 2.11.0 + '@walletconnect/universal-provider': 2.11.0 + '@walletconnect/utils': 2.11.0 events: 3.3.0 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/kv' - bufferutil - - debug - encoding - - lokijs + - react + - supports-color - utf-8-validate dev: true @@ -1804,31 +1971,41 @@ packages: '@walletconnect/jsonrpc-types': 1.0.3 tslib: 1.14.1 - /@walletconnect/jsonrpc-ws-connection@1.0.13: - resolution: {integrity: sha512-mfOM7uFH4lGtQxG+XklYuFBj6dwVvseTt5/ahOkkmpcAEgz2umuzu7fTR+h5EmjQBdrmYyEBOWADbeaFNxdySg==} + /@walletconnect/jsonrpc-ws-connection@1.0.14: + resolution: {integrity: sha512-Jsl6fC55AYcbkNVkwNM6Jo+ufsuCQRqViOQ8ZBPH9pRREHH9welbBiszuTLqEJiQcO/6XfFDl6bzCJIkrEi8XA==} dependencies: '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/safe-json': 1.0.2 events: 3.3.0 - tslib: 1.14.1 ws: 7.5.9 transitivePeerDependencies: - bufferutil - utf-8-validate - /@walletconnect/keyvaluestorage@1.0.2: - resolution: {integrity: sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ==} + /@walletconnect/keyvaluestorage@1.1.1: + resolution: {integrity: sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==} peerDependencies: '@react-native-async-storage/async-storage': 1.x - lokijs: 1.x peerDependenciesMeta: '@react-native-async-storage/async-storage': optional: true - lokijs: - optional: true dependencies: - safe-json-utils: 1.1.1 - tslib: 1.14.1 + '@walletconnect/safe-json': 1.0.2 + idb-keyval: 6.2.1 + unstorage: 1.10.1(idb-keyval@6.2.1) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@upstash/redis' + - '@vercel/kv' + - supports-color /@walletconnect/logger@2.0.1: resolution: {integrity: sha512-SsTKdsgWm+oDTBeNE/zHxxr5eJfZmE9/5yp/Ku+zJtcTAjELb3DXueWkDXmE9h8uHIbJzIb5wj5lPdzyrjT6hQ==} @@ -1836,6 +2013,37 @@ packages: pino: 7.11.0 tslib: 1.14.1 + /@walletconnect/modal-core@2.6.2(react@18.2.0): + resolution: {integrity: sha512-cv8ibvdOJQv2B+nyxP9IIFdxvQznMz8OOr/oR/AaUZym4hjXNL/l1a2UlSQBXrVjo3xxbouMxLb3kBsHoYP2CA==} + dependencies: + valtio: 1.11.2(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - react + dev: true + + /@walletconnect/modal-ui@2.6.2(react@18.2.0): + resolution: {integrity: sha512-rbdstM1HPGvr7jprQkyPggX7rP4XiCG85ZA+zWBEX0dVQg8PpAgRUqpeub4xQKDgY7pY/xLRXSiCVdWGqvG2HA==} + dependencies: + '@walletconnect/modal-core': 2.6.2(react@18.2.0) + lit: 2.8.0 + motion: 10.16.2 + qrcode: 1.5.3 + transitivePeerDependencies: + - '@types/react' + - react + dev: true + + /@walletconnect/modal@2.6.2(react@18.2.0): + resolution: {integrity: sha512-eFopgKi8AjKf/0U4SemvcYw9zlLpx9njVN8sf6DAkowC2Md0gPU/UNEbH1Wwj407pEKnEds98pKWib1NN1ACoA==} + dependencies: + '@walletconnect/modal-core': 2.6.2(react@18.2.0) + '@walletconnect/modal-ui': 2.6.2(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - react + dev: true + /@walletconnect/relay-api@1.0.9: resolution: {integrity: sha512-Q3+rylJOqRkO1D9Su0DPE3mmznbAalYapJ9qmzDgK28mYF9alcP3UwG/og5V7l7CFOqzCLi7B8BvcBUrpDj0Rg==} dependencies: @@ -1857,58 +2065,62 @@ packages: dependencies: tslib: 1.14.1 - /@walletconnect/sign-client@2.10.1: - resolution: {integrity: sha512-iG3eJGi1yXeG3xGeVSSMf8wDFyx239B0prLQfy1uYDtYFb2ynnH/09oqAZyKn96W5nfQzUgM2Mz157PVdloH3Q==} + /@walletconnect/sign-client@2.11.0: + resolution: {integrity: sha512-H2ukscibBS+6WrzQWh+WyVBqO5z4F5et12JcwobdwgHnJSlqIoZxqnUYYWNCI5rUR5UKsKWaUyto4AE9N5dw4Q==} dependencies: - '@walletconnect/core': 2.10.1 + '@walletconnect/core': 2.11.0 '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.0.1 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.10.1 - '@walletconnect/utils': 2.10.1 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 events: 3.3.0 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' - bufferutil - - lokijs - - utf-8-validate - dev: false - - /@walletconnect/sign-client@2.7.7: - resolution: {integrity: sha512-lTyF8ZEp+HwPNBW/Fw5iWnMm9O5tC1qwf5YfhNczZ7+q6+UUopOoRrsAvwqftJIkgKmfC8lHT52G/XM2JGVjbQ==} - dependencies: - '@walletconnect/core': 2.7.7 - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/logger': 2.0.1 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.7.7 - '@walletconnect/utils': 2.7.7 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - lokijs + - encoding + - supports-color - utf-8-validate - dev: true - /@walletconnect/signer-connection@2.7.7: - resolution: {integrity: sha512-l4ZV/bo4APGUMRQxnJsHxTzp6GT8wIdmbb6bIfD/q6eTPIHdZZbLrLAmufywwqw+YNxuWEba6va6EtVFYlZOhw==} + /@walletconnect/signer-connection@2.11.0: + resolution: {integrity: sha512-HJMRK97bT8Ok4zPIJc5PzSOZx+FESTVswv+OUdH26l+UsO9GQBr4f1N0xHuPv0CCvyUDJbxDN5DLJLbOKZm/sQ==} dependencies: '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/sign-client': 2.7.7 - '@walletconnect/types': 2.7.7 - '@walletconnect/utils': 2.7.7 + '@walletconnect/sign-client': 2.11.0 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 events: 3.3.0 uint8arrays: 3.1.1 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' - bufferutil - - lokijs + - encoding + - supports-color - utf-8-validate dev: true @@ -1917,94 +2129,63 @@ packages: dependencies: tslib: 1.14.1 - /@walletconnect/types@2.10.0: - resolution: {integrity: sha512-kSTA/WZnbKdEbvbXSW16Ty6dOSzOZCHnGg6JH7q1MuraalD2HuNg00lVVu7QAZ/Rj1Gn9DAkrgP5Wd5a8Xq//Q==} - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/keyvaluestorage': 1.0.2 - '@walletconnect/logger': 2.0.1 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - lokijs - dev: true - - /@walletconnect/types@2.10.1: - resolution: {integrity: sha512-7pccAhajQdiH2kYywjE1XI64IqRI+4ioyGy0wvz8d0UFQ/DSG3MLKR8jHf5aTOafQQ/HRLz6xvlzN4a7gIVkUQ==} + /@walletconnect/types@2.11.0: + resolution: {integrity: sha512-AB5b1lrEbCGHxqS2vqfCkIoODieH+ZAUp9rA1O2ftrhnqDJiJK983Df87JhYhECsQUBHHfALphA8ydER0q+9sw==} dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/keyvaluestorage': 1.0.2 + '@walletconnect/keyvaluestorage': 1.1.1 '@walletconnect/logger': 2.0.1 events: 3.3.0 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' - - lokijs - dev: false - - /@walletconnect/types@2.7.7: - resolution: {integrity: sha512-Z4Y+BKPX7X1UBCf7QV35mVy2QU9CS+5G+EthCaJwpieirZNHamHEwNXUjuUUb3PrYOLwlfRYUT5edeFW9wvoeQ==} - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/keyvaluestorage': 1.0.2 - '@walletconnect/logger': 2.0.1 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - lokijs - dev: true + - '@upstash/redis' + - '@vercel/kv' + - supports-color - /@walletconnect/universal-provider@2.7.7: - resolution: {integrity: sha512-MY+R1sLmIKjFYjanWUM6bOM077+SnShSUfSjCTrsoZE2RDddcSz9EtcATovBSPfzPwUTS20mgcgrkRT4zrFRyQ==} + /@walletconnect/universal-provider@2.11.0: + resolution: {integrity: sha512-zgJv8jDvIMP4Qse/D9oIRXGdfoNqonsrjPZanQ/CHNe7oXGOBiQND2IIeX+tS0H7uNA0TPvctljCLiIN9nw4eA==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.7 '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.0.1 - '@walletconnect/sign-client': 2.7.7 - '@walletconnect/types': 2.7.7 - '@walletconnect/utils': 2.7.7 - eip1193-provider: 1.0.1 + '@walletconnect/sign-client': 2.11.0 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 events: 3.3.0 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' - bufferutil - - debug - encoding - - lokijs + - supports-color - utf-8-validate dev: true - /@walletconnect/utils@2.10.0: - resolution: {integrity: sha512-9GRyEz/7CJW+G04RvrjPET5k7hOEsB9b3fF9cWDk/iDCxSWpbkU/hv/urRB36C+gvQMAZgIZYX3dHfzJWkY/2g==} - dependencies: - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/relay-api': 1.0.9 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.10.0 - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - query-string: 7.1.3 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - lokijs - dev: true - - /@walletconnect/utils@2.10.1: - resolution: {integrity: sha512-DM0dKgm9O58l7VqJEyV2OVv16XRePhDAReI23let6WdW1dSpw/Y/A89Lp99ZJOjLm2FxyblMRF3YRaZtHwBffw==} + /@walletconnect/utils@2.11.0: + resolution: {integrity: sha512-hxkHPlTlDQILHfIKXlmzgNJau/YcSBC3XHUSuZuKZbNEw3duFT6h6pm3HT/1+j1a22IG05WDsNBuTCRkwss+BQ==} dependencies: '@stablelib/chacha20poly1305': 1.0.1 '@stablelib/hkdf': 1.0.1 @@ -2014,38 +2195,26 @@ packages: '@walletconnect/relay-api': 1.0.9 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.10.1 + '@walletconnect/types': 2.11.0 '@walletconnect/window-getters': 1.0.1 '@walletconnect/window-metadata': 1.0.1 detect-browser: 5.3.0 query-string: 7.1.3 uint8arrays: 3.1.1 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' - - lokijs - dev: false - - /@walletconnect/utils@2.7.7: - resolution: {integrity: sha512-ozh9gvRAdXkiu+6nOAkoDCokDVPXK/tNATrrYuOhhR+EmGDjlZU2d27HT+HiGREdza0b1HdZN4XneGm0gERV5w==} - dependencies: - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/relay-api': 1.0.9 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.7.7 - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - query-string: 7.1.3 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - lokijs - dev: true + - '@upstash/redis' + - '@vercel/kv' + - supports-color /@walletconnect/window-getters@1.0.1: resolution: {integrity: sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==} @@ -2104,6 +2273,11 @@ packages: hasBin: true dev: true + /acorn@8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + /agent-base@7.1.0: resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} engines: {node: '>= 14'} @@ -2200,7 +2374,6 @@ packages: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 - dev: true /arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} @@ -2355,14 +2528,6 @@ packages: engines: {node: '>=4'} dev: true - /axios@0.21.4: - resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} - dependencies: - follow-redirects: 1.15.2 - transitivePeerDependencies: - - debug - dev: true - /axobject-query@3.2.1: resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} dependencies: @@ -2380,7 +2545,6 @@ packages: /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} - dev: true /bottleneck@2.19.5: resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} @@ -2408,7 +2572,6 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 - dev: true /browserslist@4.21.10: resolution: {integrity: sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==} @@ -2527,7 +2690,11 @@ packages: readdirp: 3.6.0 optionalDependencies: fsevents: 2.3.3 - dev: true + + /citty@0.1.5: + resolution: {integrity: sha512-AS7n5NSc0OQVMV9v6wt3ByujNIrne0/cTjiC2MYqhvao57VNfiuVksTSr2p17nVOhEr2KtqiAkGwHcgMC/qUuQ==} + dependencies: + consola: 3.2.3 /clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} @@ -2565,6 +2732,22 @@ packages: string-width: 5.1.2 dev: true + /clipboardy@4.0.0: + resolution: {integrity: sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==} + engines: {node: '>=18'} + dependencies: + execa: 8.0.1 + is-wsl: 3.1.0 + is64bit: 2.0.0 + + /cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + dev: true + /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -2574,6 +2757,10 @@ packages: wrap-ansi: 7.0.0 dev: true + /cluster-key-slot@1.1.2: + resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} + engines: {node: '>=0.10.0'} + /code-red@1.0.4: resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} dependencies: @@ -2644,6 +2831,10 @@ packages: proto-list: 1.2.4 dev: true + /consola@3.2.3: + resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} + engines: {node: ^14.18.0 || >=16.10.0} + /conventional-changelog-angular@6.0.0: resolution: {integrity: sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==} engines: {node: '>=14'} @@ -2711,6 +2902,9 @@ packages: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true + /cookie-es@1.0.0: + resolution: {integrity: sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ==} + /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true @@ -2775,7 +2969,6 @@ packages: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - dev: true /crypto-random-string@4.0.0: resolution: {integrity: sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==} @@ -2836,7 +3029,6 @@ packages: optional: true dependencies: ms: 2.1.2 - dev: true /decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} @@ -2881,6 +3073,13 @@ packages: resolution: {integrity: sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==} dev: true + /defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + + /denque@2.1.0: + resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} + engines: {node: '>=0.10'} + /deprecation@2.3.1: resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} dev: true @@ -2890,6 +3089,9 @@ packages: engines: {node: '>=6'} dev: true + /destr@2.0.2: + resolution: {integrity: sha512-65AlobnZMiCET00KaFFjUefxDX0khFA/E4myqZ7a6Sq1yZtR8+FVIvilVX66vF2uobSumxooYZChiRPCKNqhmg==} + /detect-browser@5.3.0: resolution: {integrity: sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==} @@ -2898,6 +3100,11 @@ packages: engines: {node: '>=8'} dev: true + /detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + /detect-newline@2.1.0: resolution: {integrity: sha512-CwffZFvlJffUg9zZA0uqrjQayUTC8ob94pnr5sFwaVv3IOmkfUHcWH+jXaQK3askE51Cqe8/9Ql/0uXNwqZ8Zg==} engines: {node: '>=0.10.0'} @@ -2922,6 +3129,10 @@ packages: engines: {node: '>=0.3.1'} dev: true + /dijkstrajs@1.0.3: + resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + dev: true + /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -2972,16 +3183,6 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /eip1193-provider@1.0.1: - resolution: {integrity: sha512-kSuqwQ26d7CzuS/t3yRXo2Su2cVH0QfvyKbr2H7Be7O5YDyIq4hQGCNTo5wRdP07bt+E2R/8nPCzey4ojBHf7g==} - dependencies: - '@json-rpc-tools/provider': 1.7.6 - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate - dev: true - /electron-to-chromium@1.4.508: resolution: {integrity: sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg==} dev: true @@ -2994,6 +3195,10 @@ packages: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} dev: true + /encode-utf8@1.0.3: + resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} + dev: true + /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: @@ -3503,7 +3708,6 @@ packages: onetime: 6.0.0 signal-exit: 4.1.0 strip-final-newline: 3.0.0 - dev: true /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -3565,7 +3769,6 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - dev: true /filter-obj@1.1.0: resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==} @@ -3630,16 +3833,6 @@ packages: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true - /follow-redirects@1.15.2: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: @@ -3684,7 +3877,6 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true - dev: true optional: true /function-bind@1.1.1: @@ -3724,10 +3916,13 @@ packages: has-symbols: 1.0.3 dev: true - /get-starknet-core@3.1.0(starknet@5.24.3): - resolution: {integrity: sha512-SPeYnzqKRXuukNoEr5aobxBmvhUSt4uWs6kFhMXl+3fG2R43u2D2DreDkA1n6T5DF10x5zLogldiHqn/jGlxEA==} + /get-port-please@3.1.2: + resolution: {integrity: sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==} + + /get-starknet-core@3.2.0(starknet@5.24.3): + resolution: {integrity: sha512-SZhxtLlKoPKLZ2H3l9WIU7CiNmkL3qLWGksALmvZdAXa/9PykYfLtvIB5B8A2UZMpf2ojTZlWLfuo1KhgmVobA==} peerDependencies: - starknet: ^5.14.1 + starknet: ^5.18.0 dependencies: starknet: 5.24.3 dev: false @@ -3745,7 +3940,6 @@ packages: /get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} - dev: true /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} @@ -3789,7 +3983,6 @@ packages: engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 - dev: true /glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} @@ -3887,6 +4080,18 @@ packages: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true + /h3@1.10.0: + resolution: {integrity: sha512-Tw1kcIC+AeimwRmviiObaD5EB430Yt+lTgOxLJxNr96Vd/fGRu04EF7aKfOAcpwKCI+U2JlbxOLhycD86p3Ciw==} + dependencies: + cookie-es: 1.0.0 + defu: 6.1.4 + destr: 2.0.2 + iron-webcrypto: 1.0.0 + radix3: 1.1.0 + ufo: 1.3.2 + uncrypto: 0.1.3 + unenv: 1.9.0 + /handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} engines: {node: '>=0.4.7'} @@ -3954,6 +4159,10 @@ packages: hasBin: true dev: true + /hey-listen@1.0.8: + resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} + dev: true + /hook-std@3.0.0: resolution: {integrity: sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -3987,6 +4196,10 @@ packages: - supports-color dev: true + /http-shutdown@1.2.2: + resolution: {integrity: sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + /https-proxy-agent@7.0.2: resolution: {integrity: sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==} engines: {node: '>= 14'} @@ -4010,7 +4223,6 @@ packages: /human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - dev: true /husky@8.0.3: resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} @@ -4018,6 +4230,9 @@ packages: hasBin: true dev: true + /idb-keyval@6.2.1: + resolution: {integrity: sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==} + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} @@ -4140,6 +4355,25 @@ packages: p-is-promise: 3.0.0 dev: true + /ioredis@5.3.2: + resolution: {integrity: sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==} + engines: {node: '>=12.22.0'} + dependencies: + '@ioredis/commands': 1.2.0 + cluster-key-slot: 1.1.2 + debug: 4.3.4 + denque: 2.1.0 + lodash.defaults: 4.2.0 + lodash.isarguments: 3.1.0 + redis-errors: 1.2.0 + redis-parser: 3.0.0 + standard-as-callback: 2.1.0 + transitivePeerDependencies: + - supports-color + + /iron-webcrypto@1.0.0: + resolution: {integrity: sha512-anOK1Mktt8U1Xi7fCM3RELTuYbnFikQY5VtrDj7kPgpejV7d43tWKhzgioO0zpkazLEL/j/iayRqnJhrGfqUsg==} + /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: @@ -4170,7 +4404,6 @@ packages: engines: {node: '>=8'} dependencies: binary-extensions: 2.2.0 - dev: true /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} @@ -4210,10 +4443,14 @@ packages: engines: {node: '>=0.10.0'} dev: true + /is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - dev: true /is-finalizationregistry@1.0.2: resolution: {integrity: sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==} @@ -4243,7 +4480,13 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 - dev: true + + /is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + dependencies: + is-docker: 3.0.0 /is-map@2.0.2: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} @@ -4264,7 +4507,6 @@ packages: /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - dev: true /is-obj@2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} @@ -4322,7 +4564,6 @@ packages: /is-stream@3.0.0: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} @@ -4381,6 +4622,18 @@ packages: get-intrinsic: 1.2.1 dev: true + /is-wsl@3.1.0: + resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} + engines: {node: '>=16'} + dependencies: + is-inside-container: 1.0.0 + + /is64bit@2.0.0: + resolution: {integrity: sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==} + engines: {node: '>=18'} + dependencies: + system-architecture: 0.1.0 + /isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} dev: true @@ -4391,7 +4644,6 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true /isomorphic-fetch@3.0.0: resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} @@ -4402,6 +4654,14 @@ packages: - encoding dev: false + /isomorphic-unfetch@3.1.0: + resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==} + dependencies: + node-fetch: 2.7.0 + unfetch: 4.2.0 + transitivePeerDependencies: + - encoding + /issue-parser@6.0.0: resolution: {integrity: sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==} engines: {node: '>=10.13'} @@ -4427,6 +4687,10 @@ packages: engines: {node: '>= 0.6.0'} dev: true + /jiti@1.21.0: + resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} + hasBin: true + /jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} dev: true @@ -4502,6 +4766,9 @@ packages: hasBin: true dev: true + /jsonc-parser@3.2.1: + resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} + /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: @@ -4606,6 +4873,28 @@ packages: - supports-color dev: true + /listhen@1.5.6: + resolution: {integrity: sha512-gTpEJhT5L85L0bFgmu+Boqu5rP4DwDtEb4Exq5gdQUxWRwx4jbzdInZkmyLONo5EwIcQB0k7ZpWlpCDPdL77EQ==} + hasBin: true + dependencies: + '@parcel/watcher': 2.4.0 + '@parcel/watcher-wasm': 2.3.0 + citty: 0.1.5 + clipboardy: 4.0.0 + consola: 3.2.3 + defu: 6.1.4 + get-port-please: 3.1.2 + h3: 1.10.0 + http-shutdown: 1.2.2 + jiti: 1.21.0 + mlly: 1.5.0 + node-forge: 1.3.1 + pathe: 1.1.2 + std-env: 3.7.0 + ufo: 1.3.2 + untun: 0.1.3 + uqr: 0.1.2 + /listr2@6.6.1: resolution: {integrity: sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==} engines: {node: '>=16.0.0'} @@ -4623,6 +4912,28 @@ packages: wrap-ansi: 8.1.0 dev: true + /lit-element@3.3.3: + resolution: {integrity: sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==} + dependencies: + '@lit-labs/ssr-dom-shim': 1.1.2 + '@lit/reactive-element': 1.6.3 + lit-html: 2.8.0 + dev: true + + /lit-html@2.8.0: + resolution: {integrity: sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==} + dependencies: + '@types/trusted-types': 2.0.7 + dev: true + + /lit@2.8.0: + resolution: {integrity: sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA==} + dependencies: + '@lit/reactive-element': 1.6.3 + lit-element: 3.3.3 + lit-html: 2.8.0 + dev: true + /load-json-file@4.0.0: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} @@ -4677,6 +4988,9 @@ packages: resolution: {integrity: sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==} dev: true + /lodash.defaults@4.2.0: + resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} + /lodash.escaperegexp@4.1.2: resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==} dev: true @@ -4685,6 +4999,9 @@ packages: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} dev: true + /lodash.isarguments@3.1.0: + resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} + /lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} @@ -4767,6 +5084,10 @@ packages: engines: {node: 14 || >=16.14} dev: true + /lru-cache@10.1.0: + resolution: {integrity: sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==} + engines: {node: 14 || >=16.14} + /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: @@ -4857,7 +5178,6 @@ packages: /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - dev: true /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -4870,13 +5190,11 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 - dev: true /mime@3.0.0: resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} engines: {node: '>=10.0.0'} hasBin: true - dev: true /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} @@ -4886,7 +5204,6 @@ packages: /mimic-fn@4.0.0: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} - dev: true /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} @@ -4926,19 +5243,36 @@ packages: minimist: 1.2.8 dev: true + /mlly@1.5.0: + resolution: {integrity: sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==} + dependencies: + acorn: 8.11.3 + pathe: 1.1.2 + pkg-types: 1.0.3 + ufo: 1.3.2 + /modify-values@1.0.1: resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==} engines: {node: '>=0.10.0'} dev: true + /motion@10.16.2: + resolution: {integrity: sha512-p+PurYqfUdcJZvtnmAqu5fJgV2kR0uLFQuBKtLeFVTrYEVllI99tiOTSefVNYuip9ELTEkepIIDftNdze76NAQ==} + dependencies: + '@motionone/animation': 10.17.0 + '@motionone/dom': 10.17.0 + '@motionone/svelte': 10.16.4 + '@motionone/types': 10.17.0 + '@motionone/utils': 10.17.0 + '@motionone/vue': 10.16.4 + dev: true + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} - dev: true /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true /muggle-string@0.3.1: resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} @@ -4965,12 +5299,19 @@ packages: resolution: {integrity: sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==} dev: true + /node-addon-api@7.1.0: + resolution: {integrity: sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==} + engines: {node: ^16 || ^18 || >= 20} + /node-emoji@1.11.0: resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==} dependencies: lodash: 4.17.21 dev: true + /node-fetch-native@1.6.1: + resolution: {integrity: sha512-bW9T/uJDPAJB2YNYEpWzE54U5O3MQidXsOyTfnbKYtTtFexRvGzb1waphBN4ZwP6EcIvYYEOwW0b72BpAqydTw==} + /node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -4982,6 +5323,10 @@ packages: dependencies: whatwg-url: 5.0.0 + /node-forge@1.3.1: + resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} + engines: {node: '>= 6.13.0'} + /node-releases@2.0.13: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: true @@ -5018,7 +5363,6 @@ packages: /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - dev: true /normalize-range@0.1.2: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} @@ -5042,7 +5386,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: path-key: 4.0.0 - dev: true /npm@9.8.1: resolution: {integrity: sha512-AfDvThQzsIXhYgk9zhbk5R+lh811lKkLAeQMMhSypf1BM7zUafeIIBzMzespeuVEJ0+LvY36oRQYf7IKLzU3rw==} @@ -5191,6 +5534,13 @@ packages: es-abstract: 1.22.1 dev: true + /ofetch@1.3.3: + resolution: {integrity: sha512-s1ZCMmQWXy4b5K/TW9i/DtiN8Ku+xCiHcjQ6/J/nDdssirrQNOoB165Zu8EqLMA2lln1JUth9a0aW9Ap2ctrUg==} + dependencies: + destr: 2.0.2 + node-fetch-native: 1.6.1 + ufo: 1.3.2 + /on-exit-leak-free@0.2.0: resolution: {integrity: sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==} @@ -5211,7 +5561,6 @@ packages: engines: {node: '>=12'} dependencies: mimic-fn: 4.0.0 - dev: true /optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} @@ -5388,12 +5737,10 @@ packages: /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - dev: true /path-key@4.0.0: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} engines: {node: '>=12'} - dev: true /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -5404,6 +5751,9 @@ packages: engines: {node: '>=8'} dev: true + /pathe@1.1.2: + resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + /periscopic@3.1.0: resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} dependencies: @@ -5419,7 +5769,6 @@ packages: /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - dev: true /pidtree@0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} @@ -5470,6 +5819,18 @@ packages: load-json-file: 4.0.0 dev: true + /pkg-types@1.0.3: + resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} + dependencies: + jsonc-parser: 3.2.1 + mlly: 1.5.0 + pathe: 1.1.2 + + /pngjs@5.0.0: + resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} + engines: {node: '>=10.13.0'} + dev: true + /postcss-import@14.1.0(postcss@8.4.29): resolution: {integrity: sha512-flwI+Vgm4SElObFVPpTIT7SU7R3qk2L7PyduMcokiaVKuWv9d/U+Gm/QAd8NDLuykTWTkcrjOeD2Pp1rMeBTGw==} engines: {node: '>=10.0.0'} @@ -5603,11 +5964,26 @@ packages: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} dev: true + /proxy-compare@2.5.1: + resolution: {integrity: sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA==} + dev: true + /punycode@2.3.0: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} dev: true + /qrcode@1.5.3: + resolution: {integrity: sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==} + engines: {node: '>=10.13.0'} + hasBin: true + dependencies: + dijkstrajs: 1.0.3 + encode-utf8: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 + dev: true + /query-string@7.1.3: resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==} engines: {node: '>=6'} @@ -5634,6 +6010,9 @@ packages: engines: {node: '>=10'} dev: true + /radix3@1.1.0: + resolution: {integrity: sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A==} + /rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -5648,6 +6027,13 @@ packages: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} dev: true + /react@18.2.0: + resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} + engines: {node: '>=0.10.0'} + dependencies: + loose-envify: 1.4.0 + dev: true + /read-cache@1.0.0: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} dependencies: @@ -5717,7 +6103,6 @@ packages: engines: {node: '>=8.10.0'} dependencies: picomatch: 2.3.1 - dev: true /real-require@0.1.0: resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} @@ -5737,6 +6122,16 @@ packages: esprima: 4.0.1 dev: true + /redis-errors@1.2.0: + resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==} + engines: {node: '>=4'} + + /redis-parser@3.0.0: + resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==} + engines: {node: '>=4'} + dependencies: + redis-errors: 1.2.0 + /reflect.getprototypeof@1.0.4: resolution: {integrity: sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==} engines: {node: '>= 0.4'} @@ -5779,6 +6174,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + dev: true + /resolve-from@3.0.0: resolution: {integrity: sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==} engines: {node: '>=4'} @@ -5899,9 +6298,6 @@ packages: /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - /safe-json-utils@1.1.1: - resolution: {integrity: sha512-SAJWGKDs50tAbiDXLf89PDwt9XYkWyANFWVzn4dTXl5QyI8t2o/bW5/OJl3lvc2WVU4MEpTo9Yz5NVFNsp+OJQ==} - /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: @@ -5991,17 +6387,19 @@ packages: lru-cache: 6.0.0 dev: true + /set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + dev: true + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 - dev: true /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - dev: true /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} @@ -6018,7 +6416,6 @@ packages: /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - dev: true /signale@1.4.0: resolution: {integrity: sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==} @@ -6128,6 +6525,9 @@ packages: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true + /standard-as-callback@2.1.0: + resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} + /starknet@5.24.3: resolution: {integrity: sha512-v0TuaNc9iNtHdbIRzX372jfQH1vgx2rwBHQDMqK4DqjJbwFEE5dog8Go6rGiZVW750NqRSWrZ7ahqyRNc3bscg==} dependencies: @@ -6142,6 +6542,9 @@ packages: - encoding dev: false + /std-env@3.7.0: + resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} + /stream-combiner2@1.1.1: resolution: {integrity: sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==} dependencies: @@ -6255,7 +6658,6 @@ packages: /strip-final-newline@3.0.0: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} - dev: true /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} @@ -6412,6 +6814,10 @@ packages: periscopic: 3.1.0 dev: true + /system-architecture@0.1.0: + resolution: {integrity: sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==} + engines: {node: '>=18'} + /tailwindcss@3.1.6(postcss@8.4.29)(ts-node@10.9.1): resolution: {integrity: sha512-7skAOY56erZAFQssT1xkpk+kWt2NrO45kORlxFPXUt3CiGsVPhH1smuH5XoDH6sGPXLyBv+zgCKA2HWBsgCytg==} engines: {node: '>=12.13.0'} @@ -6511,7 +6917,6 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 - dev: true /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -6694,6 +7099,9 @@ packages: hasBin: true dev: true + /ufo@1.3.2: + resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==} + /uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} @@ -6716,6 +7124,21 @@ packages: which-boxed-primitive: 1.0.2 dev: true + /uncrypto@0.1.3: + resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} + + /unenv@1.9.0: + resolution: {integrity: sha512-QKnFNznRxmbOF1hDgzpqrlIf6NC5sbZ2OJ+5Wl3OX8uM+LUJXbj4TXvLJCtwbPTmbMHCLIz6JLKNinNsMShK9g==} + dependencies: + consola: 3.2.3 + defu: 6.1.4 + mime: 3.0.0 + node-fetch-native: 1.6.1 + pathe: 1.1.2 + + /unfetch@4.2.0: + resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==} + /unique-string@3.0.0: resolution: {integrity: sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==} engines: {node: '>=12'} @@ -6737,6 +7160,70 @@ packages: engines: {node: '>= 10.0.0'} dev: true + /unstorage@1.10.1(idb-keyval@6.2.1): + resolution: {integrity: sha512-rWQvLRfZNBpF+x8D3/gda5nUCQL2PgXy2jNG4U7/Rc9BGEv9+CAJd0YyGCROUBKs9v49Hg8huw3aih5Bf5TAVw==} + peerDependencies: + '@azure/app-configuration': ^1.4.1 + '@azure/cosmos': ^4.0.0 + '@azure/data-tables': ^13.2.2 + '@azure/identity': ^3.3.2 + '@azure/keyvault-secrets': ^4.7.0 + '@azure/storage-blob': ^12.16.0 + '@capacitor/preferences': ^5.0.6 + '@netlify/blobs': ^6.2.0 + '@planetscale/database': ^1.11.0 + '@upstash/redis': ^1.23.4 + '@vercel/kv': ^0.2.3 + idb-keyval: ^6.2.1 + peerDependenciesMeta: + '@azure/app-configuration': + optional: true + '@azure/cosmos': + optional: true + '@azure/data-tables': + optional: true + '@azure/identity': + optional: true + '@azure/keyvault-secrets': + optional: true + '@azure/storage-blob': + optional: true + '@capacitor/preferences': + optional: true + '@netlify/blobs': + optional: true + '@planetscale/database': + optional: true + '@upstash/redis': + optional: true + '@vercel/kv': + optional: true + idb-keyval: + optional: true + dependencies: + anymatch: 3.1.3 + chokidar: 3.5.3 + destr: 2.0.2 + h3: 1.10.0 + idb-keyval: 6.2.1 + ioredis: 5.3.2 + listhen: 1.5.6 + lru-cache: 10.1.0 + mri: 1.2.0 + node-fetch-native: 1.6.1 + ofetch: 1.3.3 + ufo: 1.3.2 + transitivePeerDependencies: + - supports-color + + /untun@0.1.3: + resolution: {integrity: sha512-4luGP9LMYszMRZwsvyUd9MrxgEGZdZuZgpVQHEEX0lCYFESasVRvZd0EYpCkOIbJKHMuv0LskpXc/8Un+MJzEQ==} + hasBin: true + dependencies: + citty: 0.1.5 + consola: 3.2.3 + pathe: 1.1.2 + /update-browserslist-db@1.0.11(browserslist@4.21.10): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -6748,6 +7235,9 @@ packages: picocolors: 1.0.0 dev: true + /uqr@0.1.2: + resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==} + /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: @@ -6763,6 +7253,14 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true + /use-sync-external-store@1.2.0(react@18.2.0): + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: true + /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -6782,6 +7280,23 @@ packages: engines: {node: '>= 0.10'} dev: true + /valtio@1.11.2(react@18.2.0): + resolution: {integrity: sha512-1XfIxnUXzyswPAPXo1P3Pdx2mq/pIqZICkWN60Hby0d9Iqb+MEIpqgYVlbflvHdrp2YR/q3jyKWRPJJ100yxaw==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=16.8' + react: '>=16.8' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + dependencies: + proxy-compare: 2.5.1 + react: 18.2.0 + use-sync-external-store: 1.2.0(react@18.2.0) + dev: true + /vite-plugin-dts@3.0.0(@types/node@20.5.7)(typescript@5.1.6): resolution: {integrity: sha512-3UfEnH7DtokNZfEWEODzKWJOVTpNJL26ok121VGgxa2Iu6/uX5wgMiYPnadUuQsowXFibbWijbT4MQy8Ig/+fg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -6922,6 +7437,10 @@ packages: is-weakset: 2.0.2 dev: true + /which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + dev: true + /which-typed-array@1.1.11: resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} engines: {node: '>= 0.4'} @@ -6939,12 +7458,20 @@ packages: hasBin: true dependencies: isexe: 2.0.0 - dev: true /wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} dev: true + /wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -6996,6 +7523,10 @@ packages: engines: {node: '>=0.4'} dev: true + /y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + dev: true + /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -7024,6 +7555,14 @@ packages: engines: {node: '>= 14'} dev: true + /yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: true + /yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} @@ -7034,6 +7573,23 @@ packages: engines: {node: '>=12'} dev: true + /yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 + dev: true + /yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} diff --git a/src/connectors/argentMobile/helpers/inAppBrowser.ts b/src/connectors/argentMobile/helpers/inAppBrowser.ts index 77f21a2..7707f70 100644 --- a/src/connectors/argentMobile/helpers/inAppBrowser.ts +++ b/src/connectors/argentMobile/helpers/inAppBrowser.ts @@ -5,9 +5,10 @@ export const isInArgentMobileAppBrowser = (): boolean => { return false } - const starknetMobile = window?.starknet_argentX as StarknetWindowObject & { - isInAppBrowser: boolean - } + const starknetMobile = + window?.starknet_argentX as unknown as StarknetWindowObject & { + isInAppBrowser: boolean + } return starknetMobile?.isInAppBrowser } diff --git a/src/connectors/argentMobile/modal/index.ts b/src/connectors/argentMobile/modal/index.ts index 1c799a5..4592185 100644 --- a/src/connectors/argentMobile/modal/index.ts +++ b/src/connectors/argentMobile/modal/index.ts @@ -1,7 +1,4 @@ -import type { - StarknetWindowObject, - ConnectedStarknetWindowObject, -} from "get-starknet-core" +import type { StarknetWindowObject } from "get-starknet-core" import { login } from "./login" import type { IArgentLoginOptions } from "./login" @@ -11,5 +8,4 @@ export type { StarknetWindowObject, IArgentLoginOptions } export const getStarknetWindowObject = async ( options: IArgentLoginOptions, -): Promise => - login(options, StarknetAdapter) +): Promise => login(options, StarknetAdapter) diff --git a/src/connectors/connector.ts b/src/connectors/connector.ts index 337ec3c..e44b4d7 100644 --- a/src/connectors/connector.ts +++ b/src/connectors/connector.ts @@ -1,6 +1,5 @@ import EventEmitter from "eventemitter3" -import type { StarknetWindowObject } from "get-starknet-core" -import { AccountInterface } from "starknet" +import { StarknetWindowObject } from "get-starknet-core" /** Connector icons, as base64 encoded svg. */ export type ConnectorIcons = { @@ -45,7 +44,7 @@ export abstract class Connector extends EventEmitter { /** Disconnect wallet. */ abstract disconnect(): Promise /** Get current account. */ - abstract account(): Promise + abstract account(): Promise /** Get current chain id. */ abstract chainId(): Promise /** Connector StarknetWindowObject */ diff --git a/src/connectors/injected/index.ts b/src/connectors/injected/index.ts index 33af12a..6be0a47 100644 --- a/src/connectors/injected/index.ts +++ b/src/connectors/injected/index.ts @@ -1,9 +1,8 @@ -import type { StarknetWindowObject } from "get-starknet-core" -import { AccountInterface, ProviderInterface, constants } from "starknet" +import { Permission, StarknetWindowObject } from "get-starknet-core" +import { ProviderInterface, constants } from "starknet" import { ConnectorNotConnectedError, ConnectorNotFoundError, - UserNotConnectedError, UserRejectedRequestError, } from "../../errors" import { removeStarknetLastConnectedWallet } from "../../helpers/lastConnected" @@ -16,6 +15,7 @@ import { WALLET_NOT_FOUND_ICON_DARK, WALLET_NOT_FOUND_ICON_LIGHT, } from "./constants" +import { isString } from "lodash-es" /** Injected connector options. */ export interface InjectedConnectorOptions { /** The wallet id. */ @@ -50,7 +50,12 @@ export class InjectedConnector extends Connector { if (!this._wallet) { return false } - return await this._wallet.isPreauthorized() + + const permissions = await this._wallet.request({ + type: "wallet_getPermissions", + }) + + return permissions.includes(Permission.Accounts) } async chainId(): Promise { @@ -60,25 +65,21 @@ export class InjectedConnector extends Connector { throw new ConnectorNotConnectedError() } - const chainIdHex = await this._wallet.provider.getChainId() - const chainId = BigInt(chainIdHex) - return chainId + const chainIdHex = await this._wallet.request({ + type: "wallet_requestChainId", + }) + + return BigInt(chainIdHex) } - private async onAccountsChanged(accounts: string[] | string): Promise { - let account: string | string[] - if (typeof accounts === "string") { - account = accounts - } else { - account = accounts[0] + private async onAccountsChanged(accounts?: string[]): Promise { + if (!accounts) { + return void this.emit("disconnect") } - if (account) { - const chainId = await this.chainId() - this.emit("change", { account, chainId }) - } else { - this.emit("disconnect") - } + const account = accounts[0] + const chainId = await this.chainId() + this.emit("change", { account, chainId }) } private onNetworkChanged(network?: string): void { @@ -118,20 +119,22 @@ export class InjectedConnector extends Connector { throw new ConnectorNotFoundError() } - let accounts + let accounts: string[] | null try { - accounts = await this._wallet.enable({ starknetVersion: "v5" }) + accounts = await this._wallet.request({ + type: "wallet_requestAccounts", + }) } catch { // NOTE: Argent v3.0.0 swallows the `.enable` call on reject, so this won't get hit. throw new UserRejectedRequestError() } - if (!this._wallet.isConnected || !accounts) { + if (!accounts) { // NOTE: Argent v3.0.0 swallows the `.enable` call on reject, so this won't get hit. throw new UserRejectedRequestError() } - this._wallet.on("accountsChanged", async (accounts: string[] | string) => { + this._wallet.on("accountsChanged", async (accounts?: string[]) => { await this.onAccountsChanged(accounts) }) @@ -141,7 +144,7 @@ export class InjectedConnector extends Connector { await this.onAccountsChanged(accounts) - const account = this._wallet.account.address + const account = accounts[0] const chainId = await this.chainId() this.emit("connect", { account, chainId }) @@ -159,19 +162,24 @@ export class InjectedConnector extends Connector { throw new ConnectorNotFoundError() } - if (!this._wallet?.isConnected) { - throw new UserNotConnectedError() - } + // if (!this._wallet?.isConnected) { + // throw new UserNotConnectedError() + // } } - async account(): Promise { + async account(): Promise { this.ensureWallet() - if (!this._wallet || !this._wallet.account) { + if (!this._wallet) { throw new ConnectorNotConnectedError() } - return this._wallet.account + return this._wallet + .request({ + type: "wallet_requestAccounts", + params: { silentMode: true }, + }) + .then((accounts) => accounts[0]) } get id(): string { @@ -186,21 +194,24 @@ export class InjectedConnector extends Connector { } get icon(): ConnectorIcons { + const defaultIcons = { + dark: WALLET_NOT_FOUND_ICON_DARK, + light: WALLET_NOT_FOUND_ICON_LIGHT, + } + if (this._options.icon) { return this._options.icon } - if (this._wallet?.icon) { - return { - dark: this._wallet.icon, - light: this._wallet.icon, - } - } + const walletIcon = this._wallet?.icon + if (walletIcon) { + const darkIcon = isString(walletIcon) ? walletIcon : walletIcon.dark + const lightIcon = isString(walletIcon) ? walletIcon : walletIcon.light - return { - dark: WALLET_NOT_FOUND_ICON_DARK, - light: WALLET_NOT_FOUND_ICON_LIGHT, + return { dark: darkIcon, light: lightIcon } } + + return defaultIcons } get wallet(): StarknetWindowObject { @@ -210,6 +221,7 @@ export class InjectedConnector extends Connector { return this._wallet } + // TODO: UPDATE THIS private ensureWallet() { const installed = getAvailableWallets(globalThis) const wallet = installed.filter((w) => w.id === this._options.id)[0] diff --git a/src/connectors/webwallet/helpers/trpc.ts b/src/connectors/webwallet/helpers/trpc.ts index b1b5f72..e1989f0 100644 --- a/src/connectors/webwallet/helpers/trpc.ts +++ b/src/connectors/webwallet/helpers/trpc.ts @@ -3,8 +3,13 @@ import { createTRPCProxyClient, loggerLink, splitLink } from "@trpc/client" import { initTRPC } from "@trpc/server" import { popupLink, windowLink } from "trpc-browser/link" import { z } from "zod" -import { StarknetMethodArgumentsSchemas } from "../../../types/window" +import { + RpcCallSchema, + RpcCallsArraySchema, + StarknetMethodArgumentsSchemas, +} from "../../../types/window" import { DEFAULT_WEBWALLET_URL } from "../constants" +import { Permission } from "get-starknet-core" const t = initTRPC.create({ isServer: false, @@ -77,6 +82,27 @@ const appRouter = t.router({ isLoggedIn: true, } }), + + // RPC Messages + requestAccounts: t.procedure + .input(z.object({ silentMode: z.boolean().optional() })) + .output(z.string().array()) + .mutation(async () => []), + requestChainId: t.procedure.output(z.string()).mutation(async () => ""), + signTypedData: t.procedure + .input(StarknetMethodArgumentsSchemas.signMessage) + .output(z.string().array()) + .mutation(async () => []), + getPermissions: t.procedure + .output(z.array(z.enum([Permission.Accounts]))) + .mutation(async () => { + return [Permission.Accounts] + }), + addInvokeTransaction: t.procedure + .input(RpcCallSchema.or(RpcCallsArraySchema)) + .output(z.string()) + .mutation(async (_) => ""), + addStarknetChain: t.procedure.mutation((_) => { throw Error("not implemented") }), diff --git a/src/connectors/webwallet/index.ts b/src/connectors/webwallet/index.ts index 2546bb7..e8ca927 100644 --- a/src/connectors/webwallet/index.ts +++ b/src/connectors/webwallet/index.ts @@ -1,8 +1,9 @@ -import type { - AccountChangeEventHandler, - StarknetWindowObject, +import { + type StarknetWindowObject, + type AccountChangeEventHandler, + Permission, } from "get-starknet-core" -import type { AccountInterface, ProviderInterface } from "starknet" +import { type ProviderInterface } from "starknet" import { Connector, type ConnectorData, @@ -13,7 +14,6 @@ import { setPopupOptions, trpcProxyClient } from "./helpers/trpc" import { ConnectorNotConnectedError, ConnectorNotFoundError, - UserNotConnectedError, UserRejectedRequestError, } from "../../errors" import { DEFAULT_WEBWALLET_ICON, DEFAULT_WEBWALLET_URL } from "./constants" @@ -47,7 +47,11 @@ export class WebWalletConnector extends Connector { } this._wallet = _wallet - return this._wallet.isPreauthorized() + const permissions = await this._wallet.request({ + type: "wallet_getPermissions", + }) + + return permissions.includes(Permission.Accounts) } get id(): string { @@ -89,23 +93,18 @@ export class WebWalletConnector extends Connector { throw new ConnectorNotFoundError() } + let accounts: string[] + try { - await this._wallet.enable({ starknetVersion: "v4" }) + accounts = await this._wallet.request({ type: "wallet_requestAccounts" }) } catch { - // NOTE: Argent v3.0.0 swallows the `.enable` call on reject, so this won't get hit. - throw new UserRejectedRequestError() - } - - if (!this._wallet.isConnected) { throw new UserRejectedRequestError() } - const account = this._wallet.account as unknown as AccountInterface - const chainId = await this.chainId() return { - account: account.address, + account: accounts[0], chainId, } } @@ -115,32 +114,38 @@ export class WebWalletConnector extends Connector { throw new ConnectorNotFoundError() } - if (!this._wallet?.isConnected) { - throw new UserNotConnectedError() - } + // if (!this._wallet?.isConnected) { + // throw new UserNotConnectedError() + // } _wallet = null this._wallet = _wallet removeStarknetLastConnectedWallet() } - async account(): Promise { + async account(): Promise { this._wallet = _wallet - if (!this._wallet || !this._wallet.account) { + if (!this._wallet) { throw new ConnectorNotConnectedError() } - return this._wallet.account as unknown as AccountInterface + return this._wallet + .request({ + type: "wallet_requestAccounts", + params: { silentMode: true }, + }) + .then((accounts) => accounts[0]) } async chainId(): Promise { - if (!this._wallet || !this.wallet.account || !this._wallet.provider) { + if (!this._wallet) { throw new ConnectorNotConnectedError() } - const chainIdHex = await this._wallet.provider.getChainId() - const chainId = BigInt(chainIdHex) - return chainId + const chainIdHex = await this._wallet.request({ + type: "wallet_requestChainId", + }) + return BigInt(chainIdHex) } async initEventListener(accountChangeCb: AccountChangeEventHandler) { diff --git a/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts b/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts index 6b1984b..236f575 100644 --- a/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts +++ b/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts @@ -1,16 +1,18 @@ import type { CreateTRPCProxyClient } from "@trpc/client" import type { AccountChangeEventHandler, - ConnectedStarknetWindowObject, NetworkChangeEventHandler, - StarknetWindowObject, WalletEvents, } from "get-starknet-core" -import type { ProviderInterface } from "starknet" +import type { ProviderInterface, constants } from "starknet" import { setPopupOptions, type AppRouter } from "../helpers/trpc" import { MessageAccount } from "./account" import { ENABLE_POPUP_HEIGHT, ENABLE_POPUP_WIDTH } from "../helpers/popupSizes" +import { + BackwardsCompatibleConnectedStarknetWindowObject, + BackwardsCompatibleStarknetWindowObject, +} from "src/types/legacy" export const userEventHandlers: WalletEvents[] = [] @@ -30,9 +32,10 @@ export type LoginStatus = { isPreauthorized?: boolean } -export type WebWalletStarknetWindowObject = StarknetWindowObject & { - getLoginStatus(): Promise -} +export type WebWalletStarknetWindowObject = + BackwardsCompatibleStarknetWindowObject & { + getLoginStatus(): Promise + } export const getArgentStarknetWindowObject = ( options: GetArgentStarknetWindowObject, @@ -48,21 +51,45 @@ export const getArgentStarknetWindowObject = ( }, async request(call) { switch (call.type) { + case "wallet_requestAccounts": { + return proxyLink.requestAccounts.mutate(call.params as any) + } + + case "starknet_signTypedData": { + return proxyLink.signTypedData.mutate(call.params as any) + } + + case "wallet_getPermissions": { + return proxyLink.getPermissions.mutate() + } + + case "starknet_addInvokeTransaction": { + const hash = await proxyLink.addInvokeTransaction.mutate( + (call.params as any).calls, + ) + + return { transaction_hash: hash } + } + + case "wallet_requestChainId": { + return (await proxyLink.requestChainId.mutate()) as constants.StarknetChainId + } + case "wallet_addStarknetChain": { //TODO: add with implementation //const params = call.params as AddStarknetChainParameters - return await proxyLink.addStarknetChain.mutate() + return proxyLink.addStarknetChain.mutate(call.params as any) } case "wallet_switchStarknetChain": { //TODO: add with implementation //const params = call.params as SwitchStarknetChainParameter - return await proxyLink.switchStarknetChain.mutate() + return proxyLink.switchStarknetChain.mutate(call.params as any) } case "wallet_watchAsset": { //TODO: add with implementation //const params = call.params as WatchAssetParameters /* return remoteHandle.call("watchAsset", params) */ - return await proxyLink.watchAsset.mutate() + return proxyLink.watchAsset.mutate() } default: throw new Error("not implemented") @@ -138,19 +165,19 @@ export const getArgentStarknetWindowObject = ( } async function updateStarknetWindowObject( - windowObject: StarknetWindowObject, + windowObject: BackwardsCompatibleStarknetWindowObject, provider: ProviderInterface, proxyLink: CreateTRPCProxyClient, walletAddress: string, -): Promise { - if (windowObject.isConnected) { - return windowObject +): Promise { + if (windowObject.isConnected && windowObject.account) { + return windowObject as BackwardsCompatibleConnectedStarknetWindowObject } const chainId = await provider.getChainId() const valuesToAssign: Pick< - ConnectedStarknetWindowObject, + BackwardsCompatibleConnectedStarknetWindowObject, "isConnected" | "chainId" | "selectedAddress" | "account" | "provider" > = { isConnected: true, diff --git a/src/helpers/getWallets.ts b/src/helpers/getWallets.ts index cb417ef..213c6dd 100644 --- a/src/helpers/getWallets.ts +++ b/src/helpers/getWallets.ts @@ -4,7 +4,7 @@ import { ARGENT_X_ICON } from "../connectors/injected/constants" export const replaceArgentXIcon = async ( wallets: StarknetWindowObject[] | WalletProvider[], ) => { - wallets.find((w) => { + wallets.find((w: StarknetWindowObject | WalletProvider) => { if (w.id === "argentX") { w.icon = ARGENT_X_ICON } diff --git a/src/helpers/mapModalWallets.ts b/src/helpers/mapModalWallets.ts index 5b53336..95c39ee 100644 --- a/src/helpers/mapModalWallets.ts +++ b/src/helpers/mapModalWallets.ts @@ -1,8 +1,8 @@ -import type { StarknetWindowObject, WalletProvider } from "get-starknet-core" import { Connector } from "../connectors/connector" import { ARGENT_X_ICON } from "../connectors/injected/constants" import type { ModalWallet, StoreVersion } from "../types/modal" import { isString } from "lodash-es" +import { StarknetWindowObject, WalletProvider } from "get-starknet-core" interface SetConnectorsExpandedParams { availableConnectors: Connector[] @@ -17,9 +17,11 @@ export const mapModalWallets = ({ discoveryWallets, storeVersion, }: SetConnectorsExpandedParams): ModalWallet[] => { - const starknetMobile = window?.starknet_argentX as StarknetWindowObject & { - isInAppBrowser: boolean - } + const starknetMobile = + window?.starknet_argentX as unknown as StarknetWindowObject & { + isInAppBrowser: boolean + } + const isInAppBrowser = starknetMobile?.isInAppBrowser if (isInAppBrowser) { return [] @@ -29,12 +31,17 @@ export const mapModalWallets = ({ .map((c) => { const installed = installedWallets.find((w) => w.id === c.id) if (installed) { - const installedIcon = - installed.id === "argentX" ? ARGENT_X_ICON : installed.icon + const icon = + installed.id === "argentX" + ? { light: ARGENT_X_ICON, dark: ARGENT_X_ICON } + : isString(installed.icon) + ? { light: installed.icon, dark: installed.icon } + : installed.icon + return { name: installed.name, id: installed.id, - icon: { light: installedIcon, dark: installedIcon }, + icon, connector: c, } } diff --git a/src/helpers/mapTargetUrlToNetworkId.ts b/src/helpers/mapTargetUrlToNetworkId.ts index 0f949df..e64f2d7 100644 --- a/src/helpers/mapTargetUrlToNetworkId.ts +++ b/src/helpers/mapTargetUrlToNetworkId.ts @@ -18,7 +18,7 @@ export function mapTargetUrlToNetworkId(target: string): constants.NetworkName { return Network.SN_MAIN } if (origin.includes("dev")) { - return Network.SN_GOERLI2 + return Network.SN_GOERLI } if (origin.includes("argent.xyz")) { return Network.SN_MAIN diff --git a/src/main.ts b/src/main.ts index c7218ae..191089a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,6 @@ -import type { - ConnectedStarknetWindowObject, - DisconnectOptions, - DisconnectedStarknetWindowObject, - StarknetWindowObject, -} from "get-starknet-core" +import type { DisconnectOptions, StarknetWindowObject } from "get-starknet-core" import sn from "get-starknet-core" +import snV3 from "get-starknet-coreV3" import { getStoreVersionFromBrowser } from "./helpers/getStoreVersionFromBrowser" @@ -18,7 +14,7 @@ import { mapModalWallets } from "./helpers/mapModalWallets" import Modal from "./modal/Modal.svelte" import type { ConnectOptions, ModalResult, ModalWallet } from "./types/modal" -import { type Connector } from "./connectors" +import { ConnectorData, type Connector } from "./connectors" import css from "./theme.css?inline" let selectedConnector: Connector | null = null @@ -48,17 +44,18 @@ export const connect = async ({ const lastWalletId = localStorage.getItem("starknetLastConnectedWallet") if (modalMode === "neverAsk") { - const connector = availableConnectors.find((c) => c.id === lastWalletId) + const connector = + availableConnectors.find((c) => c.id === lastWalletId) ?? null + let connectorData: ConnectorData | null = null - if (resultType === "wallet") { - await connector?.connect() + if (connector && resultType === "wallet") { + connectorData = await connector.connect() } - selectedConnector = connector ?? null - return { connector, wallet: connector?.wallet ?? null, + connectorData, } } @@ -66,12 +63,10 @@ export const connect = async ({ // we return/display wallet options once per first-dapp (ever) connect if (modalMode === "canAsk" && lastWalletId) { - const preAuthorizedWallets = await sn.getPreAuthorizedWallets({ - ...restOptions, - }) + const authorizedWallets = await sn.getAuthorizedWallets(restOptions) const wallet = - preAuthorizedWallets.find((w) => w.id === lastWalletId) ?? + authorizedWallets.find((w) => w.id === lastWalletId) ?? installedWallets.length === 1 ? installedWallets[0] : undefined @@ -79,8 +74,10 @@ export const connect = async ({ if (wallet) { const connector = availableConnectors.find((c) => c.id === lastWalletId) + let connectorData: ConnectorData | null = null + if (resultType === "wallet") { - await connector?.connect() + connectorData = (await connector?.connect()) ?? null } if (connector) { @@ -88,7 +85,8 @@ export const connect = async ({ } return { - connector, + connector: selectedConnector, + connectorData, wallet: connector?.wallet ?? null, } } // otherwise fallback to modal @@ -97,7 +95,7 @@ export const connect = async ({ const modalWallets: ModalWallet[] = mapModalWallets({ availableConnectors, installedWallets, - discoveryWallets: await sn.getDiscoveryWallets(restOptions), + discoveryWallets: await snV3.getDiscoveryWallets(restOptions), storeVersion, }) @@ -133,21 +131,23 @@ export const connect = async ({ callback: async (connector: Connector | null) => { try { selectedConnector = connector + const connectorData = (await connector?.connect()) ?? null if (resultType === "wallet") { - await connector?.connect() - if (connector !== null && connector.id !== "argentWebWallet") { setStarknetLastConnectedWallet(connector.id) } resolve({ connector, + connectorData, wallet: connector?.wallet ?? null, }) } else { resolve({ connector, + wallet: null, + connectorData, }) } } catch (error) { @@ -174,16 +174,15 @@ export const disconnect = async (options: DisconnectOptions = {}) => { } selectedConnector = null - return sn.disconnect(options) + return snV3.disconnect(options) } export type { - ConnectedStarknetWindowObject, Connector, DisconnectOptions, - DisconnectedStarknetWindowObject, StarknetWindowObject, defaultConnectors as starknetkitDefaultConnectors, + ModalResult, } export { useStarknetkitConnectModal } from "./hooks/useStarknetkitConnectModal" diff --git a/src/modal/Modal.svelte b/src/modal/Modal.svelte index a58569a..663ce78 100644 --- a/src/modal/Modal.svelte +++ b/src/modal/Modal.svelte @@ -15,7 +15,7 @@ let loadingItem: string | false = false - let starknetMobile = window?.starknet_argentX as StarknetWindowObject & { + let starknetMobile = window?.starknet_argentX as unknown as StarknetWindowObject & { isInAppBrowser: boolean } let isInAppBrowser = starknetMobile?.isInAppBrowser diff --git a/src/types/legacy.ts b/src/types/legacy.ts new file mode 100644 index 0000000..fdc38b3 --- /dev/null +++ b/src/types/legacy.ts @@ -0,0 +1,16 @@ +import { StarknetWindowObject } from "get-starknet-core" +import { + IStarknetWindowObject as IStarknetWindowObjectV3, + ConnectedStarknetWindowObject as ConnectedStarknetWindowObjectV3, +} from "get-starknet-coreV3" + +type CommonOmittedProperties = "on" | "off" | "request" | "icon" + +export type BackwardsCompatibleStarknetWindowObject = StarknetWindowObject & + Omit & { + isConnected?: boolean + } + +export type BackwardsCompatibleConnectedStarknetWindowObject = + StarknetWindowObject & + Omit diff --git a/src/types/modal.ts b/src/types/modal.ts index e703bc8..175e083 100644 --- a/src/types/modal.ts +++ b/src/types/modal.ts @@ -1,5 +1,9 @@ import type { GetWalletOptions, StarknetWindowObject } from "get-starknet-core" -import type { Connector, ConnectorIcons } from "../connectors/connector" +import type { + Connector, + ConnectorData, + ConnectorIcons, +} from "../connectors/connector" import type { ArgentMobileConnectorOptions } from "../connectors/argentMobile" import { ProviderInterface } from "starknet" @@ -28,6 +32,7 @@ export type ModalWallet = { } export type ModalResult = { - connector: Connector + connector: Connector | null + connectorData: ConnectorData | null wallet?: StarknetWindowObject | null } diff --git a/src/types/window.ts b/src/types/window.ts index 76b5ad6..4740315 100644 --- a/src/types/window.ts +++ b/src/types/window.ts @@ -163,3 +163,17 @@ export type WebWalletMethods = ConnectMethods & ModalMethods export type IframeMethods = { connect: () => void } + +export const RpcCallSchema = z + .object({ + contract_address: z.string(), + entrypoint: z.string(), + calldata: z.array(bignumberishSchema).optional(), + }) + .transform(({ contract_address, entrypoint, calldata }) => ({ + contractAddress: contract_address, + entrypoint, + calldata: calldata || [], + })) + +export const RpcCallsArraySchema = z.array(RpcCallSchema).nonempty() diff --git a/tsconfig.json b/tsconfig.json index b458ac4..df09da3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,14 @@ { "extends": "@tsconfig/svelte/tsconfig.json", "compilerOptions": { - "target": "ES2020", + "target": "ESNext", "lib": ["DOM", "ESNext"], "useDefineForClassFields": true, "module": "ESNext", "moduleResolution": "bundler", "resolveJsonModule": true, "baseUrl": ".", + "strict": true, /** * Typecheck JS in `.svelte` and `.js` files by default. * Disable checkJs if you'd like to use dynamic types in JS. From 238331c3ae0251d87c2bbdca761de9bb12e59be2 Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Fri, 9 Feb 2024 14:05:56 +0000 Subject: [PATCH 02/11] fix: update injected connector --- src/connectors/injected/index.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/connectors/injected/index.ts b/src/connectors/injected/index.ts index 6be0a47..4a685f6 100644 --- a/src/connectors/injected/index.ts +++ b/src/connectors/injected/index.ts @@ -1,5 +1,5 @@ import { Permission, StarknetWindowObject } from "get-starknet-core" -import { ProviderInterface, constants } from "starknet" +import { constants } from "starknet" import { ConnectorNotConnectedError, ConnectorNotFoundError, @@ -24,8 +24,6 @@ export interface InjectedConnectorOptions { name?: string /** Wallet icons. */ icon?: ConnectorIcons - /** Provider */ - provider?: ProviderInterface } export class InjectedConnector extends Connector { @@ -161,10 +159,6 @@ export class InjectedConnector extends Connector { if (!this.available()) { throw new ConnectorNotFoundError() } - - // if (!this._wallet?.isConnected) { - // throw new UserNotConnectedError() - // } } async account(): Promise { @@ -221,18 +215,10 @@ export class InjectedConnector extends Connector { return this._wallet } - // TODO: UPDATE THIS private ensureWallet() { const installed = getAvailableWallets(globalThis) const wallet = installed.filter((w) => w.id === this._options.id)[0] if (wallet) { - const { provider } = this._options - if (provider) { - Object.assign(wallet, { - provider, - }) - } - this._wallet = wallet } } @@ -261,12 +247,8 @@ function isWalletObject(wallet: any): boolean { return ( wallet && [ - // wallet's must have methods/members, see IStarknetWindowObject + // wallet's must have methods/members, see StarknetWindowObject "request", - "isConnected", - "provider", - "enable", - "isPreauthorized", "on", "off", "version", From a7e7b6f22aaf22fa51b395500d5f2b7b58fccb49 Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Fri, 9 Feb 2024 14:07:09 +0000 Subject: [PATCH 03/11] fix: remove providers --- src/helpers/defaultConnectors.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/helpers/defaultConnectors.ts b/src/helpers/defaultConnectors.ts index db5cc2f..73ac41f 100644 --- a/src/helpers/defaultConnectors.ts +++ b/src/helpers/defaultConnectors.ts @@ -10,7 +10,6 @@ import { WebWalletConnector } from "../connectors/webwallet" export const defaultConnectors = ({ argentMobileOptions, webWalletUrl, - provider, }: { argentMobileOptions?: ArgentMobileConnectorOptions webWalletUrl?: string @@ -25,19 +24,15 @@ export const defaultConnectors = ({ if (!isSafari) { defaultConnectors.push( - new InjectedConnector({ options: { id: "argentX", provider } }), + new InjectedConnector({ options: { id: "argentX" } }), ) defaultConnectors.push( - new InjectedConnector({ options: { id: "braavos", provider } }), + new InjectedConnector({ options: { id: "braavos" } }), ) } - defaultConnectors.push( - new ArgentMobileConnector({ ...argentMobileOptions, provider }), - ) - defaultConnectors.push( - new WebWalletConnector({ url: webWalletUrl, provider }), - ) + defaultConnectors.push(new ArgentMobileConnector(argentMobileOptions)) + defaultConnectors.push(new WebWalletConnector({ url: webWalletUrl })) return defaultConnectors } From e54de443a8ab873e5be8faa02a33f8f9df1fff41 Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Fri, 9 Feb 2024 14:07:46 +0000 Subject: [PATCH 04/11] fix: update connector interface --- src/connectors/connector.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connectors/connector.ts b/src/connectors/connector.ts index e44b4d7..7660b2e 100644 --- a/src/connectors/connector.ts +++ b/src/connectors/connector.ts @@ -43,8 +43,8 @@ export abstract class Connector extends EventEmitter { abstract connect(): Promise /** Disconnect wallet. */ abstract disconnect(): Promise - /** Get current account. */ - abstract account(): Promise + /** Get current account silently. Return null if the account is not authorized */ + abstract account(): Promise /** Get current chain id. */ abstract chainId(): Promise /** Connector StarknetWindowObject */ From f4007bcf43b2a201a9fef18b5914e383749b66a4 Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Fri, 9 Feb 2024 14:14:36 +0000 Subject: [PATCH 05/11] fix: update webwallet connector --- src/connectors/webwallet/index.ts | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/connectors/webwallet/index.ts b/src/connectors/webwallet/index.ts index e8ca927..4f28899 100644 --- a/src/connectors/webwallet/index.ts +++ b/src/connectors/webwallet/index.ts @@ -3,7 +3,6 @@ import { type AccountChangeEventHandler, Permission, } from "get-starknet-core" -import { type ProviderInterface } from "starknet" import { Connector, type ConnectorData, @@ -24,7 +23,6 @@ let _wallet: StarknetWindowObject | null = null interface WebWalletConnectorOptions { url?: string - provider?: ProviderInterface } export class WebWalletConnector extends Connector { @@ -114,27 +112,24 @@ export class WebWalletConnector extends Connector { throw new ConnectorNotFoundError() } - // if (!this._wallet?.isConnected) { - // throw new UserNotConnectedError() - // } _wallet = null this._wallet = _wallet removeStarknetLastConnectedWallet() } - async account(): Promise { + async account(): Promise { this._wallet = _wallet if (!this._wallet) { throw new ConnectorNotConnectedError() } - return this._wallet - .request({ - type: "wallet_requestAccounts", - params: { silentMode: true }, - }) - .then((accounts) => accounts[0]) + const [account] = await this._wallet.request({ + type: "wallet_requestAccounts", + params: { silentMode: true }, + }) + + return account ?? null } async chainId(): Promise { @@ -171,16 +166,11 @@ export class WebWalletConnector extends Connector { private async ensureWallet(): Promise { const origin = this._options.url || DEFAULT_WEBWALLET_URL - const provider = this._options.provider setPopupOptions({ origin, location: "/interstitialLogin", }) - const wallet = await getWebWalletStarknetObject( - origin, - trpcProxyClient({}), - provider, - ) + const wallet = await getWebWalletStarknetObject(origin, trpcProxyClient({})) _wallet = wallet ?? null this._wallet = _wallet From f4f2dc2ce1bc0f50129aa877ca54c47142169fe8 Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Mon, 12 Feb 2024 08:43:29 +0000 Subject: [PATCH 06/11] feat: update mobile connector --- src/connectors/argentMobile/index.ts | 46 +++++++++++-------- src/connectors/argentMobile/modal/login.ts | 7 ++- .../argentMobile/modal/starknet/adapter.ts | 17 +++---- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/src/connectors/argentMobile/index.ts b/src/connectors/argentMobile/index.ts index 50fb6f7..91ae090 100644 --- a/src/connectors/argentMobile/index.ts +++ b/src/connectors/argentMobile/index.ts @@ -1,14 +1,14 @@ -import type { - AccountChangeEventHandler, - StarknetWindowObject, +import { + Permission, + type AccountChangeEventHandler, + type StarknetWindowObject, } from "get-starknet-core" -import type { AccountInterface, ProviderInterface } from "starknet" +import type { ProviderInterface } from "starknet" import { constants } from "starknet" import { DEFAULT_ARGENT_MOBILE_ICON, DEFAULT_PROJECT_ID } from "./constants" import { ConnectorNotConnectedError, ConnectorNotFoundError, - UserNotConnectedError, UserRejectedRequestError, } from "../../errors" import { resetWalletConnect } from "../../helpers/resetWalletConnect" @@ -53,7 +53,11 @@ export class ArgentMobileConnector extends Connector { return false } - return this._wallet.isPreauthorized() + const permissions = await this._wallet.request({ + type: "wallet_getPermissions", + }) + + return permissions.includes(Permission.Accounts) } get id(): string { @@ -85,12 +89,14 @@ export class ArgentMobileConnector extends Connector { throw new ConnectorNotFoundError() } - const account = this._wallet.account as unknown as AccountInterface + const accounts = await this._wallet.request({ + type: "wallet_requestAccounts", + }) const chainId = await this.chainId() return { - account: account.address, + account: accounts[0], chainId, } } @@ -104,29 +110,31 @@ export class ArgentMobileConnector extends Connector { throw new ConnectorNotFoundError() } - if (!this._wallet?.isConnected) { - throw new UserNotConnectedError() - } - this._wallet = null } - async account(): Promise { - if (!this._wallet || !this._wallet.account) { + async account(): Promise { + if (!this._wallet) { throw new ConnectorNotConnectedError() } - return this._wallet.account as AccountInterface + const [account] = await this._wallet.request({ + type: "wallet_requestAccounts", + params: { silentMode: true }, + }) + + return account ?? null } async chainId(): Promise { - if (!this._wallet || !this.wallet.account || !this._wallet.provider) { + if (!this._wallet) { throw new ConnectorNotConnectedError() } - const chainIdHex = await this._wallet.provider.getChainId() - const chainId = BigInt(chainIdHex) - return chainId + const chainIdHex = await this._wallet.request({ + type: "wallet_requestChainId", + }) + return BigInt(chainIdHex) } // needed, methods required by starknet-react. Otherwise an exception is throwd diff --git a/src/connectors/argentMobile/modal/login.ts b/src/connectors/argentMobile/modal/login.ts index 1aefd7c..7649177 100644 --- a/src/connectors/argentMobile/modal/login.ts +++ b/src/connectors/argentMobile/modal/login.ts @@ -1,7 +1,7 @@ import SignClient from "@walletconnect/sign-client" import type { SignClientTypes } from "@walletconnect/types" -import { ProviderInterface, constants } from "starknet" +import { ProviderInterface, RpcProvider, constants } from "starknet" // Using NetworkName as a value. const Network: typeof constants.NetworkName = constants.NetworkName @@ -65,6 +65,11 @@ export const login = async ( } const client = await SignClient.init(signClientOptions) + + if (!provider) { + provider = new RpcProvider({ nodeUrl: rpcUrl }) + } + const adapter = new Adapter({ client, chainId, rpcUrl, provider }) client.on("session_event", (_) => { diff --git a/src/connectors/argentMobile/modal/starknet/adapter.ts b/src/connectors/argentMobile/modal/starknet/adapter.ts index 66709de..8ea8d24 100644 --- a/src/connectors/argentMobile/modal/starknet/adapter.ts +++ b/src/connectors/argentMobile/modal/starknet/adapter.ts @@ -2,10 +2,6 @@ import { JsonRpcProvider } from "@walletconnect/jsonrpc-provider" import type SignClient from "@walletconnect/sign-client" import type { SignerConnection } from "@walletconnect/signer-connection" import type { SessionTypes } from "@walletconnect/types" -import type { - ConnectedStarknetWindowObject, - RpcMessage, -} from "get-starknet-core" import type { AccountInterface, ProviderInterface, @@ -19,6 +15,7 @@ import { StarknetRemoteAccount } from "./account" import { StarknetRemoteSigner } from "./signer" import type { IStarknetRpc } from "./starknet.model" import { argentModal } from "../argentModal" +import { RequestFn, StarknetWindowObject } from "get-starknet-core" export interface EthereumRpcConfig { chains: string[] @@ -34,7 +31,7 @@ export const deserializeStarknetChainId = (chainId: string): string => export class StarknetAdapter extends NamespaceAdapter - implements ConnectedStarknetWindowObject + implements StarknetWindowObject { id = "argentMobile" name = "Argent Mobile" @@ -106,12 +103,10 @@ export class StarknetAdapter // StarknetWindowObject - async request( - _call: Omit, - ): Promise { + request: RequestFn = async (call) => { // request() is mostly used for messages like `wallet_watchAsset` etc. // regular transactions calls are done through .account.execute - throw new Error("Not implemented: .request()") + throw new Error(`Not implemented: .request() for ${call.type}`) } async enable(): Promise { @@ -131,11 +126,11 @@ export class StarknetAdapter return Boolean(this.client.session.getAll().find(this.isValidSession)) } - on: ConnectedStarknetWindowObject["on"] = (event, handleEvent) => { + on: StarknetWindowObject["on"] = (event, handleEvent) => { this.eventEmitter.on(event, handleEvent) } - off: ConnectedStarknetWindowObject["off"] = (event, handleEvent) => { + off: StarknetWindowObject["off"] = (event, handleEvent) => { this.eventEmitter.off(event, handleEvent) } From 9dfe4bef3a07cbcba50d8edb3cd75406b3b2c48d Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Mon, 12 Feb 2024 14:20:17 +0000 Subject: [PATCH 07/11] chore: update connectors --- src/connectors/argentMobile/index.ts | 7 ++-- src/connectors/connector.ts | 6 +-- src/connectors/injected/index.ts | 56 +++++++++++----------------- src/connectors/webwallet/index.ts | 11 ++++-- src/main.ts | 2 + 5 files changed, 37 insertions(+), 45 deletions(-) diff --git a/src/connectors/argentMobile/index.ts b/src/connectors/argentMobile/index.ts index 91ae090..f390abf 100644 --- a/src/connectors/argentMobile/index.ts +++ b/src/connectors/argentMobile/index.ts @@ -2,6 +2,7 @@ import { Permission, type AccountChangeEventHandler, type StarknetWindowObject, + StarknetChainId, } from "get-starknet-core" import type { ProviderInterface } from "starknet" import { constants } from "starknet" @@ -91,6 +92,7 @@ export class ArgentMobileConnector extends Connector { const accounts = await this._wallet.request({ type: "wallet_requestAccounts", + params: { silentMode: false }, // explicit to show the modal }) const chainId = await this.chainId() @@ -126,15 +128,14 @@ export class ArgentMobileConnector extends Connector { return account ?? null } - async chainId(): Promise { + async chainId(): Promise { if (!this._wallet) { throw new ConnectorNotConnectedError() } - const chainIdHex = await this._wallet.request({ + return this._wallet.request({ type: "wallet_requestChainId", }) - return BigInt(chainIdHex) } // needed, methods required by starknet-react. Otherwise an exception is throwd diff --git a/src/connectors/connector.ts b/src/connectors/connector.ts index 7660b2e..f8dfea2 100644 --- a/src/connectors/connector.ts +++ b/src/connectors/connector.ts @@ -1,5 +1,5 @@ import EventEmitter from "eventemitter3" -import { StarknetWindowObject } from "get-starknet-core" +import { StarknetWindowObject, StarknetChainId } from "get-starknet-core" /** Connector icons, as base64 encoded svg. */ export type ConnectorIcons = { @@ -14,7 +14,7 @@ export type ConnectorData = { /** Connector account. */ account?: string /** Connector network. */ - chainId?: bigint + chainId?: StarknetChainId } /** Connector events. */ @@ -46,7 +46,7 @@ export abstract class Connector extends EventEmitter { /** Get current account silently. Return null if the account is not authorized */ abstract account(): Promise /** Get current chain id. */ - abstract chainId(): Promise + abstract chainId(): Promise /** Connector StarknetWindowObject */ abstract get wallet(): StarknetWindowObject } diff --git a/src/connectors/injected/index.ts b/src/connectors/injected/index.ts index 4a685f6..8597513 100644 --- a/src/connectors/injected/index.ts +++ b/src/connectors/injected/index.ts @@ -1,4 +1,8 @@ -import { Permission, StarknetWindowObject } from "get-starknet-core" +import { + Permission, + StarknetChainId, + StarknetWindowObject, +} from "get-starknet-core" import { constants } from "starknet" import { ConnectorNotConnectedError, @@ -56,53 +60,38 @@ export class InjectedConnector extends Connector { return permissions.includes(Permission.Accounts) } - async chainId(): Promise { + async chainId(): Promise { this.ensureWallet() if (!this._wallet) { throw new ConnectorNotConnectedError() } - const chainIdHex = await this._wallet.request({ + return this._wallet.request({ type: "wallet_requestChainId", }) - - return BigInt(chainIdHex) } private async onAccountsChanged(accounts?: string[]): Promise { if (!accounts) { return void this.emit("disconnect") } - const account = accounts[0] const chainId = await this.chainId() this.emit("change", { account, chainId }) } - private onNetworkChanged(network?: string): void { - switch (network) { - // Argent - case "SN_MAIN": - this.emit("change", { - chainId: BigInt(constants.StarknetChainId.SN_MAIN), - }) - break - case "SN_GOERLI": - this.emit("change", { - chainId: BigInt(constants.StarknetChainId.SN_GOERLI), - }) - break - // Braavos - case "mainnet-alpha": - this.emit("change", { - chainId: BigInt(constants.StarknetChainId.SN_MAIN), - }) - break - case "goerli-alpha": - this.emit("change", { - chainId: BigInt(constants.StarknetChainId.SN_GOERLI), - }) + private onNetworkChanged( + chainId?: StarknetChainId, + accounts?: string[], + ): void { + const { SN_GOERLI, SN_MAIN } = constants.StarknetChainId + const account = accounts?.[0] + switch (chainId) { + // TODO: add sepolia + case SN_MAIN: + case SN_GOERLI: + this.emit("change", { chainId, account }) break default: this.emit("change", {}) @@ -121,6 +110,7 @@ export class InjectedConnector extends Connector { try { accounts = await this._wallet.request({ type: "wallet_requestAccounts", + params: { silentMode: false }, // explicit to show the modal }) } catch { // NOTE: Argent v3.0.0 swallows the `.enable` call on reject, so this won't get hit. @@ -132,13 +122,9 @@ export class InjectedConnector extends Connector { throw new UserRejectedRequestError() } - this._wallet.on("accountsChanged", async (accounts?: string[]) => { - await this.onAccountsChanged(accounts) - }) + this._wallet.on("accountsChanged", this.onAccountsChanged.bind(this)) - this._wallet.on("networkChanged", (network?: string) => { - this.onNetworkChanged(network) - }) + this._wallet.on("networkChanged", this.onNetworkChanged.bind(this)) await this.onAccountsChanged(accounts) diff --git a/src/connectors/webwallet/index.ts b/src/connectors/webwallet/index.ts index 4f28899..479d6ac 100644 --- a/src/connectors/webwallet/index.ts +++ b/src/connectors/webwallet/index.ts @@ -2,6 +2,7 @@ import { type StarknetWindowObject, type AccountChangeEventHandler, Permission, + StarknetChainId, } from "get-starknet-core" import { Connector, @@ -94,7 +95,10 @@ export class WebWalletConnector extends Connector { let accounts: string[] try { - accounts = await this._wallet.request({ type: "wallet_requestAccounts" }) + accounts = await this._wallet.request({ + type: "wallet_requestAccounts", + params: { silentMode: false }, // explicit to show the modal + }) } catch { throw new UserRejectedRequestError() } @@ -132,15 +136,14 @@ export class WebWalletConnector extends Connector { return account ?? null } - async chainId(): Promise { + async chainId(): Promise { if (!this._wallet) { throw new ConnectorNotConnectedError() } - const chainIdHex = await this._wallet.request({ + return this._wallet.request({ type: "wallet_requestChainId", }) - return BigInt(chainIdHex) } async initEventListener(accountChangeCb: AccountChangeEventHandler) { diff --git a/src/main.ts b/src/main.ts index 191089a..95c8f26 100644 --- a/src/main.ts +++ b/src/main.ts @@ -185,4 +185,6 @@ export type { ModalResult, } +export type * from "./types/legacy" + export { useStarknetkitConnectModal } from "./hooks/useStarknetkitConnectModal" From 116d40918ea3860688dca6327e0e808395c7fa67 Mon Sep 17 00:00:00 2001 From: Dhruv Kelawala Date: Mon, 12 Feb 2024 14:49:47 +0000 Subject: [PATCH 08/11] chore: remove providers from more places --- src/connectors/argentMobile/index.ts | 15 +--- src/connectors/argentMobile/modal/login.ts | 7 +- .../argentStarknetWindowObject.ts | 81 ++----------------- .../getWebWalletStarknetObject.ts | 8 -- src/helpers/defaultConnectors.ts | 2 - src/main.ts | 2 - src/types/modal.ts | 2 - 7 files changed, 10 insertions(+), 107 deletions(-) diff --git a/src/connectors/argentMobile/index.ts b/src/connectors/argentMobile/index.ts index f390abf..bc942b5 100644 --- a/src/connectors/argentMobile/index.ts +++ b/src/connectors/argentMobile/index.ts @@ -4,7 +4,6 @@ import { type StarknetWindowObject, StarknetChainId, } from "get-starknet-core" -import type { ProviderInterface } from "starknet" import { constants } from "starknet" import { DEFAULT_ARGENT_MOBILE_ICON, DEFAULT_PROJECT_ID } from "./constants" import { @@ -29,7 +28,6 @@ export interface ArgentMobileConnectorOptions { description?: string url?: string icons?: string[] - provider?: ProviderInterface rpcUrl?: string } @@ -160,16 +158,8 @@ export class ArgentMobileConnector extends Connector { private async ensureWallet(): Promise { const { getStarknetWindowObject } = await import("./modal") - const { - chainId, - projectId, - dappName, - description, - url, - icons, - provider, - rpcUrl, - } = this._options + const { chainId, projectId, dappName, description, url, icons, rpcUrl } = + this._options const publicRPCNode = getRandomPublicRPCNode() const providerRpcUrl = @@ -185,7 +175,6 @@ export class ArgentMobileConnector extends Connector { description, url, icons, - provider, rpcUrl: providerRpcUrl, } diff --git a/src/connectors/argentMobile/modal/login.ts b/src/connectors/argentMobile/modal/login.ts index 7649177..9a7bcdd 100644 --- a/src/connectors/argentMobile/modal/login.ts +++ b/src/connectors/argentMobile/modal/login.ts @@ -22,7 +22,6 @@ export interface IArgentLoginOptions { mobileUrl?: string modalType?: "overlay" | "window" walletConnect?: SignClientTypes.Options - provider?: ProviderInterface } export const login = async ( @@ -38,7 +37,6 @@ export const login = async ( url, icons, walletConnect, - provider, }: IArgentLoginOptions, Adapter: new (options: NamespaceAdapterOptions) => TAdapter, ): Promise => { @@ -66,9 +64,8 @@ export const login = async ( const client = await SignClient.init(signClientOptions) - if (!provider) { - provider = new RpcProvider({ nodeUrl: rpcUrl }) - } + // TODO: remove provider and use rpcUrl directly + const provider = new RpcProvider({ nodeUrl: rpcUrl }) const adapter = new Adapter({ client, chainId, rpcUrl, provider }) diff --git a/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts b/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts index 236f575..c3898d1 100644 --- a/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts +++ b/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts @@ -2,17 +2,12 @@ import type { CreateTRPCProxyClient } from "@trpc/client" import type { AccountChangeEventHandler, NetworkChangeEventHandler, + StarknetWindowObject, WalletEvents, } from "get-starknet-core" -import type { ProviderInterface, constants } from "starknet" +import type { constants } from "starknet" -import { setPopupOptions, type AppRouter } from "../helpers/trpc" -import { MessageAccount } from "./account" -import { ENABLE_POPUP_HEIGHT, ENABLE_POPUP_WIDTH } from "../helpers/popupSizes" -import { - BackwardsCompatibleConnectedStarknetWindowObject, - BackwardsCompatibleStarknetWindowObject, -} from "src/types/legacy" +import { type AppRouter } from "../helpers/trpc" export const userEventHandlers: WalletEvents[] = [] @@ -32,20 +27,16 @@ export type LoginStatus = { isPreauthorized?: boolean } -export type WebWalletStarknetWindowObject = - BackwardsCompatibleStarknetWindowObject & { - getLoginStatus(): Promise - } +export type WebWalletStarknetWindowObject = StarknetWindowObject & { + getLoginStatus(): Promise +} export const getArgentStarknetWindowObject = ( options: GetArgentStarknetWindowObject, - provider: ProviderInterface, proxyLink: CreateTRPCProxyClient, ): WebWalletStarknetWindowObject => { const wallet: WebWalletStarknetWindowObject = { ...options, - isConnected: false, - provider, getLoginStatus: () => { return proxyLink.getLoginStatus.mutate() }, @@ -95,40 +86,6 @@ export const getArgentStarknetWindowObject = ( throw new Error("not implemented") } }, - async enable(ops) { - if (ops?.starknetVersion !== "v4") { - throw Error("not implemented") - } - - try { - setPopupOptions({ - width: ENABLE_POPUP_WIDTH, - height: ENABLE_POPUP_HEIGHT, - location: "/interstitialLogin", - }) - const enablePromise = proxyLink.enable.mutate() - const selectedAddress: string = await enablePromise - - await updateStarknetWindowObject( - wallet, - provider, - proxyLink, - selectedAddress, - ) - - return [selectedAddress] - } catch (error) { - if (error instanceof Error) { - throw new Error(error.message) - } - throw new Error("Unknow error on enable wallet") - } - }, - async isPreauthorized() { - const { isLoggedIn, isPreauthorized } = - await proxyLink.getLoginStatus.mutate() - return Boolean(isLoggedIn && isPreauthorized) - }, on: (event, handleEvent) => { if (event === "accountsChanged") { userEventHandlers.push({ @@ -163,29 +120,3 @@ export const getArgentStarknetWindowObject = ( // TODO: handle network and account changes return wallet } - -async function updateStarknetWindowObject( - windowObject: BackwardsCompatibleStarknetWindowObject, - provider: ProviderInterface, - proxyLink: CreateTRPCProxyClient, - walletAddress: string, -): Promise { - if (windowObject.isConnected && windowObject.account) { - return windowObject as BackwardsCompatibleConnectedStarknetWindowObject - } - - const chainId = await provider.getChainId() - - const valuesToAssign: Pick< - BackwardsCompatibleConnectedStarknetWindowObject, - "isConnected" | "chainId" | "selectedAddress" | "account" | "provider" - > = { - isConnected: true, - chainId, - selectedAddress: walletAddress, - account: new MessageAccount(provider, walletAddress, proxyLink), - provider, - } - - return Object.assign(windowObject, valuesToAssign) -} diff --git a/src/connectors/webwallet/starknetWindowObject/getWebWalletStarknetObject.ts b/src/connectors/webwallet/starknetWindowObject/getWebWalletStarknetObject.ts index 90dd22e..85beac5 100644 --- a/src/connectors/webwallet/starknetWindowObject/getWebWalletStarknetObject.ts +++ b/src/connectors/webwallet/starknetWindowObject/getWebWalletStarknetObject.ts @@ -1,7 +1,4 @@ import type { CreateTRPCProxyClient } from "@trpc/client" -import { ProviderInterface, RpcProvider } from "starknet" - -import { mapTargetUrlToNodeUrl } from "../helpers/mapTargetUrlToNodeUrl" import type { AppRouter } from "../helpers/trpc" import type { WebWalletStarknetWindowObject } from "./argentStarknetWindowObject" import { getArgentStarknetWindowObject } from "./argentStarknetWindowObject" @@ -9,15 +6,11 @@ import { getArgentStarknetWindowObject } from "./argentStarknetWindowObject" export const getWebWalletStarknetObject = async ( target: string, proxyLink: CreateTRPCProxyClient, - provider?: ProviderInterface, ): Promise => { const globalWindow = typeof window !== "undefined" ? window : undefined if (!globalWindow) { throw new Error("window is not defined") } - - const nodeUrl = mapTargetUrlToNodeUrl(target) - const defaultProvider = provider ?? new RpcProvider({ nodeUrl }) const starknetWindowObject = getArgentStarknetWindowObject( { host: globalWindow.location.origin, @@ -26,7 +19,6 @@ export const getWebWalletStarknetObject = async ( name: "Argent Web Wallet", version: "1.0.0", }, - defaultProvider, proxyLink, ) diff --git a/src/helpers/defaultConnectors.ts b/src/helpers/defaultConnectors.ts index 73ac41f..e468e3b 100644 --- a/src/helpers/defaultConnectors.ts +++ b/src/helpers/defaultConnectors.ts @@ -1,4 +1,3 @@ -import { ProviderInterface } from "starknet" import { type Connector } from "../connectors" import { ArgentMobileConnector, @@ -13,7 +12,6 @@ export const defaultConnectors = ({ }: { argentMobileOptions?: ArgentMobileConnectorOptions webWalletUrl?: string - provider?: ProviderInterface }): Connector[] => { const isSafari = typeof window !== "undefined" diff --git a/src/main.ts b/src/main.ts index 95c8f26..4fdf47f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,7 +28,6 @@ export const connect = async ({ argentMobileOptions, connectors = [], resultType = "wallet", - provider, ...restOptions }: ConnectOptions = {}): Promise => { // force null in case it was disconnected from mobile app @@ -38,7 +37,6 @@ export const connect = async ({ ? defaultConnectors({ argentMobileOptions, webWalletUrl, - provider, }) : connectors diff --git a/src/types/modal.ts b/src/types/modal.ts index 175e083..730b2fa 100644 --- a/src/types/modal.ts +++ b/src/types/modal.ts @@ -5,7 +5,6 @@ import type { ConnectorIcons, } from "../connectors/connector" import type { ArgentMobileConnectorOptions } from "../connectors/argentMobile" -import { ProviderInterface } from "starknet" export type StoreVersion = "chrome" | "firefox" | "edge" @@ -18,7 +17,6 @@ export interface ConnectOptions extends GetWalletOptions { storeVersion?: StoreVersion | null webWalletUrl?: string resultType?: "connector" | "wallet" - provider?: ProviderInterface } export type ModalWallet = { From 15e66dcf49eaa50f0eea6e34866e9eef4d98c90c Mon Sep 17 00:00:00 2001 From: bluecco Date: Wed, 28 Feb 2024 15:22:19 +0100 Subject: [PATCH 09/11] fix: argent mobile connector to work with new json rpc api --- package.json | 4 +- pnpm-lock.yaml | 13 +++- .../argentMobile/modal/starknet/adapter.ts | 65 +++++++++++++++++-- 3 files changed, 74 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 26908bf..66b0a97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starknetkit", - "version": "2.0.0", + "version": "1.1.3", "repository": "github:argentlabs/starknetkit", "private": false, "browser": { @@ -62,7 +62,7 @@ "detect-browser": "^5.3.0", "eventemitter3": "^5.0.1", "events": "^3.3.0", - "get-starknet-core": "4.0.0", + "get-starknet-core": "4.0.0-next.2", "get-starknet-coreV3": "npm:get-starknet-core@3.2.0", "lodash-es": "^4.17.21", "svelte-forms": "^2.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74c60c7..6056a21 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' settings: autoInstallPeers: true @@ -26,6 +26,9 @@ dependencies: events: specifier: ^3.3.0 version: 3.3.0 + get-starknet-core: + specifier: 4.0.0-next.2 + version: 4.0.0-next.2 get-starknet-coreV3: specifier: npm:get-starknet-core@3.2.0 version: /get-starknet-core@3.2.0(starknet@5.24.3) @@ -1166,6 +1169,7 @@ packages: dependencies: is-glob: 4.0.3 micromatch: 4.0.5 + napi-wasm: 1.1.0 bundledDependencies: - napi-wasm @@ -3927,6 +3931,10 @@ packages: starknet: 5.24.3 dev: false + /get-starknet-core@4.0.0-next.2: + resolution: {integrity: sha512-1p7bJbmTxUMiybdLB/nPHsdIBviIUBBzuOljN7yWnrYsCaH4AVjQ32OGEgqDn+oV8hJIKIjmArexBT2OYzP9dA==} + dev: false + /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -5287,6 +5295,9 @@ packages: hasBin: true dev: true + /napi-wasm@1.1.0: + resolution: {integrity: sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==} + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true diff --git a/src/connectors/argentMobile/modal/starknet/adapter.ts b/src/connectors/argentMobile/modal/starknet/adapter.ts index 8ea8d24..8f16957 100644 --- a/src/connectors/argentMobile/modal/starknet/adapter.ts +++ b/src/connectors/argentMobile/modal/starknet/adapter.ts @@ -9,13 +9,18 @@ import type { } from "starknet" import { RpcProvider, constants } from "starknet" +import { + AddInvokeTransactionParameters, + RequestFn, + StarknetWindowObject, + TypedData, +} from "get-starknet-core" import type { NamespaceAdapterOptions } from "../adapter" import { NamespaceAdapter } from "../adapter" +import { argentModal } from "../argentModal" import { StarknetRemoteAccount } from "./account" import { StarknetRemoteSigner } from "./signer" import type { IStarknetRpc } from "./starknet.model" -import { argentModal } from "../argentModal" -import { RequestFn, StarknetWindowObject } from "get-starknet-core" export interface EthereumRpcConfig { chains: string[] @@ -102,10 +107,60 @@ export class StarknetAdapter } // StarknetWindowObject + request: RequestFn = async (call): Promise => { + if (!this.session) { + throw new Error("No session") + } + + if (call.type === "wallet_requestChainId") { + return this.chainId === constants.NetworkName.SN_GOERLI + ? constants.StarknetChainId.SN_GOERLI + : constants.StarknetChainId.SN_MAIN + } + + if (call.type === "wallet_requestAccounts") { + return this.accounts + } + + if (call.type === "wallet_getPermissions") { + if (await this.isPreauthorized()) { + return ["accounts"] + } + + return [] + } + + if (call.type === "starknet_addInvokeTransaction") { + const { calls } = call.params as AddInvokeTransactionParameters + + return await this.requestWallet({ + method: "starknet_requestAddInvokeTransaction", + params: { + accountAddress: this.account.address, + executionRequest: { + calls: calls?.map(({ contract_address, ...rest }) => ({ + ...rest, + contractAddress: contract_address, + })), + }, + }, + }) + } + + if (call.type === "starknet_signTypedData") { + const params = { + accountAddress: this.account.address, + typedData: { ...(call.params as TypedData) }, + } + + const response = (await this.requestWallet({ + method: call.type, + params, + })) as { signature: string[] } | string[] + + return "signature" in response ? response.signature : response + } - request: RequestFn = async (call) => { - // request() is mostly used for messages like `wallet_watchAsset` etc. - // regular transactions calls are done through .account.execute throw new Error(`Not implemented: .request() for ${call.type}`) } From 8b05c8db746d60c87ca8a438aaf6fb57d4ce121d Mon Sep 17 00:00:00 2001 From: bluecco Date: Wed, 28 Feb 2024 17:36:14 +0100 Subject: [PATCH 10/11] chore: refactor mobile adapter --- .../argentMobile/modal/starknet/adapter.ts | 118 +++++++++++------- 1 file changed, 71 insertions(+), 47 deletions(-) diff --git a/src/connectors/argentMobile/modal/starknet/adapter.ts b/src/connectors/argentMobile/modal/starknet/adapter.ts index 8f16957..1417d8f 100644 --- a/src/connectors/argentMobile/modal/starknet/adapter.ts +++ b/src/connectors/argentMobile/modal/starknet/adapter.ts @@ -64,6 +64,7 @@ export class StarknetAdapter public rpc: EthereumRpcConfig private walletRpc: IStarknetRpc + private handleRequest: Record any> constructor({ client, chainId, rpcUrl, provider }: NamespaceAdapterOptions) { super() @@ -93,6 +94,15 @@ export class StarknetAdapter this.remoteSigner, this.walletRpc, ) + + this.handleRequest = Object.freeze({ + wallet_requestChainId: this.handleRequestChainId, + wallet_requestAccounts: this.handleRequestAccounts, + wallet_getPermissions: this.handleGetPermissions, + starknet_addInvokeTransaction: this.handleAddInvokeTransaction, + starknet_signTypedData: this.handleSignTypedData, + starknet_supportedSpecs: this.handleSupportedSpecs, + }) } getNetworkName(chainId: string): constants.NetworkName { @@ -112,53 +122,9 @@ export class StarknetAdapter throw new Error("No session") } - if (call.type === "wallet_requestChainId") { - return this.chainId === constants.NetworkName.SN_GOERLI - ? constants.StarknetChainId.SN_GOERLI - : constants.StarknetChainId.SN_MAIN - } - - if (call.type === "wallet_requestAccounts") { - return this.accounts - } - - if (call.type === "wallet_getPermissions") { - if (await this.isPreauthorized()) { - return ["accounts"] - } - - return [] - } - - if (call.type === "starknet_addInvokeTransaction") { - const { calls } = call.params as AddInvokeTransactionParameters - - return await this.requestWallet({ - method: "starknet_requestAddInvokeTransaction", - params: { - accountAddress: this.account.address, - executionRequest: { - calls: calls?.map(({ contract_address, ...rest }) => ({ - ...rest, - contractAddress: contract_address, - })), - }, - }, - }) - } - - if (call.type === "starknet_signTypedData") { - const params = { - accountAddress: this.account.address, - typedData: { ...(call.params as TypedData) }, - } - - const response = (await this.requestWallet({ - method: call.type, - params, - })) as { signature: string[] } | string[] - - return "signature" in response ? response.signature : response + const requestToCall = this.handleRequest[call.type] + if (requestToCall) { + return requestToCall(call.params) } throw new Error(`Not implemented: .request() for ${call.type}`) @@ -260,4 +226,62 @@ export class StarknetAdapter this.eventEmitter.emit("accountsChanged", this.accounts) this.selectedAddress = fixedAddress } + + private handleRequestChainId = () => { + return this.chainId === constants.NetworkName.SN_GOERLI + ? constants.StarknetChainId.SN_GOERLI + : constants.StarknetChainId.SN_MAIN + } + + private handleRequestAccounts = () => { + return this.accounts + } + + private handleGetPermissions = async () => { + if (await this.isPreauthorized()) { + return ["accounts"] + } + + return [] + } + + private handleAddInvokeTransaction = async ( + params: AddInvokeTransactionParameters, + ) => { + const { calls } = params as AddInvokeTransactionParameters + + return await this.requestWallet({ + method: "starknet_requestAddInvokeTransaction", + params: { + accountAddress: this.account.address, + executionRequest: { + calls: calls?.map(({ contract_address, ...rest }) => ({ + ...rest, + contractAddress: contract_address, + })), + }, + }, + }) + } + + private handleSignTypedData = async (params: TypedData) => { + const typedDataParams = { + accountAddress: this.account.address, + typedData: params, + } + + const response = (await this.requestWallet({ + method: "starknet_signTypedData", + params: typedDataParams, + })) as { signature: string[] } | string[] + + return "signature" in response ? response.signature : response + } + + private handleSupportedSpecs = async () => { + return await this.requestWallet({ + method: "starknet_supportedSpecs", + params: undefined, + }) + } } From 25ccbdafc4e16244556bb71b9b4d9dd27ff43ec8 Mon Sep 17 00:00:00 2001 From: bluecco Date: Thu, 29 Feb 2024 09:45:43 +0100 Subject: [PATCH 11/11] feat: adapt starknetKit to new JSON-rpc wallet api BREAKING CHANGE: use new JSON RPC Wallet API --- src/connectors/argentMobile/modal/starknet/adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connectors/argentMobile/modal/starknet/adapter.ts b/src/connectors/argentMobile/modal/starknet/adapter.ts index 1417d8f..55f6ad1 100644 --- a/src/connectors/argentMobile/modal/starknet/adapter.ts +++ b/src/connectors/argentMobile/modal/starknet/adapter.ts @@ -64,7 +64,7 @@ export class StarknetAdapter public rpc: EthereumRpcConfig private walletRpc: IStarknetRpc - private handleRequest: Record any> + private handleRequest: Record any> // TODO: improve typing constructor({ client, chainId, rpcUrl, provider }: NamespaceAdapterOptions) { super()