diff --git a/sdk/package-lock.json b/sdk/package-lock.json index e43d587f..c5def8cf 100644 --- a/sdk/package-lock.json +++ b/sdk/package-lock.json @@ -9,8 +9,8 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@coral-xyz/anchor": "^0.30.1", "@mysten/sui": "^1.13.0", - "@mysten/sui.js": "^0.54.1", "@uniswap/permit2-sdk": "^1.3.0", "ethers": "^6.13.4" }, @@ -51,6 +51,86 @@ "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" }, + "node_modules/@babel/runtime": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@coral-xyz/anchor": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.30.1.tgz", + "integrity": "sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ==", + "dependencies": { + "@coral-xyz/anchor-errors": "^0.30.1", + "@coral-xyz/borsh": "^0.30.1", + "@noble/hashes": "^1.3.1", + "@solana/web3.js": "^1.68.0", + "bn.js": "^5.1.2", + "bs58": "^4.0.1", + "buffer-layout": "^1.2.2", + "camelcase": "^6.3.0", + "cross-fetch": "^3.1.5", + "crypto-hash": "^1.3.0", + "eventemitter3": "^4.0.7", + "pako": "^2.0.3", + "snake-case": "^3.0.4", + "superstruct": "^0.15.4", + "toml": "^3.0.0" + }, + "engines": { + "node": ">=11" + } + }, + "node_modules/@coral-xyz/anchor-errors": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.30.1.tgz", + "integrity": "sha512-9Mkradf5yS5xiLWrl9WrpjqOrAV+/W2RQHDlbnAZBivoGpOs1ECjoDCkVk4aRG8ZdiFiB8zQEVlxf+8fKkmSfQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@coral-xyz/anchor/node_modules/base-x": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", + "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/@coral-xyz/anchor/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/@coral-xyz/anchor/node_modules/superstruct": { + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz", + "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==" + }, + "node_modules/@coral-xyz/borsh": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.30.1.tgz", + "integrity": "sha512-aaxswpPrCFKl8vZTbxLssA2RvwX2zmKLlRCIktJOwW+VpVwYtXRtlWiIP+c2pPRKneiTiWCN2GEMSH9j1zTlWQ==", + "dependencies": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@solana/web3.js": "^1.68.0" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -829,14 +909,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@mysten/bcs": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-0.11.1.tgz", - "integrity": "sha512-xP85isNSYUCHd3O/g+TmZYmg4wK6cU8q/n/MebkIGP4CYVJZz2wU/G24xIZ3wI+0iTop4dfgA5kYrg/DQKCUzA==", - "dependencies": { - "bs58": "^5.0.0" - } - }, "node_modules/@mysten/sui": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/@mysten/sui/-/sui-1.13.0.tgz", @@ -859,34 +931,6 @@ "node": ">=18" } }, - "node_modules/@mysten/sui.js": { - "version": "0.54.1", - "resolved": "https://registry.npmjs.org/@mysten/sui.js/-/sui.js-0.54.1.tgz", - "integrity": "sha512-TSmGIX7U9O/uS9EKIQdv7/S69KTbBhMJVelXCafJE6IJw8iB9cN9uLu0+uklkBSDrbRmLSEY70jMr3uRFjReIg==", - "deprecated": "This package has been renamed to @mysten/sui, please update to use the renamed package.", - "dependencies": { - "@graphql-typed-document-node/core": "^3.2.0", - "@mysten/bcs": "0.11.1", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1", - "@scure/bip32": "^1.3.1", - "@scure/bip39": "^1.2.1", - "@suchipi/femver": "^1.0.0", - "bech32": "^2.0.0", - "gql.tada": "^1.7.0", - "graphql": "^16.8.1", - "superstruct": "^1.0.3", - "tweetnacl": "^1.0.3" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/@mysten/sui.js/node_modules/bech32": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" - }, "node_modules/@mysten/sui/node_modules/@mysten/bcs": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-1.1.0.tgz", @@ -1029,11 +1073,117 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@solana/buffer-layout": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", + "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", + "dependencies": { + "buffer": "~6.0.3" + }, + "engines": { + "node": ">=5.10" + } + }, + "node_modules/@solana/web3.js": { + "version": "1.98.0", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.98.0.tgz", + "integrity": "sha512-nz3Q5OeyGFpFCR+erX2f6JPt3sKhzhYcSycBCSPkWjzSVDh/Rr1FqTVMRe58FKO16/ivTUcuJjeS5MyBvpkbzA==", + "dependencies": { + "@babel/runtime": "^7.25.0", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0", + "@solana/buffer-layout": "^4.0.1", + "agentkeepalive": "^4.5.0", + "bigint-buffer": "^1.1.5", + "bn.js": "^5.2.1", + "borsh": "^0.7.0", + "bs58": "^4.0.1", + "buffer": "6.0.3", + "fast-stable-stringify": "^1.0.0", + "jayson": "^4.1.1", + "node-fetch": "^2.7.0", + "rpc-websockets": "^9.0.2", + "superstruct": "^2.0.2" + } + }, + "node_modules/@solana/web3.js/node_modules/@noble/curves": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.7.0.tgz", + "integrity": "sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw==", + "dependencies": { + "@noble/hashes": "1.6.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@solana/web3.js/node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.0.tgz", + "integrity": "sha512-YUULf0Uk4/mAA89w+k3+yUYh6NrEvxZa5T6SY3wlMvE2chHkxFUUIDI8/XW1QSC357iA5pSnqt7XEhvFOqmDyQ==", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@solana/web3.js/node_modules/@noble/hashes": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz", + "integrity": "sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w==", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@solana/web3.js/node_modules/base-x": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", + "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/@solana/web3.js/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/@solana/web3.js/node_modules/superstruct": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz", + "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@suchipi/femver": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==" }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@swc/helpers/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, "node_modules/@tsconfig/node10": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", @@ -1058,6 +1208,14 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "22.7.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", @@ -1066,6 +1224,19 @@ "undici-types": "~6.19.2" } }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@uniswap/permit2-sdk": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@uniswap/permit2-sdk/-/permit2-sdk-1.3.0.tgz", @@ -1151,46 +1322,199 @@ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, - "node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" }, + "node_modules/bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.3.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, + "node_modules/borsh": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", + "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", + "dependencies": { + "bn.js": "^5.2.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "node_modules/borsh/node_modules/base-x": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", + "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/borsh/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, - "node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "base-x": "^4.0.0" + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-layout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", + "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", + "engines": { + "node": ">=4.5" + } + }, + "node_modules/bufferutil": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.9.tgz", + "integrity": "sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "node_modules/cross-fetch": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz", + "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==", + "dependencies": { + "node-fetch": "^2.7.0" + } + }, + "node_modules/crypto-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", + "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -1200,6 +1524,15 @@ "node": ">=0.3.1" } }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -1219,6 +1552,19 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, + "node_modules/es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", + "dependencies": { + "es6-promise": "^4.0.3" + } + }, "node_modules/ethers": { "version": "6.13.4", "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.4.tgz", @@ -1246,6 +1592,29 @@ "node": ">=14.0.0" } }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "node_modules/eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", + "engines": { + "node": "> 0.1.90" + } + }, + "node_modules/fast-stable-stringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", + "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==" + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, "node_modules/gql.tada": { "version": "1.8.10", "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.8.10.tgz", @@ -1291,16 +1660,137 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/jayson": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.1.3.tgz", + "integrity": "sha512-LtXh5aYZodBZ9Fc3j6f2w+MTNcnxteMOrb+QgIouguGOulWi0lieEkOUg+HkjjFs0DGoWDds6bi4E9hpNFLulQ==", + "dependencies": { + "@types/connect": "^3.4.33", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "uuid": "^8.3.2", + "ws": "^7.5.10" + }, + "bin": { + "jayson": "bin/jayson.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jayson/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" + }, + "node_modules/jayson/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "engines": [ + "node >= 0.2.0" + ] + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -1317,24 +1807,153 @@ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "optional": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, + "node_modules/rpc-websockets": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.0.4.tgz", + "integrity": "sha512-yWZWN0M+bivtoNLnaDbtny4XchdAIF5Q4g/ZsC5UC61Ckbp0QczwO8fg44rV3uYmY4WHd+EZQbn90W1d8ojzqQ==", + "dependencies": { + "@swc/helpers": "^0.5.11", + "@types/uuid": "^8.3.4", + "@types/ws": "^8.2.2", + "buffer": "^6.0.3", + "eventemitter3": "^5.0.1", + "uuid": "^8.3.2", + "ws": "^8.5.0" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "node_modules/rpc-websockets/node_modules/@types/ws": { + "version": "8.5.13", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz", + "integrity": "sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/rpc-websockets/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" }, - "node_modules/superstruct": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", - "integrity": "sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==", - "engines": { - "node": ">=14.0.0" + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" } }, + "node_modules/text-encoding-utf-8": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" }, + "node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -1405,6 +2024,27 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" }, + "node_modules/utf-8-validate": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -1416,6 +2056,20 @@ "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.36.0.tgz", "integrity": "sha512-CjF1XN4sUce8sBK9TixrDqFM7RwNkuXdJu174/AwmQUB62QbCQADg5lLe8ldBalFgtj1uKj+pKwDJiNo4Mn+eQ==" }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/ws": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", diff --git a/sdk/package.json b/sdk/package.json index 04d30e94..396fc606 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -15,6 +15,7 @@ "typescript": "^5.6.3" }, "dependencies": { + "@coral-xyz/anchor": "^0.30.1", "@mysten/sui": "^1.13.0", "@uniswap/permit2-sdk": "^1.3.0", "ethers": "^6.13.4" diff --git a/sdk/src/evm-intents.ts b/sdk/src/evm-intents.ts index cba7c55b..e4241b12 100644 --- a/sdk/src/evm-intents.ts +++ b/sdk/src/evm-intents.ts @@ -3,6 +3,7 @@ import { Contract } from '@ethersproject/contracts'; import { Wallet } from '@ethersproject/wallet'; import {SwapOrder} from "./swap-order" import fs from 'fs'; +import path from "path" import { PERMIT2_ADDRESS, PermitTransferFrom, SignatureTransfer, Witness } from '@uniswap/permit2-sdk'; import { _TypedDataEncoder } from '@ethersproject/hash' import { MaxUint256, Interface} from 'ethers'; @@ -45,7 +46,7 @@ export class EVMIntents{ constructor(address: string, provider: JsonRpcProvider, wallet: Wallet) { this.address = address; this.provider = provider; - this.abi = JSON.parse(fs.readFileSync('/home/andell/ICON/intent-contracts/contracts/evm/out/Intents.sol/Intents.json', 'utf8'))['abi']; + this.abi = JSON.parse(fs.readFileSync(path.join(__dirname, '../..', 'contracts/evm/out/Intents.sol/Intents.json'), 'utf8'))['abi']; this.wallet = wallet.connect(this.provider); this.intents = new Contract(this.address, this.abi, this.wallet); diff --git a/sdk/src/solana-intents.ts b/sdk/src/solana-intents.ts new file mode 100644 index 00000000..755e2140 --- /dev/null +++ b/sdk/src/solana-intents.ts @@ -0,0 +1,347 @@ +import * as anchor from "@coral-xyz/anchor"; +import { PublicKey, Connection, Keypair } from "@solana/web3.js"; + +import { Intent } from "../../contracts/solana/target/types/intent"; +import intentIdl from "../../contracts/solana/target/idl/intent.json"; +import { SwapOrder } from "./swap-order"; + +export class SolanaIntents { + wallet: anchor.Wallet; + connection: Connection; + provider: anchor.AnchorProvider; + intentProgram: anchor.Program; + intentPDA: IntentPDA; + + constructor(rpcUrl: string, keypair: Keypair) { + this.connection = new Connection(rpcUrl, "confirmed"); + this.wallet = new anchor.Wallet(keypair); + + this.provider = new anchor.AnchorProvider(this.connection, this.wallet); + anchor.setProvider(this.provider); + + this.intentProgram = new anchor.Program( + intentIdl as anchor.Idl, + this.provider + ) as unknown as anchor.Program; + this.intentPDA = new IntentPDA(this.intentProgram.programId); + } + + async fillOrder(swap: SwapOrder, solverAddress: string) { + const swapOrder = { + id: new anchor.BN(swap.id), + emitter: swap.emitter, + srcNid: swap.srcNID, + dstNid: swap.dstNID, + creator: swap.creator, + destinationAddress: swap.destinationAddress, + token: swap.token, + amount: new anchor.BN(swap.amount), + toToken: swap.toToken, + toAmount: new anchor.BN(swap.toAmount), + data: Buffer.from(swap.data), + }; + + const accounts = ( + await this.getFillAccounts( + swapOrder, + this.wallet.publicKey, + solverAddress + ) + ).accounts; + + return await this.intentProgram.methods + .fill(swapOrder, solverAddress.toString()) + .accountsStrict({ + signer: this.wallet.publicKey, + systemProgram: accounts[0].pubkey, + config: accounts[1].pubkey, + feeHandler: accounts[2].pubkey, + destinationAddress: accounts[3].pubkey, + orderFinished: accounts[4].pubkey, + feeHandlerTokenAccount: accounts[5].pubkey, + destinationTokenAccount: accounts[6].pubkey, + signerTokenAccount: accounts[7].pubkey, + mint: accounts[8].pubkey, + tokenProgram: accounts[9].pubkey, + associatedTokenProgram: accounts[10].pubkey, + }) + .remainingAccounts(accounts.slice(11)) + .signers([this.wallet.payer]) + .rpc({ + commitment: "confirmed", + }); + } + + async swap(swap: SwapOrder) { + const swapOrder = { + id: new anchor.BN(swap.id), + emitter: swap.emitter, + srcNid: swap.srcNID, + dstNid: swap.dstNID, + creator: swap.creator, + destinationAddress: swap.destinationAddress, + token: swap.token, + amount: new anchor.BN(swap.amount), + toToken: swap.toToken, + toAmount: new anchor.BN(swap.toAmount), + data: Buffer.from(swap.data), + }; + + const accounts = (await this.getSwapAccounts(swapOrder)).accounts; + + return await this.intentProgram.methods + .swap(swapOrder) + .accountsStrict({ + signer: this.wallet.publicKey, + systemProgram: accounts[0].pubkey, + config: accounts[1].pubkey, + orderAccount: accounts[2].pubkey, + vaultNativeAccount: accounts[3].pubkey, + vaultTokenAccount: accounts[4].pubkey, + signerTokenAccount: accounts[5].pubkey, + mint: accounts[6].pubkey, + tokenProgram: accounts[7].pubkey, + }) + .signers([this.wallet.payer]) + .rpc({ + commitment: "confirmed", + }); + } + + async getOrder(swap: SwapOrder) { + return ( + await this.intentProgram.account.orderAccount.fetch( + this.intentPDA.order( + this.wallet.publicKey, + swap.dstNID, + Number(swap.amount), + Number(swap.toAmount) + ).pda + ) + ).order; + } + + async getConfig() { + return await this.intentProgram.account.config.fetch( + this.intentPDA.config().pda + ); + } + + async airdrop(to: PublicKey, lamports: number) { + let aridropTx = await this.connection.requestAirdrop(to, lamports); + await this.connection.confirmTransaction(aridropTx, "confirmed"); + } + + async logParsedTx(txSignature: string) { + await this.sleep(2); + console.log( + await this.connection.getParsedTransaction(txSignature, { + commitment: "confirmed", + maxSupportedTransactionVersion: 0, + }) + ); + } + + async getBalance(address: PublicKey) { + return await this.connection.getBalance(address); + } + + async sleep(seconds: number) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); + } + + async getSwapAccounts(order: any) { + return await this.intentProgram.methods + .querySwapAccounts(order, 1, 30) + .accountsStrict({ + config: this.intentPDA.config().pda, + }) + .view({ commitment: "confirmed" }); + } + + async getFillAccounts(order: any, signer: PublicKey, solverAddress: string) { + return await this.intentProgram.methods + .queryFillAccounts(order, signer, solverAddress, 1, 30) + .accountsStrict({ + config: this.intentPDA.config().pda, + }) + .view({ commitment: "confirmed" }); + } + + async getCancelAccounts(order: any) { + return await this.intentProgram.methods + .queryCancelAccounts(order, 1, 30) + .accountsStrict({ + config: this.intentPDA.config().pda, + }) + .view({ commitment: "confirmed" }); + } + + async getRecvMessageAccounts( + srcNetwork: string, + connSn: number, + msg: Buffer + ) { + return await this.intentProgram.methods + .queryRecvMessageAccounts(srcNetwork, new anchor.BN(connSn), msg, 1, 30) + .accountsStrict({ + config: this.intentPDA.config().pda, + }) + .view({ commitment: "confirmed" }); + } + + async getSwapIx(swap: any) { + const accounts = (await this.getSwapAccounts(swap)).accounts; + + return await this.intentProgram.methods + .swap(swap) + .accountsStrict({ + signer: new PublicKey(swap.creator), + systemProgram: accounts[0].pubkey, + config: accounts[1].pubkey, + orderAccount: accounts[2].pubkey, + vaultNativeAccount: accounts[3].pubkey, + vaultTokenAccount: accounts[4].pubkey, + signerTokenAccount: accounts[5].pubkey, + mint: accounts[6].pubkey, + tokenProgram: accounts[7].pubkey, + }) + .instruction(); + } + + async getFillIx(swap: any, solverKey: PublicKey, solverAddress: string) { + const accounts = ( + await this.getFillAccounts(swap, solverKey, solverAddress) + ).accounts; + + return await this.intentProgram.methods + .fill(swap, solverAddress.toString()) + .accountsStrict({ + signer: solverKey, + systemProgram: accounts[0].pubkey, + config: accounts[1].pubkey, + feeHandler: accounts[2].pubkey, + destinationAddress: accounts[3].pubkey, + orderFinished: accounts[4].pubkey, + feeHandlerTokenAccount: accounts[5].pubkey, + destinationTokenAccount: accounts[6].pubkey, + signerTokenAccount: accounts[7].pubkey, + mint: accounts[8].pubkey, + tokenProgram: accounts[9].pubkey, + associatedTokenProgram: accounts[10].pubkey, + }) + .remainingAccounts(accounts.slice(11)) + .instruction(); + } + + async getCancelIx(swap: any) { + const accounts = (await this.getCancelAccounts(swap)).accounts; + + return await this.intentProgram.methods + .cancel(swap) + .accountsStrict({ + signer: new PublicKey(swap.creator), + systemProgram: accounts[0].pubkey, + config: accounts[1].pubkey, + orderAccount: accounts[2].pubkey, + orderFinished: accounts[3].pubkey, + }) + .instruction(); + } + + async getRecvMessageIx( + srcNetwork: string, + connSn: number, + message: Buffer, + signer: PublicKey + ) { + const accounts = ( + await this.getRecvMessageAccounts(srcNetwork, connSn, message) + ).accounts; + + return await this.intentProgram.methods + .recvMessage(srcNetwork, new anchor.BN(connSn), message) + .accountsStrict({ + signer: signer, + systemProgram: accounts[0].pubkey, + config: accounts[1].pubkey, + receipt: accounts[2].pubkey, + }) + .remainingAccounts(accounts.slice(3)) + .instruction(); + } +} + +export class IntentPDA { + programId: PublicKey; + + constructor(programId: PublicKey) { + this.programId = programId; + } + + config() { + let [pda, bump] = PublicKey.findProgramAddressSync( + [Buffer.from("config")], + this.programId + ); + + return { bump, pda }; + } + + order(creator: PublicKey, dstNID: string, amount: number, toAmount: number) { + let [pda, bump] = PublicKey.findProgramAddressSync( + [ + creator.toBuffer(), + Buffer.from(dstNID), + uint128ToArray(amount), + uint128ToArray(toAmount), + ], + this.programId + ); + + return { bump, pda }; + } + + vaultToken(mint: PublicKey) { + let [pda, bump] = PublicKey.findProgramAddressSync( + [Buffer.from("vault_token"), mint.toBuffer()], + this.programId + ); + + return { bump, pda }; + } + + vaultNative() { + let [pda, bump] = PublicKey.findProgramAddressSync( + [Buffer.from("vault_native")], + this.programId + ); + + return { bump, pda }; + } + + receipt(srcNID: string, connSn: number) { + let [pda, bump] = PublicKey.findProgramAddressSync( + [Buffer.from("receipt"), Buffer.from(srcNID), uint128ToArray(connSn)], + this.programId + ); + + return { bump, pda }; + } +} + +const uint128ToArray = (num: any) => { + if (typeof num === "string" || typeof num === "number") { + num = BigInt(num); + } else if (!(num instanceof BigInt)) { + throw new Error("Input must be a BigInt or convertible to a BigInt."); + } + + let buffer = new ArrayBuffer(16); + let view = new DataView(buffer); + + view.setBigUint64(0, num >> BigInt(64), false); + view.setBigUint64(8, num & BigInt("0xFFFFFFFFFFFFFFFF"), false); + + return new Uint8Array(buffer); +}; diff --git a/sdk/src/test.ts b/sdk/src/test.ts index 84d0dc4e..18898272 100644 --- a/sdk/src/test.ts +++ b/sdk/src/test.ts @@ -1,133 +1,258 @@ -import { SuiIntents } from './sui-intents'; -import { EVMIntents } from './evm-intents'; -import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'; -import { JsonRpcProvider } from '@ethersproject/providers'; -import { Wallet } from '@ethersproject/wallet'; -import fs from 'fs'; -import { SwapOrder } from "./swap-order"; +import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519"; +import { JsonRpcProvider } from "@ethersproject/providers"; +import { Wallet } from "@ethersproject/wallet"; import { assert } from "console"; +import * as anchor from "@coral-xyz/anchor"; +import fs from "fs"; +import os from "os"; +import path from "path"; + +import { SuiIntents } from "./sui-intents"; +import { EVMIntents } from "./evm-intents"; +import { SolanaIntents } from "./solana-intents"; +import { SwapOrder } from "./swap-order"; const getProvider = () => { - const providerUrl = "https://sepolia-rollup.arbitrum.io/rpc"; - return new JsonRpcProvider(providerUrl); + const providerUrl = "https://sepolia-rollup.arbitrum.io/rpc"; + return new JsonRpcProvider(providerUrl); }; -const arbNID = "0xaa37dc.arbitrum" -const suiNID = "sui" -const SUIToken = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI" -const ethToken = "0x0000000000000000000000000000000000000000" +const arbNID = "0xaa37dc.arbitrum"; +const suiNID = "sui"; +const SUIToken = + "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"; +const ethToken = "0x0000000000000000000000000000000000000000"; const intentContract = "0x1d70D0B9c6b0508E7Bd2B379735CFF035749f187"; -const packageId = "0x94de444d3260c2d2e18917545e01b2967dfb63d0b52cab76b2f6eef78a0bdf0e" -const storageId = "0x1036c7e8836a51e12ffde11ab578fc968f2f7b84e10bf9056fb85f1547a2eb79" +const packageId = + "0x94de444d3260c2d2e18917545e01b2967dfb63d0b52cab76b2f6eef78a0bdf0e"; +const storageId = + "0x1036c7e8836a51e12ffde11ab578fc968f2f7b84e10bf9056fb85f1547a2eb79"; -const keystore = fs.readFileSync('/home/andell/ICON/intent-contracts/contracts/evm/.keystores/balanced_testnet_eth', 'utf8'); -const password = '9re$u{}V-W'; +const keystore = fs.readFileSync( + path.join( + __dirname, + "../..", + "contracts/evm/.keystores/balanced_testnet_eth" + ), + "utf8" +); +const password = "9re$u{}V-W"; const evmWallet = Wallet.fromEncryptedJsonSync(keystore, password); -const evmAddress = evmWallet.address +const evmAddress = evmWallet.address; const evm = new EVMIntents(intentContract, getProvider(), evmWallet); -const keypair = Ed25519Keypair.fromSecretKey("suiprivkey1qrdjntsdyuygqjsx3varvvx2hz6xkuk86zu2y255s0zw97uavl82xjul9z6"); -const sui = new SuiIntents(packageId, storageId, "testnet", keypair) -const suiAddress = keypair.getPublicKey().toSuiAddress() - -const evmToSUI = async () => { - const evmReceiver = Wallet.createRandom().address; - const suiReceiver = Ed25519Keypair.generate().getPublicKey().toSuiAddress(); - const order = new SwapOrder( - BigInt(0), - intentContract, - arbNID, - suiNID, - evmAddress, - suiReceiver, - ethToken, - BigInt(100), - SUIToken, - BigInt(10000), - new Uint8Array() - ) - const tx = await evm.orderETHNative(order); - await tx.wait() - const createdOrder = await evm.getOrder(tx.hash); - - // order is set by contract - order.id = createdOrder.id - - assert(createdOrder.equals(order)) - - const digest = await sui.fillOrder(createdOrder, evmReceiver); - await sui.client.waitForTransaction({digest: digest.digest}) - const fill = await sui.getBalance(SUIToken, suiReceiver) - console.log("After fill", fill) - const fee = Number(order.toAmount)/Number(10000) - assert(Number(fill) == Number(order.toAmount) - fee) - - const start = Date.now(); - while (true) { - const payout = await evm.getBalance(ethToken, evmReceiver); - - // Check if the payout matches the order amount - if (payout === order.amount) { - - const duration = (Date.now() - start) / 1000; // Calculate the elapsed time in seconds - console.log(`payout passed in ${duration} seconds`); - return; // Exit the function if the assertion passes - } - - // Wait for a shorter interval before retrying - await new Promise(r => setTimeout(r, 1000)); // Retry every 1 second +const keypair = Ed25519Keypair.fromSecretKey( + "suiprivkey1qrdjntsdyuygqjsx3varvvx2hz6xkuk86zu2y255s0zw97uavl82xjul9z6" +); +const sui = new SuiIntents(packageId, storageId, "testnet", keypair); +const suiAddress = keypair.getPublicKey().toSuiAddress(); + +const solanaNID = "solana"; +const solanaToken = "11111111111111111111111111111111"; +const solanaKeypairFilePath = os.homedir + "/.config/solana/id.json"; +const solanaKeypair = anchor.web3.Keypair.fromSecretKey( + Buffer.from(JSON.parse(fs.readFileSync(solanaKeypairFilePath, "utf-8"))) +); +const solana = new SolanaIntents( + "https://api.devnet.solana.com", + solanaKeypair +); + +const evmToSUI = async () => { + const evmReceiver = Wallet.createRandom().address; + const suiReceiver = Ed25519Keypair.generate().getPublicKey().toSuiAddress(); + const order = new SwapOrder( + BigInt(0), + intentContract, + arbNID, + suiNID, + evmAddress, + suiReceiver, + ethToken, + BigInt(100), + SUIToken, + BigInt(10000), + new Uint8Array() + ); + const tx = await evm.orderETHNative(order); + await tx.wait(); + const createdOrder = await evm.getOrder(tx.hash); + + // order is set by contract + order.id = createdOrder.id; + + assert(createdOrder.equals(order)); + + const digest = await sui.fillOrder(createdOrder, evmReceiver); + await sui.client.waitForTransaction({ digest: digest.digest }); + const fill = await sui.getBalance(SUIToken, suiReceiver); + console.log("After fill", fill); + const fee = Number(order.toAmount) / Number(10000); + assert(Number(fill) == Number(order.toAmount) - fee); + + const start = Date.now(); + while (true) { + const payout = await evm.getBalance(ethToken, evmReceiver); + + // Check if the payout matches the order amount + if (payout === order.amount) { + const duration = (Date.now() - start) / 1000; // Calculate the elapsed time in seconds + console.log(`payout passed in ${duration} seconds`); + return; // Exit the function if the assertion passes } + + // Wait for a shorter interval before retrying + await new Promise((r) => setTimeout(r, 1000)); // Retry every 1 second + } }; +const SUIToEVM = async () => { + const evmReceiver = Wallet.createRandom().address; + const suiReceiver = Ed25519Keypair.generate().getPublicKey().toSuiAddress(); + const order = new SwapOrder( + BigInt(0), + storageId, + suiNID, + arbNID, + suiAddress, + evmReceiver, + SUIToken, + BigInt(100), + ethToken, + BigInt(10000), + new Uint8Array() + ); + const tx = await sui.createOrder(order); + const createdOrder = await sui.getOrder(tx.digest); + + order.id = createdOrder.id; + assert(createdOrder.equals(order)); + + const fillTx = await evm.fillOrder(createdOrder, suiReceiver); + await fillTx.wait(); + + const fill = await evm.getBalance(ethToken, evmReceiver); + const fee = (Number(order.toAmount) * 10) / 10000; + console.log(fill); + assert(Number(fill) == Number(order.toAmount) - fee); + const start = Date.now(); + while (true) { + const payout = await sui.getBalance(SUIToken, suiReceiver); -const SUIToEVM = async () => { - const evmReceiver = Wallet.createRandom().address; - const suiReceiver = Ed25519Keypair.generate().getPublicKey().toSuiAddress(); - const order = new SwapOrder( - BigInt(0), - storageId, - suiNID, - arbNID, - suiAddress, - evmReceiver, - SUIToken, - BigInt(100), - ethToken, - BigInt(10000), - new Uint8Array() - ) - const tx = await sui.createOrder(order); - const createdOrder = await sui.getOrder(tx.digest); - - order.id = createdOrder.id - assert(createdOrder.equals(order)) - - const fillTx = await evm.fillOrder(createdOrder, suiReceiver); - await fillTx.wait() - - const fill = await evm.getBalance(ethToken, evmReceiver); - const fee = (Number(order.toAmount)*10)/10000 - console.log(fill) - assert(Number(fill) == Number(order.toAmount) - fee) - const start = Date.now(); - while (true) { - const payout = await sui.getBalance(SUIToken, suiReceiver); - - // Check if the payout matches the order amount - if (payout === order.amount) { - - const duration = (Date.now() - start) / 1000; // Calculate the elapsed time in seconds - console.log(`payout passed in ${duration} seconds`); - return; // Exit the function if the assertion passes - } - - // Wait for a shorter interval before retrying - await new Promise(r => setTimeout(r, 1000)); // Retry every 1 second + // Check if the payout matches the order amount + if (payout === order.amount) { + const duration = (Date.now() - start) / 1000; // Calculate the elapsed time in seconds + console.log(`payout passed in ${duration} seconds`); + return; // Exit the function if the assertion passes } - //verify original funds released + // Wait for a shorter interval before retrying + await new Promise((r) => setTimeout(r, 1000)); // Retry every 1 second + } + //verify original funds released }; + +const evmToSolana = async () => { + const evmReceiver = Wallet.createRandom().address; + const solanaReceiver = anchor.web3.Keypair.generate().publicKey; + const order = new SwapOrder( + BigInt(0), + intentContract, + arbNID, + solanaNID, + evmAddress, + solanaReceiver.toString(), + ethToken, + BigInt(1289070000870000), + solanaToken, + BigInt(anchor.web3.LAMPORTS_PER_SOL * 100000000), + new Uint8Array() + ); + + const tx = await evm.orderETHNative(order); + await tx.wait(); + const createdOrder = await evm.getOrder(tx.hash); + + // order is set by contract + order.id = createdOrder.id; + + assert(createdOrder.equals(order)); + + const configAccount = await solana.getConfig(); + await solana.airdrop( + configAccount.feeHandler, + anchor.web3.LAMPORTS_PER_SOL * 2 + ); + + const fillTxHash = await solana.fillOrder(order, evmReceiver); + await solana.logParsedTx(fillTxHash); + + const fill = await solana.getBalance(solanaReceiver); + console.log("After fill", fill); + const fee = Number(order.toAmount) / Number(10000); + assert(Number(fill) == Number(order.toAmount) - fee); + + const start = Date.now(); + while (true) { + const payout = await evm.getBalance(ethToken, evmReceiver); + + // Check if the payout matches the order amount + if (payout === order.amount) { + const duration = (Date.now() - start) / 1000; // Calculate the elapsed time in seconds + console.log(`payout passed in ${duration} seconds`); + return; // Exit the function if the assertion passes + } + + // Wait for a shorter interval before retrying + await new Promise((r) => setTimeout(r, 1000)); // Retry every 1 second + } +}; + +const solanaToEVM = async () => { + const solanaReceiver = anchor.web3.Keypair.generate().publicKey; + const evmReceiver = Wallet.createRandom().address; + const order = new SwapOrder( + BigInt(0), + solana.intentProgram.programId.toString(), + solanaNID, + arbNID, + solanaKeypair.publicKey.toString(), + evmReceiver, + solanaToken, + BigInt(anchor.web3.LAMPORTS_PER_SOL * 10000), + ethToken, + BigInt(10000), + new Uint8Array() + ); + await solana.swap(order); + const createdOrder = await solana.getOrder(order); + order.id = BigInt(createdOrder.id.toNumber()); + + const fillTx = await evm.fillOrder(order, solanaReceiver.toString()); + await fillTx.wait(); + + const fill = await evm.getBalance(ethToken, evmReceiver); + console.log("After fill", fill); + + const start = Date.now(); + while (true) { + const payout = await solana.getBalance(solanaReceiver); + + // Check if the payout matches the order amount + if (payout === Number(order.amount)) { + const duration = (Date.now() - start) / 1000; // Calculate the elapsed time in seconds + console.log(`payout passed in ${duration} seconds`); + return; // Exit the function if the assertion passes + } + + // Wait for a shorter interval before retrying + await new Promise((r) => setTimeout(r, 1000)); // Retry every 1 second + } +}; + // evmToSUI(); SUIToEVM(); +// evmToSolana(); +// solanaToEVM() diff --git a/sdk/tsconfig.json b/sdk/tsconfig.json index 56a8ab81..ae16d7cb 100644 --- a/sdk/tsconfig.json +++ b/sdk/tsconfig.json @@ -40,7 +40,7 @@ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ + "resolveJsonModule": true, /* Enable importing .json files. */ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */