From 9ddc895462fd0f9c8a06b6f26008dc55c4923846 Mon Sep 17 00:00:00 2001 From: bluecco Date: Thu, 13 Jun 2024 17:05:46 +0200 Subject: [PATCH] fix: add window types --- package.json | 5 +- pnpm-lock.yaml | 985 +++++++++++++++++- src/connectors/webwallet/helpers/trpc.ts | 2 +- .../argentStarknetWindowObject.ts | 1 - src/main.ts | 5 +- src/types/legacy.ts | 3 +- src/window/index.ts | 3 + src/window/starknet.ts | 52 + src/window/utils/mittx.ts | 122 +++ src/window/window.test.ts | 917 ++++++++++++++++ src/{types => window}/window.ts | 73 +- 11 files changed, 2127 insertions(+), 41 deletions(-) create mode 100644 src/window/index.ts create mode 100644 src/window/starknet.ts create mode 100644 src/window/utils/mittx.ts create mode 100644 src/window/window.test.ts rename src/{types => window}/window.ts (84%) diff --git a/package.json b/package.json index 79b5585..da9b7f8 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,9 @@ "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" + "trpc-browser": "^1.3.2", + "starknet4": "npm:starknet@4.22.0", + "starknet5": "npm:starknet@5.29.0" }, "devDependencies": { "@commitlint/cli": "^17.7.1", @@ -102,6 +104,7 @@ "typescript": "^5.1.6", "vite": "^4.3.8", "vite-plugin-dts": "^3.0.0", + "vitest": "^1.6.0", "ws": "^8.8.1", "zod": "^3.20.6" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cdc5139..e5c2283 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,6 +41,12 @@ importers: starknet: specifier: ^6.9.0 version: 6.9.0 + starknet4: + specifier: npm:starknet@4.22.0 + version: starknet@4.22.0 + starknet5: + specifier: npm:starknet@5.29.0 + version: starknet@5.29.0 svelte-forms: specifier: ^2.3.1 version: 2.3.1 @@ -146,7 +152,10 @@ importers: version: 4.5.3(@types/node@20.12.13) vite-plugin-dts: specifier: ^3.0.0 - version: 3.9.1(@types/node@20.12.13)(rollup@3.29.4)(typescript@5.4.5)(vite@4.5.3(@types/node@20.12.13)) + version: 3.9.1(@types/node@20.12.13)(rollup@4.18.0)(typescript@5.4.5)(vite@4.5.3(@types/node@20.12.13)) + vitest: + specifier: ^1.6.0 + version: 1.6.0(@types/node@20.12.13) ws: specifier: ^8.8.1 version: 8.17.0 @@ -332,138 +341,276 @@ packages: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} + '@esbuild/aix-ppc64@0.20.2': + resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.18.20': resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.20.2': + resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.18.20': resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} cpu: [arm] os: [android] + '@esbuild/android-arm@0.20.2': + resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.18.20': resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} cpu: [x64] os: [android] + '@esbuild/android-x64@0.20.2': + resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.18.20': resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.20.2': + resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.18.20': resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.20.2': + resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.18.20': resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.20.2': + resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.18.20': resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.20.2': + resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.18.20': resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.20.2': + resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.18.20': resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.20.2': + resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.18.20': resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.20.2': + resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.18.20': resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.20.2': + resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.18.20': resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.20.2': + resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.18.20': resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.20.2': + resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.18.20': resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.20.2': + resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.18.20': resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.20.2': + resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.18.20': resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.20.2': + resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + '@esbuild/netbsd-x64@0.18.20': resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.20.2': + resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + '@esbuild/openbsd-x64@0.18.20': resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.20.2': + resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + '@esbuild/sunos-x64@0.18.20': resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.20.2': + resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.18.20': resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.20.2': + resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.18.20': resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.20.2': + resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.18.20': resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.20.2': + resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -482,6 +629,12 @@ packages: resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@ethersproject/bytes@5.7.0': + resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} + + '@ethersproject/logger@5.7.0': + resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} + '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -497,6 +650,10 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} + '@jest/schemas@29.6.3': + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -571,6 +728,9 @@ packages: '@noble/curves@1.4.0': resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} + '@noble/hashes@1.2.0': + resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} + '@noble/hashes@1.3.3': resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} engines: {node: '>= 16'} @@ -579,6 +739,9 @@ packages: resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} engines: {node: '>= 16'} + '@noble/secp256k1@1.7.1': + resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -752,6 +915,116 @@ packages: rollup: optional: true + '@rollup/rollup-android-arm-eabi@4.18.0': + resolution: {integrity: sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.18.0': + resolution: {integrity: sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.18.0': + resolution: {integrity: sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.18.0': + resolution: {integrity: sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-linux-arm-gnueabihf@4.18.0': + resolution: {integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.18.0': + resolution: {integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.18.0': + resolution: {integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.18.0': + resolution: {integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': + resolution: {integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.18.0': + resolution: {integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.18.0': + resolution: {integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.18.0': + resolution: {integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.18.0': + resolution: {integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-win32-arm64-msvc@4.18.0': + resolution: {integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.18.0': + resolution: {integrity: sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.18.0': + resolution: {integrity: sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==} + cpu: [x64] + os: [win32] + + '@rometools/cli-darwin-arm64@12.1.3': + resolution: {integrity: sha512-AmFTUDYjBuEGQp/Wwps+2cqUr+qhR7gyXAUnkL5psCuNCz3807TrUq/ecOoct5MIavGJTH6R4aaSL6+f+VlBEg==} + cpu: [arm64] + os: [darwin] + + '@rometools/cli-darwin-x64@12.1.3': + resolution: {integrity: sha512-k8MbWna8q4LRlb005N2X+JS1UQ+s3ZLBBvwk4fP8TBxlAJXUz17jLLu/Fi+7DTTEmMhM84TWj4FDKW+rNar28g==} + cpu: [x64] + os: [darwin] + + '@rometools/cli-linux-arm64@12.1.3': + resolution: {integrity: sha512-X/uLhJ2/FNA3nu5TiyeNPqiD3OZoFfNfRvw6a3ut0jEREPvEn72NI7WPijH/gxSz55znfQ7UQ6iM4DZumUknJg==} + cpu: [arm64] + os: [linux] + + '@rometools/cli-linux-x64@12.1.3': + resolution: {integrity: sha512-csP17q1eWiUXx9z6Jr/JJPibkplyKIwiWPYNzvPCGE8pHlKhwZj3YHRuu7Dm/4EOqx0XFIuqqWZUYm9bkIC8xg==} + cpu: [x64] + os: [linux] + + '@rometools/cli-win32-arm64@12.1.3': + resolution: {integrity: sha512-RymHWeod57EBOJY4P636CgUwYA6BQdkQjh56XKk4pLEHO6X1bFyMet2XL7KlHw5qOTalzuzf5jJqUs+vf3jdXQ==} + cpu: [arm64] + os: [win32] + + '@rometools/cli-win32-x64@12.1.3': + resolution: {integrity: sha512-yHSKYidqJMV9nADqg78GYA+cZ0hS1twANAjiFibQdXj9aGzD+s/IzIFEIi/U/OBLvWYg/SCw0QVozi2vTlKFDQ==} + cpu: [x64] + os: [win32] + '@rushstack/eslint-patch@1.10.3': resolution: {integrity: sha512-qC/xYId4NMebE6w/V33Fh9gWxLgURiNYgVNObbJl2LZv0GUUItCcCqC5axQSwRaAgaxl2mELq1rMzlswaQ0Zxg==} @@ -780,6 +1053,12 @@ packages: '@scure/base@1.1.6': resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} + '@scure/bip32@1.1.5': + resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} + + '@scure/bip39@1.1.1': + resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} + '@scure/starknet@1.0.0': resolution: {integrity: sha512-o5J57zY0f+2IL/mq8+AYJJ4Xpc1fOtDhr+mFQKbHnYFmm3WQrC+8zj2HEgxak1a+x86mhmBC1Kq305KUpVf0wg==} @@ -821,6 +1100,9 @@ packages: peerDependencies: semantic-release: '>=20.1.0' + '@sinclair/typebox@0.27.8': + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sindresorhus/merge-streams@2.3.0': resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} engines: {node: '>=18'} @@ -1023,6 +1305,21 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@vitest/expect@1.6.0': + resolution: {integrity: sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==} + + '@vitest/runner@1.6.0': + resolution: {integrity: sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==} + + '@vitest/snapshot@1.6.0': + resolution: {integrity: sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==} + + '@vitest/spy@1.6.0': + resolution: {integrity: sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==} + + '@vitest/utils@1.6.0': + resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==} + '@volar/language-core@1.11.1': resolution: {integrity: sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==} @@ -1136,6 +1433,10 @@ packages: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true + abi-wan-kanabi@1.0.3: + resolution: {integrity: sha512-Xwva0AnhXx/IVlzo3/kwkI7Oa7ZX7codtcSn+Gmoa2PmjGPF/0jeVud9puasIPtB7V50+uBdUj4Mh3iATqtBvg==} + hasBin: true + abi-wan-kanabi@2.2.2: resolution: {integrity: sha512-sTCv2HyNIj1x2WFUoc9oL8ZT9liosrL+GoqEGZJK1kDND096CfA7lwx06vLxLWMocQ41FQXO3oliwoh/UZHYdQ==} hasBin: true @@ -1196,6 +1497,10 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} @@ -1273,6 +1578,9 @@ packages: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} + assertion-error@1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + ast-types-flow@0.0.8: resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} @@ -1307,10 +1615,19 @@ packages: before-after-hook@2.2.3: resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} + bignumber.js@9.1.2: + resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} + binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} + bn.js@4.12.0: + resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} + + bn.js@5.2.1: + resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} + bottleneck@2.19.5: resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} @@ -1327,6 +1644,9 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + brorand@1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + browserslist@4.23.0: resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -1339,6 +1659,10 @@ packages: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + call-bind@1.0.7: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} @@ -1378,6 +1702,10 @@ packages: resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} hasBin: true + chai@4.4.1: + resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} + engines: {node: '>=4'} + chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1390,6 +1718,9 @@ packages: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + check-error@1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} @@ -1634,6 +1965,10 @@ packages: resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} engines: {node: '>=0.10'} + deep-eql@4.1.4: + resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} + engines: {node: '>=6'} + deep-extend@0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} @@ -1685,6 +2020,10 @@ packages: didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} + diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -1723,6 +2062,9 @@ packages: electron-to-chromium@1.4.787: resolution: {integrity: sha512-d0EFmtLPjctczO3LogReyM2pbBiiZbnsKnGF+cdZhsYzHm/A0GV7W94kqzLD8SN4O3f3iHlgLUChqghgyznvCQ==} + elliptic@6.5.5: + resolution: {integrity: sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -1789,6 +2131,11 @@ packages: engines: {node: '>=12'} hasBin: true + esbuild@0.20.2: + resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} + engines: {node: '>=12'} + hasBin: true + escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} @@ -1917,6 +2264,9 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} + ethereum-cryptography@1.2.0: + resolution: {integrity: sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==} + eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} @@ -2063,6 +2413,9 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + get-intrinsic@1.2.4: resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} engines: {node: '>= 0.4'} @@ -2200,6 +2553,9 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} + hash.js@1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -2211,6 +2567,9 @@ packages: hey-listen@1.0.8: resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} + hmac-drbg@1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + hook-std@3.0.0: resolution: {integrity: sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -2544,6 +2903,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.0: + resolution: {integrity: sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==} + js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -2557,6 +2919,9 @@ packages: engines: {node: '>=4'} hasBin: true + json-bigint@1.0.0: + resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==} + json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -2679,6 +3044,10 @@ packages: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} + local-pkg@0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} + engines: {node: '>=14'} + locate-character@3.0.0: resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} @@ -2763,9 +3132,15 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true + lossless-json@2.0.11: + resolution: {integrity: sha512-BP0vn+NGYvzDielvBZaFain/wgeJ1hTvURCqtKvhr1SCPePdaaTanmmcplrHfEJSJOUql7hk4FHwToNJjWRY3g==} + lossless-json@4.0.1: resolution: {integrity: sha512-l0L+ppmgPDnb+JGxNLndPtJZGNf6+ZmVaQzoxQm3u6TXmhdnsA+YtdVR8DjzZd/em58686CQhOFDPewfJ4l7MA==} + loupe@2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + lru-cache@10.2.2: resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} engines: {node: 14 || >=16.14} @@ -2850,6 +3225,12 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} + minimalistic-assert@1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + + minimalistic-crypto-utils@1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + minimatch@3.0.8: resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} @@ -3146,6 +3527,10 @@ packages: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + p-limit@5.0.0: + resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} + engines: {node: '>=18'} + p-locate@2.0.0: resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} engines: {node: '>=4'} @@ -3246,6 +3631,9 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + pathval@1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + periscopic@3.1.0: resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} @@ -3353,6 +3741,10 @@ packages: engines: {node: '>=14'} hasBin: true + pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -3407,6 +3799,9 @@ packages: react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + react@18.3.1: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} @@ -3537,6 +3932,16 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true + rollup@4.18.0: + resolution: {integrity: sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + rome@12.1.3: + resolution: {integrity: sha512-e+ff72hxDpe/t5/Us7YRBVw3PBET7SeczTQNn6tvrWdrCaAw3qOukQQ+tDCkyFtS4yGsnhjrJbm43ctNbz27Yg==} + engines: {node: '>=14.*'} + hasBin: true + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -3622,6 +4027,9 @@ packages: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} engines: {node: '>= 0.4'} + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -3695,9 +4103,18 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + starknet-types@0.7.2: resolution: {integrity: sha512-r3JJ0rrK0g3FnVRGcFiLY+9YT5WZgxB4TKBfR44wYGevHtKEM6BM5B+Gn1eou1zV7xEAwz3GpmvLSQTUAzDhsw==} + starknet@4.22.0: + resolution: {integrity: sha512-jC9Taxb6a/ht9zmS1LU/DSLfwJKpgCJnE9AktVksc5SE/+jQMpqxsq6fm7PRiqupjiqRC1DOS8N47cj+KaGv4Q==} + + starknet@5.29.0: + resolution: {integrity: sha512-eEcd6uiYIwGvl8MtHOsXGBhREqjJk84M/qUkvPLQ3n/JAMkbKBGnygDlh+HAsvXJsGlMQfwrcVlm6KpDoPha7w==} + starknet@6.9.0: resolution: {integrity: sha512-8860J7sGUr5UO/BDl3pjCZNUs/vgUM75wVoI93iOYLbTGF0f6MvFZsMOd73tsPKjEcG8V5BTSx6I7seDhQ9osw==} @@ -3779,6 +4196,9 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + strip-literal@2.1.0: + resolution: {integrity: sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==} + sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} @@ -3911,6 +4331,17 @@ packages: through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + tinybench@2.8.0: + resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} + + tinypool@0.8.4: + resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} + engines: {node: '>=14.0.0'} + + tinyspy@2.2.1: + resolution: {integrity: sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==} + engines: {node: '>=14.0.0'} + to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} @@ -3946,6 +4377,10 @@ packages: peerDependencies: typescript: '>=4.2.0' + ts-custom-error@3.3.1: + resolution: {integrity: sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==} + engines: {node: '>=14.0.0'} + ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} @@ -3979,6 +4414,10 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + type-fest@0.18.1: resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} engines: {node: '>=10'} @@ -4036,6 +4475,11 @@ packages: engines: {node: '>=4.2.0'} hasBin: true + typescript@4.9.5: + resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} + engines: {node: '>=4.2.0'} + hasBin: true + typescript@5.4.2: resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} engines: {node: '>=14.17'} @@ -4195,6 +4639,11 @@ packages: react: optional: true + vite-node@1.6.0: + resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + vite-plugin-dts@3.9.1: resolution: {integrity: sha512-rVp2KM9Ue22NGWB8dNtWEr+KekN3rIgz1tWD050QnRGlriUCmaDwa7qA5zDEjbXg5lAXhYMSBJtx3q3hQIJZSg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -4233,6 +4682,34 @@ packages: terser: optional: true + vite@5.2.13: + resolution: {integrity: sha512-SSq1noJfY9pR3I1TUENL3rQYDQCFqgD+lM6fTRAM8Nv6Lsg5hDLaXkjETVeBt+7vZBCMoibD+6IWnT2mJ+Zb/A==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + vitefu@0.2.5: resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} peerDependencies: @@ -4241,6 +4718,31 @@ packages: vite: optional: true + vitest@1.6.0: + resolution: {integrity: sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': 1.6.0 + '@vitest/ui': 1.6.0 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + vue-template-compiler@2.7.16: resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} @@ -4282,6 +4784,11 @@ packages: engines: {node: '>= 8'} hasBin: true + why-is-node-running@2.2.2: + resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} + engines: {node: '>=8'} + hasBin: true + word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} @@ -4653,72 +5160,141 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.9 + '@esbuild/aix-ppc64@0.20.2': + optional: true + '@esbuild/android-arm64@0.18.20': optional: true + '@esbuild/android-arm64@0.20.2': + optional: true + '@esbuild/android-arm@0.18.20': optional: true + '@esbuild/android-arm@0.20.2': + optional: true + '@esbuild/android-x64@0.18.20': optional: true + '@esbuild/android-x64@0.20.2': + optional: true + '@esbuild/darwin-arm64@0.18.20': optional: true + '@esbuild/darwin-arm64@0.20.2': + optional: true + '@esbuild/darwin-x64@0.18.20': optional: true + '@esbuild/darwin-x64@0.20.2': + optional: true + '@esbuild/freebsd-arm64@0.18.20': optional: true + '@esbuild/freebsd-arm64@0.20.2': + optional: true + '@esbuild/freebsd-x64@0.18.20': optional: true + '@esbuild/freebsd-x64@0.20.2': + optional: true + '@esbuild/linux-arm64@0.18.20': optional: true + '@esbuild/linux-arm64@0.20.2': + optional: true + '@esbuild/linux-arm@0.18.20': optional: true + '@esbuild/linux-arm@0.20.2': + optional: true + '@esbuild/linux-ia32@0.18.20': optional: true + '@esbuild/linux-ia32@0.20.2': + optional: true + '@esbuild/linux-loong64@0.18.20': optional: true + '@esbuild/linux-loong64@0.20.2': + optional: true + '@esbuild/linux-mips64el@0.18.20': optional: true + '@esbuild/linux-mips64el@0.20.2': + optional: true + '@esbuild/linux-ppc64@0.18.20': optional: true + '@esbuild/linux-ppc64@0.20.2': + optional: true + '@esbuild/linux-riscv64@0.18.20': optional: true + '@esbuild/linux-riscv64@0.20.2': + optional: true + '@esbuild/linux-s390x@0.18.20': optional: true + '@esbuild/linux-s390x@0.20.2': + optional: true + '@esbuild/linux-x64@0.18.20': optional: true + '@esbuild/linux-x64@0.20.2': + optional: true + '@esbuild/netbsd-x64@0.18.20': optional: true + '@esbuild/netbsd-x64@0.20.2': + optional: true + '@esbuild/openbsd-x64@0.18.20': optional: true + '@esbuild/openbsd-x64@0.20.2': + optional: true + '@esbuild/sunos-x64@0.18.20': optional: true + '@esbuild/sunos-x64@0.20.2': + optional: true + '@esbuild/win32-arm64@0.18.20': optional: true + '@esbuild/win32-arm64@0.20.2': + optional: true + '@esbuild/win32-ia32@0.18.20': optional: true + '@esbuild/win32-ia32@0.20.2': + optional: true + '@esbuild/win32-x64@0.18.20': optional: true + '@esbuild/win32-x64@0.20.2': + optional: true + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': dependencies: eslint: 8.57.0 @@ -4742,6 +5318,12 @@ snapshots: '@eslint/js@8.57.0': {} + '@ethersproject/bytes@5.7.0': + dependencies: + '@ethersproject/logger': 5.7.0 + + '@ethersproject/logger@5.7.0': {} + '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 @@ -4763,6 +5345,10 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 + '@jest/schemas@29.6.3': + dependencies: + '@sinclair/typebox': 0.27.8 + '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 @@ -4883,10 +5469,14 @@ snapshots: dependencies: '@noble/hashes': 1.4.0 + '@noble/hashes@1.2.0': {} + '@noble/hashes@1.3.3': {} '@noble/hashes@1.4.0': {} + '@noble/secp256k1@1.7.1': {} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -5041,13 +5631,79 @@ snapshots: '@pnpm/network.ca-file': 1.0.2 config-chain: 1.1.13 - '@rollup/pluginutils@5.1.0(rollup@3.29.4)': + '@rollup/pluginutils@5.1.0(rollup@4.18.0)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 3.29.4 + rollup: 4.18.0 + + '@rollup/rollup-android-arm-eabi@4.18.0': + optional: true + + '@rollup/rollup-android-arm64@4.18.0': + optional: true + + '@rollup/rollup-darwin-arm64@4.18.0': + optional: true + + '@rollup/rollup-darwin-x64@4.18.0': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.18.0': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.18.0': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.18.0': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-x64-musl@4.18.0': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.18.0': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.18.0': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.18.0': + optional: true + + '@rometools/cli-darwin-arm64@12.1.3': + optional: true + + '@rometools/cli-darwin-x64@12.1.3': + optional: true + + '@rometools/cli-linux-arm64@12.1.3': + optional: true + + '@rometools/cli-linux-x64@12.1.3': + optional: true + + '@rometools/cli-win32-arm64@12.1.3': + optional: true + + '@rometools/cli-win32-x64@12.1.3': + optional: true '@rushstack/eslint-patch@1.10.3': {} @@ -5085,6 +5741,17 @@ snapshots: '@scure/base@1.1.6': {} + '@scure/bip32@1.1.5': + dependencies: + '@noble/hashes': 1.2.0 + '@noble/secp256k1': 1.7.1 + '@scure/base': 1.1.6 + + '@scure/bip39@1.1.1': + dependencies: + '@noble/hashes': 1.2.0 + '@scure/base': 1.1.6 + '@scure/starknet@1.0.0': dependencies: '@noble/curves': 1.3.0 @@ -5176,6 +5843,8 @@ snapshots: transitivePeerDependencies: - supports-color + '@sinclair/typebox@0.27.8': {} + '@sindresorhus/merge-streams@2.3.0': {} '@stablelib/aead@1.0.1': {} @@ -5421,6 +6090,35 @@ snapshots: '@ungap/structured-clone@1.2.0': {} + '@vitest/expect@1.6.0': + dependencies: + '@vitest/spy': 1.6.0 + '@vitest/utils': 1.6.0 + chai: 4.4.1 + + '@vitest/runner@1.6.0': + dependencies: + '@vitest/utils': 1.6.0 + p-limit: 5.0.0 + pathe: 1.1.2 + + '@vitest/snapshot@1.6.0': + dependencies: + magic-string: 0.30.10 + pathe: 1.1.2 + pretty-format: 29.7.0 + + '@vitest/spy@1.6.0': + dependencies: + tinyspy: 2.2.1 + + '@vitest/utils@1.6.0': + dependencies: + diff-sequences: 29.6.3 + estree-walker: 3.0.3 + loupe: 2.3.7 + pretty-format: 29.7.0 + '@volar/language-core@1.11.1': dependencies: '@volar/source-map': 1.11.1 @@ -5814,6 +6512,13 @@ snapshots: jsonparse: 1.3.1 through: 2.3.8 + abi-wan-kanabi@1.0.3: + dependencies: + fs-extra: 10.1.0 + rome: 12.1.3 + typescript: 4.9.5 + yargs: 17.7.2 + abi-wan-kanabi@2.2.2: dependencies: ansicolors: 0.3.2 @@ -5877,6 +6582,8 @@ snapshots: dependencies: color-convert: 2.0.1 + ansi-styles@5.2.0: {} + ansi-styles@6.2.1: {} ansicolors@0.3.2: {} @@ -5982,6 +6689,8 @@ snapshots: arrify@1.0.1: {} + assertion-error@1.1.0: {} + ast-types-flow@0.0.8: {} atomic-sleep@1.0.0: {} @@ -6014,8 +6723,14 @@ snapshots: before-after-hook@2.2.3: {} + bignumber.js@9.1.2: {} + binary-extensions@2.3.0: {} + bn.js@4.12.0: {} + + bn.js@5.2.1: {} + bottleneck@2.19.5: {} bowser@2.11.0: {} @@ -6033,6 +6748,8 @@ snapshots: dependencies: fill-range: 7.1.1 + brorand@1.1.0: {} + browserslist@4.23.0: dependencies: caniuse-lite: 1.0.30001625 @@ -6044,6 +6761,8 @@ snapshots: builtin-modules@3.3.0: {} + cac@6.7.14: {} + call-bind@1.0.7: dependencies: es-define-property: 1.0.0 @@ -6081,6 +6800,16 @@ snapshots: ansicolors: 0.3.2 redeyed: 2.1.1 + chai@4.4.1: + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 4.1.4 + get-func-name: 2.0.2 + loupe: 2.3.7 + pathval: 1.1.1 + type-detect: 4.0.8 + chalk@2.4.2: dependencies: ansi-styles: 3.2.1 @@ -6094,6 +6823,10 @@ snapshots: chalk@5.3.0: {} + check-error@1.0.3: + dependencies: + get-func-name: 2.0.2 + chokidar@3.6.0: dependencies: anymatch: 3.1.3 @@ -6338,6 +7071,10 @@ snapshots: decode-uri-component@0.2.2: {} + deep-eql@4.1.4: + dependencies: + type-detect: 4.0.8 + deep-extend@0.6.0: {} deep-is@0.1.4: {} @@ -6374,6 +7111,8 @@ snapshots: didyoumean@1.2.2: {} + diff-sequences@29.6.3: {} + diff@4.0.2: {} dijkstrajs@1.0.3: {} @@ -6411,6 +7150,16 @@ snapshots: electron-to-chromium@1.4.787: {} + elliptic@6.5.5: + dependencies: + bn.js: 4.12.0 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -6556,6 +7305,32 @@ snapshots: '@esbuild/win32-ia32': 0.18.20 '@esbuild/win32-x64': 0.18.20 + esbuild@0.20.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.20.2 + '@esbuild/android-arm': 0.20.2 + '@esbuild/android-arm64': 0.20.2 + '@esbuild/android-x64': 0.20.2 + '@esbuild/darwin-arm64': 0.20.2 + '@esbuild/darwin-x64': 0.20.2 + '@esbuild/freebsd-arm64': 0.20.2 + '@esbuild/freebsd-x64': 0.20.2 + '@esbuild/linux-arm': 0.20.2 + '@esbuild/linux-arm64': 0.20.2 + '@esbuild/linux-ia32': 0.20.2 + '@esbuild/linux-loong64': 0.20.2 + '@esbuild/linux-mips64el': 0.20.2 + '@esbuild/linux-ppc64': 0.20.2 + '@esbuild/linux-riscv64': 0.20.2 + '@esbuild/linux-s390x': 0.20.2 + '@esbuild/linux-x64': 0.20.2 + '@esbuild/netbsd-x64': 0.20.2 + '@esbuild/openbsd-x64': 0.20.2 + '@esbuild/sunos-x64': 0.20.2 + '@esbuild/win32-arm64': 0.20.2 + '@esbuild/win32-ia32': 0.20.2 + '@esbuild/win32-x64': 0.20.2 + escalade@3.1.2: {} escape-string-regexp@1.0.5: {} @@ -6767,6 +7542,13 @@ snapshots: esutils@2.0.3: {} + ethereum-cryptography@1.2.0: + dependencies: + '@noble/hashes': 1.2.0 + '@noble/secp256k1': 1.7.1 + '@scure/bip32': 1.1.5 + '@scure/bip39': 1.1.1 + eventemitter3@5.0.1: {} events@3.3.0: {} @@ -6940,6 +7722,8 @@ snapshots: get-caller-file@2.0.5: {} + get-func-name@2.0.2: {} + get-intrinsic@1.2.4: dependencies: es-errors: 1.3.0 @@ -7112,6 +7896,11 @@ snapshots: dependencies: has-symbols: 1.0.3 + hash.js@1.1.7: + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + hasown@2.0.2: dependencies: function-bind: 1.1.2 @@ -7120,6 +7909,12 @@ snapshots: hey-listen@1.0.8: {} + hmac-drbg@1.0.1: + dependencies: + hash.js: 1.1.7 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + hook-std@3.0.0: {} hosted-git-info@2.8.9: {} @@ -7431,6 +8226,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.0: {} + js-yaml@3.14.1: dependencies: argparse: 1.0.10 @@ -7442,6 +8239,10 @@ snapshots: jsesc@2.5.2: {} + json-bigint@1.0.0: + dependencies: + bignumber.js: 9.1.2 + json-buffer@3.0.1: {} json-parse-better-errors@1.0.2: {} @@ -7585,6 +8386,11 @@ snapshots: pify: 3.0.0 strip-bom: 3.0.0 + local-pkg@0.5.0: + dependencies: + mlly: 1.7.0 + pkg-types: 1.1.1 + locate-character@3.0.0: {} locate-path@2.0.0: @@ -7654,8 +8460,14 @@ snapshots: dependencies: js-tokens: 4.0.0 + lossless-json@2.0.11: {} + lossless-json@4.0.1: {} + loupe@2.3.7: + dependencies: + get-func-name: 2.0.2 + lru-cache@10.2.2: {} lru-cache@5.1.1: @@ -7730,6 +8542,10 @@ snapshots: min-indent@1.0.1: {} + minimalistic-assert@1.0.1: {} + + minimalistic-crypto-utils@1.0.1: {} + minimatch@3.0.8: dependencies: brace-expansion: 1.1.11 @@ -7956,6 +8772,10 @@ snapshots: dependencies: yocto-queue: 1.0.0 + p-limit@5.0.0: + dependencies: + yocto-queue: 1.0.0 + p-locate@2.0.0: dependencies: p-limit: 1.3.0 @@ -8035,6 +8855,8 @@ snapshots: pathe@1.1.2: {} + pathval@1.1.1: {} + periscopic@3.1.0: dependencies: '@types/estree': 1.0.5 @@ -8141,6 +8963,12 @@ snapshots: prettier@3.2.5: {} + pretty-format@29.7.0: + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.3.1 + process-nextick-args@2.0.1: {} process-warning@1.0.0: {} @@ -8192,6 +9020,8 @@ snapshots: react-is@16.13.1: {} + react-is@18.3.1: {} + react@18.3.1: dependencies: loose-envify: 1.4.0 @@ -8338,6 +9168,37 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + rollup@4.18.0: + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.18.0 + '@rollup/rollup-android-arm64': 4.18.0 + '@rollup/rollup-darwin-arm64': 4.18.0 + '@rollup/rollup-darwin-x64': 4.18.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.18.0 + '@rollup/rollup-linux-arm-musleabihf': 4.18.0 + '@rollup/rollup-linux-arm64-gnu': 4.18.0 + '@rollup/rollup-linux-arm64-musl': 4.18.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.18.0 + '@rollup/rollup-linux-riscv64-gnu': 4.18.0 + '@rollup/rollup-linux-s390x-gnu': 4.18.0 + '@rollup/rollup-linux-x64-gnu': 4.18.0 + '@rollup/rollup-linux-x64-musl': 4.18.0 + '@rollup/rollup-win32-arm64-msvc': 4.18.0 + '@rollup/rollup-win32-ia32-msvc': 4.18.0 + '@rollup/rollup-win32-x64-msvc': 4.18.0 + fsevents: 2.3.3 + + rome@12.1.3: + optionalDependencies: + '@rometools/cli-darwin-arm64': 12.1.3 + '@rometools/cli-darwin-x64': 12.1.3 + '@rometools/cli-linux-arm64': 12.1.3 + '@rometools/cli-linux-x64': 12.1.3 + '@rometools/cli-win32-arm64': 12.1.3 + '@rometools/cli-win32-x64': 12.1.3 + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 @@ -8455,6 +9316,8 @@ snapshots: get-intrinsic: 1.2.4 object-inspect: 1.13.1 + siginfo@2.0.0: {} + signal-exit@3.0.7: {} signal-exit@4.1.0: {} @@ -8523,8 +9386,40 @@ snapshots: sprintf-js@1.0.3: {} + stackback@0.0.2: {} + starknet-types@0.7.2: {} + starknet@4.22.0: + dependencies: + '@ethersproject/bytes': 5.7.0 + bn.js: 5.2.1 + elliptic: 6.5.5 + ethereum-cryptography: 1.2.0 + hash.js: 1.1.7 + isomorphic-fetch: 3.0.0 + json-bigint: 1.0.0 + minimalistic-assert: 1.0.1 + pako: 2.1.0 + ts-custom-error: 3.3.1 + url-join: 4.0.1 + transitivePeerDependencies: + - encoding + + starknet@5.29.0: + dependencies: + '@noble/curves': 1.3.0 + '@scure/base': 1.1.6 + '@scure/starknet': 1.0.0 + abi-wan-kanabi-v1: abi-wan-kanabi@1.0.3 + abi-wan-kanabi-v2: abi-wan-kanabi@2.2.2 + isomorphic-fetch: 3.0.0 + lossless-json: 2.0.11 + pako: 2.1.0 + url-join: 4.0.1 + transitivePeerDependencies: + - encoding + starknet@6.9.0: dependencies: '@noble/curves': 1.4.0 @@ -8632,6 +9527,10 @@ snapshots: strip-json-comments@3.1.1: {} + strip-literal@2.1.0: + dependencies: + js-tokens: 9.0.0 + sucrase@3.35.0: dependencies: '@jridgewell/gen-mapping': 0.3.5 @@ -8791,6 +9690,12 @@ snapshots: through@2.3.8: {} + tinybench@2.8.0: {} + + tinypool@0.8.4: {} + + tinyspy@2.2.1: {} + to-fast-properties@2.0.0: {} to-regex-range@5.0.1: @@ -8823,6 +9728,8 @@ snapshots: dependencies: typescript: 5.4.5 + ts-custom-error@3.3.1: {} + ts-interface-checker@0.1.13: {} ts-mixer@6.0.4: {} @@ -8860,6 +9767,8 @@ snapshots: dependencies: prelude-ls: 1.2.1 + type-detect@4.0.8: {} + type-fest@0.18.1: {} type-fest@0.20.2: {} @@ -8919,6 +9828,8 @@ snapshots: typescript@3.9.10: {} + typescript@4.9.5: {} + typescript@5.4.2: {} typescript@5.4.5: {} @@ -9033,10 +9944,27 @@ snapshots: optionalDependencies: react: 18.3.1 - vite-plugin-dts@3.9.1(@types/node@20.12.13)(rollup@3.29.4)(typescript@5.4.5)(vite@4.5.3(@types/node@20.12.13)): + vite-node@1.6.0(@types/node@20.12.13): + dependencies: + cac: 6.7.14 + debug: 4.3.5 + pathe: 1.1.2 + picocolors: 1.0.1 + vite: 5.2.13(@types/node@20.12.13) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + + vite-plugin-dts@3.9.1(@types/node@20.12.13)(rollup@4.18.0)(typescript@5.4.5)(vite@4.5.3(@types/node@20.12.13)): dependencies: '@microsoft/api-extractor': 7.43.0(@types/node@20.12.13) - '@rollup/pluginutils': 5.1.0(rollup@3.29.4) + '@rollup/pluginutils': 5.1.0(rollup@4.18.0) '@vue/language-core': 1.8.27(typescript@5.4.5) debug: 4.3.5 kolorist: 1.8.0 @@ -9059,10 +9987,52 @@ snapshots: '@types/node': 20.12.13 fsevents: 2.3.3 + vite@5.2.13(@types/node@20.12.13): + dependencies: + esbuild: 0.20.2 + postcss: 8.4.38 + rollup: 4.18.0 + optionalDependencies: + '@types/node': 20.12.13 + fsevents: 2.3.3 + vitefu@0.2.5(vite@4.5.3(@types/node@20.12.13)): optionalDependencies: vite: 4.5.3(@types/node@20.12.13) + vitest@1.6.0(@types/node@20.12.13): + dependencies: + '@vitest/expect': 1.6.0 + '@vitest/runner': 1.6.0 + '@vitest/snapshot': 1.6.0 + '@vitest/spy': 1.6.0 + '@vitest/utils': 1.6.0 + acorn-walk: 8.3.2 + chai: 4.4.1 + debug: 4.3.5 + execa: 8.0.1 + local-pkg: 0.5.0 + magic-string: 0.30.10 + pathe: 1.1.2 + picocolors: 1.0.1 + std-env: 3.7.0 + strip-literal: 2.1.0 + tinybench: 2.8.0 + tinypool: 0.8.4 + vite: 5.2.13(@types/node@20.12.13) + vite-node: 1.6.0(@types/node@20.12.13) + why-is-node-running: 2.2.2 + optionalDependencies: + '@types/node': 20.12.13 + transitivePeerDependencies: + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + vue-template-compiler@2.7.16: dependencies: de-indent: 1.0.2 @@ -9128,6 +10098,11 @@ snapshots: dependencies: isexe: 2.0.0 + why-is-node-running@2.2.2: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + word-wrap@1.2.5: {} wordwrap@1.0.0: {} diff --git a/src/connectors/webwallet/helpers/trpc.ts b/src/connectors/webwallet/helpers/trpc.ts index f26cf9c..3bbdd5f 100644 --- a/src/connectors/webwallet/helpers/trpc.ts +++ b/src/connectors/webwallet/helpers/trpc.ts @@ -8,7 +8,7 @@ import { RpcCallsArraySchema, StarknetMethodArgumentsSchemas, deployAccountContractSchema, -} from "../../../types/window" +} from "../../../window/window" import { DEFAULT_WEBWALLET_URL } from "../constants" import { Permission } from "get-starknet-core" diff --git a/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts b/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts index 5665857..41e6f99 100644 --- a/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts +++ b/src/connectors/webwallet/starknetWindowObject/argentStarknetWindowObject.ts @@ -36,7 +36,6 @@ export type LoginStatus = { export type WebWalletStarknetWindowObject = StarknetWindowObject & { getLoginStatus(): Promise } - export const getArgentStarknetWindowObject = ( options: GetArgentStarknetWindowObject, proxyLink: CreateTRPCProxyClient, diff --git a/src/main.ts b/src/main.ts index eef4d0c..d01ec63 100644 --- a/src/main.ts +++ b/src/main.ts @@ -182,11 +182,12 @@ export type { Connector, ConnectorData, DisconnectOptions, - ModalResult, StarknetWindowObject, defaultConnectors as starknetkitDefaultConnectors, } -export type * from "./types/legacy" +export type * from "./types/modal" +//export type * from "./types/legacy" +export * from "./window" export { useStarknetkitConnectModal } from "./hooks/useStarknetkitConnectModal" diff --git a/src/types/legacy.ts b/src/types/legacy.ts index c9689ec..af97361 100644 --- a/src/types/legacy.ts +++ b/src/types/legacy.ts @@ -1,4 +1,4 @@ -import { StarknetWindowObject } from "starknet-types" +/* import { StarknetWindowObject } from "starknet-types" import { IStarknetWindowObject as IStarknetWindowObjectV3, ConnectedStarknetWindowObject as ConnectedStarknetWindowObjectV3, @@ -14,3 +14,4 @@ export type BackwardsCompatibleStarknetWindowObject = StarknetWindowObject & export type BackwardsCompatibleConnectedStarknetWindowObject = StarknetWindowObject & Omit + */ diff --git a/src/window/index.ts b/src/window/index.ts new file mode 100644 index 0000000..ed99d33 --- /dev/null +++ b/src/window/index.ts @@ -0,0 +1,3 @@ +export * from "./utils/mittx" +export * from "./window" +export * from "./starknet" diff --git a/src/window/starknet.ts b/src/window/starknet.ts new file mode 100644 index 0000000..8b871ad --- /dev/null +++ b/src/window/starknet.ts @@ -0,0 +1,52 @@ +import type { StarknetWindowObject, Permission } from "get-starknet-core" +import { + ConnectedStarknetWindowObject as ConnectedStarknetWindowObjectV3, + IStarknetWindowObject as IStarknetWindowObjectV3, +} from "get-starknet-coreV3" +import type { ProviderInterface } from "starknet" +import type { ProviderInterface as ProviderInterface4 } from "starknet4" +import type { ProviderInterface as ProviderInterface5 } from "starknet5" + +import type { AccountInterface } from "starknet" +import type { AccountInterface as AccountInterface4 } from "starknet4" +import type { AccountInterface as AccountInterface5 } from "starknet5" + +type CommonOmittedProperties = + | "on" + | "off" + | "request" + | "icon" + | "provider" + | "account" + +export type BackwardsCompatibleStarknetWindowObject = Omit< + StarknetWindowObject, + "provider" | "account" +> & + Omit & { + isConnected?: boolean + } & { + provider?: ProviderInterface | ProviderInterface5 | ProviderInterface4 + account?: AccountInterface | AccountInterface5 | AccountInterface4 + } + +export type BackwardsCompatibleConnectedStarknetWindowObject = Omit< + StarknetWindowObject, + "provider" | "account" +> & + Omit & { + provider?: ProviderInterface | ProviderInterface5 | ProviderInterface4 + account?: AccountInterface | AccountInterface5 | AccountInterface4 + } + +export type Variant = "argentX" | "argentWebWallet" + +export interface GetArgentStarknetWindowObject { + id: Variant + icon: string + name: string + version: string + host: string +} + +export { Permission } diff --git a/src/window/utils/mittx.ts b/src/window/utils/mittx.ts new file mode 100644 index 0000000..a42082c --- /dev/null +++ b/src/window/utils/mittx.ts @@ -0,0 +1,122 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +export type EventType = string | symbol + +// An event handler can take an optional event argument +// and should not return a value +export type Handler = (event: T) => void +export type WildcardHandler> = ( + type: keyof T, + event: T[keyof T], +) => void + +// An array of all currently registered event handlers for a type +export type EventHandlerList = Array> +export type WildCardEventHandlerList> = Array< + WildcardHandler +> + +// A map of event types and their corresponding event handlers. +export type EventHandlerMap> = Map< + keyof Events | "*", + EventHandlerList | WildCardEventHandlerList +> + +export interface Emitter> { + all: EventHandlerMap + + on(type: Key, handler: Handler): void + on(type: "*", handler: WildcardHandler): void + + off(type: Key, handler?: Handler): void + off(type: "*", handler: WildcardHandler): void + + emit(type: Key, event: Events[Key]): void + emit( + type: undefined extends Events[Key] ? Key : never, + ): void +} + +/** + * Taken from https://github.com/developit/mitt/blob/main/src/index.ts + * Mitt: Tiny (~200b) functional event emitter / pubsub. + * @name mittx + * @returns {MittX} + */ +export function mittx>( + all?: EventHandlerMap, +): Emitter { + type GenericEventHandler = + | Handler + | WildcardHandler + all = all || new Map() + + return { + /** + * A Map of event names to registered handler functions. + */ + all, + + /** + * Register an event handler for the given type. + * @param {string|symbol} type Type of event to listen for, or `'*'` for all events + * @param {Function} handler Function to call in response to given event + * @memberOf mittx + */ + on(type: Key, handler: GenericEventHandler) { + const handlers: Array | undefined = all!.get(type) + if (handlers) { + handlers.push(handler) + } else { + all!.set(type, [handler] as EventHandlerList) + } + }, + + /** + * Remove an event handler for the given type. + * If `handler` is omitted, all handlers of the given type are removed. + * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler) + * @param {Function} [handler] Handler function to remove + * @memberOf mittx + */ + off(type: Key, handler?: GenericEventHandler) { + const handlers: Array | undefined = all!.get(type) + if (handlers) { + if (handler) { + handlers.splice(handlers.indexOf(handler) >>> 0, 1) + } else { + all!.set(type, []) + } + } + }, + + /** + * Invoke all handlers for the given type. + * If present, `'*'` handlers are invoked after type-matched handlers. + * + * Note: Manually firing '*' handlers is not supported. + * + * @param {string|symbol} type The event type to invoke + * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler + * @memberOf mittx + */ + emit(type: Key, evt?: Events[Key]) { + let handlers = all?.get(type) + if (handlers) { + ;(handlers as EventHandlerList) + .slice() + .map((handler) => { + handler(evt!) + }) + } + + handlers = all!.get("*") + if (handlers) { + ;(handlers as WildCardEventHandlerList) + .slice() + .forEach((handler) => { + handler(type, evt!) + }) + } + }, + } +} diff --git a/src/window/window.test.ts b/src/window/window.test.ts new file mode 100644 index 0000000..75fbc13 --- /dev/null +++ b/src/window/window.test.ts @@ -0,0 +1,917 @@ +import { describe, expect, test } from "vitest" +import { z } from "zod" + +import { StarknetMethodArgumentsSchemas } from "./window" + +const message: z.infer = [ + { + domain: { + name: "Example DApp", + chainId: "SN_GOERLI", + version: "0.0.1", + }, + types: { + StarkNetDomain: [ + { name: "name", type: "felt" }, + { name: "chainId", type: "felt" }, + { name: "version", type: "felt" }, + ], + Message: [{ name: "message", type: "felt" }], + }, + primaryType: "Message", + message: { + message: "Lorem ipsum dolor", + }, + }, +] + +const baseMessage = [ + { + types: { + StarkNetDomain: [ + { name: "name", type: "felt" }, + { name: "version", type: "felt" }, + { name: "chainId", type: "felt" }, + ], + Person: [ + { name: "name", type: "felt" }, + { name: "wallet", type: "felt" }, + ], + Mail: [ + { name: "from", type: "Person" }, + { name: "to", type: "Person" }, + { name: "contents", type: "felt" }, + ], + }, + primaryType: "Mail", + domain: { + name: "StarkNet Mail", + version: "1", + chainId: 1, + }, + message: { + from: { + name: "Cow", + wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", + }, + to: { + name: "Bob", + wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", + }, + contents: "Hello, Bob!", + }, + }, +] + +const baseTypesMessage = [ + { + types: { + StarknetDomain: [ + { name: "name", type: "shortstring" }, + { name: "version", type: "shortstring" }, + { name: "chainId", type: "shortstring" }, + { name: "revision", type: "shortstring" }, + ], + Example: [ + { name: "n0", type: "felt" }, + { name: "n1", type: "bool" }, + { name: "n2", type: "string" }, + { name: "n3", type: "selector" }, + { name: "n4", type: "u128" }, + { name: "n5", type: "i128" }, + { name: "n6", type: "ContractAddress" }, + { name: "n7", type: "ClassHash" }, + { name: "n8", type: "timestamp" }, + { name: "n9", type: "shortstring" }, + ], + }, + primaryType: "Example", + domain: { + name: "StarkNet Mail", + version: "1", + chainId: "1", + revision: "1", + }, + message: { + n0: "0x3e8", + n1: true, + n2: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", + n3: "transfer", + n4: 10, + n5: -10, + n6: "0x3e8", + n7: "0x3e8", + n8: 1000, + n9: "transfer", + }, + }, +] + +const enumMessage = [ + { + types: { + StarknetDomain: [ + { name: "name", type: "shortstring" }, + { name: "version", type: "shortstring" }, + { name: "chainId", type: "shortstring" }, + { name: "revision", type: "shortstring" }, + ], + Example: [{ name: "someEnum", type: "enum", contains: "MyEnum" }], + MyEnum: [ + { name: "Variant 1", type: "()" }, + { name: "Variant 2", type: "(u128,u128*)" }, + { name: "Variant 3", type: "(u128)" }, + ], + }, + primaryType: "Example", + domain: { + name: "StarkNet Mail", + version: "1", + chainId: "1", + revision: "1", + }, + message: { + someEnum: { + "Variant 2": [2, [0, 1]], + }, + }, + }, +] + +const presetTypesMessage = [ + { + types: { + StarknetDomain: [ + { name: "name", type: "shortstring" }, + { name: "version", type: "shortstring" }, + { name: "chainId", type: "shortstring" }, + { name: "revision", type: "shortstring" }, + ], + Example: [ + { name: "n0", type: "TokenAmount" }, + { name: "n1", type: "NftId" }, + ], + }, + primaryType: "Example", + domain: { + name: "StarkNet Mail", + version: "1", + chainId: "1", + revision: "1", + }, + message: { + n0: { + token_address: + "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + amount: { + low: "0x3e8", + high: "0x0", + }, + }, + n1: { + collection_address: + "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + token_id: { + low: "0x3e8", + high: "0x0", + }, + }, + }, + }, +] + +const structArrayMessage = [ + { + types: { + StarkNetDomain: [ + { name: "name", type: "felt" }, + { name: "version", type: "felt" }, + { name: "chainId", type: "felt" }, + ], + Person: [ + { name: "name", type: "felt" }, + { name: "wallet", type: "felt" }, + ], + Post: [ + { name: "title", type: "felt" }, + { name: "content", type: "felt" }, + ], + Mail: [ + { name: "from", type: "Person" }, + { name: "to", type: "Person" }, + { name: "posts_len", type: "felt" }, + { name: "posts", type: "Post*" }, + ], + }, + primaryType: "Mail", + domain: { + name: "StarkNet Mail", + version: "1", + chainId: 1, + }, + message: { + from: { + name: "Cow", + wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", + }, + to: { + name: "Bob", + wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", + }, + posts_len: 2, + posts: [ + { title: "Greeting", content: "Hello, Bob!" }, + { title: "Farewell", content: "Goodbye, Bob!" }, + ], + }, + }, +] + +const merkleTreeMessage = [ + { + primaryType: "Session", + types: { + Policy: [ + { name: "contractAddress", type: "felt" }, + { name: "selector", type: "selector" }, + ], + Session: [ + { name: "key", type: "felt" }, + { name: "expires", type: "felt" }, + { name: "root", type: "merkletree", contains: "Policy" }, + ], + StarkNetDomain: [ + { name: "name", type: "felt" }, + { name: "version", type: "felt" }, + { name: "chain_id", type: "felt" }, + ], + }, + domain: { + name: "StarkNet Mail", + version: "1", + chain_id: 1, + }, + message: { + key: "0x0000000000000000000000000000000000000000000000000000000000000000", + expires: + "0x0000000000000000000000000000000000000000000000000000000000000000", + root: [ + { + contractAddress: "0x1", + selector: "transfer", + }, + { + contractAddress: "0x2", + selector: "transfer", + }, + { + contractAddress: "0x3", + selector: "transfer", + }, + ], + }, + }, +] + +const hybridSessionKeysMessage = [ + { + types: { + StarknetDomain: [ + { name: "name", type: "shortstring" }, + { name: "version", type: "shortstring" }, + { name: "chainI", type: "shortstring" }, + { name: "revision", type: "shortstring" }, + ], + "Allowed Method": [ + { name: "Contract Address", type: "ContractAddress" }, + { name: "selector", type: "selector" }, + ], + Session: [ + { name: "Expires At", type: "timestamp" }, + { + name: "Allowed Methods", + type: "merkletree", + contains: "Allowed Method", + }, + { name: "Metadata", type: "string" }, + { name: "Session Key", type: "felt" }, + ], + }, + primaryType: "Session", + domain: { + name: "SessionAccount.session", + version: "1", + chainId: "SN_SEPOLIA", + revision: "1", + }, + message: { + "Expires At": "117090256870", + "Allowed Methods": [ + { + "Contract Address": + "0x3f68e12789ace09d195ba1a587550c19dbd665b7bd82da33b08ac83123db652", + selector: "set_number_double", + }, + ], + Metadata: + "{ 'projectID': '123456', 'maxFee': 1000000000000, 'feeToken': 'STRK', 'tokenLimits' : { '0x989898989' : 9999999999 } }", + "Session Key": + "2543707029695183230146761574221281240112511463954890350766793321580039814416", + }, + }, +] + +describe("types", () => { + describe("typedDataSchema", () => { + describe("when valid", () => { + test("should return valid for a base types message", async () => { + const result = + await StarknetMethodArgumentsSchemas.signMessage.parseAsync( + baseTypesMessage, + ) + expect(result).toMatchInlineSnapshot(` + [ + { + "domain": { + "chainId": "1", + "name": "StarkNet Mail", + "revision": "1", + "version": "1", + }, + "message": { + "n0": "0x3e8", + "n1": true, + "n2": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", + "n3": "transfer", + "n4": 10, + "n5": -10, + "n6": "0x3e8", + "n7": "0x3e8", + "n8": 1000, + "n9": "transfer", + }, + "primaryType": "Example", + "types": { + "Example": [ + { + "name": "n0", + "type": "felt", + }, + { + "name": "n1", + "type": "bool", + }, + { + "name": "n2", + "type": "string", + }, + { + "name": "n3", + "type": "selector", + }, + { + "name": "n4", + "type": "u128", + }, + { + "name": "n5", + "type": "i128", + }, + { + "name": "n6", + "type": "ContractAddress", + }, + { + "name": "n7", + "type": "ClassHash", + }, + { + "name": "n8", + "type": "timestamp", + }, + { + "name": "n9", + "type": "shortstring", + }, + ], + "StarknetDomain": [ + { + "name": "name", + "type": "shortstring", + }, + { + "name": "version", + "type": "shortstring", + }, + { + "name": "chainId", + "type": "shortstring", + }, + { + "name": "revision", + "type": "shortstring", + }, + ], + }, + }, + ] + `) + }) + test("should return valid for a preset types message", async () => { + const result = + await StarknetMethodArgumentsSchemas.signMessage.parseAsync( + presetTypesMessage, + ) + expect(result).toMatchInlineSnapshot(` + [ + { + "domain": { + "chainId": "1", + "name": "StarkNet Mail", + "revision": "1", + "version": "1", + }, + "message": { + "n0": { + "amount": { + "high": "0x0", + "low": "0x3e8", + }, + "token_address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + }, + "n1": { + "collection_address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + "token_id": { + "high": "0x0", + "low": "0x3e8", + }, + }, + }, + "primaryType": "Example", + "types": { + "Example": [ + { + "name": "n0", + "type": "TokenAmount", + }, + { + "name": "n1", + "type": "NftId", + }, + ], + "StarknetDomain": [ + { + "name": "name", + "type": "shortstring", + }, + { + "name": "version", + "type": "shortstring", + }, + { + "name": "chainId", + "type": "shortstring", + }, + { + "name": "revision", + "type": "shortstring", + }, + ], + }, + }, + ] + `) + }) + test("should return valid for a struct array message message", async () => { + const result = + await StarknetMethodArgumentsSchemas.signMessage.parseAsync( + structArrayMessage, + ) + expect(result).toMatchInlineSnapshot(` + [ + { + "domain": { + "chainId": 1, + "name": "StarkNet Mail", + "version": "1", + }, + "message": { + "from": { + "name": "Cow", + "wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", + }, + "posts": [ + { + "content": "Hello, Bob!", + "title": "Greeting", + }, + { + "content": "Goodbye, Bob!", + "title": "Farewell", + }, + ], + "posts_len": 2, + "to": { + "name": "Bob", + "wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", + }, + }, + "primaryType": "Mail", + "types": { + "Mail": [ + { + "name": "from", + "type": "Person", + }, + { + "name": "to", + "type": "Person", + }, + { + "name": "posts_len", + "type": "felt", + }, + { + "name": "posts", + "type": "Post*", + }, + ], + "Person": [ + { + "name": "name", + "type": "felt", + }, + { + "name": "wallet", + "type": "felt", + }, + ], + "Post": [ + { + "name": "title", + "type": "felt", + }, + { + "name": "content", + "type": "felt", + }, + ], + "StarkNetDomain": [ + { + "name": "name", + "type": "felt", + }, + { + "name": "version", + "type": "felt", + }, + { + "name": "chainId", + "type": "felt", + }, + ], + }, + }, + ] + `) + }) + test("should return valid for a merkle tree message", async () => { + const result = + await StarknetMethodArgumentsSchemas.signMessage.parseAsync( + merkleTreeMessage, + ) + expect(result).toMatchInlineSnapshot(` + [ + { + "domain": { + "chain_id": 1, + "name": "StarkNet Mail", + "version": "1", + }, + "message": { + "expires": "0x0000000000000000000000000000000000000000000000000000000000000000", + "key": "0x0000000000000000000000000000000000000000000000000000000000000000", + "root": [ + { + "contractAddress": "0x1", + "selector": "transfer", + }, + { + "contractAddress": "0x2", + "selector": "transfer", + }, + { + "contractAddress": "0x3", + "selector": "transfer", + }, + ], + }, + "primaryType": "Session", + "types": { + "Policy": [ + { + "name": "contractAddress", + "type": "felt", + }, + { + "name": "selector", + "type": "selector", + }, + ], + "Session": [ + { + "name": "key", + "type": "felt", + }, + { + "name": "expires", + "type": "felt", + }, + { + "contains": "Policy", + "name": "root", + "type": "merkletree", + }, + ], + "StarkNetDomain": [ + { + "name": "name", + "type": "felt", + }, + { + "name": "version", + "type": "felt", + }, + { + "name": "chain_id", + "type": "felt", + }, + ], + }, + }, + ] + `) + }) + test("should return valid for an enum message", async () => { + const result = + await StarknetMethodArgumentsSchemas.signMessage.parseAsync( + enumMessage, + ) + expect(result).toMatchInlineSnapshot(` + [ + { + "domain": { + "chainId": "1", + "name": "StarkNet Mail", + "revision": "1", + "version": "1", + }, + "message": { + "someEnum": { + "Variant 2": [ + 2, + [ + 0, + 1, + ], + ], + }, + }, + "primaryType": "Example", + "types": { + "Example": [ + { + "contains": "MyEnum", + "name": "someEnum", + "type": "enum", + }, + ], + "MyEnum": [ + { + "name": "Variant 1", + "type": "()", + }, + { + "name": "Variant 2", + "type": "(u128,u128*)", + }, + { + "name": "Variant 3", + "type": "(u128)", + }, + ], + "StarknetDomain": [ + { + "name": "name", + "type": "shortstring", + }, + { + "name": "version", + "type": "shortstring", + }, + { + "name": "chainId", + "type": "shortstring", + }, + { + "name": "revision", + "type": "shortstring", + }, + ], + }, + }, + ] + `) + }) + test("should return valid for a hybrid session key message", async () => { + const result = + await StarknetMethodArgumentsSchemas.signMessage.parseAsync( + hybridSessionKeysMessage, + ) + expect(result).toMatchInlineSnapshot(` + [ + { + "domain": { + "chainId": "SN_SEPOLIA", + "name": "SessionAccount.session", + "revision": "1", + "version": "1", + }, + "message": { + "Allowed Methods": [ + { + "Contract Address": "0x3f68e12789ace09d195ba1a587550c19dbd665b7bd82da33b08ac83123db652", + "selector": "set_number_double", + }, + ], + "Expires At": "117090256870", + "Metadata": "{ 'projectID': '123456', 'maxFee': 1000000000000, 'feeToken': 'STRK', 'tokenLimits' : { '0x989898989' : 9999999999 } }", + "Session Key": "2543707029695183230146761574221281240112511463954890350766793321580039814416", + }, + "primaryType": "Session", + "types": { + "Allowed Method": [ + { + "name": "Contract Address", + "type": "ContractAddress", + }, + { + "name": "selector", + "type": "selector", + }, + ], + "Session": [ + { + "name": "Expires At", + "type": "timestamp", + }, + { + "contains": "Allowed Method", + "name": "Allowed Methods", + "type": "merkletree", + }, + { + "name": "Metadata", + "type": "string", + }, + { + "name": "Session Key", + "type": "felt", + }, + ], + "StarknetDomain": [ + { + "name": "name", + "type": "shortstring", + }, + { + "name": "version", + "type": "shortstring", + }, + { + "name": "chainI", + "type": "shortstring", + }, + { + "name": "revision", + "type": "shortstring", + }, + ], + }, + }, + ] + `) + }) + test("should return valid for a base message", async () => { + const result = + await StarknetMethodArgumentsSchemas.signMessage.parseAsync( + baseMessage, + ) + expect(result).toMatchInlineSnapshot(` + [ + { + "domain": { + "chainId": 1, + "name": "StarkNet Mail", + "version": "1", + }, + "message": { + "contents": "Hello, Bob!", + "from": { + "name": "Cow", + "wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", + }, + "to": { + "name": "Bob", + "wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", + }, + }, + "primaryType": "Mail", + "types": { + "Mail": [ + { + "name": "from", + "type": "Person", + }, + { + "name": "to", + "type": "Person", + }, + { + "name": "contents", + "type": "felt", + }, + ], + "Person": [ + { + "name": "name", + "type": "felt", + }, + { + "name": "wallet", + "type": "felt", + }, + ], + "StarkNetDomain": [ + { + "name": "name", + "type": "felt", + }, + { + "name": "version", + "type": "felt", + }, + { + "name": "chainId", + "type": "felt", + }, + ], + }, + }, + ] + `) + }) + test("should return valid", async () => { + const result = + await StarknetMethodArgumentsSchemas.signMessage.parseAsync(message) + expect(result).toMatchInlineSnapshot(` + [ + { + "domain": { + "chainId": "SN_GOERLI", + "name": "Example DApp", + "version": "0.0.1", + }, + "message": { + "message": "Lorem ipsum dolor", + }, + "primaryType": "Message", + "types": { + "Message": [ + { + "name": "message", + "type": "felt", + }, + ], + "StarkNetDomain": [ + { + "name": "name", + "type": "felt", + }, + { + "name": "chainId", + "type": "felt", + }, + { + "name": "version", + "type": "felt", + }, + ], + }, + }, + ] + `) + }) + }) + }) +}) diff --git a/src/types/window.ts b/src/window/window.ts similarity index 84% rename from src/types/window.ts rename to src/window/window.ts index 212ed1a..1edd879 100644 --- a/src/types/window.ts +++ b/src/window/window.ts @@ -68,9 +68,48 @@ export const typedDataSchema = z.object({ ), primaryType: z.string(), domain: z.record(z.unknown()), - message: z.any(), + message: z.record(z.unknown()), }) +export const AssetSchema = z.object({ + type: z.literal("ERC20"), + options: z.object({ + address: z.string(), + symbol: z.string().optional(), + decimals: z.number().optional(), + image: z.string().optional(), + name: z.string().optional(), + }), +}) + +export const AddStarknetChainParametersSchema = z.union([ + z.object({ + id: z.string(), + chain_id: z.string(), + chain_name: z.string(), + rpc_urls: z.array(z.string()).optional(), + native_currency: AssetSchema.optional(), + block_explorer_url: z.array(z.string()).optional(), + }), + z + .object({ + id: z.string(), + chainId: z.string(), + chainName: z.string(), + rpcUrls: z.array(z.string()).optional(), + nativeCurrency: AssetSchema.optional(), + blockExplorerUrl: z.array(z.string()).optional(), + }) + // for backwards compatibility + .transform((value) => ({ + id: value.id, + chain_id: value.chainId, + chain_name: value.chainName, + rpc_urls: value.rpcUrls, + native_currency: value.nativeCurrency, + block_explorer_url: value.blockExplorerUrl, + })), +]) export const StarknetMethodArgumentsSchemas = { enable: z .tuple([ @@ -83,42 +122,16 @@ export const StarknetMethodArgumentsSchemas = { .optional(), ]) .or(z.tuple([])), - addStarknetChain: z.tuple([ - z.object({ - id: z.string(), - chainId: z.string(), - chainName: z.string(), - rpcUrls: z.array(z.string()).optional(), - nativeCurrency: z - .object({ - name: z.string(), - symbol: z.string(), - decimals: z.number(), - }) - .optional(), - blockExplorerUrls: z.array(z.string()).optional(), - }), - ]), + addStarknetChain: z.tuple([AddStarknetChainParametersSchema]), switchStarknetChain: z.tuple([ z.object({ chainId: z.string(), }), ]), - watchAsset: z.tuple([ - z.object({ - type: z.literal("ERC20"), - options: z.object({ - address: z.string(), - symbol: z.string().optional(), - decimals: z.number().optional(), - image: z.string().optional(), - name: z.string().optional(), - }), - }), - ]), + watchAsset: z.tuple([AssetSchema]), requestAccounts: z.tuple([ z.object({ - silentMode: z.boolean().optional(), + silent_mode: z.boolean().optional(), }), ]), execute: z.tuple([