diff --git a/.changeset/shaggy-onions-remember.md b/.changeset/shaggy-onions-remember.md new file mode 100644 index 00000000..61eb155c --- /dev/null +++ b/.changeset/shaggy-onions-remember.md @@ -0,0 +1,12 @@ +--- +'@rosen-chains/ethereum': major +'@rosen-chains/abstract-chain': major +'@rosen-chains/binance': major +'@rosen-chains/bitcoin': major +'@rosen-chains/cardano': major +'@rosen-chains/doge': major +'@rosen-chains/ergo': major +'@rosen-chains/evm': major +--- + +Update rosen-extractor and token packages diff --git a/.changeset/shy-cups-drive.md b/.changeset/shy-cups-drive.md new file mode 100644 index 00000000..3c9faaaf --- /dev/null +++ b/.changeset/shy-cups-drive.md @@ -0,0 +1,7 @@ +--- +'@rosen-chains/ethereum': major +'@rosen-chains/binance': major +'@rosen-chains/evm': major +--- + +Removed `supportedTokens` from constructor arguments. Now, it is initialized by given TokenMap in constructor and can be updated using `updateSupportedTokens` function diff --git a/.gitignore b/.gitignore index a6b6c818..a4d8c033 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ coverage # TypeScript cache *.tsbuildinfo +.vscode diff --git a/package-lock.json b/package-lock.json index d7ac9c02..e0b16f8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -631,18 +631,16 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -747,9 +745,8 @@ }, "node_modules/@babel/parser": { "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.26.0" }, @@ -1203,9 +1200,8 @@ }, "node_modules/@babel/types": { "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -1259,8 +1255,6 @@ }, "node_modules/@cardano-ogmios/client": { "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@cardano-ogmios/client/-/client-6.6.0.tgz", - "integrity": "sha512-weCmjGd558Zyd41m/QljR7Wsxxq510ErTXb/pwbKyROazH7pLXzQQ+Q3ul6V6u/HYHInl126wEcJvWnr2rqQZA==", "license": "MPL-2.0", "dependencies": { "@cardano-ogmios/schema": "6.6.0", @@ -1280,8 +1274,6 @@ }, "node_modules/@cardano-ogmios/client/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==", "license": "MIT", "peerDependencies": { "ws": "*" @@ -1289,8 +1281,6 @@ }, "node_modules/@cardano-ogmios/client/node_modules/ws": { "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "license": "MIT", "engines": { "node": ">=8.3.0" @@ -1310,8 +1300,6 @@ }, "node_modules/@cardano-ogmios/schema": { "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@cardano-ogmios/schema/-/schema-6.6.0.tgz", - "integrity": "sha512-xrCUscstcg8+QMIiofXSTgBdtSIfV++qdSzIIl/v+NCNB1XrIxnqUKhlu3mfRibCLRVeP7c2Z2tTP6MBdFS/AQ==", "license": "MPL-2.0", "engines": { "node": ">=14" @@ -1319,8 +1307,6 @@ }, "node_modules/@cardanosolutions/json-bigint": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@cardanosolutions/json-bigint/-/json-bigint-1.0.1.tgz", - "integrity": "sha512-mbYL6jtHqMFCZnTFhmkmoeDzHMBino0gMiGQnOJE7CwzZzkK2HCpH0MTBk+84QDadMEGX7iFt7uB+levm1a+bQ==", "license": "MIT", "dependencies": { "bignumber.js": "^9.0.0" @@ -2422,8 +2408,7 @@ }, "node_modules/@gar/promisify": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "license": "MIT", "optional": true }, "node_modules/@graphql-codegen/cli": { @@ -3444,8 +3429,7 @@ }, "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==", + "license": "ISC", "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -3460,8 +3444,7 @@ }, "node_modules/@isaacs/cliui/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==", + "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -3476,8 +3459,9 @@ }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -3513,15 +3497,13 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -3699,8 +3681,7 @@ }, "node_modules/@npmcli/fs": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", - "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "license": "ISC", "optional": true, "dependencies": { "@gar/promisify": "^1.0.1", @@ -3709,8 +3690,7 @@ }, "node_modules/@npmcli/fs/node_modules/semver": { "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", "optional": true, "bin": { "semver": "bin/semver.js" @@ -3721,9 +3701,7 @@ }, "node_modules/@npmcli/move-file": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", - "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", - "deprecated": "This functionality has been moved to @npmcli/fs", + "license": "MIT", "optional": true, "dependencies": { "mkdirp": "^1.0.4", @@ -3776,8 +3754,7 @@ }, "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==", + "license": "MIT", "optional": true, "engines": { "node": ">=14" @@ -3804,10 +3781,62 @@ } } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.29.1.tgz", + "integrity": "sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.29.1.tgz", + "integrity": "sha512-CaRfrV0cd+NIIcVVN/jx+hVLN+VRqnuzLRmfmlzpOzB87ajixsN/+9L5xNmkaUUvEbI5BmIKS+XTwXsHEb65Ew==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.29.1.tgz", + "integrity": "sha512-2ORr7T31Y0Mnk6qNuwtyNmy14MunTAMx06VAPI6/Ju52W10zk1i7i5U3vlDRWjhOI5quBcrvhkCHyF76bI7kEw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.29.1.tgz", + "integrity": "sha512-j/Ej1oanzPjmN0tirRd5K2/nncAhS9W6ICzgxV+9Y5ZsP0hiGhHJXZ2JQ53iSSjj8m6cRY6oB1GMzNn2EUt6Ng==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.24.4.tgz", - "integrity": "sha512-py5oNShCCjCyjWXCZNrRGRpjWsF0ic8f4ieBNra5buQz0O/U6mMXCpC1LvrHuhJsNPgRt36tSYMidGzZiJF6mw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.29.1.tgz", + "integrity": "sha512-91C//G6Dm/cv724tpt7nTyP+JdN12iqeXGFM1SqnljCmi5yTXriH7B1r8AD9dAZByHpKAumqP1Qy2vVNIdLZqw==", "cpu": [ "arm64" ], @@ -3818,9 +3847,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.24.4.tgz", - "integrity": "sha512-L7VVVW9FCnTTp4i7KrmHeDsDvjB4++KOBENYtNYAiYl96jeBThFfhP6HVxL74v4SiZEVDH/1ILscR5U9S4ms4g==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.29.1.tgz", + "integrity": "sha512-hEioiEQ9Dec2nIRoeHUP6hr1PSkXzQaCUyqBDQ9I9ik4gCXQZjJMIVzoNLBRGet+hIUb3CISMh9KXuCcWVW/8w==", "cpu": [ "x64" ], @@ -3830,10 +3859,177 @@ "freebsd" ] }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.29.1.tgz", + "integrity": "sha512-Py5vFd5HWYN9zxBv3WMrLAXY3yYJ6Q/aVERoeUFwiDGiMOWsMs7FokXihSOaT/PMWUty/Pj60XDQndK3eAfE6A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.29.1.tgz", + "integrity": "sha512-RiWpGgbayf7LUcuSNIbahr0ys2YnEERD4gYdISA06wa0i8RALrnzflh9Wxii7zQJEB2/Eh74dX4y/sHKLWp5uQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.29.1.tgz", + "integrity": "sha512-Z80O+taYxTQITWMjm/YqNoe9d10OX6kDh8X5/rFCMuPqsKsSyDilvfg+vd3iXIqtfmp+cnfL1UrYirkaF8SBZA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.29.1.tgz", + "integrity": "sha512-fOHRtF9gahwJk3QVp01a/GqS4hBEZCV1oKglVVq13kcK3NeVlS4BwIFzOHDbmKzt3i0OuHG4zfRP0YoG5OF/rA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.29.1.tgz", + "integrity": "sha512-5a7q3tnlbcg0OodyxcAdrrCxFi0DgXJSoOuidFUzHZ2GixZXQs6Tc3CHmlvqKAmOs5eRde+JJxeIf9DonkmYkw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.29.1.tgz", + "integrity": "sha512-9b4Mg5Yfz6mRnlSPIdROcfw1BU22FQxmfjlp/CShWwO3LilKQuMISMTtAu/bxmmrE6A902W2cZJuzx8+gJ8e9w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.29.1.tgz", + "integrity": "sha512-G5pn0NChlbRM8OJWpJFMX4/i8OEU538uiSv0P6roZcbpe/WfhEO+AT8SHVKfp8qhDQzaz7Q+1/ixMy7hBRidnQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.29.1.tgz", + "integrity": "sha512-WM9lIkNdkhVwiArmLxFXpWndFGuOka4oJOZh8EP3Vb8q5lzdSCBuhjavJsw68Q9AKDGeOOIHYzYm4ZFvmWez5g==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.29.1.tgz", + "integrity": "sha512-87xYCwb0cPGZFoGiErT1eDcssByaLX4fc0z2nRM6eMtV9njAfEE6OW3UniAoDhX4Iq5xQVpE6qO9aJbCFumKYQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.29.1.tgz", + "integrity": "sha512-xufkSNppNOdVRCEC4WKvlR1FBDyqCSCpQeMMgv9ZyXqqtKBfkw1yfGMTUTs9Qsl6WQbJnsGboWCp7pJGkeMhKA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.29.1.tgz", + "integrity": "sha512-F2OiJ42m77lSkizZQLuC+jiZ2cgueWQL5YC9tjo3AgaEw+KJmVxHGSyQfDUoYR9cci0lAywv2Clmckzulcq6ig==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.29.1.tgz", + "integrity": "sha512-rYRe5S0FcjlOBZQHgbTKNrqxCBUmgDJem/VQTCcTnA2KCabYSWQDrytOzX7avb79cAAweNmMUb/Zw18RNd4mng==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.29.1.tgz", + "integrity": "sha512-+10CMg9vt1MoHj6x1pxyjPSMjHTIlqs8/tBztXvPAx24SKs9jwVnKqHJumlH/IzhaPUaj3T6T6wfZr8okdXaIg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@rosen-bridge/abstract-extractor": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-extractor/-/abstract-extractor-0.3.0.tgz", - "integrity": "sha512-Ty2CRgNKc0JzHbiDUfYxQy53fDNALJiQgsDYBapZGSTfqgl8wPm3yQytp7cpIDBwfgQGD3Y2wE+UEwRgjwQNbA==", "license": "GPL-3.0", "dependencies": { "@rosen-bridge/abstract-logger": "^1.0.0", @@ -3846,28 +4042,19 @@ "node": ">=20.11.0" } }, - "node_modules/@rosen-bridge/abstract-logger": { + "node_modules/@rosen-bridge/abstract-extractor/node_modules/@rosen-bridge/abstract-logger": { "version": "1.0.0", "license": "GPL-3.0" }, - "node_modules/@rosen-bridge/address-codec": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@rosen-bridge/address-codec/-/address-codec-0.4.0.tgz", - "integrity": "sha512-YjHEXDytiTw7UAfDhyKbFIvrubKQr295qf5X5PF3CQjqhRC/Po1wE+j/FLc6eRK1IU++5G8AkICH8WDuek35KQ==", - "dependencies": { - "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0", - "bitcoinjs-lib": "^6.1.5", - "ergo-lib-wasm-nodejs": "^0.24.1", - "ethers": "^6.13.2" - }, - "engines": { - "node": ">=20.11.0" - } + "node_modules/@rosen-bridge/abstract-logger": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", + "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" }, "node_modules/@rosen-bridge/bitcoin-utxo-selection": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-utxo-selection/-/bitcoin-utxo-selection-0.2.2.tgz", - "integrity": "sha512-Qn8k1l8lBuZvtSvtM7z5rN0s6JqjH1b6FCj5HzV8fQhgBjql6AJt9nNCUlXOm9dwO95DkWuJv0Cp0Hs8752ABg==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/bitcoin-utxo-selection/-/bitcoin-utxo-selection-0.3.0.tgz", + "integrity": "sha512-kaTMUvinp9XHlid5/6AHfMQVwfCw3JkPk7a/4zNNEaBLMwUUP3RMzrRHZ7QUW8U0AOD1/jH+adfFdKgafgElYQ==", "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1" }, @@ -3875,11 +4062,6 @@ "node": ">=20.11.0" } }, - "node_modules/@rosen-bridge/bitcoin-utxo-selection/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "node_modules/@rosen-bridge/changeset-formatter": { "version": "0.1.0", "dev": true, @@ -3890,8 +4072,6 @@ }, "node_modules/@rosen-bridge/evm-address-tx-extractor": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@rosen-bridge/evm-address-tx-extractor/-/evm-address-tx-extractor-1.0.3.tgz", - "integrity": "sha512-TJ477VN7Xt3HMVaXbzHZH/tZ7IXr+v9KF2fkTqnarEpcI7Imb3GPT8DsxvB75w+2TNJv0wUqjKkebRaMvf+xCg==", "license": "GPL-3.0", "dependencies": { "@rosen-bridge/abstract-extractor": "^0.3.0", @@ -3904,6 +4084,10 @@ "node": ">=20.11.0" } }, + "node_modules/@rosen-bridge/evm-address-tx-extractor/node_modules/@rosen-bridge/abstract-logger": { + "version": "1.0.0", + "license": "GPL-3.0" + }, "node_modules/@rosen-bridge/json-bigint": { "version": "0.1.0", "license": "GPL-3.0", @@ -3916,8 +4100,7 @@ }, "node_modules/@rosen-bridge/minimum-fee": { "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@rosen-bridge/minimum-fee/-/minimum-fee-2.2.2.tgz", - "integrity": "sha512-WZxIh0W7LneOtAp4aECtSbnhOATdHlmKjuKf6NAWZ7BL+sawYuykXfpLvD2p7Vo/lEv4jLAX+ELf5W2mWBjbeQ==", + "license": "GPL-3.0", "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", "@rosen-bridge/json-bigint": "^0.1.0", @@ -3929,38 +4112,8 @@ "node": ">=18.16.1" } }, - "node_modules/@rosen-bridge/minimum-fee/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, - "node_modules/@rosen-bridge/rosen-extractor": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/rosen-extractor/-/rosen-extractor-6.3.1.tgz", - "integrity": "sha512-NBI6I85u4DNHB3bvyNFaEIIYSCMMIY6K2DWp0rxThvcsATmAeAa54o2w9qHOeOqA3iaRiHVRp9TSkiV+bSVEug==", - "dependencies": { - "@blockfrost/blockfrost-js": "^5.4.0", - "@cardano-ogmios/schema": "^6.0.3", - "@rosen-bridge/abstract-logger": "^2.0.1", - "@rosen-bridge/address-codec": "^0.4.0", - "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/tokens": "^1.2.1", - "bitcoinjs-lib": "^6.1.5", - "ergo-lib-wasm-nodejs": "^0.24.1", - "ethers": "^6.11.1", - "json-bigint": "^1.0.0", - "lodash-es": "^4.17.21" - } - }, - "node_modules/@rosen-bridge/rosen-extractor/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "node_modules/@rosen-bridge/scanner": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@rosen-bridge/scanner/-/scanner-4.1.2.tgz", - "integrity": "sha512-DX0x1jeNjWVnnu8Z2pku6IGN35JTUYxJkFJn5UERGOaXFiwtNmQCeg4v1qp4uFmQ4MP/NaFqCiIcVHXUXXqLJg==", "license": "GPL-3.0", "dependencies": { "@apollo/client": "^3.8.7", @@ -3981,20 +4134,17 @@ "typeorm": "^0.3.20" } }, + "node_modules/@rosen-bridge/scanner/node_modules/@rosen-bridge/abstract-logger": { + "version": "1.0.0", + "license": "GPL-3.0" + }, "node_modules/@rosen-bridge/scanner/node_modules/cross-fetch": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", "license": "MIT", "dependencies": { "node-fetch": "^2.6.12" } }, - "node_modules/@rosen-bridge/tokens": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/tokens/-/tokens-1.2.1.tgz", - "integrity": "sha512-sWn2XMQvzLKRZTlw3mlZZWLGy81XzFEJuLu/WBPq0EyHy2eXFSOacID7uwvD+EIoldfwwraX1bv/+u3gY0gKHw==" - }, "node_modules/@rosen-chains/abstract-chain": { "resolved": "packages/abstract-chain", "link": true @@ -4027,6 +4177,10 @@ "resolved": "packages/networks/cardano-koios", "link": true }, + "node_modules/@rosen-chains/doge": { + "resolved": "packages/chains/doge", + "link": true + }, "node_modules/@rosen-chains/ergo": { "resolved": "packages/chains/ergo", "link": true @@ -4071,8 +4225,7 @@ }, "node_modules/@rosen-clients/ergo-explorer": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@rosen-clients/ergo-explorer/-/ergo-explorer-1.1.2.tgz", - "integrity": "sha512-GHTBgGZlPbiHfpJs0X/2v+9Ern5hlDaNIHNAgse2iDDvOu1jdpDpY+bpnHtWiLcUKJWUfV2RjBnBxpHMyHAUKQ==", + "license": "GPL-3.0", "dependencies": { "@rosen-clients/axios": "^0.1.0" } @@ -4096,8 +4249,7 @@ }, "node_modules/@sqltools/formatter": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", - "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" + "license": "MIT" }, "node_modules/@swc/core": { "version": "1.3.57", @@ -4144,8 +4296,7 @@ }, "node_modules/@tootallnate/once": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "license": "MIT", "optional": true, "engines": { "node": ">= 6" @@ -4167,9 +4318,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/http-cache-semantics": { @@ -4183,8 +4334,6 @@ }, "node_modules/@types/json-bigint": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.4.tgz", - "integrity": "sha512-ydHooXLbOmxBbubnA7Eh+RpBzuaIiQjh8WGJYQB50JFGFrdxW7JzVlyEV7fAXw0T2sqJ1ysTneJbiyNLqZRAag==", "license": "MIT" }, "node_modules/@types/json-schema": { @@ -4210,9 +4359,8 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz", - "integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==", + "version": "20.17.9", + "license": "MIT", "dependencies": { "undici-types": "~6.19.2" } @@ -4518,9 +4666,9 @@ "license": "ISC" }, "node_modules/@vitest/coverage-istanbul": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/coverage-istanbul/-/coverage-istanbul-2.1.4.tgz", - "integrity": "sha512-NLmfjzXnRSmLF/h4hYkzjvd7hZ85DRZzPUqXu0McPFCMczDfNmOjMoM3KaxjFaEmOc1YzX9HHbU/Rr9VO+35ow==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/coverage-istanbul/-/coverage-istanbul-2.1.8.tgz", + "integrity": "sha512-cSaCd8KcWWvgDwEJSXm0NEWZ1YTiJzjicKHy+zOEbUm0gjbbkz+qJf1p8q71uBzSlS7vdnZA8wRLeiwVE3fFTA==", "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.3", @@ -4538,210 +4686,43 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "2.1.4" + "vitest": "2.1.8" } }, - "node_modules/@vitest/coverage-istanbul/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/@vitest/expect": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/coverage-istanbul/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "node_modules/@vitest/pretty-format": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", "dev": true, "dependencies": { - "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" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@vitest/coverage-istanbul/node_modules/istanbul-lib-instrument": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", - "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", - "dev": true, - "dependencies": { - "@babel/core": "^7.23.9", - "@babel/parser": "^7.23.9", - "@istanbuljs/schema": "^0.1.3", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@vitest/coverage-istanbul/node_modules/istanbul-lib-source-maps": { - "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", - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@vitest/coverage-istanbul/node_modules/minimatch": { - "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": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@vitest/coverage-istanbul/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/@vitest/coverage-istanbul/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@vitest/coverage-istanbul/node_modules/test-exclude": { - "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": "^10.4.1", - "minimatch": "^9.0.4" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@vitest/expect": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.4.tgz", - "integrity": "sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==", - "dev": true, - "dependencies": { - "@vitest/spy": "2.1.4", - "@vitest/utils": "2.1.4", - "chai": "^5.1.2", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/expect/node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/@vitest/expect/node_modules/chai": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", - "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", - "dev": true, - "dependencies": { - "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": ">=12" - } - }, - "node_modules/@vitest/expect/node_modules/check-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", - "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", - "dev": true, - "engines": { - "node": ">= 16" - } - }, - "node_modules/@vitest/expect/node_modules/deep-eql": { - "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, - "engines": { - "node": ">=6" - } - }, - "node_modules/@vitest/expect/node_modules/loupe": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", - "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", - "dev": true - }, - "node_modules/@vitest/expect/node_modules/pathval": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", - "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", - "dev": true, - "engines": { - "node": ">= 14.16" - } - }, - "node_modules/@vitest/pretty-format": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.4.tgz", - "integrity": "sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==", - "dev": true, - "dependencies": { - "tinyrainbow": "^1.2.0" + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.4.tgz", - "integrity": "sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", "dev": true, "dependencies": { - "@vitest/utils": "2.1.4", + "@vitest/utils": "2.1.8", "pathe": "^1.1.2" }, "funding": { @@ -4749,12 +4730,12 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.4.tgz", - "integrity": "sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", "dev": true, "dependencies": { - "@vitest/pretty-format": "2.1.4", + "@vitest/pretty-format": "2.1.8", "magic-string": "^0.30.12", "pathe": "^1.1.2" }, @@ -4763,9 +4744,9 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.4.tgz", - "integrity": "sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", "dev": true, "dependencies": { "tinyspy": "^3.0.2" @@ -4774,22 +4755,13 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/spy/node_modules/tinyspy": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", - "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@vitest/utils": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.4.tgz", - "integrity": "sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", "dev": true, "dependencies": { - "@vitest/pretty-format": "2.1.4", + "@vitest/pretty-format": "2.1.8", "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, @@ -4797,12 +4769,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/utils/node_modules/loupe": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", - "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", - "dev": true - }, "node_modules/@whatwg-node/events": { "version": "0.0.3", "dev": true, @@ -4864,12 +4830,11 @@ }, "node_modules/abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC", "optional": true }, "node_modules/acorn": { - "version": "8.11.2", + "version": "8.14.0", "dev": true, "license": "MIT", "bin": { @@ -4904,8 +4869,7 @@ }, "node_modules/agentkeepalive": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", - "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "license": "MIT", "optional": true, "dependencies": { "humanize-ms": "^1.2.1" @@ -4985,28 +4949,23 @@ }, "node_modules/any-promise": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + "license": "MIT" }, "node_modules/app-root-path": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", - "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "license": "MIT", "engines": { "node": ">= 6.0.0" } }, "node_modules/aproba": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC", "optional": true }, "node_modules/are-we-there-yet": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", - "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", - "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "delegates": "^1.0.0", @@ -5108,6 +5067,15 @@ "node": ">=12.0.0" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/astral-regex": { "version": "2.0.0", "dev": true, @@ -5144,8 +5112,6 @@ }, "node_modules/await-semaphore": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/await-semaphore/-/await-semaphore-0.1.3.tgz", - "integrity": "sha512-d1W2aNSYcz/sxYO4pMGX9vq65qOTu0P800epMud+6cYYX0QcT7zyqcxec3VWzpgvdXo57UWmVbZpLMjX2m1I7Q==", "license": "MIT" }, "node_modules/axios": { @@ -5249,8 +5215,7 @@ }, "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==", + "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" } @@ -5425,16 +5390,16 @@ }, "node_modules/cac": { "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/cacache": { "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "license": "ISC", "optional": true, "dependencies": { "@npmcli/fs": "^1.0.0", @@ -5462,8 +5427,7 @@ }, "node_modules/cacache/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", "optional": true, "dependencies": { "yallist": "^4.0.0" @@ -5474,8 +5438,7 @@ }, "node_modules/cacache/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", "optional": true }, "node_modules/cacheable-lookup": { @@ -5619,6 +5582,22 @@ "node": ">=12.19" } }, + "node_modules/chai": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", + "dev": true, + "dependencies": { + "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": ">=12" + } + }, "node_modules/chalk": { "version": "5.2.0", "dev": true, @@ -5671,10 +5650,18 @@ "dev": true, "license": "MIT" }, + "node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "engines": { + "node": ">= 16" + } + }, "node_modules/chownr": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", "engines": { "node": ">=10" } @@ -5714,8 +5701,7 @@ }, "node_modules/cli-highlight": { "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "license": "ISC", "dependencies": { "chalk": "^4.0.0", "highlight.js": "^10.7.1", @@ -5734,8 +5720,7 @@ }, "node_modules/cli-highlight/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5748,8 +5733,7 @@ }, "node_modules/cli-highlight/node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5878,8 +5862,7 @@ }, "node_modules/color-support": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", "optional": true, "bin": { "color-support": "bin.js" @@ -5923,8 +5906,7 @@ }, "node_modules/console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", "optional": true }, "node_modules/constant-case": { @@ -6028,8 +6010,7 @@ }, "node_modules/dayjs": { "version": "1.11.11", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", - "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" + "license": "MIT" }, "node_modules/debounce": { "version": "1.2.1", @@ -6038,8 +6019,7 @@ }, "node_modules/debug": { "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -6106,10 +6086,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/deep-eql": { + "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, + "engines": { + "node": ">=6" + } + }, "node_modules/deep-extend": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", "engines": { "node": ">=4.0.0" } @@ -6176,8 +6164,7 @@ }, "node_modules/delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", "optional": true }, "node_modules/dependency-graph": { @@ -6198,8 +6185,7 @@ }, "node_modules/detect-libc": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", - "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", "engines": { "node": ">=8" } @@ -6268,8 +6254,7 @@ }, "node_modules/encoding": { "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", "optional": true, "dependencies": { "iconv-lite": "^0.6.2" @@ -6277,8 +6262,7 @@ }, "node_modules/encoding/node_modules/iconv-lite": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", "optional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -6327,8 +6311,7 @@ }, "node_modules/env-paths": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", "optional": true, "engines": { "node": ">=6" @@ -6340,8 +6323,7 @@ }, "node_modules/err-code": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT", "optional": true }, "node_modules/error-ex": { @@ -6412,6 +6394,12 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true + }, "node_modules/es-set-tostringtag": { "version": "2.0.2", "dev": true, @@ -6556,12 +6544,11 @@ }, "node_modules/esbuild/node_modules/@esbuild/darwin-x64": { "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.18.tgz", - "integrity": "sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -7155,8 +7142,6 @@ }, "node_modules/ethers": { "version": "6.13.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.2.tgz", - "integrity": "sha512-9VkriTTed+/27BGuY1s0hf441kqwHJ1wtN2edksEtiRvXx+soxRX3iSXTfFqq2+YwrOqbDoTHjIhQnjJRlzKmg==", "funding": [ { "type": "individual", @@ -7201,8 +7186,6 @@ }, "node_modules/ethers/node_modules/ws": { "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "license": "MIT", "engines": { "node": ">=10.0.0" @@ -7244,8 +7227,7 @@ }, "node_modules/expand-template": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", "engines": { "node": ">=6" } @@ -7265,10 +7247,9 @@ "license": "MIT" }, "node_modules/extensionless": { - "version": "1.9.6", - "resolved": "https://registry.npmjs.org/extensionless/-/extensionless-1.9.6.tgz", - "integrity": "sha512-40F6zThJu1MxaT1A1pJ/2SHlU1BPYYnQNHt0j2ZlPuxxm2ddMcNc1D7uS/LGc4K3VwMEMaZLkCdHWaKk0LnQXA==", - "dev": true + "version": "1.9.9", + "dev": true, + "license": "MIT" }, "node_modules/external-editor": { "version": "3.1.0", @@ -7429,8 +7410,7 @@ }, "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==" + "license": "MIT" }, "node_modules/fill-range": { "version": "7.0.1", @@ -7512,8 +7492,7 @@ }, "node_modules/foreground-child": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "license": "ISC", "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -7527,8 +7506,7 @@ }, "node_modules/foreground-child/node_modules/signal-exit": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", "engines": { "node": ">=14" }, @@ -7550,8 +7528,7 @@ }, "node_modules/fs-constants": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + "license": "MIT" }, "node_modules/fs-extra": { "version": "7.0.1", @@ -7568,8 +7545,7 @@ }, "node_modules/fs-minipass": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", "dependencies": { "minipass": "^3.0.0" }, @@ -7584,10 +7560,8 @@ }, "node_modules/fsevents": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -7631,9 +7605,7 @@ }, "node_modules/gauge": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -7651,8 +7623,7 @@ }, "node_modules/gauge/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==", + "license": "MIT", "optional": true, "engines": { "node": ">=8" @@ -7660,14 +7631,12 @@ }, "node_modules/gauge/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==", + "license": "MIT", "optional": true }, "node_modules/gauge/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==", + "license": "MIT", "optional": true, "engines": { "node": ">=8" @@ -7675,8 +7644,7 @@ }, "node_modules/gauge/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==", + "license": "MIT", "optional": true, "dependencies": { "emoji-regex": "^8.0.0", @@ -7689,8 +7657,7 @@ }, "node_modules/gauge/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==", + "license": "MIT", "optional": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -7761,8 +7728,7 @@ }, "node_modules/github-from-package": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + "license": "MIT" }, "node_modules/glob": { "version": "7.2.3", @@ -8055,8 +8021,7 @@ }, "node_modules/has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", "optional": true }, "node_modules/hasown": { @@ -8081,8 +8046,7 @@ }, "node_modules/highlight.js": { "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "license": "BSD-3-Clause", "engines": { "node": "*" } @@ -8105,8 +8069,9 @@ }, "node_modules/html-escaper": { "version": "2.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true }, "node_modules/http-cache-semantics": { "version": "4.1.1", @@ -8162,8 +8127,7 @@ }, "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==", + "license": "MIT", "optional": true, "dependencies": { "ms": "^2.0.0" @@ -8272,8 +8236,7 @@ }, "node_modules/infer-owner": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "license": "ISC", "optional": true }, "node_modules/inflight": { @@ -8291,8 +8254,7 @@ }, "node_modules/ini": { "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "license": "ISC" }, "node_modules/inquirer": { "version": "8.2.6", @@ -8429,8 +8391,7 @@ }, "node_modules/ip-address": { "version": "9.0.5", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", - "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", "optional": true, "dependencies": { "jsbn": "1.1.0", @@ -8442,8 +8403,7 @@ }, "node_modules/ip-address/node_modules/sprintf-js": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause", "optional": true }, "node_modules/is-absolute": { @@ -8580,8 +8540,7 @@ }, "node_modules/is-lambda": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "license": "MIT", "optional": true }, "node_modules/is-lower-case": { @@ -8810,16 +8769,46 @@ }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=8" } }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/istanbul-lib-report": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -8829,6 +8818,20 @@ "node": ">=10" } }, + "node_modules/istanbul-lib-source-maps": { + "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", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/istanbul-reports": { "version": "3.1.7", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", @@ -8852,8 +8855,7 @@ }, "node_modules/jackspeak": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", - "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -8900,8 +8902,7 @@ }, "node_modules/jsbn": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", - "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT", "optional": true }, "node_modules/jsesc": { @@ -9413,6 +9414,12 @@ "loose-envify": "cli.js" } }, + "node_modules/loupe": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", + "dev": true + }, "node_modules/lower-case": { "version": "2.0.2", "dev": true, @@ -9445,9 +9452,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.12", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", - "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" @@ -9466,8 +9473,9 @@ }, "node_modules/make-dir": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.5.3" }, @@ -9478,24 +9486,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/lru-cache": { - "version": "6.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/make-dir/node_modules/semver": { - "version": "7.5.4", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -9503,15 +9498,9 @@ "node": ">=10" } }, - "node_modules/make-dir/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/make-fetch-happen": { "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "license": "ISC", "optional": true, "dependencies": { "agentkeepalive": "^4.1.3", @@ -9537,8 +9526,7 @@ }, "node_modules/make-fetch-happen/node_modules/agent-base": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", "optional": true, "dependencies": { "debug": "4" @@ -9549,8 +9537,7 @@ }, "node_modules/make-fetch-happen/node_modules/http-proxy-agent": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "license": "MIT", "optional": true, "dependencies": { "@tootallnate/once": "1", @@ -9563,8 +9550,7 @@ }, "node_modules/make-fetch-happen/node_modules/https-proxy-agent": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", "optional": true, "dependencies": { "agent-base": "6", @@ -9576,8 +9562,7 @@ }, "node_modules/make-fetch-happen/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", "optional": true, "dependencies": { "yallist": "^4.0.0" @@ -9588,8 +9573,7 @@ }, "node_modules/make-fetch-happen/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", "optional": true }, "node_modules/map-cache": { @@ -9755,8 +9739,7 @@ }, "node_modules/minimist": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -9776,8 +9759,7 @@ }, "node_modules/minipass": { "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -9787,8 +9769,7 @@ }, "node_modules/minipass-collect": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -9799,8 +9780,7 @@ }, "node_modules/minipass-fetch": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", - "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "license": "MIT", "optional": true, "dependencies": { "minipass": "^3.1.0", @@ -9816,8 +9796,7 @@ }, "node_modules/minipass-flush": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -9828,8 +9807,7 @@ }, "node_modules/minipass-pipeline": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -9840,8 +9818,7 @@ }, "node_modules/minipass-sized": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -9852,13 +9829,11 @@ }, "node_modules/minipass/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "license": "ISC" }, "node_modules/minizlib": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -9869,8 +9844,7 @@ }, "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "license": "ISC" }, "node_modules/mixme": { "version": "0.5.10", @@ -9882,8 +9856,7 @@ }, "node_modules/mkdirp": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" }, @@ -9893,13 +9866,11 @@ }, "node_modules/mkdirp-classic": { "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + "license": "MIT" }, "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==" + "license": "MIT" }, "node_modules/mute-stream": { "version": "0.0.8", @@ -9908,8 +9879,7 @@ }, "node_modules/mz": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", @@ -9938,8 +9908,7 @@ }, "node_modules/napi-build-utils": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -9953,8 +9922,7 @@ }, "node_modules/negotiator": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", "optional": true, "engines": { "node": ">= 0.6" @@ -9971,8 +9939,7 @@ }, "node_modules/node-abi": { "version": "3.62.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", - "integrity": "sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==", + "license": "MIT", "dependencies": { "semver": "^7.3.5" }, @@ -9982,8 +9949,7 @@ }, "node_modules/node-abi/node_modules/semver": { "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -9993,8 +9959,7 @@ }, "node_modules/node-addon-api": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", - "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "license": "MIT", "engines": { "node": "^16 || ^18 || >= 20" } @@ -10019,8 +9984,7 @@ }, "node_modules/node-gyp": { "version": "8.4.1", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", - "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "license": "MIT", "optional": true, "dependencies": { "env-paths": "^2.2.0", @@ -10043,8 +10007,7 @@ }, "node_modules/node-gyp/node_modules/semver": { "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", "optional": true, "bin": { "semver": "bin/semver.js" @@ -10072,8 +10035,7 @@ }, "node_modules/nopt": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", "optional": true, "dependencies": { "abbrev": "1" @@ -10149,9 +10111,7 @@ }, "node_modules/npmlog": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "are-we-there-yet": "^3.0.0", @@ -10471,21 +10431,18 @@ }, "node_modules/parse5": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + "license": "MIT" }, "node_modules/parse5-htmlparser2-tree-adapter": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "license": "MIT", "dependencies": { "parse5": "^6.0.1" } }, "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + "license": "MIT" }, "node_modules/pascal-case": { "version": "3.1.2", @@ -10554,8 +10511,7 @@ }, "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==", + "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -10569,16 +10525,14 @@ }, "node_modules/path-scurry/node_modules/lru-cache": { "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "license": "ISC", "engines": { "node": "14 || >=16.14" } }, "node_modules/path-scurry/node_modules/minipass": { "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } @@ -10597,11 +10551,19 @@ "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true }, + "node_modules/pathval": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "dev": true, + "engines": { + "node": ">= 14.16" + } + }, "node_modules/picocolors": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", @@ -10693,9 +10655,7 @@ } }, "node_modules/postcss": { - "version": "8.4.47", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", - "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "version": "8.4.49", "dev": true, "funding": [ { @@ -10711,9 +10671,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.1.0", + "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, "engines": { @@ -10722,8 +10683,7 @@ }, "node_modules/prebuild-install": { "version": "7.1.2", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", - "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "license": "MIT", "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", @@ -10791,14 +10751,12 @@ }, "node_modules/promise-inflight": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "license": "ISC", "optional": true }, "node_modules/promise-retry": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "license": "MIT", "optional": true, "dependencies": { "err-code": "^2.0.2", @@ -10897,8 +10855,7 @@ }, "node_modules/rc": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -10911,8 +10868,7 @@ }, "node_modules/rc/node_modules/strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11079,8 +11035,6 @@ }, "node_modules/reflect-metadata": { "version": "0.1.14", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz", - "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==", "license": "Apache-2.0" }, "node_modules/regenerator-runtime": { @@ -11233,8 +11187,7 @@ }, "node_modules/retry": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", "optional": true, "engines": { "node": ">= 4" @@ -11441,8 +11394,7 @@ }, "node_modules/sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "license": "(MIT AND BSD-3-Clause)", "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -11495,8 +11447,9 @@ }, "node_modules/siginfo": { "version": "2.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true }, "node_modules/signal-exit": { "version": "3.0.7", @@ -11510,8 +11463,6 @@ }, "node_modules/simple-concat": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", "funding": [ { "type": "github", @@ -11525,12 +11476,11 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/simple-get": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", "funding": [ { "type": "github", @@ -11545,6 +11495,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", @@ -11576,8 +11527,7 @@ }, "node_modules/smart-buffer": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", "optional": true, "engines": { "node": ">= 6.0.0", @@ -11782,8 +11732,7 @@ }, "node_modules/socks": { "version": "2.8.3", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", - "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "license": "MIT", "optional": true, "dependencies": { "ip-address": "^9.0.5", @@ -11796,8 +11745,7 @@ }, "node_modules/socks-proxy-agent": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", - "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "license": "MIT", "optional": true, "dependencies": { "agent-base": "^6.0.2", @@ -11810,8 +11758,7 @@ }, "node_modules/socks-proxy-agent/node_modules/agent-base": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", "optional": true, "dependencies": { "debug": "4" @@ -11822,9 +11769,8 @@ }, "node_modules/source-map-js": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -11935,9 +11881,8 @@ }, "node_modules/sqlite3": { "version": "5.1.7", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", - "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "bindings": "^1.5.0", "node-addon-api": "^7.0.0", @@ -11958,8 +11903,7 @@ }, "node_modules/ssri": { "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.1.1" @@ -11970,13 +11914,15 @@ }, "node_modules/stackback": { "version": "0.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true }, "node_modules/std-env": { - "version": "3.7.0", - "dev": true, - "license": "MIT" + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "dev": true }, "node_modules/stream-transform": { "version": "2.1.3", @@ -12031,8 +11977,7 @@ "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==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -12044,29 +11989,25 @@ }, "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==", + "license": "MIT", "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==" + "license": "MIT" }, "node_modules/string-width-cjs/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==", + "license": "MIT", "engines": { "node": ">=8" } }, "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==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -12132,8 +12073,7 @@ "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==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -12143,8 +12083,7 @@ }, "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==", + "license": "MIT", "engines": { "node": ">=8" } @@ -12220,8 +12159,7 @@ }, "node_modules/tar": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -12236,8 +12174,7 @@ }, "node_modules/tar-fs": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "license": "MIT", "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", @@ -12247,13 +12184,11 @@ }, "node_modules/tar-fs/node_modules/chownr": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + "license": "ISC" }, "node_modules/tar-stream": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", @@ -12267,16 +12202,14 @@ }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", "engines": { "node": ">=8" } }, "node_modules/tar/node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "license": "ISC" }, "node_modules/term-size": { "version": "2.2.1", @@ -12289,6 +12222,73 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/test-exclude": { + "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": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "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" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "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": { + "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" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "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": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/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/text-table": { "version": "0.2.0", "dev": true, @@ -12296,16 +12296,14 @@ }, "node_modules/thenify": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", "dependencies": { "any-promise": "^1.0.0" } }, "node_modules/thenify-all": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", "dependencies": { "thenify": ">= 3.1.0 < 4" }, @@ -12331,9 +12329,9 @@ "dev": true }, "node_modules/tinypool": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz", - "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", + "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==", "dev": true, "engines": { "node": "^18.0.0 || >=20.0.0" @@ -12348,6 +12346,15 @@ "node": ">=14.0.0" } }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/title-case": { "version": "3.0.3", "dev": true, @@ -12403,8 +12410,6 @@ }, "node_modules/ts-custom-error": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/ts-custom-error/-/ts-custom-error-3.3.1.tgz", - "integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==", "license": "MIT", "engines": { "node": ">=14.0.0" @@ -12590,8 +12595,7 @@ }, "node_modules/tunnel-agent": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" }, @@ -12688,8 +12692,7 @@ }, "node_modules/typeorm": { "version": "0.3.20", - "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.20.tgz", - "integrity": "sha512-sJ0T08dV5eoZroaq9uPKBoNcGslHBR4E4y+EBHs//SiGbblGe7IeduP/IH4ddCcj0qp3PHwDwGnuvqEAnKlq/Q==", + "license": "MIT", "dependencies": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", @@ -12793,16 +12796,14 @@ }, "node_modules/typeorm/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==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/typeorm/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -12815,16 +12816,13 @@ }, "node_modules/typeorm/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/typeorm/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", @@ -12839,6 +12837,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -12846,8 +12845,7 @@ }, "node_modules/typeorm/node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -12861,8 +12859,7 @@ }, "node_modules/typeorm/node_modules/cliui": { "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -12874,13 +12871,11 @@ }, "node_modules/typeorm/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==" + "license": "MIT" }, "node_modules/typeorm/node_modules/glob": { "version": "10.4.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", - "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -12900,16 +12895,14 @@ }, "node_modules/typeorm/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==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/typeorm/node_modules/minimatch": { "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -12922,16 +12915,14 @@ }, "node_modules/typeorm/node_modules/minipass": { "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } }, "node_modules/typeorm/node_modules/mkdirp": { "version": "2.1.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", - "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "license": "MIT", "bin": { "mkdirp": "dist/cjs/src/bin.js" }, @@ -12944,13 +12935,11 @@ }, "node_modules/typeorm/node_modules/reflect-metadata": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", - "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==" + "license": "Apache-2.0" }, "node_modules/typeorm/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==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -12962,8 +12951,7 @@ }, "node_modules/typeorm/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==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -12973,8 +12961,7 @@ }, "node_modules/typeorm/node_modules/yargs": { "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -12990,8 +12977,7 @@ }, "node_modules/typeorm/node_modules/yargs-parser": { "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", "engines": { "node": ">=12" } @@ -13054,13 +13040,11 @@ }, "node_modules/undici-types": { "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + "license": "MIT" }, "node_modules/unique-filename": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "license": "ISC", "optional": true, "dependencies": { "unique-slug": "^2.0.0" @@ -13068,8 +13052,7 @@ }, "node_modules/unique-slug": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "license": "ISC", "optional": true, "dependencies": { "imurmurhash": "^0.1.4" @@ -13246,13 +13229,14 @@ } }, "node_modules/vite-node": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.4.tgz", - "integrity": "sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", "dev": true, "dependencies": { "cac": "^6.7.14", "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", "pathe": "^1.1.2", "vite": "^5.0.0" }, @@ -13266,220 +13250,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/vite-node/node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.4.tgz", - "integrity": "sha512-jfUJrFct/hTA0XDM5p/htWKoNNTbDLY0KRwEt6pyOA6k2fmk0WVwl65PdUdJZgzGEHWx+49LilkcSaumQRyNQw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-android-arm64": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.4.tgz", - "integrity": "sha512-j4nrEO6nHU1nZUuCfRKoCcvh7PIywQPUCBa2UsootTHvTHIoIu2BzueInGJhhvQO/2FTRdNYpf63xsgEqH9IhA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.4.tgz", - "integrity": "sha512-GmU/QgGtBTeraKyldC7cDVVvAJEOr3dFLKneez/n7BvX57UdhOqDsVwzU7UOnYA7AAOt+Xb26lk79PldDHgMIQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-darwin-x64": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.4.tgz", - "integrity": "sha512-N6oDBiZCBKlwYcsEPXGDE4g9RoxZLK6vT98M8111cW7VsVJFpNEqvJeIPfsCzbf0XEakPslh72X0gnlMi4Ddgg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.4.tgz", - "integrity": "sha512-10ICosOwYChROdQoQo589N5idQIisxjaFE/PAnX2i0Zr84mY0k9zul1ArH0rnJ/fpgiqfu13TFZR5A5YJLOYZA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.4.tgz", - "integrity": "sha512-ySAfWs69LYC7QhRDZNKqNhz2UKN8LDfbKSMAEtoEI0jitwfAG2iZwVqGACJT+kfYvvz3/JgsLlcBP+WWoKCLcw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.4.tgz", - "integrity": "sha512-uHYJ0HNOI6pGEeZ/5mgm5arNVTI0nLlmrbdph+pGXpC9tFHFDQmDMOEqkmUObRfosJqpU8RliYoGz06qSdtcjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.4.tgz", - "integrity": "sha512-38yiWLemQf7aLHDgTg85fh3hW9stJ0Muk7+s6tIkSUOMmi4Xbv5pH/5Bofnsb6spIwD5FJiR+jg71f0CH5OzoA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.4.tgz", - "integrity": "sha512-q73XUPnkwt9ZNF2xRS4fvneSuaHw2BXuV5rI4cw0fWYVIWIBeDZX7c7FWhFQPNTnE24172K30I+dViWRVD9TwA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.4.tgz", - "integrity": "sha512-Aie/TbmQi6UXokJqDZdmTJuZBCU3QBDA8oTKRGtd4ABi/nHgXICulfg1KI6n9/koDsiDbvHAiQO3YAUNa/7BCw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.4.tgz", - "integrity": "sha512-P8MPErVO/y8ohWSP9JY7lLQ8+YMHfTI4bAdtCi3pC2hTeqFJco2jYspzOzTUB8hwUWIIu1xwOrJE11nP+0JFAQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.4.tgz", - "integrity": "sha512-K03TljaaoPK5FOyNMZAAEmhlyO49LaE4qCsr0lYHUKyb6QacTNF9pnfPpXnFlFD3TXuFbFbz7tJ51FujUXkXYA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.4.tgz", - "integrity": "sha512-VJYl4xSl/wqG2D5xTYncVWW+26ICV4wubwN9Gs5NrqhJtayikwCXzPL8GDsLnaLU3WwhQ8W02IinYSFJfyo34Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.4.tgz", - "integrity": "sha512-ku2GvtPwQfCqoPFIJCqZ8o7bJcj+Y54cZSr43hHca6jLwAiCbZdBUOrqE6y29QFajNAzzpIOwsckaTFmN6/8TA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.4.tgz", - "integrity": "sha512-V3nCe+eTt/W6UYNr/wGvO1fLpHUrnlirlypZfKCT1fG6hWfqhPgQV/K/mRBXBpxc0eKLIF18pIOFVPh0mqHjlg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vite-node/node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.4.tgz", - "integrity": "sha512-LTw1Dfd0mBIEqUVCxbvTE/LLo+9ZxVC9k99v1v4ahg9Aak6FpqOfNu5kRkeTAn0wphoC4JU7No1/rL+bBCEwhg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vite-node/node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true - }, "node_modules/vite-node/node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", @@ -13519,9 +13289,9 @@ } }, "node_modules/vite-node/node_modules/rollup": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.4.tgz", - "integrity": "sha512-vGorVWIsWfX3xbcyAS+I047kFKapHYivmkaT63Smj77XwvLSJos6M1xGqZnBPFQFBRZDOcG1QnYEIxAvTr/HjA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.29.1.tgz", + "integrity": "sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw==", "dev": true, "dependencies": { "@types/estree": "1.0.6" @@ -13534,31 +13304,32 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.24.4", - "@rollup/rollup-android-arm64": "4.24.4", - "@rollup/rollup-darwin-arm64": "4.24.4", - "@rollup/rollup-darwin-x64": "4.24.4", - "@rollup/rollup-freebsd-arm64": "4.24.4", - "@rollup/rollup-freebsd-x64": "4.24.4", - "@rollup/rollup-linux-arm-gnueabihf": "4.24.4", - "@rollup/rollup-linux-arm-musleabihf": "4.24.4", - "@rollup/rollup-linux-arm64-gnu": "4.24.4", - "@rollup/rollup-linux-arm64-musl": "4.24.4", - "@rollup/rollup-linux-powerpc64le-gnu": "4.24.4", - "@rollup/rollup-linux-riscv64-gnu": "4.24.4", - "@rollup/rollup-linux-s390x-gnu": "4.24.4", - "@rollup/rollup-linux-x64-gnu": "4.24.4", - "@rollup/rollup-linux-x64-musl": "4.24.4", - "@rollup/rollup-win32-arm64-msvc": "4.24.4", - "@rollup/rollup-win32-ia32-msvc": "4.24.4", - "@rollup/rollup-win32-x64-msvc": "4.24.4", + "@rollup/rollup-android-arm-eabi": "4.29.1", + "@rollup/rollup-android-arm64": "4.29.1", + "@rollup/rollup-darwin-arm64": "4.29.1", + "@rollup/rollup-darwin-x64": "4.29.1", + "@rollup/rollup-freebsd-arm64": "4.29.1", + "@rollup/rollup-freebsd-x64": "4.29.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.29.1", + "@rollup/rollup-linux-arm-musleabihf": "4.29.1", + "@rollup/rollup-linux-arm64-gnu": "4.29.1", + "@rollup/rollup-linux-arm64-musl": "4.29.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.29.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.29.1", + "@rollup/rollup-linux-riscv64-gnu": "4.29.1", + "@rollup/rollup-linux-s390x-gnu": "4.29.1", + "@rollup/rollup-linux-x64-gnu": "4.29.1", + "@rollup/rollup-linux-x64-musl": "4.29.1", + "@rollup/rollup-win32-arm64-msvc": "4.29.1", + "@rollup/rollup-win32-ia32-msvc": "4.29.1", + "@rollup/rollup-win32-x64-msvc": "4.29.1", "fsevents": "~2.3.2" } }, "node_modules/vite-node/node_modules/vite": { - "version": "5.4.10", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", - "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, "dependencies": { "esbuild": "^0.21.3", @@ -13636,30 +13407,30 @@ } }, "node_modules/vitest": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.4.tgz", - "integrity": "sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==", - "dev": true, - "dependencies": { - "@vitest/expect": "2.1.4", - "@vitest/mocker": "2.1.4", - "@vitest/pretty-format": "^2.1.4", - "@vitest/runner": "2.1.4", - "@vitest/snapshot": "2.1.4", - "@vitest/spy": "2.1.4", - "@vitest/utils": "2.1.4", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", + "dev": true, + "dependencies": { + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "debug": "^4.3.7", "expect-type": "^1.1.0", "magic-string": "^0.30.12", "pathe": "^1.1.2", - "std-env": "^3.7.0", + "std-env": "^3.8.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.1", "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.4", + "vite-node": "2.1.8", "why-is-node-running": "^2.3.0" }, "bin": { @@ -13674,8 +13445,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.4", - "@vitest/ui": "2.1.4", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", "happy-dom": "*", "jsdom": "*" }, @@ -13700,383 +13471,112 @@ } } }, - "node_modules/vitest/node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.4.tgz", - "integrity": "sha512-jfUJrFct/hTA0XDM5p/htWKoNNTbDLY0KRwEt6pyOA6k2fmk0WVwl65PdUdJZgzGEHWx+49LilkcSaumQRyNQw==", - "cpu": [ - "arm" - ], + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", "dev": true, - "optional": true, - "os": [ - "android" - ] + "dependencies": { + "@vitest/spy": "2.1.8", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } }, - "node_modules/vitest/node_modules/@rollup/rollup-android-arm64": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.4.tgz", - "integrity": "sha512-j4nrEO6nHU1nZUuCfRKoCcvh7PIywQPUCBa2UsootTHvTHIoIu2BzueInGJhhvQO/2FTRdNYpf63xsgEqH9IhA==", - "cpu": [ - "arm64" - ], + "node_modules/vitest/node_modules/esbuild": { + "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, - "optional": true, - "os": [ - "android" - ] + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@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/node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.4.tgz", - "integrity": "sha512-GmU/QgGtBTeraKyldC7cDVVvAJEOr3dFLKneez/n7BvX57UdhOqDsVwzU7UOnYA7AAOt+Xb26lk79PldDHgMIQ==", - "cpu": [ - "arm64" - ], + "node_modules/vitest/node_modules/rollup": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.29.1.tgz", + "integrity": "sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw==", "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.29.1", + "@rollup/rollup-android-arm64": "4.29.1", + "@rollup/rollup-darwin-arm64": "4.29.1", + "@rollup/rollup-darwin-x64": "4.29.1", + "@rollup/rollup-freebsd-arm64": "4.29.1", + "@rollup/rollup-freebsd-x64": "4.29.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.29.1", + "@rollup/rollup-linux-arm-musleabihf": "4.29.1", + "@rollup/rollup-linux-arm64-gnu": "4.29.1", + "@rollup/rollup-linux-arm64-musl": "4.29.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.29.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.29.1", + "@rollup/rollup-linux-riscv64-gnu": "4.29.1", + "@rollup/rollup-linux-s390x-gnu": "4.29.1", + "@rollup/rollup-linux-x64-gnu": "4.29.1", + "@rollup/rollup-linux-x64-musl": "4.29.1", + "@rollup/rollup-win32-arm64-msvc": "4.29.1", + "@rollup/rollup-win32-ia32-msvc": "4.29.1", + "@rollup/rollup-win32-x64-msvc": "4.29.1", + "fsevents": "~2.3.2" + } }, - "node_modules/vitest/node_modules/@rollup/rollup-darwin-x64": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.4.tgz", - "integrity": "sha512-N6oDBiZCBKlwYcsEPXGDE4g9RoxZLK6vT98M8111cW7VsVJFpNEqvJeIPfsCzbf0XEakPslh72X0gnlMi4Ddgg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.4.tgz", - "integrity": "sha512-10ICosOwYChROdQoQo589N5idQIisxjaFE/PAnX2i0Zr84mY0k9zul1ArH0rnJ/fpgiqfu13TFZR5A5YJLOYZA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.4.tgz", - "integrity": "sha512-ySAfWs69LYC7QhRDZNKqNhz2UKN8LDfbKSMAEtoEI0jitwfAG2iZwVqGACJT+kfYvvz3/JgsLlcBP+WWoKCLcw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.4.tgz", - "integrity": "sha512-uHYJ0HNOI6pGEeZ/5mgm5arNVTI0nLlmrbdph+pGXpC9tFHFDQmDMOEqkmUObRfosJqpU8RliYoGz06qSdtcjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.4.tgz", - "integrity": "sha512-38yiWLemQf7aLHDgTg85fh3hW9stJ0Muk7+s6tIkSUOMmi4Xbv5pH/5Bofnsb6spIwD5FJiR+jg71f0CH5OzoA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.4.tgz", - "integrity": "sha512-q73XUPnkwt9ZNF2xRS4fvneSuaHw2BXuV5rI4cw0fWYVIWIBeDZX7c7FWhFQPNTnE24172K30I+dViWRVD9TwA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.4.tgz", - "integrity": "sha512-Aie/TbmQi6UXokJqDZdmTJuZBCU3QBDA8oTKRGtd4ABi/nHgXICulfg1KI6n9/koDsiDbvHAiQO3YAUNa/7BCw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.4.tgz", - "integrity": "sha512-P8MPErVO/y8ohWSP9JY7lLQ8+YMHfTI4bAdtCi3pC2hTeqFJco2jYspzOzTUB8hwUWIIu1xwOrJE11nP+0JFAQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.4.tgz", - "integrity": "sha512-K03TljaaoPK5FOyNMZAAEmhlyO49LaE4qCsr0lYHUKyb6QacTNF9pnfPpXnFlFD3TXuFbFbz7tJ51FujUXkXYA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.4.tgz", - "integrity": "sha512-VJYl4xSl/wqG2D5xTYncVWW+26ICV4wubwN9Gs5NrqhJtayikwCXzPL8GDsLnaLU3WwhQ8W02IinYSFJfyo34Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.4.tgz", - "integrity": "sha512-ku2GvtPwQfCqoPFIJCqZ8o7bJcj+Y54cZSr43hHca6jLwAiCbZdBUOrqE6y29QFajNAzzpIOwsckaTFmN6/8TA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.4.tgz", - "integrity": "sha512-V3nCe+eTt/W6UYNr/wGvO1fLpHUrnlirlypZfKCT1fG6hWfqhPgQV/K/mRBXBpxc0eKLIF18pIOFVPh0mqHjlg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.4.tgz", - "integrity": "sha512-LTw1Dfd0mBIEqUVCxbvTE/LLo+9ZxVC9k99v1v4ahg9Aak6FpqOfNu5kRkeTAn0wphoC4JU7No1/rL+bBCEwhg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vitest/node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true - }, - "node_modules/vitest/node_modules/@vitest/mocker": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.4.tgz", - "integrity": "sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==", - "dev": true, - "dependencies": { - "@vitest/spy": "2.1.4", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.12" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, - "node_modules/vitest/node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/vitest/node_modules/chai": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", - "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", - "dev": true, - "dependencies": { - "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": ">=12" - } - }, - "node_modules/vitest/node_modules/check-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", - "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", - "dev": true, - "engines": { - "node": ">= 16" - } - }, - "node_modules/vitest/node_modules/deep-eql": { - "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, - "engines": { - "node": ">=6" - } - }, - "node_modules/vitest/node_modules/esbuild": { - "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": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@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/node_modules/loupe": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", - "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", - "dev": true - }, - "node_modules/vitest/node_modules/pathval": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", - "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", - "dev": true, - "engines": { - "node": ">= 14.16" - } - }, - "node_modules/vitest/node_modules/rollup": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.4.tgz", - "integrity": "sha512-vGorVWIsWfX3xbcyAS+I047kFKapHYivmkaT63Smj77XwvLSJos6M1xGqZnBPFQFBRZDOcG1QnYEIxAvTr/HjA==", - "dev": true, - "dependencies": { - "@types/estree": "1.0.6" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.24.4", - "@rollup/rollup-android-arm64": "4.24.4", - "@rollup/rollup-darwin-arm64": "4.24.4", - "@rollup/rollup-darwin-x64": "4.24.4", - "@rollup/rollup-freebsd-arm64": "4.24.4", - "@rollup/rollup-freebsd-x64": "4.24.4", - "@rollup/rollup-linux-arm-gnueabihf": "4.24.4", - "@rollup/rollup-linux-arm-musleabihf": "4.24.4", - "@rollup/rollup-linux-arm64-gnu": "4.24.4", - "@rollup/rollup-linux-arm64-musl": "4.24.4", - "@rollup/rollup-linux-powerpc64le-gnu": "4.24.4", - "@rollup/rollup-linux-riscv64-gnu": "4.24.4", - "@rollup/rollup-linux-s390x-gnu": "4.24.4", - "@rollup/rollup-linux-x64-gnu": "4.24.4", - "@rollup/rollup-linux-x64-musl": "4.24.4", - "@rollup/rollup-win32-arm64-msvc": "4.24.4", - "@rollup/rollup-win32-ia32-msvc": "4.24.4", - "@rollup/rollup-win32-x64-msvc": "4.24.4", - "fsevents": "~2.3.2" - } - }, - "node_modules/vitest/node_modules/vite": { - "version": "5.4.10", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", - "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", + "node_modules/vitest/node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, "dependencies": { "esbuild": "^0.21.3", @@ -14253,8 +13753,7 @@ }, "node_modules/wide-align": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", "optional": true, "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" @@ -14262,8 +13761,7 @@ }, "node_modules/wide-align/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==", + "license": "MIT", "optional": true, "engines": { "node": ">=8" @@ -14271,14 +13769,12 @@ }, "node_modules/wide-align/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==", + "license": "MIT", "optional": true }, "node_modules/wide-align/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==", + "license": "MIT", "optional": true, "engines": { "node": ">=8" @@ -14286,8 +13782,7 @@ }, "node_modules/wide-align/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==", + "license": "MIT", "optional": true, "dependencies": { "emoji-regex": "^8.0.0", @@ -14300,8 +13795,7 @@ }, "node_modules/wide-align/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==", + "license": "MIT", "optional": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -14328,8 +13822,7 @@ "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==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -14344,16 +13837,14 @@ }, "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==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -14366,21 +13857,18 @@ }, "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==" + "license": "MIT" }, "node_modules/wrap-ansi-cjs/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==", + "license": "MIT", "engines": { "node": ">=8" } }, "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==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -14392,8 +13880,7 @@ }, "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==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -14595,8 +14082,8 @@ "@rosen-bridge/abstract-logger": "^2.0.1", "@rosen-bridge/json-bigint": "^0.1.0", "@rosen-bridge/minimum-fee": "^2.2.2", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", "blakejs": "^1.2.1" }, "devDependencies": { @@ -14615,10 +14102,42 @@ "node": ">=20.11.0" } }, - "packages/abstract-chain/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" + "packages/abstract-chain/node_modules/@rosen-bridge/address-codec": { + "version": "0.5.0", + "license": "GPL-3.0", + "dependencies": { + "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.13.2" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "packages/abstract-chain/node_modules/@rosen-bridge/rosen-extractor": { + "version": "7.0.1", + "license": "GPL-3.0", + "dependencies": { + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/schema": "^6.0.3", + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/address-codec": "^0.5.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/tokens": "^2.0.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.11.1", + "json-bigint": "^1.0.0", + "lodash-es": "^4.17.21" + } + }, + "packages/abstract-chain/node_modules/@rosen-bridge/tokens": { + "version": "2.0.0", + "license": "GPL-3.0", + "dependencies": { + "ergo-lib-wasm-nodejs": "^0.24.1" + } }, "packages/chains/binance": { "name": "@rosen-chains/binance", @@ -14626,7 +14145,7 @@ "license": "CC0-1.0", "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "@rosen-chains/evm": "^6.0.1" }, @@ -14646,16 +14165,18 @@ "node": ">=20.11.0" } }, - "packages/chains/binance/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" + "packages/chains/binance/node_modules/@rosen-bridge/tokens": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/tokens/-/tokens-2.0.0.tgz", + "integrity": "sha512-Fw1oRQR3JFAI3c/lxznR7UMVTzYCWSreD/0QCZ9PMYK380SiQTwmq5nZcIJXVHhNIztTk7H9YDl3sX8b0J5sQA==", + "dependencies": { + "ergo-lib-wasm-nodejs": "^0.24.1" + } }, "packages/chains/binance/node_modules/@typescript-eslint/eslint-plugin": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.5.1", "@typescript-eslint/scope-manager": "6.21.0", @@ -14688,9 +14209,8 @@ }, "packages/chains/binance/node_modules/@typescript-eslint/parser": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", @@ -14716,9 +14236,8 @@ }, "packages/chains/binance/node_modules/@typescript-eslint/scope-manager": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0" @@ -14733,9 +14252,8 @@ }, "packages/chains/binance/node_modules/@typescript-eslint/type-utils": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "6.21.0", "@typescript-eslint/utils": "6.21.0", @@ -14760,9 +14278,8 @@ }, "packages/chains/binance/node_modules/@typescript-eslint/types": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, + "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -14773,9 +14290,8 @@ }, "packages/chains/binance/node_modules/@typescript-eslint/typescript-estree": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", @@ -14801,9 +14317,8 @@ }, "packages/chains/binance/node_modules/@typescript-eslint/utils": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", @@ -14826,9 +14341,8 @@ }, "packages/chains/binance/node_modules/@typescript-eslint/visitor-keys": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" @@ -14843,18 +14357,16 @@ }, "packages/chains/binance/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "packages/chains/binance/node_modules/eslint-config-prettier": { "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, + "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -14864,9 +14376,8 @@ }, "packages/chains/binance/node_modules/minimatch": { "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -14879,9 +14390,8 @@ }, "packages/chains/binance/node_modules/prettier": { "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -14894,9 +14404,8 @@ }, "packages/chains/binance/node_modules/semver": { "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -14904,30 +14413,439 @@ "node": ">=10" } }, - "packages/chains/binance/node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" + "packages/chains/binance/node_modules/typescript": { + "version": "5.6.3", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/chains/bitcoin": { + "name": "@rosen-chains/bitcoin", + "version": "6.1.3", + "license": "CC0-1.0", + "dependencies": { + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/bitcoin-utxo-selection": "^0.3.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", + "@rosen-chains/abstract-chain": "^11.0.3", + "bitcoinjs-lib": "^6.1.5" + }, + "devDependencies": { + "@types/node": "^20.11.9", + "@typescript-eslint/eslint-plugin": "^6.19.1", + "@typescript-eslint/parser": "^6.19.1", + "@vitest/coverage-istanbul": "^2.1.4", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "extensionless": "^1.9.6", + "prettier": "^3.2.4", + "typescript": "^5.3.3", + "vitest": "^2.1.4" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "packages/chains/bitcoin/node_modules/@rosen-bridge/address-codec": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/address-codec/-/address-codec-0.5.0.tgz", + "integrity": "sha512-WI6KjOAhtIJGfq9LB3tbwNSklHmIHuBY5FLXUO3BS8hzB2NVIFUP77jL9aI0xCbB/66dWiKOb7OnIIm5DCt8Yw==", + "dependencies": { + "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.13.2" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "packages/chains/bitcoin/node_modules/@rosen-bridge/rosen-extractor": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@rosen-bridge/rosen-extractor/-/rosen-extractor-7.0.1.tgz", + "integrity": "sha512-3vWy1+7zC7Cn8hiEEthHf5w9wG6fOp6wruT09i+9RJHFX68mMXUNg+2RqYTrhNSxkaC3enP+yoynzeioBqypMw==", + "dependencies": { + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/schema": "^6.0.3", + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/address-codec": "^0.5.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/tokens": "^2.0.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.11.1", + "json-bigint": "^1.0.0", + "lodash-es": "^4.17.21" + } + }, + "packages/chains/bitcoin/node_modules/@rosen-bridge/tokens": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/tokens/-/tokens-2.0.0.tgz", + "integrity": "sha512-Fw1oRQR3JFAI3c/lxznR7UMVTzYCWSreD/0QCZ9PMYK380SiQTwmq5nZcIJXVHhNIztTk7H9YDl3sX8b0J5sQA==", + "dependencies": { + "ergo-lib-wasm-nodejs": "^0.24.1" + } + }, + "packages/chains/bitcoin/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/chains/bitcoin/node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/chains/bitcoin/node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/chains/bitcoin/node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/chains/bitcoin/node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/chains/bitcoin/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/chains/bitcoin/node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/chains/bitcoin/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/chains/bitcoin/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "packages/chains/bitcoin/node_modules/eslint-config-prettier": { + "version": "9.1.0", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "packages/chains/bitcoin/node_modules/lru-cache": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "packages/chains/bitcoin/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/chains/bitcoin/node_modules/prettier": { + "version": "3.2.5", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "packages/chains/bitcoin/node_modules/semver": { + "version": "7.6.0", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "packages/chains/bitcoin/node_modules/typescript": { + "version": "5.3.3", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/chains/bitcoin/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "packages/chains/cardano": { + "name": "@rosen-chains/cardano", + "version": "10.1.4", + "license": "CC0-1.0", + "dependencies": { + "@emurgo/cardano-serialization-lib-nodejs": "^11.3.1", + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", + "@rosen-chains/abstract-chain": "^11.0.3", + "bech32": "^2.0.0" + }, + "devDependencies": { + "@types/blake2b": "^2.1.0", + "@types/node": "^20.11.9", + "@typescript-eslint/eslint-plugin": "^5.30.7", + "@typescript-eslint/parser": "^5.26.0", + "@vitest/coverage-istanbul": "^2.1.4", + "eslint": "^8.16.0", + "eslint-config-prettier": "^8.5.0", + "extensionless": "^1.9.6", + "prettier": "^2.7.1", + "typescript": "^4.9.5", + "vitest": "^2.1.4" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "packages/chains/cardano/node_modules/@rosen-bridge/address-codec": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/address-codec/-/address-codec-0.5.0.tgz", + "integrity": "sha512-WI6KjOAhtIJGfq9LB3tbwNSklHmIHuBY5FLXUO3BS8hzB2NVIFUP77jL9aI0xCbB/66dWiKOb7OnIIm5DCt8Yw==", + "dependencies": { + "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.13.2" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "packages/chains/cardano/node_modules/@rosen-bridge/rosen-extractor": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@rosen-bridge/rosen-extractor/-/rosen-extractor-7.0.1.tgz", + "integrity": "sha512-3vWy1+7zC7Cn8hiEEthHf5w9wG6fOp6wruT09i+9RJHFX68mMXUNg+2RqYTrhNSxkaC3enP+yoynzeioBqypMw==", + "dependencies": { + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/schema": "^6.0.3", + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/address-codec": "^0.5.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/tokens": "^2.0.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.11.1", + "json-bigint": "^1.0.0", + "lodash-es": "^4.17.21" + } + }, + "packages/chains/cardano/node_modules/@rosen-bridge/tokens": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/tokens/-/tokens-2.0.0.tgz", + "integrity": "sha512-Fw1oRQR3JFAI3c/lxznR7UMVTzYCWSreD/0QCZ9PMYK380SiQTwmq5nZcIJXVHhNIztTk7H9YDl3sX8b0J5sQA==", + "dependencies": { + "ergo-lib-wasm-nodejs": "^0.24.1" } }, - "packages/chains/bitcoin": { - "name": "@rosen-chains/bitcoin", - "version": "6.1.3", - "license": "CC0-1.0", + "packages/chains/doge": { + "name": "@rosen-chains/doge", + "version": "0.1.0", + "license": "GPL-3.0", "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", - "@rosen-bridge/bitcoin-utxo-selection": "^0.2.2", + "@rosen-bridge/bitcoin-utxo-selection": "^0.3.0", "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", - "@rosen-chains/abstract-chain": "^11.0.3", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", + "@rosen-chains/abstract-chain": "^11.0.1", "bitcoinjs-lib": "^6.1.5" }, "devDependencies": { @@ -14946,12 +14864,44 @@ "node": ">=20.11.0" } }, - "packages/chains/bitcoin/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" + "packages/chains/doge/node_modules/@rosen-bridge/rosen-extractor": { + "version": "7.0.1", + "license": "GPL-3.0", + "dependencies": { + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/schema": "^6.0.3", + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/address-codec": "^0.5.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/tokens": "^2.0.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.11.1", + "json-bigint": "^1.0.0", + "lodash-es": "^4.17.21" + } }, - "packages/chains/bitcoin/node_modules/@typescript-eslint/eslint-plugin": { + "packages/chains/doge/node_modules/@rosen-bridge/rosen-extractor/node_modules/@rosen-bridge/address-codec": { + "version": "0.5.0", + "license": "GPL-3.0", + "dependencies": { + "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.13.2" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "packages/chains/doge/node_modules/@rosen-bridge/tokens": { + "version": "2.0.0", + "license": "GPL-3.0", + "dependencies": { + "ergo-lib-wasm-nodejs": "^0.24.1" + } + }, + "packages/chains/doge/node_modules/@typescript-eslint/eslint-plugin": { "version": "6.21.0", "dev": true, "license": "MIT", @@ -14985,7 +14935,7 @@ } } }, - "packages/chains/bitcoin/node_modules/@typescript-eslint/parser": { + "packages/chains/doge/node_modules/@typescript-eslint/parser": { "version": "6.21.0", "dev": true, "license": "BSD-2-Clause", @@ -15012,7 +14962,7 @@ } } }, - "packages/chains/bitcoin/node_modules/@typescript-eslint/scope-manager": { + "packages/chains/doge/node_modules/@typescript-eslint/scope-manager": { "version": "6.21.0", "dev": true, "license": "MIT", @@ -15028,7 +14978,7 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "packages/chains/bitcoin/node_modules/@typescript-eslint/type-utils": { + "packages/chains/doge/node_modules/@typescript-eslint/type-utils": { "version": "6.21.0", "dev": true, "license": "MIT", @@ -15054,7 +15004,7 @@ } } }, - "packages/chains/bitcoin/node_modules/@typescript-eslint/types": { + "packages/chains/doge/node_modules/@typescript-eslint/types": { "version": "6.21.0", "dev": true, "license": "MIT", @@ -15066,7 +15016,7 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "packages/chains/bitcoin/node_modules/@typescript-eslint/typescript-estree": { + "packages/chains/doge/node_modules/@typescript-eslint/typescript-estree": { "version": "6.21.0", "dev": true, "license": "BSD-2-Clause", @@ -15093,7 +15043,7 @@ } } }, - "packages/chains/bitcoin/node_modules/@typescript-eslint/utils": { + "packages/chains/doge/node_modules/@typescript-eslint/utils": { "version": "6.21.0", "dev": true, "license": "MIT", @@ -15117,7 +15067,7 @@ "eslint": "^7.0.0 || ^8.0.0" } }, - "packages/chains/bitcoin/node_modules/@typescript-eslint/visitor-keys": { + "packages/chains/doge/node_modules/@typescript-eslint/visitor-keys": { "version": "6.21.0", "dev": true, "license": "MIT", @@ -15133,7 +15083,7 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "packages/chains/bitcoin/node_modules/brace-expansion": { + "packages/chains/doge/node_modules/brace-expansion": { "version": "2.0.1", "dev": true, "license": "MIT", @@ -15141,7 +15091,7 @@ "balanced-match": "^1.0.0" } }, - "packages/chains/bitcoin/node_modules/eslint-config-prettier": { + "packages/chains/doge/node_modules/eslint-config-prettier": { "version": "9.1.0", "dev": true, "license": "MIT", @@ -15152,18 +15102,7 @@ "eslint": ">=7.0.0" } }, - "packages/chains/bitcoin/node_modules/lru-cache": { - "version": "6.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "packages/chains/bitcoin/node_modules/minimatch": { + "packages/chains/doge/node_modules/minimatch": { "version": "9.0.3", "dev": true, "license": "ISC", @@ -15177,8 +15116,8 @@ "url": "https://github.com/sponsors/isaacs" } }, - "packages/chains/bitcoin/node_modules/prettier": { - "version": "3.2.5", + "packages/chains/doge/node_modules/prettier": { + "version": "3.4.1", "dev": true, "license": "MIT", "bin": { @@ -15191,13 +15130,10 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "packages/chains/bitcoin/node_modules/semver": { - "version": "7.6.0", + "packages/chains/doge/node_modules/semver": { + "version": "7.6.3", "dev": true, "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -15205,8 +15141,8 @@ "node": ">=10" } }, - "packages/chains/bitcoin/node_modules/typescript": { - "version": "5.3.3", + "packages/chains/doge/node_modules/typescript": { + "version": "5.7.2", "dev": true, "license": "Apache-2.0", "bin": { @@ -15217,26 +15153,19 @@ "node": ">=14.17" } }, - "packages/chains/bitcoin/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "license": "ISC" - }, - "packages/chains/cardano": { - "name": "@rosen-chains/cardano", + "packages/chains/ergo": { + "name": "@rosen-chains/ergo", "version": "10.1.4", "license": "CC0-1.0", "dependencies": { - "@emurgo/cardano-serialization-lib-nodejs": "^11.3.1", "@rosen-bridge/abstract-logger": "^2.0.1", "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", - "bech32": "^2.0.0" + "ergo-lib-wasm-nodejs": "^0.24.1" }, "devDependencies": { - "@types/blake2b": "^2.1.0", "@types/node": "^20.11.9", "@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/parser": "^5.26.0", @@ -15252,43 +15181,45 @@ "node": ">=20.11.0" } }, - "packages/chains/cardano/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, - "packages/chains/ergo": { - "name": "@rosen-chains/ergo", - "version": "10.1.4", - "license": "CC0-1.0", + "packages/chains/ergo/node_modules/@rosen-bridge/address-codec": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/address-codec/-/address-codec-0.5.0.tgz", + "integrity": "sha512-WI6KjOAhtIJGfq9LB3tbwNSklHmIHuBY5FLXUO3BS8hzB2NVIFUP77jL9aI0xCbB/66dWiKOb7OnIIm5DCt8Yw==", "dependencies": { - "@rosen-bridge/abstract-logger": "^2.0.1", - "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", - "@rosen-chains/abstract-chain": "^11.0.3", - "ergo-lib-wasm-nodejs": "^0.24.1" - }, - "devDependencies": { - "@types/node": "^20.11.9", - "@typescript-eslint/eslint-plugin": "^5.30.7", - "@typescript-eslint/parser": "^5.26.0", - "@vitest/coverage-istanbul": "^2.1.4", - "eslint": "^8.16.0", - "eslint-config-prettier": "^8.5.0", - "extensionless": "^1.9.6", - "prettier": "^2.7.1", - "typescript": "^4.9.5", - "vitest": "^2.1.4" + "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.13.2" }, "engines": { "node": ">=20.11.0" } }, - "packages/chains/ergo/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" + "packages/chains/ergo/node_modules/@rosen-bridge/rosen-extractor": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@rosen-bridge/rosen-extractor/-/rosen-extractor-7.0.1.tgz", + "integrity": "sha512-3vWy1+7zC7Cn8hiEEthHf5w9wG6fOp6wruT09i+9RJHFX68mMXUNg+2RqYTrhNSxkaC3enP+yoynzeioBqypMw==", + "dependencies": { + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/schema": "^6.0.3", + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/address-codec": "^0.5.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/tokens": "^2.0.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.11.1", + "json-bigint": "^1.0.0", + "lodash-es": "^4.17.21" + } + }, + "packages/chains/ergo/node_modules/@rosen-bridge/tokens": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/tokens/-/tokens-2.0.0.tgz", + "integrity": "sha512-Fw1oRQR3JFAI3c/lxznR7UMVTzYCWSreD/0QCZ9PMYK380SiQTwmq5nZcIJXVHhNIztTk7H9YDl3sX8b0J5sQA==", + "dependencies": { + "ergo-lib-wasm-nodejs": "^0.24.1" + } }, "packages/chains/ethereum": { "name": "@rosen-chains/ethereum", @@ -15296,7 +15227,7 @@ "license": "CC0-1.0", "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "@rosen-chains/evm": "^6.0.1" }, @@ -15316,16 +15247,18 @@ "node": ">=20.11.0" } }, - "packages/chains/ethereum/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" + "packages/chains/ethereum/node_modules/@rosen-bridge/tokens": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/tokens/-/tokens-2.0.0.tgz", + "integrity": "sha512-Fw1oRQR3JFAI3c/lxznR7UMVTzYCWSreD/0QCZ9PMYK380SiQTwmq5nZcIJXVHhNIztTk7H9YDl3sX8b0J5sQA==", + "dependencies": { + "ergo-lib-wasm-nodejs": "^0.24.1" + } }, "packages/chains/ethereum/node_modules/@typescript-eslint/eslint-plugin": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.5.1", "@typescript-eslint/scope-manager": "6.21.0", @@ -15358,9 +15291,8 @@ }, "packages/chains/ethereum/node_modules/@typescript-eslint/parser": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", @@ -15386,9 +15318,8 @@ }, "packages/chains/ethereum/node_modules/@typescript-eslint/scope-manager": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0" @@ -15403,9 +15334,8 @@ }, "packages/chains/ethereum/node_modules/@typescript-eslint/type-utils": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "6.21.0", "@typescript-eslint/utils": "6.21.0", @@ -15430,9 +15360,8 @@ }, "packages/chains/ethereum/node_modules/@typescript-eslint/types": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, + "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -15443,9 +15372,8 @@ }, "packages/chains/ethereum/node_modules/@typescript-eslint/typescript-estree": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.21.0", "@typescript-eslint/visitor-keys": "6.21.0", @@ -15471,9 +15399,8 @@ }, "packages/chains/ethereum/node_modules/@typescript-eslint/utils": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", @@ -15496,9 +15423,8 @@ }, "packages/chains/ethereum/node_modules/@typescript-eslint/visitor-keys": { "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" @@ -15513,18 +15439,16 @@ }, "packages/chains/ethereum/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "packages/chains/ethereum/node_modules/eslint-config-prettier": { "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, + "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -15534,9 +15458,8 @@ }, "packages/chains/ethereum/node_modules/minimatch": { "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -15549,9 +15472,8 @@ }, "packages/chains/ethereum/node_modules/prettier": { "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -15564,9 +15486,8 @@ }, "packages/chains/ethereum/node_modules/semver": { "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -15576,9 +15497,8 @@ }, "packages/chains/ethereum/node_modules/typescript": { "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -15594,8 +15514,8 @@ "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "ethers": "^6.11.1" }, @@ -15615,10 +15535,45 @@ "node": ">=20.11.0" } }, - "packages/chains/evm/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" + "packages/chains/evm/node_modules/@rosen-bridge/address-codec": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/address-codec/-/address-codec-0.5.0.tgz", + "integrity": "sha512-WI6KjOAhtIJGfq9LB3tbwNSklHmIHuBY5FLXUO3BS8hzB2NVIFUP77jL9aI0xCbB/66dWiKOb7OnIIm5DCt8Yw==", + "dependencies": { + "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.13.2" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "packages/chains/evm/node_modules/@rosen-bridge/rosen-extractor": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@rosen-bridge/rosen-extractor/-/rosen-extractor-7.0.1.tgz", + "integrity": "sha512-3vWy1+7zC7Cn8hiEEthHf5w9wG6fOp6wruT09i+9RJHFX68mMXUNg+2RqYTrhNSxkaC3enP+yoynzeioBqypMw==", + "dependencies": { + "@blockfrost/blockfrost-js": "^5.4.0", + "@cardano-ogmios/schema": "^6.0.3", + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/address-codec": "^0.5.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/tokens": "^2.0.0", + "bitcoinjs-lib": "^6.1.5", + "ergo-lib-wasm-nodejs": "^0.24.1", + "ethers": "^6.11.1", + "json-bigint": "^1.0.0", + "lodash-es": "^4.17.21" + } + }, + "packages/chains/evm/node_modules/@rosen-bridge/tokens": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@rosen-bridge/tokens/-/tokens-2.0.0.tgz", + "integrity": "sha512-Fw1oRQR3JFAI3c/lxznR7UMVTzYCWSreD/0QCZ9PMYK380SiQTwmq5nZcIJXVHhNIztTk7H9YDl3sX8b0J5sQA==", + "dependencies": { + "ergo-lib-wasm-nodejs": "^0.24.1" + } }, "packages/chains/evm/node_modules/@typescript-eslint/eslint-plugin": { "version": "6.21.0", @@ -15919,11 +15874,6 @@ "node": ">=20.11.0" } }, - "packages/networks/bitcoin-esplora/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "packages/networks/bitcoin-esplora/node_modules/@typescript-eslint/eslint-plugin": { "version": "6.21.0", "dev": true, @@ -16222,11 +16172,6 @@ "node": ">=20.11.0" } }, - "packages/networks/cardano-blockfrost/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "packages/networks/cardano-blockfrost/node_modules/@typescript-eslint/eslint-plugin": { "version": "6.10.0", "dev": true, @@ -16494,11 +16439,6 @@ "node": ">=20.11.0" } }, - "packages/networks/cardano-graphql/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "packages/networks/cardano-graphql/node_modules/@typescript-eslint/eslint-plugin": { "version": "6.13.1", "dev": true, @@ -16764,11 +16704,6 @@ "node": ">=20.11.0" } }, - "packages/networks/cardano-koios/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "packages/networks/cardano-koios/node_modules/typescript": { "version": "5.0.4", "dev": true, @@ -16781,6 +16716,36 @@ "node": ">=12.20" } }, + "packages/networks/doge-esplora": { + "name": "@rosen-chains/doge-esplora", + "version": "0.1.0", + "extraneous": true, + "license": "GPL-3.0", + "dependencies": { + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-chains/abstract-chain": "^11.0.3", + "@rosen-chains/bitcoin-esplora": "^4.0.8", + "@rosen-chains/doge": "^0.0.0", + "axios": "^1.6.7", + "bitcoinjs-lib": "^6.1.5" + }, + "devDependencies": { + "@types/node": "^20.11.9", + "@typescript-eslint/eslint-plugin": "^6.19.1", + "@typescript-eslint/parser": "^6.19.1", + "@vitest/coverage-istanbul": "^1.2.2", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "extensionless": "^1.9.6", + "prettier": "^3.2.4", + "typescript": "^5.3.3", + "vitest": "^1.2.2" + }, + "engines": { + "node": ">=20.11.0" + } + }, "packages/networks/ergo-explorer": { "name": "@rosen-chains/ergo-explorer-network", "version": "9.0.8", @@ -16812,11 +16777,6 @@ "node": ">=20.11.0" } }, - "packages/networks/ergo-explorer/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "packages/networks/ergo-explorer/node_modules/typescript": { "version": "5.0.4", "dev": true, @@ -16860,11 +16820,6 @@ "node": ">=20.11.0" } }, - "packages/networks/ergo-node/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "packages/networks/ergo-node/node_modules/typescript": { "version": "5.0.4", "dev": true, @@ -16904,11 +16859,6 @@ "node": ">=20.11.0" } }, - "packages/networks/evm-rpc/node_modules/@rosen-bridge/abstract-logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@rosen-bridge/abstract-logger/-/abstract-logger-2.0.1.tgz", - "integrity": "sha512-GC2TpPxrDRkwJvhBVdaQCrkkUkp1DwwzCGT2akUv6HKfHijrNMv9BVus9ia7mv//Cy4zJCq0yw9N1n48lD2aOg==" - }, "packages/networks/evm-rpc/node_modules/@typescript-eslint/eslint-plugin": { "version": "6.21.0", "dev": true, diff --git a/packages/abstract-chain/lib/AbstractChain.ts b/packages/abstract-chain/lib/AbstractChain.ts index c1e39dd5..f164bf4d 100644 --- a/packages/abstract-chain/lib/AbstractChain.ts +++ b/packages/abstract-chain/lib/AbstractChain.ts @@ -1,7 +1,7 @@ import { AbstractLogger, DummyLogger } from '@rosen-bridge/abstract-logger'; import { ChainMinimumFee } from '@rosen-bridge/minimum-fee'; import { AbstractRosenDataExtractor } from '@rosen-bridge/rosen-extractor'; -import { RosenTokens, TokenMap } from '@rosen-bridge/tokens'; +import { TokenMap } from '@rosen-bridge/tokens'; import { blake2b } from 'blakejs'; import ChainUtils from './ChainUtils'; import { @@ -40,12 +40,12 @@ abstract class AbstractChain { constructor( network: AbstractChainNetwork, configs: ChainConfigs, - tokens: RosenTokens, + tokens: TokenMap, logger?: AbstractLogger ) { this.network = network; this.configs = configs; - this.tokenMap = new TokenMap(tokens); + this.tokenMap = tokens; this.logger = logger ? logger : new DummyLogger(); } diff --git a/packages/abstract-chain/package.json b/packages/abstract-chain/package.json index 2a8f6822..bac57e22 100644 --- a/packages/abstract-chain/package.json +++ b/packages/abstract-chain/package.json @@ -23,8 +23,8 @@ "@rosen-bridge/abstract-logger": "^2.0.1", "@rosen-bridge/json-bigint": "^0.1.0", "@rosen-bridge/minimum-fee": "^2.2.2", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", "blakejs": "^1.2.1" }, "devDependencies": { diff --git a/packages/abstract-chain/tests/AbstractChain.spec.ts b/packages/abstract-chain/tests/AbstractChain.spec.ts index fb9bf6a3..16550f37 100644 --- a/packages/abstract-chain/tests/AbstractChain.spec.ts +++ b/packages/abstract-chain/tests/AbstractChain.spec.ts @@ -9,6 +9,7 @@ import { PaymentTransaction, TransactionType, } from '../lib'; +import { TokenMap } from '@rosen-bridge/tokens'; describe('AbstractChain', () => { describe('generateTransaction', () => { @@ -818,8 +819,10 @@ describe('AbstractChain', () => { const getAddressAssetsSpy = vi.spyOn(network, 'getAddressAssets'); getAddressAssetsSpy.mockResolvedValueOnce(testData.actualBalance); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.testTokenMap); // run test - const chain = generateChainObject(network); + const chain = generateChainObject(network, tokenMap); const result = await chain.getAddressAssets('address'); // check returned value diff --git a/packages/abstract-chain/tests/ChainUtils.spec.ts b/packages/abstract-chain/tests/ChainUtils.spec.ts index 3571a8a1..ce7ceff9 100644 --- a/packages/abstract-chain/tests/ChainUtils.spec.ts +++ b/packages/abstract-chain/tests/ChainUtils.spec.ts @@ -612,9 +612,10 @@ describe('ChainUtils', () => { * @expected * - it should return the expected wrapped values */ - it('should wrap all values successfully', () => { + it('should wrap all values successfully', async () => { // mock an AssetBalance - const tokenMap = new TokenMap(testTokenMap); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testTokenMap); // run test const result = ChainUtils.wrapAssetBalance( @@ -640,9 +641,10 @@ describe('ChainUtils', () => { * @expected * - it should return the expected unwrapped values */ - it('should unwrap all values successfully', () => { + it('should unwrap all values successfully', async () => { // mock an AssetBalance - const tokenMap = new TokenMap(testTokenMap); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testTokenMap); // run test const result = ChainUtils.unwrapAssetBalance( diff --git a/packages/abstract-chain/tests/extractor/TestRosenDataExtractor.ts b/packages/abstract-chain/tests/extractor/TestRosenDataExtractor.ts index 3acbfb0e..37c10c52 100644 --- a/packages/abstract-chain/tests/extractor/TestRosenDataExtractor.ts +++ b/packages/abstract-chain/tests/extractor/TestRosenDataExtractor.ts @@ -2,11 +2,12 @@ import { AbstractRosenDataExtractor, RosenData, } from '@rosen-bridge/rosen-extractor'; +import { TokenMap } from '@rosen-bridge/tokens'; class TestRosenDataExtractor extends AbstractRosenDataExtractor { readonly chain = 'test'; constructor() { - super('', { idKeys: {}, tokens: [] }); + super('', new TokenMap()); } extractRawData = (tx: string): RosenData | undefined => { diff --git a/packages/abstract-chain/tests/testData.ts b/packages/abstract-chain/tests/testData.ts index beef0499..a6488ce8 100644 --- a/packages/abstract-chain/tests/testData.ts +++ b/packages/abstract-chain/tests/testData.ts @@ -63,114 +63,88 @@ export const validEventWithHighFee: EventTrigger = { WIDsCount: 2, }; -export const testTokenMap: RosenTokens = { - idKeys: { - test: 'tokenId', - 'test-utxo': 'tokenId', +export const testTokenMap: RosenTokens = [ + { + test: { + tokenId: 'test-native-token', + name: 'test-native-token', + decimals: 2, + type: 'native', + residency: 'native', + }, + 'test-utxo': { + tokenId: 'wrapped-native-token', + name: 'wrapped-test-native-token', + decimals: 1, + type: 'ANY', + residency: 'wrapped', + }, }, - tokens: [ - { - test: { - tokenId: 'test-native-token', - name: 'test-native-token', - decimals: 2, - metaData: { - type: 'native', - residency: 'native', - }, - }, - 'test-utxo': { - tokenId: 'wrapped-native-token', - name: 'wrapped-test-native-token', - decimals: 1, - metaData: { - type: 'ANY', - residency: 'wrapped', - }, - }, + { + test: { + tokenId: 'wrapped-test-utxo-native-token', + name: 'wrapped-test-utxo-native-token', + decimals: 3, + type: 'ANY', + residency: 'wrapped', }, - { - test: { - tokenId: 'wrapped-test-utxo-native-token', - name: 'wrapped-test-utxo-native-token', - decimals: 3, - metaData: { - type: 'ANY', - residency: 'wrapped', - }, - }, - 'test-utxo': { - tokenId: 'test-utxo-native-token', - name: 'test-utxo-native-token', - decimals: 3, - metaData: { - type: 'native', - residency: 'native', - }, - }, + 'test-utxo': { + tokenId: 'test-utxo-native-token', + name: 'test-utxo-native-token', + decimals: 3, + type: 'native', + residency: 'native', }, - { - test: { - tokenId: 'multi-decimal-token1', - name: 'multi-decimal-token1', - decimals: 4, - metaData: { - type: 'ANY', - residency: 'native', - }, - }, - 'test-utxo': { - tokenId: 'wrapped-multi-decimal-token1', - name: 'wrapped-multi-decimal-token1', - decimals: 1, - metaData: { - type: 'ANY', - residency: 'wrapped', - }, - }, + }, + { + test: { + tokenId: 'multi-decimal-token1', + name: 'multi-decimal-token1', + decimals: 4, + type: 'ANY', + residency: 'native', }, - { - test: { - tokenId: 'wrapped-multi-decimal-token2', - name: 'wrapped-multi-decimal-token2', - decimals: 4, - metaData: { - type: 'ANY', - residency: 'wrapped', - }, - }, - 'test-utxo': { - tokenId: 'multi-decimal-token2', - name: 'multi-decimal-token2', - decimals: 0, - metaData: { - type: 'ANY', - residency: 'native', - }, - }, + 'test-utxo': { + tokenId: 'wrapped-multi-decimal-token1', + name: 'wrapped-multi-decimal-token1', + decimals: 1, + type: 'ANY', + residency: 'wrapped', }, - { - test: { - tokenId: 'fixed-decimal-token', - name: 'fixed-decimal-token', - decimals: 4, - metaData: { - type: 'ANY', - residency: 'native', - }, - }, - 'test-utxo': { - tokenId: 'wrapped-fixed-decimal-token', - name: 'wrapped-fixed-decimal-token', - decimals: 4, - metaData: { - type: 'ANY', - residency: 'wrapped', - }, - }, + }, + { + test: { + tokenId: 'wrapped-multi-decimal-token2', + name: 'wrapped-multi-decimal-token2', + decimals: 4, + type: 'ANY', + residency: 'wrapped', }, - ], -}; + 'test-utxo': { + tokenId: 'multi-decimal-token2', + name: 'multi-decimal-token2', + decimals: 0, + type: 'ANY', + residency: 'native', + }, + }, + { + test: { + tokenId: 'fixed-decimal-token', + name: 'fixed-decimal-token', + decimals: 4, + type: 'ANY', + residency: 'native', + }, + 'test-utxo': { + tokenId: 'wrapped-fixed-decimal-token', + name: 'wrapped-fixed-decimal-token', + decimals: 4, + type: 'ANY', + residency: 'wrapped', + }, + }, +]; export const actualBalance: AssetBalance = { nativeToken: 10000n, diff --git a/packages/abstract-chain/tests/testUtils.ts b/packages/abstract-chain/tests/testUtils.ts index 4cc05996..b3a78ecd 100644 --- a/packages/abstract-chain/tests/testUtils.ts +++ b/packages/abstract-chain/tests/testUtils.ts @@ -5,10 +5,11 @@ import TestChain from './TestChain'; import * as testData from './testData'; import TestUtxoChainNetwork from './network/TestChainNetwork'; import TestUtxoChain from './TestUtxoChain'; +import { TokenMap } from '@rosen-bridge/tokens'; export const generateRandomId = (): string => randomBytes(32).toString('hex'); -export const generateChainObject = (network: TestChainNetwork) => { +export const generateChainObject = (network: TestChainNetwork, tokens: TokenMap = new TokenMap()) => { const config: ChainConfigs = { fee: 100n, confirmations: { @@ -26,10 +27,10 @@ export const generateChainObject = (network: TestChainNetwork) => { }, rwtId: 'rwt', }; - return new TestChain(network, config, testData.testTokenMap); + return new TestChain(network, config, tokens); }; -export const generateUtxoChainObject = (network: TestUtxoChainNetwork) => { +export const generateUtxoChainObject = (network: TestUtxoChainNetwork, tokens: TokenMap = new TokenMap()) => { const config: ChainConfigs = { fee: 100n, confirmations: { @@ -47,5 +48,5 @@ export const generateUtxoChainObject = (network: TestUtxoChainNetwork) => { }, rwtId: 'rwt', }; - return new TestUtxoChain(network, config, testData.testTokenMap); + return new TestUtxoChain(network, config, tokens); }; diff --git a/packages/chains/binance/lib/BinanceChain.ts b/packages/chains/binance/lib/BinanceChain.ts index 1318889d..8fbb2205 100644 --- a/packages/chains/binance/lib/BinanceChain.ts +++ b/packages/chains/binance/lib/BinanceChain.ts @@ -4,7 +4,7 @@ import { EvmConfigs, TssSignFunction, } from '@rosen-chains/evm'; -import { RosenTokens } from '@rosen-bridge/tokens'; +import { TokenMap } from '@rosen-bridge/tokens'; import { AbstractLogger } from '@rosen-bridge/abstract-logger'; import { BNB, BINANCE_CHAIN, BINANCE_CHAIN_ID } from './constants'; @@ -16,8 +16,7 @@ class BinanceChain extends EvmChain { constructor( network: AbstractEvmNetwork, configs: EvmConfigs, - tokens: RosenTokens, - supportedTokens: Array, + tokens: TokenMap, signFunction: TssSignFunction, logger?: AbstractLogger ) { @@ -25,7 +24,6 @@ class BinanceChain extends EvmChain { network, configs, tokens, - supportedTokens, signFunction, BINANCE_CHAIN, BNB, diff --git a/packages/chains/binance/package.json b/packages/chains/binance/package.json index 0de5178d..52f89138 100644 --- a/packages/chains/binance/package.json +++ b/packages/chains/binance/package.json @@ -32,7 +32,7 @@ }, "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "@rosen-chains/evm": "^6.0.1" } diff --git a/packages/chains/bitcoin/lib/BitcoinChain.ts b/packages/chains/bitcoin/lib/BitcoinChain.ts index fee74f07..a5703ffc 100644 --- a/packages/chains/bitcoin/lib/BitcoinChain.ts +++ b/packages/chains/bitcoin/lib/BitcoinChain.ts @@ -32,7 +32,7 @@ import { estimateTxFee, getPsbtTxInputBoxId } from './bitcoinUtils'; import { BITCOIN_CHAIN, BTC, SEGWIT_INPUT_WEIGHT_UNIT } from './constants'; import { selectBitcoinUtxos } from '@rosen-bridge/bitcoin-utxo-selection'; import { BitcoinRosenExtractor } from '@rosen-bridge/rosen-extractor'; -import { RosenAmount, RosenTokens } from '@rosen-bridge/tokens'; +import { RosenAmount, TokenMap } from '@rosen-bridge/tokens'; class BitcoinChain extends AbstractUtxoChain { declare network: AbstractBitcoinNetwork; @@ -47,7 +47,7 @@ class BitcoinChain extends AbstractUtxoChain { constructor( network: AbstractBitcoinNetwork, configs: BitcoinConfigs, - tokens: RosenTokens, + tokens: TokenMap, signFunction: TssSignFunction, logger?: AbstractLogger ) { diff --git a/packages/chains/bitcoin/package.json b/packages/chains/bitcoin/package.json index 86299bf6..a8c6b02f 100644 --- a/packages/chains/bitcoin/package.json +++ b/packages/chains/bitcoin/package.json @@ -34,10 +34,10 @@ }, "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", - "@rosen-bridge/bitcoin-utxo-selection": "^0.2.2", + "@rosen-bridge/bitcoin-utxo-selection": "^0.3.0", "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "bitcoinjs-lib": "^6.1.5" } diff --git a/packages/chains/bitcoin/tests/BitcoinChain.spec.ts b/packages/chains/bitcoin/tests/BitcoinChain.spec.ts index 84cf85d1..0638316c 100644 --- a/packages/chains/bitcoin/tests/BitcoinChain.spec.ts +++ b/packages/chains/bitcoin/tests/BitcoinChain.spec.ts @@ -18,6 +18,7 @@ import TestBitcoinNetwork from './network/TestBitcoinNetwork'; import { TestBitcoinChain } from './TestBitcoinChain'; import * as testData from './testData'; import * as testUtils from './testUtils'; +import { TokenMap } from '@rosen-bridge/tokens'; describe('BitcoinChain', () => { describe('generateTransaction', () => { @@ -49,7 +50,7 @@ describe('BitcoinChain', () => { getFeeRatioSpy.mockResolvedValue(1); // mock getCoveringBoxes, hasLockAddressEnoughAssets - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const getCovBoxesSpy = vi.spyOn(bitcoinChain as any, 'getCoveringBoxes'); getCovBoxesSpy.mockResolvedValue({ covered: true, @@ -109,7 +110,7 @@ describe('BitcoinChain', () => { */ it('should throw error when lock address does not have enough assets', async () => { // mock hasLockAddressEnoughAssets - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const hasLockAddressEnoughAssetsSpy = vi.spyOn( bitcoinChain, 'hasLockAddressEnoughAssets' @@ -140,7 +141,7 @@ describe('BitcoinChain', () => { */ it('should throw error when bank boxes can not cover order assets', async () => { // mock getCoveringBoxes, hasLockAddressEnoughAssets - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const getCovBoxesSpy = vi.spyOn(bitcoinChain as any, 'getCoveringBoxes'); getCovBoxesSpy.mockResolvedValue({ covered: false, @@ -191,7 +192,7 @@ describe('BitcoinChain', () => { // mock getCoveringBoxes, hasLockAddressEnoughAssets const bitcoinChain = - testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); const getCovBoxesSpy = vi.spyOn(bitcoinChain as any, 'getCoveringBoxes'); getCovBoxesSpy.mockResolvedValue({ covered: true, @@ -273,7 +274,7 @@ describe('BitcoinChain', () => { ); // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); // check returned value const result = await bitcoinChain.getTransactionAssets(paymentTx); @@ -299,7 +300,7 @@ describe('BitcoinChain', () => { // run test const bitcoinChain = - testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); // check returned value const result = await bitcoinChain.getTransactionAssets(paymentTx); @@ -321,7 +322,7 @@ describe('BitcoinChain', () => { * @expected * - it should return mocked transaction order */ - it('should extract transaction order successfully', () => { + it('should extract transaction order successfully', async () => { // mock PaymentTransaction const paymentTx = BitcoinTransaction.fromJson( testData.transaction2PaymentTransaction @@ -329,7 +330,7 @@ describe('BitcoinChain', () => { const expectedOrder = testData.transaction2Order; // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = bitcoinChain.extractTransactionOrder(paymentTx); // check returned value @@ -346,14 +347,14 @@ describe('BitcoinChain', () => { * @expected * - it should throw Error */ - it('should throw error when tx has OP_RETURN utxo', () => { + it('should throw error when tx has OP_RETURN utxo', async () => { // mock PaymentTransaction const paymentTx = BitcoinTransaction.fromJson( testData.transaction1PaymentTransaction ); // run test & check thrown exception - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); expect(() => { bitcoinChain.extractTransactionOrder(paymentTx); }).toThrow(Error); @@ -370,7 +371,7 @@ describe('BitcoinChain', () => { * @expected * - it should return mocked transaction order */ - it('should wrap transaction order successfully', () => { + it('should wrap transaction order successfully', async () => { // mock PaymentTransaction const paymentTx = BitcoinTransaction.fromJson( testData.transaction2PaymentTransaction @@ -379,7 +380,7 @@ describe('BitcoinChain', () => { // run test const bitcoinChain = - testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); const result = bitcoinChain.extractTransactionOrder(paymentTx); // check returned value @@ -409,7 +410,7 @@ describe('BitcoinChain', () => { const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); getFeeRatioSpy.mockResolvedValue(1); - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.verifyTransactionFee(paymentTx); expect(result).toEqual(true); @@ -434,7 +435,7 @@ describe('BitcoinChain', () => { const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); getFeeRatioSpy.mockResolvedValue(1.2); - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.verifyTransactionFee(paymentTx); expect(result).toEqual(false); @@ -455,14 +456,14 @@ describe('BitcoinChain', () => { * @expected * - it should return true */ - it('should return true when all extra conditions are met', () => { + it('should return true when all extra conditions are met', async () => { // mock a payment transaction const paymentTx = BitcoinTransaction.fromJson( testData.transaction2PaymentTransaction ); // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = bitcoinChain.verifyTransactionExtraConditions(paymentTx); // check returned value @@ -481,7 +482,7 @@ describe('BitcoinChain', () => { * @expected * - it should return false */ - it('should return false when change box address is wrong', () => { + it('should return false when change box address is wrong', async () => { // mock a payment transaction const paymentTx = BitcoinTransaction.fromJson( testData.transaction0PaymentTransaction @@ -490,10 +491,12 @@ describe('BitcoinChain', () => { // create a new BitcoinChain object with custom lock address const newConfigs = structuredClone(testUtils.configs); newConfigs.addresses.lock = 'bc1qs2qr0j7ta5pvdkv53egm38zymgarhq0ugr7x8j'; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.testTokenMap); const bitcoinChain = new BitcoinChain( network, newConfigs, - testData.testTokenMap, + tokenMap, testUtils.mockedSignFn ); @@ -531,7 +534,7 @@ describe('BitcoinChain', () => { const isBoxUnspentAndValidSpy = vi.spyOn(network, 'isBoxUnspentAndValid'); isBoxUnspentAndValidSpy.mockResolvedValue(true); - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.isTxValid(payment1); expect(result).toEqual({ @@ -567,7 +570,7 @@ describe('BitcoinChain', () => { .mockResolvedValue(true) .mockResolvedValueOnce(false); - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.isTxValid(payment1); expect(result).toEqual({ @@ -625,7 +628,10 @@ describe('BitcoinChain', () => { ); // run test - const bitcoinChain = testUtils.generateChainObject(network, signFunction); + const bitcoinChain = await testUtils.generateChainObject( + network, + signFunction + ); const result = await bitcoinChain.signTransaction(paymentTx, 0); // check returned value @@ -668,7 +674,10 @@ describe('BitcoinChain', () => { ); // run test - const bitcoinChain = testUtils.generateChainObject(network, signFunction); + const bitcoinChain = await testUtils.generateChainObject( + network, + signFunction + ); await expect(async () => { await bitcoinChain.signTransaction(paymentTx, 0); @@ -705,7 +714,7 @@ describe('BitcoinChain', () => { ); // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.rawTxToPaymentTransaction( Buffer.from(expectedTx.txBytes).toString('hex') ); @@ -728,12 +737,12 @@ describe('BitcoinChain', () => { * @expected * - it should return constructed BoxInfo */ - it('should get box info successfully', () => { + it('should get box info successfully', async () => { // mock a BitcoinUtxo with assets const rawBox = testData.lockUtxo; // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); // check returned value const result = (bitcoinChain as any).getBoxInfo(rawBox); @@ -744,12 +753,14 @@ describe('BitcoinChain', () => { }); }); - describe('getTransactionsBoxMapping', () => { + describe('getTransactionsBoxMapping', async () => { const network = new TestBitcoinNetwork(); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.testTokenMap); const testInstance = new TestBitcoinChain( network, testUtils.configs, - testData.testTokenMap, + tokenMap, null as any ); @@ -852,7 +863,7 @@ describe('BitcoinChain', () => { ); // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.verifyPaymentTransaction(paymentTx); // check returned value @@ -878,7 +889,7 @@ describe('BitcoinChain', () => { paymentTx.txId = testUtils.generateRandomId(); // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.verifyPaymentTransaction(paymentTx); // check returned value @@ -904,7 +915,7 @@ describe('BitcoinChain', () => { paymentTx.inputUtxos.pop(); // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.verifyPaymentTransaction(paymentTx); // check returned value @@ -933,7 +944,7 @@ describe('BitcoinChain', () => { }); // run test - const bitcoinChain = testUtils.generateChainObject(network); + const bitcoinChain = await testUtils.generateChainObject(network); const result = await bitcoinChain.verifyPaymentTransaction(paymentTx); // check returned value diff --git a/packages/chains/bitcoin/tests/network/TestBitcoinNetwork.ts b/packages/chains/bitcoin/tests/network/TestBitcoinNetwork.ts index 3c01f5cf..c9fc59b1 100644 --- a/packages/chains/bitcoin/tests/network/TestBitcoinNetwork.ts +++ b/packages/chains/bitcoin/tests/network/TestBitcoinNetwork.ts @@ -1,14 +1,12 @@ import { AbstractBitcoinNetwork, BitcoinTx, BitcoinUtxo } from '../../lib'; import { BlockInfo, TokenDetail } from '@rosen-chains/abstract-chain'; import { BitcoinRosenExtractor } from '@rosen-bridge/rosen-extractor'; +import { TokenMap } from '@rosen-bridge/tokens'; class TestBitcoinNetwork extends AbstractBitcoinNetwork { extractor = new BitcoinRosenExtractor( 'bc1qkgp89fjerymm5ltg0hygnumr0m2qa7n22gyw6h', - { - idKeys: {}, - tokens: [], - } + new TokenMap() ); notImplemented = () => { throw Error('Not implemented'); diff --git a/packages/chains/bitcoin/tests/testData.ts b/packages/chains/bitcoin/tests/testData.ts index e667cfa8..56209d55 100644 --- a/packages/chains/bitcoin/tests/testData.ts +++ b/packages/chains/bitcoin/tests/testData.ts @@ -1,59 +1,37 @@ import { RosenTokens } from '@rosen-bridge/tokens'; import { EventTrigger, PaymentOrder } from '@rosen-chains/abstract-chain'; -export const testTokenMap: RosenTokens = JSON.parse(` -{ - "idKeys" : { - "ergo" : "tokenId", - "cardano" : "tokenId", - "bitcoin" : "tokenId" - }, - "tokens" : [] -} -`); +export const testTokenMap: RosenTokens = []; -export const multiDecimalTokenMap: RosenTokens = JSON.parse(` -{ - "idKeys" : { - "ergo" : "tokenId", - "cardano" : "tokenId", - "bitcoin" : "tokenId" +export const multiDecimalTokenMap: RosenTokens = [ + { + ergo: { + tokenId: + '1c7435e608ab710c56bbe0f635e2a5e86ddf856f7d3d2d1d4dfefa62fbbfb9b4', + name: 'testBTC', + decimals: 3, + type: 'EIP-004', + residency: 'wrapped', + }, + cardano: { + tokenId: + '6d7cc9577a04be165cc4f2cf36f580dbeaf88f68e78f790805430940.72734254432d6c6f656e', + policyId: '6d7cc9577a04be165cc4f2cf36f580dbeaf88f68e78f790805430940', + assetName: '72734254432d6c6f656e', + name: 'rsBTC-loen', + decimals: 6, + type: 'CIP26', + residency: 'wrapped', + }, + bitcoin: { + tokenId: 'btc', + name: 'BTC', + decimals: 8, + type: 'native', + residency: 'native', + }, }, - "tokens" : [ - { - "ergo": { - "tokenId": "1c7435e608ab710c56bbe0f635e2a5e86ddf856f7d3d2d1d4dfefa62fbbfb9b4", - "name": "testBTC", - "decimals": 3, - "metaData": { - "type": "EIP-004", - "residency": "wrapped" - } - }, - "cardano": { - "tokenId": "6d7cc9577a04be165cc4f2cf36f580dbeaf88f68e78f790805430940.72734254432d6c6f656e", - "policyId": "6d7cc9577a04be165cc4f2cf36f580dbeaf88f68e78f790805430940", - "assetName": "72734254432d6c6f656e", - "name": "rsBTC-loen", - "decimals": 6, - "metaData": { - "type": "CIP26", - "residency": "wrapped" - } - }, - "bitcoin": { - "tokenId": "btc", - "name": "BTC", - "decimals": 8, - "metaData": { - "type": "native", - "residency": "native" - } - } - } - ] -} -`); +]; export const transaction0PaymentTransaction = `{ "network": "bitcoin", diff --git a/packages/chains/bitcoin/tests/testUtils.ts b/packages/chains/bitcoin/tests/testUtils.ts index fcb5dff3..f054aa4a 100644 --- a/packages/chains/bitcoin/tests/testUtils.ts +++ b/packages/chains/bitcoin/tests/testUtils.ts @@ -2,6 +2,7 @@ import { randomBytes } from 'crypto'; import * as testData from './testData'; import { BitcoinChain, BitcoinConfigs, TssSignFunction } from '../lib'; import TestBitcoinNetwork from './network/TestBitcoinNetwork'; +import { TokenMap } from '@rosen-bridge/tokens'; export const generateRandomId = (): string => randomBytes(32).toString('hex'); @@ -36,20 +37,19 @@ export const mockedSignFn = () => signature: '', signatureRecovery: '', }); -export const generateChainObject = ( +export const generateChainObject = async ( network: TestBitcoinNetwork, signFn: TssSignFunction = mockedSignFn ) => { - return new BitcoinChain(network, configs, testData.testTokenMap, signFn); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.testTokenMap); + return new BitcoinChain(network, configs, tokenMap, signFn); }; -export const generateChainObjectWithMultiDecimalTokenMap = ( +export const generateChainObjectWithMultiDecimalTokenMap = async ( network: TestBitcoinNetwork, signFn: TssSignFunction = mockedSignFn ) => { - return new BitcoinChain( - network, - configs, - testData.multiDecimalTokenMap, - signFn - ); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.multiDecimalTokenMap); + return new BitcoinChain(network, configs, tokenMap, signFn); }; diff --git a/packages/chains/cardano/lib/CardanoChain.ts b/packages/chains/cardano/lib/CardanoChain.ts index 01b5bb77..e9967dd4 100644 --- a/packages/chains/cardano/lib/CardanoChain.ts +++ b/packages/chains/cardano/lib/CardanoChain.ts @@ -4,7 +4,7 @@ import { hash_transaction, } from '@emurgo/cardano-serialization-lib-nodejs'; import { AbstractLogger } from '@rosen-bridge/abstract-logger'; -import { RosenTokens } from '@rosen-bridge/tokens'; +import { TokenMap } from '@rosen-bridge/tokens'; import { AbstractUtxoChain, AssetBalance, @@ -49,7 +49,7 @@ class CardanoChain extends AbstractUtxoChain { constructor( network: AbstractCardanoNetwork, configs: CardanoConfigs, - tokens: RosenTokens, + tokens: TokenMap, signFunction: (txHash: Uint8Array) => Promise, logger?: AbstractLogger ) { diff --git a/packages/chains/cardano/package.json b/packages/chains/cardano/package.json index e14c5224..b530035a 100644 --- a/packages/chains/cardano/package.json +++ b/packages/chains/cardano/package.json @@ -23,8 +23,8 @@ "@emurgo/cardano-serialization-lib-nodejs": "^11.3.1", "@rosen-bridge/abstract-logger": "^2.0.1", "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "bech32": "^2.0.0" }, diff --git a/packages/chains/cardano/tests/CardanoChain.spec.ts b/packages/chains/cardano/tests/CardanoChain.spec.ts index eb8b66c1..fac9c2e9 100644 --- a/packages/chains/cardano/tests/CardanoChain.spec.ts +++ b/packages/chains/cardano/tests/CardanoChain.spec.ts @@ -13,6 +13,7 @@ import { import { Transaction } from '@emurgo/cardano-serialization-lib-nodejs'; import JsonBI from '@rosen-bridge/json-bigint'; import JsonBigInt from '@rosen-bridge/json-bigint'; +import { TokenMap } from '@rosen-bridge/tokens'; describe('CardanoChain', () => { const bankBoxes = TestUtils.mockBankBoxes(); @@ -47,7 +48,7 @@ describe('CardanoChain', () => { getSlotSpy.mockResolvedValue(100); // mock getCoveringBoxes, hasLockAddressEnoughAssets - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const getCovBoxesSpy = vi.spyOn(cardanoChain as any, 'getCoveringBoxes'); getCovBoxesSpy.mockResolvedValue({ covered: true, @@ -139,7 +140,7 @@ describe('CardanoChain', () => { getSlotSpy.mockResolvedValue(200); // mock getCoveringBoxes, hasLockAddressEnoughAssets - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const getCovBoxesSpy = vi.spyOn(cardanoChain as any, 'getCoveringBoxes'); const mockedBoxes = bankBoxes.slice(2); getCovBoxesSpy.mockResolvedValue({ @@ -209,7 +210,7 @@ describe('CardanoChain', () => { */ it('should throw error when lock address does not have enough assets', async () => { // mock hasLockAddressEnoughAssets - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const hasLockAddressEnoughAssetsSpy = vi.spyOn( cardanoChain, 'hasLockAddressEnoughAssets' @@ -240,7 +241,7 @@ describe('CardanoChain', () => { */ it('should throw error when bank boxes can not cover order assets', async () => { // mock getCoveringBoxes, hasLockAddressEnoughAssets - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const getCovBoxesSpy = vi.spyOn(cardanoChain as any, 'getCoveringBoxes'); getCovBoxesSpy.mockResolvedValue({ covered: false, @@ -292,7 +293,7 @@ describe('CardanoChain', () => { // mock getCoveringBoxes, hasLockAddressEnoughAssets const cardanoChain = - TestUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await TestUtils.generateChainObjectWithMultiDecimalTokenMap(network); const getCovBoxesSpy = vi.spyOn(cardanoChain as any, 'getCoveringBoxes'); const mockedBoxes = bankBoxes.slice(2); getCovBoxesSpy.mockResolvedValue({ @@ -365,7 +366,7 @@ describe('CardanoChain', () => { * @expected * - it should return mocked transaction order */ - it('should extract transaction order successfully', () => { + it('should extract transaction order successfully', async () => { // mock PaymentTransaction const paymentTx = CardanoTransaction.fromJson( TestData.transaction1PaymentTransaction @@ -373,7 +374,7 @@ describe('CardanoChain', () => { const expectedOrder = TestData.transaction1Order; // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = cardanoChain.extractTransactionOrder(paymentTx); // check returned value @@ -391,7 +392,7 @@ describe('CardanoChain', () => { * @expected * - it should return mocked transaction order */ - it('should wrap transaction order successfully', () => { + it('should wrap transaction order successfully', async () => { // mock PaymentTransaction const paymentTx = CardanoTransaction.fromJson( TestData.transaction1PaymentTransaction @@ -400,7 +401,7 @@ describe('CardanoChain', () => { // call the function const cardanoChain = - TestUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await TestUtils.generateChainObjectWithMultiDecimalTokenMap(network); const result = cardanoChain.extractTransactionOrder(paymentTx); // check returned value @@ -421,12 +422,12 @@ describe('CardanoChain', () => { * @expected * - it should return constructed BoxInfo */ - it('should get box info successfully', () => { + it('should get box info successfully', async () => { // mock a CardanoBox with assets const rawBox = bankBoxes[0]; // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); // check returned value const result = (cardanoChain as any).getBoxInfo(rawBox); @@ -465,7 +466,10 @@ describe('CardanoChain', () => { ); // call the function - const cardanoChain = TestUtils.generateChainObject(network, signFunction); + const cardanoChain = await TestUtils.generateChainObject( + network, + signFunction + ); const result = await cardanoChain.signTransaction(paymentTx, 0); // check returned value @@ -497,7 +501,10 @@ describe('CardanoChain', () => { ); // call the function - const cardanoChain = TestUtils.generateChainObject(network, signFunction); + const cardanoChain = await TestUtils.generateChainObject( + network, + signFunction + ); await expect(async () => { await cardanoChain.signTransaction(paymentTx, 0); @@ -526,7 +533,7 @@ describe('CardanoChain', () => { ); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); // check returned value const result = await cardanoChain.getTransactionAssets(paymentTx); @@ -551,7 +558,7 @@ describe('CardanoChain', () => { ); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); // check returned value const result = await cardanoChain.getTransactionAssets(paymentTx); @@ -577,7 +584,7 @@ describe('CardanoChain', () => { // call the function const cardanoChain = - TestUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await TestUtils.generateChainObjectWithMultiDecimalTokenMap(network); // check returned value const result = await cardanoChain.getTransactionAssets(paymentTx); @@ -612,7 +619,7 @@ describe('CardanoChain', () => { ); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.getMempoolBoxMapping(trackingAddress); // check returned value @@ -647,7 +654,7 @@ describe('CardanoChain', () => { // call the function const trackingTokenId = 'a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59'; - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.getMempoolBoxMapping( trackingAddress, trackingTokenId @@ -688,7 +695,7 @@ describe('CardanoChain', () => { vi.spyOn(network, 'getMempoolTransactions').mockResolvedValueOnce( transactions ); - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.getMempoolBoxMapping( trackingAddress, trackingTokenId @@ -704,7 +711,7 @@ describe('CardanoChain', () => { }); }); - describe('getTransactionsBoxMapping', () => { + describe('getTransactionsBoxMapping', async () => { const network = new TestCardanoNetwork(); class TestCardanoChain extends CardanoChain { callGetTransactionsBoxMapping = ( @@ -719,10 +726,12 @@ describe('CardanoChain', () => { ); }; } + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(TestData.testTokenMap); const testInstance = new TestCardanoChain( network, TestUtils.configs, - TestData.testTokenMap, + tokenMap, null as any ); @@ -866,7 +875,7 @@ describe('CardanoChain', () => { // call the function const txId = transactions[0].id; - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.isTxInMempool(txId); // check returned value @@ -892,7 +901,7 @@ describe('CardanoChain', () => { // call the function const txId = TestUtils.generateRandomId(); - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.isTxInMempool(txId); // check returned value @@ -932,7 +941,7 @@ describe('CardanoChain', () => { currentSlotSpy.mockResolvedValue(100); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.isTxValid(payment1); // check returned value @@ -964,7 +973,7 @@ describe('CardanoChain', () => { currentSlotSpy.mockResolvedValue(1000); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.isTxValid(payment1); // check returned value @@ -1009,7 +1018,7 @@ describe('CardanoChain', () => { currentSlotSpy.mockResolvedValue(100); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.isTxValid(payment1); // check returned value @@ -1051,7 +1060,7 @@ describe('CardanoChain', () => { currentSlotSpy.mockResolvedValue(100); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.isTxValid(payment1); // check returned value @@ -1086,7 +1095,7 @@ describe('CardanoChain', () => { ); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.verifyTransactionFee(paymentTx); // check returned value @@ -1111,7 +1120,7 @@ describe('CardanoChain', () => { ); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.verifyTransactionFee(paymentTx); // check returned value @@ -1133,15 +1142,17 @@ describe('CardanoChain', () => { * @expected * - it should return true */ - it('should return true when all extra conditions are met', () => { + it('should return true when all extra conditions are met', async () => { // mock a payment transaction const paymentTx = CardanoTransaction.fromJson( TestData.transaction1PaymentTransaction ); // call the function - const cardanoChain = TestUtils.generateChainObject(network); - const result = cardanoChain.verifyTransactionExtraConditions(paymentTx); + const cardanoChain = await TestUtils.generateChainObject(network); + const result = await cardanoChain.verifyTransactionExtraConditions( + paymentTx + ); // check returned value expect(result).toEqual(true); @@ -1158,14 +1169,14 @@ describe('CardanoChain', () => { * @expected * - it should return false */ - it('should return false when transaction has metadata', () => { + it('should return false when transaction has metadata', async () => { // mock a payment transaction const paymentTx = CardanoTransaction.fromJson( TestData.transaction3PaymentTransaction ); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = cardanoChain.verifyTransactionExtraConditions(paymentTx); // check returned value @@ -1184,7 +1195,7 @@ describe('CardanoChain', () => { * @expected * - it should return false */ - it('should return false when change box address is wrong', () => { + it('should return false when change box address is wrong', async () => { // mock a payment transaction const paymentTx = CardanoTransaction.fromJson( TestData.transaction1PaymentTransaction @@ -1193,10 +1204,12 @@ describe('CardanoChain', () => { // create a new CardanoChain object with custom lock address const newConfigs = structuredClone(TestUtils.configs); newConfigs.addresses.lock = 'TEST'; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(TestData.testTokenMap); const cardanoChain = new CardanoChain( network, newConfigs, - TestData.testTokenMap, + tokenMap, TestUtils.mockedSignFn ); @@ -1240,7 +1253,7 @@ describe('CardanoChain', () => { ); // call the function - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.rawTxToPaymentTransaction( rawTxJsonString ); @@ -1271,7 +1284,7 @@ describe('CardanoChain', () => { ); // run test - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.verifyPaymentTransaction(paymentTx); // check returned value @@ -1297,7 +1310,7 @@ describe('CardanoChain', () => { paymentTx.txId = TestUtils.generateRandomId(); // run test - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.verifyPaymentTransaction(paymentTx); // check returned value @@ -1323,7 +1336,7 @@ describe('CardanoChain', () => { paymentTx.inputUtxos.pop(); // run test - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.verifyPaymentTransaction(paymentTx); // check returned value @@ -1352,7 +1365,7 @@ describe('CardanoChain', () => { }); // run test - const cardanoChain = TestUtils.generateChainObject(network); + const cardanoChain = await TestUtils.generateChainObject(network); const result = await cardanoChain.verifyPaymentTransaction(paymentTx); // check returned value diff --git a/packages/chains/cardano/tests/network/TestCardanoNetwork.ts b/packages/chains/cardano/tests/network/TestCardanoNetwork.ts index bddca3d6..0ec07f8f 100644 --- a/packages/chains/cardano/tests/network/TestCardanoNetwork.ts +++ b/packages/chains/cardano/tests/network/TestCardanoNetwork.ts @@ -11,14 +11,12 @@ import { } from '../../lib/types'; import { CardanoRosenExtractor } from '@rosen-bridge/rosen-extractor'; import { protocolParameters } from '../testUtils'; +import { TokenMap } from '@rosen-bridge/tokens'; class TestCardanoNetwork extends AbstractCardanoNetwork { extractor = new CardanoRosenExtractor( '9es3xKFSehNNwCpuNpY31ScAubDqeLbSWwaCysjN1ee51bgHKTq', - { - idKeys: {}, - tokens: [], - } + new TokenMap() ); notImplemented = () => { throw Error('Not implemented'); diff --git a/packages/chains/cardano/tests/testData.ts b/packages/chains/cardano/tests/testData.ts index c6381848..75dae92b 100644 --- a/packages/chains/cardano/tests/testData.ts +++ b/packages/chains/cardano/tests/testData.ts @@ -6,210 +6,166 @@ import { import { CardanoTx } from '../lib'; import { RosenTokens } from '@rosen-bridge/tokens'; -export const testTokenMap: RosenTokens = { - idKeys: { - ergo: 'tokenId', - cardano: 'tokenId', +export const testTokenMap: RosenTokens = [ + { + ergo: { + tokenId: 'erg', + name: 'ERG', + decimals: 9, + type: 'ERG', + residency: 'native', + }, + cardano: { + tokenId: + 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286.5273744552477654657374', + name: 'RstERGvTest', + policyId: 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286', + assetName: '5273744552477654657374', + decimals: 9, + type: 'native', + residency: 'wrapped', + }, }, - tokens: [ - { - ergo: { - tokenId: 'erg', - name: 'ERG', - decimals: 9, - metaData: { - type: 'ERG', - residency: 'native', - }, - }, - cardano: { - tokenId: - 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286.5273744552477654657374', - name: 'RstERGvTest', - policyId: 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286', - assetName: '5273744552477654657374', - decimals: 9, - metaData: { - type: 'native', - residency: 'wrapped', - }, - }, + { + ergo: { + tokenId: + '4ed6449240d166b0e44c529b5bf06d210796473d3811b9aa0e15329599164c24', + name: 'RST-ADA.V-test', + decimals: 6, + type: 'EIP-004', + residency: 'wrapped', }, - { - ergo: { - tokenId: - '4ed6449240d166b0e44c529b5bf06d210796473d3811b9aa0e15329599164c24', - name: 'RST-ADA.V-test', - decimals: 6, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: 'ada', - name: 'ADA', - policyId: '', - assetName: '414441', - decimals: 6, - metaData: { - type: 'ADA', - residency: 'native', - }, - }, + cardano: { + tokenId: 'ada', + name: 'ADA', + policyId: '', + assetName: '414441', + decimals: 6, + type: 'ADA', + residency: 'native', }, - { - ergo: { - tokenId: - 'c59e86ef9d0280de582d6266add18fca339a77dfb321268e83033fe47101dc4d', - name: 'RST-Cardano-Token.V-test', - decimals: 4, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: - 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be.43617264616e6f546f6b656e7654657374', - name: 'CardanoTokenvTest', - policyId: 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be', - assetName: '43617264616e6f546f6b656e7654657374', - decimals: 4, - metaData: { - type: 'native', - residency: 'native', - }, - }, + }, + { + ergo: { + tokenId: + 'c59e86ef9d0280de582d6266add18fca339a77dfb321268e83033fe47101dc4d', + name: 'RST-Cardano-Token.V-test', + decimals: 4, + type: 'EIP-004', + residency: 'wrapped', }, - { - ergo: { - tokenId: - 'a1143e81c5ab485a807e6f0f76af1dd70cc5359b29e0b1229d0edfe490d33b67', - name: 'Ergo-Token.V-test', - decimals: 4, - metaData: { - type: 'EIP-004', - residency: 'native', - }, - }, - cardano: { - tokenId: - '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b.5273744572676f546f6b656e7654657374', - name: 'RstErgoTokenvTest', - policyId: '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b', - assetName: '5273744572676f546f6b656e7654657374', - decimals: 4, - metaData: { - type: 'native', - residency: 'wrapped', - }, - }, + cardano: { + tokenId: + 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be.43617264616e6f546f6b656e7654657374', + name: 'CardanoTokenvTest', + policyId: 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be', + assetName: '43617264616e6f546f6b656e7654657374', + decimals: 4, + type: 'native', + residency: 'native', }, - ], -}; -export const multiDecimalTokenMap: RosenTokens = { - idKeys: { - ergo: 'tokenId', - cardano: 'tokenId', }, - tokens: [ - { - ergo: { - tokenId: 'erg', - name: 'erg', - decimals: 9, - metaData: { - type: 'ERG', - residency: 'native', - }, - }, - cardano: { - tokenId: - 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286.5273744552477654657374', - name: 'RstERGvTest', - policyId: 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286', - assetName: '5273744552477654657374', - decimals: 10, - metaData: { - type: 'native', - residency: 'wrapped', - }, - }, + { + ergo: { + tokenId: + 'a1143e81c5ab485a807e6f0f76af1dd70cc5359b29e0b1229d0edfe490d33b67', + name: 'Ergo-Token.V-test', + decimals: 4, + type: 'EIP-004', + residency: 'native', }, - { - ergo: { - tokenId: - '4ed6449240d166b0e44c529b5bf06d210796473d3811b9aa0e15329599164c24', - name: 'RST-ADA.V-test', - decimals: 4, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: 'ada', - name: 'ADA', - policyId: '', - assetName: '414441', - decimals: 6, - metaData: { - type: 'ADA', - residency: 'native', - }, - }, + cardano: { + tokenId: + '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b.5273744572676f546f6b656e7654657374', + name: 'RstErgoTokenvTest', + policyId: '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b', + assetName: '5273744572676f546f6b656e7654657374', + decimals: 4, + type: 'native', + residency: 'wrapped', }, - { - ergo: { - tokenId: - 'c59e86ef9d0280de582d6266add18fca339a77dfb321268e83033fe47101dc4d', - name: 'RST-Cardano-Token.V-test', - decimals: 4, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: - 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be.43617264616e6f546f6b656e7654657374', - name: 'CardanoTokenvTest', - policyId: 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be', - assetName: '43617264616e6f546f6b656e7654657374', - decimals: 5, - metaData: { - type: 'native', - residency: 'native', - }, - }, + }, +]; +export const multiDecimalTokenMap: RosenTokens = [ + { + ergo: { + tokenId: 'erg', + name: 'erg', + decimals: 9, + type: 'ERG', + residency: 'native', }, - { - ergo: { - tokenId: - 'a1143e81c5ab485a807e6f0f76af1dd70cc5359b29e0b1229d0edfe490d33b67', - name: 'Ergo-Token.V-test', - decimals: 4, - metaData: { - type: 'EIP-004', - residency: 'native', - }, - }, - cardano: { - tokenId: - '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b.5273744572676f546f6b656e7654657374', - name: 'RstErgoTokenvTest', - policyId: '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b', - assetName: '5273744572676f546f6b656e7654657374', - decimals: 1, - metaData: { - type: 'native', - residency: 'wrapped', - }, - }, + cardano: { + tokenId: + 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286.5273744552477654657374', + name: 'RstERGvTest', + policyId: 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286', + assetName: '5273744552477654657374', + decimals: 10, + type: 'native', + residency: 'wrapped', }, - ], -}; + }, + { + ergo: { + tokenId: + '4ed6449240d166b0e44c529b5bf06d210796473d3811b9aa0e15329599164c24', + name: 'RST-ADA.V-test', + decimals: 4, + type: 'EIP-004', + residency: 'wrapped', + }, + cardano: { + tokenId: 'ada', + name: 'ADA', + policyId: '', + assetName: '414441', + decimals: 6, + type: 'ADA', + residency: 'native', + }, + }, + { + ergo: { + tokenId: + 'c59e86ef9d0280de582d6266add18fca339a77dfb321268e83033fe47101dc4d', + name: 'RST-Cardano-Token.V-test', + decimals: 4, + type: 'EIP-004', + residency: 'wrapped', + }, + cardano: { + tokenId: + 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be.43617264616e6f546f6b656e7654657374', + name: 'CardanoTokenvTest', + policyId: 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be', + assetName: '43617264616e6f546f6b656e7654657374', + decimals: 5, + type: 'native', + residency: 'native', + }, + }, + { + ergo: { + tokenId: + 'a1143e81c5ab485a807e6f0f76af1dd70cc5359b29e0b1229d0edfe490d33b67', + name: 'Ergo-Token.V-test', + decimals: 4, + type: 'EIP-004', + residency: 'native', + }, + cardano: { + tokenId: + '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b.5273744572676f546f6b656e7654657374', + name: 'RstErgoTokenvTest', + policyId: '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b', + assetName: '5273744572676f546f6b656e7654657374', + decimals: 1, + type: 'native', + residency: 'wrapped', + }, + }, +]; export const transaction1 = ` { diff --git a/packages/chains/cardano/tests/testUtils.ts b/packages/chains/cardano/tests/testUtils.ts index 113e7a72..2285e77a 100644 --- a/packages/chains/cardano/tests/testUtils.ts +++ b/packages/chains/cardano/tests/testUtils.ts @@ -2,7 +2,7 @@ import { randomBytes } from 'crypto'; import { CardanoConfigs, CardanoUtxo } from '../lib/types'; import * as CardanoWasm from '@emurgo/cardano-serialization-lib-nodejs'; import CardanoUtils from '../lib/CardanoUtils'; -import { RosenTokens } from '@rosen-bridge/tokens'; +import { RosenTokens, TokenMap } from '@rosen-bridge/tokens'; import { multiDecimalTokenMap, testTokenMap } from './testData'; import TestCardanoNetwork from './network/TestCardanoNetwork'; import { CardanoChain } from '../lib'; @@ -154,15 +154,19 @@ export const configs: CardanoConfigs = { 'bcb07faa6c0f19e2f2587aa9ef6f43a68fc0135321216a71dc87c8527af4ca6a', }; export const mockedSignFn = () => Promise.resolve(''); -export const generateChainObject = ( +export const generateChainObject = async ( network: TestCardanoNetwork, signFn: (txHash: Uint8Array) => Promise = mockedSignFn ) => { - return new CardanoChain(network, configs, testTokenMap, signFn); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testTokenMap); + return new CardanoChain(network, configs, tokenMap, signFn); }; -export const generateChainObjectWithMultiDecimalTokenMap = ( +export const generateChainObjectWithMultiDecimalTokenMap = async ( network: TestCardanoNetwork, signFn: (txHash: Uint8Array) => Promise = mockedSignFn ) => { - return new CardanoChain(network, configs, multiDecimalTokenMap, signFn); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(multiDecimalTokenMap); + return new CardanoChain(network, configs, tokenMap, signFn); }; diff --git a/packages/chains/doge/.eslintignore b/packages/chains/doge/.eslintignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/chains/doge/.eslintignore @@ -0,0 +1 @@ +dist diff --git a/packages/chains/doge/README.md b/packages/chains/doge/README.md new file mode 100644 index 00000000..c5db6a1f --- /dev/null +++ b/packages/chains/doge/README.md @@ -0,0 +1,24 @@ +# @rosen-chains/doge + +## Table of contents + +- [Introduction](#introduction) +- [Installation](#installation) + +## Introduction + +this project contains doge chain for Rosen-bridge + +## Installation + +npm: + +```sh +npm i @rosen-chains/doge +``` + +yarn: + +```sh +yarn add @rosen-chains/doge +``` diff --git a/packages/chains/doge/lib/DogeChain.ts b/packages/chains/doge/lib/DogeChain.ts new file mode 100644 index 00000000..9190fbae --- /dev/null +++ b/packages/chains/doge/lib/DogeChain.ts @@ -0,0 +1,785 @@ +import { AbstractLogger } from '@rosen-bridge/abstract-logger'; +import { + AbstractUtxoChain, + AssetBalance, + BlockInfo, + BoxInfo, + ChainUtils, + CoveringBoxes, + GET_BOX_API_LIMIT, + NotEnoughAssetsError, + NotEnoughValidBoxesError, + PaymentOrder, + PaymentTransaction, + SigningStatus, + SinglePayment, + TransactionAssetBalance, + TransactionType, + ValidityStatus, +} from '@rosen-chains/abstract-chain'; +import AbstractDogeNetwork from './network/AbstractDogeNetwork'; +import DogeTransaction from './DogeTransaction'; +import { DogeConfigs, DogeTx, DogeUtxo, TssSignFunction } from './types'; +import Serializer from './Serializer'; +import { Psbt, Transaction, address, script } from 'bitcoinjs-lib'; +import JsonBigInt from '@rosen-bridge/json-bigint'; +import { + estimateTxFee, + getPsbtTxInputBoxId, + isPsbtFinalized, +} from './dogeUtils'; +import { + DOGE_CHAIN, + DOGE, + MINIMUM_UTXO_VALUE, + DOGE_NETWORK, + DOGE_INPUT_SIZE, + DOGE_OUTPUT_SIZE, + DOGE_TX_BASE_SIZE, +} from './constants'; +import { DogeRosenExtractor } from '@rosen-bridge/rosen-extractor'; +import { RosenAmount, TokenMap } from '@rosen-bridge/tokens'; +import { selectBitcoinUtxos } from '@rosen-bridge/bitcoin-utxo-selection'; + +class DogeChain extends AbstractUtxoChain { + declare network: AbstractDogeNetwork; + declare configs: DogeConfigs; + CHAIN = DOGE_CHAIN; + NATIVE_TOKEN_ID = DOGE; + extractor: DogeRosenExtractor; + protected signFunction: TssSignFunction; + protected lockScript: string; + + constructor( + network: AbstractDogeNetwork, + configs: DogeConfigs, + tokens: TokenMap, + signFunction: TssSignFunction, + logger?: AbstractLogger + ) { + super(network, configs, tokens, logger); + this.extractor = new DogeRosenExtractor( + configs.addresses.lock, + tokens, + logger + ); + this.signFunction = signFunction; + this.lockScript = address + .toOutputScript(this.configs.addresses.lock, DOGE_NETWORK) + .toString('hex'); + } + + /** + * generates unsigned PaymentTransaction for payment order + * @param eventId the id of event + * @param txType transaction type + * @param order the payment order (list of single payments) + * @param unsignedTransactions ongoing unsigned PaymentTransactions (used for preventing double spend) + * @param serializedSignedTransactions the serialized string of ongoing signed transactions (used for chaining transaction) + * @returns the generated PaymentTransaction + */ + generateMultipleTransactions = async ( + eventId: string, + txType: TransactionType, + order: PaymentOrder, + unsignedTransactions: PaymentTransaction[], + serializedSignedTransactions: string[] + ): Promise => { + this.logger.debug( + `Generating Dogecoin transaction for Order: ${JsonBigInt.stringify( + order + )}` + ); + const feeRatio = await this.network.getFeeRatio(); + + // calculate required assets + const minUtxoValue = this.getMinimumNativeToken(); + const requiredAssets = order + .map((order) => order.assets) + .reduce(ChainUtils.sumAssetBalance, { + nativeToken: minUtxoValue, + tokens: [], + }); + this.logger.debug( + `Required assets: ${JsonBigInt.stringify(requiredAssets)}` + ); + + if (!(await this.hasLockAddressEnoughAssets(requiredAssets))) { + const neededDoge = this.unwrapDoge(requiredAssets.nativeToken); + throw new NotEnoughAssetsError( + `Locked assets cannot cover required assets. DOGE: ${neededDoge.amount.toString()}` + ); + } + + const forbiddenBoxIds = unsignedTransactions.flatMap((paymentTx) => { + const inputs = Serializer.deserialize(paymentTx.txBytes).txInputs; + const ids: string[] = []; + for (let i = 0; i < inputs.length; i++) + ids.push(getPsbtTxInputBoxId(inputs[i])); + + return ids; + }); + + // we chain the signed transactions + // we avoid using the unsigned transactions' inputs + const finalizedSignedTransactions = serializedSignedTransactions.filter( + (serializedTx) => { + if ( + isPsbtFinalized(Psbt.fromHex(serializedTx, { network: DOGE_NETWORK })) + ) { + return true; + } else { + const unsignedPsbt = Psbt.fromHex(serializedTx, { + network: DOGE_NETWORK, + }); + for (let i = 0; i < unsignedPsbt.txInputs.length; i++) { + forbiddenBoxIds.push(getPsbtTxInputBoxId(unsignedPsbt.txInputs[i])); + } + return false; + } + } + ); + + // Save the hex bytes of the signed transaction in case their utxos are going to be spent in this transaction + const txToHex: Record = {}; + for (const serializedTx of finalizedSignedTransactions) { + const psbt = Psbt.fromHex(serializedTx, { network: DOGE_NETWORK }); + const tx = psbt.extractTransaction(true); + txToHex[tx.getId()] = tx.toHex(); + } + const trackMap = this.getTransactionsBoxMapping( + finalizedSignedTransactions.map((serializedTx) => + Psbt.fromHex(serializedTx, { network: DOGE_NETWORK }) + ), + this.configs.addresses.lock + ); + + // fetch input boxes + const unwrappedRequiredAssets = ChainUtils.unwrapAssetBalance( + requiredAssets, + this.tokenMap, + this.NATIVE_TOKEN_ID, + this.CHAIN + ); + const coveredBoxes = await this.getCoveringBoxes( + this.configs.addresses.lock, + unwrappedRequiredAssets, + forbiddenBoxIds, + trackMap + ); + if (!coveredBoxes.covered) { + const neededDoge = unwrappedRequiredAssets.nativeToken; + throw new NotEnoughValidBoxesError( + `Available boxes didn't cover required assets. DOGE: ${neededDoge.toString()}` + ); + } + + // add inputs + const psbt = new Psbt({ network: DOGE_NETWORK }); + for (const box of coveredBoxes.boxes) { + if (!txToHex[box.txId]) { + txToHex[box.txId] = await this.network.getTransactionHex(box.txId); + } + psbt.addInput({ + hash: box.txId, + index: box.index, + nonWitnessUtxo: Buffer.from(txToHex[box.txId], 'hex'), + redeemScript: Buffer.from(this.lockScript, 'hex'), + }); + } + // calculate input boxes assets + let remainingDoge = coveredBoxes.boxes.reduce((a, b) => a + b.value, 0n); + this.logger.debug(`Input DOGE: ${remainingDoge}`); + + // add outputs + order.forEach((order) => { + if (order.extra) { + throw Error('Dogecoin does not support extra data in payment order'); + } + if (order.assets.tokens.length) { + throw Error('Dogecoin does not support tokens in payment order'); + } + const orderDoge = this.unwrapDoge(order.assets.nativeToken).amount; + + // reduce order value from remaining assets + remainingDoge -= orderDoge; + + // create order output + psbt.addOutput({ + script: address.toOutputScript(order.address, DOGE_NETWORK), + value: Number(orderDoge), + }); + }); + + // create change output + this.logger.debug(`Remaining DOGE: ${remainingDoge}`); + const estimatedFee = estimateTxFee( + psbt.txInputs.length, + psbt.txOutputs.length + 1, + feeRatio + ); + this.logger.debug(`Estimated Fee: ${estimatedFee}`); + remainingDoge -= estimatedFee; + psbt.addOutput({ + script: Buffer.from(this.lockScript, 'hex'), + value: Number(remainingDoge), + }); + + // create the transaction + const txId = Transaction.fromBuffer(psbt.data.getTransaction()).getId(); + const txBytes = Serializer.serialize(psbt); + + const dogeTx = new DogeTransaction( + txId, + eventId, + txBytes, + txType, + coveredBoxes.boxes.map((box) => JsonBigInt.stringify(box)) + ); + + this.logger.info( + `Dogecoin transaction [${txId}] as type [${txType}] generated for event [${eventId}]` + ); + return [dogeTx]; + }; + + /** + * gets input and output assets of a PaymentTransaction + * @param transaction the PaymentTransaction + * @returns an object containing the amount of input and output assets + */ + getTransactionAssets = async ( + transaction: PaymentTransaction + ): Promise => { + const dogeTx = transaction as DogeTransaction; + + let txDoge = 0n; + const inputUtxos = Array.from(new Set(dogeTx.inputUtxos)); + for (let i = 0; i < inputUtxos.length; i++) { + const input = JsonBigInt.parse(inputUtxos[i]) as DogeUtxo; + txDoge += input.value; + } + + // no need to calculate outDoge, because: inDoge = outDoge + fee + const wrappedValue = this.wrapDoge(txDoge).amount; + return { + inputAssets: { + nativeToken: wrappedValue, + tokens: [], + }, + outputAssets: { + nativeToken: wrappedValue, + tokens: [], + }, + }; + }; + + /** + * gets the minimum amount of native token for transferring asset + * @returns the minimum amount + */ + getMinimumNativeToken = (): bigint => { + return this.tokenMap.wrapAmount( + this.NATIVE_TOKEN_ID, + BigInt(MINIMUM_UTXO_VALUE), + this.CHAIN + ).amount; + }; + + /** + * extracts payment order of a PaymentTransaction + * @param transaction the PaymentTransaction + * @returns the transaction payment order (list of single payments) + */ + extractTransactionOrder = (transaction: PaymentTransaction): PaymentOrder => { + const tx = Serializer.deserialize(transaction.txBytes); + + const order: PaymentOrder = []; + for (let i = 0; i < tx.txOutputs.length; i++) { + const output = tx.txOutputs[i]; + + // skip change box (last box & address equal to bank address) + if ( + i === tx.txOutputs.length - 1 && + output.script.toString('hex') === this.lockScript + ) + continue; + + const payment: SinglePayment = { + address: address.fromOutputScript(output.script, DOGE_NETWORK), + assets: { + nativeToken: this.wrapDoge(BigInt(output.value)).amount, + tokens: [], + }, + }; + order.push(payment); + } + return order; + }; + + /** + * verifies transaction fee for a PaymentTransaction + * @param transaction the PaymentTransaction + * @returns true if the transaction fee is verified + */ + verifyTransactionFee = async ( + transaction: PaymentTransaction + ): Promise => { + const tx = Serializer.deserialize(transaction.txBytes); + const dogeTx = transaction as DogeTransaction; + + let inDoge = 0n; + const inputUtxos = Array.from(new Set(dogeTx.inputUtxos)); + for (let i = 0; i < inputUtxos.length; i++) { + const input = JsonBigInt.parse(inputUtxos[i]) as DogeUtxo; + inDoge += input.value; + } + + let outDoge = 0n; + for (let i = 0; i < tx.txOutputs.length; i++) { + const output = tx.txOutputs[i]; + outDoge += BigInt(output.value); + } + + const fee = inDoge - outDoge; + const estimatedFee = estimateTxFee( + tx.txInputs.length, + tx.txOutputs.length, + await this.network.getFeeRatio() + ); + + const feeDifferencePercent = Math.abs( + (Number(fee - estimatedFee) * 100) / Number(fee) + ); + if (feeDifferencePercent > this.configs.txFeeSlippage) { + this.logger.warn( + `Tx [${transaction.txId}] is not verified: Fee difference is too high. Slippage is higher than allowed value [${feeDifferencePercent} > ${this.configs.txFeeSlippage}]. fee: ${fee}, estimated fee: ${estimatedFee}` + ); + return false; + } + return true; + }; + + /** + * verifies no token burned in a PaymentTransaction + * @param transaction the PaymentTransaction + * @returns true if no token burned + */ + verifyNoTokenBurned = async ( + transaction: PaymentTransaction + ): Promise => { + // Dogecoin has no tokens and DOGE cannot be burned + return true; + }; + + /** + * verifies additional conditions for a DogeTransaction + * - check change box + * @param transaction the PaymentTransaction + * @returns true if the transaction is verified + */ + verifyTransactionExtraConditions = ( + transaction: PaymentTransaction + ): boolean => { + const tx = Serializer.deserialize(transaction.txBytes); + + // check change box + const changeBoxIndex = tx.txOutputs.length - 1; + const changeBox = tx.txOutputs[changeBoxIndex]; + if (changeBox.script.toString('hex') !== this.lockScript) { + this.logger.warn( + `Tx [${transaction.txId}] is not verified: Change box address is wrong` + ); + return false; + } + + return true; + }; + + /** + * verifies additional conditions for a event lock transaction + * @param transaction the lock transaction + * @param blockInfo + * @returns true if the transaction is verified + */ + verifyLockTransactionExtraConditions = async ( + transaction: DogeTx, + blockInfo: BlockInfo + ): Promise => { + return true; + }; + + /** + * checks if a transaction is still valid and can be sent to the network + * @param transaction the transaction + * @param signingStatus + * @returns true if the transaction is still valid + */ + isTxValid = async ( + transaction: PaymentTransaction, + signingStatus: SigningStatus = SigningStatus.Signed + ): Promise => { + const tx = Serializer.deserialize(transaction.txBytes); + for (let i = 0; i < tx.txInputs.length; i++) { + const boxId = getPsbtTxInputBoxId(tx.txInputs[i]); + if (!(await this.network.isBoxUnspentAndValid(boxId))) { + this.logger.info( + `Tx [${transaction.txId}] is invalid due to spending invalid input box [${boxId}] at index [${i}]` + ); + return { + isValid: false, + details: { + reason: `input [${i}] is spent or invalid`, + unexpected: false, + }, + }; + } + } + return { + isValid: true, + details: undefined, + }; + }; + + /** + * requests the corresponding signer service to sign the transaction + * @param transaction the transaction + * @param requiredSign the required number of sign + * @returns the signed transaction + */ + signTransaction = ( + transaction: PaymentTransaction + ): Promise => { + const psbt = Serializer.deserialize(transaction.txBytes); + const tx = Transaction.fromBuffer(psbt.data.getTransaction()); + const dogeTx = transaction as DogeTransaction; + + const signaturePromises: Promise[] = []; + for (let i = 0; i < dogeTx.inputUtxos.length; i++) { + const signMessage = tx.hashForSignature( + i, + Buffer.from(this.lockScript, 'hex'), + Transaction.SIGHASH_ALL + ); + + const signatureHex = this.signFunction(signMessage).then((response) => { + this.logger.debug( + `Input [${i}] of tx [${dogeTx.txId}] is signed. signature: ${response.signature}` + ); + return response.signature; + }); + signaturePromises.push(signatureHex); + } + + return Promise.all(signaturePromises).then((signatures) => { + const signedPsbt = this.buildSignedTransaction( + dogeTx.txBytes, + signatures + ); + // check if transaction can be finalized + signedPsbt.finalizeAllInputs().extractTransaction(true); + + // generate PaymentTransaction with signed Psbt + return new DogeTransaction( + dogeTx.txId, + dogeTx.eventId, + Serializer.serialize(signedPsbt), + dogeTx.txType, + dogeTx.inputUtxos + ); + }); + }; + + /** + * submits a transaction to the blockchain + * @param transaction the transaction + */ + submitTransaction = async ( + transaction: PaymentTransaction + ): Promise => { + // deserialize transaction + const tx = Serializer.deserialize(transaction.txBytes); + + // send transaction + try { + const response = await this.network.submitTransaction(tx); + this.logger.info( + `Dogecoin Transaction [${transaction.txId}] submitted. Response: ${response}` + ); + } catch (e) { + this.logger.warn( + `An error occurred while submitting Dogecoin transaction [${transaction.txId}]: ${e}` + ); + if (e instanceof Error && e.stack) { + this.logger.warn(e.stack); + } + } + }; + + /** + * checks if a transaction is in mempool (returns false if the chain has no mempool) + * @param transactionId the transaction id + * @returns true if the transaction is in mempool + */ + isTxInMempool = async (transactionId: string): Promise => { + return (await this.network.getMempoolTxIds()).includes(transactionId); + }; + + /** + * converts json representation of the payment transaction to PaymentTransaction + * @returns PaymentTransaction object + */ + PaymentTransactionFromJson = (jsonString: string): DogeTransaction => + DogeTransaction.fromJson(jsonString); + + /** + * generates PaymentTransaction object from psbt hex string + * @param psbtHex + * @returns PaymentTransaction object + */ + rawTxToPaymentTransaction = async ( + psbtHex: string + ): Promise => { + const tx = Psbt.fromHex(psbtHex, { network: DOGE_NETWORK }); + const txBytes = Serializer.serialize(tx); + const txId = Transaction.fromBuffer(tx.data.getTransaction()).getId(); + + const inputBoxes: Array = []; + const inputs = tx.txInputs; + for (let i = 0; i < inputs.length; i++) { + const boxId = getPsbtTxInputBoxId(inputs[i]); + const curUtxo = await this.network.getUtxo(boxId); + inputBoxes.push(curUtxo); + } + + const dogeTx = new DogeTransaction( + txId, + '', + txBytes, + TransactionType.manual, + inputBoxes.map((box) => JsonBigInt.stringify(box)) + ); + + this.logger.info(`Parsed Dogecoin transaction [${txId}] successfully`); + return dogeTx; + }; + + /** + * generates mapping from input box id to serialized string of output box (filtered by address, containing the token) + * @param address the address + * @param tokenId the token id + * @returns a Map from input box id to serialized string of output box + */ + getMempoolBoxMapping = async ( + address: string, + tokenId?: string + ): Promise> => { + // chaining transaction won't be done in DogeChain + // due to redundant complexity + return new Map(); + }; + + /** + * gets the box id + * @param box the box + * @returns the box id + */ + protected getBoxId = (box: DogeUtxo): string => box.txId + '.' + box.index; + + /** + * extracts box id and assets of a box + * Note: it returns the actual value + * @param box the box + * @returns an object containing the box id and assets + */ + protected getBoxInfo = (box: DogeUtxo): BoxInfo => { + return { + id: this.getBoxId(box), + assets: { + nativeToken: box.value, + tokens: [], + }, + }; + }; + + /** + * generates mapping from input box id to serialized string of output box (filtered by address, containing the token) + * @param txs list of transactions + * @param address the address + * @returns a Map from input box id to output box + */ + protected getTransactionsBoxMapping = ( + txs: Psbt[], + address: string + ): Map => { + const trackMap = new Map(); + + txs.forEach((tx) => { + const txId = tx.extractTransaction(true).getId(); + // iterate over tx inputs + tx.txInputs.forEach((input) => { + let trackedBox: DogeUtxo | undefined = undefined; + // iterate over tx outputs + let index = 0; + for (index = 0; index < tx.txOutputs.length; index++) { + const output = tx.txOutputs[index]; + // check if box satisfy conditions + if (output.address !== address) continue; + + // mark the tracked box + trackedBox = { + txId: txId, + index: index, + value: BigInt(output.value), + }; + break; + } + + // add input box to trackMap + const boxId = getPsbtTxInputBoxId(input); + trackMap.set(boxId, trackedBox); + }); + }); + + return trackMap; + }; + + /** + * builds a signed transaction + * @param txBytes + * @param signatures + * @returns a signed transaction + */ + protected buildSignedTransaction = ( + txBytes: Uint8Array, + signatures: string[] + ): Psbt => { + const psbt = Serializer.deserialize(txBytes); + for (let i = 0; i < signatures.length; i++) { + const signature = Buffer.from(signatures[i], 'hex'); + psbt.updateInput(i, { + partialSig: [ + { + pubkey: Buffer.from(this.configs.aggregatedPublicKey, 'hex'), + signature: script.signature.encode(signature, 1), + }, + ], + }); + } + return psbt; + }; + + /** + * serializes the transaction of this chain into string + */ + protected serializeTx = (tx: DogeTx): string => JsonBigInt.stringify(tx); + + /** + * wraps doge amount + * @param amount + */ + protected wrapDoge = (amount: bigint): RosenAmount => + this.tokenMap.wrapAmount(this.NATIVE_TOKEN_ID, amount, this.CHAIN); + + /** + * unwraps doge amount + * @param amount + */ + protected unwrapDoge = (amount: bigint): RosenAmount => + this.tokenMap.unwrapAmount(this.NATIVE_TOKEN_ID, amount, this.CHAIN); + + /** + * gets useful, allowable and last boxes for an address until required assets are satisfied + * Note: it returns the actual value + * @param address the address + * @param requiredAssets the required assets (actual values) + * @param forbiddenBoxIds the id of forbidden boxes + * @param trackMap the mapping of a box id to it's next box + * @returns an object containing the selected boxes with a boolean showing if requirements covered or not + */ + protected getCoveringBoxes = async ( + address: string, + requiredAssets: AssetBalance, + forbiddenBoxIds: Array, + trackMap: Map + ): Promise> => { + const getAddressBoxes = this.network.getAddressBoxes; + async function* generator() { + let offset = 0; + const limit = GET_BOX_API_LIMIT; + while (true) { + const page = await getAddressBoxes(address, offset, limit); + if (page.length === 0) break; + yield* page; + offset += limit; + } + return undefined; + } + const utxoIterator = generator(); + + const feeRatio = await this.network.getFeeRatio(); + const estimatedTxWeight = DOGE_TX_BASE_SIZE + DOGE_OUTPUT_SIZE * 2; + return selectBitcoinUtxos( + requiredAssets.nativeToken, + forbiddenBoxIds, + trackMap, + utxoIterator, + BigInt(MINIMUM_UTXO_VALUE), + DOGE_INPUT_SIZE, + estimatedTxWeight, + feeRatio, + this.logger, + 1 + ); + }; + + /** + * verifies consistency within the PaymentTransaction object + * @param transaction the PaymentTransaction + * @returns true if the transaction is verified + */ + verifyPaymentTransaction = async ( + transaction: PaymentTransaction + ): Promise => { + const psbt = Serializer.deserialize(transaction.txBytes); + const dogeTx = transaction as DogeTransaction; + const baseError = `Tx [${transaction.txId}] is not verified: `; + + // verify txId + const txId = Transaction.fromBuffer(psbt.data.getTransaction()).getId(); + if (transaction.txId !== txId) { + this.logger.warn( + baseError + + `Transaction id is inconsistent (expected [${transaction.txId}] found [${txId}])` + ); + return false; + } + + // verify inputUtxos + if (dogeTx.inputUtxos.length !== psbt.inputCount) { + this.logger.warn( + baseError + + `DogeTransaction object input counts is inconsistent [${dogeTx.inputUtxos.length} != ${psbt.inputCount}]` + ); + return false; + } + for (let i = 0; i < psbt.inputCount; i++) { + const input = psbt.txInputs[i]; + const txId = Buffer.from(input.hash).reverse().toString('hex'); + const actualInputId = `${txId}.${input.index}`; + const dogeInput = JsonBigInt.parse(dogeTx.inputUtxos[i]) as DogeUtxo; + const expectedId = `${dogeInput.txId}.${dogeInput.index}`; + if (expectedId !== actualInputId) { + this.logger.warn( + baseError + + `Utxo id for input at index [${i}] is inconsistent [expected ${expectedId} found ${actualInputId}]` + ); + return false; + } + } + + return true; + }; +} + +export default DogeChain; diff --git a/packages/chains/doge/lib/DogeTransaction.ts b/packages/chains/doge/lib/DogeTransaction.ts new file mode 100644 index 00000000..210feec0 --- /dev/null +++ b/packages/chains/doge/lib/DogeTransaction.ts @@ -0,0 +1,60 @@ +import { + PaymentTransaction, + TransactionType, +} from '@rosen-chains/abstract-chain'; +import { DOGE_CHAIN } from './constants'; // Ensure you define DOGE_CHAIN in your constants file +import { DogeTransactionJsonModel } from './types'; + +class DogeTransaction extends PaymentTransaction { + inputUtxos: Array; + + constructor( + txId: string, + eventId: string, + txBytes: Uint8Array, + txType: TransactionType, + inputUtxos: Array + ) { + super(DOGE_CHAIN, txId, eventId, txBytes, txType); + this.inputUtxos = inputUtxos; + } + + /** + * converts json representation of the payment transaction to DogeTransaction + * @returns DogeTransaction object + */ + static fromJson = (jsonString: string): DogeTransaction => { + const obj = JSON.parse(jsonString) as DogeTransactionJsonModel; + return new DogeTransaction( + obj.txId, + obj.eventId, + Buffer.from(obj.txBytes, 'hex'), + obj.txType as TransactionType, + obj.inputUtxos + ); + }; + + /** + * converts DogeTransaction to json + * @returns json representation of the payment transaction + */ + toJson = (): string => { + return JSON.stringify({ + network: this.network, + eventId: this.eventId, + txBytes: this.getTxHexString(), + txId: this.txId, + txType: this.txType, + inputUtxos: this.inputUtxos, + }); + }; + + /** + * @returns transaction hex string + */ + getTxHexString = () => { + return Buffer.from(this.txBytes).toString('hex'); + }; +} + +export default DogeTransaction; diff --git a/packages/chains/doge/lib/Serializer.ts b/packages/chains/doge/lib/Serializer.ts new file mode 100644 index 00000000..29e925e8 --- /dev/null +++ b/packages/chains/doge/lib/Serializer.ts @@ -0,0 +1,24 @@ +import { Psbt } from 'bitcoinjs-lib'; // You may need to replace this with a Doge-specific library if available +import { DOGE_NETWORK } from './constants'; + +class Serializer { + /** + * converts 'bitcoinjs-lib' PSBT to bytearray + * @param tx the transaction in 'bitcoinjs-lib' PSBT format + * @returns bytearray representation of the transaction + */ + static serialize = (tx: Psbt): Uint8Array => { + return tx.toBuffer(); + }; + + /** + * converts bytearray representation of the transaction to 'bitcoinjs-lib' PSBT format + * @param txBytes bytearray representation of the transaction + * @returns the transaction in 'bitcoinjs-lib' PSBT format + */ + static deserialize = (txBytes: Uint8Array): Psbt => { + return Psbt.fromBuffer(Buffer.from(txBytes), { network: DOGE_NETWORK }); + }; +} + +export default Serializer; diff --git a/packages/chains/doge/lib/constants.ts b/packages/chains/doge/lib/constants.ts new file mode 100644 index 00000000..09f595f5 --- /dev/null +++ b/packages/chains/doge/lib/constants.ts @@ -0,0 +1,22 @@ +export const DOGE_CHAIN = 'doge'; +export const DOGE = 'doge'; + +export const CONFIRMATION_TARGET = 10; + +// New constants +export const DOGE_TX_BASE_SIZE = 10; // Dogecoin base transaction size in bytes +export const DOGE_INPUT_SIZE = 148; // Typical Dogecoin input size in bytes (non-SegWit) +export const DOGE_OUTPUT_SIZE = 34; // Typical Dogecoin output size in bytes +export const MINIMUM_UTXO_VALUE = 546; // Minimum Dogecoin UTXO value in satoshis +export const DOGE_NETWORK = { + // Doge network parameters + messagePrefix: '\x19Dogecoin Signed Message:\n', + bech32: 'dc', + bip32: { + public: 0x02facafd, + private: 0x02fac398, + }, + pubKeyHash: 0x1e, + scriptHash: 0x16, + wif: 0x9e, +}; diff --git a/packages/chains/doge/lib/dogeUtils.ts b/packages/chains/doge/lib/dogeUtils.ts new file mode 100644 index 00000000..29e05f01 --- /dev/null +++ b/packages/chains/doge/lib/dogeUtils.ts @@ -0,0 +1,47 @@ +import { PsbtTxInput } from 'bitcoinjs-lib'; +import { DOGE_TX_BASE_SIZE } from './constants'; +import { DOGE_INPUT_SIZE } from './constants'; +import { DOGE_OUTPUT_SIZE } from './constants'; +import { Psbt } from 'bitcoinjs-lib'; + +/** + * gets boxId from PsbtTxInput + * @param input + * @returns box id in `{txId}.{index}` format + */ +export const getPsbtTxInputBoxId = (input: PsbtTxInput) => + `${input.hash.reverse().toString('hex')}.${input.index}`; + +/** + * estimates required fee for tx based on number of inputs, outputs and current network fee ratio + * uses standard non-SegWit transaction size calculation + * @param inputSize number of inputs + * @param outputSize number of outputs + * @param feeRatio fee rate in satoshis per byte + */ +export const estimateTxFee = ( + inputSize: number, + outputSize: number, + feeRatio: number +): bigint => { + const txSize = + DOGE_TX_BASE_SIZE + + inputSize * DOGE_INPUT_SIZE + + outputSize * DOGE_OUTPUT_SIZE; + + return BigInt(Math.ceil(txSize * feeRatio)); +}; + +/** + * checks if a PSBT is finalized by attempting to extract the transaction + * @param psbt the PSBT to check + * @returns true if the PSBT is finalized + */ +export const isPsbtFinalized = (psbt: Psbt): boolean => { + try { + psbt.extractTransaction(true); + return true; + } catch { + return false; + } +}; diff --git a/packages/chains/doge/lib/index.ts b/packages/chains/doge/lib/index.ts new file mode 100644 index 00000000..9dede3f9 --- /dev/null +++ b/packages/chains/doge/lib/index.ts @@ -0,0 +1,5 @@ +export { default as DogeChain } from './DogeChain'; +export { default as AbstractDogeNetwork } from './network/AbstractDogeNetwork'; +export { default as DogeTransaction } from './DogeTransaction'; +export * from './types'; +export * from './constants'; diff --git a/packages/chains/doge/lib/network/AbstractDogeNetwork.ts b/packages/chains/doge/lib/network/AbstractDogeNetwork.ts new file mode 100644 index 00000000..8004b880 --- /dev/null +++ b/packages/chains/doge/lib/network/AbstractDogeNetwork.ts @@ -0,0 +1,62 @@ +import { + AbstractUtxoChainNetwork, + TokenDetail, +} from '@rosen-chains/abstract-chain'; +import { Psbt } from 'bitcoinjs-lib'; +import { DogeTx, DogeUtxo } from '../types'; + +abstract class AbstractDogeNetwork extends AbstractUtxoChainNetwork< + DogeTx, + DogeUtxo +> { + /** + * submits a transaction + * @param transaction the transaction + */ + abstract submitTransaction: (transaction: Psbt) => Promise; + + /** + * gets a utxo from the network + * @param boxId the id of Utxo (txId + . + index) + * @returns the utxo in DogeUtxo format + */ + abstract getUtxo: (boxId: string) => Promise; + + /** + * gets current fee ratio of the network + * @returns + */ + abstract getFeeRatio: () => Promise; + + /** + * gets id of transactions in mempool + * @returns + */ + abstract getMempoolTxIds: () => Promise>; + + /** + * gets all transactions in mempool (returns empty list if the chain has no mempool) + * Note: due to heavy size of transactions in mempool, we ignore getting mempool txs in Doge + * @returns empty list + */ + getMempoolTransactions = async (): Promise> => { + return []; + }; + + /** + * gets token details (name, decimals) + * @param tokenId + */ + getTokenDetail = async (tokenId: string): Promise => { + throw Error(`Doge does not support token`); + }; + + /** + * gets a transaction hex string + * @param txId the transaction id + * @returns hex string of the transaction + */ + abstract getTransactionHex: (txId: string) => Promise; +} + +export default AbstractDogeNetwork; diff --git a/packages/chains/doge/lib/types.ts b/packages/chains/doge/lib/types.ts new file mode 100644 index 00000000..e2b0757b --- /dev/null +++ b/packages/chains/doge/lib/types.ts @@ -0,0 +1,61 @@ +import { + ChainConfigs, + PaymentTransactionJsonModel, +} from '@rosen-chains/abstract-chain'; + +export interface DogeConfigs extends ChainConfigs { + aggregatedPublicKey: string; + txFeeSlippage: number; +} + +export interface DogeTransactionJsonModel extends PaymentTransactionJsonModel { + inputUtxos: Array; +} + +export interface DogeUtxo { + txId: string; + index: number; + value: bigint; +} + +export interface DogeTxInput { + txId: string; + index: number; + scriptPubKey: string; +} + +export interface DogeTxOutput { + scriptPubKey: string; + value: bigint; +} + +export interface DogeTx { + id: string; + inputs: DogeTxInput[]; + outputs: DogeTxOutput[]; +} + +export interface BoxInfo { + id: string; + assets: AssetBalance; +} + +export interface TokenInfo { + id: string; + value: bigint; +} + +export interface AssetBalance { + nativeToken: bigint; + tokens: Array; +} + +export interface CoveringBoxes { + covered: boolean; + boxes: Array; +} + +export type TssSignFunction = (txHash: Uint8Array) => Promise<{ + signature: string; + signatureRecovery: string; +}>; diff --git a/packages/chains/doge/package.json b/packages/chains/doge/package.json new file mode 100644 index 00000000..28994a4d --- /dev/null +++ b/packages/chains/doge/package.json @@ -0,0 +1,44 @@ +{ + "name": "@rosen-chains/doge", + "version": "0.1.0", + "description": "this project contains doge chain for Rosen-bridge", + "repository": "https://github.com/rosen-bridge/rosen-chains", + "license": "GPL-3.0", + "author": "Mehran", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc --build tsconfig.build.json", + "coverage": "npm run test -- --coverage", + "lint": "eslint --fix . && npm run prettify", + "prettify": "prettier --write . --ignore-path ./.gitignore", + "release": "npm run test -- --run && npm run build && npm publish --access public", + "test": "NODE_OPTIONS=--loader=extensionless vitest", + "type-check": "tsc --noEmit" + }, + "devDependencies": { + "@types/node": "^20.11.9", + "@typescript-eslint/eslint-plugin": "^6.19.1", + "@typescript-eslint/parser": "^6.19.1", + "@vitest/coverage-istanbul": "^2.1.4", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "extensionless": "^1.9.6", + "prettier": "^3.2.4", + "typescript": "^5.3.3", + "vitest": "^2.1.4" + }, + "dependencies": { + "@rosen-bridge/abstract-logger": "^2.0.1", + "@rosen-bridge/bitcoin-utxo-selection": "^0.3.0", + "@rosen-bridge/json-bigint": "^0.1.0", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", + "@rosen-chains/abstract-chain": "^11.0.1", + "bitcoinjs-lib": "^6.1.5" + }, + "engines": { + "node": ">=20.11.0" + } +} diff --git a/packages/chains/doge/tests/DogeChain.spec.ts b/packages/chains/doge/tests/DogeChain.spec.ts new file mode 100644 index 00000000..92e78f0a --- /dev/null +++ b/packages/chains/doge/tests/DogeChain.spec.ts @@ -0,0 +1,1093 @@ +import { + NotEnoughAssetsError, + NotEnoughValidBoxesError, + TransactionType, +} from '@rosen-chains/abstract-chain'; +import JsonBigInt from '@rosen-bridge/json-bigint'; +import { Psbt } from 'bitcoinjs-lib'; +import { + DOGE_NETWORK, + DogeChain, + DogeTransaction, + DogeUtxo, + TssSignFunction, +} from '../lib'; +import TestDogeNetwork from './network/TestDogeNetwork'; +import { TestDogeChain } from './TestDogeChain'; +import * as testData from './testData'; +import * as testUtils from './testUtils'; +import { TokenMap } from '@rosen-bridge/tokens'; +import { AssetBalance } from '@rosen-chains/abstract-chain'; + +describe('DogeChain', () => { + describe('generateTransaction', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.generateTransaction should generate payment + * transaction successfully + * @dependencies + * @scenario + * - mock transaction order, getFeeRatio + * - mock getCoveringBoxes, hasLockAddressEnoughAssets + * - run test + * - check returned value + * @expected + * - PaymentTransaction txType, eventId, network and inputUtxos should be as + * expected + * - extracted order of generated transaction should be the same as input + * order + * - getCoveringBoxes should have been called with correct arguments + */ + it('should generate payment transaction successfully', async () => { + // mock transaction order + const order = testData.transaction2Order; + const payment1 = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); + getFeeRatioSpy.mockResolvedValue(1); + + // mock getCoveringBoxes, hasLockAddressEnoughAssets + const dogeChain = await testUtils.generateChainObject(network); + const getCovBoxesSpy = vi.spyOn(dogeChain as any, 'getCoveringBoxes'); + getCovBoxesSpy.mockResolvedValue({ + covered: true, + boxes: testData.lockAddressUtxos, + }); + const hasLockAddressEnoughAssetsSpy = vi.spyOn( + dogeChain, + 'hasLockAddressEnoughAssets' + ); + hasLockAddressEnoughAssetsSpy.mockResolvedValue(true); + + // mock getTransactionHex for each UTXO + const getUtxoSpy = vi.spyOn(network, 'getTransactionHex'); + testData.lockAddressUtxos.forEach((utxo) => { + getUtxoSpy.mockResolvedValueOnce(utxo.txHex); + }); + + // run test + const result = await dogeChain.generateTransaction( + payment1.eventId, + payment1.txType, + order, + [], + [] + ); + const dogeTx = result as DogeTransaction; + + // check returned value + expect(dogeTx.txType).toEqual(payment1.txType); + expect(dogeTx.eventId).toEqual(payment1.eventId); + expect(dogeTx.network).toEqual(payment1.network); + expect(dogeTx.inputUtxos).toEqual( + testData.lockAddressUtxos.map((utxo) => JsonBigInt.stringify(utxo)) + ); + + // extracted order of generated transaction should be the same as input order + const extractedOrder = dogeChain.extractTransactionOrder(dogeTx); + expect(extractedOrder).toEqual(order); + + // getCoveringBoxes should have been called with correct arguments + const expectedRequiredAssets = structuredClone( + testData.transaction2Order[0].assets + ); + expectedRequiredAssets.nativeToken += dogeChain.getMinimumNativeToken(); + expect(getCovBoxesSpy).toHaveBeenCalledWith( + testUtils.configs.addresses.lock, + expectedRequiredAssets, + [], + new Map() + ); + }); + + /** + * @target DogeChain.generateTransaction should generate payment with signed transaction outputs + * @dependencies + * @scenario + * - mock transaction order, getFeeRatio + * - mock getCoveringBoxes, hasLockAddressEnoughAssets + * - run test + * - check returned value + * @expected + * - PaymentTransaction txType, eventId, network and inputUtxos should be as expected + */ + it('should generate payment transaction successfully with signed transaction outputs', async () => { + // mock transaction order + const order = testData.transaction2Order; + const payment1 = DogeTransaction.fromJson( + testData.transaction1PaymentTransaction + ); + const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); + getFeeRatioSpy.mockResolvedValue(1); + + // mock getCoveringBoxes, hasLockAddressEnoughAssets + const dogeChain = await testUtils.generateChainObject(network); + const getCovBoxesSpy = vi.spyOn(dogeChain as any, 'getCoveringBoxes'); + getCovBoxesSpy.mockResolvedValue({ + covered: true, + boxes: testData.coveredBoxes, + }); + + const hasLockAddressEnoughAssetsSpy = vi.spyOn( + dogeChain, + 'hasLockAddressEnoughAssets' + ); + hasLockAddressEnoughAssetsSpy.mockResolvedValue(true); + + // mock getTransactionHex for each UTXO + const getUtxoSpy = vi.spyOn(network, 'getTransactionHex'); + testData.lockAddressUtxos.forEach((utxo) => { + getUtxoSpy.mockResolvedValueOnce(utxo.txHex); + }); + + // run test + const result = await dogeChain.generateTransaction( + payment1.eventId, + payment1.txType, + order, + [], + [testData.transaction0SignedTxBytesHex] + ); + const dogeTx = result as DogeTransaction; + + // check returned value + expect(dogeTx.txType).toEqual(payment1.txType); + expect(dogeTx.eventId).toEqual(payment1.eventId); + expect(dogeTx.network).toEqual(payment1.network); + expect(dogeTx.inputUtxos.length).toEqual(1); + + // extracted order of generated transaction should be the same as input order + const extractedOrder = dogeChain.extractTransactionOrder(dogeTx); + expect(extractedOrder).toEqual(order); + + // getCoveringBoxes should have been called with correct arguments + const expectedRequiredAssets = structuredClone( + testData.transaction2Order[0].assets + ); + expectedRequiredAssets.nativeToken += dogeChain.getMinimumNativeToken(); + }); + + /** + * @target DogeChain.generateTransaction should successfully generate payment transaction while considering forbidden boxes caused by a signed transaction without signature + * @dependencies + * @scenario + * - mock transaction order, getFeeRatio + * - mock getCoveringBoxes, hasLockAddressEnoughAssets + * + * - run test + * - check returned value + * @expected + * - PaymentTransaction txType, eventId, network and inputUtxos should be as expected + */ + it('should successfully generate payment transaction while considering forbidden boxes caused by a signed transaction without signature', async () => { + // mock transaction order + const order = testData.transaction2Order; + const payment1 = DogeTransaction.fromJson( + testData.transaction1PaymentTransaction + ); + const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); + getFeeRatioSpy.mockResolvedValue(1); + + // mock getCoveringBoxes, hasLockAddressEnoughAssets + const dogeChain = await testUtils.generateChainObject(network); + const getCovBoxesSpy = vi.spyOn(dogeChain as any, 'getCoveringBoxes'); + getCovBoxesSpy.mockImplementation(async (...args: any[]) => { + const forbiddenBoxIds = args[2] as Array; + // Only return covered boxes if forbidden box IDs match expected values + if ( + forbiddenBoxIds.length === 2 && + forbiddenBoxIds.includes( + 'a2623a8e6358b44df7c672cee5a6ff1df2b45721b2f506d22ef59a0634f7641d.0' + ) && + forbiddenBoxIds.includes( + 'f7fdbfcb582dd9e34997df257bfff291c1ea98a5622ba18400794f3337113b0e.2' + ) + ) { + return { + covered: true, + boxes: testData.coveredBoxes, + }; + } + return { + covered: false, + boxes: [], + }; + }); + const hasLockAddressEnoughAssetsSpy = vi.spyOn( + dogeChain, + 'hasLockAddressEnoughAssets' + ); + hasLockAddressEnoughAssetsSpy.mockResolvedValue(true); + + // run test + const faultyTx = Buffer.from( + DogeTransaction.fromJson(testData.transaction0PaymentTransaction) + .txBytes + ).toString('hex'); + const result = await dogeChain.generateTransaction( + payment1.eventId, + payment1.txType, + order, + [], + [testData.transaction0SignedTxBytesHex, faultyTx] + ); + const dogeTx = result as DogeTransaction; + + // check returned value + expect(dogeTx.txType).toEqual(payment1.txType); + expect(dogeTx.eventId).toEqual(payment1.eventId); + expect(dogeTx.network).toEqual(payment1.network); + expect(dogeTx.inputUtxos.length).toEqual(1); + + // extracted order of generated transaction should be the same as input order + const extractedOrder = dogeChain.extractTransactionOrder(dogeTx); + expect(extractedOrder).toEqual(order); + + // getCoveringBoxes should have been called with correct arguments + const expectedRequiredAssets = structuredClone( + testData.transaction2Order[0].assets + ); + expectedRequiredAssets.nativeToken += dogeChain.getMinimumNativeToken(); + }); + + /** + * @target DogeChain.generateTransaction should fail to generate payment with forbidden boxes + * @dependencies + * @scenario + * - mock transaction order, getFeeRatio + * - mock getCoveringBoxes, hasLockAddressEnoughAssets + * - run test + * - check returned value + * @expected + * - generateTransaction should throw NotEnoughValidBoxesError + */ + it('should fail to generate payment transaction with forbidden boxes', async () => { + // mock transaction order + const order = testData.transaction2Order; + const payment1 = DogeTransaction.fromJson( + testData.transaction1PaymentTransaction + ); + const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); + getFeeRatioSpy.mockResolvedValue(1); + + // mock getCoveringBoxes, hasLockAddressEnoughAssets + const dogeChain = await testUtils.generateChainObject(network); + const getCovBoxesSpy = vi.spyOn(dogeChain as any, 'getCoveringBoxes'); + getCovBoxesSpy.mockResolvedValue({ + covered: false, + boxes: [], + }); + getCovBoxesSpy.mockImplementation(async (...args: any[]) => { + const forbiddenBoxIds = args[2] as Array; + // Only return empty boxes if forbidden box IDs match expected values + if ( + forbiddenBoxIds.length === 2 && + forbiddenBoxIds.includes( + 'a2623a8e6358b44df7c672cee5a6ff1df2b45721b2f506d22ef59a0634f7641d.0' + ) && + forbiddenBoxIds.includes( + 'f7fdbfcb582dd9e34997df257bfff291c1ea98a5622ba18400794f3337113b0e.2' + ) + ) { + return { + covered: false, + boxes: [], + }; + } + return { + covered: true, + boxes: testData.coveredBoxes, + }; + }); + const hasLockAddressEnoughAssetsSpy = vi.spyOn( + dogeChain, + 'hasLockAddressEnoughAssets' + ); + hasLockAddressEnoughAssetsSpy.mockResolvedValue(true); + + // run test + await expect(async () => { + await dogeChain.generateTransaction( + payment1.eventId, + payment1.txType, + order, + [DogeTransaction.fromJson(testData.transaction0PaymentTransaction)], + [] + ); + }).rejects.toThrow(NotEnoughValidBoxesError); + }); + + /** + * @target DogeChain.generateTransaction should throw error + * when lock address does not have enough assets + * @dependencies + * @scenario + * - mock hasLockAddressEnoughAssets + * - mock getFeeRatio + * - run test and expect error + * @expected + * - generateTransaction should throw NotEnoughAssetsError + */ + it('should throw error when lock address does not have enough assets', async () => { + // mock hasLockAddressEnoughAssets + const dogeChain = await testUtils.generateChainObject(network); + const hasLockAddressEnoughAssetsSpy = vi.spyOn( + dogeChain, + 'hasLockAddressEnoughAssets' + ); + hasLockAddressEnoughAssetsSpy.mockResolvedValue(false); + const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); + getFeeRatioSpy.mockResolvedValue(1); + + // run test and expect error + await expect(async () => { + await dogeChain.generateTransaction( + 'event1', + TransactionType.payment, + testData.transaction2Order, + [], + [] + ); + }).rejects.toThrow(NotEnoughAssetsError); + }); + + /** + * @target DogeChain.generateTransaction should throw error + * when bank boxes can not cover order assets + * @dependencies + * @scenario + * - mock getCoveringBoxes, hasLockAddressEnoughAssets + * - mock getFeeRatio + * - run test and expect error + * @expected + * - generateTransaction should throw NotEnoughValidBoxesError + * + */ + it('should throw error when bank boxes can not cover order assets', async () => { + // mock getCoveringBoxes, hasLockAddressEnoughAssets + const dogeChain = await testUtils.generateChainObject(network); + const getCovBoxesSpy = vi.spyOn(dogeChain as any, 'getCoveringBoxes'); + getCovBoxesSpy.mockResolvedValue({ + covered: false, + boxes: [], + }); + const hasLockAddressEnoughAssetsSpy = vi.spyOn( + dogeChain, + 'hasLockAddressEnoughAssets' + ); + hasLockAddressEnoughAssetsSpy.mockResolvedValue(true); + const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); + getFeeRatioSpy.mockResolvedValue(1); + + // run test and expect error + await expect(async () => { + await dogeChain.generateTransaction( + 'event1', + TransactionType.payment, + testData.transaction2Order, + [], + [] + ); + }).rejects.toThrow(NotEnoughValidBoxesError); + }); + }); + + describe('getTransactionAssets', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.getTransactionAssets should get transaction assets + * successfully + * @dependencies + * @scenario + * - mock PaymentTransaction + * - run test + * - check returned value + * @expected + * - it should return mocked transaction assets (both input and output assets) + */ + it('should get transaction assets successfully', async () => { + // mock PaymentTransaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + + // run test + const dogeChain = await testUtils.generateChainObject(network); + + // check returned value + const result = await dogeChain.getTransactionAssets(paymentTx); + expect(result).toEqual(testData.transaction0Assets); + }); + + /** + * @target DogeChain.getTransactionAssets should wrap transaction assets + * successfully + * @dependencies + * @scenario + * - mock PaymentTransaction + * - run test + * - check returned value + * @expected + * - it should return mocked transaction assets (both input and output assets) + */ + it('should wrap transaction assets successfully', async () => { + // mock PaymentTransaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + + // run test + const dogeChain = + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + + // check returned value + const result = await dogeChain.getTransactionAssets(paymentTx); + expect(result).toEqual(testData.transaction0WrappedAssets); + }); + }); + + describe('extractTransactionOrder', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.extractTransactionOrder should extract transaction + * order successfully + * @dependencies + * @scenario + * - mock PaymentTransaction + * - run test + * - check returned value + * @expected + * - it should return mocked transaction order + */ + it('should extract transaction order successfully', async () => { + // mock PaymentTransaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + const expectedOrder = testData.transaction2Order; + + // run test + const dogeChain = await testUtils.generateChainObject(network); + const result = dogeChain.extractTransactionOrder(paymentTx); + + // check returned value + expect(result).toEqual(expectedOrder); + }); + + /** + * @target DogeChain.extractTransactionOrder should throw error + * when tx has OP_RETURN utxo + * @dependencies + * @scenario + * - mock PaymentTransaction with OP_RETURN output + * - run test & check thrown exception + * @expected + * - it should throw Error + */ + it('should throw error when tx has OP_RETURN utxo', async () => { + // mock PaymentTransaction + const paymentTx = DogeTransaction.fromJson( + testData.transactionOpReturnPaymentTransaction + ); + + // run test & check thrown exception + const dogeChain = await testUtils.generateChainObject(network); + expect(() => { + dogeChain.extractTransactionOrder(paymentTx); + }).toThrow(Error); + }); + + /** + * @target DogeChain.extractTransactionOrder should wrap transaction + * order successfully + * @dependencies + * @scenario + * - mock PaymentTransaction + * - run test + * - check returned value + * @expected + * - it should return mocked transaction order + */ + it('should wrap transaction order successfully', async () => { + // mock PaymentTransaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + const expectedOrder = testData.transaction2WrappedOrder; + + // run test + const dogeChain = + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + const result = dogeChain.extractTransactionOrder(paymentTx); + + // check returned value + expect(result).toEqual(expectedOrder); + }); + }); + + describe('verifyTransactionFee', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.verifyTransactionFee should return true when fee + * difference is less than allowed slippage + * @dependencies + * @scenario + * - mock PaymentTransaction + * - mock getFeeRatio + * - run test + * - check returned value + * @expected + * - it should return true + */ + it('should return true when fee difference is less than allowed slippage', async () => { + const paymentTx = DogeTransaction.fromJson( + testData.transaction1PaymentTransaction + ); + const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); + getFeeRatioSpy.mockResolvedValue(176991); + + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.verifyTransactionFee(paymentTx); + + expect(result).toEqual(true); + }); + + /** + * @target DogeChain.verifyTransactionFee should return false when fee + * difference is more than allowed slippage + * @dependencies + * @scenario + * - mock PaymentTransaction + * - mock getFeeRatio + * - run test + * - check returned value + * @expected + * - it should return false + */ + it('should return false when fee difference is more than allowed slippage', async () => { + const paymentTx = DogeTransaction.fromJson( + testData.transaction1PaymentTransaction + ); + const getFeeRatioSpy = vi.spyOn(network, 'getFeeRatio'); + getFeeRatioSpy.mockResolvedValue(100); + + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.verifyTransactionFee(paymentTx); + + expect(result).toEqual(false); + }); + }); + + describe('verifyExtraCondition', () => { + const network = new TestDogeNetwork(); + + /** + * @target: DogeChain.verifyTransactionExtraConditions should return true when all + * extra conditions are met + * @dependencies + * @scenario + * - mock a payment transaction + * - run test + * - check returned value + * @expected + * - it should return true + */ + it('should return true when all extra conditions are met', async () => { + // mock a payment transaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + + // run test + const dogeChain = await testUtils.generateChainObject(network); + const result = dogeChain.verifyTransactionExtraConditions(paymentTx); + + // check returned value + expect(result).toEqual(true); + }); + + /** + * @target: DogeChain.verifyTransactionExtraConditions should return false + * when change box address is wrong + * @dependencies + * @scenario + * - mock a payment transaction + * - create a new DogeChain object with custom lock address + * - run test + * - check returned value + * @expected + * - it should return false + */ + it('should return false when change box address is wrong', async () => { + // mock a payment transaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.testTokenMap); + + // create a new DogeChain object with custom lock address + const newConfigs = structuredClone(testUtils.configs); + newConfigs.addresses.lock = 'DDd8APtwJLJZJxwmoh3YmP5oeBe9tcdUp4'; + const dogeChain = new DogeChain( + network, + newConfigs, + tokenMap, + testUtils.mockedSignFn + ); + + // run test + const result = dogeChain.verifyTransactionExtraConditions(paymentTx); + + // check returned value + expect(result).toEqual(false); + }); + }); + + describe('isTxValid', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.isTxValid should return true when + * all tx inputs are valid and ttl is less than current slot + * @dependencies + * @scenario + * - mock PaymentTransaction + * - mock a network object to return as valid for all inputs of a mocked + * transaction + * - run test + * - check returned value + * - check if function got called + * @expected + * - it should return true with no details + * - `isBoxUnspentAndValidSpy` should have been called with tx input ids + */ + it('should return true when all tx inputs are valid and ttl is less than current slot', async () => { + const payment1 = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + + const isBoxUnspentAndValidSpy = vi.spyOn(network, 'isBoxUnspentAndValid'); + isBoxUnspentAndValidSpy.mockResolvedValue(true); + + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.isTxValid(payment1); + + expect(result).toEqual({ + isValid: true, + details: undefined, + }); + expect(isBoxUnspentAndValidSpy).toHaveBeenCalledWith( + testData.transaction0Input0BoxId + ); + }); + + /** + * @target DogeChain.isTxValid should return false when at least one input + * is invalid + * @dependencies + * @scenario + * - mock PaymentTransaction + * - mock a network object to return as valid for all inputs of a mocked + * transaction except for the first one + * - run test + * - check returned value + * - check if function got called + * @expected + * - it should return false and as expected invalidation + */ + it('should return false when at least one input is invalid', async () => { + const payment1 = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + + const isBoxUnspentAndValidSpy = vi.spyOn(network, 'isBoxUnspentAndValid'); + isBoxUnspentAndValidSpy + .mockResolvedValue(true) + .mockResolvedValueOnce(false); + + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.isTxValid(payment1); + + expect(result).toEqual({ + isValid: false, + details: { + reason: expect.any(String), + unexpected: false, + }, + }); + expect(isBoxUnspentAndValidSpy).toHaveBeenCalledWith( + testData.transaction0Input0BoxId + ); + }); + }); + + describe('signTransaction', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.signTransaction should return PaymentTransaction of the + * signed transaction + * @dependencies + * @scenario + * - mock a sign function to return signature for expected messages + * - mock PaymentTransaction of unsigned transaction + * - run test + * - check returned value + * @expected + * - it should return PaymentTransaction of signed transaction (all fields + * are same as input object, except txBytes which is signed transaction) + */ + it('should return PaymentTransaction of the signed transaction', async () => { + // mock a sign function to return signature + const signFunction: TssSignFunction = async (hash: Uint8Array) => { + const hashHex = Buffer.from(hash).toString('hex'); + if (hashHex === testData.transaction0HashMessage0) + return { + signature: testData.transaction0Signature0, + signatureRecovery: '', + }; + else if (hashHex === testData.transaction0HashMessage1) + return { + signature: testData.transaction0Signature1, + signatureRecovery: '', + }; + else + throw Error( + `TestError: sign function is called with wrong message [${hashHex}]` + ); + }; + + // mock PaymentTransaction of unsigned transaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + + // run test + const dogeChain = await testUtils.generateChainObject( + network, + signFunction + ); + const result = await dogeChain.signTransaction(paymentTx); + + // check returned value + expect(result.txId).toEqual(paymentTx.txId); + expect(result.eventId).toEqual(paymentTx.eventId); + expect(Buffer.from(result.txBytes).toString('hex')).toEqual( + testData.transaction0SignedTxBytesHex + ); + expect(result.txType).toEqual(paymentTx.txType); + expect(result.network).toEqual(paymentTx.network); + }); + + /** + * @target DogeChain.signTransaction should throw error when at least signing of one message is failed + * @dependencies + * @scenario + * - mock a sign function to throw error for 2nd message + * - mock PaymentTransaction of unsigned transaction + * - run test & check thrown exception + * @expected + * - it should throw the exact error thrown by sign function + */ + it('should throw error when at least signing of one message is failed', async () => { + // mock a sign function to throw error + const signFunction: TssSignFunction = async (hash: Uint8Array) => { + if ( + Buffer.from(hash).toString('hex') === + testData.transaction0HashMessage0 + ) + return { + signature: testData.transaction0Signature0, + signatureRecovery: '', + }; + else throw Error(`TestError: sign failed`); + }; + + // mock PaymentTransaction of unsigned transaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + + // run test + const dogeChain = await testUtils.generateChainObject( + network, + signFunction + ); + + await expect(async () => { + await dogeChain.signTransaction(paymentTx); + }).rejects.toThrow('TestError: sign failed'); + }); + }); + + describe('rawTxToPaymentTransaction', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.rawTxToPaymentTransaction should construct transaction successfully + * @dependencies + * @scenario + * - mock PaymentTransaction + * - run test + * - check returned value + * @expected + * - it should return mocked transaction order + */ + it('should construct transaction successfully', async () => { + // mock PaymentTransaction + const expectedTx = DogeTransaction.fromJson( + testData.transaction0PaymentTransaction + ); + expectedTx.eventId = ''; + expectedTx.txType = TransactionType.manual; + + // mock getUtxo + const getUtxoSpy = vi.spyOn(network, 'getUtxo'); + expectedTx.inputUtxos.forEach((utxo) => + getUtxoSpy.mockResolvedValueOnce(JsonBigInt.parse(utxo)) + ); + + // run test + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.rawTxToPaymentTransaction( + Buffer.from(expectedTx.txBytes).toString('hex') + ); + + // check returned value + expect(result.toJson()).toEqual(expectedTx.toJson()); + }); + }); + + describe('getBoxInfo', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.getBoxInfo should get box id and assets correctly + * @dependencies + * @scenario + * - mock a DogeUtxo with assets + * - run test + * - check returned value + * @expected + * - it should return constructed BoxInfo + */ + it('should get box info successfully', async () => { + // mock a DogeUtxo with assets + const rawBox = testData.lockUtxo; + + // run test + const dogeChain = await testUtils.generateChainObject(network); + + // check returned value + const result = (dogeChain as any).getBoxInfo(rawBox); + expect(result.id).toEqual(rawBox.txId + '.' + rawBox.index); + expect(result.assets.nativeToken.toString()).toEqual( + rawBox.value.toString() + ); + }); + }); + + describe('getTransactionsBoxMapping', async () => { + const network = new TestDogeNetwork(); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.testTokenMap); + const testInstance = new TestDogeChain( + network, + testUtils.configs, + tokenMap, + null as any + ); + + /** + * @target DogeChain.getTransactionsBoxMapping should construct mapping + * successfully + * @dependencies + * @scenario + * - mock serialized transactions + * - run test + * - check returned value + * @expected + * - it should return a map equal to constructed map + */ + it('should construct mapping successfully', () => { + // mock serialized transactions + const transactions = [ + Psbt.fromHex(testData.transaction0SignedTxBytesHex, { + network: DOGE_NETWORK, + }), + ]; + + // run test + const result = testInstance.callGetTransactionsBoxMapping( + transactions, + testUtils.configs.addresses.lock + ); + + // check returned value + const trackMap = new Map(); + const boxMapping = testData.transaction2BoxMapping; + boxMapping.forEach((mapping) => { + const candidate = JsonBigInt.parse( + mapping.serializedOutput + ) as DogeUtxo; + trackMap.set(mapping.inputId, { + txId: candidate.txId, + index: Number(candidate.index), + value: candidate.value, + }); + }); + expect(result).toEqual(trackMap); + }); + + /** + * @target DogeChain.getTransactionsBoxMapping should map inputs to + * undefined when no valid output box found + * @dependencies + * @scenario + * - mock serialized transactions + * - run test + * - check returned value + * @expected + * - it should return a map of each box to undefined + */ + it('should map inputs to undefined when no valid output box found', () => { + // mock serialized transactions + const transactions = [ + Psbt.fromHex(testData.transaction0SignedTxBytesHex, { + network: DOGE_NETWORK, + }), + ]; + + // run test + const result = testInstance.callGetTransactionsBoxMapping( + transactions, + 'another address' + ); + + // check returned value + const trackMap = new Map(); + const boxMapping = testData.transaction2BoxMapping; + boxMapping.forEach((mapping) => { + trackMap.set(mapping.inputId, undefined); + }); + expect(result).toEqual(trackMap); + }); + }); + + describe('verifyPaymentTransaction', () => { + const network = new TestDogeNetwork(); + + /** + * @target DogeChain.verifyPaymentTransaction should return true + * when data is consistent + * @dependencies + * @scenario + * - mock a DogeTransaction + * - run test + * - check returned value + * @expected + * - it should return true + */ + it('should return true when data is consistent', async () => { + // mock a DogeTransaction + const paymentTx = DogeTransaction.fromJson( + testData.transaction2PaymentTransaction + ); + + // run test + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.verifyPaymentTransaction(paymentTx); + + // check returned value + expect(result).toEqual(true); + }); + + /** + * @target DogeChain.verifyPaymentTransaction should return false + * when transaction id is wrong + * @dependencies + * @scenario + * - mock a DogeTransaction with changed txId + * - run test + * - check returned value + * @expected + * - it should return false + */ + it('should return false when transaction id is wrong', async () => { + // mock a DogeTransaction with changed txId + const paymentTx = DogeTransaction.fromJson( + testData.transaction2PaymentTransaction + ); + paymentTx.txId = testUtils.generateRandomId(); + + // run test + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.verifyPaymentTransaction(paymentTx); + + // check returned value + expect(result).toEqual(false); + }); + + /** + * @target DogeChain.verifyPaymentTransaction should return false + * when number of utxos is wrong + * @dependencies + * @scenario + * - mock a DogeTransaction with less utxos + * - run test + * - check returned value + * @expected + * - it should return false + */ + it('should return false when number of utxos is wrong', async () => { + // mock a DogeTransaction with less utxos + const paymentTx = DogeTransaction.fromJson( + testData.transaction2PaymentTransaction + ); + paymentTx.inputUtxos.pop(); + + // run test + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.verifyPaymentTransaction(paymentTx); + + // check returned value + expect(result).toEqual(false); + }); + + /** + * @target DogeChain.verifyPaymentTransaction should return false + * when at least one of the utxos is wrong + * @dependencies + * @scenario + * - mock a DogeTransaction with changed utxo + * - run test + * - check returned value + * @expected + * - it should return false + */ + it('should return false when at least one of the utxos is wrong', async () => { + // mock a DogeTransaction with changed utxo + const paymentTx = DogeTransaction.fromJson( + testData.transaction2PaymentTransaction + ); + paymentTx.inputUtxos[1] = JsonBigInt.stringify({ + txId: testUtils.generateRandomId(), + index: 1, + }); + + // run test + const dogeChain = await testUtils.generateChainObject(network); + const result = await dogeChain.verifyPaymentTransaction(paymentTx); + + // check returned value + expect(result).toEqual(false); + }); + }); +}); diff --git a/packages/chains/doge/tests/TestDogeChain.ts b/packages/chains/doge/tests/TestDogeChain.ts new file mode 100644 index 00000000..e0553c13 --- /dev/null +++ b/packages/chains/doge/tests/TestDogeChain.ts @@ -0,0 +1,11 @@ +import { Psbt } from 'bitcoinjs-lib'; +import { DogeChain } from '../lib'; + +export class TestDogeChain extends DogeChain { + callGetTransactionsBoxMapping = ( + serializedTransactions: Psbt[], + address: string + ) => { + return this.getTransactionsBoxMapping(serializedTransactions, address); + }; +} diff --git a/packages/chains/doge/tests/network/TestDogeNetwork.ts b/packages/chains/doge/tests/network/TestDogeNetwork.ts new file mode 100644 index 00000000..0a9dbde3 --- /dev/null +++ b/packages/chains/doge/tests/network/TestDogeNetwork.ts @@ -0,0 +1,85 @@ +import { AbstractDogeNetwork, DogeTx, DogeUtxo } from '../../lib'; +import { BlockInfo, TokenDetail } from '@rosen-chains/abstract-chain'; +import { DogeRosenExtractor } from '@rosen-bridge/rosen-extractor'; +import { TokenMap } from '@rosen-bridge/tokens'; + +class TestDogeNetwork extends AbstractDogeNetwork { + extractor = new DogeRosenExtractor( + 'DHTom1rFwsgAn5raKU1nok8E5MdQ4GBkAN', + new TokenMap() + ); + notImplemented = () => { + throw Error('Not implemented'); + }; + + currentSlot = (): Promise => { + throw Error('Not mocked'); + }; + + getAddressAssets = this.notImplemented; + submitTransaction = this.notImplemented; + + getAddressBoxes = ( + address: string, + offset: number, + limit: number + ): Promise> => { + throw Error('Not mocked'); + }; + + getBlockTransactionIds = (blockId: string): Promise> => { + throw Error('Not mocked'); + }; + + getHeight = (): Promise => { + throw Error('Not mocked'); + }; + + getMempoolTransactions = (): Promise> => { + throw Error('Not mocked'); + }; + + getTransaction = (txId: string, blockId: string): Promise => { + throw Error('Not mocked'); + }; + + getTxConfirmation = (txId: string): Promise => { + throw Error('Not mocked'); + }; + + isBoxUnspentAndValid = (boxId: string): Promise => { + throw Error('Not mocked'); + }; + + getUtxo = (boxId: string): Promise => { + throw Error('Not mocked'); + }; + + getBlockInfo = (blockId: string): Promise => { + throw Error('Not mocked'); + }; + + getTokenDetail = (tokenId: string): Promise => { + throw Error('Not mocked'); + }; + + getFeeRatio = (): Promise => { + throw Error('Not mocked'); + }; + + getMempoolTxIds = (): Promise> => { + throw Error('Not mocked'); + }; + + getTransactionHex = (txId: string): Promise => { + throw Error('Not mocked'); + }; + + getSpentTransactionByInputId = ( + boxId: string + ): Promise => { + throw Error('Not mocked'); + }; +} + +export default TestDogeNetwork; diff --git a/packages/chains/doge/tests/testData.ts b/packages/chains/doge/tests/testData.ts new file mode 100644 index 00000000..320745db --- /dev/null +++ b/packages/chains/doge/tests/testData.ts @@ -0,0 +1,274 @@ +import { RosenTokens } from '@rosen-bridge/tokens'; +import { EventTrigger, PaymentOrder } from '@rosen-chains/abstract-chain'; + +export const testTokenMap: RosenTokens = []; + +export const multiDecimalTokenMap: RosenTokens = [ + { + ergo: { + tokenId: + '1c7435e608ab710c56bbe0f635e2a5e86ddf856f7d3d2d1d4dfefa62fbbfb9b4', + name: 'testDOGE', + decimals: 3, + type: 'EIP-004', + residency: 'wrapped', + }, + doge: { + tokenId: 'doge', + name: 'DOGE', + decimals: 8, + type: 'native', + residency: 'native', + }, + }, +]; + +export const transaction0PaymentTransaction = `{ + "network": "doge", + "eventId": "", + "txBytes": "70736274ff0100a002000000021d64f734069af52ed206f5b22157b4f21dffa6e5ce72c6f74db458638e3a62a20000000000ffffffff0e3b1137334f790084a12b62a598eac191f2ff7b25df9749e3d92d58cbbffdf70200000000ffffffff0200e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc853b9e8020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000100f901000000017af0d5f7b6fc3aa277e54a16f372f71e33cf9fb3632227397a1715008fb05836010000006b48304502210081c051556843abc8bfec58fd8bb6a9600f32944bf1d071998b16c42b399e7bb702200ab5c55de9a43967fe7c7f7726fabe2a34b097eb4223c4440d2dffab7e43d0c50121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff030065cd1d000000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000000000e6a0c48656c6c6f20526f73656e21480752bc030000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000100fd1f0102000000015de5e7ecd6c60bf37591d4c23a6747644040b71edbe209231542c848c7ef737f020000006a473044022069ef1e50e6cd355179f68cdf42e7f68ff442a005b4906f40aa846d945208eaf1022037ce2ecc0c294eb46f875bac50edffbe610247a2769c5dc2ad8e8f18f6155daf0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff030000000000000000356a33000000000005f5e10000000000009896802103e5bedab3f782ef17a73e9bdc41ee0e18c3ab477400f35bcf7caa54171db7ff3600e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc82944d3020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000000", + "txId": "e7bb0677b2a0542e3ecb8d3f29ea91ae3500b05201f1e97e6bef7e724c4aa476", + "txType": "manual", + "inputUtxos": [ + "{\\"txId\\":\\"a2623a8e6358b44df7c672cee5a6ff1df2b45721b2f506d22ef59a0634f7641d\\",\\"index\\":0,\\"value\\":500000000}", + "{\\"txId\\":\\"f7fdbfcb582dd9e34997df257bfff291c1ea98a5622ba18400794f3337113b0e\\",\\"index\\":2,\\"value\\":12134394312}" + ] + }`; +export const transaction0Input0BoxId = + 'a2623a8e6358b44df7c672cee5a6ff1df2b45721b2f506d22ef59a0634f7641d.0'; +export const transaction0Input1BoxId = + 'f7fdbfcb582dd9e34997df257bfff291c1ea98a5622ba18400794f3337113b0e.2'; +export const transaction0InputIds = [ + transaction0Input0BoxId, + transaction0Input1BoxId, +]; + +// Add additional transactions and data from Bitcoin testData +export const transaction1PaymentTransaction = `{ + "network": "doge", + "eventId": "", + "txBytes": "70736274ff01007702000000010b914262e601be6432014d82b519bf595eee40f226a673a72ca82760965ceb5a0100000000ffffffff0200e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc81861e0020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000100fd760102000000021d64f734069af52ed206f5b22157b4f21dffa6e5ce72c6f74db458638e3a62a2000000006b4830450221009a589b1cb889e0796cff6de767790866822bd45356425b7c4c4e4efcef4e6ea30220310bbc0a5fcfca1f84822e5eaaa665edcf817b1320e2229303d0caf877a2f1ac0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff0e3b1137334f790084a12b62a598eac191f2ff7b25df9749e3d92d58cbbffdf7020000006b483045022100b97a8f630779b1be32108edaa09e8c57bb0efd19b96f76cf1ab5eed592433f2502207f61878cb0bb3ef40c27cc38d5332b1ac5d2e34120cd244d107d5881f8c2fddf0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff0200e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc853b9e8020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000000", + "txId": "a5155dfe365c58006e28fb7d4c5d33dcfdd771f9a85612329da632083306e67e", + "txType": "manual", + "inputUtxos": [ + "{\\"txId\\":\\"5aeb5c966027a82ca773a626f240ee5e59bf19b5824d013264be01e66242910b\\",\\"index\\":1,\\"value\\":12494394312}" + ] + }`; + +export const transaction1InputIds = [ + '5aeb5c966027a82ca773a626f240ee5e59bf19b5824d013264be01e66242910b.1', +]; + +export const transactionOpReturnPaymentTransaction = `{ + "network": "doge", + "eventId": "", + "txBytes": "70736274ff0100880200000001972da36330161ef9af99788ccc7261f81e2a046049d1ee65ad724288159633640100000000ffffffff0300000000000000000e6a0c6161616161616161616161618442993b00000000160014828037cbcbed02c6d9948e51b89c44da3a3b81fca086010000000000160014b20272a6591937ba7d687dc889f3637ed40efa6a000000000001011f00ca9a3b00000000160014fdfe06abec6a565eff3604db30fd30069b2f2a2800000000", + "txId": "a451d0c24a8c871f52707cf2fcf0cb35f5b1ac6c734fb5cd172893d48d782e91", + "txType": "manual", + "inputUtxos": [ + "{\\"txId\\":\\"64339615884272ad65eed14960042a1ef86172cc8c7899aff91e163063a32d97\\",\\"index\\":1,\\"value\\":1000000000}" + ] +}`; + +export const transaction0Assets = { + inputAssets: { + nativeToken: 12634394312n, + tokens: [], + }, + outputAssets: { + nativeToken: 12634394312n, + tokens: [], + }, +}; +export const transaction0WrappedAssets = { + inputAssets: { + nativeToken: 126344n, + tokens: [], + }, + outputAssets: { + nativeToken: 126344n, + tokens: [], + }, +}; +export const transaction2Order: PaymentOrder = [ + { + address: 'DDd8APtwJLJZJxwmoh3YmP5oeBe9tcdUp4', + assets: { + nativeToken: 100000000n, + tokens: [], + }, + }, +]; +export const transaction2WrappedOrder: PaymentOrder = [ + { + address: 'DDd8APtwJLJZJxwmoh3YmP5oeBe9tcdUp4', + assets: { + nativeToken: 1000n, + tokens: [], + }, + }, +]; +export const transaction0HashMessage0 = + 'ac36493a67e171161c0b33a0414af459cbd49955453ef68cbf55737567457d39'; +export const transaction0Signature0 = + '9a589b1cb889e0796cff6de767790866822bd45356425b7c4c4e4efcef4e6ea3310bbc0a5fcfca1f84822e5eaaa665edcf817b1320e2229303d0caf877a2f1ac'; +export const transaction0HashMessage1 = + '0c51a346037390c214ddb9c4b28aa44d7911553066ffa6ce77d1ff1b0fff0dc0'; +export const transaction0Signature1 = + 'b97a8f630779b1be32108edaa09e8c57bb0efd19b96f76cf1ab5eed592433f257f61878cb0bb3ef40c27cc38d5332b1ac5d2e34120cd244d107d5881f8c2fddf'; +export const transaction0SignedTxBytesHex = + '70736274ff0100a002000000021d64f734069af52ed206f5b22157b4f21dffa6e5ce72c6f74db458638e3a62a20000000000ffffffff0e3b1137334f790084a12b62a598eac191f2ff7b25df9749e3d92d58cbbffdf70200000000ffffffff0200e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc853b9e8020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000100f901000000017af0d5f7b6fc3aa277e54a16f372f71e33cf9fb3632227397a1715008fb05836010000006b48304502210081c051556843abc8bfec58fd8bb6a9600f32944bf1d071998b16c42b399e7bb702200ab5c55de9a43967fe7c7f7726fabe2a34b097eb4223c4440d2dffab7e43d0c50121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff030065cd1d000000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000000000e6a0c48656c6c6f20526f73656e21480752bc030000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac0000000001076b4830450221009a589b1cb889e0796cff6de767790866822bd45356425b7c4c4e4efcef4e6ea30220310bbc0a5fcfca1f84822e5eaaa665edcf817b1320e2229303d0caf877a2f1ac0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037000100fd1f0102000000015de5e7ecd6c60bf37591d4c23a6747644040b71edbe209231542c848c7ef737f020000006a473044022069ef1e50e6cd355179f68cdf42e7f68ff442a005b4906f40aa846d945208eaf1022037ce2ecc0c294eb46f875bac50edffbe610247a2769c5dc2ad8e8f18f6155daf0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff030000000000000000356a33000000000005f5e10000000000009896802103e5bedab3f782ef17a73e9bdc41ee0e18c3ab477400f35bcf7caa54171db7ff3600e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc82944d3020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac0000000001076b483045022100b97a8f630779b1be32108edaa09e8c57bb0efd19b96f76cf1ab5eed592433f2502207f61878cb0bb3ef40c27cc38d5332b1ac5d2e34120cd244d107d5881f8c2fddf0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037000000'; +export const transaction2BoxMapping = [ + { + inputId: + 'a2623a8e6358b44df7c672cee5a6ff1df2b45721b2f506d22ef59a0634f7641d.0', + serializedOutput: + '{"txId":"5aeb5c966027a82ca773a626f240ee5e59bf19b5824d013264be01e66242910b","index":1,"value":12494394312}', + txHex: + '02000000021d64f734069af52ed206f5b22157b4f21dffa6e5ce72c6f74db458638e3a62a2000000006b4830450221009a589b1cb889e0796cff6de767790866822bd45356425b7c4c4e4efcef4e6ea30220310bbc0a5fcfca1f84822e5eaaa665edcf817b1320e2229303d0caf877a2f1ac0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff0e3b1137334f790084a12b62a598eac191f2ff7b25df9749e3d92d58cbbffdf7020000006b483045022100b97a8f630779b1be32108edaa09e8c57bb0efd19b96f76cf1ab5eed592433f2502207f61878cb0bb3ef40c27cc38d5332b1ac5d2e34120cd244d107d5881f8c2fddf0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff0200e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc853b9e8020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000', + }, + { + inputId: + 'f7fdbfcb582dd9e34997df257bfff291c1ea98a5622ba18400794f3337113b0e.2', + serializedOutput: + '{"txId":"5aeb5c966027a82ca773a626f240ee5e59bf19b5824d013264be01e66242910b","index":1,"value":12494394312}', + txHex: + '02000000021d64f734069af52ed206f5b22157b4f21dffa6e5ce72c6f74db458638e3a62a2000000006b4830450221009a589b1cb889e0796cff6de767790866822bd45356425b7c4c4e4efcef4e6ea30220310bbc0a5fcfca1f84822e5eaaa665edcf817b1320e2229303d0caf877a2f1ac0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff0e3b1137334f790084a12b62a598eac191f2ff7b25df9749e3d92d58cbbffdf7020000006b483045022100b97a8f630779b1be32108edaa09e8c57bb0efd19b96f76cf1ab5eed592433f2502207f61878cb0bb3ef40c27cc38d5332b1ac5d2e34120cd244d107d5881f8c2fddf0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff0200e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc853b9e8020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000', + }, +]; + +export const lockAddress = 'DHTom1rFwsgAn5raKU1nok8E5MdQ4GBkAN'; +export const lockAddressPublicKey = + '022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037'; +export const lockUtxo = { + txId: 'f1ac0a7ce8a45aa53ac245ea2178592f708c9ef38bee0a5bd88c9f08d47ce493', + index: 1, + scriptPubKey: + '0345307e1165c99d12557bea11f8c8cd0f6bc057fb51952e824bc7c760fda07335', + value: 3000000000n, +}; + +export const validEvent: EventTrigger = { + height: 300, + fromChain: 'doge', + toChain: 'ergo', + fromAddress: 'fromAddress', + toAddress: 'toAddress', + amount: '1000000', + bridgeFee: '1000', + networkFee: '5000', + sourceChainTokenId: 'sourceTokenId', + targetChainTokenId: 'targetTokenId', + sourceTxId: + '6e3dbf41a8e3dbf41a8cd0fe059a54cef8bb140322503d0555a9851f056825bc', + sourceChainHeight: 1000, + sourceBlockId: + '01a33c00accaa91ebe0c946bffe1ec294280a3a51a90f7f4b011f3f37c29c5ed', + WIDsHash: 'bb2b2272816e1e9993fc535c0cf57c668f5cd39c67cfcd55b4422b1aa87cd0c3', + WIDsCount: 2, +}; + +// Add additional events and data from Bitcoin testData +export const invalidEvent: EventTrigger = { + height: 300, + fromChain: 'doge', + toChain: 'ergo', + fromAddress: 'fromAddress', + toAddress: 'toAddress', + amount: '5500', + bridgeFee: '1000', + networkFee: '5000', + sourceChainTokenId: 'sourceTokenId', + targetChainTokenId: 'targetTokenId', + sourceTxId: + '6e3dbf41a8e3dbf41a8cd0fe059a54cef8bb140322503d0555a9851f056825bc', + sourceChainHeight: 1000, + sourceBlockId: + '01a33c00accaa91ebe0c946bffe1ec294280a3a51a90f7f4b011f3f37c29c5ed', + WIDsHash: 'bb2b2272816e1e9993fc535c0cf57c668f5cd39c67cfcd55b4422b1aa87cd0c3', + WIDsCount: 2, +}; + +export const validEventWithHighFee: EventTrigger = { + height: 300, + fromChain: 'doge', + toChain: 'ergo', + fromAddress: 'fromAddress', + toAddress: 'toAddress', + amount: '1000000', + bridgeFee: '1000', + networkFee: '900000', + sourceChainTokenId: 'sourceTokenId', + targetChainTokenId: 'targetTokenId', + sourceTxId: + '6e3dbf41a8e3dbf41a8cd0fe059a54cef8bb140322503d0555a9851f056825bc', + sourceChainHeight: 1000, + sourceBlockId: + '01a33c00accaa91ebe0c946bffe1ec294280a3a51a90f7f4b011f3f37c29c5ed', + WIDsHash: 'bb2b2272816e1e9993fc535c0cf57c668f5cd39c67cfcd55b4422b1aa87cd0c3', + WIDsCount: 2, +}; + +export const dogecoinTx1 = { + id: '6a1b9e7a755afb5d82ecaa5f432d51bd23e452ee1031fc99066e92788a075a84', + inputs: [ + { + txId: 'eff4900465d1603d12c1dc8f231a07ce2196c04196aa26bb80147bb152137aaf', + index: 0, + scriptPubKey: '0014bf1916dc33dbdd65f60d8b1f65eb35e8120835fc', + }, + ], + outputs: [ + { + scriptPubKey: + '6a4c3300000000007554fc820000000000962f582103f999da8e6e42660e4464d17d29e63bc006734a6710a24eb489b466323d3a9339', + value: 0n, + }, + { + scriptPubKey: + '0345307e1165c99d12557bea11f8c8cd0f6bc057fb51952e824bc7c760fda07335', + value: 3000000000n, + }, + ], +}; + +export const lockAddressUtxos = [ + { + txId: 'a2623a8e6358b44df7c672cee5a6ff1df2b45721b2f506d22ef59a0634f7641d', + index: 0, + value: 500000000n, + scriptPubKey: + '0345307e1165c99d12557bea11f8c8cd0f6bc057fb51952e824bc7c760fda07335', + txHex: + '01000000017af0d5f7b6fc3aa277e54a16f372f71e33cf9fb3632227397a1715008fb05836010000006b48304502210081c051556843abc8bfec58fd8bb6a9600f32944bf1d071998b16c42b399e7bb702200ab5c55de9a43967fe7c7f7726fabe2a34b097eb4223c4440d2dffab7e43d0c50121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff030065cd1d000000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000000000000e6a0c48656c6c6f20526f73656e21480752bc030000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000', + }, + { + txId: 'f7fdbfcb582dd9e34997df257bfff291c1ea98a5622ba18400794f3337113b0e', + index: 2, + value: 12134394312n, + scriptPubKey: + '0345307e1165c99d12557bea11f8c8cd0f6bc057fb51952e824bc7c760fda07335', + txHex: + '02000000015de5e7ecd6c60bf37591d4c23a6747644040b71edbe209231542c848c7ef737f020000006a473044022069ef1e50e6cd355179f68cdf42e7f68ff442a005b4906f40aa846d945208eaf1022037ce2ecc0c294eb46f875bac50edffbe610247a2769c5dc2ad8e8f18f6155daf0121022b9ed0a9139042921decc62603a4a07357b444da2e0bd6a96c27155117913037ffffffff030000000000000000356a33000000000005f5e10000000000009896802103e5bedab3f782ef17a73e9bdc41ee0e18c3ab477400f35bcf7caa54171db7ff3600e1f505000000001976a9145d0e02100e393220f90ffce4485f809de4ff777c88acc82944d3020000001976a914872b67c8270a9eaf5c2abf632af3dea989d2e37188ac00000000', + }, +]; + +export const transaction2PaymentTransaction = `{ + "network": "doge", + "eventId": "", + "txBytes": "70736274ff01009a0200000002193a28a12c8be889390e48b30cf9c65096f3f51bc04c2475557096d0cfca4f220100000000ffffffffd2e6232676e35e104927f22d4c90bc367c684209a4937664bad886227cd95c4b0100000000ffffffff028063ef2700000000160014828037cbcbed02c6d9948e51b89c44da3a3b81fcaff9e08a00000000160014fdfe06abec6a565eff3604db30fd30069b2f2a28000000000001011f00ca9a3b00000000160014fdfe06abec6a565eff3604db30fd30069b2f2a280001011f0094357700000000160014fdfe06abec6a565eff3604db30fd30069b2f2a28000000", + "txId": "5bc486302164841b32bdfa03f510590109e3520d0a0aa6a15edfea0c8e33a080", + "txType": "manual", + "inputUtxos": [ + "{\\"txId\\":\\"224fcacfd096705575244cc01bf5f39650c6f90cb3480e3989e88b2ca1283a19\\",\\"index\\":1,\\"value\\":1000000000}", + "{\\"txId\\":\\"4b5cd97c2286d8ba647693a40942687c36bc904c2df22749105ee3762623e6d2\\",\\"index\\":1,\\"value\\":2000000000}" + ] +}`; + +export const coveredBoxes = [ + { + txId: '5aeb5c966027a82ca773a626f240ee5e59bf19b5824d013264be01e66242910b', + index: 1, + value: 12494394312n, + }, +]; diff --git a/packages/chains/doge/tests/testUtils.ts b/packages/chains/doge/tests/testUtils.ts new file mode 100644 index 00000000..639546ee --- /dev/null +++ b/packages/chains/doge/tests/testUtils.ts @@ -0,0 +1,55 @@ +import { randomBytes } from 'crypto'; +import * as testData from './testData'; +import { DogeChain, DogeConfigs, TssSignFunction } from '../lib'; +import TestDogeNetwork from './network/TestDogeNetwork'; +import { TokenMap } from '@rosen-bridge/tokens'; + +export const generateRandomId = (): string => randomBytes(32).toString('hex'); + +export const observationTxConfirmation = 5; +export const paymentTxConfirmation = 9; +export const coldTxConfirmation = 10; +export const manualTxConfirmation = 11; +export const arbitraryTxConfirmation = 12; +export const rwtId = + '9410db5b39388c6b515160e7248346d7ec63d5457292326da12a26cc02efb526'; +export const configs: DogeConfigs = { + fee: 1000000n, + addresses: { + lock: testData.lockAddress, + cold: 'cold', + permit: 'permit', + fraud: 'fraud', + }, + rwtId: rwtId, + confirmations: { + observation: observationTxConfirmation, + payment: paymentTxConfirmation, + cold: coldTxConfirmation, + manual: manualTxConfirmation, + arbitrary: arbitraryTxConfirmation, + }, + aggregatedPublicKey: testData.lockAddressPublicKey, + txFeeSlippage: 10, +}; +export const mockedSignFn = () => + Promise.resolve({ + signature: '', + signatureRecovery: '', + }); +export const generateChainObject = async ( + network: TestDogeNetwork, + signFn: TssSignFunction = mockedSignFn +) => { + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.testTokenMap); + return new DogeChain(network, configs, tokenMap, signFn); +}; +export const generateChainObjectWithMultiDecimalTokenMap = async ( + network: TestDogeNetwork, + signFn: TssSignFunction = mockedSignFn +) => { + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.multiDecimalTokenMap); + return new DogeChain(network, configs, tokenMap, signFn); +}; diff --git a/packages/chains/doge/tsconfig.build.json b/packages/chains/doge/tsconfig.build.json new file mode 100644 index 00000000..77165229 --- /dev/null +++ b/packages/chains/doge/tsconfig.build.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": "./lib" + }, + "exclude": ["tests", "vitest.config.ts"] +} diff --git a/packages/chains/doge/tsconfig.json b/packages/chains/doge/tsconfig.json new file mode 100644 index 00000000..6dc77c1a --- /dev/null +++ b/packages/chains/doge/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist" + }, + "include": ["tests", "lib", "vitest.config.ts"], + "references": [{ "path": "../../abstract-chain" }] +} diff --git a/packages/chains/doge/vitest.config.ts b/packages/chains/doge/vitest.config.ts new file mode 100644 index 00000000..661cb841 --- /dev/null +++ b/packages/chains/doge/vitest.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + coverage: { + all: true, + provider: 'istanbul', + reporter: 'cobertura', + }, + passWithNoTests: true, + poolOptions: { + forks: { + singleFork: true, + }, + }, + }, +}); diff --git a/packages/chains/ergo/lib/ErgoChain.ts b/packages/chains/ergo/lib/ErgoChain.ts index f7ed880d..1a6169a8 100644 --- a/packages/chains/ergo/lib/ErgoChain.ts +++ b/packages/chains/ergo/lib/ErgoChain.ts @@ -26,7 +26,7 @@ import { ErgoConfigs, GuardsPkConfig } from './types'; import JsonBI from '@rosen-bridge/json-bigint'; import JsonBigInt from '@rosen-bridge/json-bigint'; import { ErgoRosenExtractor } from '@rosen-bridge/rosen-extractor'; -import { RosenTokens } from '@rosen-bridge/tokens'; +import { TokenMap } from '@rosen-bridge/tokens'; class ErgoChain extends AbstractUtxoChain { CHAIN = ERGO_CHAIN; @@ -46,7 +46,7 @@ class ErgoChain extends AbstractUtxoChain { constructor( network: AbstractErgoNetwork, configs: ErgoConfigs, - tokens: RosenTokens, + tokens: TokenMap, signFunction: ( tx: wasm.ReducedTransaction, requiredSign: number, diff --git a/packages/chains/ergo/package.json b/packages/chains/ergo/package.json index 8069ab9b..aabaf8fb 100644 --- a/packages/chains/ergo/package.json +++ b/packages/chains/ergo/package.json @@ -22,8 +22,8 @@ "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "ergo-lib-wasm-nodejs": "^0.24.1" }, diff --git a/packages/chains/ergo/tests/ErgoChain.spec.ts b/packages/chains/ergo/tests/ErgoChain.spec.ts index 540763ac..ec6b53b7 100644 --- a/packages/chains/ergo/tests/ErgoChain.spec.ts +++ b/packages/chains/ergo/tests/ErgoChain.spec.ts @@ -17,6 +17,7 @@ import { ErgoConfigs } from '../lib'; import * as wasm from 'ergo-lib-wasm-nodejs'; import ErgoTransaction from '../lib/ErgoTransaction'; import { MockInstance } from 'vitest'; +import { TokenMap } from '@rosen-bridge/tokens'; describe('ErgoChain', () => { describe('generateTransaction', () => { @@ -132,11 +133,13 @@ describe('ErgoChain', () => { eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); // mock getCoveringBoxes const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const getCoveringBoxesSpy = vi.spyOn( @@ -306,11 +309,13 @@ describe('ErgoChain', () => { eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); // run test and expect exception thrown const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); await expect(async () => { @@ -406,11 +411,13 @@ describe('ErgoChain', () => { eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); // mock getCoveringBoxes const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const getCoveringBoxesSpy = vi.spyOn( @@ -529,11 +536,14 @@ describe('ErgoChain', () => { eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); + // mock getCoveringBoxes const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const getCoveringBoxesSpy = vi.spyOn( @@ -675,12 +685,14 @@ describe('ErgoChain', () => { minBoxValue: 300000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.multiDecimalTokenMap); // mock getCoveringBoxes const ergoChain = new ErgoChain( network, config, - ergoTestUtils.multiDecimalTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const getCoveringBoxesSpy = vi.spyOn( @@ -837,10 +849,11 @@ describe('ErgoChain', () => { const expectedAssets = transactionTestData.transaction3WrappedAssets; // run test - const ergoChain = ergoTestUtils.generateDefaultChainObjectWithTokenMap( - network, - ergoTestUtils.multiDecimalTokenMap - ); + const ergoChain = + await ergoTestUtils.generateDefaultChainObjectWithTokenMap( + network, + ergoTestUtils.multiDecimalTokenMap + ); const result = await ergoChain.getTransactionAssets(paymentTx); // check returned value @@ -862,7 +875,7 @@ describe('ErgoChain', () => { * @expected * - it should return mocked transaction order */ - it('should extract transaction order successfully', () => { + it('should extract transaction order successfully', async () => { // mock PaymentTransaction const paymentTx = ErgoTransaction.fromJson( transactionTestData.transaction6PaymentTransaction @@ -883,10 +896,12 @@ describe('ErgoChain', () => { }; // run test + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = ergoChain.extractTransactionOrder(paymentTx); @@ -906,7 +921,7 @@ describe('ErgoChain', () => { * @expected * - it should return mocked transaction order */ - it('should wrap transaction order successfully', () => { + it('should wrap transaction order successfully', async () => { // mock PaymentTransaction const paymentTx = ErgoTransaction.fromJson( transactionTestData.transaction6PaymentTransaction @@ -927,10 +942,12 @@ describe('ErgoChain', () => { }; // run test + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.multiDecimalTokenMap); const ergoChain = new ErgoChain( network, config, - ergoTestUtils.multiDecimalTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = ergoChain.extractTransactionOrder(paymentTx); @@ -984,10 +1001,12 @@ describe('ErgoChain', () => { }; // run test + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = await ergoChain.verifyTransactionFee(paymentTx); @@ -1037,10 +1056,12 @@ describe('ErgoChain', () => { }; // run test + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = await ergoChain.verifyTransactionFee(paymentTx); @@ -1149,12 +1170,14 @@ describe('ErgoChain', () => { minBoxValue: 1000000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); // run test const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = await ergoChain.verifyTransactionExtraConditions( @@ -1197,12 +1220,14 @@ describe('ErgoChain', () => { minBoxValue: 1000000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); // run test const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = await ergoChain.verifyTransactionExtraConditions( @@ -1253,12 +1278,14 @@ describe('ErgoChain', () => { minBoxValue: 1000000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); // run test const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = await ergoChain.verifyTransactionExtraConditions( @@ -1302,12 +1329,14 @@ describe('ErgoChain', () => { minBoxValue: 1000000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); // run test const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = await ergoChain.verifyTransactionExtraConditions( @@ -1350,12 +1379,14 @@ describe('ErgoChain', () => { minBoxValue: 1000000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); // run test const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = await ergoChain.verifyTransactionExtraConditions( @@ -1942,17 +1973,18 @@ describe('ErgoChain', () => { * @expected * - it should return RWT amount */ - it('should wrap RWT amount successfully', () => { + it('should wrap RWT amount successfully', async () => { // mock an ErgoBox with RWT and construct serialized box const serializedBox = Buffer.from( ergoTestUtils.toErgoBox(boxTestData.eventBox1).sigma_serialize_bytes() ).toString('hex'); // run test - const ergoChain = ergoTestUtils.generateDefaultChainObjectWithTokenMap( - network, - ergoTestUtils.wrappedRwtTokenMap - ); + const ergoChain = + await ergoTestUtils.generateDefaultChainObjectWithTokenMap( + network, + ergoTestUtils.wrappedRwtTokenMap + ); const result = ergoChain.getBoxRWT(serializedBox); // check returned value @@ -2026,7 +2058,7 @@ describe('ErgoChain', () => { * @expected * - it should return constructed BoxInfo */ - it('should wrap assets successfully', () => { + it('should wrap assets successfully', async () => { // mock an ErgoBox with assets const box = ergoTestUtils.toErgoBox(boxTestData.ergoBox1); const serializedBox = Buffer.from(box.sigma_serialize_bytes()).toString( @@ -2038,10 +2070,11 @@ describe('ErgoChain', () => { }; // run test - const ergoChain = ergoTestUtils.generateDefaultChainObjectWithTokenMap( - network, - ergoTestUtils.multiDecimalTokenMap - ); + const ergoChain = + await ergoTestUtils.generateDefaultChainObjectWithTokenMap( + network, + ergoTestUtils.multiDecimalTokenMap + ); const result = ergoChain.getSerializedBoxInfo(serializedBox); // check returned value @@ -2310,7 +2343,7 @@ describe('ErgoChain', () => { * @expected * - it should return mocked transaction order */ - it('should extract transaction order successfully', () => { + it('should extract transaction order successfully', async () => { // mock serialized transaction const serializedTx = Buffer.from( ergoTestUtils @@ -2334,10 +2367,12 @@ describe('ErgoChain', () => { }; // run test + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.testTokenMap); const ergoChain = new ErgoChain( network, config, - ergoTestUtils.testTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = ergoChain.extractSignedTransactionOrder(serializedTx); @@ -2357,7 +2392,7 @@ describe('ErgoChain', () => { * @expected * - it should return mocked transaction order */ - it('should wrap transaction order successfully', () => { + it('should wrap transaction order successfully', async () => { // mock serialized transaction const serializedTx = Buffer.from( ergoTestUtils @@ -2379,12 +2414,14 @@ describe('ErgoChain', () => { minBoxValue: 1000000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(ergoTestUtils.multiDecimalTokenMap); // run test const ergoChain = new ErgoChain( network, config, - ergoTestUtils.multiDecimalTokenMap, + tokenMap, ergoTestUtils.defaultSignFunction ); const result = ergoChain.extractSignedTransactionOrder(serializedTx); diff --git a/packages/chains/ergo/tests/ergoTestUtils.ts b/packages/chains/ergo/tests/ergoTestUtils.ts index 9a4a7ce3..35309436 100644 --- a/packages/chains/ergo/tests/ergoTestUtils.ts +++ b/packages/chains/ergo/tests/ergoTestUtils.ts @@ -5,174 +5,132 @@ import * as wasm from 'ergo-lib-wasm-nodejs'; import TestErgoNetwork from './network/TestErgoNetwork'; import { ErgoChain, ErgoConfigs } from '../lib'; import { transaction2SignedSerialized } from './transactionTestData'; +import { TokenMap } from '@rosen-bridge/tokens'; -export const testTokenMap: RosenTokens = { - idKeys: { - ergo: 'tokenId', - cardano: 'tokenId', - bitcoin: 'tokenId', +export const testTokenMap: RosenTokens = []; +export const multiDecimalTokenMap: RosenTokens = [ + { + ergo: { + tokenId: 'erg', + name: 'erg', + decimals: 9, + type: 'ERG', + residency: 'native', + }, + cardano: { + tokenId: + 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286.5273744552477654657374', + name: 'RstERGvTest', + policyId: 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286', + assetName: '5273744552477654657374', + decimals: 10, + type: 'native', + residency: 'wrapped', + }, }, - tokens: [], -}; -export const multiDecimalTokenMap: RosenTokens = { - idKeys: { - ergo: 'tokenId', - cardano: 'tokenId', + { + ergo: { + tokenId: + '10278c102bf890fdab8ef5111e94053c90b3541bc25b0de2ee8aa6305ccec3de', + name: 'Ergo-Token.V-test', + decimals: 1, + type: 'EIP-004', + residency: 'native', + }, + cardano: { + tokenId: + '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b.5273744572676f546f6b656e7654657374', + name: 'RstErgoTokenvTest', + policyId: '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b', + assetName: '5273744572676f546f6b656e7654657374', + decimals: 0, + type: 'native', + residency: 'wrapped', + }, }, - tokens: [ - { - ergo: { - tokenId: 'erg', - name: 'erg', - decimals: 9, - metaData: { - type: 'ERG', - residency: 'native', - }, - }, - cardano: { - tokenId: - 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286.5273744552477654657374', - name: 'RstERGvTest', - policyId: 'ef6aa6200e21634e58ce6796b4b61d1d7d059d2ebe93c2996eeaf286', - assetName: '5273744552477654657374', - decimals: 10, - metaData: { - type: 'native', - residency: 'wrapped', - }, - }, + { + ergo: { + tokenId: + '895a0268c749b9ab894e4d064a783dfe1361b64c9d99857c391390d630ebe2d2', + name: 'RST-Cardano-Token.V-test', + decimals: 4, + type: 'EIP-004', + residency: 'wrapped', + }, + cardano: { + tokenId: + 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be.43617264616e6f546f6b656e7654657374', + name: 'CardanoTokenvTest', + policyId: 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be', + assetName: '43617264616e6f546f6b656e7654657374', + decimals: 3, + type: 'native', + residency: 'native', }, - { - ergo: { - tokenId: - '10278c102bf890fdab8ef5111e94053c90b3541bc25b0de2ee8aa6305ccec3de', - name: 'Ergo-Token.V-test', - decimals: 1, - metaData: { - type: 'EIP-004', - residency: 'native', - }, - }, - cardano: { - tokenId: - '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b.5273744572676f546f6b656e7654657374', - name: 'RstErgoTokenvTest', - policyId: '48d4a14b8407af8407702df3afda4cc8a945ce55235e9808c62c5f9b', - assetName: '5273744572676f546f6b656e7654657374', - decimals: 0, - metaData: { - type: 'native', - residency: 'wrapped', - }, - }, + }, + { + ergo: { + tokenId: + '7b0cc1b9c6e3dbf41a8cd0fe059a545dfbd0dfafc4093d0555a9851f06662dff', + name: 'test', + decimals: 2, + type: 'EIP-004', + residency: 'wrapped', }, - { - ergo: { - tokenId: - '895a0268c749b9ab894e4d064a783dfe1361b64c9d99857c391390d630ebe2d2', - name: 'RST-Cardano-Token.V-test', - decimals: 4, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: - 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be.43617264616e6f546f6b656e7654657374', - name: 'CardanoTokenvTest', - policyId: 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be', - assetName: '43617264616e6f546f6b656e7654657374', - decimals: 3, - metaData: { - type: 'native', - residency: 'native', - }, - }, + cardano: { + tokenId: + 'e043fa0e1adaa5abeca716791384b64be4d15c7d1e80817e43992e4a.43617264616e6f546f6b656e7654657374', + name: 'test', + policyId: 'e043fa0e1adaa5abeca716791384b64be4d15c7d1e80817e43992e4a', + assetName: '43617264616e6f546f6b656e7654657374', + decimals: 1, + type: 'native', + residency: 'native', }, - { - ergo: { - tokenId: - '7b0cc1b9c6e3dbf41a8cd0fe059a545dfbd0dfafc4093d0555a9851f06662dff', - name: 'test', - decimals: 2, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: - 'e043fa0e1adaa5abeca716791384b64be4d15c7d1e80817e43992e4a.43617264616e6f546f6b656e7654657374', - name: 'test', - policyId: 'e043fa0e1adaa5abeca716791384b64be4d15c7d1e80817e43992e4a', - assetName: '43617264616e6f546f6b656e7654657374', - decimals: 1, - metaData: { - type: 'native', - residency: 'native', - }, - }, + }, + { + ergo: { + tokenId: + '3688bf4dbfa9e77606446ca0189546621097cee6979e2befc8ef56825ba82580', + name: 'test', + decimals: 2, + type: 'EIP-004', + residency: 'wrapped', }, - { - ergo: { - tokenId: - '3688bf4dbfa9e77606446ca0189546621097cee6979e2befc8ef56825ba82580', - name: 'test', - decimals: 2, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: - '55ca25ad5c788597f13e5c61d415315e8ac1f40e08d172a7809c016c.43617264616e6f546f6b656e7654657374', - name: 'test', - policyId: 'e043fa0e1adaa5abeca716791384b64be4d15c7d1e80817e43992e4a', - assetName: '43617264616e6f546f6b656e7654657374', - decimals: 2, - metaData: { - type: 'native', - residency: 'native', - }, - }, + cardano: { + tokenId: + '55ca25ad5c788597f13e5c61d415315e8ac1f40e08d172a7809c016c.43617264616e6f546f6b656e7654657374', + name: 'test', + policyId: 'e043fa0e1adaa5abeca716791384b64be4d15c7d1e80817e43992e4a', + assetName: '43617264616e6f546f6b656e7654657374', + decimals: 2, + type: 'native', + residency: 'native', }, - ], -}; -export const wrappedRwtTokenMap: RosenTokens = { - idKeys: { - ergo: 'tokenId', - cardano: 'tokenId', }, - tokens: [ - { - ergo: { - tokenId: - '9410db5b39388c6b515160e7248346d7ec63d5457292326da12a26cc02efb526', - name: 'Ergo-RWT.V-test', - decimals: 1, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: - 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be.43617264616e6f546f6b656e7654657374', - name: 'CardanoTokenvTest', - policyId: 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be', - assetName: '43617264616e6f546f6b656e7654657374', - decimals: 0, - metaData: { - type: 'native', - residency: 'native', - }, - }, +]; +export const wrappedRwtTokenMap: RosenTokens = [ + { + ergo: { + tokenId: + '9410db5b39388c6b515160e7248346d7ec63d5457292326da12a26cc02efb526', + name: 'Ergo-RWT.V-test', + decimals: 1, + type: 'EIP-004', + residency: 'wrapped', }, - ], -}; + cardano: { + tokenId: + 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be.43617264616e6f546f6b656e7654657374', + name: 'CardanoTokenvTest', + policyId: 'cfd784ccfe5fe8ce7d09f4ddb65624378cc8022bf3ec240cf41ea6be', + assetName: '43617264616e6f546f6b656e7654657374', + decimals: 0, + type: 'native', + residency: 'native', + }, + }, +]; export const testLockAddress = '9es3xKFSehNNwCpuNpY31ScAubDqeLbSWwaCysjN1ee51bgHKTq'; @@ -222,12 +180,14 @@ export const generateChainObject = ( minBoxValue: 1000000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + tokenMap.updateConfigByJson; // mock a sign function to return signed transaction - return new ErgoChain(network, config, testTokenMap, signFn); + return new ErgoChain(network, config, new TokenMap(), signFn); }; -export const generateDefaultChainObjectWithTokenMap = ( +export const generateDefaultChainObjectWithTokenMap = async ( network: TestErgoNetwork, - tokenMap: RosenTokens + rosenTokens: RosenTokens ) => { const config: ErgoConfigs = { fee: 100n, @@ -242,6 +202,8 @@ export const generateDefaultChainObjectWithTokenMap = ( minBoxValue: 1000000n, eventTxConfirmation: 18, }; + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(rosenTokens); // mock a sign function to return signed transaction return new ErgoChain(network, config, tokenMap, defaultSignFunction); }; diff --git a/packages/chains/ergo/tests/network/TestErgoNetwork.ts b/packages/chains/ergo/tests/network/TestErgoNetwork.ts index 3a50090a..12c271cc 100644 --- a/packages/chains/ergo/tests/network/TestErgoNetwork.ts +++ b/packages/chains/ergo/tests/network/TestErgoNetwork.ts @@ -7,12 +7,10 @@ import { BlockInfo, TokenDetail, } from '@rosen-chains/abstract-chain'; +import { TokenMap } from '@rosen-bridge/tokens'; class TestErgoNetwork extends AbstractErgoNetwork { - extractor = new ErgoRosenExtractor(testLockAddress, { - idKeys: {}, - tokens: [], - }); + extractor = new ErgoRosenExtractor(testLockAddress, new TokenMap()); notImplemented = () => { throw Error('Not implemented'); diff --git a/packages/chains/ethereum/lib/EthereumChain.ts b/packages/chains/ethereum/lib/EthereumChain.ts index 7c63b49a..e0e2f709 100644 --- a/packages/chains/ethereum/lib/EthereumChain.ts +++ b/packages/chains/ethereum/lib/EthereumChain.ts @@ -4,7 +4,7 @@ import { EvmConfigs, TssSignFunction, } from '@rosen-chains/evm'; -import { RosenTokens } from '@rosen-bridge/tokens'; +import { TokenMap } from '@rosen-bridge/tokens'; import { AbstractLogger } from '@rosen-bridge/abstract-logger'; import { ETH, ETHEREUM_CHAIN, ETHEREUM_CHAIN_ID } from './constants'; @@ -16,8 +16,7 @@ class EthereumChain extends EvmChain { constructor( network: AbstractEvmNetwork, configs: EvmConfigs, - tokens: RosenTokens, - supportedTokens: Array, + tokens: TokenMap, signFunction: TssSignFunction, logger?: AbstractLogger ) { @@ -25,7 +24,6 @@ class EthereumChain extends EvmChain { network, configs, tokens, - supportedTokens, signFunction, ETHEREUM_CHAIN, ETH, diff --git a/packages/chains/ethereum/package.json b/packages/chains/ethereum/package.json index 4cf126a2..bbad1710 100644 --- a/packages/chains/ethereum/package.json +++ b/packages/chains/ethereum/package.json @@ -32,7 +32,7 @@ }, "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "@rosen-chains/evm": "^6.0.1" } diff --git a/packages/chains/evm/lib/EvmChain.ts b/packages/chains/evm/lib/EvmChain.ts index da354ad6..c7892811 100644 --- a/packages/chains/evm/lib/EvmChain.ts +++ b/packages/chains/evm/lib/EvmChain.ts @@ -1,4 +1,4 @@ -import { RosenTokens } from '@rosen-bridge/tokens'; +import { TokenMap } from '@rosen-bridge/tokens'; import JSONBigInt from '@rosen-bridge/json-bigint'; import { AbstractChain, @@ -34,14 +34,13 @@ abstract class EvmChain extends AbstractChain { evmTxType: number; extractor: EvmRosenExtractor | undefined; - supportedTokens: Array; + supportedTokens: Array = []; protected signFunction: TssSignFunction; constructor( network: AbstractEvmNetwork, configs: EvmConfigs, - tokens: RosenTokens, - supportedTokens: Array, + tokens: TokenMap, signFunction: TssSignFunction, CHAIN: string, NATIVE_TOKEN_ID: string, @@ -50,7 +49,6 @@ abstract class EvmChain extends AbstractChain { ) { super(network, configs, tokens, logger); this.evmTxType = evmTxType; - this.supportedTokens = supportedTokens; this.signFunction = signFunction; this.extractor = new EvmRosenExtractor( this.configs.addresses.lock, @@ -59,6 +57,15 @@ abstract class EvmChain extends AbstractChain { NATIVE_TOKEN_ID, logger ); + const supportedTokens = tokens + .getConfig() + .filter( + (tokenSet) => + Object.keys(tokenSet).includes(CHAIN) && + tokenSet[CHAIN].type !== 'native' + ) + .map((tokenSet) => tokenSet[CHAIN].tokenId); + this.updateSupportedTokens(supportedTokens); } /** @@ -951,6 +958,10 @@ abstract class EvmChain extends AbstractChain { return true; }; + + updateSupportedTokens = async (supportedTokens: Array) => { + this.supportedTokens = supportedTokens; + }; } export default EvmChain; diff --git a/packages/chains/evm/package.json b/packages/chains/evm/package.json index a6f70cc4..35bed591 100644 --- a/packages/chains/evm/package.json +++ b/packages/chains/evm/package.json @@ -35,8 +35,8 @@ "dependencies": { "@rosen-bridge/abstract-logger": "^2.0.1", "@rosen-bridge/json-bigint": "^0.1.0", - "@rosen-bridge/rosen-extractor": "^6.3.1", - "@rosen-bridge/tokens": "^1.2.1", + "@rosen-bridge/rosen-extractor": "^7.0.1", + "@rosen-bridge/tokens": "^2.0.0", "@rosen-chains/abstract-chain": "^11.0.3", "ethers": "^6.11.1" } diff --git a/packages/chains/evm/tests/EvmChain.spec.ts b/packages/chains/evm/tests/EvmChain.spec.ts index a919661a..35b35571 100644 --- a/packages/chains/evm/tests/EvmChain.spec.ts +++ b/packages/chains/evm/tests/EvmChain.spec.ts @@ -15,6 +15,7 @@ import { FeeData, Transaction, TransactionLike } from 'ethers'; import { mockGetAddressBalanceForNativeToken } from './TestUtils'; import { EvmTxStatus } from '../lib'; import TestChain from './TestChain'; +import { TokenMap } from '@rosen-bridge/tokens'; describe('EvmChain', () => { describe(`constructor`, () => { @@ -29,16 +30,44 @@ describe('EvmChain', () => { */ it('should initialize rosen-extractor successfully', async () => { const network = new TestEvmNetwork(); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(TestData.testTokenMap); const chain = new TestChain( network, testUtils.configs, - TestData.testTokenMap, - TestData.supportedTokens, + tokenMap, testUtils.mockedSignFn, 2 ); + chain.updateSupportedTokens(TestData.supportedTokens); expect(chain.extractor?.chain).toEqual(chain.CHAIN); }); + + /** + * @target EvmChain.constructor should initialize supported tokens successfully + * @dependencies + * @scenario + * - initialize EvmChain with a rich token map + * - check supported tokens + * @expected + * - supported tokens should be the token IDs of test tokens in the given token map + * with the exception of the native token + */ + it('should initialize supported tokens successfully', async () => { + const network = new TestEvmNetwork(); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(TestData.tokenMapWithVariousTestTokens); + const chain = new TestChain( + network, + testUtils.configs, + tokenMap, + testUtils.mockedSignFn, + 2 + ); + expect(chain.supportedTokens).toEqual( + TestData.supportedTokensOfVariousTestTokens + ); + }); }); describe('generateMultipleTransactions', () => { @@ -85,7 +114,8 @@ describe('EvmChain', () => { // mock hasLockAddressEnoughAssets, getFeeData, // getGasRequired, getAddressNextNonce const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); + evmChain.updateSupportedTokens(TestData.supportedTokens); const requiredGas = 100000n; testUtils.mockHasLockAddressEnoughAssets(evmChain, true); testUtils.mockGetFeeData(network, new FeeData(10n, 10n, 10n)); @@ -168,7 +198,7 @@ describe('EvmChain', () => { // mock hasLockAddressEnoughAssets, getFeeData, // getGasRequired, getAddressNextNonce const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const requiredGas = 21000n; testUtils.mockHasLockAddressEnoughAssets(evmChain, true); testUtils.mockGetFeeData(network, new FeeData(10n, 10n, 10n)); @@ -247,7 +277,7 @@ describe('EvmChain', () => { // mock hasLockAddressEnoughAssets, getFeeData, // getGasRequired, getAddressNextNonce const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); testUtils.mockHasLockAddressEnoughAssets(evmChain, true); testUtils.mockGetFeeData(network, new FeeData(10n, 10n, 10n)); testUtils.mockGetGasRequired(network, 200000n); @@ -310,7 +340,7 @@ describe('EvmChain', () => { const txType = TransactionType.payment; // run test and expect error const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); await expect(async () => { await evmChain.generateMultipleTransactions( eventId, @@ -340,7 +370,8 @@ describe('EvmChain', () => { // mock hasLockAddressEnoughAssets and getAddressNextNonce const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); + evmChain.updateSupportedTokens(TestData.supportedTokens); testUtils.mockHasLockAddressEnoughAssets(evmChain, false); testUtils.mockGetFeeData(network, new FeeData(10n, 10n, 10n)); testUtils.mockGetAddressNextAvailableNonce(network, nonce); @@ -400,7 +431,7 @@ describe('EvmChain', () => { // mock hasLockAddressEnoughAssets, getFeeData, // getGasRequired, getAddressNextNonce const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const requiredGas = 21000n; testUtils.mockHasLockAddressEnoughAssets(evmChain, true); testUtils.mockGetFeeData(network, new FeeData(10n, 10n, 10n)); @@ -478,7 +509,8 @@ describe('EvmChain', () => { // mock hasLockAddressEnoughAssets, getAddressNextNonce, const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); + evmChain.updateSupportedTokens(TestData.supportedTokens); testUtils.mockHasLockAddressEnoughAssets(evmChain, true); testUtils.mockGetFeeData(network, new FeeData(10n, 10n, 10n)); testUtils.mockGetGasRequired(network, 200000n); @@ -519,7 +551,7 @@ describe('EvmChain', () => { it('should generate payment transaction successfully for wrapped order', async () => { const network = new TestEvmNetwork(); const evmChain = - testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); const order = TestData.nativePaymentWrappedOrder; const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; @@ -599,7 +631,11 @@ describe('EvmChain', () => { // mock hasLockAddressEnoughAssets, getFeeData, // getGasRequired, getAddressNextNonce const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network, undefined, 0); + const evmChain = await testUtils.generateChainObject( + network, + undefined, + 0 + ); const requiredGas = 21000n; testUtils.mockHasLockAddressEnoughAssets(evmChain, true); testUtils.mockGetFeeData(network, new FeeData(10n, null, null)); @@ -649,9 +685,9 @@ describe('EvmChain', () => { }); }); - describe('rawTxToPaymentTransaction', () => { + describe('rawTxToPaymentTransaction', async () => { const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); /** * @target EvmChain.rawTxToPaymentTransaction should construct transaction successfully @@ -687,7 +723,11 @@ describe('EvmChain', () => { * - throw TransactionFormatError */ it('should throw error when transaction type is unexpected', async () => { - const evmChain = testUtils.generateChainObject(network, undefined, 0); + const evmChain = await testUtils.generateChainObject( + network, + undefined, + 0 + ); expect(async () => { await evmChain.rawTxToPaymentTransaction( TestData.transaction1JsonString @@ -696,9 +736,9 @@ describe('EvmChain', () => { }); }); - describe('getTransactionAssets', () => { + describe('getTransactionAssets', async () => { const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); /** * @target EvmChain.getTransactionAssets should get transaction assets @@ -813,7 +853,11 @@ describe('EvmChain', () => { * - it should return mocked transaction assets (both input and output assets) */ it('should get transaction assets successfully for type 0 transactions', async () => { - const evmChain = testUtils.generateChainObject(network, undefined, 0); + const evmChain = await testUtils.generateChainObject( + network, + undefined, + 0 + ); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; // mock PaymentTransaction @@ -852,7 +896,7 @@ describe('EvmChain', () => { it('should wrap transaction assets successfully', async () => { const network = new TestEvmNetwork(); const evmChain = - testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; @@ -899,7 +943,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const tx = Transaction.from(TestData.transaction1Json); tx.gasLimit = 85000n * evmChain.configs.gasLimitMultiplier; tx.maxFeePerGas = 22n; @@ -940,7 +984,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const tx = Transaction.from(TestData.transaction1Json); tx.gasLimit = 100000n * evmChain.configs.gasLimitMultiplier; tx.maxFeePerGas = 22n; @@ -982,7 +1026,11 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network, undefined, 0); + const evmChain = await testUtils.generateChainObject( + network, + undefined, + 0 + ); const tx = Transaction.from(TestData.transaction1Json); tx.gasLimit = 55000n * evmChain.configs.gasLimitMultiplier; tx.maxFeePerGas = 22n; @@ -1027,7 +1075,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1Json); @@ -1071,7 +1119,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1Json); @@ -1115,7 +1163,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1Json); @@ -1159,7 +1207,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1Json); @@ -1202,7 +1250,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1Json); @@ -1245,7 +1293,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1Json); @@ -1288,7 +1336,7 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1Json); @@ -1331,7 +1379,11 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, null, null)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network, undefined, 0); + const evmChain = await testUtils.generateChainObject( + network, + undefined, + 0 + ); const tx = Transaction.from(TestData.transaction1WithType0Json); tx.gasLimit = 85000n * evmChain.configs.gasLimitMultiplier; tx.gasPrice = 22n; @@ -1373,7 +1425,11 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, null, null)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network, undefined, 0); + const evmChain = await testUtils.generateChainObject( + network, + undefined, + 0 + ); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1WithType0Json); @@ -1415,7 +1471,11 @@ describe('EvmChain', () => { testUtils.mockGetFeeData(network, new FeeData(20n, null, null)); // mock PaymentTransaction - const evmChain = testUtils.generateChainObject(network, undefined, 0); + const evmChain = await testUtils.generateChainObject( + network, + undefined, + 0 + ); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.transaction1WithType0Json); @@ -1439,9 +1499,9 @@ describe('EvmChain', () => { }); }); - describe('extractTransactionOrder', () => { + describe('extractTransactionOrder', async () => { const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); /** * @target EvmChain.extractTransactionOrder should extract transaction @@ -1660,9 +1720,9 @@ describe('EvmChain', () => { * @expected * - it should return mocked transaction order */ - it('should wrap transaction order successfully', () => { + it('should wrap transaction order successfully', async () => { const evmChain = - testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); // mock PaymentTransaction const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; @@ -1715,7 +1775,7 @@ describe('EvmChain', () => { it('should submit the transaction when transaction is of type 2, fees are set properly and lock address has enough assets', async () => { // mock network functions const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); testUtils.mockHasLockAddressEnoughAssets(evmChain, true); testUtils.mockGetGasRequired(network, 70000n); @@ -1760,7 +1820,7 @@ describe('EvmChain', () => { it('should not submit the transaction when gasLimit is wrong', async () => { // mock network functions const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); testUtils.mockHasLockAddressEnoughAssets(evmChain, true); testUtils.mockGetGasRequired(network, 77000n); @@ -1805,7 +1865,7 @@ describe('EvmChain', () => { it('should not submit the transaction when lock address does not have enough asset', async () => { // mock network functions const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); testUtils.mockHasLockAddressEnoughAssets(evmChain, false); testUtils.mockGetGasRequired(network, 70000n); @@ -1850,7 +1910,7 @@ describe('EvmChain', () => { it('should not submit the transaction when checking failed due to error', async () => { // mock network functions const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); testUtils.mockGetFeeData(network, new FeeData(20n, 20n, 7n)); testUtils.mockHasLockAddressEnoughAssets(evmChain, false); vi.spyOn(network, 'getGasRequired').mockImplementation(() => { @@ -1880,9 +1940,9 @@ describe('EvmChain', () => { }); }); - describe('verifyTransactionExtraConditions', () => { + describe('verifyTransactionExtraConditions', async () => { const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); /** * @target EvmChain.verifyTransactionExtraConditions should return true @@ -2273,7 +2333,7 @@ describe('EvmChain', () => { it('should return true when tx is not found and nonce is not used', async () => { // mock PaymentTransaction const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.erc20transaction as TransactionLike); @@ -2319,7 +2379,7 @@ describe('EvmChain', () => { it('should return false when nonce is already used by another transaction', async () => { // mock PaymentTransaction const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.erc20transaction as TransactionLike); @@ -2375,7 +2435,7 @@ describe('EvmChain', () => { it('should return true when nonce is used by current transaction', async () => { // mock PaymentTransaction const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.erc20transaction as TransactionLike); @@ -2426,7 +2486,7 @@ describe('EvmChain', () => { it('should return false when tx is failed', async () => { // mock PaymentTransaction const network = new TestEvmNetwork(); - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const txType = TransactionType.payment; const tx = Transaction.from(TestData.erc20transaction as TransactionLike); @@ -2487,7 +2547,10 @@ describe('EvmChain', () => { signatureRecovery: TestData.transaction2SignatureRecovery, }; }); - const evmChain = testUtils.generateChainObject(network, signFunction); + const evmChain = await testUtils.generateChainObject( + network, + signFunction + ); // mock PaymentTransaction of unsigned transaction const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; @@ -2537,7 +2600,10 @@ describe('EvmChain', () => { const signFunction = async (txHash: Uint8Array) => { throw Error(`TestError: sign failed`); }; - const evmChain = testUtils.generateChainObject(network, signFunction); + const evmChain = await testUtils.generateChainObject( + network, + signFunction + ); // mock PaymentTransaction of unsigned transaction const eventId = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; @@ -2589,7 +2655,8 @@ describe('EvmChain', () => { ); // run test - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); + evmChain.updateSupportedTokens(TestData.supportedTokens); const result = await evmChain.getAddressAssets(TestData.lockAddress); // check returned value @@ -2615,7 +2682,9 @@ describe('EvmChain', () => { */ it('should return 0 balance with no token if address is empty', async () => { // run test - const evmChain = testUtils.generateChainObject(new TestEvmNetwork()); + const evmChain = await testUtils.generateChainObject( + new TestEvmNetwork() + ); const result = await evmChain.getAddressAssets(''); // check returned value @@ -2636,7 +2705,8 @@ describe('EvmChain', () => { it('should wrap address assets successfully', async () => { const network = new TestEvmNetwork(); const evmChain = - testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + await testUtils.generateChainObjectWithMultiDecimalTokenMap(network); + evmChain.updateSupportedTokens(TestData.supportedTokens); mockGetAddressBalanceForNativeToken(evmChain.network, 1000n); vi.spyOn(network, 'getAddressBalanceForERC20Asset').mockImplementation( @@ -2691,7 +2761,7 @@ describe('EvmChain', () => { testUtils.mockGetTransactionStatus(network, EvmTxStatus.succeed); // run test - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const result = await evmChain.verifyLockTransactionExtraConditions( tx, {} as any @@ -2722,7 +2792,7 @@ describe('EvmChain', () => { testUtils.mockGetTransactionStatus(network, EvmTxStatus.failed); // run test - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const result = await evmChain.verifyLockTransactionExtraConditions( tx, {} as any @@ -2749,7 +2819,7 @@ describe('EvmChain', () => { */ it('should return true when data is consistent', async () => { // mock a PaymentTransaction - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const tx = Transaction.from(TestData.transaction1Json); const paymentTx = new PaymentTransaction( evmChain.CHAIN, @@ -2779,7 +2849,7 @@ describe('EvmChain', () => { */ it('should return false when transaction id is wrong', async () => { // mock a PaymentTransaction with changed txId - const evmChain = testUtils.generateChainObject(network); + const evmChain = await testUtils.generateChainObject(network); const tx = Transaction.from(TestData.transaction1Json); const paymentTx = new PaymentTransaction( evmChain.CHAIN, diff --git a/packages/chains/evm/tests/TestChain.ts b/packages/chains/evm/tests/TestChain.ts index 14d8b323..615b5614 100644 --- a/packages/chains/evm/tests/TestChain.ts +++ b/packages/chains/evm/tests/TestChain.ts @@ -1,4 +1,4 @@ -import { RosenTokens } from '@rosen-bridge/tokens'; +import { RosenTokens, TokenMap } from '@rosen-bridge/tokens'; import { AbstractEvmNetwork, EvmChain, TssSignFunction } from '../lib'; class TestChain extends EvmChain { @@ -9,8 +9,7 @@ class TestChain extends EvmChain { constructor( network: AbstractEvmNetwork, configs: any, - tokens: RosenTokens, - supportedTokens: Array, + tokens: TokenMap, signFunction: TssSignFunction, evmTxType: number ) { @@ -18,7 +17,6 @@ class TestChain extends EvmChain { network, configs, tokens, - supportedTokens, signFunction, 'test', 'test-native-token', diff --git a/packages/chains/evm/tests/TestUtils.ts b/packages/chains/evm/tests/TestUtils.ts index 8d815342..7447f252 100644 --- a/packages/chains/evm/tests/TestUtils.ts +++ b/packages/chains/evm/tests/TestUtils.ts @@ -11,6 +11,8 @@ import { AbstractEvmNetwork } from '../lib'; import TestEvmNetwork from './network/TestEvmNetwork'; import TestChain from './TestChain'; import { FeeData } from 'ethers'; +import { TokenMap, RosenTokens } from '@rosen-bridge/tokens'; +import { multiDecimalTokenMap } from './testData'; const spyOn = vi.spyOn; const observationTxConfirmation = 5; @@ -88,34 +90,25 @@ export const mockGetTransactionByNonce = ( spyOn(network, 'getTransactionByNonce').mockResolvedValue(value); }; -export const generateChainObject = ( +export const generateChainObject = async ( network: TestEvmNetwork, signFn: TssSignFunction = mockedSignFn, evmTxType = 2 ) => { - return new TestChain( - network, - configs, - testData.testTokenMap, - testData.supportedTokens, - signFn, - evmTxType - ); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(testData.testTokenMap); + return new TestChain(network, configs, tokenMap, signFn, evmTxType); }; -export const generateChainObjectWithMultiDecimalTokenMap = ( +export const generateChainObjectWithMultiDecimalTokenMap = async ( network: TestEvmNetwork, signFn: TssSignFunction = mockedSignFn, - evmTxType = 2 + evmTxType = 2, + rosenTokens: RosenTokens = testData.multiDecimalTokenMap ) => { - return new TestChain( - network, - configs, - testData.multiDecimalTokenMap, - testData.supportedTokens, - signFn, - evmTxType - ); + const tokenMap = new TokenMap(); + await tokenMap.updateConfigByJson(rosenTokens); + return new TestChain(network, configs, tokenMap, signFn, evmTxType); }; export const mockGetTransactionStatus = ( diff --git a/packages/chains/evm/tests/testData.ts b/packages/chains/evm/tests/testData.ts index af7a3bd9..c831dc61 100644 --- a/packages/chains/evm/tests/testData.ts +++ b/packages/chains/evm/tests/testData.ts @@ -3,8 +3,8 @@ import { TransactionType, } from '@rosen-chains/abstract-chain'; import { PaymentOrder, AssetBalance } from '@rosen-chains/abstract-chain'; -import { RosenTokens } from '@rosen-bridge/tokens'; import { Transaction } from 'ethers'; +import { RosenTokens, TokenMap } from '@rosen-bridge/tokens'; export const lockAddress = '0xedee4752e5a2f595151c94762fb38e5730357785'; export const supportedTokens = [ @@ -491,50 +491,92 @@ export const transaction2SignatureRecovery = '01'; export const transaction2TxId = '0x73c9ff5665d84067d98afbbeb2d9ff316c4b5bf885f9f3d31fa56eb1b13b3b90'; -export const testTokenMap: RosenTokens = { - idKeys: {}, - tokens: [], -}; +export const testTokenMap: RosenTokens = []; -export const multiDecimalTokenMap: RosenTokens = { - idKeys: { - ergo: 'tokenId', - cardano: 'tokenId', - test: 'tokenId', +export const multiDecimalTokenMap: RosenTokens = [ + { + ergo: { + tokenId: + '1c7435e608ab710c56bbe0f635e2a5e86ddf856f7d3d2d1d4dfefa62fbbfb9b4', + name: 'testETHER', + decimals: 1, + type: 'EIP-004', + residency: 'wrapped', + }, + cardano: { + tokenId: + '6d7cc9577a04be165cc4f2cf36f580dbeaf88f68e78f790805430940.727345544845522d6c6f656e', + policyId: '6d7cc9577a04be165cc4f2cf36f580dbeaf88f68e78f790805430940', + assetName: '727345544845522d6c6f656e', + name: 'rsETHER-loen', + decimals: 1, + type: 'CIP26', + residency: 'wrapped', + }, + test: { + tokenId: 'test-native-token', + name: 'ETHER', + decimals: 3, + type: 'native', + residency: 'native', + }, }, - tokens: [ - { - ergo: { - tokenId: - '1c7435e608ab710c56bbe0f635e2a5e86ddf856f7d3d2d1d4dfefa62fbbfb9b4', - name: 'testETHER', - decimals: 1, - metaData: { - type: 'EIP-004', - residency: 'wrapped', - }, - }, - cardano: { - tokenId: - '6d7cc9577a04be165cc4f2cf36f580dbeaf88f68e78f790805430940.727345544845522d6c6f656e', - policyId: '6d7cc9577a04be165cc4f2cf36f580dbeaf88f68e78f790805430940', - assetName: '727345544845522d6c6f656e', - name: 'rsETHER-loen', - decimals: 1, - metaData: { - type: 'CIP26', - residency: 'wrapped', - }, - }, - test: { - tokenId: 'test-native-token', - name: 'ETHER', - decimals: 3, - metaData: { - type: 'native', - residency: 'native', - }, - }, +]; + +export const tokenMapWithVariousTestTokens: RosenTokens = [ + { + ergo: { + tokenId: + '1c7435e608ab710c56bbe0f635e2a5e86ddf856f7d3d2d1d4dfefa62fbbfb9b4', + name: 'testETHER', + decimals: 9, + type: 'EIP-004', + residency: 'wrapped', }, - ], -}; + test: { + tokenId: 'test-native-token', + name: 'ETHER', + decimals: 18, + type: 'native', + residency: 'native', + }, + }, + { + ergo: { + tokenId: + '87c3212bc43e17be4ec735ba13b90802fe1eb9c4aae250d27f24e76ddd39ed72', + name: 'test-ergo-token', + decimals: 3, + type: 'EIP-004', + residency: 'native', + }, + test: { + tokenId: '0xedee4752e5a2f595151c94762fb38e5730357785', + name: 'WRAPPED-TOKEN', + decimals: 3, + type: 'ERC-20', + residency: 'wrapped', + }, + }, + { + ergo: { + tokenId: + '87c3212bc43e17be4ec735ba13b90802fe1eb9c4aae250d27f24e76ddd39ed72', + name: 'test-wrapped-token', + decimals: 0, + type: 'EIP-004', + residency: 'native', + }, + test: { + tokenId: '0xa20bef5093783116611871d940f39e7aba3d14f9', + name: 'TOKEN', + decimals: 0, + type: 'ERC-20', + residency: 'native', + }, + }, +]; +export const supportedTokensOfVariousTestTokens = [ + '0xedee4752e5a2f595151c94762fb38e5730357785', + '0xa20bef5093783116611871d940f39e7aba3d14f9', +];