diff --git a/README.md b/README.md index a955dab..626efc4 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ ## Blockchain Support -| arbitrum | avalanche | base | bnb chain | celo | ethereum | fantom | optimism | polygon | -| :----------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: | -| Arbitrum | Avalanche | Base | BNB Chain | Celo | Ethereum | Fantom | Optimism | Polygon | +| arbitrum | avalanche | base | bnb chain | ethereum | optimism | polygon | +| :----------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: | +| Arbitrum | Avalanche | Base | BNB Chain | Ethereum | Optimism | Polygon | ## Overview -This library is designed for [0x](https://0x.org/docs/introduction/introduction-to-0x) integrators, simplifying the complex task of parsing [0x transactions](https://etherscan.io/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff) into a format that is both user-friendly and easy to understand. When swapping tokens, one of the challenges is that the trade can experience slippage through Automated Market Makers ([AMMs](https://0x.org/post/what-is-an-automated-market-maker-amm)). This makes the final swap amounts difficult to predict prior to executing the trade. However, this library overcomes that challenge by parsing the transaction receipt and event logs to accurately identify the final swap amounts. +This library is designed for [0x](https://0x.org/docs/introduction/introduction-to-0x) integrators, simplifying the complex task of parsing [0x transactions](https://0x.org/docs/next/introduction/introduction-to-0x#the-0x-ecosystem) into a format that is both user-friendly and easy to understand. When swapping tokens, one of the challenges is that the trade can experience slippage through Automated Market Makers ([AMMs](https://0x.org/post/what-is-an-automated-market-maker-amm)). This makes the final swap amounts difficult to predict prior to executing the trade. However, this library overcomes that challenge by parsing the transaction receipt and event logs to accurately identify the final swap amounts. ### Demo @@ -46,26 +46,24 @@ npm install @0x/0x-parser ```typescript import { parseSwap } from "@0x/0x-parser"; +import { createPublicClient } from "viem"; async function main() { - const response = await fetch( - "https://raw.githubusercontent.com/0xProject/protocol/development/packages/contract-artifacts/artifacts/IZeroEx.json" - ); + const RPC_URL = `https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`; - const data = await response.json(); - const exchangeProxyAbi = data.compilerOutput.abi; + // You can pass any transaction hash that you got after submitted a 0x transaction: + // https://etherscan.io/address/0x2fc205711fc933ef6e5bcc0bf6e6a9bfc220b2d8073aea4f41305882f485669d + const transactionHash = + "0x2fc205711fc933ef6e5bcc0bf6e6a9bfc220b2d8073aea4f41305882f485669d"; - // You can pass any transaction hash from 0x Exchange Proxy: - // https://etherscan.io/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff - const transactionHash = "0xd8637124d650268ae7680781809800e103a3a2bee9fec56083028fea6d98140b"; - - const swap = await parseSwap({ - transactionHash, - exchangeProxyAbi, - rpcUrl: "https://eth.llamarpc.com", + const publicClient = createPublicClient({ + chain: mainnet, + transport: http(RPC_URL), }); - console.log(swap); // Logs the swap details in the console. + const swap = await parseSwap({ publicClient, transactionHash }); + + console.log(swap); // Logs the swap details. } main(); diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..cd38cef --- /dev/null +++ b/examples/README.md @@ -0,0 +1,3 @@ +⚠️ WARNING + +These examples need to be migrated from using 0x-parser v1 to v2. PRs welcomed. diff --git a/package-lock.json b/package-lock.json index f7f31f8..04ed562 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,20 +9,20 @@ "version": "1.2.5", "license": "MIT", "devDependencies": { - "@types/node": "^20.14.0", - "@vitest/coverage-v8": "^1.6.0", - "abitype": "^1.0.2", + "@types/node": "^20.14.11", + "@vitest/coverage-v8": "^2.0.3", + "abitype": "^1.0.5", "dotenv": "^16.4.5", - "esbuild": "^0.21.4", + "esbuild": "^0.23.0", "http-server": "^14.1.1", - "typescript": "^5.4.5", - "vitest": "^1.6.0" + "typescript": "^5.5.3", + "vitest": "^2.0.3" }, "engines": { "node": ">=18" }, "peerDependencies": { - "viem": "^2.13.3" + "viem": "^2.17.5" } }, "node_modules/@adraffy/ens-normalize": { @@ -32,13 +32,13 @@ "peer": true }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -95,9 +95,9 @@ "dev": true }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz", - "integrity": "sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", + "integrity": "sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==", "cpu": [ "ppc64" ], @@ -107,13 +107,13 @@ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.4.tgz", - "integrity": "sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", + "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", "cpu": [ "arm" ], @@ -123,13 +123,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.4.tgz", - "integrity": "sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", + "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", "cpu": [ "arm64" ], @@ -139,13 +139,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.4.tgz", - "integrity": "sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", + "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", "cpu": [ "x64" ], @@ -155,13 +155,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz", - "integrity": "sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", + "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", "cpu": [ "arm64" ], @@ -171,13 +171,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.4.tgz", - "integrity": "sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", + "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", "cpu": [ "x64" ], @@ -187,13 +187,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.4.tgz", - "integrity": "sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", + "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", "cpu": [ "arm64" ], @@ -203,13 +203,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz", - "integrity": "sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", + "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", "cpu": [ "x64" ], @@ -219,13 +219,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz", - "integrity": "sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", + "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", "cpu": [ "arm" ], @@ -235,13 +235,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.4.tgz", - "integrity": "sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", + "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", "cpu": [ "arm64" ], @@ -251,13 +251,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz", - "integrity": "sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", + "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", "cpu": [ "ia32" ], @@ -267,13 +267,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.4.tgz", - "integrity": "sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", + "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", "cpu": [ "loong64" ], @@ -283,13 +283,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.4.tgz", - "integrity": "sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", + "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", "cpu": [ "mips64el" ], @@ -299,13 +299,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.4.tgz", - "integrity": "sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", + "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", "cpu": [ "ppc64" ], @@ -315,13 +315,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.4.tgz", - "integrity": "sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", + "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", "cpu": [ "riscv64" ], @@ -331,13 +331,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.4.tgz", - "integrity": "sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", + "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", "cpu": [ "s390x" ], @@ -347,13 +347,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.4.tgz", - "integrity": "sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", + "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", "cpu": [ "x64" ], @@ -363,13 +363,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.4.tgz", - "integrity": "sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", + "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", "cpu": [ "x64" ], @@ -379,13 +379,29 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", + "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.4.tgz", - "integrity": "sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", + "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", "cpu": [ "x64" ], @@ -395,13 +411,13 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.4.tgz", - "integrity": "sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", + "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", "cpu": [ "x64" ], @@ -411,13 +427,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.4.tgz", - "integrity": "sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", + "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", "cpu": [ "arm64" ], @@ -427,13 +443,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.4.tgz", - "integrity": "sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", + "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", "cpu": [ "ia32" ], @@ -443,13 +459,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.4.tgz", - "integrity": "sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", + "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", "cpu": [ "x64" ], @@ -458,6 +474,23 @@ "os": [ "win32" ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, "engines": { "node": ">=12" } @@ -471,54 +504,42 @@ "node": ">=8" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { @@ -532,21 +553,21 @@ } }, "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.0.tgz", + "integrity": "sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==", "peer": true, "dependencies": { - "@noble/hashes": "1.3.2" + "@noble/hashes": "1.4.0" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", "peer": true, "engines": { "node": ">= 16" @@ -555,10 +576,20 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", - "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz", + "integrity": "sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==", "cpu": [ "arm" ], @@ -569,9 +600,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", - "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.1.tgz", + "integrity": "sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==", "cpu": [ "arm64" ], @@ -582,9 +613,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", - "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.1.tgz", + "integrity": "sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==", "cpu": [ "arm64" ], @@ -595,9 +626,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", - "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.1.tgz", + "integrity": "sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==", "cpu": [ "x64" ], @@ -608,9 +639,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", - "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.1.tgz", + "integrity": "sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==", "cpu": [ "arm" ], @@ -621,9 +652,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", - "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.1.tgz", + "integrity": "sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==", "cpu": [ "arm" ], @@ -634,9 +665,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", - "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.1.tgz", + "integrity": "sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==", "cpu": [ "arm64" ], @@ -647,9 +678,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", - "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.1.tgz", + "integrity": "sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==", "cpu": [ "arm64" ], @@ -660,9 +691,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", - "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.1.tgz", + "integrity": "sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==", "cpu": [ "ppc64" ], @@ -673,9 +704,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", - "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.1.tgz", + "integrity": "sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==", "cpu": [ "riscv64" ], @@ -686,9 +717,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", - "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.1.tgz", + "integrity": "sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==", "cpu": [ "s390x" ], @@ -699,9 +730,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", - "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.1.tgz", + "integrity": "sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==", "cpu": [ "x64" ], @@ -712,9 +743,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", - "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.1.tgz", + "integrity": "sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==", "cpu": [ "x64" ], @@ -725,9 +756,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", - "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.1.tgz", + "integrity": "sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==", "cpu": [ "arm64" ], @@ -738,9 +769,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", - "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.1.tgz", + "integrity": "sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==", "cpu": [ "ia32" ], @@ -751,9 +782,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", - "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.1.tgz", + "integrity": "sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==", "cpu": [ "x64" ], @@ -764,47 +795,41 @@ ] }, "node_modules/@scure/base": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz", - "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", + "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==", "peer": true, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip32": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.2.tgz", - "integrity": "sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", "peer": true, "dependencies": { - "@noble/curves": "~1.2.0", - "@noble/hashes": "~1.3.2", - "@scure/base": "~1.1.2" + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip39": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", - "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", "peer": true, "dependencies": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" }, "funding": { "url": "https://paulmillr.com/funding/" } }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -812,115 +837,126 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.14.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.0.tgz", - "integrity": "sha512-5cHBxFGJx6L4s56Bubp4fglrEpmyJypsqI6RgzMfBHWUJQGWAAi8cWcgetEbZXHYXo9C2Fa4EEds/uSyS4cxmA==", + "version": "20.14.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", + "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", "dev": true, "dependencies": { "undici-types": "~5.26.4" } }, "node_modules/@vitest/coverage-v8": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", - "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.0.3.tgz", + "integrity": "sha512-53d+6jXFdYbasXBmsL6qaGIfcY5eBQq0sP57AjdasOcSiGNj4qxkkpDKIitUNfjxcfAfUfQ8BD0OR2fSey64+g==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.2.1", + "@ampproject/remapping": "^2.3.0", "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.4", + "debug": "^4.3.5", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^5.0.4", - "istanbul-reports": "^3.1.6", - "magic-string": "^0.30.5", - "magicast": "^0.3.3", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "test-exclude": "^6.0.0" + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magic-string": "^0.30.10", + "magicast": "^0.3.4", + "std-env": "^3.7.0", + "strip-literal": "^2.1.0", + "test-exclude": "^7.0.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "1.6.0" + "vitest": "2.0.3" } }, "node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.3.tgz", + "integrity": "sha512-X6AepoOYePM0lDNUPsGXTxgXZAl3EXd0GYe/MZyVE4HzkUqyUVC6S3PrY5mClDJ6/7/7vALLMV3+xD/Ko60Hqg==", "dev": true, "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" + "@vitest/spy": "2.0.3", + "@vitest/utils": "2.0.3", + "chai": "^5.1.1", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.3.tgz", + "integrity": "sha512-URM4GLsB2xD37nnTyvf6kfObFafxmycCL8un3OC9gaCs5cti2u+5rJdIflZ2fUJUen4NbvF6jCufwViAFLvz1g==", + "dev": true, + "dependencies": { + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.3.tgz", + "integrity": "sha512-EmSP4mcjYhAcuBWwqgpjR3FYVeiA4ROzRunqKltWjBfLNs1tnMLtF+qtgd5ClTwkDP6/DGlKJTNa6WxNK0bNYQ==", "dev": true, "dependencies": { - "@vitest/utils": "1.6.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" + "@vitest/utils": "2.0.3", + "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.3.tgz", + "integrity": "sha512-6OyA6v65Oe3tTzoSuRPcU6kh9m+mPL1vQ2jDlPdn9IQoUxl8rXhBnfICNOC+vwxWY684Vt5UPgtcA2aPFBb6wg==", "dev": true, "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" + "@vitest/pretty-format": "2.0.3", + "magic-string": "^0.30.10", + "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.0.3.tgz", + "integrity": "sha512-sfqyAw/ypOXlaj4S+w8689qKM1OyPOqnonqOc9T91DsoHbfN5mU7FdifWWv3MtQFf0lEUstEwR9L/q/M390C+A==", "dev": true, "dependencies": { - "tinyspy": "^2.2.0" + "tinyspy": "^3.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.0.3.tgz", + "integrity": "sha512-c/UdELMuHitQbbc/EVctlBaxoYAwQPQdSNwv7z/vHyBKy2edYZaFgptE27BRueZB7eW8po+cllotMNTDpL3HWg==", "dev": true, "dependencies": { - "diff-sequences": "^29.6.3", + "@vitest/pretty-format": "2.0.3", "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" + "loupe": "^3.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/abitype": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.2.tgz", - "integrity": "sha512-aFt4k2H+eiAKy/zxtnORa9iIb10BMBeWL18l8v4+QuwYEBXPxxjSB1bFZCzQmKPoj8m7j68K705l3uY+E2gAjg==", - "dev": true, + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.5.tgz", + "integrity": "sha512-YzDhti7cjlfaBhHutMaboYB21Ha3rXR9QTkNJFzYC4kC8YclaiwPBBBJY8ejFdu2wnJeZCVZSMlQJ7fi8S6hsw==", "funding": { "url": "https://github.com/sponsors/wevm" }, @@ -937,25 +973,16 @@ } } }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { - "node": ">=0.4.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -974,12 +1001,12 @@ } }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/async": { @@ -1010,13 +1037,12 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/cac": { @@ -1043,21 +1069,19 @@ } }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", + "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chalk": { @@ -1077,15 +1101,12 @@ } }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/color-convert": { @@ -1106,18 +1127,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/confbox": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", - "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", - "dev": true - }, "node_modules/corser": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", @@ -1142,9 +1151,9 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -1159,13 +1168,10 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, "engines": { "node": ">=6" } @@ -1184,15 +1190,6 @@ "node": ">= 0.4" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/dotenv": { "version": "16.4.5", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", @@ -1205,42 +1202,55 @@ "url": "https://dotenvx.com" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, "node_modules/esbuild": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.4.tgz", - "integrity": "sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", + "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.4", - "@esbuild/android-arm": "0.21.4", - "@esbuild/android-arm64": "0.21.4", - "@esbuild/android-x64": "0.21.4", - "@esbuild/darwin-arm64": "0.21.4", - "@esbuild/darwin-x64": "0.21.4", - "@esbuild/freebsd-arm64": "0.21.4", - "@esbuild/freebsd-x64": "0.21.4", - "@esbuild/linux-arm": "0.21.4", - "@esbuild/linux-arm64": "0.21.4", - "@esbuild/linux-ia32": "0.21.4", - "@esbuild/linux-loong64": "0.21.4", - "@esbuild/linux-mips64el": "0.21.4", - "@esbuild/linux-ppc64": "0.21.4", - "@esbuild/linux-riscv64": "0.21.4", - "@esbuild/linux-s390x": "0.21.4", - "@esbuild/linux-x64": "0.21.4", - "@esbuild/netbsd-x64": "0.21.4", - "@esbuild/openbsd-x64": "0.21.4", - "@esbuild/sunos-x64": "0.21.4", - "@esbuild/win32-arm64": "0.21.4", - "@esbuild/win32-ia32": "0.21.4", - "@esbuild/win32-x64": "0.21.4" + "@esbuild/aix-ppc64": "0.23.0", + "@esbuild/android-arm": "0.23.0", + "@esbuild/android-arm64": "0.23.0", + "@esbuild/android-x64": "0.23.0", + "@esbuild/darwin-arm64": "0.23.0", + "@esbuild/darwin-x64": "0.23.0", + "@esbuild/freebsd-arm64": "0.23.0", + "@esbuild/freebsd-x64": "0.23.0", + "@esbuild/linux-arm": "0.23.0", + "@esbuild/linux-arm64": "0.23.0", + "@esbuild/linux-ia32": "0.23.0", + "@esbuild/linux-loong64": "0.23.0", + "@esbuild/linux-mips64el": "0.23.0", + "@esbuild/linux-ppc64": "0.23.0", + "@esbuild/linux-riscv64": "0.23.0", + "@esbuild/linux-s390x": "0.23.0", + "@esbuild/linux-x64": "0.23.0", + "@esbuild/netbsd-x64": "0.23.0", + "@esbuild/openbsd-arm64": "0.23.0", + "@esbuild/openbsd-x64": "0.23.0", + "@esbuild/sunos-x64": "0.23.0", + "@esbuild/win32-arm64": "0.23.0", + "@esbuild/win32-ia32": "0.23.0", + "@esbuild/win32-x64": "0.23.0" } }, "node_modules/estree-walker": { @@ -1301,11 +1311,21 @@ } } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "node_modules/foreground-child": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/fsevents": { "version": "2.3.3", @@ -1367,20 +1387,20 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": "*" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1544,22 +1564,15 @@ "node": ">=0.10.0" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "engines": { + "node": ">=8" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -1617,9 +1630,9 @@ } }, "node_modules/istanbul-lib-source-maps": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", - "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.23", @@ -1631,9 +1644,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -1643,28 +1656,27 @@ "node": ">=8" } }, - "node_modules/js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", - "dev": true - }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, - "engines": { - "node": ">=14" + "@isaacs/cliui": "^8.0.2" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -1672,25 +1684,19 @@ "dev": true }, "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", + "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", "dev": true, "dependencies": { "get-func-name": "^2.0.1" } }, "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==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true }, "node_modules/magic-string": { "version": "0.30.10", @@ -1758,15 +1764,18 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -1778,6 +1787,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -1790,18 +1808,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mlly": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", - "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", - "dev": true, - "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.1.0", - "ufo": "^1.5.3" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1862,15 +1868,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, "node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", @@ -1895,29 +1892,11 @@ "opener": "bin/opener-bin.js" } }, - "node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true }, "node_modules/path-key": { "version": "3.1.1", @@ -1928,6 +1907,22 @@ "node": ">=8" } }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", @@ -1935,12 +1930,12 @@ "dev": true }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/picocolors": { @@ -1949,17 +1944,6 @@ "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, - "node_modules/pkg-types": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", - "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", - "dev": true, - "dependencies": { - "confbox": "^0.1.7", - "mlly": "^1.7.0", - "pathe": "^1.1.2" - } - }, "node_modules/portfinder": { "version": "1.0.32", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz", @@ -1984,9 +1968,9 @@ } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", + "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", "dev": true, "funding": [ { @@ -2004,39 +1988,13 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" } }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/qs": { "version": "6.11.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", @@ -2052,12 +2010,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -2065,9 +2017,9 @@ "dev": true }, "node_modules/rollup": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", - "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.1.tgz", + "integrity": "sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -2080,22 +2032,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.18.0", - "@rollup/rollup-android-arm64": "4.18.0", - "@rollup/rollup-darwin-arm64": "4.18.0", - "@rollup/rollup-darwin-x64": "4.18.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", - "@rollup/rollup-linux-arm-musleabihf": "4.18.0", - "@rollup/rollup-linux-arm64-gnu": "4.18.0", - "@rollup/rollup-linux-arm64-musl": "4.18.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", - "@rollup/rollup-linux-riscv64-gnu": "4.18.0", - "@rollup/rollup-linux-s390x-gnu": "4.18.0", - "@rollup/rollup-linux-x64-gnu": "4.18.0", - "@rollup/rollup-linux-x64-musl": "4.18.0", - "@rollup/rollup-win32-arm64-msvc": "4.18.0", - "@rollup/rollup-win32-ia32-msvc": "4.18.0", - "@rollup/rollup-win32-x64-msvc": "4.18.0", + "@rollup/rollup-android-arm-eabi": "4.18.1", + "@rollup/rollup-android-arm64": "4.18.1", + "@rollup/rollup-darwin-arm64": "4.18.1", + "@rollup/rollup-darwin-x64": "4.18.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.1", + "@rollup/rollup-linux-arm-musleabihf": "4.18.1", + "@rollup/rollup-linux-arm64-gnu": "4.18.1", + "@rollup/rollup-linux-arm64-musl": "4.18.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.1", + "@rollup/rollup-linux-riscv64-gnu": "4.18.1", + "@rollup/rollup-linux-s390x-gnu": "4.18.1", + "@rollup/rollup-linux-x64-gnu": "4.18.1", + "@rollup/rollup-linux-x64-musl": "4.18.1", + "@rollup/rollup-win32-arm64-msvc": "4.18.1", + "@rollup/rollup-win32-ia32-msvc": "4.18.1", + "@rollup/rollup-win32-x64-msvc": "4.18.1", "fsevents": "~2.3.2" } }, @@ -2118,13 +2070,10 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -2221,6 +2170,102 @@ "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -2258,17 +2303,17 @@ } }, "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^10.4.1", + "minimatch": "^9.0.4" }, "engines": { - "node": ">=8" + "node": ">=18" } }, "node_modules/tinybench": { @@ -2278,18 +2323,27 @@ "dev": true }, "node_modules/tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.0.tgz", + "integrity": "sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==", + "dev": true, + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.0.tgz", + "integrity": "sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==", "dev": true, "engines": { "node": ">=14.0.0" @@ -2304,19 +2358,10 @@ "node": ">=4" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "devOptional": true, "bin": { "tsc": "bin/tsc", @@ -2326,12 +2371,6 @@ "node": ">=14.17" } }, - "node_modules/ufo": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", - "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", - "dev": true - }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -2357,9 +2396,9 @@ "dev": true }, "node_modules/viem": { - "version": "2.13.3", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.13.3.tgz", - "integrity": "sha512-3tlwDRKHSelupFjbFMdUxF41f79ktyH2F9PAQ9Dltbs1DpdDlR1x+Ksa0th6qkyjjAbpDZP3F5nMTJv/1GVPdQ==", + "version": "2.17.5", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.17.5.tgz", + "integrity": "sha512-m0QIKQF1uqTFWAYNeAdhNUBFMaIs0Mwhu2VmZuXmBMkzJ0IL0ViblLH13JRwbDnOaY82KYzNhCARmfnLBWVdkA==", "funding": [ { "type": "github", @@ -2369,13 +2408,13 @@ "peer": true, "dependencies": { "@adraffy/ens-normalize": "1.10.0", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@scure/bip32": "1.3.2", - "@scure/bip39": "1.2.1", - "abitype": "1.0.0", + "@noble/curves": "1.4.0", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0", + "abitype": "1.0.5", "isows": "1.0.4", - "ws": "8.13.0" + "ws": "8.17.1" }, "peerDependencies": { "typescript": ">=5.0.4" @@ -2386,35 +2425,14 @@ } } }, - "node_modules/viem/node_modules/abitype": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.0.tgz", - "integrity": "sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==", - "peer": true, - "funding": { - "url": "https://github.com/sponsors/wevm" - }, - "peerDependencies": { - "typescript": ">=5.0.4", - "zod": "^3 >=3.22.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - }, - "zod": { - "optional": true - } - } - }, "node_modules/vite": { - "version": "5.2.12", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.12.tgz", - "integrity": "sha512-/gC8GxzxMK5ntBwb48pR32GGhENnjtY30G4A0jemunsBkiEZFw60s8InGpN8gkhHEkjnRK1aSAxeQgwvFhUHAA==", + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.4.tgz", + "integrity": "sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA==", "dev": true, "dependencies": { - "esbuild": "^0.20.1", - "postcss": "^8.4.38", + "esbuild": "^0.21.3", + "postcss": "^8.4.39", "rollup": "^4.13.0" }, "bin": { @@ -2463,15 +2481,15 @@ } }, "node_modules/vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.0.3.tgz", + "integrity": "sha512-14jzwMx7XTcMB+9BhGQyoEAmSl0eOr3nrnn+Z12WNERtOvLN+d2scbRUvyni05rT3997Bg+rZb47NyP4IQPKXg==", "dev": true, "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", + "debug": "^4.3.5", + "pathe": "^1.1.2", + "tinyrainbow": "^1.2.0", "vite": "^5.0.0" }, "bin": { @@ -2485,9 +2503,9 @@ } }, "node_modules/vite/node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": [ "ppc64" ], @@ -2501,9 +2519,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], @@ -2517,9 +2535,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], @@ -2533,9 +2551,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], @@ -2549,9 +2567,9 @@ } }, "node_modules/vite/node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], @@ -2565,9 +2583,9 @@ } }, "node_modules/vite/node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], @@ -2581,9 +2599,9 @@ } }, "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], @@ -2597,9 +2615,9 @@ } }, "node_modules/vite/node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], @@ -2613,9 +2631,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], @@ -2629,9 +2647,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], @@ -2645,9 +2663,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], @@ -2661,9 +2679,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], @@ -2677,9 +2695,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], @@ -2693,9 +2711,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], @@ -2709,9 +2727,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], @@ -2725,9 +2743,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], @@ -2741,9 +2759,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], @@ -2757,9 +2775,9 @@ } }, "node_modules/vite/node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], @@ -2773,9 +2791,9 @@ } }, "node_modules/vite/node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], @@ -2789,9 +2807,9 @@ } }, "node_modules/vite/node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], @@ -2805,9 +2823,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], @@ -2821,9 +2839,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], @@ -2837,9 +2855,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], @@ -2853,9 +2871,9 @@ } }, "node_modules/vite/node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, "bin": { @@ -2865,56 +2883,55 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.0.3.tgz", + "integrity": "sha512-o3HRvU93q6qZK4rI2JrhKyZMMuxg/JRt30E6qeQs6ueaiz5hr1cPj+Sk2kATgQzMMqsa2DiNI0TIK++1ULx8Jw==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@vitest/expect": "2.0.3", + "@vitest/pretty-format": "^2.0.3", + "@vitest/runner": "2.0.3", + "@vitest/snapshot": "2.0.3", + "@vitest/spy": "2.0.3", + "@vitest/utils": "2.0.3", + "chai": "^5.1.1", + "debug": "^4.3.5", "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", + "magic-string": "^0.30.10", + "pathe": "^1.1.2", + "std-env": "^3.7.0", + "tinybench": "^2.8.0", + "tinypool": "^1.0.0", + "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "1.6.0", + "vite-node": "2.0.3", "why-is-node-running": "^2.2.2" }, "bin": { @@ -2929,8 +2946,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.0", - "@vitest/ui": "1.6.0", + "@vitest/browser": "2.0.3", + "@vitest/ui": "2.0.3", "happy-dom": "*", "jsdom": "*" }, @@ -2983,9 +3000,9 @@ } }, "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, "dependencies": { "siginfo": "^2.0.0", @@ -2998,16 +3015,98 @@ "node": ">=8" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "peer": true, "engines": { "node": ">=10.0.0" @@ -3024,24 +3123,6 @@ "optional": true } } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } } } diff --git a/package.json b/package.json index 9b60ede..b135134 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,11 @@ "swap", "erc-20", "events", + "settler", "ethereum", + "aggregator", "0x protocol", - "transactions", - "exchange proxy" + "transactions" ], "author": "henryzhu.eth", "license": "MIT", @@ -48,16 +49,16 @@ "test": "vitest --coverage" }, "peerDependencies": { - "viem": "^2.13.3" + "viem": "^2.17.5" }, "devDependencies": { - "@types/node": "^20.14.0", - "@vitest/coverage-v8": "^1.6.0", - "abitype": "^1.0.2", + "@types/node": "^20.14.11", + "@vitest/coverage-v8": "^2.0.3", + "abitype": "^1.0.5", "dotenv": "^16.4.5", - "esbuild": "^0.21.4", + "esbuild": "^0.23.0", "http-server": "^14.1.1", - "typescript": "^5.4.5", - "vitest": "^1.6.0" + "typescript": "^5.5.3", + "vitest": "^2.0.3" } } diff --git a/src/abi/ExchangeProxyAbi.ts b/src/abi/ExchangeProxyAbi.ts deleted file mode 100644 index 0bb9eb3..0000000 --- a/src/abi/ExchangeProxyAbi.ts +++ /dev/null @@ -1,6831 +0,0 @@ -export const exchangeProxyAbi = [ - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - ], - name: "ERC1155OrderCancelled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "taker", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - indexed: false, - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "erc20FillAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - indexed: false, - internalType: "uint128", - name: "erc1155FillAmount", - type: "uint128", - }, - { - indexed: false, - internalType: "address", - name: "matcher", - type: "address", - }, - ], - name: "ERC1155OrderFilled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "taker", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - indexed: false, - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { internalType: "bytes", name: "feeData", type: "bytes" }, - ], - indexed: false, - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - indexed: false, - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - indexed: false, - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - indexed: false, - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - name: "ERC1155OrderPreSigned", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - ], - name: "ERC721OrderCancelled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "taker", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - indexed: false, - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - indexed: false, - internalType: "address", - name: "matcher", - type: "address", - }, - ], - name: "ERC721OrderFilled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "taker", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - indexed: false, - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { internalType: "bytes", name: "feeData", type: "bytes" }, - ], - indexed: false, - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - indexed: false, - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - indexed: false, - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - name: "ERC721OrderPreSigned", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "taker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "makerToken", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "takerToken", - type: "address", - }, - { - indexed: false, - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - indexed: false, - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - { - indexed: false, - internalType: "uint128", - name: "takerTokenFeeFilledAmount", - type: "uint128", - }, - { - indexed: false, - internalType: "uint256", - name: "protocolFeePaid", - type: "uint256", - }, - { - indexed: false, - internalType: "bytes32", - name: "pool", - type: "bytes32", - }, - ], - name: "LimitOrderFilled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "contract IERC20Token", - name: "inputToken", - type: "address", - }, - { - indexed: false, - internalType: "contract IERC20Token", - name: "outputToken", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "inputTokenAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "outputTokenAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "contract ILiquidityProvider", - name: "provider", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "recipient", - type: "address", - }, - ], - name: "LiquidityProviderSwap", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "hash", - type: "bytes32", - }, - { - indexed: true, - internalType: "bytes4", - name: "selector", - type: "bytes4", - }, - { - indexed: false, - internalType: "address", - name: "signer", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "MetaTransactionExecuted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "caller", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "migrator", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "Migrated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - ], - name: "OrderCancelled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "signer", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "allowed", - type: "bool", - }, - ], - name: "OrderSignerRegistered", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "taker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "makerToken", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "takerToken", - type: "address", - }, - { - indexed: false, - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - { - indexed: false, - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - ], - name: "OtcOrderFilled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "makerToken", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "takerToken", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "minValidSalt", - type: "uint256", - }, - ], - name: "PairCancelledLimitOrders", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "makerToken", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "takerToken", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "minValidSalt", - type: "uint256", - }, - ], - name: "PairCancelledRfqOrders", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "bytes4", - name: "selector", - type: "bytes4", - }, - { - indexed: false, - internalType: "address", - name: "oldImpl", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newImpl", - type: "address", - }, - ], - name: "ProxyFunctionUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "quoteSigner", - type: "address", - }, - ], - name: "QuoteSignerUpdated", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - indexed: false, - internalType: "address", - name: "maker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "taker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "makerToken", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "takerToken", - type: "address", - }, - { - indexed: false, - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - indexed: false, - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - { - indexed: false, - internalType: "bytes32", - name: "pool", - type: "bytes32", - }, - ], - name: "RfqOrderFilled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "origin", - type: "address", - }, - { - indexed: false, - internalType: "address[]", - name: "addrs", - type: "address[]", - }, - { - indexed: false, - internalType: "bool", - name: "allowed", - type: "bool", - }, - ], - name: "RfqOrderOriginsAllowed", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "taker", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "inputToken", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "outputToken", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "inputTokenAmount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "outputTokenAmount", - type: "uint256", - }, - ], - name: "TransformedERC20", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "transformerDeployer", - type: "address", - }, - ], - name: "TransformerDeployerUpdated", - type: "event", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - { internalType: "address", name: "taker", type: "address" }, - { internalType: "address", name: "sender", type: "address" }, - ], - name: "_fillLimitOrder", - outputs: [ - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "makerSignature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - { internalType: "address", name: "taker", type: "address" }, - { internalType: "bool", name: "useSelfBalance", type: "bool" }, - { internalType: "address", name: "recipient", type: "address" }, - ], - name: "_fillOtcOrder", - outputs: [ - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - { internalType: "address", name: "taker", type: "address" }, - { internalType: "bool", name: "useSelfBalance", type: "bool" }, - { internalType: "address", name: "recipient", type: "address" }, - ], - name: "_fillRfqOrder", - outputs: [ - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "inputToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "outputToken", - type: "address", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "enum IMultiplexFeature.MultiplexSubcall", - name: "id", - type: "uint8", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct IMultiplexFeature.BatchSellSubcall[]", - name: "calls", - type: "tuple[]", - }, - { - internalType: "bool", - name: "useSelfBalance", - type: "bool", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { internalType: "address", name: "payer", type: "address" }, - ], - internalType: "struct IMultiplexFeature.BatchSellParams", - name: "params", - type: "tuple", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - ], - name: "_multiplexBatchSell", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address[]", - name: "tokens", - type: "address[]", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "enum IMultiplexFeature.MultiplexSubcall", - name: "id", - type: "uint8", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct IMultiplexFeature.MultiHopSellSubcall[]", - name: "calls", - type: "tuple[]", - }, - { - internalType: "bool", - name: "useSelfBalance", - type: "bool", - }, - { - internalType: "address", - name: "recipient", - type: "address", - }, - { internalType: "address", name: "payer", type: "address" }, - ], - internalType: "struct IMultiplexFeature.MultiHopSellParams", - name: "params", - type: "tuple", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - ], - name: "_multiplexMultiHopSell", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes", name: "encodedPath", type: "bytes" }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - { internalType: "address", name: "recipient", type: "address" }, - ], - name: "_sellHeldTokenForTokenToUniswapV3", - outputs: [{ internalType: "uint256", name: "buyAmount", type: "uint256" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes", name: "encodedPath", type: "bytes" }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - { internalType: "address", name: "recipient", type: "address" }, - { internalType: "address", name: "payer", type: "address" }, - ], - name: "_sellTokenForTokenToUniswapV3", - outputs: [{ internalType: "uint256", name: "buyAmount", type: "uint256" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "taker", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "inputToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "outputToken", - type: "address", - }, - { - internalType: "uint256", - name: "inputTokenAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minOutputTokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "uint32", - name: "deploymentNonce", - type: "uint32", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct ITransformERC20Feature.Transformation[]", - name: "transformations", - type: "tuple[]", - }, - { - internalType: "bool", - name: "useSelfBalance", - type: "bool", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - internalType: "struct ITransformERC20Feature.TransformERC20Args", - name: "args", - type: "tuple", - }, - ], - name: "_transformERC20", - outputs: [ - { - internalType: "uint256", - name: "outputTokenAmount", - type: "uint256", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.ERC1155Order[]", - name: "sellOrders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "signatures", - type: "tuple[]", - }, - { - internalType: "uint128[]", - name: "erc1155TokenAmounts", - type: "uint128[]", - }, - { - internalType: "bytes[]", - name: "callbackData", - type: "bytes[]", - }, - { - internalType: "bool", - name: "revertIfIncomplete", - type: "bool", - }, - ], - name: "batchBuyERC1155s", - outputs: [{ internalType: "bool[]", name: "successes", type: "bool[]" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order[]", - name: "sellOrders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "signatures", - type: "tuple[]", - }, - { - internalType: "bytes[]", - name: "callbackData", - type: "bytes[]", - }, - { - internalType: "bool", - name: "revertIfIncomplete", - type: "bool", - }, - ], - name: "batchBuyERC721s", - outputs: [{ internalType: "bool[]", name: "successes", type: "bool[]" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256[]", - name: "orderNonces", - type: "uint256[]", - }, - ], - name: "batchCancelERC1155Orders", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256[]", - name: "orderNonces", - type: "uint256[]", - }, - ], - name: "batchCancelERC721Orders", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder[]", - name: "orders", - type: "tuple[]", - }, - ], - name: "batchCancelLimitOrders", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token[]", - name: "makerTokens", - type: "address[]", - }, - { - internalType: "contract IERC20Token[]", - name: "takerTokens", - type: "address[]", - }, - { - internalType: "uint256[]", - name: "minValidSalts", - type: "uint256[]", - }, - ], - name: "batchCancelPairLimitOrders", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "maker", type: "address" }, - { - internalType: "contract IERC20Token[]", - name: "makerTokens", - type: "address[]", - }, - { - internalType: "contract IERC20Token[]", - name: "takerTokens", - type: "address[]", - }, - { - internalType: "uint256[]", - name: "minValidSalts", - type: "uint256[]", - }, - ], - name: "batchCancelPairLimitOrdersWithSigner", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token[]", - name: "makerTokens", - type: "address[]", - }, - { - internalType: "contract IERC20Token[]", - name: "takerTokens", - type: "address[]", - }, - { - internalType: "uint256[]", - name: "minValidSalts", - type: "uint256[]", - }, - ], - name: "batchCancelPairRfqOrders", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "maker", type: "address" }, - { - internalType: "contract IERC20Token[]", - name: "makerTokens", - type: "address[]", - }, - { - internalType: "contract IERC20Token[]", - name: "takerTokens", - type: "address[]", - }, - { - internalType: "uint256[]", - name: "minValidSalts", - type: "uint256[]", - }, - ], - name: "batchCancelPairRfqOrdersWithSigner", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder[]", - name: "orders", - type: "tuple[]", - }, - ], - name: "batchCancelRfqOrders", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "signer", - type: "address", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "minGasPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxGasPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "expirationTimeSeconds", - type: "uint256", - }, - { internalType: "uint256", name: "salt", type: "uint256" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "feeToken", - type: "address", - }, - { - internalType: "uint256", - name: "feeAmount", - type: "uint256", - }, - ], - internalType: "struct IMetaTransactionsFeature.MetaTransactionData[]", - name: "mtxs", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "signatures", - type: "tuple[]", - }, - ], - name: "batchExecuteMetaTransactions", - outputs: [ - { - internalType: "bytes[]", - name: "returnResults", - type: "bytes[]", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "signer", - type: "address", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "expirationTimeSeconds", - type: "uint256", - }, - { internalType: "uint256", name: "salt", type: "uint256" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { - internalType: "contract IERC20Token", - name: "feeToken", - type: "address", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - internalType: - "struct IMetaTransactionsFeatureV2.MetaTransactionFeeData[]", - name: "fees", - type: "tuple[]", - }, - ], - internalType: - "struct IMetaTransactionsFeatureV2.MetaTransactionDataV2[]", - name: "mtxs", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "signatures", - type: "tuple[]", - }, - ], - name: "batchExecuteMetaTransactionsV2", - outputs: [ - { - internalType: "bytes[]", - name: "returnResults", - type: "bytes[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder[]", - name: "orders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "signatures", - type: "tuple[]", - }, - { - internalType: "uint128[]", - name: "takerTokenFillAmounts", - type: "uint128[]", - }, - { - internalType: "bool", - name: "revertIfIncomplete", - type: "bool", - }, - ], - name: "batchFillLimitOrders", - outputs: [ - { - internalType: "uint128[]", - name: "takerTokenFilledAmounts", - type: "uint128[]", - }, - { - internalType: "uint128[]", - name: "makerTokenFilledAmounts", - type: "uint128[]", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder[]", - name: "orders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "signatures", - type: "tuple[]", - }, - { - internalType: "uint128[]", - name: "takerTokenFillAmounts", - type: "uint128[]", - }, - { - internalType: "bool", - name: "revertIfIncomplete", - type: "bool", - }, - ], - name: "batchFillRfqOrders", - outputs: [ - { - internalType: "uint128[]", - name: "takerTokenFilledAmounts", - type: "uint128[]", - }, - { - internalType: "uint128[]", - name: "makerTokenFilledAmounts", - type: "uint128[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder[]", - name: "orders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "makerSignatures", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "takerSignatures", - type: "tuple[]", - }, - { internalType: "bool[]", name: "unwrapWeth", type: "bool[]" }, - ], - name: "batchFillTakerSignedOtcOrders", - outputs: [{ internalType: "bool[]", name: "successes", type: "bool[]" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder[]", - name: "orders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "signatures", - type: "tuple[]", - }, - ], - name: "batchGetLimitOrderRelevantStates", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - internalType: "enum LibNativeOrder.OrderStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - ], - internalType: "struct LibNativeOrder.OrderInfo[]", - name: "orderInfos", - type: "tuple[]", - }, - { - internalType: "uint128[]", - name: "actualFillableTakerTokenAmounts", - type: "uint128[]", - }, - { - internalType: "bool[]", - name: "isSignatureValids", - type: "bool[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder[]", - name: "orders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "signatures", - type: "tuple[]", - }, - ], - name: "batchGetRfqOrderRelevantStates", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - internalType: "enum LibNativeOrder.OrderStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - ], - internalType: "struct LibNativeOrder.OrderInfo[]", - name: "orderInfos", - type: "tuple[]", - }, - { - internalType: "uint128[]", - name: "actualFillableTakerTokenAmounts", - type: "uint128[]", - }, - { - internalType: "bool[]", - name: "isSignatureValids", - type: "bool[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order[]", - name: "sellOrders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order[]", - name: "buyOrders", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "sellOrderSignatures", - type: "tuple[]", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature[]", - name: "buyOrderSignatures", - type: "tuple[]", - }, - ], - name: "batchMatchERC721Orders", - outputs: [ - { - internalType: "uint256[]", - name: "profits", - type: "uint256[]", - }, - { internalType: "bool[]", name: "successes", type: "bool[]" }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.ERC1155Order", - name: "sellOrder", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint128", - name: "erc1155BuyAmount", - type: "uint128", - }, - { internalType: "bytes", name: "callbackData", type: "bytes" }, - ], - name: "buyERC1155", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "sellOrder", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { internalType: "bytes", name: "callbackData", type: "bytes" }, - ], - name: "buyERC721", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "orderNonce", type: "uint256" }], - name: "cancelERC1155Order", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "orderNonce", type: "uint256" }], - name: "cancelERC721Order", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder", - name: "order", - type: "tuple", - }, - ], - name: "cancelLimitOrder", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint256", - name: "minValidSalt", - type: "uint256", - }, - ], - name: "cancelPairLimitOrders", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "maker", type: "address" }, - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint256", - name: "minValidSalt", - type: "uint256", - }, - ], - name: "cancelPairLimitOrdersWithSigner", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint256", - name: "minValidSalt", - type: "uint256", - }, - ], - name: "cancelPairRfqOrders", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "maker", type: "address" }, - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint256", - name: "minValidSalt", - type: "uint256", - }, - ], - name: "cancelPairRfqOrdersWithSigner", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder", - name: "order", - type: "tuple", - }, - ], - name: "cancelRfqOrder", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "createTransformWallet", - outputs: [ - { - internalType: "contract IFlashWallet", - name: "wallet", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "signer", - type: "address", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "minGasPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxGasPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "expirationTimeSeconds", - type: "uint256", - }, - { internalType: "uint256", name: "salt", type: "uint256" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "feeToken", - type: "address", - }, - { - internalType: "uint256", - name: "feeAmount", - type: "uint256", - }, - ], - internalType: "struct IMetaTransactionsFeature.MetaTransactionData", - name: "mtx", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - ], - name: "executeMetaTransaction", - outputs: [{ internalType: "bytes", name: "returnResult", type: "bytes" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "signer", - type: "address", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "expirationTimeSeconds", - type: "uint256", - }, - { internalType: "uint256", name: "salt", type: "uint256" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { - internalType: "contract IERC20Token", - name: "feeToken", - type: "address", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - internalType: - "struct IMetaTransactionsFeatureV2.MetaTransactionFeeData[]", - name: "fees", - type: "tuple[]", - }, - ], - internalType: "struct IMetaTransactionsFeatureV2.MetaTransactionDataV2", - name: "mtx", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - ], - name: "executeMetaTransactionV2", - outputs: [{ internalType: "bytes", name: "returnResult", type: "bytes" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes4", name: "selector", type: "bytes4" }, - { internalType: "address", name: "impl", type: "address" }, - ], - name: "extend", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - ], - name: "fillLimitOrder", - outputs: [ - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - ], - name: "fillOrKillLimitOrder", - outputs: [ - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - ], - name: "fillOrKillRfqOrder", - outputs: [ - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "makerSignature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - ], - name: "fillOtcOrder", - outputs: [ - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "makerSignature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - ], - name: "fillOtcOrderForEth", - outputs: [ - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "makerSignature", - type: "tuple", - }, - ], - name: "fillOtcOrderWithEth", - outputs: [ - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint128", - name: "takerTokenFillAmount", - type: "uint128", - }, - ], - name: "fillRfqOrder", - outputs: [ - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "makerTokenFilledAmount", - type: "uint128", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "makerSignature", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "takerSignature", - type: "tuple", - }, - ], - name: "fillTakerSignedOtcOrder", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "makerSignature", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "takerSignature", - type: "tuple", - }, - ], - name: "fillTakerSignedOtcOrderForEth", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.ERC1155Order", - name: "order", - type: "tuple", - }, - ], - name: "getERC1155OrderHash", - outputs: [{ internalType: "bytes32", name: "orderHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.ERC1155Order", - name: "order", - type: "tuple", - }, - ], - name: "getERC1155OrderInfo", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - internalType: "enum LibNFTOrder.OrderStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint128", - name: "orderAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "remainingAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.OrderInfo", - name: "orderInfo", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "order", - type: "tuple", - }, - ], - name: "getERC721OrderHash", - outputs: [{ internalType: "bytes32", name: "orderHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "order", - type: "tuple", - }, - ], - name: "getERC721OrderStatus", - outputs: [ - { - internalType: "enum LibNFTOrder.OrderStatus", - name: "status", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "maker", type: "address" }, - { internalType: "uint248", name: "nonceRange", type: "uint248" }, - ], - name: "getERC721OrderStatusBitVector", - outputs: [{ internalType: "uint256", name: "bitVector", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder", - name: "order", - type: "tuple", - }, - ], - name: "getLimitOrderHash", - outputs: [{ internalType: "bytes32", name: "orderHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder", - name: "order", - type: "tuple", - }, - ], - name: "getLimitOrderInfo", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - internalType: "enum LibNativeOrder.OrderStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - ], - internalType: "struct LibNativeOrder.OrderInfo", - name: "orderInfo", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerTokenFeeAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "address", - name: "feeRecipient", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.LimitOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - ], - name: "getLimitOrderRelevantState", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - internalType: "enum LibNativeOrder.OrderStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - ], - internalType: "struct LibNativeOrder.OrderInfo", - name: "orderInfo", - type: "tuple", - }, - { - internalType: "uint128", - name: "actualFillableTakerTokenAmount", - type: "uint128", - }, - { internalType: "bool", name: "isSignatureValid", type: "bool" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "signer", - type: "address", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "minGasPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxGasPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "expirationTimeSeconds", - type: "uint256", - }, - { internalType: "uint256", name: "salt", type: "uint256" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "feeToken", - type: "address", - }, - { - internalType: "uint256", - name: "feeAmount", - type: "uint256", - }, - ], - internalType: "struct IMetaTransactionsFeature.MetaTransactionData", - name: "mtx", - type: "tuple", - }, - ], - name: "getMetaTransactionExecutedBlock", - outputs: [ - { - internalType: "uint256", - name: "blockNumber", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "signer", - type: "address", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "minGasPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxGasPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "expirationTimeSeconds", - type: "uint256", - }, - { internalType: "uint256", name: "salt", type: "uint256" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "feeToken", - type: "address", - }, - { - internalType: "uint256", - name: "feeAmount", - type: "uint256", - }, - ], - internalType: "struct IMetaTransactionsFeature.MetaTransactionData", - name: "mtx", - type: "tuple", - }, - ], - name: "getMetaTransactionHash", - outputs: [{ internalType: "bytes32", name: "mtxHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "bytes32", name: "mtxHash", type: "bytes32" }], - name: "getMetaTransactionHashExecutedBlock", - outputs: [ - { - internalType: "uint256", - name: "blockNumber", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "signer", - type: "address", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "expirationTimeSeconds", - type: "uint256", - }, - { internalType: "uint256", name: "salt", type: "uint256" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { - internalType: "contract IERC20Token", - name: "feeToken", - type: "address", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - internalType: - "struct IMetaTransactionsFeatureV2.MetaTransactionFeeData[]", - name: "fees", - type: "tuple[]", - }, - ], - internalType: "struct IMetaTransactionsFeatureV2.MetaTransactionDataV2", - name: "mtx", - type: "tuple", - }, - ], - name: "getMetaTransactionV2ExecutedBlock", - outputs: [ - { - internalType: "uint256", - name: "blockNumber", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address payable", - name: "signer", - type: "address", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "expirationTimeSeconds", - type: "uint256", - }, - { internalType: "uint256", name: "salt", type: "uint256" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { - internalType: "contract IERC20Token", - name: "feeToken", - type: "address", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - internalType: - "struct IMetaTransactionsFeatureV2.MetaTransactionFeeData[]", - name: "fees", - type: "tuple[]", - }, - ], - internalType: "struct IMetaTransactionsFeatureV2.MetaTransactionDataV2", - name: "mtx", - type: "tuple", - }, - ], - name: "getMetaTransactionV2Hash", - outputs: [{ internalType: "bytes32", name: "mtxHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "bytes32", name: "mtxHash", type: "bytes32" }], - name: "getMetaTransactionV2HashExecutedBlock", - outputs: [ - { - internalType: "uint256", - name: "blockNumber", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder", - name: "order", - type: "tuple", - }, - ], - name: "getOtcOrderHash", - outputs: [{ internalType: "bytes32", name: "orderHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { - internalType: "uint256", - name: "expiryAndNonce", - type: "uint256", - }, - ], - internalType: "struct LibNativeOrder.OtcOrder", - name: "order", - type: "tuple", - }, - ], - name: "getOtcOrderInfo", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - internalType: "enum LibNativeOrder.OrderStatus", - name: "status", - type: "uint8", - }, - ], - internalType: "struct LibNativeOrder.OtcOrderInfo", - name: "orderInfo", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getProtocolFeeMultiplier", - outputs: [{ internalType: "uint32", name: "multiplier", type: "uint32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getQuoteSigner", - outputs: [{ internalType: "address", name: "signer", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder", - name: "order", - type: "tuple", - }, - ], - name: "getRfqOrderHash", - outputs: [{ internalType: "bytes32", name: "orderHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder", - name: "order", - type: "tuple", - }, - ], - name: "getRfqOrderInfo", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - internalType: "enum LibNativeOrder.OrderStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - ], - internalType: "struct LibNativeOrder.OrderInfo", - name: "orderInfo", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "contract IERC20Token", - name: "makerToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "takerToken", - type: "address", - }, - { - internalType: "uint128", - name: "makerAmount", - type: "uint128", - }, - { - internalType: "uint128", - name: "takerAmount", - type: "uint128", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "address", - name: "txOrigin", - type: "address", - }, - { internalType: "bytes32", name: "pool", type: "bytes32" }, - { internalType: "uint64", name: "expiry", type: "uint64" }, - { internalType: "uint256", name: "salt", type: "uint256" }, - ], - internalType: "struct LibNativeOrder.RfqOrder", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - ], - name: "getRfqOrderRelevantState", - outputs: [ - { - components: [ - { - internalType: "bytes32", - name: "orderHash", - type: "bytes32", - }, - { - internalType: "enum LibNativeOrder.OrderStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint128", - name: "takerTokenFilledAmount", - type: "uint128", - }, - ], - internalType: "struct LibNativeOrder.OrderInfo", - name: "orderInfo", - type: "tuple", - }, - { - internalType: "uint128", - name: "actualFillableTakerTokenAmount", - type: "uint128", - }, - { internalType: "bool", name: "isSignatureValid", type: "bool" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "bytes4", name: "selector", type: "bytes4" }, - { internalType: "uint256", name: "idx", type: "uint256" }, - ], - name: "getRollbackEntryAtIndex", - outputs: [{ internalType: "address", name: "impl", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "bytes4", name: "selector", type: "bytes4" }], - name: "getRollbackLength", - outputs: [ - { - internalType: "uint256", - name: "rollbackLength", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getTransformWallet", - outputs: [ - { - internalType: "contract IFlashWallet", - name: "wallet", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getTransformerDeployer", - outputs: [{ internalType: "address", name: "deployer", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "signer", type: "address" }, - ], - name: "isValidOrderSigner", - outputs: [{ internalType: "bool", name: "isAllowed", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "txOrigin", type: "address" }, - { internalType: "uint64", name: "nonceBucket", type: "uint64" }, - ], - name: "lastOtcTxOriginNonce", - outputs: [{ internalType: "uint128", name: "lastNonce", type: "uint128" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "sellOrder", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "buyOrder", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "sellOrderSignature", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "buyOrderSignature", - type: "tuple", - }, - ], - name: "matchERC721Orders", - outputs: [{ internalType: "uint256", name: "profit", type: "uint256" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "bytes", name: "data", type: "bytes" }, - { internalType: "address", name: "newOwner", type: "address" }, - ], - name: "migrate", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token", - name: "outputToken", - type: "address", - }, - { - components: [ - { - internalType: "enum IMultiplexFeature.MultiplexSubcall", - name: "id", - type: "uint8", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct IMultiplexFeature.BatchSellSubcall[]", - name: "calls", - type: "tuple[]", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - ], - name: "multiplexBatchSellEthForToken", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token", - name: "inputToken", - type: "address", - }, - { - components: [ - { - internalType: "enum IMultiplexFeature.MultiplexSubcall", - name: "id", - type: "uint8", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct IMultiplexFeature.BatchSellSubcall[]", - name: "calls", - type: "tuple[]", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - ], - name: "multiplexBatchSellTokenForEth", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token", - name: "inputToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "outputToken", - type: "address", - }, - { - components: [ - { - internalType: "enum IMultiplexFeature.MultiplexSubcall", - name: "id", - type: "uint8", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct IMultiplexFeature.BatchSellSubcall[]", - name: "calls", - type: "tuple[]", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - ], - name: "multiplexBatchSellTokenForToken", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "tokens", - type: "address[]", - }, - { - components: [ - { - internalType: "enum IMultiplexFeature.MultiplexSubcall", - name: "id", - type: "uint8", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct IMultiplexFeature.MultiHopSellSubcall[]", - name: "calls", - type: "tuple[]", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - ], - name: "multiplexMultiHopSellEthForToken", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "tokens", - type: "address[]", - }, - { - components: [ - { - internalType: "enum IMultiplexFeature.MultiplexSubcall", - name: "id", - type: "uint8", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct IMultiplexFeature.MultiHopSellSubcall[]", - name: "calls", - type: "tuple[]", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - ], - name: "multiplexMultiHopSellTokenForEth", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "tokens", - type: "address[]", - }, - { - components: [ - { - internalType: "enum IMultiplexFeature.MultiplexSubcall", - name: "id", - type: "uint8", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct IMultiplexFeature.MultiHopSellSubcall[]", - name: "calls", - type: "tuple[]", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - ], - name: "multiplexMultiHopSellTokenForToken", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "operator", type: "address" }, - { internalType: "address", name: "from", type: "address" }, - { internalType: "uint256", name: "tokenId", type: "uint256" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "onERC1155Received", - outputs: [{ internalType: "bytes4", name: "success", type: "bytes4" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "operator", type: "address" }, - { internalType: "address", name: "from", type: "address" }, - { internalType: "uint256", name: "tokenId", type: "uint256" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "onERC721Received", - outputs: [{ internalType: "bytes4", name: "success", type: "bytes4" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "ownerAddress", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.ERC1155Order", - name: "order", - type: "tuple", - }, - ], - name: "preSignERC1155Order", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "order", - type: "tuple", - }, - ], - name: "preSignERC721Order", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "signer", type: "address" }, - { internalType: "bool", name: "allowed", type: "bool" }, - ], - name: "registerAllowedOrderSigner", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "origins", - type: "address[]", - }, - { internalType: "bool", name: "allowed", type: "bool" }, - ], - name: "registerAllowedRfqOrigins", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes4", name: "selector", type: "bytes4" }, - { internalType: "address", name: "targetImpl", type: "address" }, - ], - name: "rollback", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.ERC1155Order", - name: "buyOrder", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - internalType: "uint128", - name: "erc1155SellAmount", - type: "uint128", - }, - { - internalType: "bool", - name: "unwrapNativeToken", - type: "bool", - }, - { internalType: "bytes", name: "callbackData", type: "bytes" }, - ], - name: "sellERC1155", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "buyOrder", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - internalType: "bool", - name: "unwrapNativeToken", - type: "bool", - }, - { internalType: "bytes", name: "callbackData", type: "bytes" }, - ], - name: "sellERC721", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes", name: "encodedPath", type: "bytes" }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - { internalType: "address", name: "recipient", type: "address" }, - ], - name: "sellEthForTokenToUniswapV3", - outputs: [{ internalType: "uint256", name: "buyAmount", type: "uint256" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token", - name: "inputToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "outputToken", - type: "address", - }, - { - internalType: "contract ILiquidityProvider", - name: "provider", - type: "address", - }, - { internalType: "address", name: "recipient", type: "address" }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - { internalType: "bytes", name: "auxiliaryData", type: "bytes" }, - ], - name: "sellToLiquidityProvider", - outputs: [ - { - internalType: "uint256", - name: "boughtAmount", - type: "uint256", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token[]", - name: "tokens", - type: "address[]", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - { - internalType: "enum IPancakeSwapFeature.ProtocolFork", - name: "fork", - type: "uint8", - }, - ], - name: "sellToPancakeSwap", - outputs: [{ internalType: "uint256", name: "buyAmount", type: "uint256" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token[]", - name: "tokens", - type: "address[]", - }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - { internalType: "bool", name: "isSushi", type: "bool" }, - ], - name: "sellToUniswap", - outputs: [{ internalType: "uint256", name: "buyAmount", type: "uint256" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes", name: "encodedPath", type: "bytes" }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - { - internalType: "address payable", - name: "recipient", - type: "address", - }, - ], - name: "sellTokenForEthToUniswapV3", - outputs: [{ internalType: "uint256", name: "buyAmount", type: "uint256" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes", name: "encodedPath", type: "bytes" }, - { - internalType: "uint256", - name: "sellAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minBuyAmount", - type: "uint256", - }, - { internalType: "address", name: "recipient", type: "address" }, - ], - name: "sellTokenForTokenToUniswapV3", - outputs: [{ internalType: "uint256", name: "buyAmount", type: "uint256" }], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "quoteSigner", - type: "address", - }, - ], - name: "setQuoteSigner", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "transformerDeployer", - type: "address", - }, - ], - name: "setTransformerDeployer", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }], - name: "supportInterface", - outputs: [{ internalType: "bool", name: "isSupported", type: "bool" }], - stateMutability: "pure", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "newOwner", type: "address" }], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32[]", - name: "poolIds", - type: "bytes32[]", - }, - ], - name: "transferProtocolFeesForPools", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token", - name: "erc20", - type: "address", - }, - { internalType: "uint256", name: "amountOut", type: "uint256" }, - { - internalType: "address payable", - name: "recipientWallet", - type: "address", - }, - ], - name: "transferTrappedTokensTo", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20Token", - name: "inputToken", - type: "address", - }, - { - internalType: "contract IERC20Token", - name: "outputToken", - type: "address", - }, - { - internalType: "uint256", - name: "inputTokenAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "minOutputTokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "uint32", - name: "deploymentNonce", - type: "uint32", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct ITransformERC20Feature.Transformation[]", - name: "transformations", - type: "tuple[]", - }, - ], - name: "transformERC20", - outputs: [ - { - internalType: "uint256", - name: "outputTokenAmount", - type: "uint256", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "int256", - name: "amount0Delta", - type: "int256", - }, - { - internalType: "int256", - name: "amount1Delta", - type: "int256", - }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "uniswapV3SwapCallback", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.ERC1155Order", - name: "order", - type: "tuple", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - ], - name: "validateERC1155OrderProperties", - outputs: [], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC1155Token", - name: "erc1155Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc1155TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc1155TokenProperties", - type: "tuple[]", - }, - { - internalType: "uint128", - name: "erc1155TokenAmount", - type: "uint128", - }, - ], - internalType: "struct LibNFTOrder.ERC1155Order", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - ], - name: "validateERC1155OrderSignature", - outputs: [], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "order", - type: "tuple", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - ], - name: "validateERC721OrderProperties", - outputs: [], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "enum LibNFTOrder.TradeDirection", - name: "direction", - type: "uint8", - }, - { internalType: "address", name: "maker", type: "address" }, - { internalType: "address", name: "taker", type: "address" }, - { - internalType: "uint256", - name: "expiry", - type: "uint256", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { - internalType: "contract IERC20Token", - name: "erc20Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc20TokenAmount", - type: "uint256", - }, - { - components: [ - { - internalType: "address", - name: "recipient", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "bytes", - name: "feeData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Fee[]", - name: "fees", - type: "tuple[]", - }, - { - internalType: "contract IERC721Token", - name: "erc721Token", - type: "address", - }, - { - internalType: "uint256", - name: "erc721TokenId", - type: "uint256", - }, - { - components: [ - { - internalType: "contract IPropertyValidator", - name: "propertyValidator", - type: "address", - }, - { - internalType: "bytes", - name: "propertyData", - type: "bytes", - }, - ], - internalType: "struct LibNFTOrder.Property[]", - name: "erc721TokenProperties", - type: "tuple[]", - }, - ], - internalType: "struct LibNFTOrder.ERC721Order", - name: "order", - type: "tuple", - }, - { - components: [ - { - internalType: "enum LibSignature.SignatureType", - name: "signatureType", - type: "uint8", - }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - internalType: "struct LibSignature.Signature", - name: "signature", - type: "tuple", - }, - ], - name: "validateERC721OrderSignature", - outputs: [], - stateMutability: "view", - type: "function", - }, -] as const; diff --git a/src/abi/MinimalERC20.ts b/src/abi/MinimalERC20.ts deleted file mode 100644 index 101783e..0000000 --- a/src/abi/MinimalERC20.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const minimalERC20Abi = [ - { - type: "function", - name: "decimals", - stateMutability: "view", - inputs: [], - outputs: [{ name: "", type: "uint8" }], - }, - { - type: "function", - name: "symbol", - stateMutability: "view", - inputs: [], - outputs: [{ name: "", type: "string" }], - }, -] as const; diff --git a/src/abi/PermitAndCall.ts b/src/abi/PermitAndCall.ts deleted file mode 100644 index 6fa9e5b..0000000 --- a/src/abi/PermitAndCall.ts +++ /dev/null @@ -1,177 +0,0 @@ -export const permitAndCallAbi = [ - { - inputs: [ - { - internalType: "contract IERC2612", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "permitAndCall", - outputs: [ - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20PermitAllowed", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "bool", - name: "allowed", - type: "bool", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "permitAndCall", - outputs: [ - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "contract IERC20MetaTransaction", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "permitAndCall", - outputs: [ - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "target", - outputs: [ - { - internalType: "address payable", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, -] as const; diff --git a/src/constants.ts b/src/constants.ts index a7e2c35..007362e 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,76 +1,60 @@ -export const EVENT_SIGNATURES = { - LimitOrderFilled: - "0xab614d2b738543c0ea21f56347cf696a3a0c42a7cbec3212a5ca22a4dcff2124", - LiquidityProviderSwap: - "0x40a6ba9513d09e3488135e0e0d10e2d4382b792720155b144cbea89ac9db6d34", - OtcOrderFilled: - "0xac75f773e3a92f1a02b12134d65e1f47f8a14eabe4eaf1e24624918e6a8b269f", - MetaTransactionExecuted: - "0x7f4fe3ff8ae440e1570c558da08440b26f89fb1c1f2910cd91ca6452955f121a", - Transfer: - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - TransformedERC20: - "0x0f6672f78a59ba8e5e5b5d38df3ebc67f3c792e2c9259b8d97d7f00dd78ba1b3", -} as const; - -export const FUNCTION_SELECTORS = { - permitAndCall: { - IERC2612: "0x34b4d153", // Canonical permit - IERC20PermitAllowed: "0x7f9cb4d7", // Dai permit - IERC20MetaTransaction: "0x9d50b5e4", // Meta Transaction permit - } -} as const - -export const EXCHANGE_PROXY_ABI_URL = - "https://raw.githubusercontent.com/0xProject/protocol/development/packages/contract-artifacts/artifacts/IZeroEx.json"; - -const CANONICAL_EXCHANGE_PROXY = "0xDef1C0ded9bec7F1a1670819833240f027b25EfF"; - -export const MULTICALL3 = "0xcA11bde05977b3631167028862bE2a173976CA11"; - -export const PERMIT_AND_CALL_BY_CHAIN_ID = { - 1: "0x1291C02D288de3De7dC25353459489073D11E1Ae", - 137: "0x2Ddd30fE5c12FC4CD497526F14Bf3d1fcd3D5Db4", - 8453: "0x3CA53031Ad0B86a304845e83644983Be3340895f", -} as const; - -export const EXCHANGE_PROXY_BY_CHAIN_ID = { - 1: CANONICAL_EXCHANGE_PROXY, - 5: "0xF91bB752490473B8342a3E964E855b9f9a2A668e", - 10: "0xDEF1ABE32c034e558Cdd535791643C58a13aCC10", - 56: CANONICAL_EXCHANGE_PROXY, - 137: CANONICAL_EXCHANGE_PROXY, - 250: "0xDEF189DeAEF76E379df891899eb5A00a94cBC250", - 8453: CANONICAL_EXCHANGE_PROXY, - 42161: CANONICAL_EXCHANGE_PROXY, - 42220: CANONICAL_EXCHANGE_PROXY, - 43114: CANONICAL_EXCHANGE_PROXY, -} as const; - -export const CONTRACTS = { - weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", -} as const; - -export const NATIVE_ASSET = { - symbol: "ETH", - decimals: 18, - address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", -} as const; - -export const NATIVE_SYMBOL_BY_CHAIN_ID = { - 1: "ETH", // Ethereum - 5: "ETH", // Goerli - 10: "ETH", // Optimism - 56: "BNB", // BNB Chain - 137: "MATIC", // Polygon - 250: "FTM", // Fantom - 8453: "ETH", // Base - 42161: "ETH", // Arbitrum One - 42220: "CELO", // Celo - 43114: "AVAX", // Avalanche -} as const; - -export enum TRANSACTION_STATUS { - REVERTED = "reverted", - SUCCESS = "success", -} +import type { SupportedChainId } from "./types"; + +export const SETTLER_ABI = [ + { + inputs: [ + { + components: [ + { internalType: "address", name: "recipient", type: "address" }, + { + internalType: "contract IERC20", + name: "buyToken", + type: "address", + }, + { internalType: "uint256", name: "minAmountOut", type: "uint256" }, + ], + internalType: "struct SettlerBase.AllowedSlippage", + name: "slippage", + type: "tuple", + }, + { internalType: "bytes[]", name: "actions", type: "bytes[]" }, + { internalType: "bytes32", name: "", type: "bytes32" }, + { internalType: "address", name: "msgSender", type: "address" }, + { internalType: "bytes", name: "sig", type: "bytes" }, + ], + name: "executeMetaTxn", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export const NATIVE_TOKEN_ADDRESS = + "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; + +export const NATIVE_SYMBOL_BY_CHAIN_ID: { [key in SupportedChainId]: string } = + { + 1: "ETH", // Ethereum + 10: "ETH", // Optimism + 56: "BNB", // BNB Chain + 137: "MATIC", // Polygon + 8453: "ETH", // Base + 42161: "ETH", // Arbitrum One + 43114: "AVAX", // Avalanche + }; + +export const SETTLER_META_TXN_BY_CHAIN_ID: { + [key in SupportedChainId]: string; +} = { + 1: "0x7C39a136EA20B3483e402EA031c1f3C019bAb24b", + 10: "0x4069560a180EbD76bB1aF947f5119Fe555BB4eA0", + 56: "0x73C25Ef091Ce3F2451946Be3f982549776bFED31", + 137: "0xF9332450385291b6dcE301917aF6905e28E8f35f", + 8453: "0x5CE929DDB01804bfF35B2F5c77b735bdB094AAc8", + 42161: "0x1aa84EB5cb62f686FC0D908AFd85864f4A05d5Ee", + 43114: "0x2adb2cE26848B94E13d2f7fE0fF7E945050D741c", +}; + +export const MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11"; + +export const NATIVE_ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; diff --git a/src/index.ts b/src/index.ts index 64c6c6d..229fd88 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,94 +1,197 @@ -import { http, getAddress, decodeFunctionData, createPublicClient } from "viem"; -import { mainnet } from "viem/chains"; -import { parsers } from "./parsers"; -import { permitAndCallAbi } from "./abi/PermitAndCall"; import { - TRANSACTION_STATUS, - EXCHANGE_PROXY_ABI_URL, - EXCHANGE_PROXY_BY_CHAIN_ID, - PERMIT_AND_CALL_BY_CHAIN_ID, + parseUnits, + formatUnits, + formatEther, + multicall3Abi, + decodeFunctionData, +} from "viem"; +import { + SETTLER_ABI, + MULTICALL3_ADDRESS, + NATIVE_TOKEN_ADDRESS, + NATIVE_SYMBOL_BY_CHAIN_ID, + SETTLER_META_TXN_BY_CHAIN_ID, } from "./constants"; -import { isChainIdSupported, isPermitAndCallChainId } from "./utils"; -import type { ParseSwapArgs } from "./types"; - -export * from "./types"; +import { + transferLogs, + isChainIdSupported, + extractNativeTransfer, +} from "./utils"; +import type { Hash, Chain, Address, Transport, PublicClient } from "viem"; +import type { TraceTransactionSchema } from "./types"; export async function parseSwap({ - rpcUrl, - exchangeProxyAbi, + publicClient, transactionHash: hash, -}: ParseSwapArgs) { - if (!rpcUrl) throw new Error("Missing rpcUrl…"); - if (!hash) throw new Error("Missing transaction hash…"); - if (!exchangeProxyAbi) { - throw new Error( - `Missing 0x Exchange Proxy ABI: ${EXCHANGE_PROXY_ABI_URL}…` - ); - } - - const publicClient = createPublicClient({ - chain: mainnet, - transport: http(rpcUrl), - }); - - const { getChainId, getTransaction, getTransactionReceipt } = publicClient; - - const [chainId, transaction, transactionReceipt] = await Promise.all([ - getChainId(), - getTransaction({ hash }), - getTransactionReceipt({ hash }), - ]); - - if (transactionReceipt.status === TRANSACTION_STATUS.REVERTED) { - return null; - } +}: { + publicClient: PublicClient; + transactionHash: Address; +}) { + const chainId = await publicClient.getChainId(); if (!isChainIdSupported(chainId)) { throw new Error(`chainId ${chainId} is unsupported…`); } - const exchangeProxy = EXCHANGE_PROXY_BY_CHAIN_ID[chainId]; - - const permitAndCall = isPermitAndCallChainId(chainId) - ? PERMIT_AND_CALL_BY_CHAIN_ID[chainId] - : null; + const client = publicClient.extend((client) => ({ + async traceCall(args: { hash: Hash }) { + return client.request({ + method: "debug_traceTransaction", + params: [args.hash, { tracer: "callTracer" }], + }); + }, + })); - // The `to` property is null only in the case of a contract creation transaction, - // which never occurs in the context of the 0x-parser. Use TypeScript's non-null - // assertion operator to indicate that the `to` property will always be present. - const to = getAddress(transaction.to!); + const trace = await client.traceCall({ hash }); - const isToExchangeProxy = to === exchangeProxy; + const transaction = await publicClient.getTransaction({ hash }); - const isToPermitAndCall = to === permitAndCall; + const { from: taker, value, to } = transaction; - if (!isToExchangeProxy && !isToPermitAndCall) { - return null; - } + const nativeTransferAmount = extractNativeTransfer(trace, taker); - const { functionName } = isToExchangeProxy - ? decodeFunctionData({ - abi: exchangeProxyAbi, - data: transaction.input, - }) - : decodeFunctionData({ - abi: permitAndCallAbi, - data: transaction.input, - }); + const transactionReceipt = await publicClient.getTransactionReceipt({ hash }); - const parser = parsers[functionName]; + const isNativeSell = value > 0n; - return parser({ - chainId, - transaction, + const logs = await transferLogs({ publicClient, - exchangeProxyAbi, transactionReceipt, - callData: transaction.input, }); -} -/** - * This function is specific to 0x API transactions on Settler. - */ -export { parseSwapV2 } from "./parseSwapV2"; + const fromTaker = logs.filter( + (log) => log.from.toLowerCase() === taker.toLowerCase() + ); + + let input = fromTaker.length ? fromTaker[0] : logs[0]; + + let output = + nativeTransferAmount === "0" + ? logs.find((log) => { + return log.to.toLowerCase() === taker.toLowerCase(); + }) + : { + symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId], + amount: nativeTransferAmount, + address: NATIVE_TOKEN_ADDRESS, + }; + + if (to?.toLowerCase() === MULTICALL3_ADDRESS.toLowerCase()) { + const { args: multicallArgs } = decodeFunctionData({ + abi: multicall3Abi, + data: transaction.input, + }); + + const { args: settlerArgs } = decodeFunctionData({ + abi: SETTLER_ABI, + data: multicallArgs[0][1].callData, + }); + + const takerForGaslessApprovalSwap = + settlerArgs[0].recipient.toLowerCase() as Address; + + const nativeTransferAmount = extractNativeTransfer( + trace, + takerForGaslessApprovalSwap + ); + + if (nativeTransferAmount === "0") { + output = output = logs[logs.length - 1]; + } else { + output = { + symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId], + amount: nativeTransferAmount, + address: NATIVE_TOKEN_ADDRESS, + }; + } + } + + const isSettlerMetaTxn = + to?.toLowerCase() === SETTLER_META_TXN_BY_CHAIN_ID[chainId].toLowerCase(); + + if (isSettlerMetaTxn) { + const { args } = decodeFunctionData({ + abi: SETTLER_ABI, + data: transaction.input, + }); + + const { 3: msgSender } = args; + + const nativeTransferAmount = extractNativeTransfer(trace, msgSender); + + if (nativeTransferAmount === "0") { + output = logs[logs.length - 1]; + const takerReceived = logs.filter( + (log) => log.to.toLowerCase() === msgSender.toLowerCase() + ); + if (takerReceived.length === 1) { + output = { + symbol: takerReceived[0].symbol, + amount: takerReceived[0].amount, + address: takerReceived[0].address, + }; + } /* v8 ignore start */ else { + // Unknown if this case actually happens. If it does, please file a bug report here: https://github.com/0xProject/0x-parser/issues/new/choose". + output = { symbol: "", amount: "", address: "" }; + console.error( + "File a bug report here with a URL to the transaction on a block explorer: https://github.com/0xProject/0x-parser/issues/new/choose" + ); + } + /* v8 ignore stop */ + } else { + output = { + symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId], + amount: nativeTransferAmount, + address: NATIVE_TOKEN_ADDRESS, + }; + } + } + + if (isNativeSell) { + const nativeSellAmount = formatEther(value); + const tokenOut = logs + .filter((log) => log.to.toLowerCase() === taker) + .reduce( + (acc, curr) => ({ + symbol: curr.symbol, + amount: formatUnits( + BigInt(acc.amount) + parseUnits(curr.amount, curr.decimals), + curr.decimals + ), + address: curr.address, + }), + { symbol: "", amount: "", address: "" } + ); + + return { + tokenIn: { + symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId], + address: NATIVE_TOKEN_ADDRESS, + amount: nativeSellAmount, + }, + tokenOut, + }; + } + + /* v8 ignore start */ + if (!output) { + console.error( + "File a bug report here with a URL to the transaction on a block explorer: https://github.com/0xProject/0x-parser/issues/new/choose" + ); + return null; + } + /* v8 ignore stop */ + + return { + tokenIn: { + symbol: input.symbol, + amount: input.amount, + address: input.address, + }, + tokenOut: { + symbol: output.symbol, + amount: output.amount, + address: output.address, + }, + }; +} diff --git a/src/parseSwapV2.ts b/src/parseSwapV2.ts deleted file mode 100644 index 9519cf4..0000000 --- a/src/parseSwapV2.ts +++ /dev/null @@ -1,382 +0,0 @@ -import { - fromHex, - erc20Abi, - parseUnits, - getAddress, - formatUnits, - formatEther, - multicall3Abi, - decodeFunctionData, -} from "viem"; - -import type { - Hex, - Hash, - Chain, - Address, - Transport, - PublicClient, - TransactionReceipt, -} from "viem"; - -const settlerAbi = [ - { - inputs: [ - { - components: [ - { internalType: "address", name: "recipient", type: "address" }, - { - internalType: "contract IERC20", - name: "buyToken", - type: "address", - }, - { internalType: "uint256", name: "minAmountOut", type: "uint256" }, - ], - internalType: "struct SettlerBase.AllowedSlippage", - name: "slippage", - type: "tuple", - }, - { internalType: "bytes[]", name: "actions", type: "bytes[]" }, - { internalType: "bytes32", name: "", type: "bytes32" }, - { internalType: "address", name: "msgSender", type: "address" }, - { internalType: "bytes", name: "sig", type: "bytes" }, - ], - name: "executeMetaTxn", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "nonpayable", - type: "function", - }, -]; - -const NATIVE_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; - -type SupportedChainId = 1 | 10 | 56 | 137 | 8453 | 42161 | 43114; - -export const NATIVE_SYMBOL_BY_CHAIN_ID: { [key in SupportedChainId]: string } = - { - 1: "ETH", // Ethereum - 10: "ETH", // Optimism - 56: "BNB", // BNB Chain - 137: "MATIC", // Polygon - 8453: "ETH", // Base - 42161: "ETH", // Arbitrum One - 43114: "AVAX", // Avalanche - }; - -const SETTLER_META_TXN_BY_CHAIN_ID: { [key in SupportedChainId]: string } = { - 1: "0x7C39a136EA20B3483e402EA031c1f3C019bAb24b", - 10: "0x4069560a180EbD76bB1aF947f5119Fe555BB4eA0", - 56: "0x73C25Ef091Ce3F2451946Be3f982549776bFED31", - 137: "0xF9332450385291b6dcE301917aF6905e28E8f35f", - 8453: "0x5CE929DDB01804bfF35B2F5c77b735bdB094AAc8", - 42161: "0x1aa84EB5cb62f686FC0D908AFd85864f4A05d5Ee", - 43114: "0x2adb2cE26848B94E13d2f7fE0fF7E945050D741c", -}; - -const MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11"; - -export function isChainIdSupported( - chainId: number -): chainId is SupportedChainId { - return [1, 10, 56, 137, 8453, 42161, 43114].includes(chainId); -} - -export interface EnrichLogsArgs { - transactionReceipt: TransactionReceipt; - publicClient: PublicClient; -} -export interface EnrichedLog { - to: Address; - from: Address; - symbol: string; - amount: string; - address: Address; - decimals: number; -} - -interface Trace { - to: Address; - from: Address; - gas: Hex; - gasUsed: Hex; - input: "Hash"; - output: Hash; - calls: Trace[]; - value: Hex; - type: "CALL" | "STATICCALL" | "DELEGATECALL" | "CREATE" | "CREATE2"; -} - -type TraceTransactionSchema = { - Parameters: [ - hash: Hash, - options: - | { - disableStorage?: boolean; - disableStack?: boolean; - enableMemory?: boolean; - enableReturnData?: boolean; - tracer?: string; - } - | { - timeout?: string; - tracerConfig?: { - onlyTopCall?: boolean; - withLog?: boolean; - }; - } - | undefined - ]; - ReturnType: Trace; -}; - -function extractNativeTransfer(trace: Trace, recipient: Address) { - let totalTransferred = 0n; - - function traverseCalls(calls: Trace[]) { - calls.forEach((call) => { - if ( - call.to.toLowerCase() === recipient.toLowerCase() && - fromHex(call.value, "bigint") > 0n - ) { - totalTransferred = totalTransferred + fromHex(call.value, "bigint"); - } - if (call.calls && call.calls.length > 0) { - traverseCalls(call.calls); - } - }); - } - - traverseCalls(trace.calls); - - return formatEther(totalTransferred); -} - -export async function transferLogs({ - publicClient, - transactionReceipt, -}: EnrichLogsArgs): Promise< - { - to: `0x${string}`; - from: `0x${string}`; - symbol: string; - amount: string; - address: `0x${string}`; - decimals: number; - }[] -> { - const EVENT_SIGNATURES = { - Transfer: - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - } as const; - const { logs } = transactionReceipt; - const transferLogsAddresses = logs - .filter((log) => log.topics[0] === EVENT_SIGNATURES.Transfer) - .map((log) => ({ ...log, address: getAddress(log.address) })); - const contracts = [ - ...transferLogsAddresses.map((log) => ({ - abi: erc20Abi, - address: log.address, - functionName: "symbol", - })), - ...transferLogsAddresses.map((log) => ({ - abi: erc20Abi, - address: log.address, - functionName: "decimals", - })), - ]; - const results = await publicClient.multicall({ contracts }); - const midpoint = Math.floor(results.length / 2); - const enrichedLogs = transferLogsAddresses - .map((log, index) => { - const symbol = results[index].result as string; - const decimals = results[midpoint + index].result as number; - const amount = - log.data === "0x" ? "0" : formatUnits(BigInt(log.data), decimals); - const { address, topics } = log; - const { 1: fromHex, 2: toHex } = topics; - const from = getAddress(convertHexToAddress(fromHex)); - const to = getAddress(convertHexToAddress(toHex)); - - return { to, from, symbol, amount, address, decimals }; - }) - .filter((log) => log.amount !== "0"); - - return enrichedLogs; -} - -function convertHexToAddress(hexString: string): string { - return `0x${hexString.slice(-40)}`; -} - -export async function parseSwapV2({ - publicClient, - transactionHash: hash, -}: { - publicClient: PublicClient; - transactionHash: Address; -}) { - const chainId = await publicClient.getChainId(); - - if (!isChainIdSupported(chainId)) { - throw new Error(`chainId ${chainId} is unsupported…`); - } - - const client = publicClient.extend((client) => ({ - async traceCall(args: { hash: Hash }) { - return client.request({ - method: "debug_traceTransaction", - params: [args.hash, { tracer: "callTracer" }], - }); - }, - })); - - const trace = await client.traceCall({ hash }); - - const transaction = await publicClient.getTransaction({ hash }); - - const { from: taker, value, to } = transaction; - - const nativeTransferAmount = extractNativeTransfer(trace, taker); - - const transactionReceipt = await publicClient.getTransactionReceipt({ hash }); - - const isNativeSell = value > 0n; - - const logs = await transferLogs({ - publicClient, - transactionReceipt, - }); - - const fromTaker = logs.filter( - (log) => log.from.toLowerCase() === taker.toLowerCase() - ); - - let input = fromTaker.length ? fromTaker[0] : logs[0]; - - let output = - nativeTransferAmount === "0" - ? logs.find((log) => { - return log.to.toLowerCase() === taker.toLowerCase(); - }) - : { - symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId], - amount: nativeTransferAmount, - address: NATIVE_TOKEN_ADDRESS, - }; - - if (to?.toLowerCase() === MULTICALL3_ADDRESS.toLowerCase()) { - const { args: multicallArgs } = decodeFunctionData({ - abi: multicall3Abi, - data: transaction.input, - }); - - const { args: settlerArgs } = decodeFunctionData({ - abi: settlerAbi, - data: multicallArgs[0][1].callData, - }); - - const takerForGaslessApprovalSwap = - settlerArgs[0].recipient.toLowerCase() as Address; - - const nativeTransferAmount = extractNativeTransfer( - trace, - takerForGaslessApprovalSwap - ); - - if (nativeTransferAmount === "0") { - output = output = logs[logs.length - 1]; - } else { - output = { - symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId], - amount: nativeTransferAmount, - address: NATIVE_TOKEN_ADDRESS, - }; - } - } - - const isSettlerMetaTxn = - to?.toLowerCase() === SETTLER_META_TXN_BY_CHAIN_ID[chainId].toLowerCase(); - - if (isSettlerMetaTxn) { - const { args } = decodeFunctionData({ - abi: settlerAbi, - data: transaction.input, - }); - - const { 3: msgSender } = args; - - const nativeTransferAmount = extractNativeTransfer(trace, msgSender); - - if (nativeTransferAmount === "0") { - output = logs[logs.length - 1]; - const takerReceived = logs.filter( - (log) => log.to.toLowerCase() === msgSender.toLowerCase() - ); - if (takerReceived.length === 1) { - output = { - symbol: takerReceived[0].symbol, - amount: takerReceived[0].amount, - address: takerReceived[0].address, - }; - } else { - // Unknown if this case actually happens. If it does, please file a bug report here: https://github.com/0xProject/0x-parser/issues/new/choose". - output = { symbol: "", amount: "", address: "" }; - console.error( - "More than one `takerReceived` log. File a bug report here: https://github.com/0xProject/0x-parser/issues/new/choose" - ); - } - } else { - output = { - symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId], - amount: nativeTransferAmount, - address: NATIVE_TOKEN_ADDRESS, - }; - } - } - - if (isNativeSell) { - const nativeSellAmount = formatEther(value); - const tokenOut = logs - .filter((log) => log.to.toLowerCase() === taker) - .reduce( - (acc, curr) => ({ - symbol: curr.symbol, - amount: formatUnits( - BigInt(acc.amount) + parseUnits(curr.amount, curr.decimals), - curr.decimals - ), - address: curr.address, - }), - { symbol: "", amount: "", address: "" } - ); - - return { - tokenIn: { - symbol: NATIVE_SYMBOL_BY_CHAIN_ID[chainId], - address: NATIVE_TOKEN_ADDRESS, - amount: nativeSellAmount, - }, - tokenOut, - }; - } - - if (!output) { - console.error( - "An error has occurred. File a bug report here: https://github.com/0xProject/0x-parser/issues/new/choose" - ); - return null; - } - - return { - tokenIn: { - symbol: input.symbol, - amount: input.amount, - address: input.address, - }, - tokenOut: { - symbol: output.symbol, - amount: output.amount, - address: output.address, - }, - }; -} diff --git a/src/parsers/index.ts b/src/parsers/index.ts deleted file mode 100644 index cb79a54..0000000 --- a/src/parsers/index.ts +++ /dev/null @@ -1,658 +0,0 @@ -import { - getAddress, - formatUnits, - decodeEventLog, - decodeFunctionData, - encodeFunctionData, -} from "viem"; -import { - CONTRACTS, - NATIVE_ASSET, - EVENT_SIGNATURES, - FUNCTION_SELECTORS, - NATIVE_SYMBOL_BY_CHAIN_ID, - EXCHANGE_PROXY_BY_CHAIN_ID, -} from "../constants"; -import { minimalERC20Abi } from "../abi/MinimalERC20"; -import { transferLogs, extractTokenInfo } from "../utils"; -import { exchangeProxyAbi as exchangeProxyAbiValue } from "../abi/ExchangeProxyAbi"; -import type { - Hex, - Chain, - Transport, - PublicClient, - TransactionReceipt, -} from "viem"; -import type { - Parsers, - ParserArgs, - PermitAndCall, - FillLimitOrder, - TokenTransaction, - FillOtcOrderForEth, - TransformERC20Args, - FillOtcOrderWithEth, - ExecuteMetaTransaction, - FillTakerSignedOtcOrder, - ExecuteMetaTransactionV2, - MultiplexBatchSellTokenForEth, - MultiplexBatchSellEthForToken, - MultiplexBatchSellTokenForToken, -} from "../types"; -import { permitAndCallAbi } from "../abi/PermitAndCall"; - -export async function sellToLiquidityProvider({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const from = getAddress(transactionReceipt.from); - const inputLog = logs.find((log) => from === log.from); - const outputLog = logs.find((log) => from === log.to); - - if (inputLog && outputLog) { - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function multiplexMultiHopSellTokenForEth({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const from = getAddress(transactionReceipt.from); - const logs = await transferLogs({ publicClient, transactionReceipt }); - const inputLog = logs.find((log) => from === log.from); - const outputLog = logs.find((log) => log.address === CONTRACTS.weth); - - if (inputLog && outputLog) { - outputLog.symbol = NATIVE_ASSET.symbol; - outputLog.address = NATIVE_ASSET.address; - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function multiplexMultiHopSellEthForToken({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const from = getAddress(transactionReceipt.from); - const logs = await transferLogs({ publicClient, transactionReceipt }); - const inputLog = logs.find((log) => log.address === CONTRACTS.weth); - const outputLog = logs.find((log) => log.to === from); - - if (inputLog && outputLog) { - inputLog.symbol = NATIVE_ASSET.symbol; - inputLog.address = NATIVE_ASSET.address; - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function fillTakerSignedOtcOrder({ - callData, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: { - callData: Hex; - publicClient: PublicClient; - exchangeProxyAbi: typeof exchangeProxyAbiValue; - transactionReceipt: TransactionReceipt; -}) { - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as FillTakerSignedOtcOrder[], - data: callData, - }); - const [order] = args; - const logs = await transferLogs({ publicClient, transactionReceipt }); - const { maker, taker } = order; - const inputLog = logs.find((log) => log.from === taker); - const outputLog = logs.find((log) => log.from === maker); - - if (inputLog && outputLog) { - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function fillOtcOrder({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const fromAddress = getAddress(transactionReceipt.from); - const inputLog = logs.find((log) => log.from === fromAddress); - const outputLog = logs.find((log) => log.to === fromAddress); - - if (inputLog && outputLog) { - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function fillTakerSignedOtcOrderForEth({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const inputLog = logs.find((log) => log.address !== CONTRACTS.weth); - const outputLog = logs.find((log) => log.address === CONTRACTS.weth); - - if (inputLog && outputLog) { - outputLog.symbol = NATIVE_ASSET.symbol; - outputLog.address = NATIVE_ASSET.address; - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function sellTokenForEthToUniswapV3({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const from = getAddress(transactionReceipt.from); - const inputLog = logs.find((log) => log.from === from); - const outputLog = logs.find((log) => log.address === CONTRACTS.weth); - - if (inputLog && outputLog) { - outputLog.symbol = NATIVE_ASSET.symbol; - outputLog.address = NATIVE_ASSET.address; - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function sellTokenForTokenToUniswapV3({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const from = getAddress(transactionReceipt.from); - const inputLog = logs.find((log) => from === log.from); - const outputLog = logs.find((log) => from === log.to); - - if (inputLog && outputLog) { - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function sellEthForTokenToUniswapV3({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const from = getAddress(transactionReceipt.from); - const inputLog = logs.find((log) => log.address === CONTRACTS.weth); - const outputLog = logs.find((log) => from === log.to); - - if (inputLog && outputLog) { - inputLog.symbol = NATIVE_ASSET.symbol; - inputLog.address = NATIVE_ASSET.address; - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function sellToUniswap({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const inputLog = logs[0]; - const outputLog = logs[logs.length - 1]; - - return extractTokenInfo(inputLog, outputLog); -} - -export async function transformERC20({ - chainId, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const nativeSymbol = NATIVE_SYMBOL_BY_CHAIN_ID[chainId]; - - for (const log of transactionReceipt.logs) { - const { topics, data } = log; - const [eventHash] = topics; - - if (eventHash === EVENT_SIGNATURES.TransformedERC20) { - let inputSymbol: undefined | string; - let inputDecimal: undefined | number; - let outputSymbol: undefined | string; - let outputDecimal: undefined | number; - - const eventLog = decodeEventLog({ - data, - topics, - abi: exchangeProxyAbi, - }); - - const { inputToken, outputToken, inputTokenAmount, outputTokenAmount } = - eventLog.args as TransformERC20Args; - - const inputContract = { - address: inputToken, - abi: minimalERC20Abi, - } as const; - - const outputContract = { - address: outputToken, - abi: minimalERC20Abi, - } as const; - - if (inputToken === NATIVE_ASSET.address) { - inputSymbol = nativeSymbol; - inputDecimal = 18; - } else { - [{ result: inputSymbol }, { result: inputDecimal }] = - await publicClient.multicall({ - contracts: [ - { - ...inputContract, - functionName: "symbol", - }, - { - ...inputContract, - functionName: "decimals", - }, - ], - }); - } - - if (outputToken === NATIVE_ASSET.address) { - outputSymbol = nativeSymbol; - outputDecimal = 18; - } else { - [{ result: outputSymbol }, { result: outputDecimal }] = - await publicClient.multicall({ - contracts: [ - { - ...outputContract, - functionName: "symbol", - }, - { - ...outputContract, - functionName: "decimals", - }, - ], - }); - } - - // 0x-parser expects decimals to be present. If you find a transaction - // where this is not the case, please open a GitHub issue. - const inputAmount = formatUnits(inputTokenAmount, inputDecimal!); - const outputAmount = formatUnits(outputTokenAmount, outputDecimal!); - - return { - tokenIn: { - address: inputToken, - amount: inputAmount, - symbol: inputSymbol, - }, - tokenOut: { - address: outputToken, - amount: outputAmount, - symbol: outputSymbol, - }, - }; - } - } -} - -export async function multiplexMultiHopSellTokenForToken({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const from = getAddress(transactionReceipt.from); - const inputLog = logs.find((log) => from === log.from); - const outputLog = logs.find((log) => from === log.to); - - if (inputLog && outputLog) { - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function multiplexBatchSellTokenForEth({ - callData, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as MultiplexBatchSellTokenForEth[], - data: callData, - }); - const [inputTokenAddress] = args; - - return logs.reduce( - (acc, curr) => { - const { symbol, amount, address } = curr; - - if (address === CONTRACTS.weth) { - return { - ...acc, - tokenOut: { - ...acc.tokenOut, - amount: (Number(acc.tokenOut.amount) + Number(amount)).toString(), - }, - }; - } else if (address === inputTokenAddress) { - return { - ...acc, - tokenIn: { - ...acc.tokenIn, - symbol, - address, - amount: (Number(acc.tokenIn.amount) + Number(amount)).toString(), - }, - }; - } else { - return acc; - } - }, - { - tokenIn: { address: "", amount: "", symbol: "" }, - tokenOut: { - amount: "", - symbol: NATIVE_ASSET.symbol, - address: NATIVE_ASSET.address, - }, - } - ); -} - -export async function multiplexBatchSellEthForToken({ - callData, - transaction, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const { value } = transaction; - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as MultiplexBatchSellEthForToken[], - data: callData, - }); - const logs = await transferLogs({ publicClient, transactionReceipt }); - const [outputToken] = args; - const divisor = 1000000000000000000n; // 1e18, for conversion from wei to ether - const etherBigInt = value / divisor; - const remainderBigInt = value % divisor; - const ether = Number(etherBigInt) + Number(remainderBigInt) / Number(divisor); - const tokenOutAmount = logs.reduce((total, log) => { - return log.address === outputToken ? total + Number(log.amount) : total; - }, 0); - const inputLog = logs.find((log) => log.address === CONTRACTS.weth); - const outputLog = logs.find((log) => log.address === outputToken); - - if (inputLog && outputLog) { - return { - tokenIn: { - symbol: NATIVE_ASSET.symbol, - amount: ether.toString(), - address: NATIVE_ASSET.address, - }, - tokenOut: { - symbol: outputLog.symbol, - amount: tokenOutAmount.toString(), - address: outputLog.address, - }, - }; - } -} - -export async function multiplexBatchSellTokenForToken({ - callData, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as MultiplexBatchSellTokenForToken[], - data: callData, - }); - const [inputContractAddress, outputContractAddress] = args; - const tokenData = { - [inputContractAddress]: { amount: "0", symbol: "", address: "" }, - [outputContractAddress]: { amount: "0", symbol: "", address: "" }, - }; - - logs.forEach(({ address, symbol, amount }) => { - if (getAddress(address) in tokenData) { - tokenData[getAddress(address)].address = getAddress(address); - tokenData[getAddress(address)].symbol = symbol; - tokenData[getAddress(address)].amount = ( - Number(tokenData[getAddress(address)].amount) + Number(amount) - ).toString(); - } - }); - - return { - tokenIn: tokenData[inputContractAddress], - tokenOut: tokenData[outputContractAddress], - }; -} - -export async function sellToPancakeSwap({ - publicClient, - transactionReceipt, -}: ParserArgs) { - const logs = await transferLogs({ publicClient, transactionReceipt }); - const exchangeProxy = getAddress(EXCHANGE_PROXY_BY_CHAIN_ID[56]); - const from = getAddress(transactionReceipt.from); - let inputLog = logs.find((log) => log.from === from); - let outputLog = logs.find((log) => log.from !== from); - - if (inputLog === undefined) { - inputLog = logs.find((log) => log.from === exchangeProxy); - outputLog = logs.find((log) => log.from !== exchangeProxy); - } - - if (!logs.some((log) => log.to === from)) { - outputLog = logs.find((log) => log.to === exchangeProxy); - } - - if (inputLog && outputLog) { - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function fillOtcOrderForEth({ - callData, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as FillOtcOrderForEth[], - data: callData, - }); - const logs = await transferLogs({ publicClient, transactionReceipt }); - const [order] = args; - const { makerToken, takerToken } = order; - const inputLog = logs.find((log) => log.address === takerToken); - const outputLog = logs.find((log) => log.address === makerToken); - - if (inputLog && outputLog) { - outputLog.symbol = NATIVE_ASSET.symbol; - outputLog.address = NATIVE_ASSET.address; - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function fillOtcOrderWithEth({ - callData, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as FillOtcOrderWithEth[], - data: callData, - }); - const logs = await transferLogs({ publicClient, transactionReceipt }); - const [order] = args; - const { makerToken, takerToken } = order; - const inputLog = logs.find((log) => log.address === takerToken); - const outputLog = logs.find((log) => log.address === makerToken); - - if (inputLog && outputLog) { - inputLog.symbol = NATIVE_ASSET.symbol; - inputLog.address = NATIVE_ASSET.address; - return extractTokenInfo(inputLog, outputLog); - } -} - -export async function fillLimitOrder({ - callData, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as FillLimitOrder[], - data: callData, - }); - const [order] = args; - const { maker, taker } = order; - const logs = await transferLogs({ publicClient, transactionReceipt }); - - if (typeof maker === "string" && typeof taker === "string") { - const inputLog = logs.find((log) => log.from === taker); - const outputLog = logs.find((log) => log.from === maker); - if (inputLog && outputLog) { - return extractTokenInfo(inputLog, outputLog); - } - } -} - -export async function executeMetaTransaction({ - callData, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as ExecuteMetaTransaction[], - data: callData, - }); - const [metaTransaction] = args; - const { signer } = metaTransaction; - const logs = await transferLogs({ publicClient, transactionReceipt }); - - if (typeof signer === "string") { - const inputLog = logs.find((log) => log.from === signer); - const outputLog = logs.find((log) => log.to === signer); - if (inputLog && outputLog) { - return extractTokenInfo(inputLog, outputLog); - } - } -} - -async function executeMetaTransactionV2({ - chainId, - transaction, - publicClient, - exchangeProxyAbi, - transactionReceipt, - callData: callDataMtx, -}: ParserArgs): Promise { - const { args } = decodeFunctionData({ - abi: exchangeProxyAbi as unknown as ExecuteMetaTransactionV2[], - data: callDataMtx, - }); - const [metaTransaction] = args; - const { callData } = metaTransaction; - const { functionName } = decodeFunctionData({ - data: callData, - abi: exchangeProxyAbi, - }); - const parser = parsers[functionName]; - - return parser({ - chainId, - callData, - transaction, - publicClient, - exchangeProxyAbi, - transactionReceipt, - }); -} - -function permitAndCall({ - chainId, - transaction, - publicClient, - exchangeProxyAbi, - transactionReceipt, -}: ParserArgs) { - const { args } = decodeFunctionData({ - abi: permitAndCallAbi as unknown as PermitAndCall[], - data: transaction.input, - }); - let callData: Hex | undefined; - - const encodedHexData = encodeFunctionData({ - abi: permitAndCallAbi as any, - functionName: "permitAndCall", - args: [...args], - }); - - const functionSelector = encodedHexData.slice(0, 10); - - const { IERC2612, IERC20PermitAllowed, IERC20MetaTransaction } = - FUNCTION_SELECTORS.permitAndCall; - - switch (functionSelector) { - case IERC2612: - callData = args[7]; - break; - case IERC20PermitAllowed: - callData = args[8]; - break; - case IERC20MetaTransaction: - callData = args[6]; - break; - } - - if (callData) { - const { functionName: exchangeProxyFn } = decodeFunctionData({ - abi: exchangeProxyAbi, - data: callData, - }); - const parser = parsers[exchangeProxyFn]; - - return parser({ - chainId, - callData, - transaction, - publicClient, - exchangeProxyAbi, - transactionReceipt, - }); - } -} - -export const parsers: Parsers = { - fillLimitOrder, - fillOtcOrder, - fillOtcOrderForEth, - fillOtcOrderWithEth, - fillTakerSignedOtcOrder, - fillTakerSignedOtcOrderForEth, - executeMetaTransaction, - executeMetaTransactionV2, - multiplexBatchSellTokenForToken, - multiplexBatchSellTokenForEth, - multiplexBatchSellEthForToken, - multiplexMultiHopSellTokenForToken, - multiplexMultiHopSellEthForToken, - multiplexMultiHopSellTokenForEth, - permitAndCall, - sellToUniswap, - sellTokenForEthToUniswapV3, - sellEthForTokenToUniswapV3, - sellTokenForTokenToUniswapV3, - sellToLiquidityProvider, - sellToPancakeSwap, - transformERC20, -}; diff --git a/src/tests/executeMetaTransaction.test.ts b/src/tests/executeMetaTransaction.test.ts deleted file mode 100644 index cbc2daf..0000000 --- a/src/tests/executeMetaTransaction.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -const POLYGON_MAINNET_RPC = "https://rpc.ankr.com/polygon"; - -// https://polygonscan.com/tx/0xaa61b2058fafae1532565b6acadf47a8fe604518185f535e2780dd28d626e0ef -it("parses swap from executeMetaTransaction", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: POLYGON_MAINNET_RPC, - transactionHash: - "0xaa61b2058fafae1532565b6acadf47a8fe604518185f535e2780dd28d626e0ef", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "WMATIC", - amount: "8.54621988", - address: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", - }, - tokenOut: { - symbol: "PAXG", - amount: "0.00488474242697242", - address: "0x553d3D295e0f695B9228246232eDF400ed3560B5", - }, - }); -}); diff --git a/src/tests/executeMetaTransactionV2.test.ts b/src/tests/executeMetaTransactionV2.test.ts deleted file mode 100644 index 5044480..0000000 --- a/src/tests/executeMetaTransactionV2.test.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x3e22063b0a1be3e8a7a902b6a2ecd86d7753279ef368e21b99d23e431d759f71 -it("parses swap from executeMetaTransactionV2 which wraps transformERC20", async () => { - const data = await parseSwap({ - transactionHash: - "0x3e22063b0a1be3e8a7a902b6a2ecd86d7753279ef368e21b99d23e431d759f71", - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "9960.981086", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "WBTC", - amount: "0.35487978", - address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", - }, - }); -}); - -// https://etherscan.io/tx/0xc772258418e5d73bcf891ef341a42c0d74d8f84beda7f9e8580eacc0d62ba3c7 -it("parses swap from executeMetaTransactionV2 which wraps multiplexBatchSellTokenForEth", async () => { - const data = await parseSwap({ - transactionHash: - "0xc772258418e5d73bcf891ef341a42c0d74d8f84beda7f9e8580eacc0d62ba3c7", - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - }); - - expect(data).toEqual({ - tokenIn: { - amount: "5000", - symbol: "USDT", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - tokenOut: { - amount: "2.6043201133029994", - symbol: NATIVE_ASSET.symbol, - address: NATIVE_ASSET.address, - }, - }); -}); - -// https://etherscan.io/tx/0xa4fa7313361c1be65bcec51217ad795028c8fd0ce9eacaff7aab546c29017921 -it("parses swap from executeMetaTransactionV2 which wraps multiplexBatchSellTokenForToken", async () => { - const data = await parseSwap({ - transactionHash: - "0xa4fa7313361c1be65bcec51217ad795028c8fd0ce9eacaff7aab546c29017921", - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - }); - - expect(data).toEqual({ - tokenIn: { - amount: "2.8981149999999998", - symbol: "WETH", - address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - }, - tokenOut: { - amount: "384833.18203482", - symbol: "HEX", - address: "0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39", - }, - }); -}); - -// https://etherscan.io/tx/0xee3ffb65f6c8e07b46471cc610cf721affeefed87098c7db30a8147d50eb2a65 -it("parses swap from executeMetaTransactionV2 which wraps transformERC20", async () => { - const data = await parseSwap({ - transactionHash: - "0xee3ffb65f6c8e07b46471cc610cf721affeefed87098c7db30a8147d50eb2a65", - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - }); - - expect(data).toEqual({ - tokenIn: { - amount: "399.98912868386398826", - symbol: "cbETH", - address: "0xBe9895146f7AF43049ca1c1AE358B0541Ea49704", - }, - tokenOut: { - amount: "410.723904828710787856", - symbol: NATIVE_ASSET.symbol, - address: NATIVE_ASSET.address, - }, - }); -}); diff --git a/src/tests/fillLimitOrder.test.ts b/src/tests/fillLimitOrder.test.ts deleted file mode 100644 index cb3496c..0000000 --- a/src/tests/fillLimitOrder.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0xbe734b761ccd45cc60a5b4828eb83da96405d663567a46041b049627dddf347d -it("parses swap from fillLimitOrder", async () => { - const data = await parseSwap({ - transactionHash: - "0xbe734b761ccd45cc60a5b4828eb83da96405d663567a46041b049627dddf347d", - exchangeProxyAbi, - rpcUrl: "https://eth.llamarpc.com", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "USDT", - amount: "1.6", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - tokenOut: { - symbol: "WETH", - amount: "0.001", - address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - }, - }); -}); diff --git a/src/tests/fillOtcOrder.test.ts b/src/tests/fillOtcOrder.test.ts deleted file mode 100644 index 4fb43ca..0000000 --- a/src/tests/fillOtcOrder.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { it, expect, describe } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -describe("fillOtcOrder", () => { - // https://etherscan.io/tx/0xc9579b9e3cddebd3d48ccb0a719456d7c46869b2c3a536509ea88685c7a5efbb - it("parse a swap on Ethereum", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0xc9579b9e3cddebd3d48ccb0a719456d7c46869b2c3a536509ea88685c7a5efbb", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "USDT", - amount: "50000", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - tokenOut: { - symbol: "LDO", - amount: "21120.508370504671821824", - address: "0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32", - }, - }); - }); - - // https://arbiscan.io/tx/0x3e48c1d1d3596ecfc1f9feb9e9613f5f5fc002b76743251c31eca8bc0aa30e21 - it("parse a swap on Arbitrum", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://arb1.arbitrum.io/rpc", - transactionHash: - "0xae78f94319844585bd9e8d4ecfefa2eb70e0cd0d49f76695ee7e4783bad4c1fc", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "ARB", - amount: "2050", - address: "0x912CE59144191C1204E64559FE8253a0e49E6548", - }, - tokenOut: { - symbol: "USDC", - amount: "1918.218706", - address: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8", - }, - }); - }); -}); diff --git a/src/tests/fillOtcOrderForEth.test.ts b/src/tests/fillOtcOrderForEth.test.ts deleted file mode 100644 index 39dc4f0..0000000 --- a/src/tests/fillOtcOrderForEth.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x2c4cee137659650ef486fb46b657ec37c1b4fe18489956a5e058cf5585328fa7 -it("parses swap from fillOtcOrderForEth", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x2c4cee137659650ef486fb46b657ec37c1b4fe18489956a5e058cf5585328fa7", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "USDT", - amount: "218.441376", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - tokenOut: { - symbol: NATIVE_ASSET.symbol, - amount: "0.1254399221596278", - address: NATIVE_ASSET.address, - }, - }); -}); diff --git a/src/tests/fillOtcOrderWithEth.test.ts b/src/tests/fillOtcOrderWithEth.test.ts deleted file mode 100644 index 0373af9..0000000 --- a/src/tests/fillOtcOrderWithEth.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x68608bec5c30750a6a358b14eb937a07f10f72c84428bdf6eae80f52c27faf53 -it("parses swap from fillOtcOrderWithEth", async () => { - const data = await parseSwap({ - transactionHash: - "0x68608bec5c30750a6a358b14eb937a07f10f72c84428bdf6eae80f52c27faf53", - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - }); - - expect(data).toEqual({ - tokenIn: { - symbol: NATIVE_ASSET.symbol, - amount: "0.9", - address: NATIVE_ASSET.address, - }, - tokenOut: { - symbol: "USDC", - amount: "1384.074396", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - }); -}); diff --git a/src/tests/fillTakerSignedOtcOrder.test.ts b/src/tests/fillTakerSignedOtcOrder.test.ts deleted file mode 100644 index 569c42d..0000000 --- a/src/tests/fillTakerSignedOtcOrder.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x7f31ba7cacfda809ea24d4b9f87c44fb4114608666c7dd1c6553986ce88dc92b -it("parses swap from fillTakerSignedOtcOrder", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x7f31ba7cacfda809ea24d4b9f87c44fb4114608666c7dd1c6553986ce88dc92b", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "WETH", - amount: "3.919122810830431232", - address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - }, - tokenOut: { - symbol: "WBTC", - amount: "0.25", - address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", - }, - }); -}); diff --git a/src/tests/fillTakerSignedOtcOrderForEth.test.ts b/src/tests/fillTakerSignedOtcOrderForEth.test.ts deleted file mode 100644 index 9b94157..0000000 --- a/src/tests/fillTakerSignedOtcOrderForEth.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x5f0ed4396f68e0321e48d50611cc6663af68bf7cbee6bc8e74ff5c63d90f3b68 -it("parses swap from fillTakerSignedOtcOrderForEth", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x5f0ed4396f68e0321e48d50611cc6663af68bf7cbee6bc8e74ff5c63d90f3b68", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "25000", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: NATIVE_ASSET.symbol, - amount: "13.848320444784979968", - address: NATIVE_ASSET.address, - }, - }); -}); diff --git a/src/tests/index.test.ts b/src/tests/index.test.ts index 5aac512..6305417 100644 --- a/src/tests/index.test.ts +++ b/src/tests/index.test.ts @@ -1,72 +1,601 @@ -import { it, expect } from "vitest"; +import { + http, + createPublicClient, + type PublicClient, + type Transport, + type Chain, +} from "viem"; +import { arbitrum, base, mainnet, optimism, polygon } from "viem/chains"; +import { test, expect } from "vitest"; import { parseSwap } from "../index"; -import { EXCHANGE_PROXY_ABI_URL } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; +import { NATIVE_ETH_ADDRESS } from "../constants"; require("dotenv").config(); -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); +if (!process.env.ALCHEMY_API_KEY) { + throw new Error("An Alchemy API key is required."); } -// https://etherscan.io/tx/0xe393e03e31ba2b938326ef0527aba08b4e7f2d144ac2a2172c57615990698ee6 -it("returns null when the transaction did not interact with 0x exchangeProxy or permitAndCall", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0xe393e03e31ba2b938326ef0527aba08b4e7f2d144ac2a2172c57615990698ee6", +const publicClient = createPublicClient({ + chain: mainnet, + transport: http( + `https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), +}); + +// https://etherscan.io/tx/0x2fc205711fc933ef6e5bcc0bf6e6a9bfc220b2d8073aea4f41305882f485669d +test("parses swapped amounts case 0 (default)", async () => { + const transactionHash = + "0x2fc205711fc933ef6e5bcc0bf6e6a9bfc220b2d8073aea4f41305882f485669d"; + + const result = await parseSwap({ + publicClient, + transactionHash, }); - expect(data).toBe(null); + expect(result).toEqual({ + tokenIn: { + symbol: "KAI", + amount: "12124969884.736401754", + address: "0xA045Fe936E26e1e1e1Fb27C1f2Ae3643acde0171", + }, + tokenOut: { + symbol: "USDC", + amount: "340.919143", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + }); }); -// https://etherscan.io/tx/0x335b2a3faf4a15cd6f67f1ec7ed26ee04ea7cc248f5cd052967e6ae672af8d35 -it("returns null when the transaction status is reverted", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x335b2a3faf4a15cd6f67f1ec7ed26ee04ea7cc248f5cd052967e6ae672af8d35", +// https://etherscan.io/tx/0x2b9a12398613887e9813594e8583f488f0e8392d8e6e0ba8d9e140065826dd00 +test("parses swapped amounts case 1 (default)", async () => { + const transactionHash = + "0x2b9a12398613887e9813594e8583f488f0e8392d8e6e0ba8d9e140065826dd00"; + + const result = await parseSwap({ + publicClient, + transactionHash, }); - expect(data).toBe(null); + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "30.084159", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + tokenOut: { + symbol: "USDT", + amount: "30.069172", + address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", + }, + }); }); -it("throws an error when required arguments are not passed", () => { - expect(async () => { - await parseSwap({ - transactionHash: "0x…", - exchangeProxyAbi, - } as any); - }).rejects.toThrowError("Missing rpcUrl…"); +// https://etherscan.io/tx/0x76b744ab42b05b30624bd5027b4f7da841cdc357bb1d6ee74e3d9e049dd8a126 +test("parses swapped amounts case 2 (default)", async () => { + const transactionHash = + "0x76b744ab42b05b30624bd5027b4f7da841cdc357bb1d6ee74e3d9e049dd8a126"; - expect(async () => { - await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - } as any); - }).rejects.toThrowError("Missing transaction hash…"); + const result = await parseSwap({ + publicClient, + transactionHash, + }); - expect(async () => { - await parseSwap({ - transactionHash: "0x…", - rpcUrl: ETH_MAINNET_RPC, - } as any); - }).rejects.toThrowError( - `Missing 0x Exchange Proxy ABI: ${EXCHANGE_PROXY_ABI_URL}…` - ); + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "1", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + tokenOut: { + symbol: "WETH", + amount: "0.000280757770903965", + address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + }, + }); +}); + +// https://etherscan.io/tx/0x565e8e0582b620ee06618ee0b7705dc0e7f56dfd88b5eb3e008c0858f6f806d8 +test("parses swapped amounts case 3 (default)", async () => { + const transactionHash = + "0x565e8e0582b620ee06618ee0b7705dc0e7f56dfd88b5eb3e008c0858f6f806d8"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "8.15942", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + tokenOut: { + symbol: "WBTC", + amount: "0.00013188", + address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", + }, + }); +}); + +// https://etherscan.io/tx/0xd024750c7dcb99ace02c6b083c68d73dcfebdee252ccbeb1b83981b609693271 +test("parses swapped amounts case 4 (default)", async () => { + const transactionHash = + "0xd024750c7dcb99ace02c6b083c68d73dcfebdee252ccbeb1b83981b609693271"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "335.142587", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + tokenOut: { + symbol: "WETH", + amount: "0.105662100963455883", + address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + }, + }); +}); + +// https://etherscan.io/tx/0x4cbcf2e2512adb7e28f19f8cf28ddc29a9f9fea93c842cf3b735eeb526fe34b3 +test("parses swapped amounts case 5 (native sell token)", async () => { + const transactionHash = + "0x4cbcf2e2512adb7e28f19f8cf28ddc29a9f9fea93c842cf3b735eeb526fe34b3"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "ETH", + amount: "0.04", + address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + }, + tokenOut: { + symbol: "USDC", + amount: "126.580558", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + }); }); -it("throws an error if the chainId is not supported", () => { +// https://etherscan.io/tx/0x28c5bb3768bb64e81e1f3753ed1a8c30f0484a434d6c2b4af825d258ecb3bcf0 +test("parses swapped amounts case 6 (buy DNT 404 token)", async () => { + const transactionHash = + "0x28c5bb3768bb64e81e1f3753ed1a8c30f0484a434d6c2b4af825d258ecb3bcf0"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "95", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + tokenOut: { + symbol: "CHIB", + amount: "10.527633901274097318", + address: "0x7068263EDa099fB93BB3215c05e728c0b54b3137", + }, + }); +}); + +// https://etherscan.io/tx/0xb8beef6bf857f2fc22905b2872120abc634900b45941478aa9cf0ad1ceffcd67 +// https://gopluslabs.io/token-security/1/0xcf0c122c6b73ff809c693db761e7baebe62b6a2e +test("parses swapped amounts case 6 (buy FoT token, FLOKI)", async () => { + const transactionHash = + "0xb8beef6bf857f2fc22905b2872120abc634900b45941478aa9cf0ad1ceffcd67"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "31.580558", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + tokenOut: { + symbol: "FLOKI", + amount: "172036.330384861", + address: "0xcf0C122c6b73ff809C693DB761e7BaeBe62b6a2E", + }, + }); +}); + +// Gasless RFQ +// https://etherscan.io/tx/0x5dd4579b5709b405d6df935d516563e1db09453f37431639ae7e1358ec8f834d +test("parses swapped amounts from tx settled by gasless rfq)", async () => { + const transactionHash = + "0x5dd4579b5709b405d6df935d516563e1db09453f37431639ae7e1358ec8f834d"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "20", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + }, + tokenOut: { + symbol: "USDT", + amount: "11.604822", + address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", + }, + }); +}); + +// https://explorer.celo.org/tx/0x615c5089f772a8f2074750e8c6070013d288af7681435aba1771f6bfc63d1286 +test("throws an error for unsupported chains)", async () => { + const transactionHash = + "0x615c5089f772a8f2074750e8c6070013d288af7681435aba1771f6bfc63d1286"; + + const publicClient = createPublicClient({ + chain: mainnet, + transport: http("https://rpc.ankr.com/celo"), + }); + expect(async () => { await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://rpc.gnosis.gateway.fm", - transactionHash: - "0x2cd8904d385dbf4347c28062d8c20d1307202ee5e1d3aacf4b3fc067ca783a29", + publicClient, + transactionHash, }); - }).rejects.toThrowError("chainId 100 is unsupported…"); + }).rejects.toThrowError("chainId 42220 is unsupported…"); +}); + +// https://basescan.org/tx/0xa09cb1606e30c3aed8a842723fd6c23cecd838a59f750ab3dbc5ef2c7486e696 +test("parse a swap on Base (USDC for DAI)", async () => { + const publicClient = createPublicClient({ + chain: base, + transport: http( + `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0xa09cb1606e30c3aed8a842723fd6c23cecd838a59f750ab3dbc5ef2c7486e696"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "17.834287", + address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + }, + tokenOut: { + symbol: "DAI", + amount: "17.843596331665784515", + address: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb", + }, + }); +}); + +// https://basescan.org/tx/0xea8bca6e13f2c3e6c1e956308003b8d5da5fca44e03eac7ddbdcea271186ab37 +test("parse a swap on Base (DEGEN for ETH)", async () => { + const publicClient = createPublicClient({ + chain: base, + transport: http( + `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0xea8bca6e13f2c3e6c1e956308003b8d5da5fca44e03eac7ddbdcea271186ab37"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "DEGEN", + amount: "3173.454530222930443426", + address: "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed", + }, + tokenOut: { + symbol: "ETH", + amount: "0.006410046715601835", + address: NATIVE_ETH_ADDRESS, + }, + }); +}); + +// https://basescan.org/tx/0x9e81eee3f09b79fe1e3700fdb79bf78098b6073ec17e3524498177407ac33a00 +test("parse a swap on Base (ETH for BRETT)", async () => { + const publicClient = createPublicClient({ + chain: base, + transport: http( + `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0x9e81eee3f09b79fe1e3700fdb79bf78098b6073ec17e3524498177407ac33a00"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "ETH", + amount: "0.027500863104380774", + address: NATIVE_ETH_ADDRESS, + }, + tokenOut: { + symbol: "BRETT", + amount: "698.405912537092209301", + address: "0x532f27101965dd16442E59d40670FaF5eBB142E4", + }, + }); +}); + +// https://polygonscan.com/tx/0x438517b81f50858035f4b8e0870f5d797616509b5102c28814bcc378559c213d +test("parse a gasless approval + gasless swap on Polygon (USDC for MATIC)", async () => { + const publicClient = createPublicClient({ + chain: polygon, + transport: http( + `https://polygon-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0x438517b81f50858035f4b8e0870f5d797616509b5102c28814bcc378559c213d"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "7.79692", + address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + }, + tokenOut: { + symbol: "MATIC", + amount: "15.513683571865599415", + address: NATIVE_ETH_ADDRESS, + }, + }); +}); + +// https://basescan.org/tx/0x40fc248824e11c11debb307a68ba04ff0f068c67de07e6817f5405e055b91c44 +test("parse a gasless swap on Base (USDC for DEGEN)", async () => { + const publicClient = createPublicClient({ + chain: base, + transport: http( + `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0x40fc248824e11c11debb307a68ba04ff0f068c67de07e6817f5405e055b91c44"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "42.001841", + address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + }, + tokenOut: { + symbol: "DEGEN", + amount: "6570.195174245277347697", + address: "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed", + }, + }); +}); + +// https://basescan.org/tx/0x14416958953850c5c5a572d6e8cb832c032d0678b3ce9da6cdce891a20864b99 +test("parse a gasless swap on Base (USDC for ETH) for SettlerMetaTxn", async () => { + const publicClient = createPublicClient({ + chain: base, + transport: http( + `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0x14416958953850c5c5a572d6e8cb832c032d0678b3ce9da6cdce891a20864b99"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "21.27865", + address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + }, + tokenOut: { + symbol: "ETH", + amount: "0.006847116541535933", + address: NATIVE_ETH_ADDRESS, + }, + }); +}); + +// https://basescan.org/tx/0xe595dec22a7e2c2c5bdb0c1a7e59b2302ede72e5d2210c6cd7071222ea6dc2b2 +test("parse a gasless swap on Base (DEGEN for USDC) for SettlerMetaTxn", async () => { + const publicClient = createPublicClient({ + chain: base, + transport: http( + `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0xe595dec22a7e2c2c5bdb0c1a7e59b2302ede72e5d2210c6cd7071222ea6dc2b2"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "DEGEN", + amount: "1392.424785087824779911", + address: "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed", + }, + tokenOut: { + symbol: "USDC", + amount: "9.915288", + address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + }, + }); +}); + +// https://arbiscan.io/tx/0xb2c05194e4ec9ae0f82098ec82a606df544e87c8d6b7726bbb4b1dcc023cb9d7 +test("parse a gasless swap on on Arbitrum (ARB for ETH)", async () => { + const publicClient = createPublicClient({ + chain: arbitrum, + transport: http( + `https://arb-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0xb2c05194e4ec9ae0f82098ec82a606df544e87c8d6b7726bbb4b1dcc023cb9d7"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "ARB", + amount: "1.337", + address: "0x912CE59144191C1204E64559FE8253a0e49E6548", + }, + tokenOut: { + symbol: "ETH", + amount: "0.000304461782666722", + address: NATIVE_ETH_ADDRESS, + }, + }); +}); + +// https://optimistic.etherscan.io/tx/0xdfd5180c9f84d8f7381f48550dd14df86dd704489c251a10a67bd3cfdb0ae626 +test("parse a gasless swap on Optimism (USDC for OP) for executeMetaTxn", async () => { + const publicClient = createPublicClient({ + chain: optimism, + transport: http( + `https://opt-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0xdfd5180c9f84d8f7381f48550dd14df86dd704489c251a10a67bd3cfdb0ae626"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "5", + address: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + }, + tokenOut: { + symbol: "OP", + amount: "2.744026666231502743", + address: "0x4200000000000000000000000000000000000042", + }, + }); +}); + +// https://optimistic.etherscan.io/tx/0x9abc33ffc67ff9348af9a29f109c4f27b36ee5bc80dd81ae3814e69309449a61 +test("parse a gasless swap on Optimism (USDC for OP) for execute", async () => { + const publicClient = createPublicClient({ + chain: optimism, + transport: http( + `https://opt-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0x9abc33ffc67ff9348af9a29f109c4f27b36ee5bc80dd81ae3814e69309449a61"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "USDC", + amount: "5", + address: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + }, + tokenOut: { + symbol: "OP", + amount: "2.73214427938472425", + address: "0x4200000000000000000000000000000000000042", + }, + }); +}); + +// https://bscscan.com/tx/0xdda12da1e32c3320082355c985d6f2c6559169989de51e3cc83123395516c057 +test("parse a swap on BNB Chain (ETH for USDC) for execute", async () => { + const publicClient = createPublicClient({ + chain: optimism, + transport: http( + `https://bnb-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + }) as PublicClient; + + const transactionHash = + "0xdda12da1e32c3320082355c985d6f2c6559169989de51e3cc83123395516c057"; + + const result = await parseSwap({ + publicClient, + transactionHash, + }); + + expect(result).toEqual({ + tokenIn: { + symbol: "ETH", + amount: "0.728252933682622857", + address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + }, + tokenOut: { + symbol: "USDC", + amount: "2260.511889276471849176", + address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + }, + }); }); diff --git a/src/tests/multiplexBatchSellEthForToken.test.ts b/src/tests/multiplexBatchSellEthForToken.test.ts deleted file mode 100644 index 3d88422..0000000 --- a/src/tests/multiplexBatchSellEthForToken.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0xe59ff84284d7e2ad87f1a6de55d5d6600b0b721242110687847e57b52a045b7d -it("parses swap from multiplexBatchSellEthForToken", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0xe59ff84284d7e2ad87f1a6de55d5d6600b0b721242110687847e57b52a045b7d", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: NATIVE_ASSET.symbol, - amount: "10", - address: NATIVE_ASSET.address, - }, - tokenOut: { - symbol: "X2Y2", - amount: "90095.36724488341", - address: "0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9", - }, - }); -}); diff --git a/src/tests/multiplexBatchSellTokenForEth.test.ts b/src/tests/multiplexBatchSellTokenForEth.test.ts deleted file mode 100644 index ba3f14d..0000000 --- a/src/tests/multiplexBatchSellTokenForEth.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x0caebae93af96f83c4d2434816d079d1b43e9061dcaca8627bd9e2c0917a3b63 -it("parses swap from multiplexBatchSellTokenForEth", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x0caebae93af96f83c4d2434816d079d1b43e9061dcaca8627bd9e2c0917a3b63", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "BORING", - amount: "181533.55587344", - address: "0xBC19712FEB3a26080eBf6f2F7849b417FdD792CA", - }, - tokenOut: { - symbol: NATIVE_ASSET.symbol, - amount: "0.48027902546177326", - address: NATIVE_ASSET.address, - }, - }); -}); diff --git a/src/tests/multiplexBatchSellTokenForToken.test.ts b/src/tests/multiplexBatchSellTokenForToken.test.ts deleted file mode 100644 index 13cb4dc..0000000 --- a/src/tests/multiplexBatchSellTokenForToken.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0xb2c5a697a3126af96d2aa20ba6dcd0daaf9ec6baa49de2a76682dfe4258d2e56 - -it("parses swap from multiplexBatchSellTokenForToken", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0xb2c5a697a3126af96d2aa20ba6dcd0daaf9ec6baa49de2a76682dfe4258d2e56", - }); - - expect(data).toEqual({ - tokenIn: { - amount: "329656.871822", - symbol: "USDC", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - amount: "11.5568887", - symbol: "WBTC", - address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", - }, - }); -}); diff --git a/src/tests/multiplexMultiHopSellEthForToken.test.ts b/src/tests/multiplexMultiHopSellEthForToken.test.ts deleted file mode 100644 index de45c3d..0000000 --- a/src/tests/multiplexMultiHopSellEthForToken.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x00b191d47269265cfbbc94c77a114281ee939463b7a922e8bfbf7de8bc150c5c -it("parses swap from multiplexMultiHopSellEthForToken", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: "0x00b191d47269265cfbbc94c77a114281ee939463b7a922e8bfbf7de8bc150c5c", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: NATIVE_ASSET.symbol, - amount: "3", - address: NATIVE_ASSET.address, - }, - tokenOut: { - symbol: "XCAD", - amount: "2705.968001258040126473", - address: "0x7659CE147D0e714454073a5dd7003544234b6Aa0", - }, - }); -}); diff --git a/src/tests/multiplexMultiHopSellTokenForEth.test.ts b/src/tests/multiplexMultiHopSellTokenForEth.test.ts deleted file mode 100644 index 19004e3..0000000 --- a/src/tests/multiplexMultiHopSellTokenForEth.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0xba3a89b2164e5f169bc81e90a13f8946d110dffe2b53393953ea2a4fede8e81e -it("parses swap from multiplexMultiHopSellTokenForEth", async () => { - const data = await parseSwap({ - transactionHash: - "0xba3a89b2164e5f169bc81e90a13f8946d110dffe2b53393953ea2a4fede8e81e", - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "LSS", - amount: "20065.979484072366300492", - address: "0x3B9BE07d622aCcAEd78f479BC0EDabFd6397E320", - }, - tokenOut: { - symbol: NATIVE_ASSET.symbol, - amount: "3.305750792360646949", - address: NATIVE_ASSET.address, - }, - }); -}); diff --git a/src/tests/multiplexMultiHopSellTokenForToken.test.ts b/src/tests/multiplexMultiHopSellTokenForToken.test.ts deleted file mode 100644 index f60583d..0000000 --- a/src/tests/multiplexMultiHopSellTokenForToken.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0xf705df9127065ae8a8da3c1939d7096011ea13c81e4a2ed8c59ea1b039f7565d -it("parses swap from multiplexMultiHopSellTokenForToken", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: "0xf705df9127065ae8a8da3c1939d7096011ea13c81e4a2ed8c59ea1b039f7565d", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "LINK", - amount: "503.8124966", - address: "0x514910771AF9Ca656af840dff83E8264EcF986CA", - }, - tokenOut: { - symbol: "DAO", - amount: "2014.179756573835415392", - address: "0x0f51bb10119727a7e5eA3538074fb341F56B09Ad", - }, - }); -}); diff --git a/src/tests/parseSwapV2.test.ts b/src/tests/parseSwapV2.test.ts deleted file mode 100644 index cc67317..0000000 --- a/src/tests/parseSwapV2.test.ts +++ /dev/null @@ -1,601 +0,0 @@ -import { - http, - createPublicClient, - type PublicClient, - type Transport, - type Chain, -} from "viem"; -import { arbitrum, base, mainnet, optimism, polygon } from "viem/chains"; -import { test, expect } from "vitest"; -import { parseSwapV2 } from "../index"; -import { NATIVE_ASSET } from "../constants"; - -require("dotenv").config(); - -if (!process.env.ALCHEMY_API_KEY) { - throw new Error("An Alchemy API key is required."); -} - -const publicClient = createPublicClient({ - chain: mainnet, - transport: http( - `https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), -}); - -// https://etherscan.io/tx/0x2fc205711fc933ef6e5bcc0bf6e6a9bfc220b2d8073aea4f41305882f485669d -test("parses swapped amounts case 0 (default)", async () => { - const transactionHash = - "0x2fc205711fc933ef6e5bcc0bf6e6a9bfc220b2d8073aea4f41305882f485669d"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "KAI", - amount: "12124969884.736401754", - address: "0xA045Fe936E26e1e1e1Fb27C1f2Ae3643acde0171", - }, - tokenOut: { - symbol: "USDC", - amount: "340.919143", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - }); -}); - -// https://etherscan.io/tx/0x2b9a12398613887e9813594e8583f488f0e8392d8e6e0ba8d9e140065826dd00 -test("parses swapped amounts case 1 (default)", async () => { - const transactionHash = - "0x2b9a12398613887e9813594e8583f488f0e8392d8e6e0ba8d9e140065826dd00"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "30.084159", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "USDT", - amount: "30.069172", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - }); -}); - -// https://etherscan.io/tx/0x76b744ab42b05b30624bd5027b4f7da841cdc357bb1d6ee74e3d9e049dd8a126 -test("parses swapped amounts case 2 (default)", async () => { - const transactionHash = - "0x76b744ab42b05b30624bd5027b4f7da841cdc357bb1d6ee74e3d9e049dd8a126"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "1", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "WETH", - amount: "0.000280757770903965", - address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - }, - }); -}); - -// https://etherscan.io/tx/0x565e8e0582b620ee06618ee0b7705dc0e7f56dfd88b5eb3e008c0858f6f806d8 -test("parses swapped amounts case 3 (default)", async () => { - const transactionHash = - "0x565e8e0582b620ee06618ee0b7705dc0e7f56dfd88b5eb3e008c0858f6f806d8"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "8.15942", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "WBTC", - amount: "0.00013188", - address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", - }, - }); -}); - -// https://etherscan.io/tx/0xd024750c7dcb99ace02c6b083c68d73dcfebdee252ccbeb1b83981b609693271 -test("parses swapped amounts case 4 (default)", async () => { - const transactionHash = - "0xd024750c7dcb99ace02c6b083c68d73dcfebdee252ccbeb1b83981b609693271"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "335.142587", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "WETH", - amount: "0.105662100963455883", - address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - }, - }); -}); - -// https://etherscan.io/tx/0x4cbcf2e2512adb7e28f19f8cf28ddc29a9f9fea93c842cf3b735eeb526fe34b3 -test("parses swapped amounts case 5 (native sell token)", async () => { - const transactionHash = - "0x4cbcf2e2512adb7e28f19f8cf28ddc29a9f9fea93c842cf3b735eeb526fe34b3"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "ETH", - amount: "0.04", - address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", - }, - tokenOut: { - symbol: "USDC", - amount: "126.580558", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - }); -}); - -// https://etherscan.io/tx/0x28c5bb3768bb64e81e1f3753ed1a8c30f0484a434d6c2b4af825d258ecb3bcf0 -test("parses swapped amounts case 6 (buy DNT 404 token)", async () => { - const transactionHash = - "0x28c5bb3768bb64e81e1f3753ed1a8c30f0484a434d6c2b4af825d258ecb3bcf0"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "95", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "CHIB", - amount: "10.527633901274097318", - address: "0x7068263EDa099fB93BB3215c05e728c0b54b3137", - }, - }); -}); - -// https://etherscan.io/tx/0xb8beef6bf857f2fc22905b2872120abc634900b45941478aa9cf0ad1ceffcd67 -// https://gopluslabs.io/token-security/1/0xcf0c122c6b73ff809c693db761e7baebe62b6a2e -test("parses swapped amounts case 6 (buy FoT token, FLOKI)", async () => { - const transactionHash = - "0xb8beef6bf857f2fc22905b2872120abc634900b45941478aa9cf0ad1ceffcd67"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "31.580558", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "FLOKI", - amount: "172036.330384861", - address: "0xcf0C122c6b73ff809C693DB761e7BaeBe62b6a2E", - }, - }); -}); - -// Gasless RFQ -// https://etherscan.io/tx/0x5dd4579b5709b405d6df935d516563e1db09453f37431639ae7e1358ec8f834d -test("parses swapped amounts from tx settled by gasless rfq)", async () => { - const transactionHash = - "0x5dd4579b5709b405d6df935d516563e1db09453f37431639ae7e1358ec8f834d"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "20", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "USDT", - amount: "11.604822", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - }); -}); - -// https://explorer.celo.org/tx/0x615c5089f772a8f2074750e8c6070013d288af7681435aba1771f6bfc63d1286 -test("throws an error for unsupported chains)", async () => { - const transactionHash = - "0x615c5089f772a8f2074750e8c6070013d288af7681435aba1771f6bfc63d1286"; - - const publicClient = createPublicClient({ - chain: mainnet, - transport: http("https://rpc.ankr.com/celo"), - }); - - expect(async () => { - await parseSwapV2({ - publicClient, - transactionHash, - }); - }).rejects.toThrowError("chainId 42220 is unsupported…"); -}); - -// https://basescan.org/tx/0xa09cb1606e30c3aed8a842723fd6c23cecd838a59f750ab3dbc5ef2c7486e696 -test("parse a swap on Base (USDC for DAI)", async () => { - const publicClient = createPublicClient({ - chain: base, - transport: http( - `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0xa09cb1606e30c3aed8a842723fd6c23cecd838a59f750ab3dbc5ef2c7486e696"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "17.834287", - address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - }, - tokenOut: { - symbol: "DAI", - amount: "17.843596331665784515", - address: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb", - }, - }); -}); - -// https://basescan.org/tx/0xea8bca6e13f2c3e6c1e956308003b8d5da5fca44e03eac7ddbdcea271186ab37 -test("parse a swap on Base (DEGEN for ETH)", async () => { - const publicClient = createPublicClient({ - chain: base, - transport: http( - `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0xea8bca6e13f2c3e6c1e956308003b8d5da5fca44e03eac7ddbdcea271186ab37"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "DEGEN", - amount: "3173.454530222930443426", - address: "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed", - }, - tokenOut: { - symbol: "ETH", - amount: "0.006410046715601835", - address: NATIVE_ASSET.address, - }, - }); -}); - -// https://basescan.org/tx/0x9e81eee3f09b79fe1e3700fdb79bf78098b6073ec17e3524498177407ac33a00 -test("parse a swap on Base (ETH for BRETT)", async () => { - const publicClient = createPublicClient({ - chain: base, - transport: http( - `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0x9e81eee3f09b79fe1e3700fdb79bf78098b6073ec17e3524498177407ac33a00"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "ETH", - amount: "0.027500863104380774", - address: NATIVE_ASSET.address, - }, - tokenOut: { - symbol: "BRETT", - amount: "698.405912537092209301", - address: "0x532f27101965dd16442E59d40670FaF5eBB142E4", - }, - }); -}); - -// https://polygonscan.com/tx/0x438517b81f50858035f4b8e0870f5d797616509b5102c28814bcc378559c213d -test("parse a gasless approval + gasless swap on Polygon (USDC for MATIC)", async () => { - const publicClient = createPublicClient({ - chain: polygon, - transport: http( - `https://polygon-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0x438517b81f50858035f4b8e0870f5d797616509b5102c28814bcc378559c213d"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "7.79692", - address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - }, - tokenOut: { - symbol: "MATIC", - amount: "15.513683571865599415", - address: NATIVE_ASSET.address, - }, - }); -}); - -// https://basescan.org/tx/0x40fc248824e11c11debb307a68ba04ff0f068c67de07e6817f5405e055b91c44 -test("parse a gasless swap on Base (USDC for DEGEN)", async () => { - const publicClient = createPublicClient({ - chain: base, - transport: http( - `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0x40fc248824e11c11debb307a68ba04ff0f068c67de07e6817f5405e055b91c44"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "42.001841", - address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - }, - tokenOut: { - symbol: "DEGEN", - amount: "6570.195174245277347697", - address: "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed", - }, - }); -}); - -// https://basescan.org/tx/0x14416958953850c5c5a572d6e8cb832c032d0678b3ce9da6cdce891a20864b99 -test("parse a gasless swap on Base (USDC for ETH) for SettlerMetaTxn", async () => { - const publicClient = createPublicClient({ - chain: base, - transport: http( - `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0x14416958953850c5c5a572d6e8cb832c032d0678b3ce9da6cdce891a20864b99"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "21.27865", - address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - }, - tokenOut: { - symbol: "ETH", - amount: "0.006847116541535933", - address: NATIVE_ASSET.address, - }, - }); -}); - -// https://basescan.org/tx/0xe595dec22a7e2c2c5bdb0c1a7e59b2302ede72e5d2210c6cd7071222ea6dc2b2 -test("parse a gasless swap on Base (DEGEN for USDC) for SettlerMetaTxn", async () => { - const publicClient = createPublicClient({ - chain: base, - transport: http( - `https://base-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0xe595dec22a7e2c2c5bdb0c1a7e59b2302ede72e5d2210c6cd7071222ea6dc2b2"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "DEGEN", - amount: "1392.424785087824779911", - address: "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed", - }, - tokenOut: { - symbol: "USDC", - amount: "9.915288", - address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - }, - }); -}); - -// https://arbiscan.io/tx/0xb2c05194e4ec9ae0f82098ec82a606df544e87c8d6b7726bbb4b1dcc023cb9d7 -test("parse a gasless swap on on Arbitrum (ARB for ETH)", async () => { - const publicClient = createPublicClient({ - chain: arbitrum, - transport: http( - `https://arb-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0xb2c05194e4ec9ae0f82098ec82a606df544e87c8d6b7726bbb4b1dcc023cb9d7"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "ARB", - amount: "1.337", - address: "0x912CE59144191C1204E64559FE8253a0e49E6548", - }, - tokenOut: { - symbol: "ETH", - amount: "0.000304461782666722", - address: NATIVE_ASSET.address, - }, - }); -}); - -// https://optimistic.etherscan.io/tx/0xdfd5180c9f84d8f7381f48550dd14df86dd704489c251a10a67bd3cfdb0ae626 -test("parse a gasless swap on Optimism (USDC for OP) for executeMetaTxn", async () => { - const publicClient = createPublicClient({ - chain: optimism, - transport: http( - `https://opt-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0xdfd5180c9f84d8f7381f48550dd14df86dd704489c251a10a67bd3cfdb0ae626"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "5", - address: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - }, - tokenOut: { - symbol: "OP", - amount: "2.744026666231502743", - address: "0x4200000000000000000000000000000000000042", - }, - }); -}); - -// https://optimistic.etherscan.io/tx/0x9abc33ffc67ff9348af9a29f109c4f27b36ee5bc80dd81ae3814e69309449a61 -test("parse a gasless swap on Optimism (USDC for OP) for execute", async () => { - const publicClient = createPublicClient({ - chain: optimism, - transport: http( - `https://opt-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0x9abc33ffc67ff9348af9a29f109c4f27b36ee5bc80dd81ae3814e69309449a61"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "5", - address: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - }, - tokenOut: { - symbol: "OP", - amount: "2.73214427938472425", - address: "0x4200000000000000000000000000000000000042", - }, - }); -}); - -// https://bscscan.com/tx/0xdda12da1e32c3320082355c985d6f2c6559169989de51e3cc83123395516c057 -test("parse a swap on BNB Chain (ETH for USDC) for execute", async () => { - const publicClient = createPublicClient({ - chain: optimism, - transport: http( - `https://bnb-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - }) as PublicClient; - - const transactionHash = - "0xdda12da1e32c3320082355c985d6f2c6559169989de51e3cc83123395516c057"; - - const result = await parseSwapV2({ - publicClient, - transactionHash, - }); - - expect(result).toEqual({ - tokenIn: { - symbol: "ETH", - amount: "0.728252933682622857", - address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", - }, - tokenOut: { - symbol: "USDC", - amount: "2260.511889276471849176", - address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", - }, - }); -}); diff --git a/src/tests/permitAndCall.test.ts b/src/tests/permitAndCall.test.ts deleted file mode 100644 index d4571e0..0000000 --- a/src/tests/permitAndCall.test.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -const POLYGON_MAINNET_RPC = "https://rpc.ankr.com/polygon"; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -describe("permitAndCall", () => { - // https://etherscan.io/tx/0x142909f33e8b9882c73da6dc85193a81cd2bfa3bd39d485dd901d3b70e985ee4 - it("IERC2612: parses swap with permit and call on Ethereum with canonical permit", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x142909f33e8b9882c73da6dc85193a81cd2bfa3bd39d485dd901d3b70e985ee4", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "BAL", - amount: "50.883400023914484682", - address: "0xba100000625a3754423978a60c9317c58a424e3D", - }, - tokenOut: { - symbol: NATIVE_ASSET.symbol, - amount: "0.144785082557763087", - address: NATIVE_ASSET.address, - }, - }); - }); - - // https://polygonscan.com/tx/0xc020f1a4265c44474544c2b38bf086ab5f463c8bde4f5aa394db3d1429ad42b8 - it("IERC2612: parses swap with permit and call on Polygon with canonical permit", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: POLYGON_MAINNET_RPC, - transactionHash: - "0xc020f1a4265c44474544c2b38bf086ab5f463c8bde4f5aa394db3d1429ad42b8", - }); - - expect(data).toEqual({ - tokenIn: { - address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", - amount: "3.598205", - symbol: "USDC", - }, - tokenOut: { - address: "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590", - amount: "6.876078336435440124", - symbol: "STG", - }, - }); - }); - - // https://etherscan.io/tx/0x2e48f20033a45c7a7e1f926db51b1876c5a6a2042bf8e06b17ddbdd58f3b67ab - it("IERC20PermitAllowed: parses swap with permit and call on Ethereum with dai permit ", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x2e48f20033a45c7a7e1f926db51b1876c5a6a2042bf8e06b17ddbdd58f3b67ab", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "DAI", - amount: "2502.47", - address: "0x6B175474E89094C44Da98b954EedeAC495271d0F", - }, - tokenOut: { - symbol: "USDT", - amount: "2494.136763", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - }); - }); - - // https://polygonscan.com/tx/0x407f0ffe42963d2f68beeac39c71d6db1530a90c9716ed4643de116abefcc642 - it("IERC20MetaTransaction: parses swap with permit and call on Polygon with meta transaction", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: POLYGON_MAINNET_RPC, - transactionHash: - "0x407f0ffe42963d2f68beeac39c71d6db1530a90c9716ed4643de116abefcc642", - }); - - expect(data).toEqual({ - tokenIn: { - address: "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063", - amount: "1152.957063922541296658", - symbol: "DAI", - }, - tokenOut: { - address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", - amount: "0.714510898374948536", - symbol: "WETH", - }, - }); - }); -}); diff --git a/src/tests/sellEthForTokenToUniswapV3.test.ts b/src/tests/sellEthForTokenToUniswapV3.test.ts deleted file mode 100644 index 890cef1..0000000 --- a/src/tests/sellEthForTokenToUniswapV3.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { expect, it } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x54362c24134d62243ea80dd0e7f77f0c62718f25fbffc6caafdd7b52f702359c -it("parses swap from sellEthForTokenToUniswapV3", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x54362c24134d62243ea80dd0e7f77f0c62718f25fbffc6caafdd7b52f702359c", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "ETH", - amount: "0.098091206429872", - address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", - }, - tokenOut: { - symbol: "똥코인", - amount: "49330077428.84485198095946916", - address: "0x4208Aa4d7A9a10f4f8bb7f6400c1b2161D946969", - }, - }); -}); - -// https://etherscan.io/tx/0x93e0e2967309835c4eb5443b67b6c886839b6a5c0626d33c7df976153cb224d7 -it("parses swap from sellEthForTokenToUniswapV3", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x93e0e2967309835c4eb5443b67b6c886839b6a5c0626d33c7df976153cb224d7", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: NATIVE_ASSET.symbol, - amount: "0.12864375786794413", - address: NATIVE_ASSET.address, - }, - tokenOut: { - symbol: "CGPT", - amount: "3895.128022043192070174", - address: "0x25931894a86D47441213199621F1F2994e1c39Aa", - }, - }); -}); diff --git a/src/tests/sellToLiquidityProvider.test.ts b/src/tests/sellToLiquidityProvider.test.ts deleted file mode 100644 index d6c6ef9..0000000 --- a/src/tests/sellToLiquidityProvider.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x2a4379d531695dd4f142730edb7720bb9d06dfb405322e0e16acbfd8ba4fcb98 -it("parses swap from sellToLiquidityProvider", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x2a4379d531695dd4f142730edb7720bb9d06dfb405322e0e16acbfd8ba4fcb98", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "STG", - amount: "918.996239437320809884", - address: "0xAf5191B0De278C7286d6C7CC6ab6BB8A73bA2Cd6", - }, - tokenOut: { - symbol: "USDC", - amount: "692.783026", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - }); -}); diff --git a/src/tests/sellToPancakeSwap.test.ts b/src/tests/sellToPancakeSwap.test.ts deleted file mode 100644 index e739c9d..0000000 --- a/src/tests/sellToPancakeSwap.test.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -const BSC_RPC = "https://bsc-dataseed.binance.org"; - -// https://bscscan.com/tx/0x2076af859a54f5f0c7d4e1cd13b3906169a5e3697d8762b59062052d53466e94 -describe("sellToPancakeSwap", () => { - it("parses swap from sellToPancakeSwap", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: BSC_RPC, - transactionHash: - "0x2076af859a54f5f0c7d4e1cd13b3906169a5e3697d8762b59062052d53466e94", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "BUSD", - amount: "1155.41", - address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56", - }, - tokenOut: { - symbol: "WBNB", - amount: "1.82210243305633351", - address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", - }, - }); - }); - - // https://bscscan.com/tx/0x595b1684b8accec5fdd536dbdd9acb4ddcae9cfc21afcd65245d0a51a0e3582b - it("parses another swap from sellToPancakeSwap", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: BSC_RPC, - transactionHash: - "0x595b1684b8accec5fdd536dbdd9acb4ddcae9cfc21afcd65245d0a51a0e3582b", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "WBNB", - amount: "1.2", - address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", - }, - tokenOut: { - symbol: "BUSD", - amount: "319.903586514927545022", - address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56", - }, - }); - }); - - // https://bscscan.com/tx/0x0f95c3d8429b498a28ee194082e7394b63a595e0b9bd96b14c4895f1bd80cd9b - it("parses swap from sellToPancakeSwap with transfer events that transfer zero amounts", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: BSC_RPC, - transactionHash: - "0x0f95c3d8429b498a28ee194082e7394b63a595e0b9bd96b14c4895f1bd80cd9b", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "WBNB", - amount: "1.599214125294091218", - address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", - }, - tokenOut: { - symbol: "HELLO", - amount: "7022.195837990335108707", - address: "0x0F1cBEd8EFa0E012AdbCCB1638D0aB0147D5Ac00", - }, - }); - }); - - // https://bscscan.com/tx/0xba7e86dd27ba9b14cca0c98edc5df9c753ec8ae27ace3bacb80e87cbde33f850 - it("parses swap from sellToPancakeSwap with transfer events that transfer output amount to exchange proxy", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: BSC_RPC, - transactionHash: - "0xba7e86dd27ba9b14cca0c98edc5df9c753ec8ae27ace3bacb80e87cbde33f850", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "IDIA", - amount: "50", - address: "0x0b15Ddf19D47E6a86A56148fb4aFFFc6929BcB89", - }, - tokenOut: { - symbol: "WBNB", - amount: "0.011285266969864419", - address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", - }, - }); - }); -}); diff --git a/src/tests/sellToUniswap.test.ts b/src/tests/sellToUniswap.test.ts deleted file mode 100644 index baaf101..0000000 --- a/src/tests/sellToUniswap.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0xd6a7aeda4a2978c80b03700e3136c6895b48d08cd9c8d4c88dfd19dee0a12795 -it("parses a single hop swap from sellToUniswap", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0xd6a7aeda4a2978c80b03700e3136c6895b48d08cd9c8d4c88dfd19dee0a12795", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "WETH", - amount: "0.016858343555927415", - address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - }, - tokenOut: { - symbol: "USDT", - amount: "30.149999", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - }); -}); - -// https://etherscan.io/tx/0x380eebed81807391a70aac7f02cc852d441ccf0b7cf6538f7a472750e551720b -it("parses a multihop swap from sellToUniswap", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x380eebed81807391a70aac7f02cc852d441ccf0b7cf6538f7a472750e551720b", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "1000", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "SOLANA", - amount: "497767771055.529611406221129532", - address: "0x3D806324b6Df5AF3c1a81aCbA14A8A62Fe6D643F", - }, - }); -}); diff --git a/src/tests/sellTokenForEthToUniswapV3.test.ts b/src/tests/sellTokenForEthToUniswapV3.test.ts deleted file mode 100644 index bc1f7fb..0000000 --- a/src/tests/sellTokenForEthToUniswapV3.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x822d38c0746b19544cedddd9a1ebaacadd3e5da55dc293738ae135fc595e269b -describe("parseSwap", () => { - it("parses swap from sellTokenForEthToUniswapV3", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x822d38c0746b19544cedddd9a1ebaacadd3e5da55dc293738ae135fc595e269b", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "✺RUG", - amount: "56322.215316673764925169", - address: "0xD2d8D78087D0E43BC4804B6F946674b2Ee406b80", - }, - tokenOut: { - symbol: NATIVE_ASSET.symbol, - amount: "0.218304893918707078", - address: NATIVE_ASSET.address, - }, - }); - }); - - it("parses swap from sellTokenForEthToUniswapV3", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0xf6271c6ae709c31b2679f9190798bc64e636feb8b49d498e6239f171783884df", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "ETHFI", - amount: "609.2", - address: "0xFe0c30065B384F05761f15d0CC899D4F9F9Cc0eB", - }, - tokenOut: { - symbol: NATIVE_ASSET.symbol, - amount: "0.519590258364550926", - address: NATIVE_ASSET.address, - }, - }); - }); -}); diff --git a/src/tests/sellTokenForTokenToUniswapV3.test.ts b/src/tests/sellTokenForTokenToUniswapV3.test.ts deleted file mode 100644 index d347ab5..0000000 --- a/src/tests/sellTokenForTokenToUniswapV3.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { it, expect } from "vitest"; -import { parseSwap } from "../index"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi" - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -// https://etherscan.io/tx/0x90dbdd630287a0412f88cbc98b0d751bc81c613bb285898dac461b523cd07a5a -it("parses swap from sellTokenForTokenToUniswapV3", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x90dbdd630287a0412f88cbc98b0d751bc81c613bb285898dac461b523cd07a5a", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "USDC", - amount: "3500", - address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - }, - tokenOut: { - symbol: "CRV", - amount: "3490.286498060619473095", - address: "0xD533a949740bb3306d119CC777fa900bA034cd52", - }, - }); -}); diff --git a/src/tests/transformERC20.test.ts b/src/tests/transformERC20.test.ts deleted file mode 100644 index 43a12ff..0000000 --- a/src/tests/transformERC20.test.ts +++ /dev/null @@ -1,233 +0,0 @@ -import { it, expect, describe } from "vitest"; -import { parseSwap } from "../index"; -import { NATIVE_ASSET } from "../constants"; -import { transformERC20 } from "../parsers"; -import { exchangeProxyAbi } from "../abi/ExchangeProxyAbi"; - -require("dotenv").config(); - -const ETH_MAINNET_RPC = process.env.ETH_MAINNET_RPC; - -if (!ETH_MAINNET_RPC) { - throw new Error("Missing environment variable `ETH_MAINNET_RPC`"); -} - -describe("transformERC20", () => { - it("returns undefined when TransformedERC20 topic is not found in logs", async () => { - const result = await transformERC20({ - transaction: { chainId: 1 }, - transactionReceipt: { logs: [] }, - } as any); - - expect(result).toBeUndefined(); - }); -}); - -describe("transformERC20 on various networks", () => { - // https://etherscan.io/tx/0x30d015e87dd5481609eec1c54433b8d4679fe641034971baf648d4528a9b0a35 - it("Ethereum mainnet: parse a swap with native input asset", async () => { - const data = await parseSwap({ - transactionHash: - "0x30d015e87dd5481609eec1c54433b8d4679fe641034971baf648d4528a9b0a35", - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - }); - - expect(data).toEqual({ - tokenIn: { - address: NATIVE_ASSET.address, - symbol: NATIVE_ASSET.symbol, - amount: "332.666067836453233036", - }, - tokenOut: { - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - symbol: "USDT", - amount: "500000.317382", - }, - }); - }); - - // https://etherscan.io/tx/0x4db5b7168686cdfb1469b47a67f03fb6199aa81f3d2a26c4a05835b8752d152d - it("Ethereum mainnet: parse a swap with ERC-20 input asset", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: ETH_MAINNET_RPC, - transactionHash: - "0x4db5b7168686cdfb1469b47a67f03fb6199aa81f3d2a26c4a05835b8752d152d", - }); - - expect(data).toEqual({ - tokenIn: { - symbol: "USDT", - amount: "275", - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - }, - tokenOut: { - symbol: "MUTE", - amount: "183.067612917791449241", - address: "0xA49d7499271aE71cd8aB9Ac515e6694C755d400c", - }, - }); - }); - - // https://arbiscan.io/tx/0x3e48c1d1d3596ecfc1f9feb9e9613f5f5fc002b76743251c31eca8bc0aa30e21 - it("parse a swap on Arbitrum", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://arb1.arbitrum.io/rpc", - transactionHash: - "0x3e48c1d1d3596ecfc1f9feb9e9613f5f5fc002b76743251c31eca8bc0aa30e21", - }); - - expect(data).toEqual({ - tokenIn: { - address: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a", - amount: "36834.421293958495524657", - symbol: "GMX", - }, - tokenOut: { - address: NATIVE_ASSET.address, - amount: "1189.251717722346544033", - symbol: NATIVE_ASSET.symbol, - }, - }); - }); - - // https://optimistic.etherscan.io/tx/0x0d8125a0d77af877c5efd475e0b2a8aa7451c2b5b95e2918387f8a038aacd718 - it("parse a swap on Optimism", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://mainnet.optimism.io", - transactionHash: - "0x0d8125a0d77af877c5efd475e0b2a8aa7451c2b5b95e2918387f8a038aacd718", - }); - - expect(data).toEqual({ - tokenIn: { - address: NATIVE_ASSET.address, - amount: "51", - symbol: NATIVE_ASSET.symbol, - }, - tokenOut: { - address: "0x9A601C5bb360811d96A23689066af316a30c3027", - amount: "217794.381575767372449449", - symbol: "PIKA", - }, - }); - }); - - // https://snowtrace.io/tx/0x989436aff2791d355a08b87c9a97288699ed5a44a75897a963925b1922e12dbb - it("parse a swap on Avalanche", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://api.avax.network/ext/bc/C/rpc", - transactionHash: - "0x989436aff2791d355a08b87c9a97288699ed5a44a75897a963925b1922e12dbb", - }); - - expect(data).toEqual({ - tokenIn: { - address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - amount: "25650", - symbol: "USDC", - }, - tokenOut: { - address: "0x152b9d0FdC40C096757F570A51E494bd4b943E50", - amount: "0.99966847", - symbol: "BTC.b", - }, - }); - }); - - // https://ftmscan.com/tx/0xc48de1d0482475d76a13107b4d438605abe0d2223e75167fc46d6d6a54d954c2 - it("parse a swap on Fantom", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://rpc.ftm.tools", - transactionHash: - "0xc48de1d0482475d76a13107b4d438605abe0d2223e75167fc46d6d6a54d954c2", - }); - - expect(data).toEqual({ - tokenIn: { - address: NATIVE_ASSET.address, - amount: "375000", - symbol: "FTM", - }, - tokenOut: { - address: "0x04068DA6C83AFCFA0e13ba15A6696662335D5B75", - amount: "126441.837374", - symbol: "USDC", - }, - }); - }); - - // https://bscscan.com/tx/0x789d6d51ceb6d32407c97757e4be90c12f789927453413318178bed0ebc53bc0 - it("parse a swap on BNB Chain", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://rpc.ankr.com/bsc", - transactionHash: - "0x789d6d51ceb6d32407c97757e4be90c12f789927453413318178bed0ebc53bc0", - }); - - expect(data).toEqual({ - tokenIn: { - address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56", - amount: "400142.7162326532", - symbol: "BUSD", - }, - tokenOut: { - address: "0x55d398326f99059fF775485246999027B3197955", - amount: "399966.973708709289660215", - symbol: "USDT", - }, - }); - }); -}); - -// https://explorer.celo.org/tx/0x615c5089f772a8f2074750e8c6070013d288af7681435aba1771f6bfc63d1286 -it("parse a swap on Celo", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://rpc.ankr.com/celo", - transactionHash: - "0x615c5089f772a8f2074750e8c6070013d288af7681435aba1771f6bfc63d1286", - }); - - expect(data).toEqual({ - tokenIn: { - address: "0x765DE816845861e75A25fCA122bb6898B8B1282a", - amount: "500", - symbol: "cUSD", - }, - tokenOut: { - address: "0x74c0C58B99b68cF16A717279AC2d056A34ba2bFe", - amount: "23390.112524333224016754", - symbol: "SOURCE", - }, - }); -}); - -// https://basescan.org/tx/0x26ca796e654a3667957c25e7714c5d6d5de1fc845ebf98d8ee217f9f5e2c5f34 -it("parse a swap on Base", async () => { - const data = await parseSwap({ - exchangeProxyAbi, - rpcUrl: "https://mainnet.base.org", - transactionHash: - "0x26ca796e654a3667957c25e7714c5d6d5de1fc845ebf98d8ee217f9f5e2c5f34", - }); - - expect(data).toEqual({ - tokenIn: { - address: NATIVE_ASSET.address, - amount: "0.005446885313391051", - symbol: NATIVE_ASSET.symbol, - }, - tokenOut: { - address: "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", - amount: "10.049999", - symbol: "USDbC", - }, - }); -}); diff --git a/src/types.ts b/src/types.ts index 7507c34..fa0b160 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,38 +1,19 @@ -import { permitAndCallAbi } from "./abi/PermitAndCall"; -import { exchangeProxyAbi } from "./abi/ExchangeProxyAbi"; import type { Hex, Hash, Chain, Address, Transport, - Transaction, PublicClient, TransactionReceipt, } from "viem"; -export type PermitAndCallChainIds = 1 | 137 | 8453; +export type SupportedChainId = 1 | 10 | 56 | 137 | 8453 | 42161 | 43114; -export type SupportedChainId = - | 1 - | 5 - | 10 - | 56 - | 137 - | 250 - | 8453 - | 42220 - | 43114 - | 42161; - -export interface TransformERC20Args { - taker: Address; - inputToken: Address; - outputToken: Address; - inputTokenAmount: bigint; - outputTokenAmount: bigint; +export interface EnrichLogsArgs { + transactionReceipt: TransactionReceipt; + publicClient: PublicClient; } - export interface EnrichedLog { to: Address; from: Address; @@ -42,97 +23,37 @@ export interface EnrichedLog { decimals: number; } -export interface EnrichLogsArgs { - transactionReceipt: TransactionReceipt; - publicClient: PublicClient; -} - -export interface ParseSwapArgs { - rpcUrl: string; - transactionHash: Hash; - exchangeProxyAbi: typeof exchangeProxyAbi; +export interface Trace { + to: Address; + from: Address; + gas: Hex; + gasUsed: Hex; + input: "Hash"; + output: Hash; + calls: Trace[]; + value: Hex; + type: "CALL" | "STATICCALL" | "DELEGATECALL" | "CREATE" | "CREATE2"; } -type Token = { - symbol?: string; - amount: string; - address: string; -}; - -export type TokenTransaction = - | { - tokenIn: Token; - tokenOut: Token; - } - | undefined; - -export type ParserArgs = { - callData: Hex; - transaction: Transaction; - chainId: SupportedChainId; - transactionReceipt: TransactionReceipt; - exchangeProxyAbi: typeof exchangeProxyAbi; - publicClient: PublicClient; +export type TraceTransactionSchema = { + Parameters: [ + hash: Hash, + options: + | { + disableStorage?: boolean; + disableStack?: boolean; + enableMemory?: boolean; + enableReturnData?: boolean; + tracer?: string; + } + | { + timeout?: string; + tracerConfig?: { + onlyTopCall?: boolean; + withLog?: boolean; + }; + } + | undefined + ]; + ReturnType: Trace; }; - -type ParserFunction = ( - args: ParserArgs -) => TokenTransaction | Promise; - -export interface Parsers { - [key: string]: ParserFunction; -} - -export type ParseSwap = ( - args: ParseSwapArgs -) => Promise; - -export type PermitAndCall = Extract< - (typeof permitAndCallAbi)[number], - { name: "permitAndCall" } ->; - -export type ExecuteMetaTransaction = Extract< - (typeof exchangeProxyAbi)[number], - { name: "executeMetaTransaction" } ->; - -export type ExecuteMetaTransactionV2 = Extract< - (typeof exchangeProxyAbi)[number], - { name: "executeMetaTransactionV2" } ->; - -export type FillTakerSignedOtcOrder = Extract< - (typeof exchangeProxyAbi)[number], - { name: "fillTakerSignedOtcOrder" } ->; - -export type FillOtcOrderForEth = Extract< - (typeof exchangeProxyAbi)[number], - { name: "fillOtcOrderForEth" } ->; - -export type FillOtcOrderWithEth = Extract< - (typeof exchangeProxyAbi)[number], - { name: "fillOtcOrderWithEth" } ->; - -export type FillLimitOrder = Extract< - (typeof exchangeProxyAbi)[number], - { name: "fillLimitOrder" } ->; - -export type MultiplexBatchSellTokenForToken = Extract< - (typeof exchangeProxyAbi)[number], - { name: "multiplexBatchSellTokenForToken" } ->; - -export type MultiplexBatchSellEthForToken = Extract< - (typeof exchangeProxyAbi)[number], - { name: "multiplexBatchSellEthForToken" } ->; - -export type MultiplexBatchSellTokenForEth = Extract< - (typeof exchangeProxyAbi)[number], - { name: "multiplexBatchSellTokenForEth" } ->; diff --git a/src/utils/index.ts b/src/utils/index.ts index 3025074..9057ba5 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,69 +1,76 @@ -import { getAddress, formatUnits } from "viem"; -import { EVENT_SIGNATURES } from "../constants"; -import { minimalERC20Abi } from "../abi/MinimalERC20"; -import type { - EnrichedLog, - EnrichLogsArgs, - SupportedChainId, - PermitAndCallChainIds, -} from "../types"; - -function convertHexToAddress(hexString: string): string { - return `0x${hexString.slice(-40)}`; -} +import { fromHex, erc20Abi, getAddress, formatUnits, formatEther } from "viem"; +import type { Address } from "viem"; +import type { Trace, EnrichLogsArgs, SupportedChainId } from "../types"; export function isChainIdSupported( chainId: number ): chainId is SupportedChainId { - return [1, 5, 10, 56, 137, 250, 8453, 42220, 43114, 42161].includes(chainId); + return [1, 10, 56, 137, 8453, 42161, 43114].includes(chainId); } -export function isPermitAndCallChainId( - chainId: number -): chainId is PermitAndCallChainIds { - return [1, 137, 8453].includes(chainId); +export function extractNativeTransfer(trace: Trace, recipient: Address) { + let totalTransferred = 0n; + + function traverseCalls(calls: Trace[]) { + calls.forEach((call) => { + if ( + call.to.toLowerCase() === recipient.toLowerCase() && + fromHex(call.value, "bigint") > 0n + ) { + totalTransferred = totalTransferred + fromHex(call.value, "bigint"); + } + if (call.calls && call.calls.length > 0) { + traverseCalls(call.calls); + } + }); + } + + traverseCalls(trace.calls); + + return formatEther(totalTransferred); } export async function transferLogs({ publicClient, transactionReceipt, -}: EnrichLogsArgs): Promise { - // Extract logs from transaction receipt. +}: EnrichLogsArgs): Promise< + { + to: `0x${string}`; + from: `0x${string}`; + symbol: string; + amount: string; + address: `0x${string}`; + decimals: number; + }[] +> { + const EVENT_SIGNATURES = { + Transfer: + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + } as const; const { logs } = transactionReceipt; - - // Filter logs for the "Transfer" event signature. const transferLogsAddresses = logs .filter((log) => log.topics[0] === EVENT_SIGNATURES.Transfer) .map((log) => ({ ...log, address: getAddress(log.address) })); - - // Prepare contract queries for symbols and decimals. const contracts = [ ...transferLogsAddresses.map((log) => ({ - abi: minimalERC20Abi, + abi: erc20Abi, address: log.address, functionName: "symbol", })), ...transferLogsAddresses.map((log) => ({ - abi: minimalERC20Abi, + abi: erc20Abi, address: log.address, functionName: "decimals", })), ]; - - // Execute multicall to fetch symbols and decimals. const results = await publicClient.multicall({ contracts }); - - // There are two sets of results (symbol and decimals), each of the same length. - // They are concatenated, so the midpoint separates them. const midpoint = Math.floor(results.length / 2); - - // Enrich original logs with additional data (symbol, decimals) and - // format the transferred amount to a human-readable format. const enrichedLogs = transferLogsAddresses .map((log, index) => { const symbol = results[index].result as string; const decimals = results[midpoint + index].result as number; - const amount = formatUnits(BigInt(log.data), decimals); + const amount = + log.data === "0x" ? "0" : formatUnits(BigInt(log.data), decimals); const { address, topics } = log; const { 1: fromHex, 2: toHex } = topics; const from = getAddress(convertHexToAddress(fromHex)); @@ -76,20 +83,6 @@ export async function transferLogs({ return enrichedLogs; } -export function extractTokenInfo( - inputLog: EnrichedLog, - outputLog: EnrichedLog -) { - return { - tokenIn: { - symbol: inputLog.symbol, - amount: inputLog.amount, - address: getAddress(inputLog.address), - }, - tokenOut: { - symbol: outputLog.symbol, - amount: outputLog.amount, - address: getAddress(outputLog.address), - }, - }; +function convertHexToAddress(hexString: string): string { + return `0x${hexString.slice(-40)}`; } diff --git a/vite.config.ts b/vite.config.ts index 28b7369..810b5e4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,10 +1,10 @@ -import { defineConfig, configDefaults } from "vitest/config"; +import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - testTimeout: 10000, + testTimeout: 20000, coverage: { - exclude: ["examples/**"], + include: ["src/index.ts"], }, }, });