diff --git a/package-lock.json b/package-lock.json index 7b5bc535b..de0d9f2f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,9 @@ "version": "1.0.0", "dependencies": { "@binance/w3w-rainbow-connector-v2": "^1.0.2", + "@cowprotocol/cow-sdk": "^7.0.8", + "@cowprotocol/sdk-app-data": "^4.1.1", + "@cowprotocol/sdk-viem-adapter": "^0.1.2", "@dnd-kit/core": "^6.0.5", "@dnd-kit/sortable": "^7.0.1", "@dnd-kit/utilities": "^3.2.0", @@ -37,7 +40,7 @@ "@radix-ui/react-toggle": "^1.1.1", "@radix-ui/react-toggle-group": "^1.1.1", "@radix-ui/react-tooltip": "^1.1.8", - "@rainbow-me/rainbowkit": "2.2.8", + "@rainbow-me/rainbowkit": "2.2.9", "@react-spring/web": "^9.7.1", "@reserve-protocol/dtf-rebalance-lib": "2.6.3", "@reserve-protocol/react-zapper": "^1.4.0", @@ -63,6 +66,7 @@ "lucide-react": "^0.461.0", "mixpanel-browser": "2.56.0", "next-themes": "^0.4.4", + "p-limit": "^6.2.0", "react": "18.3.1", "react-dom": "18.3.1", "react-dropzone": "^14.3.5", @@ -85,6 +89,7 @@ "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", "theme-ui": "0.17.1", + "universal-sdk": "^0.1.34", "vaul": "^1.1.1", "viem": "2.37.9", "wagmi": "2.17.5", @@ -116,6 +121,7 @@ "typescript": "5.6.3", "vite": "5.4.8", "vite-bundle-visualizer": "1.2.1", + "vite-plugin-node-polyfills": "^0.23.0", "vite-plugin-static-copy": "^2.1.0", "vite-tsconfig-paths": "^4.2.0", "vitest": "^3.1.3" @@ -162,6 +168,12 @@ "node": ">=6.0.0" } }, + "node_modules/@assemblyscript/loader": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.9.4.tgz", + "integrity": "sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA==", + "license": "Apache-2.0" + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -2168,6 +2180,145 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@cowprotocol/cow-sdk": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@cowprotocol/cow-sdk/-/cow-sdk-7.0.8.tgz", + "integrity": "sha512-G2RZvVsoZvLysXVtZWDXQuRMtEoyfL1P36gTt7YZA80ulUuZMBREtFPSwrRRxaGaDKvvmxa8ZS9FdQ5sWsA2ZA==", + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "@cowprotocol/sdk-app-data": "4.1.1", + "@cowprotocol/sdk-common": "0.2.1", + "@cowprotocol/sdk-config": "0.1.0", + "@cowprotocol/sdk-contracts-ts": "0.3.1", + "@cowprotocol/sdk-order-book": "0.1.2", + "@cowprotocol/sdk-order-signing": "0.1.5", + "@cowprotocol/sdk-trading": "0.3.2" + }, + "peerDependencies": { + "@openzeppelin/merkle-tree": "^1.x", + "cross-fetch": "^3.x", + "ipfs-only-hash": "^4.x", + "multiformats": "^9.x" + }, + "peerDependenciesMeta": { + "@openzeppelin/merkle-tree": { + "optional": true + }, + "cross-fetch": { + "optional": false + }, + "ipfs-only-hash": { + "optional": true + }, + "multiformats": { + "optional": true + } + } + }, + "node_modules/@cowprotocol/sdk-app-data": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cowprotocol/sdk-app-data/-/sdk-app-data-4.1.1.tgz", + "integrity": "sha512-1S5oNejCX2sznRkrteDDoVSK1+HUHEXXI1yTihEN+ptIvnI1t9oI9Sp3SEil7TdPSfpliO+qMNGBflHJZbSI0A==", + "license": "MIT", + "dependencies": { + "@cowprotocol/sdk-common": "0.2.1", + "ajv": "^8.11.0", + "cross-fetch": "^3.1.5", + "ipfs-only-hash": "^4.0.0", + "json-stringify-deterministic": "^1.0.8", + "multiformats": "^9.6.4" + }, + "peerDependencies": { + "ajv": "^8.x", + "cross-fetch": "^3.x", + "ipfs-only-hash": "^4.x", + "multiformats": "^9.x" + } + }, + "node_modules/@cowprotocol/sdk-common": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@cowprotocol/sdk-common/-/sdk-common-0.2.1.tgz", + "integrity": "sha512-7EBKg7CyKLAtmDZdAh5Nsv2KPstUNbdLuNXtCimQk+TNb6OhWgNnCuCf9tOCyQ/yllQvXfNEc5shdXQfx5VXdw==", + "license": "MIT" + }, + "node_modules/@cowprotocol/sdk-config": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@cowprotocol/sdk-config/-/sdk-config-0.1.0.tgz", + "integrity": "sha512-tbGbsa0IzlwDEAzl/03m/p7/AHe3p2BmdUykytVfLAGzKT8/8TDgD2FULtr5n4oaBFDpHCApaFZvpplQufZDGQ==", + "license": "MIT", + "dependencies": { + "exponential-backoff": "^3.1.1", + "limiter": "^2.1.0" + } + }, + "node_modules/@cowprotocol/sdk-contracts-ts": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@cowprotocol/sdk-contracts-ts/-/sdk-contracts-ts-0.3.1.tgz", + "integrity": "sha512-0iC0VNnpxvMcv31osin67kWhmhSbWnNsqvLLR7lWedbgrLWGpEl0qavqikIAzkaTsTb7Lw72p38j6Jqkgno22Q==", + "license": "MIT", + "dependencies": { + "@cowprotocol/sdk-common": "0.2.1", + "@cowprotocol/sdk-config": "0.1.0" + } + }, + "node_modules/@cowprotocol/sdk-order-book": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@cowprotocol/sdk-order-book/-/sdk-order-book-0.1.2.tgz", + "integrity": "sha512-dYJESuhxqJ1mcrp8Fmxg88dRildymh88xeOtJsOYIep8yMixCluSBQTmfokNeraYGytTWL187cyPtOvC95pneg==", + "license": "MIT", + "dependencies": { + "@cowprotocol/sdk-common": "0.2.1", + "@cowprotocol/sdk-config": "0.1.0", + "cross-fetch": "^3.2.0", + "exponential-backoff": "^3.1.2", + "limiter": "^3.0.0" + } + }, + "node_modules/@cowprotocol/sdk-order-book/node_modules/limiter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-3.0.0.tgz", + "integrity": "sha512-hev7DuXojsTFl2YwyzUJMDnZ/qBDd3yZQLSH3aD4tdL1cqfc3TMnoecEJtWFaQFdErZsKoFMBTxF/FBSkgDbEg==", + "license": "MIT" + }, + "node_modules/@cowprotocol/sdk-order-signing": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@cowprotocol/sdk-order-signing/-/sdk-order-signing-0.1.5.tgz", + "integrity": "sha512-geklxUqOajoPA/A+6b/AXmCeXyCkiaQfKgJv/E/z76JN3U0GrQPNUTcefd8qUa+hE/UF3RPjxrRkcc5N/zc2fA==", + "license": "MIT", + "dependencies": { + "@cowprotocol/sdk-common": "0.2.1", + "@cowprotocol/sdk-config": "0.1.0", + "@cowprotocol/sdk-contracts-ts": "0.3.1", + "@cowprotocol/sdk-order-book": "0.1.2" + } + }, + "node_modules/@cowprotocol/sdk-trading": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@cowprotocol/sdk-trading/-/sdk-trading-0.3.2.tgz", + "integrity": "sha512-W10c9Ocks0RPsTlwWXgNaz6rIpNOH9rU4G1gSBx5RpFDeKgfsw5qbhCb72TaX49PleSbZjbgpuVxzKHy9b3riQ==", + "license": "MIT", + "dependencies": { + "@cowprotocol/sdk-app-data": "4.1.1", + "@cowprotocol/sdk-common": "0.2.1", + "@cowprotocol/sdk-config": "0.1.0", + "@cowprotocol/sdk-contracts-ts": "0.3.1", + "@cowprotocol/sdk-order-book": "0.1.2", + "@cowprotocol/sdk-order-signing": "0.1.5", + "deepmerge": "^4.3.1" + } + }, + "node_modules/@cowprotocol/sdk-viem-adapter": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@cowprotocol/sdk-viem-adapter/-/sdk-viem-adapter-0.1.2.tgz", + "integrity": "sha512-3+hyq97YO/YtSR04qyPJCscliniKOxgiAlBSOaObkp8d+J6G4zkMgGMzSlk4G84hy6lacmtsKPwz/Aeht5kX+w==", + "license": "MIT", + "dependencies": { + "@cowprotocol/sdk-common": "0.2.1" + }, + "peerDependencies": { + "viem": "^2.28.4" + } + }, "node_modules/@dnd-kit/accessibility": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz", @@ -2923,6 +3074,26 @@ "@ethersproject/bytes": "^5.8.0" } }, + "node_modules/@ethersproject/basex": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.8.0.tgz", + "integrity": "sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/properties": "^5.8.0" + } + }, "node_modules/@ethersproject/bignumber": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.8.0.tgz", @@ -2982,6 +3153,34 @@ "@ethersproject/bignumber": "^5.8.0" } }, + "node_modules/@ethersproject/contracts": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.8.0.tgz", + "integrity": "sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "^5.8.0", + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/transactions": "^5.8.0" + } + }, "node_modules/@ethersproject/hash": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.8.0.tgz", @@ -3009,6 +3208,67 @@ "@ethersproject/strings": "^5.8.0" } }, + "node_modules/@ethersproject/hdnode": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.8.0.tgz", + "integrity": "sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/basex": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/pbkdf2": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/sha2": "^5.8.0", + "@ethersproject/signing-key": "^5.8.0", + "@ethersproject/strings": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "@ethersproject/wordlists": "^5.8.0" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.8.0.tgz", + "integrity": "sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/hdnode": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/pbkdf2": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/random": "^5.8.0", + "@ethersproject/strings": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, "node_modules/@ethersproject/keccak256": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.8.0.tgz", @@ -3064,6 +3324,26 @@ "@ethersproject/logger": "^5.8.0" } }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.8.0.tgz", + "integrity": "sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/sha2": "^5.8.0" + } + }, "node_modules/@ethersproject/properties": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.8.0.tgz", @@ -3083,10 +3363,10 @@ "@ethersproject/logger": "^5.8.0" } }, - "node_modules/@ethersproject/rlp": { + "node_modules/@ethersproject/providers": { "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.8.0.tgz", - "integrity": "sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.8.0.tgz", + "integrity": "sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw==", "funding": [ { "type": "individual", @@ -3099,14 +3379,53 @@ ], "license": "MIT", "dependencies": { + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/base64": "^5.8.0", + "@ethersproject/basex": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0" + "@ethersproject/constants": "^5.8.0", + "@ethersproject/hash": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/networks": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/random": "^5.8.0", + "@ethersproject/rlp": "^5.8.0", + "@ethersproject/sha2": "^5.8.0", + "@ethersproject/strings": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "@ethersproject/web": "^5.8.0", + "bech32": "1.1.4", + "ws": "8.18.0" } }, - "node_modules/@ethersproject/signing-key": { + "node_modules/@ethersproject/providers/node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@ethersproject/random": { "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.8.0.tgz", - "integrity": "sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.8.0.tgz", + "integrity": "sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A==", "funding": [ { "type": "individual", @@ -3120,17 +3439,13 @@ "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "bn.js": "^5.2.1", - "elliptic": "6.6.1", - "hash.js": "1.1.7" + "@ethersproject/logger": "^5.8.0" } }, - "node_modules/@ethersproject/strings": { + "node_modules/@ethersproject/rlp": { "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.8.0.tgz", - "integrity": "sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.8.0.tgz", + "integrity": "sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==", "funding": [ { "type": "individual", @@ -3144,14 +3459,13 @@ "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", "@ethersproject/logger": "^5.8.0" } }, - "node_modules/@ethersproject/transactions": { + "node_modules/@ethersproject/sha2": { "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.8.0.tgz", - "integrity": "sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.8.0.tgz", + "integrity": "sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A==", "funding": [ { "type": "individual", @@ -3164,21 +3478,15 @@ ], "license": "MIT", "dependencies": { - "@ethersproject/address": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/rlp": "^5.8.0", - "@ethersproject/signing-key": "^5.8.0" + "hash.js": "1.1.7" } }, - "node_modules/@ethersproject/web": { + "node_modules/@ethersproject/signing-key": { "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.8.0.tgz", - "integrity": "sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.8.0.tgz", + "integrity": "sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==", "funding": [ { "type": "individual", @@ -3191,24 +3499,197 @@ ], "license": "MIT", "dependencies": { - "@ethersproject/base64": "^5.8.0", "@ethersproject/bytes": "^5.8.0", "@ethersproject/logger": "^5.8.0", "@ethersproject/properties": "^5.8.0", - "@ethersproject/strings": "^5.8.0" + "bn.js": "^5.2.1", + "elliptic": "6.6.1", + "hash.js": "1.1.7" } }, - "node_modules/@floating-ui/core": { - "version": "1.6.9", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.9.tgz", - "integrity": "sha512-uMXCuQ3BItDUbAMhIXw7UPXRfAlOAvZzdK9BWpE60MCn+Svt3aLn9jsPTi/WNGlRUu2uI0v5S7JiIUsbsvh3fw==", + "node_modules/@ethersproject/solidity": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.8.0.tgz", + "integrity": "sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], "license": "MIT", "dependencies": { - "@floating-ui/utils": "^0.2.9" - } - }, - "node_modules/@floating-ui/dom": { - "version": "1.6.13", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/sha2": "^5.8.0", + "@ethersproject/strings": "^5.8.0" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.8.0.tgz", + "integrity": "sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/logger": "^5.8.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.8.0.tgz", + "integrity": "sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/rlp": "^5.8.0", + "@ethersproject/signing-key": "^5.8.0" + } + }, + "node_modules/@ethersproject/units": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.8.0.tgz", + "integrity": "sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/logger": "^5.8.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.8.0.tgz", + "integrity": "sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/hash": "^5.8.0", + "@ethersproject/hdnode": "^5.8.0", + "@ethersproject/json-wallets": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/random": "^5.8.0", + "@ethersproject/signing-key": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "@ethersproject/wordlists": "^5.8.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.8.0.tgz", + "integrity": "sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/base64": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" + } + }, + "node_modules/@ethersproject/wordlists": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.8.0.tgz", + "integrity": "sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/hash": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" + } + }, + "node_modules/@floating-ui/core": { + "version": "1.6.9", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.9.tgz", + "integrity": "sha512-uMXCuQ3BItDUbAMhIXw7UPXRfAlOAvZzdK9BWpE60MCn+Svt3aLn9jsPTi/WNGlRUu2uI0v5S7JiIUsbsvh3fw==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.9" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.13", "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.13.tgz", "integrity": "sha512-umqzocjDgNRGTuO7Q8CU32dkHkECqI8ZdMZ5Swb6QAM0t5rnlrN3lGo1hdpscRd3WS8T6DKYK4ephgIH9iRh3w==", "license": "MIT", @@ -3281,6 +3762,12 @@ "npm": ">=7.0.0" } }, + "node_modules/@ipld/dag-cbor/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/@ipld/dag-json": { "version": "10.2.3", "resolved": "https://registry.npmjs.org/@ipld/dag-json/-/dag-json-10.2.3.tgz", @@ -3295,6 +3782,12 @@ "npm": ">=7.0.0" } }, + "node_modules/@ipld/dag-json/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/@ipld/dag-pb": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/@ipld/dag-pb/-/dag-pb-4.1.3.tgz", @@ -3308,6 +3801,12 @@ "npm": ">=7.0.0" } }, + "node_modules/@ipld/dag-pb/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -3479,9 +3978,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { @@ -3579,6 +4078,12 @@ "uint8arrays": "^5.1.0" } }, + "node_modules/@libp2p/crypto/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/@libp2p/interface": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.7.0.tgz", @@ -3593,6 +4098,12 @@ "uint8arraylist": "^2.4.8" } }, + "node_modules/@libp2p/interface/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/@libp2p/logger": { "version": "5.1.13", "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.13.tgz", @@ -3606,6 +4117,12 @@ "weald": "^1.0.4" } }, + "node_modules/@libp2p/logger/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/@libp2p/peer-id": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.1.0.tgz", @@ -3618,6 +4135,12 @@ "uint8arrays": "^5.1.0" } }, + "node_modules/@libp2p/peer-id/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/@lingui/babel-plugin-extract-messages": { "version": "4.14.0", "resolved": "https://registry.npmjs.org/@lingui/babel-plugin-extract-messages/-/babel-plugin-extract-messages-4.14.0.tgz", @@ -4516,6 +5039,12 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/@multiformats/base-x": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/base-x/-/base-x-4.0.1.tgz", + "integrity": "sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw==", + "license": "MIT" + }, "node_modules/@multiformats/dns": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@multiformats/dns/-/dns-1.0.6.tgz", @@ -4554,6 +5083,12 @@ "@multiformats/multiaddr": "^12.3.0" } }, + "node_modules/@multiformats/multiaddr/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/@next/env": { "version": "15.3.5", "resolved": "https://registry.npmjs.org/@next/env/-/env-15.3.5.tgz", @@ -4687,6 +5222,70 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, "node_modules/@radix-ui/number": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.0.tgz", @@ -8530,16 +9129,16 @@ "license": "MIT" }, "node_modules/@rainbow-me/rainbowkit": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/@rainbow-me/rainbowkit/-/rainbowkit-2.2.8.tgz", - "integrity": "sha512-EdNIK2cdAT6GJ9G11wx7nCVfjqBfxh7dx/1DhPYrB+yg+VFrII6cM1PiMFVC9evD4mqVHe9mmLAt3nvlwDdiPQ==", + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rainbow-me/rainbowkit/-/rainbowkit-2.2.9.tgz", + "integrity": "sha512-zXAeqkqpznpj9yEs1bTbpZbq0pVYKdJUnqqK/nI8xyYFDWchIOyBoEb/4+goT5RaHfGbDe9dp6pIEu/KelKE6A==", "license": "MIT", "dependencies": { "@vanilla-extract/css": "1.17.3", "@vanilla-extract/dynamic": "2.1.4", "@vanilla-extract/sprinkles": "1.6.4", "clsx": "2.1.1", - "cuer": "0.0.2", + "cuer": "0.0.3", "react-remove-scroll": "2.6.2", "ua-parser-js": "^1.0.37" }, @@ -8972,12 +9571,6 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, - "node_modules/@reown/appkit-controllers/node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==", - "license": "(Apache-2.0 AND MIT)" - }, "node_modules/@reown/appkit-controllers/node_modules/ox": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.7.tgz", @@ -9509,12 +10102,6 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, - "node_modules/@reown/appkit-utils/node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==", - "license": "(Apache-2.0 AND MIT)" - }, "node_modules/@reown/appkit-utils/node_modules/ox": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.7.tgz", @@ -9980,12 +10567,6 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, - "node_modules/@reown/appkit/node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==", - "license": "(Apache-2.0 AND MIT)" - }, "node_modules/@reown/appkit/node_modules/ox": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.7.tgz", @@ -10227,30 +10808,103 @@ "integrity": "sha512-VYP0BNhULhFzAGpzaqe1pkuMpCvLmuNYsYHE0xkKgiqaMZdztSlnCNK2BRlsDbFD/HQZwcoAoYjFpEHQbq2GoA==", "license": "ISC" }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.38.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.38.0.tgz", - "integrity": "sha512-ldomqc4/jDZu/xpYU+aRxo3V4mGCV9HeTgUBANI3oIQMOL+SsxB+S2lxMpkFp5UamSS3XuTMQVbsS24R4J4Qjg==", - "cpu": [ - "arm" - ], + "node_modules/@rollup/plugin-inject": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz", + "integrity": "sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "android" - ] + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.38.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.38.0.tgz", - "integrity": "sha512-VUsgcy4GhhT7rokwzYQP+aV9XnSLkkhlEJ0St8pbasuWO/vwphhZQxYEKUP3ayeCYLhk6gEtacRpYP/cj3GjyQ==", - "cpu": [ - "arm64" - ], + "node_modules/@rollup/plugin-inject/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/pluginutils": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", + "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", "dev": true, "license": "MIT", - "optional": true, + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/pluginutils/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.38.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.38.0.tgz", + "integrity": "sha512-ldomqc4/jDZu/xpYU+aRxo3V4mGCV9HeTgUBANI3oIQMOL+SsxB+S2lxMpkFp5UamSS3XuTMQVbsS24R4J4Qjg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.38.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.38.0.tgz", + "integrity": "sha512-VUsgcy4GhhT7rokwzYQP+aV9XnSLkkhlEJ0St8pbasuWO/vwphhZQxYEKUP3ayeCYLhk6gEtacRpYP/cj3GjyQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, "os": [ "android" ] @@ -11662,6 +12316,12 @@ "integrity": "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==", "license": "MIT" }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT" + }, "node_modules/@types/mdast": { "version": "3.0.15", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", @@ -11671,6 +12331,12 @@ "@types/unist": "^2" } }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", + "license": "MIT" + }, "node_modules/@types/mixpanel-browser": { "version": "2.54.0", "resolved": "https://registry.npmjs.org/@types/mixpanel-browser/-/mixpanel-browser-2.54.0.tgz", @@ -11693,6 +12359,12 @@ "undici-types": "~6.19.8" } }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "license": "MIT" + }, "node_modules/@types/parse-json": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", @@ -11858,6 +12530,58 @@ "react-dom": ">=16.8.0" } }, + "node_modules/@uniswap/permit2-sdk": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@uniswap/permit2-sdk/-/permit2-sdk-1.4.0.tgz", + "integrity": "sha512-l/aGhfhB93M76vXs4eB8QNwhELE6bs66kh7F1cyobaPtINaVpMmlJv+j3KmHeHwAZIsh7QXyYzhDxs07u0Pe4Q==", + "license": "MIT", + "dependencies": { + "ethers": "^5.7.0", + "tiny-invariant": "^1.1.0" + } + }, + "node_modules/@uniswap/sdk-core": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-4.2.1.tgz", + "integrity": "sha512-hr7vwYrXScg+V8/rRc2UL/Ixc/p0P7yqe4D/OxzUdMRYr8RZd+8z5Iu9+WembjZT/DCdbTjde6lsph4Og0n1BQ==", + "license": "MIT", + "dependencies": { + "@ethersproject/address": "^5.0.2", + "big.js": "^5.2.2", + "decimal.js-light": "^2.5.0", + "jsbi": "^3.1.4", + "tiny-invariant": "^1.1.0", + "toformat": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@uniswap/sdk-core/node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/@uniswap/uniswapx-sdk": { + "version": "2.0.1-alpha.10", + "resolved": "https://registry.npmjs.org/@uniswap/uniswapx-sdk/-/uniswapx-sdk-2.0.1-alpha.10.tgz", + "integrity": "sha512-nDWJ9qLFBLId2lxJ8TMy15HIBlzQe2yFE6LEJSzEF1T5EGDFv1G/ioKQSm2LJg4cO11UfVouHKsn6rwYS6P9wA==", + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/providers": "^5.7.0", + "@uniswap/permit2-sdk": "^1.2.0", + "@uniswap/sdk-core": "^4.0.3", + "ethers": "^5.7.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@vanilla-extract/css": { "version": "1.17.3", "resolved": "https://registry.npmjs.org/@vanilla-extract/css/-/css-1.17.3.tgz", @@ -11982,15 +12706,6 @@ } } }, - "node_modules/@vitest/mocker/node_modules/magic-string": { - "version": "0.30.17", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", - "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, "node_modules/@vitest/pretty-format": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.1.3.tgz", @@ -12036,15 +12751,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/snapshot/node_modules/magic-string": { - "version": "0.30.17", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", - "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, "node_modules/@vitest/snapshot/node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", @@ -12231,12 +12937,6 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, - "node_modules/@walletconnect/core/node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==", - "license": "(Apache-2.0 AND MIT)" - }, "node_modules/@walletconnect/core/node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", @@ -12707,12 +13407,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@walletconnect/relay-auth/node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==", - "license": "(Apache-2.0 AND MIT)" - }, "node_modules/@walletconnect/relay-auth/node_modules/uint8arrays": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", @@ -13268,12 +13962,6 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, - "node_modules/@walletconnect/utils/node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==", - "license": "(Apache-2.0 AND MIT)" - }, "node_modules/@walletconnect/utils/node_modules/ox": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.7.tgz", @@ -13542,6 +14230,12 @@ "node": ">=0.4.0" } }, + "node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "license": "MIT" + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -13554,6 +14248,22 @@ "node": ">= 6.0.0" } }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -13674,6 +14384,48 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/assert": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", + "integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "is-nan": "^1.3.2", + "object-is": "^1.1.5", + "object.assign": "^4.1.4", + "util": "^0.12.5" + } + }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -13941,6 +14693,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "license": "MIT" + }, "node_modules/big.js": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-6.2.2.tgz", @@ -14003,6 +14761,12 @@ "ieee754": "^1.1.13" } }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "license": "MIT" + }, "node_modules/blob-to-it": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/blob-to-it/-/blob-to-it-2.0.8.tgz", @@ -14071,6 +14835,156 @@ "integrity": "sha512-+aDq+8QoTxIklc9m21oVg96Bm18EpeVke4/8vWPNu+9Ktd+G4PYavitE4gv/pjIndw1q+vxE/Rcnv1zYHrEQbQ==", "license": "Apache-2.0 OR MIT" }, + "node_modules/browser-resolve": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", + "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve": "^1.17.0" + } + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.1.tgz", + "integrity": "sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^5.2.1", + "randombytes": "^2.1.0", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.5.tgz", + "integrity": "sha512-C2AUdAJg6rlM2W5QMp2Q4KGQMVBwR1lIimTsUnutJ8bMpW5B52pGpR2gEnNBNwijumDo5FojQ0L9JrXA8m4YEw==", + "dev": true, + "license": "ISC", + "dependencies": { + "bn.js": "^5.2.2", + "browserify-rsa": "^4.1.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.6.1", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.9", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/browserify-sign/node_modules/bn.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.2.tgz", + "integrity": "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==", + "dev": true, + "license": "MIT" + }, + "node_modules/browserify-sign/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/browserify-sign/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/browserify-sign/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pako": "~1.0.5" + } + }, "node_modules/browserslist": { "version": "4.24.4", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", @@ -14136,6 +15050,13 @@ "ieee754": "^1.2.1" } }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true, + "license": "MIT" + }, "node_modules/bufferutil": { "version": "4.0.9", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.9.tgz", @@ -14149,6 +15070,13 @@ "node": ">=6.14.2" } }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", + "dev": true, + "license": "MIT" + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -14248,9 +15176,35 @@ "node": ">= 6" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001745", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001745.tgz", + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "license": "MIT", + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001745", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001745.tgz", "integrity": "sha512-ywt6i8FzvdgrrrGbr1jZVObnVv6adj+0if2/omv9cmR2oiZs30zL4DIyaptKcbOrBdOIc74QTMoJvSE2QHh5UQ==", "funding": [ { @@ -14440,6 +15394,47 @@ "node": ">=8" } }, + "node_modules/cids": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/cids/-/cids-1.1.9.tgz", + "integrity": "sha512-l11hWRfugIcbGuTZwAM5PwpjPPjyb6UZOGwlHSnOBV5o07XhQ4gNpBN67FbODvpjyHtd+0Xs6KNvUcGBiDRsdg==", + "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", + "dependencies": { + "multibase": "^4.0.1", + "multicodec": "^3.0.1", + "multihashes": "^4.0.1", + "uint8arrays": "^3.0.0" + }, + "engines": { + "node": ">=4.0.0", + "npm": ">=3.0.0" + } + }, + "node_modules/cids/node_modules/uint8arrays": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", + "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, + "node_modules/cipher-base": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.7.tgz", + "integrity": "sha512-Mz9QMT5fJe7bKI7MH31UilT5cEK5EHHRCccw/YRFsRY47AuNgaV6HY3rscp0/I4Q+tTW/5zoqpSeRRI54TkDWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.2" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/class-variance-authority": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz", @@ -14620,6 +15615,19 @@ "dev": true, "license": "MIT" }, + "node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", + "dev": true, + "license": "MIT" + }, "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", @@ -14699,6 +15707,60 @@ "node": ">=0.8" } }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, "node_modules/cross-fetch": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz", @@ -14731,6 +15793,33 @@ "uncrypto": "^0.1.3" } }, + "node_modules/crypto-browserify": { + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.1.tgz", + "integrity": "sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserify-cipher": "^1.0.1", + "browserify-sign": "^4.2.3", + "create-ecdh": "^4.0.4", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "diffie-hellman": "^5.0.3", + "hash-base": "~3.0.4", + "inherits": "^2.0.4", + "pbkdf2": "^3.1.2", + "public-encrypt": "^4.0.3", + "randombytes": "^2.1.0", + "randomfill": "^1.0.4" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/css-selector-parser": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-1.4.1.tgz", @@ -14775,9 +15864,9 @@ "license": "MIT" }, "node_modules/cuer": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/cuer/-/cuer-0.0.2.tgz", - "integrity": "sha512-MG1BYnnSLqBnO0dOBS1Qm/TEc9DnFa9Sz2jMA24OF4hGzs8UuPjpKBMkRPF3lrpC+7b3EzULwooX9djcvsM8IA==", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/cuer/-/cuer-0.0.3.tgz", + "integrity": "sha512-f/UNxRMRCYtfLEGECAViByA3JNflZImOk11G9hwSd+44jvzrc99J35u5l+fbdQ2+ZG441GvOpaeGYBmWquZsbQ==", "funding": [ { "type": "github", @@ -14979,6 +16068,31 @@ "node": ">=0.10.0" } }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "license": "MIT", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/decimal.js-light": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", @@ -15169,6 +16283,17 @@ "valtio": "*" } }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "node_modules/destr": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", @@ -15212,6 +16337,25 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "dev": true, + "license": "MIT" + }, "node_modules/dijkstrajs": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", @@ -15266,6 +16410,19 @@ "csstype": "^3.0.2" } }, + "node_modules/domain-browser": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", + "integrity": "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, "node_modules/dotenv": { "version": "16.5.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", @@ -15825,6 +16982,103 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/ethers": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.8.0.tgz", + "integrity": "sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "5.8.0", + "@ethersproject/abstract-provider": "5.8.0", + "@ethersproject/abstract-signer": "5.8.0", + "@ethersproject/address": "5.8.0", + "@ethersproject/base64": "5.8.0", + "@ethersproject/basex": "5.8.0", + "@ethersproject/bignumber": "5.8.0", + "@ethersproject/bytes": "5.8.0", + "@ethersproject/constants": "5.8.0", + "@ethersproject/contracts": "5.8.0", + "@ethersproject/hash": "5.8.0", + "@ethersproject/hdnode": "5.8.0", + "@ethersproject/json-wallets": "5.8.0", + "@ethersproject/keccak256": "5.8.0", + "@ethersproject/logger": "5.8.0", + "@ethersproject/networks": "5.8.0", + "@ethersproject/pbkdf2": "5.8.0", + "@ethersproject/properties": "5.8.0", + "@ethersproject/providers": "5.8.0", + "@ethersproject/random": "5.8.0", + "@ethersproject/rlp": "5.8.0", + "@ethersproject/sha2": "5.8.0", + "@ethersproject/signing-key": "5.8.0", + "@ethersproject/solidity": "5.8.0", + "@ethersproject/strings": "5.8.0", + "@ethersproject/transactions": "5.8.0", + "@ethersproject/units": "5.8.0", + "@ethersproject/wallet": "5.8.0", + "@ethersproject/web": "5.8.0", + "@ethersproject/wordlists": "5.8.0" + } + }, + "node_modules/ethers5": { + "name": "ethers", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.8.0.tgz", + "integrity": "sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "5.8.0", + "@ethersproject/abstract-provider": "5.8.0", + "@ethersproject/abstract-signer": "5.8.0", + "@ethersproject/address": "5.8.0", + "@ethersproject/base64": "5.8.0", + "@ethersproject/basex": "5.8.0", + "@ethersproject/bignumber": "5.8.0", + "@ethersproject/bytes": "5.8.0", + "@ethersproject/constants": "5.8.0", + "@ethersproject/contracts": "5.8.0", + "@ethersproject/hash": "5.8.0", + "@ethersproject/hdnode": "5.8.0", + "@ethersproject/json-wallets": "5.8.0", + "@ethersproject/keccak256": "5.8.0", + "@ethersproject/logger": "5.8.0", + "@ethersproject/networks": "5.8.0", + "@ethersproject/pbkdf2": "5.8.0", + "@ethersproject/properties": "5.8.0", + "@ethersproject/providers": "5.8.0", + "@ethersproject/random": "5.8.0", + "@ethersproject/rlp": "5.8.0", + "@ethersproject/sha2": "5.8.0", + "@ethersproject/signing-key": "5.8.0", + "@ethersproject/solidity": "5.8.0", + "@ethersproject/strings": "5.8.0", + "@ethersproject/transactions": "5.8.0", + "@ethersproject/units": "5.8.0", + "@ethersproject/wallet": "5.8.0", + "@ethersproject/web": "5.8.0", + "@ethersproject/wordlists": "5.8.0" + } + }, "node_modules/eventemitter2": { "version": "6.4.9", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz", @@ -15846,6 +17100,17 @@ "node": ">=0.8.x" } }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, "node_modules/execa": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", @@ -15896,6 +17161,12 @@ "node": ">=12.0.0" } }, + "node_modules/exponential-backoff": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.2.tgz", + "integrity": "sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA==", + "license": "Apache-2.0" + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -15994,6 +17265,22 @@ "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "license": "MIT" }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/fastq": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", @@ -16478,6 +17765,38 @@ "uncrypto": "^0.1.3" } }, + "node_modules/hamt-sharding": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hamt-sharding/-/hamt-sharding-2.0.1.tgz", + "integrity": "sha512-vnjrmdXG9dDs1m/H4iJ6z0JFI2NtgsW5keRkTcM85NGak69Mkf5PHUqBz+Xs0T4sg0ppvj9O5EGAJo40FTxmmA==", + "license": "MIT", + "dependencies": { + "sparse-array": "^1.3.1", + "uint8arrays": "^3.0.0" + }, + "engines": { + "node": ">=10.0.0", + "npm": ">=6.0.0" + } + }, + "node_modules/hamt-sharding/node_modules/uint8arrays": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", + "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -16539,6 +17858,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hash-base": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.5.tgz", + "integrity": "sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -16796,6 +18129,36 @@ "node": ">=16.9.0" } }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hosted-git-info/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, "node_modules/html-void-elements": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz", @@ -16828,6 +18191,13 @@ "dev": true, "license": "MIT" }, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", + "dev": true, + "license": "MIT" + }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -16941,7 +18311,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -17006,6 +18375,18 @@ "uint8arrays": "^5.1.0" } }, + "node_modules/interface-ipld-format": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/interface-ipld-format/-/interface-ipld-format-1.0.1.tgz", + "integrity": "sha512-WV/ar+KQJVoQpqRDYdo7YPGYIUHJxCuOEhdvsRpzLqoOIVCqPKdMMYmsLL1nCRsF3yYNio+PAJbCKiv6drrEAg==", + "deprecated": "This module has been superseded by the multiformats module", + "license": "(Apache-2.0 AND MIT)", + "dependencies": { + "cids": "^1.1.6", + "multicodec": "^3.0.1", + "multihashes": "^4.0.2" + } + }, "node_modules/interface-store": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-6.0.2.tgz", @@ -17036,6 +18417,19 @@ "node": ">=12" } }, + "node_modules/ipfs-only-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ipfs-only-hash/-/ipfs-only-hash-4.0.0.tgz", + "integrity": "sha512-TE1DZCvfw8i3gcsTq3P4TFx3cKFJ3sluu/J3XINkJhIN9OwJgNMqKA+WnKx6ByCb1IoPXsTp1KM7tupElb6SyA==", + "license": "MIT", + "dependencies": { + "ipfs-unixfs-importer": "^7.0.1", + "meow": "^9.0.0" + }, + "bin": { + "ipfs-only-hash": "cli.js" + } + }, "node_modules/ipfs-unixfs": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-11.2.1.tgz", @@ -17046,12 +18440,113 @@ "uint8arraylist": "^2.4.8" } }, - "node_modules/iron-webcrypto": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz", - "integrity": "sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==", + "node_modules/ipfs-unixfs-importer": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ipfs-unixfs-importer/-/ipfs-unixfs-importer-7.0.3.tgz", + "integrity": "sha512-qeFOlD3AQtGzr90sr5Tq1Bi8pT5Nr2tSI8z310m7R4JDYgZc6J1PEZO3XZQ8l1kuGoqlAppBZuOYmPEqaHcVQQ==", "license": "MIT", - "funding": { + "dependencies": { + "bl": "^5.0.0", + "cids": "^1.1.5", + "err-code": "^3.0.1", + "hamt-sharding": "^2.0.0", + "ipfs-unixfs": "^4.0.3", + "ipld-dag-pb": "^0.22.2", + "it-all": "^1.0.5", + "it-batch": "^1.0.8", + "it-first": "^1.0.6", + "it-parallel-batch": "^1.0.9", + "merge-options": "^3.0.4", + "multihashing-async": "^2.1.0", + "rabin-wasm": "^0.1.4", + "uint8arrays": "^2.1.2" + }, + "engines": { + "node": ">=14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/ipfs-unixfs-importer/node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "license": "MIT", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/ipfs-unixfs-importer/node_modules/ipfs-unixfs": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-4.0.3.tgz", + "integrity": "sha512-hzJ3X4vlKT8FQ3Xc4M1szaFVjsc1ZydN+E4VQ91aXxfpjFn9G2wsMo1EFdAXNq/BUnN5dgqIOMP5zRYr3DTsAw==", + "license": "MIT", + "dependencies": { + "err-code": "^3.0.1", + "protobufjs": "^6.10.2" + }, + "engines": { + "node": ">=14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/ipfs-unixfs-importer/node_modules/it-all": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.6.tgz", + "integrity": "sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A==", + "license": "ISC" + }, + "node_modules/ipfs-unixfs-importer/node_modules/it-first": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/it-first/-/it-first-1.0.7.tgz", + "integrity": "sha512-nvJKZoBpZD/6Rtde6FXqwDqDZGF1sCADmr2Zoc0hZsIvnE449gRFnGctxDf09Bzc/FWnHXAdaHVIetY6lrE0/g==", + "license": "ISC" + }, + "node_modules/ipfs-unixfs-importer/node_modules/uint8arrays": { + "version": "2.1.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", + "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, + "node_modules/ipld-dag-pb": { + "version": "0.22.3", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.22.3.tgz", + "integrity": "sha512-dfG5C5OVAR4FEP7Al2CrHWvAyIM7UhAQrjnOYOIxXGQz5NlEj6wGX0XQf6Ru6or1na6upvV3NQfstapQG8X2rg==", + "deprecated": "This module has been superseded by @ipld/dag-pb and multiformats", + "license": "MIT", + "dependencies": { + "cids": "^1.0.0", + "interface-ipld-format": "^1.0.0", + "multicodec": "^3.0.1", + "multihashing-async": "^2.0.0", + "protobufjs": "^6.10.2", + "stable": "^0.1.8", + "uint8arrays": "^2.0.5" + }, + "engines": { + "node": ">=6.0.0", + "npm": ">=3.0.0" + } + }, + "node_modules/ipld-dag-pb/node_modules/uint8arrays": { + "version": "2.1.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz", + "integrity": "sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A==", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, + "node_modules/iron-webcrypto": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz", + "integrity": "sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==", + "license": "MIT", + "funding": { "url": "https://github.com/sponsors/brc-dd" } }, @@ -17345,6 +18840,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -17567,6 +19079,16 @@ "node": ">=12" } }, + "node_modules/isomorphic-timers-promises": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-timers-promises/-/isomorphic-timers-promises-1.0.1.tgz", + "integrity": "sha512-u4sej9B1LPSxTGKB/HiuzvEQnXH0ECYkSVQU39koSwmFAxhlEAFl9RdTvLv4TOTQUgBS5O3O5fwUxk6byBZ+IQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/isows": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz", @@ -17588,6 +19110,12 @@ "integrity": "sha512-PkuYtu6XhJzuPTKXImd6y0qE6H91MUPV/b9xotXMAI6GjmD2v3NoHj2g5L0lS2qZ0EzyGWZU1kp0UxW8POvNBQ==", "license": "Apache-2.0 OR MIT" }, + "node_modules/it-batch": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/it-batch/-/it-batch-1.0.9.tgz", + "integrity": "sha512-7Q7HXewMhNFltTsAMdSz6luNhyhkhEtGGbYek/8Xb/GiqYMtwUmopE1ocPSiJKKp3rM4Dt045sNFoUu+KZGNyA==", + "license": "ISC" + }, "node_modules/it-first": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/it-first/-/it-first-3.0.7.tgz", @@ -17618,6 +19146,15 @@ "it-peekable": "^3.0.0" } }, + "node_modules/it-parallel-batch": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/it-parallel-batch/-/it-parallel-batch-1.0.11.tgz", + "integrity": "sha512-UWsWHv/kqBpMRmyZJzlmZeoAMA0F3SZr08FBdbhtbe+MtoEBgr/ZUAKrnenhXCBrsopy76QjRH2K/V8kNdupbQ==", + "license": "ISC", + "dependencies": { + "it-batch": "^1.0.9" + } + }, "node_modules/it-peekable": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/it-peekable/-/it-peekable-3.0.6.tgz", @@ -18014,6 +19551,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbi": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-3.2.5.tgz", + "integrity": "sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ==", + "license": "Apache-2.0" + }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", @@ -18057,6 +19600,21 @@ "integrity": "sha512-RJ9YYNCkhVDBuP4zN5BBtYAzEl03yq/jIIsyif0JY9qyJuQQZNeDK7anAPKKlyEtLSj2s8h6hNh2F8zO5q7ScA==", "license": "ISC" }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/json-stringify-deterministic": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/json-stringify-deterministic/-/json-stringify-deterministic-1.0.12.tgz", + "integrity": "sha512-q3PN0lbUdv0pmurkBNdJH3pfFvOTL/Zp0lquqpvcjfKzt6Y0j49EPHAmVHCAS4Ceq/Y+PejWTzyiVpoY71+D6g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -18082,6 +19640,12 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/just-performance": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/just-performance/-/just-performance-4.3.0.tgz", + "integrity": "sha512-L7RjvtJsL0QO8xFs5wEoDDzzJwoiowRw6Rn/GnvldlchS2JQr9wFYPiwZcDfrbbujEKqKN0tvENdbjXdYhDp5Q==", + "license": "MIT" + }, "node_modules/keccak": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", @@ -18103,6 +19667,15 @@ "integrity": "sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==", "license": "MIT" }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -18153,6 +19726,12 @@ "wherearewe": "^2.0.1" } }, + "node_modules/kubo-rpc-client/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -18174,6 +19753,15 @@ "url": "https://github.com/sponsors/antonk52" } }, + "node_modules/limiter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-2.1.0.tgz", + "integrity": "sha512-361TYz6iay6n+9KvUUImqdLuFigK+K79qrUtBsXhJTLdH4rIt/r1y8r1iozwh8KbZNpujbFTSh74mJ7bwbAMOw==", + "license": "MIT", + "dependencies": { + "just-performance": "4.3.0" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -18269,6 +19857,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, "node_modules/longest-streak": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", @@ -18325,6 +19919,28 @@ "lz-string": "bin/bin.js" } }, + "node_modules/magic-string": { + "version": "0.30.19", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.19.tgz", + "integrity": "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/markdown-table": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", @@ -18344,6 +19960,18 @@ "node": ">= 0.4" } }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, "node_modules/mdast-util-definitions": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz", @@ -18587,6 +20215,53 @@ "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", "license": "MIT" }, + "node_modules/meow": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", + "license": "MIT", + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/merge-options": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", @@ -19197,6 +20872,27 @@ "node": ">=8.6" } }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "dev": true, + "license": "MIT" + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -19235,7 +20931,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -19266,6 +20961,38 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "license": "MIT", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/minimist-options/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -19337,11 +21064,111 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, + "node_modules/multibase": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-4.0.6.tgz", + "integrity": "sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ==", + "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", + "dependencies": { + "@multiformats/base-x": "^4.0.1" + }, + "engines": { + "node": ">=12.0.0", + "npm": ">=6.0.0" + } + }, + "node_modules/multicodec": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-3.2.1.tgz", + "integrity": "sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw==", + "deprecated": "This module has been superseded by the multiformats module", + "license": "MIT", + "dependencies": { + "uint8arrays": "^3.0.0", + "varint": "^6.0.0" + } + }, + "node_modules/multicodec/node_modules/uint8arrays": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", + "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, "node_modules/multiformats": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.2.tgz", - "integrity": "sha512-qbB0CQDt3QKfiAzZ5ZYjLFOs+zW43vA4uyM8g27PeEuXZybUOFyjrVdP93HPBHMoglibwfkdVwbzfUq8qGcH6g==", - "license": "Apache-2.0 OR MIT" + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==", + "license": "(Apache-2.0 AND MIT)" + }, + "node_modules/multihashes": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-4.0.3.tgz", + "integrity": "sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA==", + "license": "MIT", + "dependencies": { + "multibase": "^4.0.1", + "uint8arrays": "^3.0.0", + "varint": "^5.0.2" + }, + "engines": { + "node": ">=12.0.0", + "npm": ">=6.0.0" + } + }, + "node_modules/multihashes/node_modules/uint8arrays": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", + "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, + "node_modules/multihashes/node_modules/varint": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", + "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==", + "license": "MIT" + }, + "node_modules/multihashing-async": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-2.1.4.tgz", + "integrity": "sha512-sB1MiQXPSBTNRVSJc2zM157PXgDtud2nMFUEIvBrsq5Wv96sUclMRK/ecjoP1T/W61UJBqt4tCTwMkUpt2Gbzg==", + "license": "MIT", + "dependencies": { + "blakejs": "^1.1.0", + "err-code": "^3.0.0", + "js-sha3": "^0.8.0", + "multihashes": "^4.0.1", + "murmurhash3js-revisited": "^3.0.0", + "uint8arrays": "^3.0.0" + }, + "engines": { + "node": ">=12.0.0", + "npm": ">=6.0.0" + } + }, + "node_modules/multihashing-async/node_modules/uint8arrays": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", + "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, + "node_modules/murmurhash3js-revisited": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz", + "integrity": "sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } }, "node_modules/mute-stream": { "version": "0.0.8", @@ -19556,11 +21383,109 @@ "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "license": "MIT" }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "license": "MIT", + "node_modules/node-stdlib-browser": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-stdlib-browser/-/node-stdlib-browser-1.3.1.tgz", + "integrity": "sha512-X75ZN8DCLftGM5iKwoYLA3rjnrAEs97MkzvSd4q2746Tgpg8b8XWiBGiBG4ZpgcAqBgtgPHTiAc8ZMCvZuikDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert": "^2.0.0", + "browser-resolve": "^2.0.0", + "browserify-zlib": "^0.2.0", + "buffer": "^5.7.1", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "create-require": "^1.1.1", + "crypto-browserify": "^3.12.1", + "domain-browser": "4.22.0", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "isomorphic-timers-promises": "^1.0.1", + "os-browserify": "^0.3.0", + "path-browserify": "^1.0.1", + "pkg-dir": "^5.0.0", + "process": "^0.11.10", + "punycode": "^1.4.1", + "querystring-es3": "^0.2.1", + "readable-stream": "^3.6.0", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.1", + "url": "^0.11.4", + "util": "^0.12.4", + "vm-browserify": "^1.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-stdlib-browser/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/node-stdlib-browser/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -19846,6 +21771,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", + "dev": true, + "license": "MIT" + }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -19918,15 +21850,27 @@ } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.2.0.tgz", + "integrity": "sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA==", "license": "MIT", "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^1.1.1" }, "engines": { - "node": ">=6" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit/node_modules/yocto-queue": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", + "license": "MIT", + "engines": { + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -19945,6 +21889,22 @@ "node": ">=6" } }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-map": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz", @@ -20001,6 +21961,13 @@ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "license": "BlueOak-1.0.0" }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true, + "license": "(MIT AND Zlib)" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -20013,6 +21980,23 @@ "node": ">=6" } }, + "node_modules/parse-asn1": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.9.tgz", + "integrity": "sha512-fIYNuZ/HastSb80baGOuPRo1O9cf4baWw5WsAp7dBuUzeTD/BoaG8sVTdlPFksBE2lF21dN+A1AnrpIjSWqHHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "pbkdf2": "^3.1.5", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/parse-duration": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/parse-duration/-/parse-duration-2.1.4.tgz", @@ -20068,6 +22052,13 @@ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "license": "MIT" }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -20150,6 +22141,24 @@ "node": ">= 14.16" } }, + "node_modules/pbkdf2": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.5.tgz", + "integrity": "sha512-Q3CG/cYvCO1ye4QKkuH7EXxs3VC/rI1/trd+qX2+PolbaKG0H+bgcZzrTt96mMyRtejk+JMCiLUn3y29W8qmFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "ripemd160": "^2.0.3", + "safe-buffer": "^5.2.1", + "sha.js": "^2.4.12", + "to-buffer": "^1.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -20224,6 +22233,94 @@ "node": ">= 6" } }, + "node_modules/pkg-dir": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", + "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^5.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/pkg-up": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", @@ -20588,6 +22685,16 @@ "dev": true, "license": "MIT" }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -20636,6 +22743,32 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, "node_modules/protons-runtime": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.5.0.tgz", @@ -20675,6 +22808,28 @@ "node": ">=16.0.0" } }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "dev": true, + "license": "MIT" + }, "node_modules/pump": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", @@ -20696,15 +22851,12 @@ } }, "node_modules/qr": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/qr/-/qr-0.5.0.tgz", - "integrity": "sha512-LtnyJsepKCMzfmHBZKVNo1g29kS+8ZbuxE9294EsRhHgVVpy4x8eFw9o4J9SIolDHoDYuaEIY+z8UjiCv/eudA==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/qr/-/qr-0.5.2.tgz", + "integrity": "sha512-91M3sVlA7xCFpkJtYX5xzVH8tDo4rNZ7jr8v+1CRgPVkZ4D+Vl9y8rtZWJ/YkEUM6U/h0FAu5W/JAK7iowOteA==", "license": "(MIT OR Apache-2.0)", "engines": { "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" } }, "node_modules/qrcode": { @@ -20733,6 +22885,22 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/query-string": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", @@ -20751,6 +22919,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -20777,6 +22954,43 @@ "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", "license": "MIT" }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/rabin-wasm": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/rabin-wasm/-/rabin-wasm-0.1.5.tgz", + "integrity": "sha512-uWgQTo7pim1Rnj5TuWcCewRDTf0PEFTSlaUjWP4eY9EbLV9em08v89oCz/WO+wRxpYuO36XEHp4wgYQnAgOHzA==", + "license": "MIT", + "dependencies": { + "@assemblyscript/loader": "^0.9.4", + "bl": "^5.0.0", + "debug": "^4.3.1", + "minimist": "^1.2.5", + "node-fetch": "^2.6.1", + "readable-stream": "^3.6.0" + }, + "bin": { + "rabin-wasm": "cli/bin.js" + } + }, + "node_modules/rabin-wasm/node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "license": "MIT", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/radix3": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz", @@ -20790,6 +23004,27 @@ "dev": true, "license": "MIT" }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, "node_modules/react": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", @@ -21192,36 +23427,174 @@ "react-dom": "^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, - "node_modules/react-window": { - "version": "1.8.11", - "resolved": "https://registry.npmjs.org/react-window/-/react-window-1.8.11.tgz", - "integrity": "sha512-+SRbUVT2scadgFSWx+R1P754xHPEqvcfSfVX10QYg6POOz+WNgkN48pS+BtZNIMGiL1HYrSEiCkwsMS15QogEQ==", + "node_modules/react-window": { + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/react-window/-/react-window-1.8.11.tgz", + "integrity": "sha512-+SRbUVT2scadgFSWx+R1P754xHPEqvcfSfVX10QYg6POOz+WNgkN48pS+BtZNIMGiL1HYrSEiCkwsMS15QogEQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.0.0", + "memoize-one": ">=3.1.1 <6" + }, + "engines": { + "node": ">8.0.0" + }, + "peerDependencies": { + "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/react-window/node_modules/memoize-one": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", + "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", + "license": "MIT" + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "license": "MIT", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "license": "MIT", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.0.0", - "memoize-one": ">=3.1.1 <6" + "p-try": "^2.0.0" }, "engines": { - "node": ">8.0.0" + "node": ">=6" }, - "peerDependencies": { - "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/react-window/node_modules/memoize-one": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", - "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", - "license": "MIT" + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/read-cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", - "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "license": "ISC" + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "license": "BSD-2-Clause", "dependencies": { - "pify": "^2.3.0" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" } }, "node_modules/readable-stream": { @@ -21308,7 +23681,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, "license": "MIT", "dependencies": { "indent-string": "^4.0.0", @@ -21653,6 +24025,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -21745,6 +24126,83 @@ "node": ">=0.10.0" } }, + "node_modules/ripemd160": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.3.tgz", + "integrity": "sha512-5Di9UC0+8h1L6ZD2d7awM7E/T4uA1fJRlx6zk/NvdCCVEoAnFqvHmCuNeIKoCeIixBX/q8uM+6ycDvF8woqosA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hash-base": "^3.1.2", + "inherits": "^2.0.4" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ripemd160/node_modules/hash-base": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.2.tgz", + "integrity": "sha512-Bb33KbowVTIj5s7Ked1OsqHUeCpz//tPwR+E2zJgJKo9Z5XolZ9b6bdUgjmYlwnWhoOQKoTd1TYToZGn5mAYOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ripemd160/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/ripemd160/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/ripemd160/node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/ripemd160/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/ripemd160/node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, "node_modules/rollup": { "version": "4.38.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.38.0.tgz", @@ -22077,6 +24535,12 @@ "loose-envify": "^1.1.0" } }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "license": "MIT" + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -22154,6 +24618,13 @@ "node": ">= 0.4" } }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true, + "license": "MIT" + }, "node_modules/sha.js": { "version": "2.4.12", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", @@ -22415,6 +24886,44 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/sparse-array": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/sparse-array/-/sparse-array-1.3.2.tgz", + "integrity": "sha512-ZT711fePGn3+kQyLuv1fpd3rNSkNF8vd5Kv2D+qnOANeyKs3fx6bUMGWRPvgTTcYV64QMqZKZwcuaQSP3AZ0tg==", + "license": "ISC" + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.22", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz", + "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==", + "license": "CC0-1.0" + }, "node_modules/split-on-first": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", @@ -22433,6 +24942,13 @@ "node": ">= 10.x" } }, + "node_modules/stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "deprecated": "Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility", + "license": "MIT" + }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -22482,6 +24998,30 @@ "node": ">= 0.4" } }, + "node_modules/stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, + "node_modules/stream-http": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", + "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", + "dev": true, + "license": "MIT", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "xtend": "^4.0.2" + } + }, "node_modules/stream-shift": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", @@ -22609,7 +25149,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, "license": "MIT", "dependencies": { "min-indent": "^1.0.0" @@ -22970,6 +25509,19 @@ "dev": true, "license": "MIT" }, + "node_modules/timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "setimmediate": "^1.0.4" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", @@ -23096,6 +25648,12 @@ "node": ">=8.0" } }, + "node_modules/toformat": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/toformat/-/toformat-2.0.0.tgz", + "integrity": "sha512-03SWBVop6nU8bpyZCx7SodpYznbZF5R4ljwNLBcTQzKOD9xuihRo/psX58llS1BMFhhAI08H3luot5GoXJz2pQ==", + "license": "MIT" + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -23112,6 +25670,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/trough": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", @@ -23155,6 +25722,13 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true, + "license": "MIT" + }, "node_modules/turbo-stream": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz", @@ -23262,6 +25836,12 @@ "multiformats": "^13.0.0" } }, + "node_modules/uint8arrays/node_modules/multiformats": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.1.tgz", + "integrity": "sha512-VqO6OSvLrFVAYYjgsr8tyv62/rCQhPgsZUXLTqoFLSgdkgiUYKYeArbt1uWLlEpkjxQe+P0+sHlbPEte1Bi06Q==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/uncrypto": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", @@ -23448,6 +26028,17 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/universal-sdk": { + "version": "0.1.34", + "resolved": "https://registry.npmjs.org/universal-sdk/-/universal-sdk-0.1.34.tgz", + "integrity": "sha512-1YNXbuEsBe6XWiHdWuUKvrOLm4G11LVWRQ8b/PSHNQE78sria+a0ONyZdtReGGk5uhJLdbCh39po2fl5Eg7BbQ==", + "license": "ISC", + "dependencies": { + "@uniswap/uniswapx-sdk": "^2.0.1-alpha.10", + "axios": "^1.7.9", + "ethers5": "npm:ethers@5" + } + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -23542,6 +26133,27 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/url": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.4.tgz", + "integrity": "sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.12.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true, + "license": "MIT" + }, "node_modules/use-callback-ref": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", @@ -23667,6 +26279,16 @@ "node": ">=8" } }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "node_modules/valtio": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/valtio/-/valtio-1.13.2.tgz", @@ -23702,6 +26324,12 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/varint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", + "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==", + "license": "MIT" + }, "node_modules/vaul": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vaul/-/vaul-1.1.2.tgz", @@ -23928,6 +26556,23 @@ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true }, + "node_modules/vite-plugin-node-polyfills": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/vite-plugin-node-polyfills/-/vite-plugin-node-polyfills-0.23.0.tgz", + "integrity": "sha512-4n+Ys+2bKHQohPBKigFlndwWQ5fFKwaGY6muNDMTb0fSQLyBzS+jjUNRZG9sKF0S/Go4ApG6LFnUGopjkILg3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/plugin-inject": "^5.0.5", + "node-stdlib-browser": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/davidmyersdev" + }, + "peerDependencies": { + "vite": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" + } + }, "node_modules/vite-plugin-static-copy": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-2.3.0.tgz", @@ -24489,21 +27134,19 @@ } } }, - "node_modules/vitest/node_modules/magic-string": { - "version": "0.30.17", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", - "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, "node_modules/vitest/node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true, + "license": "MIT" + }, "node_modules/wagmi": { "version": "2.17.5", "resolved": "https://registry.npmjs.org/wagmi/-/wagmi-2.17.5.tgz", @@ -24914,6 +27557,21 @@ "node": ">=8" } }, + "node_modules/yargs/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/yargs/node_modules/p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", diff --git a/package.json b/package.json index 430ba7c65..1bf278da8 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,9 @@ "type": "module", "dependencies": { "@binance/w3w-rainbow-connector-v2": "^1.0.2", + "@cowprotocol/cow-sdk": "^7.0.8", + "@cowprotocol/sdk-app-data": "^4.1.1", + "@cowprotocol/sdk-viem-adapter": "^0.1.2", "@dnd-kit/core": "^6.0.5", "@dnd-kit/sortable": "^7.0.1", "@dnd-kit/utilities": "^3.2.0", @@ -32,7 +35,7 @@ "@radix-ui/react-toggle": "^1.1.1", "@radix-ui/react-toggle-group": "^1.1.1", "@radix-ui/react-tooltip": "^1.1.8", - "@rainbow-me/rainbowkit": "2.2.8", + "@rainbow-me/rainbowkit": "2.2.9", "@react-spring/web": "^9.7.1", "@reserve-protocol/dtf-rebalance-lib": "2.6.3", "@reserve-protocol/react-zapper": "^1.4.0", @@ -58,6 +61,7 @@ "lucide-react": "^0.461.0", "mixpanel-browser": "2.56.0", "next-themes": "^0.4.4", + "p-limit": "^6.2.0", "react": "18.3.1", "react-dom": "18.3.1", "react-dropzone": "^14.3.5", @@ -80,6 +84,7 @@ "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", "theme-ui": "0.17.1", + "universal-sdk": "^0.1.34", "vaul": "^1.1.1", "viem": "2.37.9", "wagmi": "2.17.5", @@ -87,7 +92,7 @@ }, "scripts": { "start": "vite", - "build": "tsc && vite build", + "build": "tsc && node --max-old-space-size=8192 ./node_modules/.bin/vite build", "serve": "vite preview", "analyze": "vite-bundle-visualizer 'build/static/js/*.js'", "test": "vite test", @@ -138,6 +143,7 @@ "typescript": "5.6.3", "vite": "5.4.8", "vite-bundle-visualizer": "1.2.1", + "vite-plugin-node-polyfills": "^0.23.0", "vite-plugin-static-copy": "^2.1.0", "vite-tsconfig-paths": "^4.2.0", "vitest": "^3.1.3" diff --git a/src/abis/CowSwapSettlement.ts b/src/abis/CowSwapSettlement.ts new file mode 100644 index 000000000..e160e3d62 --- /dev/null +++ b/src/abis/CowSwapSettlement.ts @@ -0,0 +1,329 @@ +export default [ + { + inputs: [ + { + internalType: 'contract GPv2Authentication', + name: 'authenticator_', + type: 'address', + }, + { internalType: 'contract IVault', name: 'vault_', type: 'address' }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'target', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes4', + name: 'selector', + type: 'bytes4', + }, + ], + name: 'Interaction', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: 'orderUid', + type: 'bytes', + }, + ], + name: 'OrderInvalidated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: 'orderUid', + type: 'bytes', + }, + { indexed: false, internalType: 'bool', name: 'signed', type: 'bool' }, + ], + name: 'PreSignature', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'solver', + type: 'address', + }, + ], + name: 'Settlement', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'sellToken', + type: 'address', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'buyToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'sellAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'buyAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'feeAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'orderUid', + type: 'bytes', + }, + ], + name: 'Trade', + type: 'event', + }, + { + inputs: [], + name: 'authenticator', + outputs: [ + { + internalType: 'contract GPv2Authentication', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'domainSeparator', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], + name: 'filledAmount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes[]', name: 'orderUids', type: 'bytes[]' }], + name: 'freeFilledAmountStorage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes[]', name: 'orderUids', type: 'bytes[]' }], + name: 'freePreSignatureStorage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'offset', type: 'uint256' }, + { internalType: 'uint256', name: 'length', type: 'uint256' }, + ], + name: 'getStorageAt', + outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: 'orderUid', type: 'bytes' }], + name: 'invalidateOrder', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], + name: 'preSignature', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes', name: 'orderUid', type: 'bytes' }, + { internalType: 'bool', name: 'signed', type: 'bool' }, + ], + name: 'setPreSignature', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'contract IERC20[]', name: 'tokens', type: 'address[]' }, + { internalType: 'uint256[]', name: 'clearingPrices', type: 'uint256[]' }, + { + components: [ + { internalType: 'uint256', name: 'sellTokenIndex', type: 'uint256' }, + { internalType: 'uint256', name: 'buyTokenIndex', type: 'uint256' }, + { internalType: 'address', name: 'receiver', type: 'address' }, + { internalType: 'uint256', name: 'sellAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'buyAmount', type: 'uint256' }, + { internalType: 'uint32', name: 'validTo', type: 'uint32' }, + { internalType: 'bytes32', name: 'appData', type: 'bytes32' }, + { internalType: 'uint256', name: 'feeAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'flags', type: 'uint256' }, + { internalType: 'uint256', name: 'executedAmount', type: 'uint256' }, + { internalType: 'bytes', name: 'signature', type: 'bytes' }, + ], + internalType: 'struct GPv2Trade.Data[]', + name: 'trades', + type: 'tuple[]', + }, + { + components: [ + { internalType: 'address', name: 'target', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'bytes', name: 'callData', type: 'bytes' }, + ], + internalType: 'struct GPv2Interaction.Data[][3]', + name: 'interactions', + type: 'tuple[][3]', + }, + ], + name: 'settle', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'targetContract', type: 'address' }, + { internalType: 'bytes', name: 'calldataPayload', type: 'bytes' }, + ], + name: 'simulateDelegatecall', + outputs: [{ internalType: 'bytes', name: 'response', type: 'bytes' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'targetContract', type: 'address' }, + { internalType: 'bytes', name: 'calldataPayload', type: 'bytes' }, + ], + name: 'simulateDelegatecallInternal', + outputs: [{ internalType: 'bytes', name: 'response', type: 'bytes' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'bytes32', name: 'poolId', type: 'bytes32' }, + { internalType: 'uint256', name: 'assetInIndex', type: 'uint256' }, + { internalType: 'uint256', name: 'assetOutIndex', type: 'uint256' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + { internalType: 'bytes', name: 'userData', type: 'bytes' }, + ], + internalType: 'struct IVault.BatchSwapStep[]', + name: 'swaps', + type: 'tuple[]', + }, + { internalType: 'contract IERC20[]', name: 'tokens', type: 'address[]' }, + { + components: [ + { internalType: 'uint256', name: 'sellTokenIndex', type: 'uint256' }, + { internalType: 'uint256', name: 'buyTokenIndex', type: 'uint256' }, + { internalType: 'address', name: 'receiver', type: 'address' }, + { internalType: 'uint256', name: 'sellAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'buyAmount', type: 'uint256' }, + { internalType: 'uint32', name: 'validTo', type: 'uint32' }, + { internalType: 'bytes32', name: 'appData', type: 'bytes32' }, + { internalType: 'uint256', name: 'feeAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'flags', type: 'uint256' }, + { internalType: 'uint256', name: 'executedAmount', type: 'uint256' }, + { internalType: 'bytes', name: 'signature', type: 'bytes' }, + ], + internalType: 'struct GPv2Trade.Data', + name: 'trade', + type: 'tuple', + }, + ], + name: 'swap', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'vault', + outputs: [{ internalType: 'contract IVault', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'vaultRelayer', + outputs: [ + { internalType: 'contract GPv2VaultRelayer', name: '', type: 'address' }, + ], + stateMutability: 'view', + type: 'function', + }, + { stateMutability: 'payable', type: 'receive' }, +] as const diff --git a/src/app-routes.tsx b/src/app-routes.tsx index e7e1f44c9..2f354ca32 100644 --- a/src/app-routes.tsx +++ b/src/app-routes.tsx @@ -9,6 +9,7 @@ import Issuance from '@/views/yield-dtf/issuance' import Overview from '@/views/yield-dtf/overview' import Settings from '@/views/yield-dtf/settings' import Staking from '@/views/yield-dtf/staking' +import { lazy, Suspense } from 'react' import { Navigate, Route, Routes } from 'react-router-dom' import RTokenContainer from 'state/rtoken/RTokenContainer' import { GOVERNANCE_PROPOSAL_TYPES, ROUTES } from 'utils/constants' @@ -39,8 +40,9 @@ import IndexDTFManualIssuance from './views/index-dtf/issuance/manual' import IndexDTFManage from './views/index-dtf/manage' import IndexDTFOverview from './views/index-dtf/overview' import IndexDTFSettings from './views/index-dtf/settings' -import AllYieldDTFList from './views/tokens/Tokens' import InternalDTFList from './views/internal/dtf-list' +import AllYieldDTFList from './views/tokens/Tokens' +const AsyncSwaps = lazy(() => import('./views/index-dtf/issuance/async-swaps')) // TODO: Fix recoll call on yield dtf auction page const AppRoutes = () => ( @@ -84,6 +86,20 @@ const AppRoutes = () => ( path={`${ROUTES.ISSUANCE}/manual`} element={} /> + + Loading... + + } + > + + + } + /> } diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx index 534182176..841669ee9 100644 --- a/src/components/ui/label.tsx +++ b/src/components/ui/label.tsx @@ -1,13 +1,11 @@ -"use client" +import * as React from 'react' +import * as LabelPrimitive from '@radix-ui/react-label' +import { cva, type VariantProps } from 'class-variance-authority' -import * as React from "react" -import * as LabelPrimitive from "@radix-ui/react-label" -import { cva, type VariantProps } from "class-variance-authority" - -import { cn } from "@/lib/utils" +import { cn } from '@/lib/utils' const labelVariants = cva( - "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" + 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70' ) const Label = React.forwardRef< diff --git a/src/components/ui/sonner.tsx b/src/components/ui/sonner.tsx index cbeb72969..fe4196ad1 100644 --- a/src/components/ui/sonner.tsx +++ b/src/components/ui/sonner.tsx @@ -7,11 +7,12 @@ type ToasterProps = React.ComponentProps const Toaster = ({ ...props }: ToasterProps) => { const { theme = 'system' } = useTheme() const isDesktop = useMediaQuery('(min-width: 1400px)') + const isTablet = useMediaQuery('(min-width: 768px) and (max-width: 1400px)') return ( { marginLeft: '516px', marginTop: '46px', } - : {}), + : isTablet + ? { + position: 'fixed', + right: '0%', + marginBottom: '44px', + marginRight: '10px', + } + : {}), }} theme={theme as ToasterProps['theme']} className="toaster group" diff --git a/src/components/ui/swap.tsx b/src/components/ui/swap.tsx index c4a0447ee..3fddfcef9 100644 --- a/src/components/ui/swap.tsx +++ b/src/components/ui/swap.tsx @@ -7,8 +7,10 @@ import { DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' import { Input, NumericalInput } from '@/components/ui/input' +import useMediaQuery from '@/hooks/useMediaQuery' import { cn } from '@/lib/utils' import { chainIdAtom } from '@/state/atoms' +import { indexDTFAtom, indexDTFBrandAtom } from '@/state/dtf/atoms' import { Token } from '@/types' import { formatCurrency } from '@/utils' import { useAtomValue } from 'jotai' @@ -27,18 +29,16 @@ import React, { useState, } from 'react' import GaugeIcon from '../icons/GaugeIcon' -import { ToggleGroup, ToggleGroupItem } from './toggle-group' -import { Skeleton } from './skeleton' import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from './accordion' -import { Separator } from './separator' import Help from './help' -import { indexDTFAtom, indexDTFBrandAtom } from '@/state/dtf/atoms' -import useMediaQuery from '@/hooks/useMediaQuery' +import { Separator } from './separator' +import { Skeleton } from './skeleton' +import { ToggleGroup, ToggleGroupItem } from './toggle-group' type TokenWithBalance = Token & { balance?: string } @@ -53,6 +53,8 @@ type SwapItem = { onChange?: (value: string) => void tokens?: TokenWithBalance[] onTokenSelect?: (token: Token) => void + disabled?: boolean + className?: string } type SwapProps = { @@ -61,10 +63,12 @@ type SwapProps = { onSwap?: () => void loading?: boolean } + const TokenInput = ({ value = '', onChange = () => {}, -}: Pick) => { + disabled = false, +}: Pick & { disabled?: boolean }) => { const ref = useRef(null) const isDesktop = useMediaQuery('(min-width: 768px)') @@ -86,6 +90,7 @@ const TokenInput = ({ className="placeholder:text-primary/70 text-primary" ref={ref} autoFocus={isDesktop} + disabled={disabled} /> ) } @@ -187,7 +192,11 @@ const PriceValue = ({ price }: Pick) => ( ) -const MaxButton = ({ balance, onMax }: Pick) => ( +const MaxButton = ({ + balance, + onMax, + disabled, +}: Pick & { disabled?: boolean }) => (
Balance {balance} @@ -196,19 +205,25 @@ const MaxButton = ({ balance, onMax }: Pick) => ( className="h-6 rounded-full ml-1 bg-primary/15 text-primary/80 hover:bg-primary/15 hover:text-primary/80 font-semibold" size="xs" onClick={onMax} + disabled={disabled} > Max
) -const TokenInputBox = ({ from }: Pick) => { +export const TokenInputBox = ({ from }: Pick) => { return ( -
+

{from?.title || 'You use:'}

- +
@@ -217,7 +232,11 @@ const TokenInputBox = ({ from }: Pick) => {
- +
@@ -282,7 +301,10 @@ const SlowLoading = ({ enabled }: { enabled: boolean }) => { ) } -const TokenOutputBox = ({ to, loading }: Pick) => { +export const TokenOutputBox = ({ + to, + loading, +}: Pick) => { const [slowLoading, setSlowLoading] = useState(false) useEffect(() => { @@ -311,7 +333,12 @@ const TokenOutputBox = ({ to, loading }: Pick) => { }, [loading]) return ( -
+

{to.title || 'You receive:'}

@@ -343,11 +370,17 @@ const TokenOutputBox = ({ to, loading }: Pick) => { ) } -const ArrowSeparator = ({ onSwap }: Pick) => { +export const ArrowSeparator = ({ + onSwap, + className, +}: Pick & { className?: string }) => { if (onSwap) { return ( + + ) +} + +const SubmitMint = ({ loadingQuote }: SubmitMintProps) => { + const { mutate, isPending } = useStableQuoteSignatures() + + return ( + + ) +} + +export default SubmitMint diff --git a/src/views/index-dtf/issuance/async-swaps/async-redeem/index.tsx b/src/views/index-dtf/issuance/async-swaps/async-redeem/index.tsx new file mode 100644 index 000000000..605be8288 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/async-redeem/index.tsx @@ -0,0 +1,162 @@ +import TokenLogo from '@/components/token-logo' +import StackTokenLogo from '@/components/token-logo/StackTokenLogo' +import { + ArrowSeparator, + TokenInputBox, + TokenOutputBox, +} from '@/components/ui/swap' +import { cn } from '@/lib/utils' +import { + indexDTFAtom, + indexDTFBasketAtom, + indexDTFPriceAtom, +} from '@/state/dtf/atoms' +import { formatCurrencyCompact } from '@/utils' +import { useAtom, useAtomValue } from 'jotai' +import { useMemo } from 'react' +import { formatEther } from 'viem' +import { + collateralAcquiredAtom, + indexDTFBalanceAtom, + isMintingAtom, + ordersSubmittedAtom, + redeemAssetsAtom, + selectedTokenAtom, + userInputAtom, +} from '../atom' +import CollateralAcquisition from '../collateral-acquisition' +import { useQuotesForRedeem } from '../hooks/useQuote' +import SubmitRedeem from './submit-redeem' +import SubmitRedeemOrders from './submit-redeem-orders' + +const CustomInputBox = () => { + const indexDTF = useAtomValue(indexDTFAtom) + const inputAmount = useAtomValue(userInputAtom) + const basket = useAtomValue(indexDTFBasketAtom) + + if (!indexDTF) return null + + return ( +
+ +
+ You Redeemed: + + {inputAmount} + {indexDTF.token.symbol} + + for {basket?.length} underlying collateral tokens +
+
+
+ ({ + ...r, + chain: indexDTF.chainId, + }))} + size={24} + overlap={-2} + reverseStack + outsource + /> +
+
+ ) +} + +const AsyncRedeem = () => { + const indexDTF = useAtomValue(indexDTFAtom) + const [inputAmount, setInputAmount] = useAtom(userInputAtom) + const selectedToken = useAtomValue(selectedTokenAtom) + const isMinting = useAtomValue(isMintingAtom) + const indexDTFPrice = useAtomValue(indexDTFPriceAtom) + const inputPrice = (indexDTFPrice || 0) * Number(inputAmount) + const indexDTFBalance = useAtomValue(indexDTFBalanceAtom) + const indxDTFParsedBalance = formatEther(indexDTFBalance) + const onMax = () => setInputAmount(indxDTFParsedBalance) + const ordersSubmitted = useAtomValue(ordersSubmittedAtom) + const collateralAcquired = useAtomValue(collateralAcquiredAtom) + const amountOut = inputPrice + const amountOutValue = inputPrice + const redeemAssets = useAtomValue(redeemAssetsAtom) + + const { isLoading, isFetching } = useQuotesForRedeem() + + const awaitingQuote = isLoading || isFetching + + if (!indexDTF) return null + + const assetsRedeemed = useMemo( + () => Object.keys(redeemAssets).length > 0, + [redeemAssets] + ) + + return ( +
+
+ {assetsRedeemed ? ( + + ) : ( + + )} + + ${formatCurrencyCompact(amountOutValue)} + ) : undefined, + value: amountOut.toString(), + className: cn( + 'rounded-3xl border-8 border-card rounded-b-none pb-2', + ordersSubmitted && 'border-background bg-background', + collateralAcquired && !isMinting && 'border-card bg-card' + ), + }} + loading={isLoading} + /> +
+
+ {!assetsRedeemed && } + {assetsRedeemed && !ordersSubmitted && ( + + )} + {ordersSubmitted && } +
+
+ ) +} + +export default AsyncRedeem diff --git a/src/views/index-dtf/issuance/async-swaps/async-redeem/submit-redeem-orders.tsx b/src/views/index-dtf/issuance/async-swaps/async-redeem/submit-redeem-orders.tsx new file mode 100644 index 000000000..aed9f8fea --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/async-redeem/submit-redeem-orders.tsx @@ -0,0 +1,90 @@ +import { Button } from '@/components/ui/button' +import { cn } from '@/lib/utils' +import { useAtomValue, useSetAtom } from 'jotai' +import { useCallback, useMemo } from 'react' +import { + balanceAfterSwapAtom, + infoMessageAtom, + redeemAssetsAtom, + selectedTokenBalanceAtom, +} from '../atom' +import { useStableQuoteSignatures } from '../hooks/useQuoteSignatures' + +type SubmitRedeemOrdersProps = { + loadingQuote?: boolean +} + +const SubmitRedeemButton = ({ + mutate, + isPending, + loadingQuote, +}: { + mutate: () => void + isPending: boolean + loadingQuote?: boolean +}) => { + const selectedTokenBalance = useAtomValue(selectedTokenBalanceAtom) + const redeemAssets = useAtomValue(redeemAssetsAtom) + const infoMessage = useAtomValue(infoMessageAtom) + const setBalanceAfterSwap = useSetAtom(balanceAfterSwapAtom) + + const handleSubmit = useCallback(() => { + setBalanceAfterSwap(selectedTokenBalance?.value || 0n) + mutate() + }, [mutate, selectedTokenBalance?.value, setBalanceAfterSwap]) + + const disabled = useMemo( + () => + isPending || + loadingQuote || + !redeemAssets || + Object.keys(redeemAssets).length === 0, + [isPending, loadingQuote, redeemAssets] + ) + + const buttonText = useMemo(() => { + if (loadingQuote) { + return 'Awaiting Quote' + } + if (infoMessage) { + return infoMessage + } + if (isPending) { + return 'Signing...' + } + return ( + + Sell Collateral for USDC + - Step 2/2 + + ) + }, [isPending, loadingQuote, infoMessage]) + + return ( + + ) +} + +const SubmitRedeemOrders = ({ loadingQuote }: SubmitRedeemOrdersProps) => { + const { mutate, isPending } = useStableQuoteSignatures() + + return ( + + ) +} + +export default SubmitRedeemOrders diff --git a/src/views/index-dtf/issuance/async-swaps/async-redeem/submit-redeem.tsx b/src/views/index-dtf/issuance/async-swaps/async-redeem/submit-redeem.tsx new file mode 100644 index 000000000..dbcccf029 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/async-redeem/submit-redeem.tsx @@ -0,0 +1,125 @@ +import dtfIndexAbi from '@/abis/dtf-index-abi' +import { Button } from '@/components/ui/button' +import { cn } from '@/lib/utils' +import { chainIdAtom, walletAtom } from '@/state/atoms' +import { indexDTFAtom } from '@/state/dtf/atoms' +import { safeParseEther } from '@/utils' +import { useAtomValue, useSetAtom } from 'jotai' +import { useCallback, useEffect } from 'react' +import { Address, parseEventLogs } from 'viem' +import { useSendCalls, useWaitForCallsStatus, useWalletClient } from 'wagmi' +import { + txHashAtom, + redeemAssetsAtom, + userInputAtom, + insufficientBalanceAtom, +} from '../atom' +import { useFolioDetails } from '../hooks/useFolioDetails' + +const SubmitRedeem = () => { + const chainId = useAtomValue(chainIdAtom) + const account = useAtomValue(walletAtom) + const indexDTF = useAtomValue(indexDTFAtom) + const inputAmount = useAtomValue(userInputAtom) + const insufficientBalance = useAtomValue(insufficientBalanceAtom) + const setRedeemAssets = useSetAtom(redeemAssetsAtom) + const setRedeemTxHash = useSetAtom(txHashAtom) + + const sharesToRedeem = safeParseEther(inputAmount) + const { data: walletClient } = useWalletClient() + const { data: folioDetails } = useFolioDetails({ shares: sharesToRedeem }) + + const { data, sendCalls, isPending } = useSendCalls() + + const { data: callsStatus, isLoading: isReceiptLoading } = + useWaitForCallsStatus({ + id: data?.id || '', + }) + + useEffect(() => { + if (callsStatus?.status === 'success') { + const receipt = callsStatus.receipts?.[0] + + setRedeemTxHash(receipt?.transactionHash || 'tx-hash-not-found') + + const events = parseEventLogs({ + abi: dtfIndexAbi, + logs: receipt?.logs as any, + eventName: 'Transfer', + }) + + events + .filter((event) => event.address !== indexDTF?.id) + .forEach((event) => { + const assetAddress = event.address as Address + const amount = event.args.value as bigint + setRedeemAssets((prev: Record) => ({ + ...prev, + [assetAddress]: amount, + })) + }) + } + }, [callsStatus]) + + const handleSubmit = useCallback(() => { + if ( + !chainId || + !walletClient || + !account || + !indexDTF || + !inputAmount || + !folioDetails + ) + return + + try { + sendCalls({ + calls: [ + { + to: indexDTF.id, + abi: dtfIndexAbi, + functionName: 'redeem', + args: [ + sharesToRedeem, + account, + folioDetails.assets ?? [], + folioDetails.redeemValues.map((e) => (e * 95n) / 100n), + ], + }, + ], + }) + } catch (error) { + console.error('Error processing orders:', error) + } + }, [chainId, walletClient, account, indexDTF, inputAmount, folioDetails]) + + const disabled = + isPending || isReceiptLoading || !inputAmount || insufficientBalance + + return ( +
+ +
+ ) +} + +export default SubmitRedeem diff --git a/src/views/index-dtf/issuance/async-swaps/atom.ts b/src/views/index-dtf/issuance/async-swaps/atom.ts new file mode 100644 index 000000000..40d1e4e76 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/atom.ts @@ -0,0 +1,155 @@ +import { balancesAtom, chainIdAtom, TokenBalance } from '@/state/atoms' +import { indexDTFPriceAtom } from '@/state/dtf/atoms' +import { Token } from '@/types' +import { reducedZappableTokens } from '@/views/yield-dtf/issuance/components/zapV2/constants' +import { + EnrichedOrder, + OrderQuoteResponse, + OrderStatus, +} from '@cowprotocol/cow-sdk' +import { atom } from 'jotai' +import { atomWithReset } from 'jotai/utils' +import { Address, formatUnits, parseEther, parseUnits } from 'viem' +import { + AsyncSwapOrderResponse, + QuoteAggregated, + UniversalOrder, +} from './types' + +const ASYNC_MINT_BUFFER = 0.01 + +// Main Atoms +export const operationAtom = atom<'mint' | 'redeem'>('mint') +export const userInputAtom = atomWithReset('') +export const indexDTFBalanceAtom = atom(0n) +export const txHashAtom = atom('') // tx hash for minting or redeeming +export const redeemAssetsAtom = atom>({}) +export const quotesAtom = atom>({}) +export const fallbackQuotesAtom = atom>({}) +export const cowswapOrderIdsAtom = atom([]) +export const cowswapOrdersCreatedAtAtom = atom(undefined) +export const cowswapOrdersAtom = atom<(EnrichedOrder & { orderId: string })[]>( + [] +) + +export const slippageAtom = atom('100') +export const applyWalletBalanceAtom = atom(true) + +export const refetchQuotesAtom = atom<{ fn: () => void }>({ fn: () => {} }) +export const fetchingQuotesAtom = atom(false) + +export const isMintingAtom = atom(false) +export const successAtom = atom(false) + +export const universalSuccessOrdersAtom = atom([]) + +export const infoMessageAtom = atom(undefined) + +export const balanceAfterSwapAtom = atom(0n) + +// Render Atoms +export const openCollateralPanelAtom = atom(true) +export const showSettingsAtom = atom(false) + +// Computed Atoms +export const selectedTokenAtom = atom((get) => { + const chainId = get(chainIdAtom) + return reducedZappableTokens[chainId][2] // USDC +}) + +export const selectedTokenBalanceAtom = atom( + (get) => { + const balances = get(balancesAtom) + const token = get(selectedTokenAtom) + return balances[token.address] + } +) + +export const insufficientBalanceAtom = atom((get) => { + const inputAmount = get(userInputAtom) + const operation = get(operationAtom) + const selectedToken = get(selectedTokenAtom) + const selectedTokenBalance = get(selectedTokenBalanceAtom) + const indexDTFParsedBalance = get(indexDTFBalanceAtom) + return operation === 'mint' + ? parseUnits(inputAmount, selectedToken.decimals) > + (selectedTokenBalance?.value || 0n) + : parseEther(inputAmount) > indexDTFParsedBalance +}) + +export const collateralAcquiredAtom = atom((get) => { + const cowswapOrders = get(cowswapOrdersAtom) + return ( + cowswapOrders.length > 0 && + cowswapOrders.every((order) => order.status === OrderStatus.FULFILLED) + ) +}) + +export const mintValueAtom = atom((get) => { + const inputAmount = get(userInputAtom) + const dtfPrice = get(indexDTFPriceAtom) + const result = + ((Number(inputAmount) || 0) / (dtfPrice ?? 1)) * (1 - ASYNC_MINT_BUFFER) + + // 0.000001 is the minimum to avoid exponential notation when converting to string + return result > 0 && result < 0.000001 ? 0.000001 : result +}) + +export const mintValueUSDAtom = atom((get) => { + const inputAmount = get(userInputAtom) + return (Number(inputAmount) || 0) * (1 - ASYNC_MINT_BUFFER) +}) + +export const savedAmountAtom = atom((get) => { + const inputAmount = get(userInputAtom) + const balanceDifference = get(balanceDifferenceAtom) + return (Number(inputAmount) || 0) - balanceDifference +}) + +export const mintValueWeiAtom = atom((get) => { + const amountOut = get(mintValueAtom) + return parseEther(amountOut.toString()) +}) + +// Only Cowswap Orders +export const failedOrdersAtom = atom( + (get) => { + const cowswapOrders = get(cowswapOrdersAtom) + return ( + cowswapOrders.filter((order) => + [OrderStatus.CANCELLED, OrderStatus.EXPIRED].includes(order.status) + ) || [] + ) + } +) + +// Only Cowswap Orders +export const pendingOrdersAtom = atom( + (get) => { + const cowswapOrders = get(cowswapOrdersAtom) + return ( + cowswapOrders.filter((order) => + [OrderStatus.OPEN, OrderStatus.PRESIGNATURE_PENDING].includes( + order.status + ) + ) || [] + ) + } +) + +export const ordersSubmittedAtom = atom((get) => { + const cowswapOrdersCreatedAt = get(cowswapOrdersCreatedAtAtom) + return Boolean(cowswapOrdersCreatedAt) +}) + +export const balanceDifferenceAtom = atom((get) => { + const selectedToken = get(selectedTokenAtom) + const balanceAfterSwap = get(balanceAfterSwapAtom) + const selectedTokenBalance = get(selectedTokenBalanceAtom) + const operation = get(operationAtom) + const result = + operation === 'mint' + ? balanceAfterSwap - (selectedTokenBalance?.value || 0n) + : selectedTokenBalance?.value || 0n - balanceAfterSwap + return Number(formatUnits(result, selectedToken.decimals)) +}) diff --git a/src/views/index-dtf/issuance/async-swaps/atomic-batch-required.tsx b/src/views/index-dtf/issuance/async-swaps/atomic-batch-required.tsx new file mode 100644 index 000000000..052ebf913 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/atomic-batch-required.tsx @@ -0,0 +1,105 @@ +import { Button } from '@/components/ui/button' +import Help from '@/components/ui/help' +import { TransactionButtonContainer } from '@/components/ui/transaction' +import { chainIdAtom } from '@/state/atoms' +import { useConnectModal } from '@rainbow-me/rainbowkit' +import { useAtomValue } from 'jotai' +import { ExternalLink, OctagonAlert } from 'lucide-react' +import { useEffect, useState } from 'react' +import { useAccount, useDisconnect } from 'wagmi' + +const AtomicBatchRequired = () => { + const { openConnectModal } = useConnectModal() + const { disconnect } = useDisconnect() + const { isConnected } = useAccount() + const [shouldOpenModal, setShouldOpenModal] = useState(false) + const chainId = useAtomValue(chainIdAtom) + + useEffect(() => { + if (shouldOpenModal && !isConnected && openConnectModal) { + openConnectModal() + setShouldOpenModal(false) + } + }, [shouldOpenModal, isConnected, openConnectModal]) + + const handleSwitchWallet = async () => { + try { + setShouldOpenModal(true) + await disconnect() + } catch (error) { + console.error('Error switching wallets:', error) + setShouldOpenModal(false) + } + } + + return ( +
+
+
+
+ CoW Protocol + Universal Protocol +
+
+ +
Atomic Batch Required
+ +
+
+
+
+ Get better prices by accessing off-chain liquidity +
+
+ Automated Slow Mints can provide better quotes for minting or + redeeming a DTF, particularly when dealing with significant amounts + of capital or DTFs that involve bridged or low DEX liquidity + collateral assets. +
+
+
+
+ + + + + Create a new Gnosis Safe + + +
+
+ ) +} + +export default AtomicBatchRequired diff --git a/src/views/index-dtf/issuance/async-swaps/collateral-acquisition.tsx b/src/views/index-dtf/issuance/async-swaps/collateral-acquisition.tsx new file mode 100644 index 000000000..90cc42708 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/collateral-acquisition.tsx @@ -0,0 +1,187 @@ +import StackTokenLogo from '@/components/token-logo/StackTokenLogo' +import { Button } from '@/components/ui/button' +import { indexDTFAtom, indexDTFBasketAtom } from '@/state/dtf/atoms' +import { getTimerFormat } from '@/utils' +import { useAtom, useAtomValue, useSetAtom } from 'jotai' +import { ArrowLeft, ArrowRight, Check, Loader, RefreshCw } from 'lucide-react' +import { useEffect, useMemo, useState } from 'react' +import { + collateralAcquiredAtom, + cowswapOrdersCreatedAtAtom, + failedOrdersAtom, + openCollateralPanelAtom, + operationAtom, + pendingOrdersAtom, + successAtom, +} from './atom' +import { useRefreshQuotes } from './hooks/useQuote' +import { useStableQuoteSignatures } from './hooks/useQuoteSignatures' +import MintButton from './mint-button' + +const OpenCollateralPanel = () => { + const indexDTF = useAtomValue(indexDTFAtom) + const basket = useAtomValue(indexDTFBasketAtom) + const [open, setOpen] = useAtom(openCollateralPanelAtom) + + return ( + + ) +} + +const RequoteFailedOrdersButton = ({ + mutate, + isPending, + isFetching, +}: { + mutate: () => void + isPending: boolean + isFetching: boolean +}) => { + const failedOrdersQty = useAtomValue(failedOrdersAtom).length + + const buttonText = useMemo(() => { + if (isFetching) { + return 'Awaiting Quotes' + } + if (isPending) { + return 'Signing...' + } + return 'Accept New Quotes' + }, [isFetching, isPending]) + + return ( +
+
+
+
+ +
+
+
Prices have moved
+
+ Accept the new quotes for {failedOrdersQty} tokens. +
+
+
+ {/* */} +
+ +
+ ) +} + +const RequoteFailedOrders = () => { + const { isFetching } = useRefreshQuotes() + const { mutate: signQuotes, isPending: isSigning } = + useStableQuoteSignatures(true) + + return ( + + ) +} + +const CollateralAcquisition = () => { + const operation = useAtomValue(operationAtom) + const cowswapOrdersCreatedAt = useAtomValue(cowswapOrdersCreatedAtAtom) + const [elapsedTime, setElapsedTime] = useState(0) + const setSuccess = useSetAtom(successAtom) + const failedOrders = useAtomValue(failedOrdersAtom) + const pendingOrders = useAtomValue(pendingOrdersAtom) + const collateralAcquired = useAtomValue(collateralAcquiredAtom) + + const refreshQuotes = useMemo( + () => failedOrders.length > 0 && pendingOrders.length === 0, + [failedOrders, pendingOrders] + ) + + useEffect(() => { + if (!cowswapOrdersCreatedAt) return + + const interval = setInterval(() => { + const now = new Date() + const createdAt = new Date(cowswapOrdersCreatedAt) + const elapsed = now.getTime() - createdAt.getTime() + setElapsedTime(elapsed / 1000) + }, 1000) + + return () => clearInterval(interval) + }, [cowswapOrdersCreatedAt]) + + useEffect(() => { + if (collateralAcquired && operation === 'redeem') { + setSuccess(true) + } + }, [collateralAcquired, setSuccess, operation]) + + if (!cowswapOrdersCreatedAt) return null + + if (collateralAcquired && operation === 'mint') { + return ( +
+
+
+
+ +
+
Collateral Acquired
+
+ +
+ +
+ ) + } + + if (refreshQuotes) return + + return ( +
+
+
+
+ +
+
+ {operation === 'mint' + ? 'Acquiring Collateral' + : 'Selling collateral for USDC'} +
+
+
+ {getTimerFormat(elapsedTime)} +
+
+
+ ) +} + +export default CollateralAcquisition diff --git a/src/views/index-dtf/issuance/async-swaps/collaterals.tsx b/src/views/index-dtf/issuance/async-swaps/collaterals.tsx new file mode 100644 index 000000000..b950a698e --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/collaterals.tsx @@ -0,0 +1,90 @@ +import { cn } from '@/lib/utils' +import { OrderStatus } from '@cowprotocol/cow-sdk' +import { atom, useAtom, useAtomValue } from 'jotai' +import { useEffect, useMemo } from 'react' +import { + cowswapOrderIdsAtom, + cowswapOrdersAtom, + openCollateralPanelAtom, + operationAtom, + ordersSubmittedAtom, + universalSuccessOrdersAtom, +} from './atom' +import CowSwapOrder from './cowswap-order' +import UniversalOrder from './universal-order' + +const STATUS_PRIORITY: Record = { + [OrderStatus.CANCELLED]: 0, + [OrderStatus.EXPIRED]: 0, + [OrderStatus.PRESIGNATURE_PENDING]: 1, + [OrderStatus.OPEN]: 1, + [OrderStatus.FULFILLED]: 2, +} + +const isVisibleAtom = atom(false) +const shouldRenderAtom = atom(false) +export const showCollateralsAtom = atom((get) => { + const ordersSubmitted = get(ordersSubmittedAtom) + const open = get(openCollateralPanelAtom) + return ordersSubmitted && open +}) + +const Collaterals = () => { + const operation = useAtomValue(operationAtom) + const cowswapOrderIds = useAtomValue(cowswapOrderIdsAtom) + const cowswapOrders = useAtomValue(cowswapOrdersAtom) + const ordersSubmitted = useAtomValue(ordersSubmittedAtom) + const universalSuccessOrders = useAtomValue(universalSuccessOrdersAtom) + const open = useAtomValue(openCollateralPanelAtom) + const [isVisible, setIsVisible] = useAtom(isVisibleAtom) + const [shouldRender, setShouldRender] = useAtom(shouldRenderAtom) + + useEffect(() => { + if (ordersSubmitted && open) { + setShouldRender(true) + const timer = setTimeout(() => setIsVisible(true), 0) + return () => clearTimeout(timer) + } else { + setIsVisible(false) + const timer = setTimeout(() => setShouldRender(false), 300) + return () => clearTimeout(timer) + } + }, [ordersSubmitted, open, setIsVisible, setShouldRender]) + + const sortedCowswapOrderIds = useMemo( + () => + cowswapOrderIds.sort((a, b) => { + const orderA = cowswapOrders.find((o) => o.orderId === a) + const orderB = cowswapOrders.find((o) => o.orderId === b) + + if (!orderA?.status || !orderB?.status) return 0 + + const orderAPriority = STATUS_PRIORITY[orderA.status] + const orderBPriority = STATUS_PRIORITY[orderB.status] + + return orderAPriority - orderBPriority + }), + [cowswapOrders, cowswapOrderIds] + ) + + if (!shouldRender) return null + + return ( +
+ {sortedCowswapOrderIds.map((orderId) => ( + + ))} + {universalSuccessOrders.map((order, index) => ( + + ))} +
+ ) +} + +export default Collaterals diff --git a/src/views/index-dtf/issuance/async-swaps/cowswap-order.tsx b/src/views/index-dtf/issuance/async-swaps/cowswap-order.tsx new file mode 100644 index 000000000..e60d9e95f --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/cowswap-order.tsx @@ -0,0 +1,140 @@ +import TokenLogo from '@/components/token-logo' +import Help from '@/components/ui/help' +import { cn } from '@/lib/utils' +import { indexDTFBasketAtom } from '@/state/dtf/atoms' +import { formatCurrency, formatTokenAmount } from '@/utils' +import { OrderStatus as CowSwapOrderStatus } from '@cowprotocol/cow-sdk' +import { useAtomValue } from 'jotai' +import { ArrowUpRight, Check, Loader } from 'lucide-react' +import { Link } from 'react-router-dom' +import { formatUnits } from 'viem' +import { operationAtom } from './atom' +import { useOrderStatus } from './hooks/useOrderStatus' +import { Skeleton } from '@/components/ui/skeleton' +import { useMemo } from 'react' +import { chainIdAtom } from '@/state/atoms' + +const STATUS_MAP: Record = { + [CowSwapOrderStatus.PRESIGNATURE_PENDING]: 'Processing', + [CowSwapOrderStatus.OPEN]: 'Processing', + [CowSwapOrderStatus.FULFILLED]: 'Order Filled', + [CowSwapOrderStatus.CANCELLED]: 'Not Filled', + [CowSwapOrderStatus.EXPIRED]: 'Not Filled', +} + +const OrderStatus = ({ + status, + orderId, +}: { + orderId: string + status: CowSwapOrderStatus +}) => { + return ( +
+ {STATUS_MAP[status] === 'Order Filled' && ( + + )} + {STATUS_MAP[status] === 'Processing' && ( + + )} +
{STATUS_MAP[status]}
+ {STATUS_MAP[status] === 'Not Filled' && ( + + )} + + + +
+ ) +} + +const CowSwapOrder = ({ + orderId, + disableFetch, +}: { + orderId: string + disableFetch?: boolean +}) => { + const chainId = useAtomValue(chainIdAtom) + const { data } = useOrderStatus({ orderId, disabled: disableFetch }) + const operation = useAtomValue(operationAtom) + const indexDTFBasket = useAtomValue(indexDTFBasketAtom) + + const { token, firstAmount, secondAmount } = useMemo(() => { + return operation === 'redeem' + ? { + token: data?.sellToken, + firstAmount: data?.sellAmount, + secondAmount: data?.buyAmount, + } + : { + token: data?.buyToken, + firstAmount: data?.buyAmount, + secondAmount: data?.sellAmount, + } + }, [data, operation]) + + return ( +
+
+ t.address === token)?.symbol || '' + } + chain={chainId} + size="xl" + /> +
+ {secondAmount ? ( +
+ {operation === 'mint' ? '-' : '+'}{' '} + {formatCurrency(Number(formatUnits(BigInt(secondAmount), 6)))}{' '} + USDC +
+ ) : ( + + )} + {firstAmount ? ( +
+ {operation === 'mint' ? '+' : '-'}{' '} + {formatTokenAmount( + Number( + formatUnits( + BigInt(firstAmount), + indexDTFBasket?.find((t) => t.address === token) + ?.decimals || 18 + ) + ) + )}{' '} + {indexDTFBasket?.find((t) => t.address === token)?.symbol || ''} +
+ ) : ( + + )} +
+
+ {data?.status ? ( + + ) : ( + + )} +
+ ) +} + +export default CowSwapOrder diff --git a/src/views/index-dtf/issuance/async-swaps/details.tsx b/src/views/index-dtf/issuance/async-swaps/details.tsx new file mode 100644 index 000000000..8fd049c9d --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/details.tsx @@ -0,0 +1,51 @@ +import { SwapDetails } from '@/components/ui/swap' +import { indexDTFAtom, indexDTFPriceAtom } from '@/state/dtf/atoms' +import { formatCurrency, formatPercentage } from '@/utils' +import { useAtomValue } from 'jotai' +import { mintValueUSDAtom } from './atom' + +const Details = () => { + const indexDTF = useAtomValue(indexDTFAtom) + const indexDTFPrice = useAtomValue(indexDTFPriceAtom) + const mintValueUSD = useAtomValue(mintValueUSDAtom) + + const ratioText = `1 ${indexDTF?.token?.symbol} = ${formatCurrency(indexDTFPrice || 0)} USDC` + const mintFeeValue = mintValueUSD * (indexDTF?.mintingFee || 0) + + if (!indexDTF) return null + + return ( + + Fee{' '} + {formatPercentage(indexDTF.mintingFee * 100)} + + ), + }} + details={[ + { + left: Mint Fee, + right: ( + + ${formatCurrency(mintFeeValue)}{' '} + + ({formatPercentage(indexDTF.mintingFee * 100)}) + + + ), + help: 'A one-time fee deduction from the tokens you are using to create a share of the DTF. This fee is set by the Governors of the DTF.', + }, + // { + // left: Price Impact, + // right: , + // help: 'The impact your trade has on the market price.', + // }, + ]} + /> + ) +} + +export default Details diff --git a/src/views/index-dtf/issuance/async-swaps/hooks/useFolioDetails.ts b/src/views/index-dtf/issuance/async-swaps/hooks/useFolioDetails.ts new file mode 100644 index 000000000..25adbc75b --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/hooks/useFolioDetails.ts @@ -0,0 +1,56 @@ +import dtfIndexAbi from '@/abis/dtf-index-abi' +import { chainIdAtom } from '@/state/atoms' +import { indexDTFAtom } from '@/state/dtf/atoms' +import { useAtomValue } from 'jotai' +import { parseUnits } from 'viem' +import { useReadContracts } from 'wagmi' + +interface UseFolioDetailsProps { + shares?: bigint +} + +export function useFolioDetails({ + shares = parseUnits('1', 18), +}: UseFolioDetailsProps) { + const indexDTF = useAtomValue(indexDTFAtom) + const chainId = useAtomValue(chainIdAtom) + + if (!indexDTF) { + return { + data: { + assets: [], + redeemValues: [], + mintValues: [], + }, + } + } + + return useReadContracts({ + allowFailure: false, + contracts: [ + { + abi: dtfIndexAbi, + address: indexDTF.id, + functionName: 'toAssets', + args: [shares, 0], + chainId, + }, + { + abi: dtfIndexAbi, + address: indexDTF.id, + functionName: 'toAssets', + args: [shares, 1], + chainId, + }, + ], + query: { + select(data) { + return { + assets: data[0][0], + redeemValues: data[0][1], + mintValues: data[1][1], + } + }, + }, + }) +} diff --git a/src/views/index-dtf/issuance/async-swaps/hooks/useGetMintTx.ts b/src/views/index-dtf/issuance/async-swaps/hooks/useGetMintTx.ts new file mode 100644 index 000000000..1f27129c7 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/hooks/useGetMintTx.ts @@ -0,0 +1,89 @@ +import { indexDTFAtom } from '@/state/dtf/atoms' +import { walletAtom } from '@/state/atoms' +import { useAtomValue } from 'jotai' +import { useEffect, useState } from 'react' +import { Address, parseEventLogs, zeroAddress } from 'viem' +import { usePublicClient } from 'wagmi' +import dtfIndexAbi from '@/abis/dtf-index-abi' + +export const useGetMintTx = () => { + const [mintTxHash, setMintTxHash] = useState(null) + const [isLoading, setIsLoading] = useState(false) + const indexDTF = useAtomValue(indexDTFAtom) + const walletAddress = useAtomValue(walletAtom) + const publicClient = usePublicClient() + + useEffect(() => { + if (!indexDTF?.id || !walletAddress || !publicClient) { + return + } + + setIsLoading(true) + + const checkForMintEvents = async () => { + try { + // Get the latest block number + const latestBlock = await publicClient.getBlockNumber() + + // Look back 10 blocks for Transfer events + const fromBlock = latestBlock - 10n + + const logs = await publicClient.getLogs({ + address: indexDTF.id as Address, + event: { + type: 'event', + name: 'Transfer', + inputs: [ + { type: 'address', name: 'from', indexed: true }, + { type: 'address', name: 'to', indexed: true }, + { type: 'uint256', name: 'value', indexed: false }, + ], + }, + fromBlock, + toBlock: latestBlock, + }) + + // Filter for Transfer events from zero address to connected wallet + const mintEvents = logs.filter((log) => { + const parsedLog = parseEventLogs({ + abi: dtfIndexAbi, + logs: [log], + eventName: 'Transfer', + })[0] + + return ( + parsedLog && + parsedLog.args.from === zeroAddress && + parsedLog.args.to === walletAddress && + parsedLog.args.value > 0n + ) + }) + + if (mintEvents.length > 0) { + // Get the most recent mint event + const latestMintEvent = mintEvents[mintEvents.length - 1] + setMintTxHash(latestMintEvent.transactionHash) + } + } catch (error) { + console.error('Error checking for mint events:', error) + } finally { + setIsLoading(false) + } + } + + // Check immediately + checkForMintEvents() + + // Set up polling every 2 seconds + const interval = setInterval(checkForMintEvents, 2000) + + return () => { + clearInterval(interval) + } + }, [indexDTF?.id, walletAddress, publicClient]) + + return { + mintTxHash, + isLoading, + } +} diff --git a/src/views/index-dtf/issuance/async-swaps/hooks/useOrderStatus.ts b/src/views/index-dtf/issuance/async-swaps/hooks/useOrderStatus.ts new file mode 100644 index 000000000..a5588c9b3 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/hooks/useOrderStatus.ts @@ -0,0 +1,48 @@ +import { OrderStatus } from '@cowprotocol/cow-sdk' +import { useQuery } from '@tanstack/react-query' +import { useSetAtom } from 'jotai' +import { cowswapOrdersAtom } from '../atom' +import { useGlobalProtocolKit } from '../providers/GlobalProtocolKitProvider' + +interface UseOrderStatusParams { + orderId: string + disabled?: boolean +} + +const isOrderCompleted = (status: OrderStatus) => { + return [ + OrderStatus.FULFILLED, + OrderStatus.EXPIRED, + OrderStatus.CANCELLED, + ].includes(status) +} + +export function useOrderStatus({ orderId, disabled }: UseOrderStatusParams) { + const { orderBookApi } = useGlobalProtocolKit() + const setCowswapOrders = useSetAtom(cowswapOrdersAtom) + + return useQuery({ + queryKey: ['order/status', orderId], + enabled: !!orderId && !!orderBookApi && !disabled, + queryFn: async () => { + if (!orderBookApi) { + throw new Error('OrderBookApi not initialized') + } + + const order = await orderBookApi.getOrder(orderId) + setCowswapOrders((prev) => [ + ...prev.filter((o) => o.orderId !== orderId), + { ...order, orderId }, + ]) + + return order + }, + refetchInterval(query) { + if (query.state.data && isOrderCompleted(query.state.data.status)) { + return false + } + + return 3_000 + }, + }) +} diff --git a/src/views/index-dtf/issuance/async-swaps/hooks/useQuote.ts b/src/views/index-dtf/issuance/async-swaps/hooks/useQuote.ts new file mode 100644 index 000000000..a67589500 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/hooks/useQuote.ts @@ -0,0 +1,567 @@ +import { useERC20Balances } from '@/hooks/useERC20Balance' +import useTokensInfo from '@/hooks/useTokensInfo' +import { chainIdAtom, walletAtom } from '@/state/atoms' +import { + OrderBookApi, + OrderQuoteSideKindBuy, + OrderQuoteSideKindSell, + PriceQuality, + SigningScheme, +} from '@cowprotocol/cow-sdk' +import { useQuery } from '@tanstack/react-query' +import { useAtom, useAtomValue, useSetAtom } from 'jotai' +import { useEffect } from 'react' +import { Address, formatUnits, parseEther, zeroAddress } from 'viem' +import { + applyWalletBalanceAtom, + failedOrdersAtom, + fallbackQuotesAtom, + fetchingQuotesAtom, + mintValueAtom, + operationAtom, + quotesAtom, + redeemAssetsAtom, + refetchQuotesAtom, + selectedTokenAtom, +} from '../atom' +import { + UniversalRelayerWithRateLimiter, + useGlobalProtocolKit, +} from '../providers/GlobalProtocolKitProvider' +import { + CustomUniversalQuote, + getUniversalTokenName, +} from '../providers/universal' +import { QuoteProvider } from '../types' +import { useFolioDetails } from './useFolioDetails' +import { getAssetPrice } from './utils' + +const MIN_UNIVERSAL_QUOTE_VALUE_USD = 2 + +async function getQuoteValue( + chainId: number, + buyToken: Address, + amount: bigint, + decimals: number +) { + const assetPrice = await getAssetPrice(chainId, buyToken) + if (!assetPrice) { + return undefined + } + return Number(formatUnits(amount, decimals)) * assetPrice.price || undefined +} + +async function getCowswapQuote({ + sellToken, + buyToken, + amount, + address, + operation, + orderBookApi, +}: { + sellToken: Address + buyToken: Address + amount: bigint + address: Address + operation: 'redeem' | 'mint' + orderBookApi: OrderBookApi +}) { + try { + const quote = await orderBookApi.getQuote({ + sellToken, + buyToken, + from: address, + receiver: address, + validFor: 60 * 10, // 10 minutes + priceQuality: PriceQuality.VERIFIED, + ...(operation === 'redeem' + ? { + kind: OrderQuoteSideKindSell.SELL, + sellAmountBeforeFee: amount.toString(), + } + : { + kind: OrderQuoteSideKindBuy.BUY, + buyAmountAfterFee: amount.toString(), + }), + signingScheme: SigningScheme.PRESIGN, + }) + + // CowSwap orders sometimes return every so slightly different amounts than requested. + if (operation === 'redeem') { + quote.quote.sellAmount = amount.toString() + } else { + quote.quote.buyAmount = amount.toString() + } + + return quote + } catch (error) { + console.error(`Error getting cowswap quote:`, error) + return null + } +} + +async function getUniversalQuote({ + sellToken, + buyToken, + amount, + address, + operation, + universalSdk, +}: { + sellToken: Address + buyToken: Address + amount: bigint + address: Address + operation: 'redeem' | 'mint' + universalSdk: UniversalRelayerWithRateLimiter +}) { + try { + const universalAsset = getUniversalTokenName( + operation === 'redeem' ? sellToken : buyToken + ) + const universalQuote = await universalSdk.getQuote({ + type: operation === 'redeem' ? 'SELL' : 'BUY', + blockchain: 'BASE', + token: universalAsset, + pair_token: 'USDC', + user_address: address, + slippage_bips: 100, + token_amount: amount.toString(), + }) + + const customQuote: CustomUniversalQuote = { + _originalQuote: universalQuote, + buyToken, + sellToken, + type: operation === 'redeem' ? 'SELL' : 'BUY', + userAddress: address, + sellAmount: + operation === 'redeem' + ? amount + : BigInt(universalQuote.pair_token_amount ?? '0'), + buyAmount: + operation === 'redeem' + ? BigInt(universalQuote.pair_token_amount ?? '0') + : amount, + validTo: Number(universalQuote.deadline ?? 0), + } + return customQuote + } catch (error) { + console.error(`Error getting universal quote:`, error) + return null + } +} + +async function getQuote({ + sellToken, + buyToken, + amount, + address, + operation, + orderBookApi, + universalSdk, + quoteValue, +}: { + sellToken: Address + buyToken: Address + amount: bigint + address: Address + operation: 'redeem' | 'mint' + orderBookApi: OrderBookApi + universalSdk: UniversalRelayerWithRateLimiter + quoteValue?: number +}) { + if ( + !address || + address == zeroAddress || + buyToken == zeroAddress || + sellToken == zeroAddress || + !orderBookApi || + !universalSdk + ) { + throw new Error('getQuote: Invalid params') + } + + if (amount <= 0n) { + throw new Error('getQuote: Amount is 0') + } + + // Try Universal first if available + const universalAsset = getUniversalTokenName( + operation === 'redeem' ? sellToken : buyToken + ) + const hasMinValue = quoteValue && quoteValue > MIN_UNIVERSAL_QUOTE_VALUE_USD + let universalQuote: CustomUniversalQuote | null = null + + if (universalAsset && hasMinValue) { + universalQuote = await getUniversalQuote({ + sellToken, + buyToken, + amount, + address, + operation, + universalSdk, + }) + } + + const cowswapQuote = await getCowswapQuote({ + sellToken, + buyToken, + amount, + address, + operation, + orderBookApi, + }) + + // Pick the best quote + if (universalQuote && cowswapQuote) { + const universalValue = universalQuote._originalQuote.pair_token_amount + const cowswapValue = + operation === 'redeem' + ? cowswapQuote.quote.buyAmount + : cowswapQuote.quote.sellAmount + + console.log({ universalValue, cowswapValue }) + + if ( + universalValue && + cowswapValue && + universalValue < cowswapValue && + operation === 'redeem' + ) { + universalQuote = null + } + + if ( + universalValue && + cowswapValue && + universalValue > cowswapValue && + operation === 'mint' + ) { + universalQuote = null + } + } + + return { + universalQuote, + cowswapQuote, + } +} + +export const useQuotesForMint = () => { + const chainId = useAtomValue(chainIdAtom) + const selectedToken = useAtomValue(selectedTokenAtom) + const mintValue = useAtomValue(mintValueAtom) + const folioAmount = parseEther(mintValue.toString()) + const address = useAtomValue(walletAtom) + const applyWalletBalance = useAtomValue(applyWalletBalanceAtom) + const [quotes, setQuotes] = useAtom(quotesAtom) + const setRefetchQuotes = useSetAtom(refetchQuotesAtom) + const setFetchingQuotes = useSetAtom(fetchingQuotesAtom) + const setFallbackQuotes = useSetAtom(fallbackQuotesAtom) + + const { orderBookApi, universalSdk } = useGlobalProtocolKit() + const { data: folioDetails } = useFolioDetails({ shares: folioAmount }) + const { data: balances } = useERC20Balances( + (folioDetails?.assets || []).map((address) => ({ + address, + chainId, + })) + ) + + const { data: tokensInfo } = useTokensInfo( + folioDetails?.assets.map((address) => address as Address) || [] + ) + + const query = useQuery({ + queryKey: ['quotes/mint', folioDetails?.assets, folioDetails?.mintValues], + queryFn: async ({ signal }) => { + if (!folioDetails || !tokensInfo || !orderBookApi || !universalSdk) { + return {} + } + + const quotePromises = + folioDetails?.assets.map(async (asset, i) => { + const token = tokensInfo[asset.toLowerCase()] + const mintValue = folioDetails?.mintValues[i] + const walletValue = applyWalletBalance + ? ((balances?.[i] as bigint) ?? 0n) + : 0n + const amount = mintValue - walletValue + + if (amount <= 0n || token.address === selectedToken.address) { + console.log(asset, 'already has enough balance') + return null + } + + try { + const quoteValue = await getQuoteValue( + chainId, + token.address, + amount, + token.decimals + ) + const { universalQuote, cowswapQuote } = await getQuote({ + sellToken: selectedToken.address, + buyToken: token.address, + amount, + address: address as Address, + operation: 'mint', + orderBookApi, + universalSdk, + quoteValue, + }) + + if (cowswapQuote) { + setFallbackQuotes((prev) => ({ + ...prev, + [token.address]: cowswapQuote, + })) + } + + return universalQuote || cowswapQuote + } catch (error) { + console.error(`Error getting quote for ${asset}:`, error) + return null + } + }) || [] + + const results = await Promise.all(quotePromises) + + folioDetails.assets.forEach((asset, i) => { + const token = tokensInfo[asset.toLowerCase()] + const quote = results[i] + const type = + quote && '_originalQuote' in quote + ? QuoteProvider.Universal + : QuoteProvider.CowSwap + + try { + if (!signal.aborted) { + setQuotes((prev) => ({ + ...prev, + [token.address as string]: { + success: !!quote, + type, + data: quote, + }, + })) + } + + return { + token, + success: true, + type, + quote, + } + } catch { + if (!signal.aborted) { + setQuotes((prev) => ({ + ...prev, + [token.address as string]: { + token, + success: false, + }, + })) + } + + return { + token, + success: false, + } + } + }) + + return quotes + }, + enabled: !!folioDetails?.mintValues && !!tokensInfo && !!folioAmount, + }) + + useEffect(() => { + setRefetchQuotes({ fn: query.refetch }) + setFetchingQuotes(query.isFetching) + }, [query.refetch, query.isFetching, setRefetchQuotes, setFetchingQuotes]) + + return query +} + +export const useQuotesForRedeem = () => { + const chainId = useAtomValue(chainIdAtom) + const selectedToken = useAtomValue(selectedTokenAtom) + const redeemAssets = useAtomValue(redeemAssetsAtom) + const address = useAtomValue(walletAtom) + const [quotes, setQuotes] = useAtom(quotesAtom) + const setRefetchQuotes = useSetAtom(refetchQuotesAtom) + const setFetchingQuotes = useSetAtom(fetchingQuotesAtom) + const setFallbackQuotes = useSetAtom(fallbackQuotesAtom) + + const { orderBookApi, universalSdk } = useGlobalProtocolKit() + + const assets = Object.keys(redeemAssets) + + const { data: tokensInfo } = useTokensInfo( + assets.map((address) => address as Address) + ) + + const query = useQuery({ + queryKey: ['quotes/redeem', assets], + queryFn: async ({ signal }) => { + if ( + !redeemAssets || + !assets || + !assets.length || + !tokensInfo || + !orderBookApi || + !universalSdk + ) { + return {} + } + + const quotePromises = + assets.map(async (asset) => { + const token = tokensInfo[asset.toLowerCase()] + const amount = redeemAssets[asset as Address] + + if (token.address === selectedToken.address) { + console.log(asset, 'no need to redeem') + return null + } + + try { + const quoteValue = await getQuoteValue( + chainId, + token.address, + amount, + token.decimals + ) + const { universalQuote, cowswapQuote } = await getQuote({ + sellToken: token.address, + buyToken: selectedToken.address, + amount, + address: address as Address, + operation: 'redeem', + orderBookApi, + universalSdk, + quoteValue, + }) + + if (cowswapQuote) { + setFallbackQuotes((prev) => ({ + ...prev, + [token.address]: cowswapQuote, + })) + } + + return universalQuote || cowswapQuote + } catch (error) { + console.error(`Error getting quote for ${asset}:`, error) + return null + } + }) || [] + + const results = await Promise.all(quotePromises) + + assets.forEach((asset, i) => { + const token = tokensInfo[asset.toLowerCase()] + const quote = results[i] + const type = + quote && '_originalQuote' in quote + ? QuoteProvider.Universal + : QuoteProvider.CowSwap + + try { + if (!signal.aborted) { + setQuotes((prev) => ({ + ...prev, + [token.address as string]: { + success: !!quote, + type, + data: quote, + }, + })) + } + + return { + token, + success: true, + type, + quote, + } + } catch { + if (!signal.aborted) { + setQuotes((prev) => ({ + ...prev, + [token.address as string]: { + token, + success: false, + }, + })) + } + + return { + token, + success: false, + } + } + }) + + return quotes + }, + enabled: !!assets && !!tokensInfo && !!redeemAssets && assets.length > 0, + }) + + useEffect(() => { + setRefetchQuotes({ fn: query.refetch }) + setFetchingQuotes(query.isFetching) + }, [query.refetch, query.isFetching, setRefetchQuotes, setFetchingQuotes]) + + return query +} + +export const useRefreshQuotes = () => { + const address = useAtomValue(walletAtom) + const { orderBookApi, universalSdk } = useGlobalProtocolKit() + const [quotes, setQuotes] = useAtom(quotesAtom) + const operation = useAtomValue(operationAtom) + const failedOrders = useAtomValue(failedOrdersAtom) + + const query = useQuery({ + queryKey: ['refresh-quotes', failedOrders], + queryFn: async () => { + if (!failedOrders || !orderBookApi || !address || !universalSdk) { + return + } + + // Failed Cowswap quotes + const quotePromises = failedOrders.map(async (order) => { + return await getCowswapQuote({ + sellToken: order.sellToken as Address, + buyToken: order.buyToken as Address, + amount: BigInt( + operation === 'redeem' ? order.sellAmount : order.buyAmount + ), + address: address as Address, + operation, + orderBookApi, + }) + }) + + const results = await Promise.all(quotePromises) + + failedOrders.forEach((order, i) => { + setQuotes((prev) => ({ + ...prev, + [operation === 'redeem' ? order.sellToken : order.buyToken]: { + success: !!results[i], + type: QuoteProvider.CowSwap, + data: results[i], + }, + })) + }) + + return quotes + }, + }) + + return query +} diff --git a/src/views/index-dtf/issuance/async-swaps/hooks/useQuoteSignatures.ts b/src/views/index-dtf/issuance/async-swaps/hooks/useQuoteSignatures.ts new file mode 100644 index 000000000..13ed218aa --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/hooks/useQuoteSignatures.ts @@ -0,0 +1,540 @@ +import CowswapSettlement from '@/abis/CowSwapSettlement' +import { notifyError } from '@/hooks/useNotification' +import { chainIdAtom, walletAtom } from '@/state/atoms' +import { indexDTFAtom } from '@/state/dtf/atoms' +import { MetadataApi } from '@cowprotocol/sdk-app-data' +import { + AppDataHash, + OrderBalance, + OrderCreation, + OrderQuoteResponse, + OrderSigningUtils, + SigningScheme, +} from '@cowprotocol/cow-sdk' +import { ViemAdapter } from '@cowprotocol/sdk-viem-adapter' +import { useMutation } from '@tanstack/react-query' +import { useAtom, useAtomValue, useSetAtom } from 'jotai' +import pLimit from 'p-limit' +import { useCallback, useRef } from 'react' +import { generateTypedData, OrderRequest, Quote } from 'universal-sdk' +import { Address, encodeFunctionData, Hex, maxUint256, parseUnits } from 'viem' +import { useSendCalls, useSignTypedData, usePublicClient } from 'wagmi' +import { + cowswapOrderIdsAtom, + cowswapOrdersAtom, + cowswapOrdersCreatedAtAtom, + failedOrdersAtom, + fallbackQuotesAtom, + infoMessageAtom, + operationAtom, + quotesAtom, + selectedTokenAtom, + universalSuccessOrdersAtom, + userInputAtom, +} from '../atom' +import { useGlobalProtocolKit } from '../providers/GlobalProtocolKitProvider' +import { + CustomUniversalQuote, + getUniversalTokenAddress, +} from '../providers/universal' +import { QuoteProvider } from '../types' +import { + convertTypeDataToBigInt, + getApprovalCallIfNeeded, + getCowswapOrdersInfoMessage, + getTransactionInfoMessage, + getUniversalTokenInfoMessage, + sendCallsWithRetry, + signTypedDataWithRetry, +} from './utils' + +export const COWSWAP_SETTLEMENT = + '0x9008D19f58AAbD9eD0D60971565AA8510560ab41' as const +const COWSWAP_VAULT = '0xC92E8bdf79f0507f65a392b0ab4667716BFE0110' as const +const UNIVERSAL_PERMIT2 = '0x000000000022D473030F116dDEE9F6B43aC78BA3' as const + +type CowswapPreSignTx = { + type: QuoteProvider.CowSwap + data: { + orderId: string + quote: OrderCreation + preSignTx: Hex + sellToken: string + amount: string + } +} + +type UniversalQuote = { + type: QuoteProvider.Universal + data: CustomUniversalQuote & { + quote: Quote + } +} + +const getCowswapPreSignTx = async ({ + chainId, + orderQuote, + operation, + address, + appDataHex, +}: { + chainId: number + orderQuote: OrderQuoteResponse + operation: string + address: Address + appDataHex: AppDataHash +}): Promise => { + if (orderQuote.quote.sellAmount === '0') { + return undefined + } + + const modifiedQuote = { + ...orderQuote.quote, + feeAmount: '0', + buyAmount: + operation === 'mint' + ? orderQuote.quote.buyAmount + : ((BigInt(orderQuote.quote.buyAmount) * 98n) / 100n).toString(), + sellAmount: + operation === 'mint' + ? ((BigInt(orderQuote.quote.sellAmount) * 101n) / 100n).toString() + : orderQuote.quote.sellAmount, + from: address, + receiver: address!, + signature: address!, + signingScheme: SigningScheme.PRESIGN, + } as const satisfies OrderCreation + + const orderId = await OrderSigningUtils.generateOrderId( + chainId, + { + ...modifiedQuote, + sellTokenBalance: OrderBalance.ERC20, + buyTokenBalance: OrderBalance.ERC20, + appData: appDataHex, + }, + { + owner: address, + } + ) + + const encodedPreSignTx = encodeFunctionData({ + abi: CowswapSettlement, + functionName: 'setPreSignature', + args: [orderId.orderId as Hex, true], + }) + + return { + type: QuoteProvider.CowSwap, + data: { + orderId: orderId.orderId, + quote: modifiedQuote, + preSignTx: encodedPreSignTx, + sellToken: modifiedQuote.sellToken, + amount: modifiedQuote.sellAmount, + }, + } +} + +export function useQuoteSignatures(refresh = false) { + const indexDTF = useAtomValue(indexDTFAtom) + const chainId = useAtomValue(chainIdAtom) + const address = useAtomValue(walletAtom) + const operation = useAtomValue(operationAtom) + const inputAmount = useAtomValue(userInputAtom) + const quoteToken = useAtomValue(selectedTokenAtom) + const [quotes, setQuotes] = useAtom(quotesAtom) + const fallbackQuotes = useAtomValue(fallbackQuotesAtom) + const setCowswapOrderIds = useSetAtom(cowswapOrderIdsAtom) + const setCowswapOrders = useSetAtom(cowswapOrdersAtom) + const setUniversalSuccessOrders = useSetAtom(universalSuccessOrdersAtom) + const setCowswapOrdersCreatedAt = useSetAtom(cowswapOrdersCreatedAtAtom) + const setInfoMessage = useSetAtom(infoMessageAtom) + const { orderBookApi, universalSdk } = useGlobalProtocolKit() + const { sendCallsAsync } = useSendCalls() + const failedOrders = useAtomValue(failedOrdersAtom) + const { signTypedDataAsync } = useSignTypedData() + const publicClient = usePublicClient() + + const limiter = pLimit(1) + + return useMutation({ + mutationKey: [ + 'quote-signatures', + chainId, + address, + operation, + JSON.stringify(quotes, (_, value) => + typeof value === 'bigint' ? value.toString() : value + ), + refresh, + ], + mutationFn: async () => { + if (!address || !orderBookApi || !chainId || !indexDTF || !universalSdk) { + console.error('No global kit') + return { + orders: [], + } + } + + // Create a Viem adapter for the MetadataApi + let metadataApi: MetadataApi + if (publicClient) { + const viemAdapter = new ViemAdapter({ provider: publicClient }) + metadataApi = new MetadataApi(viemAdapter) + } else { + // Fallback without adapter + metadataApi = new MetadataApi() + } + + let appDataContent: string + let appDataHex: AppDataHash + + try { + const appDataDoc = await metadataApi.generateAppDataDoc({ + appCode: 'Reserve Protocol', + environment: 'production', + }) + const appDataInfo = await metadataApi.getAppDataInfo(appDataDoc) + appDataContent = appDataInfo.appDataContent + appDataHex = appDataInfo.appDataHex + } catch (error) { + console.error('Failed to calculate appDataHex', error) + // Fallback to a simple appData structure if MetadataApi fails + appDataContent = JSON.stringify({ + appCode: 'Reserve Protocol', + environment: 'production', + version: '1.0.0', + }) + // Use a default hex value - this is the keccak256 hash of the appDataContent + appDataHex = ('0x' + '0'.repeat(64)) as AppDataHash + console.warn('Using fallback appData due to MetadataApi error') + } + + const successfulQuotes = Object.values(quotes).filter( + (quote) => quote.success + ) + + console.log({ successfulQuotes }) + + if (successfulQuotes.length === 0) { + // TODO: handle this + return { + orders: [], + } + } + + // Generate order IDs and hashed messages for all quotes + const orderData: (CowswapPreSignTx | UniversalQuote | undefined)[] = + await Promise.all( + successfulQuotes.map(async (quote) => { + if (quote.type === QuoteProvider.CowSwap) { + return getCowswapPreSignTx({ + chainId, + orderQuote: quote.data, + operation, + address, + appDataHex, + }) + } + + if (quote.type === QuoteProvider.Universal) { + const uq = quote.data as CustomUniversalQuote + + return { + type: QuoteProvider.Universal, + data: { + ...uq, + quote: uq._originalQuote, + }, + } + } + }) + ) + + const validOrderData = orderData.filter((data) => !!data) + + const txData = await Promise.all( + validOrderData.map(async ({ type, data }) => { + if (type === QuoteProvider.CowSwap) { + return [ + operation === 'redeem' + ? await getApprovalCallIfNeeded({ + chainId, + address: address, + token: data.sellToken as Address, + requiredAmount: BigInt(data.amount as string), + spender: COWSWAP_VAULT, + }) + : null, + { + to: COWSWAP_SETTLEMENT, + data: data.preSignTx, + value: 0n, + }, + ].filter((e) => e !== null) + } + + if (operation === 'redeem' && type === QuoteProvider.Universal) { + return [ + await await getApprovalCallIfNeeded({ + chainId, + address: address, + token: data.sellToken as Address, + requiredAmount: data.sellAmount, + spender: UNIVERSAL_PERMIT2, + }), + ].filter((e) => e !== null) + } + + return null + }) + ).then((results) => results.filter((data) => data !== null).flat()) + + if (operation === 'mint') { + const requiredAmount = parseUnits(inputAmount, quoteToken.decimals) + for (const spender of [COWSWAP_VAULT, UNIVERSAL_PERMIT2]) { + const approvalCall = await getApprovalCallIfNeeded({ + chainId, + address: address as Address, + token: quoteToken.address as Address, + requiredAmount, + approvalAmount: maxUint256, + spender, + }) + if (approvalCall) txData.unshift(approvalCall) + } + } + + if (txData.length > 0) { + try { + const infoMessage = getTransactionInfoMessage(txData) + setInfoMessage((prev) => infoMessage || prev) + + await sendCallsWithRetry(sendCallsAsync, chainId, txData, address) + } catch (error) { + console.error('sendCallsAsync', error) + notifyError('Transaction failed', 'Please try again') + } + } + + // Separate signature generation from order submission to optimize performance + const universalQuotes = validOrderData.filter( + ({ type }) => type === QuoteProvider.Universal + ) + + const universalOrderResults = await Promise.all( + universalQuotes.map(({ data }) => + limiter(async () => { + const quote = data.quote as OrderRequest + + try { + const { typedData } = await generateTypedData(quote) + const _typedData = convertTypeDataToBigInt(typedData) + + const signingMessage = getUniversalTokenInfoMessage( + quote.token as Address, + 'signing' + ) + setInfoMessage((prev) => signingMessage || prev) + + const signature = await signTypedDataWithRetry( + signTypedDataAsync, + _typedData + ) + + const submittingMessage = getUniversalTokenInfoMessage( + quote.token as Address, + 'submitting' + ) + setInfoMessage((prev) => submittingMessage || prev) + + const universalOrder = await universalSdk.submitOrder({ + ...quote, + signature, + }) + + setUniversalSuccessOrders((prev) => { + return [ + ...prev, + { + ...quote, + orderId: universalOrder.order_id, + transactionHash: universalOrder.transaction_hash, + }, + ] + }) + + return { success: true, quote, order: universalOrder } + } catch (error) { + console.error('universalOrder', error) + notifyError( + 'Universal order failed', + 'No worries - continuing with Cowswap fallback after all Universal orders' + ) + return { success: false, quote, error } + } + }) + ) + ) + + // Log results for debugging + const successfulOrders = universalOrderResults.filter( + (result) => result.success + ) + const failedUniversalOrders = universalOrderResults.filter( + (result) => !result.success + ) + + console.log( + `Universal orders completed: ${successfulOrders.length} successful, ${failedUniversalOrders.length} failed` + ) + + // For failed universal orders, use fallback quotes + const fallbackOrderData = ( + await Promise.all( + failedUniversalOrders.map(async ({ quote }) => { + const token = getUniversalTokenAddress(quote.token) + const fallbackQuote = fallbackQuotes[token] + + if (!fallbackQuote) { + return null + } + + return await getCowswapPreSignTx({ + chainId, + orderQuote: fallbackQuote, + operation, + address, + appDataHex, + }) + }) + ) + ).filter((data) => !!data) + + const fallbackTxData = await Promise.all( + fallbackOrderData.map(async ({ type, data }) => { + if (type === QuoteProvider.CowSwap) { + return [ + operation === 'redeem' + ? await getApprovalCallIfNeeded({ + chainId, + address: address, + token: data.sellToken as Address, + requiredAmount: BigInt(data.amount as string), + spender: COWSWAP_VAULT, + }) + : null, + { + to: COWSWAP_SETTLEMENT, + data: data.preSignTx, + value: 0n, + }, + ].filter((e) => e !== null) + } + return null + }) + ).then((results) => results.filter((data) => data !== null).flat()) + + if (fallbackTxData.length > 0) { + try { + const fallbackInfoMessage = getTransactionInfoMessage( + fallbackTxData, + true + ) + setInfoMessage((prev) => fallbackInfoMessage || prev) + + await sendCallsWithRetry( + sendCallsAsync, + chainId, + fallbackTxData, + address + ) + } catch (error) { + console.error('sendCallsAsync', error) + notifyError('Transaction failed', 'Please try again') + } + } + + const cowswapOrders = [...validOrderData, ...fallbackOrderData].filter( + ({ type }) => type === QuoteProvider.CowSwap + ) + + const cowswapInfoMessage = getCowswapOrdersInfoMessage(cowswapOrders) + setInfoMessage((prev) => cowswapInfoMessage || prev) + + const orderIds = ( + await Promise.all( + cowswapOrders.map(async ({ data }) => { + const order = data.quote as OrderCreation + try { + const orderId = await orderBookApi.sendOrder({ + ...order, + from: address, + signature: address, + signingScheme: SigningScheme.PRESIGN, + appData: appDataContent, + }) + return orderId + } catch (error) { + console.error('orderBookApi.sendOrder', error) + notifyError( + 'Cowswap order failed', + `Failed to submit Cowswap order` + ) + return undefined + } + }) + ) + ).filter((orderId) => orderId !== undefined) + + if (refresh) { + // replace failed orders with new ones + setCowswapOrderIds((prev) => [ + ...prev.filter( + (orderId) => !failedOrders.map((o) => o.orderId).includes(orderId) + ), + ...orderIds, + ]) + setCowswapOrders((prev) => [ + ...prev.filter( + (o) => !failedOrders.map((fo) => fo.orderId).includes(o.orderId) + ), + ]) + } else { + setCowswapOrderIds(orderIds) + } + setCowswapOrdersCreatedAt(new Date().toISOString()) + setQuotes({}) + setInfoMessage(undefined) + + return { + orders: orderIds, + } + }, + onError(error) { + console.error(error) + }, + retry: false, + retryDelay: 0, + gcTime: 5 * 60 * 1000, + }) +} + +// Custom hook to stabilize dependencies +export const useStableQuoteSignatures = (refresh = false) => { + const { mutate, isPending } = useQuoteSignatures(refresh) + + // Use useRef to maintain a stable reference to mutate + const mutateRef = useRef(mutate) + mutateRef.current = mutate + + const stableMutate = useCallback(() => { + mutateRef.current() + }, []) + + return { + mutate: stableMutate, + isPending, + } +} diff --git a/src/views/index-dtf/issuance/async-swaps/hooks/utils.ts b/src/views/index-dtf/issuance/async-swaps/hooks/utils.ts new file mode 100644 index 000000000..eed146d0a --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/hooks/utils.ts @@ -0,0 +1,240 @@ +import { wagmiConfig } from '@/state/chain' +import { AvailableChain } from '@/utils/chains' +import { RESERVE_API } from '@/utils/constants' +import { Address, encodeFunctionData, erc20Abi, Hex } from 'viem' +import { getPublicClient } from 'wagmi/actions' +import { getUniversalTokenName } from '../providers/universal' +import { COWSWAP_SETTLEMENT } from './useQuoteSignatures' +import { notifyError } from '@/hooks/useNotification' + +export function convertTypeDataToBigInt(obj: any, isInDomain = false): any { + if (Array.isArray(obj)) { + return obj.map((item) => convertTypeDataToBigInt(item, isInDomain)) + } + + if (obj && typeof obj === 'object') { + // If we're inside the domain object, don't convert numbers + if (isInDomain) { + return obj + } + + // Convert BigNumber + if (obj._isBigNumber && typeof obj._hex === 'string') { + return BigInt(obj._hex) + } + + const result: Record = {} + for (const key in obj) { + // If the key is 'domain', pass true to indicate we're inside the domain + result[key] = convertTypeDataToBigInt(obj[key], key === 'domain') + } + return result + } + + // Convert numbers to BigInt if we're not in domain + if (!isInDomain && typeof obj === 'number') { + return BigInt(obj) + } + + return obj +} + +export async function getApprovalCallIfNeeded({ + chainId, + address, + token, + requiredAmount, + approvalAmount = requiredAmount, + spender, +}: { + chainId: AvailableChain + address: Address + token: Address + requiredAmount: bigint + approvalAmount?: bigint + spender: Address +}): Promise<{ to: Address; data: Hex; value: bigint } | null> { + const publicClient = getPublicClient(wagmiConfig, { chainId }) + const allowance = await publicClient.readContract({ + address: token, + abi: erc20Abi, + functionName: 'allowance', + args: [address, spender], + }) + if (allowance < requiredAmount) { + return { + to: token, + data: encodeFunctionData({ + abi: erc20Abi, + functionName: 'approve', + args: [spender, approvalAmount], + }), + value: 0n, + } + } + return null +} + +type TokenPrice = { + address: Address + price: number + timestamp: number + source: string +} + +export async function getAssetPrice( + chainId: number, + token: Address +): Promise { + const response = await fetch( + `${RESERVE_API}current/prices?tokens=${token}&chainId=${chainId}` + ) + const data = (await response.json()) as TokenPrice[] + return data[0] +} + +// Function to handle sendCallsAsync with retry logic for user rejections +export const sendCallsWithRetry = async ( + sendCallsAsync: any, + chainId: number, + calls: any[], + account: Address, + maxRetries: number = 2 +) => { + let lastError: Error | null = null + + for (let attempt = 0; attempt <= maxRetries; attempt++) { + try { + const txBundle = await sendCallsAsync({ + chainId, + calls, + account, + forceAtomic: true, + }) + console.log({ txBundle }) + return txBundle + } catch (error) { + lastError = error as Error + + // Check if it's a user rejection error + if ( + error instanceof Error && + error.message.includes('User rejected transaction') + ) { + notifyError( + 'Transaction rejected', + `User rejected transaction (attempt ${attempt + 1}/${maxRetries + 1})` + ) + + // If this was the last attempt, throw the error + if (attempt === maxRetries) { + throw new Error('USER_CANCELLED_TX') + } + + // Otherwise, continue to next attempt + continue + } + + // For other errors, throw immediately + throw error + } + } + + // This should never be reached, but just in case + throw lastError || new Error('Unknown error in sendCallsWithRetry') +} + +// Function to handle signTypedDataAsync with retry logic for user rejections +export const signTypedDataWithRetry = async ( + signTypedDataAsync: any, + typedData: any, + maxRetries: number = 2 +) => { + let lastError: Error | null = null + + for (let attempt = 0; attempt <= maxRetries; attempt++) { + try { + const signature = await signTypedDataAsync(typedData) + return signature + } catch (error) { + lastError = error as Error + + // Check if it's a user rejection error + if ( + error instanceof Error && + error.message.includes('User rejected signature') + ) { + notifyError( + 'Signature rejected', + `User rejected signature (attempt ${attempt + 1}/${maxRetries + 1})` + ) + + // If this was the last attempt, throw the error + if (attempt === maxRetries) { + throw new Error('USER_CANCELLED_SIGNATURE') + } + + // Otherwise, continue to next attempt + continue + } + + // For other errors, throw immediately + throw error + } + } + + // This should never be reached, but just in case + throw lastError || new Error('Unknown error in signTypedDataWithRetry') +} + +// Helper functions for info messages +export const getTransactionInfoMessage = ( + txData: any[], + isFallback = false +): string | undefined => { + const approvals = txData.filter( + (tx) => tx.to !== COWSWAP_SETTLEMENT && tx.data?.includes('0xa9059cbb') // approve function signature + ).length + const cowswapSwaps = txData.filter( + (tx) => tx.to === COWSWAP_SETTLEMENT + ).length + + if (approvals === 0 && cowswapSwaps === 0) { + return undefined + } + + let message = '' + + if (approvals > 0) { + message += `Signing ${approvals} approval${approvals !== 1 ? 's' : ''}` + } + + if (cowswapSwaps > 0) { + message += approvals > 0 ? ' and ' : 'Signing ' + const fallbackText = isFallback + ? ` (fallback${cowswapSwaps !== 1 ? 's' : ''})` + : '' + message += `${cowswapSwaps} swap${cowswapSwaps !== 1 ? 's' : ''} via Cowswap${fallbackText}` + } + + message += `...` + + return message +} + +export const getCowswapOrdersInfoMessage = ( + cowswapOrders: any[] +): string | undefined => { + if (cowswapOrders.length > 0) { + return `Sending ${cowswapOrders.length} swap${cowswapOrders.length !== 1 ? 's' : ''} via Cowswap...` + } + return undefined +} + +export const getUniversalTokenInfoMessage = ( + tokenName: string, + action: 'signing' | 'submitting' +): string => { + const actionText = action === 'signing' ? 'Signing swap' : 'Submitting order' + return `${actionText} via Universal for u${tokenName}...` +} diff --git a/src/views/index-dtf/issuance/async-swaps/index.tsx b/src/views/index-dtf/issuance/async-swaps/index.tsx new file mode 100644 index 000000000..34fe81cc8 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/index.tsx @@ -0,0 +1,210 @@ +import { Button } from '@/components/ui/button' +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' +import useAtomicBatch from '@/hooks/use-atomic-batch' +import { cn } from '@/lib/utils' +import { indexDTFAtom } from '@/state/dtf/atoms' +import { useAtom, useAtomValue } from 'jotai' +import { ArrowLeft, Settings } from 'lucide-react' +import { useEffect } from 'react' +import useTrackIndexDTFPage from '../../hooks/useTrackIndexDTFPage' +import RefreshQuote from '../../overview/components/zap-mint/refresh-quote' +import Updater from '../manual/updater' +import AsyncMint from './async-mint' +import AsyncRedeem from './async-redeem' +import { + fetchingQuotesAtom, + operationAtom, + ordersSubmittedAtom, + redeemAssetsAtom, + refetchQuotesAtom, + showSettingsAtom, + successAtom, + userInputAtom, +} from './atom' +import AtomicBatchRequired from './atomic-batch-required' +import Collaterals, { showCollateralsAtom } from './collaterals' +import { GlobalProtocolKitProvider } from './providers/GlobalProtocolKitProvider' +import Config from './settings' +import Success from './success' +import { Skeleton } from '@/components/ui/skeleton' + +function Content() { + const showSettings = useAtomValue(showSettingsAtom) + const showCollaterals = useAtomValue(showCollateralsAtom) + + return ( +
+
+
+ + + + + + +
+
+
+ +
+
+ ) +} + +const Header = () => { + const [showSettings, setShowSettings] = useAtom(showSettingsAtom) + const refetchQuote = useAtomValue(refetchQuotesAtom) + const fetchingQuotes = useAtomValue(fetchingQuotesAtom) + const input = useAtomValue(userInputAtom) + const invalidInput = isNaN(Number(input)) || Number(input) === 0 + const ordersSubmitted = useAtomValue(ordersSubmittedAtom) + const redeemAssets = useAtomValue(redeemAssetsAtom) + const disableActions = + !!ordersSubmitted || Object.keys(redeemAssets).length > 0 + + return ( +
+ {showSettings ? ( +
+ +
+ ) : ( + <> +
+ + + Auto Mint + + + Auto Redeem + + +
+
+ + +
+ + )} +
+ ) +} + +const AsyncSwaps = () => { + useTrackIndexDTFPage('mint-async-swap') + const [currentTab, setCurrentTab] = useAtom(operationAtom) + const [showSettings, setShowSettings] = useAtom(showSettingsAtom) + const indexDTF = useAtomValue(indexDTFAtom) + const success = useAtomValue(successAtom) + const { atomicSupported, isLoading } = useAtomicBatch() + + const reset = () => { + setShowSettings(false) + } + + const changeTab = (tab: string) => { + setCurrentTab(tab as 'mint' | 'redeem') + } + + useEffect(() => { + return () => { + reset() + } + }, []) + + if (!indexDTF) return null + + if (isLoading || !atomicSupported) { + return ( +
+ {isLoading ? ( + + ) : ( + + )} +
+ ) + } + + if (success) { + return ( +
+
+
+ +
+
+
+ ) + } + + return ( +
+
+ +
+ +
+ + {showSettings && ( +
+ +
+ )} + + + +
+
+
+ ) +} + +const AsyncSwapsWithProvider = () => { + return ( + + + + ) +} + +export default AsyncSwapsWithProvider diff --git a/src/views/index-dtf/issuance/async-swaps/mint-button.tsx b/src/views/index-dtf/issuance/async-swaps/mint-button.tsx new file mode 100644 index 000000000..5c11c8c11 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/mint-button.tsx @@ -0,0 +1,183 @@ +import dtfIndexAbi from '@/abis/dtf-index-abi' +import dtfIndexAbiV2 from '@/abis/dtf-index-abi-v2' +import TokenLogo from '@/components/token-logo' +import { Button } from '@/components/ui/button' +import { useERC20Balances } from '@/hooks/useERC20Balance' +import { chainIdAtom, walletAtom } from '@/state/atoms' +import { indexDTFAtom, indexDTFVersionAtom } from '@/state/dtf/atoms' +import { useAtom, useAtomValue, useSetAtom } from 'jotai' +import { Loader } from 'lucide-react' +import { useEffect, useMemo } from 'react' +import { encodeFunctionData, erc20Abi, maxUint256, parseEther } from 'viem' +import { useSendCalls, useWaitForCallsStatus } from 'wagmi' +import { isMintingAtom, txHashAtom, mintValueAtom, successAtom } from './atom' +import { useFolioDetails } from './hooks/useFolioDetails' +import { useGetMintTx } from './hooks/useGetMintTx' + +const MintButton = () => { + const account = useAtomValue(walletAtom) + const indexDTF = useAtomValue(indexDTFAtom) + const mintAmount = useAtomValue(mintValueAtom) + const folioAmount = parseEther(mintAmount.toString()) + const chainId = useAtomValue(chainIdAtom) + const indexDTFVersion = useAtomValue(indexDTFVersionAtom) + const setMintTxHash = useSetAtom(txHashAtom) + const setSuccess = useSetAtom(successAtom) + + const [isMinting, setIsMinting] = useAtom(isMintingAtom) + const { data: folioDetails } = useFolioDetails({ shares: folioAmount }) + const { data, sendCalls, isPending, isError } = useSendCalls() + + const { data: callsStatus } = useWaitForCallsStatus({ + id: data?.id || '', + }) + + // New hook to detect mint events from Transfer logs + const { mintTxHash: eventMintTxHash } = useGetMintTx() + + const { data: balanceData, isFetching: isFetchingBalanceData } = + useERC20Balances( + folioDetails?.assets.map((address) => ({ + address, + chainId, + })) || [] + ) + + const maxMintableAmount = useMemo(() => { + if (!folioDetails?.mintValues || !balanceData || !balanceData.length) { + return 0n + } + + // For each token, calculate how many folio tokens we can mint based on available balance + const mintableAmounts = folioDetails.mintValues.map((mintValue, index) => { + if (mintValue === 0n) { + return 0n + } + const balance = balanceData[index] as bigint + return (balance * folioAmount) / mintValue + }) + + // Return the minimum amount (as we need all tokens to mint) + return mintableAmounts.reduce((min, amount) => { + if (amount === 0n) { + return min + } + + return amount < min ? amount : min + }, mintableAmounts[0] || 0n) + }, [folioDetails?.mintValues, balanceData, folioAmount]) + + const handleMaxMint = () => { + if (!account || !folioDetails || !indexDTF) { + return + } + + setIsMinting(true) + + sendCalls({ + calls: [ + ...folioDetails.assets.map((e) => ({ + to: e, + value: 0n, + data: encodeFunctionData({ + abi: erc20Abi, + functionName: 'approve', + args: [indexDTF.id, maxUint256], + }), + })), + { + to: indexDTF.id, + data: + indexDTFVersion === '2.0.0' + ? encodeFunctionData({ + abi: dtfIndexAbiV2, + functionName: 'mint', + args: [ + maxMintableAmount, + account, + (maxMintableAmount * 99n) / 100n, + ], + }) + : encodeFunctionData({ + abi: dtfIndexAbi, + functionName: 'mint', + args: [maxMintableAmount, account], + }), + value: 0n, + }, + ], + forceAtomic: true, + }) + } + + useEffect(() => { + const isSuccess = callsStatus?.status === 'success' + const isFailure = callsStatus?.status === 'failure' + + if (isSuccess) { + const receipts = callsStatus?.receipts ?? [] + let mintTxHash = receipts.slice(-1)[0]?.transactionHash || 'tx' + setMintTxHash(mintTxHash) + setSuccess(true) + setIsMinting(false) + } + + if (isFailure) { + setIsMinting(false) + } + }, [callsStatus?.receipts, callsStatus?.status]) + + // New effect to handle mint detection from Transfer events + useEffect(() => { + if (eventMintTxHash && isMinting) { + setMintTxHash(eventMintTxHash) + setSuccess(true) + setIsMinting(false) + } + }, [eventMintTxHash, isMinting, setMintTxHash, setSuccess, setIsMinting]) + + useEffect(() => { + if (isError) { + setIsMinting(false) + } + }, [isError]) + + if (!indexDTF) return null + + if (isMinting) { + return ( +
+
+
+ +
Confirm Mint
+
+
+ +
+
+
+ ) + } + + return ( + + ) +} + +export default MintButton diff --git a/src/views/index-dtf/issuance/async-swaps/providers/GlobalProtocolKitProvider.tsx b/src/views/index-dtf/issuance/async-swaps/providers/GlobalProtocolKitProvider.tsx new file mode 100644 index 000000000..230a36cf0 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/providers/GlobalProtocolKitProvider.tsx @@ -0,0 +1,89 @@ +import { chainIdAtom } from '@/state/atoms' +import { OrderBookApi } from '@cowprotocol/cow-sdk' +import { useAtomValue } from 'jotai' +import { + createContext, + ReactNode, + useContext, + useEffect, + useState, +} from 'react' +import { createUniversalSdkWrapper } from './universal' +import { ChainId } from '@/utils/chains' + +export type UniversalRelayerWithRateLimiter = ReturnType< + typeof createUniversalSdkWrapper +> + +type GlobalProtocolKitContextType = { + orderBookApi: OrderBookApi | null + universalSdk: UniversalRelayerWithRateLimiter | null +} + +const GlobalProtocolKitContext = createContext({ + orderBookApi: null, + universalSdk: null, +}) + +export const useGlobalProtocolKit = () => useContext(GlobalProtocolKitContext) + +interface GlobalProtocolKitProviderProps { + children: ReactNode +} + +export function GlobalProtocolKitProvider({ + children, +}: GlobalProtocolKitProviderProps) { + const chainId = useAtomValue(chainIdAtom) + + const [orderBookApi, setOrderBookApi] = useState(null) + const [universalSdk, setUniversalSdk] = useState | null>(null) + + useEffect(() => { + if (chainId) { + setUniversalSdk(createUniversalSdkWrapper()) + setOrderBookApi( + new OrderBookApi({ + chainId, + limiterOpts: { + tokensPerInterval: 4, + interval: 'second', + }, + backoffOpts: { + numOfAttempts: 3, + maxDelay: Infinity, + jitter: 'full', + }, + }) + ) + } else { + setOrderBookApi( + new OrderBookApi({ + chainId: ChainId.Base, + limiterOpts: { + tokensPerInterval: 4, + interval: 'second', + }, + backoffOpts: { + numOfAttempts: 3, + maxDelay: Infinity, + jitter: 'full', + }, + }) + ) + } + }, [chainId]) + + return ( + + {children} + + ) +} diff --git a/src/views/index-dtf/issuance/async-swaps/providers/universal-api.ts b/src/views/index-dtf/issuance/async-swaps/providers/universal-api.ts new file mode 100644 index 000000000..20fe7a27b --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/providers/universal-api.ts @@ -0,0 +1,93 @@ +import { RESERVE_API } from '@/utils/constants' +import type { + OrderRequest, + OrderResponse, + OrdersParams, + OrdersResponse, + Quote, + QuoteRequest, +} from 'universal-sdk' + +const getQuote = async (quote: QuoteRequest): Promise => { + const queryParams = new URLSearchParams({ + type: quote.type, + token: quote.token, + pair_token: quote.pair_token, + blockchain: quote.blockchain, + user_address: quote.user_address, + ...(quote.token_amount && { token_amount: quote.token_amount }), + ...(quote.pair_token_amount && { + pair_token_amount: quote.pair_token_amount, + }), + ...(quote.slippage_bips !== undefined && { + slippage_bips: quote.slippage_bips.toString(), + }), + }) + + const response = await fetch(`${RESERVE_API}universal/quote?${queryParams}`, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (!response.ok) { + const error = await response.json() + throw new Error(error.error || 'Failed to get quote') + } + + return response.json() +} + +const submitOrder = async (order: OrderRequest): Promise => { + const response = await fetch(`${RESERVE_API}universal/order`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(order), + }) + + if (!response.ok) { + const error = await response.json() + throw new Error(error.error || 'Failed to submit order') + } + + return response.json() +} + +const getOrders = async (params?: OrdersParams): Promise => { + const queryParams = new URLSearchParams() + + if (params) { + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined && value !== null) { + queryParams.append(key, value.toString()) + } + }) + } + + const url = queryParams.toString() + ? `${RESERVE_API}universal/orders?${queryParams}` + : `${RESERVE_API}universal/orders` + + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (!response.ok) { + const error = await response.json() + throw new Error(error.error || 'Failed to get orders') + } + + return response.json() +} + +export const universal = { + getQuote, + submitOrder, + getOrders, +} diff --git a/src/views/index-dtf/issuance/async-swaps/providers/universal.ts b/src/views/index-dtf/issuance/async-swaps/providers/universal.ts new file mode 100644 index 000000000..c123e2fd6 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/providers/universal.ts @@ -0,0 +1,69 @@ +import { RateLimiter } from 'limiter' +import { + OrderRequest, + OrdersParams, + Quote, + QuoteRequest, + TokenName, +} from 'universal-sdk' +import { BlockchainConfigs, TokenAddresses } from 'universal-sdk/dist/config' +import { Address } from 'viem' +import { universal } from './universal-api' + +export type CustomUniversalQuote = { + userAddress: Address + buyToken: Address + sellToken: Address + type: 'BUY' | 'SELL' + sellAmount: bigint + buyAmount: bigint + validTo: number + _originalQuote: Quote +} + +const universalTokenMap: Record = Object.entries( + TokenAddresses +).reduce( + (acc, [tokenName, address]) => ({ + ...acc, + [address.toLowerCase()]: tokenName as TokenName, + }), + {} as Record +) + +export const getUniversalTokenName = (token: Address) => { + return universalTokenMap[token.toLowerCase() as Address] as TokenName +} + +export const getUniversalTokenAddress = (token: TokenName) => { + // @ts-expect-error - USDC is not in the universalTokenMap but we need it for the universal SDK + if (token === 'USDC') { + return BlockchainConfigs.BASE.usdcAddress + } + + return Object.keys(universalTokenMap).find( + (key) => universalTokenMap[key as Address] === token + ) as Address +} + +export const createUniversalSdkWrapper = () => { + const limiter = new RateLimiter({ + tokensPerInterval: 1, + interval: 750, + }) + + return { + getQuote: async (quote: QuoteRequest) => { + await limiter.removeTokens(1) + return await universal.getQuote(quote) + }, + getOrders: async (orders: OrdersParams) => { + await limiter.removeTokens(1) + return await universal.getOrders(orders) + }, + submitOrder: async (order: OrderRequest) => { + await limiter.removeTokens(1) + return await universal.submitOrder(order) + }, + } +} diff --git a/src/views/index-dtf/issuance/async-swaps/settings.tsx b/src/views/index-dtf/issuance/async-swaps/settings.tsx new file mode 100644 index 000000000..5cd5726f9 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/settings.tsx @@ -0,0 +1,59 @@ +import { Checkbox } from '@/components/ui/checkbox' +import Help from '@/components/ui/help' +import { SlippageSelector } from '@/components/ui/swap' +import { useAtom } from 'jotai' +import { Wallet } from 'lucide-react' +import { slippageAtom, applyWalletBalanceAtom } from './atom' + +const SettingsRowTitle = ({ title, help }: { title: string; help: string }) => ( +
+
{title}
+ +
+) + +const Settings = () => { + const [slippage, setSlippage] = useAtom(slippageAtom) + const [applyWalletBalance, setApplyWalletBalance] = useAtom( + applyWalletBalanceAtom + ) + + return ( +
+
+ +
+
+ +
Use wallet balance
+
+ + setApplyWalletBalance( + checked === 'indeterminate' ? true : checked + ) + } + /> +
+
+
+ + +
+
+ ) +} + +export default Settings diff --git a/src/views/index-dtf/issuance/async-swaps/success.tsx b/src/views/index-dtf/issuance/async-swaps/success.tsx new file mode 100644 index 000000000..84ca2e8df --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/success.tsx @@ -0,0 +1,405 @@ +import TokenLogo from '@/components/token-logo' +import StackTokenLogo from '@/components/token-logo/StackTokenLogo' +import { Button } from '@/components/ui/button' +import Copy from '@/components/ui/copy' +import Help from '@/components/ui/help' +import { chainIdAtom } from '@/state/atoms' +import { + indexDTFAtom, + indexDTFBasketAtom, + indexDTFPriceAtom, +} from '@/state/dtf/atoms' +import { + formatCurrency, + formatPercentage, + formatTokenAmount, + shortenAddress, +} from '@/utils' +import { ExplorerDataType, getExplorerLink } from '@/utils/getExplorerLink' +import { atom, useAtomValue, useSetAtom } from 'jotai' +import { + ArrowLeft, + ArrowUpRight, + Check, + ChevronRight, + HandCoins, + X, +} from 'lucide-react' +import { useEffect, useState } from 'react' +import { Link } from 'react-router-dom' +import { + balanceDifferenceAtom, + cowswapOrderIdsAtom, + cowswapOrdersAtom, + cowswapOrdersCreatedAtAtom, + fallbackQuotesAtom, + mintValueAtom, + operationAtom, + quotesAtom, + redeemAssetsAtom, + savedAmountAtom, + successAtom, + txHashAtom, + universalSuccessOrdersAtom, + userInputAtom, +} from './atom' +import CowSwapOrder from './cowswap-order' +import Details from './details' +import UniversalOrder from './universal-order' + +const viewTransactionsAtom = atom(false) + +const CloseButton = () => { + const setTxHashAtom = useSetAtom(txHashAtom) + const setSuccess = useSetAtom(successAtom) + const setUserInputAtom = useSetAtom(userInputAtom) + const setRedeemAssets = useSetAtom(redeemAssetsAtom) + const setCowswapOrderIdsAtom = useSetAtom(cowswapOrderIdsAtom) + const setCowswapOrdersCreatedAtAtom = useSetAtom(cowswapOrdersCreatedAtAtom) + const setCowswapOrdersAtom = useSetAtom(cowswapOrdersAtom) + const setQuotesAtom = useSetAtom(quotesAtom) + const setUniversalSuccessOrdersAtom = useSetAtom(universalSuccessOrdersAtom) + const setFallbackQuotesAtom = useSetAtom(fallbackQuotesAtom) + + const handleClose = () => { + setTxHashAtom(undefined) + setSuccess(false) + setUserInputAtom('') + setRedeemAssets({}) + setQuotesAtom({}) + setCowswapOrderIdsAtom([]) + setCowswapOrdersCreatedAtAtom(undefined) + setCowswapOrdersAtom([]) + setUniversalSuccessOrdersAtom([]) + setFallbackQuotesAtom({}) + } + + return ( + + ) +} + +const SuccessHeader = () => { + const chainId = useAtomValue(chainIdAtom) + const indexDTF = useAtomValue(indexDTFAtom) + const basket = useAtomValue(indexDTFBasketAtom) + const setViewTransactions = useSetAtom(viewTransactionsAtom) + + return ( +
+ + + +
+ + +
+
+ ) +} + +const DTFAmount = () => { + const chainId = useAtomValue(chainIdAtom) + const indexDTF = useAtomValue(indexDTFAtom) + const indexDTFPrice = useAtomValue(indexDTFPriceAtom) + const balanceDifference = useAtomValue(balanceDifferenceAtom) + const operation = useAtomValue(operationAtom) + const sharesRedeemed = useAtomValue(userInputAtom) + const mintValue = useAtomValue(mintValueAtom) + const valueMinted = (indexDTFPrice || 0) * mintValue + const valueRedeemed = (indexDTFPrice || 0) * Number(sharesRedeemed) + + const priceImpact = balanceDifference + ? (valueMinted * 100) / balanceDifference - 100 + : 0 + + return ( +
+
+ {operation === 'mint' ? 'You Minted:' : 'You Redeemed:'} +
+
+
+
+ {operation === 'mint' + ? formatTokenAmount(mintValue) + : formatTokenAmount(Number(sharesRedeemed))} +
+
{indexDTF?.token.symbol || ''}
+
+ +
+
+ ${formatCurrency(operation === 'mint' ? valueMinted : valueRedeemed)}{' '} + {operation === 'mint' && ( + + ({formatPercentage(priceImpact)}) + + )} +
+
+ ) +} + +const USDCAmount = () => { + const inputAmount = useAtomValue(userInputAtom) + const operation = useAtomValue(operationAtom) + const balanceDifference = useAtomValue(balanceDifferenceAtom) + const indexDTFPrice = useAtomValue(indexDTFPriceAtom) + const valueRedeemed = (indexDTFPrice || 0) * Number(inputAmount) + const priceImpact = valueRedeemed + ? (balanceDifference * 100) / valueRedeemed - 100 + : 0 + + return ( +
+
+ {operation === 'mint' ? 'You Used:' : 'You Received:'} +
+
+
+
+ {formatCurrency(balanceDifference)} +
+
USDC
+
+ {operation === 'mint' && ( +
+ + {formatCurrency(Number(inputAmount))} USDC + + +
+ )} +
+
+ ${formatCurrency(balanceDifference)} + {operation === 'mint' && ( + + ${formatCurrency(Number(inputAmount))} + + )} + {operation === 'redeem' && ( + + ({priceImpact > 0 ? '+' : ''} + {formatPercentage(priceImpact)}) + + )} +
+ {operation === 'mint' && ( +
+ +
+
+ )} +
+ ) +} + +const BufferInfo = () => { + const savedAmount = useAtomValue(savedAmountAtom) + + return ( +
+
+ +
You Saved:
+ {' '} +
+
+ $ + {formatCurrency(savedAmount)} +
+
+ ) +} + +const MainTransaction = () => { + const indexDTF = useAtomValue(indexDTFAtom) + const txHash = useAtomValue(txHashAtom) + const operation = useAtomValue(operationAtom) + + return ( +
+
+ +
+ + {operation === 'mint' + ? `${indexDTF?.token.symbol} Minted` + : `${indexDTF?.token.symbol} Redeemed`} + +
+ {shortenAddress(indexDTF?.id || '')} +
+
+
+
+
+ +
+ + + +
+
+ ) +} + +const Transactions = () => { + const setViewTransactions = useSetAtom(viewTransactionsAtom) + const cowswapOrders = useAtomValue(cowswapOrdersAtom) + const universalSuccessOrders = useAtomValue(universalSuccessOrdersAtom) + + return ( +
+
+ +
+ All Transactions +
+ +
+
+ +
+ {cowswapOrders.map(({ orderId }, index) => ( + + ))} + {universalSuccessOrders.map((order, index) => ( + + ))} +
+
+
+ ) +} + +const Success = () => { + const viewTransactions = useAtomValue(viewTransactionsAtom) + const [showConfetti, setShowConfetti] = useState(true) + + useEffect(() => { + const timer = setTimeout(() => { + setShowConfetti(false) + }, 2000) + + return () => clearTimeout(timer) + }, []) + + if (viewTransactions) { + return + } + + return ( +
+ {showConfetti && ( +
+ )} +
+
+ +
+
+ + +
+
+
+ ) +} + +export default Success diff --git a/src/views/index-dtf/issuance/async-swaps/types.ts b/src/views/index-dtf/issuance/async-swaps/types.ts new file mode 100644 index 000000000..ef29b296a --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/types.ts @@ -0,0 +1,40 @@ +import { Token } from '@/types' +import { EnrichedOrder, OrderQuoteResponse } from '@cowprotocol/cow-sdk' +import { Quote } from 'universal-sdk' +import { CustomUniversalQuote } from './providers/universal' + +export enum QuoteProvider { + CowSwap = 'CowSwap', + Universal = 'Universal', +} + +export type CowswapQuote = { + token: Token + success: true + type: QuoteProvider.CowSwap + data: OrderQuoteResponse +} + +export type UniversalQuote = { + token: Token + success: true + type: QuoteProvider.Universal + data: CustomUniversalQuote +} + +export type QuoteAggregated = + | { + token: Token + success: false + } + | CowswapQuote + | UniversalQuote + +export type UniversalOrder = Quote & { + orderId: string + transactionHash: string +} + +export type AsyncSwapOrderResponse = { + cowswapOrders: (EnrichedOrder & { orderId: string })[] +} diff --git a/src/views/index-dtf/issuance/async-swaps/universal-order.tsx b/src/views/index-dtf/issuance/async-swaps/universal-order.tsx new file mode 100644 index 000000000..0078d2c13 --- /dev/null +++ b/src/views/index-dtf/issuance/async-swaps/universal-order.tsx @@ -0,0 +1,96 @@ +import TokenLogo from '@/components/token-logo' +import { Skeleton } from '@/components/ui/skeleton' +import { chainIdAtom } from '@/state/atoms' +import { indexDTFBasketAtom } from '@/state/dtf/atoms' +import { formatCurrency, formatTokenAmount } from '@/utils' +import { ExplorerDataType, getExplorerLink } from '@/utils/getExplorerLink' +import { useAtomValue } from 'jotai' +import { ArrowUpRight, Check } from 'lucide-react' +import { useMemo } from 'react' +import { Link } from 'react-router-dom' +import { formatUnits } from 'viem' +import { operationAtom } from './atom' +import { UniversalOrder as UniversalOrderType } from './types' +import { getUniversalTokenAddress } from './providers/universal' + +const UniversalOrder = ({ order }: { order: UniversalOrderType }) => { + const operation = useAtomValue(operationAtom) + const indexDTFBasket = useAtomValue(indexDTFBasketAtom) + const chainId = useAtomValue(chainIdAtom) + const { token, firstAmount, secondAmount } = useMemo(() => { + const token = getUniversalTokenAddress(order?.token) + return operation === 'redeem' + ? { + token, + firstAmount: order?.token_amount, + secondAmount: order?.pair_token_amount, + } + : { + token, + firstAmount: order?.token_amount, + secondAmount: order?.pair_token_amount, + } + }, [order, operation]) + + return ( +
+
+ t.address === token)?.symbol || '' + } + size="xl" + /> +
+ {secondAmount ? ( +
+ {operation === 'mint' ? '-' : '+'}{' '} + {formatCurrency(Number(formatUnits(BigInt(secondAmount), 6)))}{' '} + USDC +
+ ) : ( + + )} + {firstAmount ? ( +
+ {operation === 'mint' ? '+' : '-'}{' '} + {formatTokenAmount( + Number( + formatUnits( + BigInt(firstAmount), + indexDTFBasket?.find((t) => t.address === token) + ?.decimals || 18 + ) + ) + )}{' '} + {indexDTFBasket?.find((t) => t.address === token)?.symbol || ''} +
+ ) : ( + + )} +
+
+
+ + Order Filled + + + +
+
+ ) +} + +export default UniversalOrder diff --git a/src/views/index-dtf/issuance/manual/index.tsx b/src/views/index-dtf/issuance/manual/index.tsx index 1ec4b330f..61dc79b61 100644 --- a/src/views/index-dtf/issuance/manual/index.tsx +++ b/src/views/index-dtf/issuance/manual/index.tsx @@ -1,8 +1,22 @@ +import { useSetAtom } from 'jotai' import AssetList from './components/asset-list' import IndexManualIssuance from './components/index-manual-issuance' import Updater from './updater' +import { amountAtom } from './atoms' +import { useEffect } from 'react' +import { useSearchParams } from 'react-router-dom' const IndexDTFManualIssuance = () => { + const setAmount = useSetAtom(amountAtom) + const [searchParams] = useSearchParams() + const amountIn = searchParams.get('amountIn') + + useEffect(() => { + if (amountIn) { + setAmount(amountIn) + } + }, []) + return ( <>
diff --git a/src/views/index-dtf/issuance/manual/updater.tsx b/src/views/index-dtf/issuance/manual/updater.tsx index 8ec0515b1..80ad6a995 100644 --- a/src/views/index-dtf/issuance/manual/updater.tsx +++ b/src/views/index-dtf/issuance/manual/updater.tsx @@ -11,6 +11,8 @@ import { assetDistributionAtom, balanceMapAtom, } from './atoms' +import useERC20Balance from '@/hooks/useERC20Balance' +import { indexDTFBalanceAtom } from '../async-swaps/atom' const balanceCallsAtom = atom((get) => { const wallet = get(walletAtom) @@ -57,6 +59,9 @@ const Updater = () => { const setAssetDistribution = useSetAtom(assetDistributionAtom) const setAllowances = useSetAtom(allowanceMapAtom) const chainId = useAtomValue(chainIdAtom) + const setIndexDTFBalance = useSetAtom(indexDTFBalanceAtom) + + const { data: balance } = useERC20Balance(indexDTF?.id) const { data } = useWatchReadContracts({ contracts: calls, @@ -110,6 +115,10 @@ const Updater = () => { }, }) + useEffect(() => { + setIndexDTFBalance(balance || 0n) + }, [balance, setIndexDTFBalance]) + useEffect(() => { if (data) { setBalance(data) diff --git a/tailwind.config.ts b/tailwind.config.ts index 49e7dd437..d1bce770a 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -131,6 +131,10 @@ const config = { transform: 'rotate(360deg)', }, }, + shimmer: { + '0%': { backgroundPosition: '200% 0' }, + '100%': { backgroundPosition: '-200% 0' }, + }, }, animation: { 'accordion-down': 'accordion-down 0.2s ease-out', @@ -140,6 +144,7 @@ const config = { 'width-expand': 'width-expand 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards', 'spin-slow': 'spin-slow 4s linear infinite', + shimmer: 'shimmer 2s linear infinite', }, }, }, diff --git a/vite.config.ts b/vite.config.ts index 6ef9e9a3c..ef4ab88bf 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -71,55 +71,55 @@ export default defineConfig({ manualChunks: (id) => { // Skip non-node_modules if (!id.includes('node_modules')) { - return undefined; + return undefined } // Core React dependencies if (id.includes('react-dom')) { - return 'react-dom'; + return 'react-dom' } if (id.includes('react') && !id.includes('react-')) { - return 'react'; + return 'react' } // Large libraries that should be separate if (id.includes('@rainbow-me/rainbowkit')) { - return 'rainbowkit'; + return 'rainbowkit' } if (id.includes('wagmi') || id.includes('@wagmi')) { - return 'wagmi'; + return 'wagmi' } if (id.includes('viem')) { - return 'viem'; + return 'viem' } if (id.includes('@walletconnect')) { - return 'walletconnect'; + return 'walletconnect' } if (id.includes('@coinbase/wallet-sdk')) { - return 'coinbase'; + return 'coinbase' } // UI libraries if (id.includes('@radix-ui')) { - return 'radix-ui'; + return 'radix-ui' } if (id.includes('recharts')) { - return 'charts'; + return 'charts' } // Other vendor libs if (id.includes('ethers')) { - return 'ethers'; + return 'ethers' } if (id.includes('@tanstack')) { - return 'tanstack'; + return 'tanstack' } if (id.includes('jotai')) { - return 'jotai'; + return 'jotai' } - } - } - } + }, + }, + }, }, resolve: { alias: { @@ -127,6 +127,12 @@ export default defineConfig({ types: path.resolve('src/types/'), utils: path.resolve('src/utils/'), '@': path.resolve(__dirname, './src'), + '@uniswap/uniswapx-sdk': path.resolve( + __dirname, + 'node_modules/@uniswap/uniswapx-sdk/dist/src/index.js' + ), + // Polyfills for node modules - @cowprotocol/cow-sdk needs it + 'node-fetch': 'cross-fetch', }, }, optimizeDeps: { @@ -139,12 +145,13 @@ export default defineConfig({ '@radix-ui/react-dialog', '@radix-ui/react-select', '@radix-ui/react-tabs', + '@uniswap/uniswapx-sdk', ], esbuildOptions: { target: 'es2020', // Help with tree shaking - treeShaking: true - } + treeShaking: true, + }, }, server: { port: 3000,