From 2390ddb8ded8665cbe48489e0546a59652700d1e Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 21:23:17 +0200 Subject: [PATCH 01/21] chore: upgrade ethers to v6 --- package-lock.json | 927 ++++------------------------ package.json | 2 +- src/command/stamp/buy.ts | 7 +- src/command/utility/create-batch.ts | 6 +- src/command/utility/redeem.ts | 10 +- src/utils/rpc.ts | 38 +- 6 files changed, 134 insertions(+), 856 deletions(-) diff --git a/package-lock.json b/package-lock.json index f1f069db..06a6391b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@ethersphere/swarm-cli", - "version": "2.37.0", + "version": "3.0.0", "license": "BSD-3-Clause", "dependencies": { "@ethereumjs/wallet": "^2.0.4", @@ -15,7 +15,7 @@ "chalk": "^2.4.2", "cli-progress": "^3.11.2", "cli-table3": "^0.6.5", - "ethers": "^5.7.2", + "ethers": "^6.16.0", "furious-commander": "^1.7.1", "inquirer": "^8.2.5", "node-fetch": "^2.7.0", @@ -54,6 +54,12 @@ "npm": ">=6.0.0" } }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "license": "MIT" + }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", @@ -96,6 +102,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.2.tgz", "integrity": "sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g==", "dev": true, + "peer": true, "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", @@ -1125,707 +1132,6 @@ "beeApiVersion": "7.2.0" } }, - "node_modules/@ethersproject/abi": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.8.0.tgz", - "integrity": "sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/address": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/hash": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/strings": "^5.8.0" - } - }, - "node_modules/@ethersproject/abstract-provider": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.8.0.tgz", - "integrity": "sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/networks": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/transactions": "^5.8.0", - "@ethersproject/web": "^5.8.0" - } - }, - "node_modules/@ethersproject/abstract-signer": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.8.0.tgz", - "integrity": "sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-provider": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0" - } - }, - "node_modules/@ethersproject/address": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.8.0.tgz", - "integrity": "sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/rlp": "^5.8.0" - } - }, - "node_modules/@ethersproject/base64": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.8.0.tgz", - "integrity": "sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0" - } - }, - "node_modules/@ethersproject/basex": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.8.0.tgz", - "integrity": "sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/properties": "^5.8.0" - } - }, - "node_modules/@ethersproject/bignumber": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.8.0.tgz", - "integrity": "sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "bn.js": "^5.2.1" - } - }, - "node_modules/@ethersproject/bytes": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.8.0.tgz", - "integrity": "sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/constants": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.8.0.tgz", - "integrity": "sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bignumber": "^5.8.0" - } - }, - "node_modules/@ethersproject/contracts": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.8.0.tgz", - "integrity": "sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abi": "^5.8.0", - "@ethersproject/abstract-provider": "^5.8.0", - "@ethersproject/abstract-signer": "^5.8.0", - "@ethersproject/address": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/transactions": "^5.8.0" - } - }, - "node_modules/@ethersproject/hash": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.8.0.tgz", - "integrity": "sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-signer": "^5.8.0", - "@ethersproject/address": "^5.8.0", - "@ethersproject/base64": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/strings": "^5.8.0" - } - }, - "node_modules/@ethersproject/hdnode": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.8.0.tgz", - "integrity": "sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-signer": "^5.8.0", - "@ethersproject/basex": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/pbkdf2": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/sha2": "^5.8.0", - "@ethersproject/signing-key": "^5.8.0", - "@ethersproject/strings": "^5.8.0", - "@ethersproject/transactions": "^5.8.0", - "@ethersproject/wordlists": "^5.8.0" - } - }, - "node_modules/@ethersproject/json-wallets": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.8.0.tgz", - "integrity": "sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-signer": "^5.8.0", - "@ethersproject/address": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/hdnode": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/pbkdf2": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/random": "^5.8.0", - "@ethersproject/strings": "^5.8.0", - "@ethersproject/transactions": "^5.8.0", - "aes-js": "3.0.0", - "scrypt-js": "3.0.1" - } - }, - "node_modules/@ethersproject/keccak256": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.8.0.tgz", - "integrity": "sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "js-sha3": "0.8.0" - } - }, - "node_modules/@ethersproject/logger": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.8.0.tgz", - "integrity": "sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT" - }, - "node_modules/@ethersproject/networks": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.8.0.tgz", - "integrity": "sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/pbkdf2": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.8.0.tgz", - "integrity": "sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/sha2": "^5.8.0" - } - }, - "node_modules/@ethersproject/properties": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.8.0.tgz", - "integrity": "sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/providers": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.8.0.tgz", - "integrity": "sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-provider": "^5.8.0", - "@ethersproject/abstract-signer": "^5.8.0", - "@ethersproject/address": "^5.8.0", - "@ethersproject/base64": "^5.8.0", - "@ethersproject/basex": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/hash": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/networks": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/random": "^5.8.0", - "@ethersproject/rlp": "^5.8.0", - "@ethersproject/sha2": "^5.8.0", - "@ethersproject/strings": "^5.8.0", - "@ethersproject/transactions": "^5.8.0", - "@ethersproject/web": "^5.8.0", - "bech32": "1.1.4", - "ws": "8.18.0" - } - }, - "node_modules/@ethersproject/random": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.8.0.tgz", - "integrity": "sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/rlp": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.8.0.tgz", - "integrity": "sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/sha2": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.8.0.tgz", - "integrity": "sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "hash.js": "1.1.7" - } - }, - "node_modules/@ethersproject/signing-key": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.8.0.tgz", - "integrity": "sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "bn.js": "^5.2.1", - "elliptic": "6.6.1", - "hash.js": "1.1.7" - } - }, - "node_modules/@ethersproject/solidity": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.8.0.tgz", - "integrity": "sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/sha2": "^5.8.0", - "@ethersproject/strings": "^5.8.0" - } - }, - "node_modules/@ethersproject/strings": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.8.0.tgz", - "integrity": "sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/transactions": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.8.0.tgz", - "integrity": "sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/address": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/rlp": "^5.8.0", - "@ethersproject/signing-key": "^5.8.0" - } - }, - "node_modules/@ethersproject/units": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.8.0.tgz", - "integrity": "sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/constants": "^5.8.0", - "@ethersproject/logger": "^5.8.0" - } - }, - "node_modules/@ethersproject/wallet": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.8.0.tgz", - "integrity": "sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-provider": "^5.8.0", - "@ethersproject/abstract-signer": "^5.8.0", - "@ethersproject/address": "^5.8.0", - "@ethersproject/bignumber": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/hash": "^5.8.0", - "@ethersproject/hdnode": "^5.8.0", - "@ethersproject/json-wallets": "^5.8.0", - "@ethersproject/keccak256": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/random": "^5.8.0", - "@ethersproject/signing-key": "^5.8.0", - "@ethersproject/transactions": "^5.8.0", - "@ethersproject/wordlists": "^5.8.0" - } - }, - "node_modules/@ethersproject/web": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.8.0.tgz", - "integrity": "sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/base64": "^5.8.0", - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/strings": "^5.8.0" - } - }, - "node_modules/@ethersproject/wordlists": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.8.0.tgz", - "integrity": "sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/bytes": "^5.8.0", - "@ethersproject/hash": "^5.8.0", - "@ethersproject/logger": "^5.8.0", - "@ethersproject/properties": "^5.8.0", - "@ethersproject/strings": "^5.8.0" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.7", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", @@ -2947,6 +2253,7 @@ "integrity": "sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -3021,6 +2328,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.44.0.tgz", "integrity": "sha512-j5ULd7FmmekcyWeArx+i8x7sdRHzAtXTkmDPthE4amxZOWKFK7bomoJ4r7PJ8K7PoMzD16U8MmuZFAonr1ERvw==", "dev": true, + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "5.44.0", "@typescript-eslint/type-utils": "5.44.0", @@ -3054,6 +2362,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.44.0.tgz", "integrity": "sha512-H7LCqbZnKqkkgQHaKLGC6KUjt3pjJDx8ETDqmwncyb6PuoigYajyAwBGz08VU/l86dZWZgI4zm5k2VaKqayYyA==", "dev": true, + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "5.44.0", "@typescript-eslint/types": "5.44.0", @@ -3217,6 +2526,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true, + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3243,9 +2553,9 @@ } }, "node_modules/aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", "license": "MIT" }, "node_modules/ajv": { @@ -3558,12 +2868,6 @@ } ] }, - "node_modules/bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "license": "MIT" - }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -3574,12 +2878,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/bn.js": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz", - "integrity": "sha512-EAcmnPkxpntVL+DS7bO1zhcZNvCkxqtkd0ZY53h06GNQ3DEkkGZ/gKgmDv6DdZQGj9BgfSPKtJJ7Dp1GPP8f7w==", - "license": "MIT" - }, "node_modules/brace-expansion": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", @@ -3604,12 +2902,6 @@ "node": ">=8" } }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "license": "MIT" - }, "node_modules/browserslist": { "version": "4.21.4", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", @@ -3625,6 +2917,7 @@ "url": "https://tidelift.com/funding/github/npm/browserslist" } ], + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001400", "electron-to-chromium": "^1.4.251", @@ -4215,27 +3508,6 @@ "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", "dev": true }, - "node_modules/elliptic": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", - "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz", - "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", - "license": "MIT" - }, "node_modules/emittery": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", @@ -4329,6 +3601,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.28.0.tgz", "integrity": "sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==", "dev": true, + "peer": true, "dependencies": { "@eslint/eslintrc": "^1.3.3", "@humanwhocodes/config-array": "^0.11.6", @@ -4732,13 +4005,13 @@ } }, "node_modules/ethers": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.8.0.tgz", - "integrity": "sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==", + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.16.0.tgz", + "integrity": "sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A==", "funding": [ { "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + "url": "https://github.com/sponsors/ethers-io/" }, { "type": "individual", @@ -4747,36 +4020,82 @@ ], "license": "MIT", "dependencies": { - "@ethersproject/abi": "5.8.0", - "@ethersproject/abstract-provider": "5.8.0", - "@ethersproject/abstract-signer": "5.8.0", - "@ethersproject/address": "5.8.0", - "@ethersproject/base64": "5.8.0", - "@ethersproject/basex": "5.8.0", - "@ethersproject/bignumber": "5.8.0", - "@ethersproject/bytes": "5.8.0", - "@ethersproject/constants": "5.8.0", - "@ethersproject/contracts": "5.8.0", - "@ethersproject/hash": "5.8.0", - "@ethersproject/hdnode": "5.8.0", - "@ethersproject/json-wallets": "5.8.0", - "@ethersproject/keccak256": "5.8.0", - "@ethersproject/logger": "5.8.0", - "@ethersproject/networks": "5.8.0", - "@ethersproject/pbkdf2": "5.8.0", - "@ethersproject/properties": "5.8.0", - "@ethersproject/providers": "5.8.0", - "@ethersproject/random": "5.8.0", - "@ethersproject/rlp": "5.8.0", - "@ethersproject/sha2": "5.8.0", - "@ethersproject/signing-key": "5.8.0", - "@ethersproject/solidity": "5.8.0", - "@ethersproject/strings": "5.8.0", - "@ethersproject/transactions": "5.8.0", - "@ethersproject/units": "5.8.0", - "@ethersproject/wallet": "5.8.0", - "@ethersproject/web": "5.8.0", - "@ethersproject/wordlists": "5.8.0" + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "22.7.5", + "aes-js": "4.0.0-beta.5", + "tslib": "2.7.0", + "ws": "8.17.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethers/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethers/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/ethers/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "license": "0BSD" + }, + "node_modules/ethers/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/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" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/execa": { @@ -5359,16 +4678,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -5381,17 +4690,6 @@ "node": ">= 0.4" } }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "license": "MIT", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "node_modules/hosted-git-info": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", @@ -6000,6 +5298,7 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-29.3.1.tgz", "integrity": "sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA==", "dev": true, + "peer": true, "dependencies": { "@jest/core": "^29.3.1", "@jest/types": "^29.3.1", @@ -7643,12 +6942,6 @@ "url": "https://opencollective.com/js-sdsl" } }, - "node_modules/js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "license": "MIT" - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -8086,18 +7379,6 @@ "node": ">=4" } }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "license": "ISC" - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "license": "MIT" - }, "node_modules/minimatch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", @@ -8578,6 +7859,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true, + "peer": true, "bin": { "prettier": "bin-prettier.js" }, @@ -9050,12 +8332,6 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, - "node_modules/scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", - "license": "MIT" - }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", @@ -9463,6 +8739,7 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -9560,6 +8837,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9810,6 +9088,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, diff --git a/package.json b/package.json index 70c9eea2..e36962ea 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "chalk": "^2.4.2", "cli-progress": "^3.11.2", "cli-table3": "^0.6.5", - "ethers": "^5.7.2", + "ethers": "^6.16.0", "furious-commander": "^1.7.1", "inquirer": "^8.2.5", "node-fetch": "^2.7.0", diff --git a/src/command/stamp/buy.ts b/src/command/stamp/buy.ts index ef47a33f..eb5611b1 100644 --- a/src/command/stamp/buy.ts +++ b/src/command/stamp/buy.ts @@ -1,7 +1,6 @@ import { BatchId, Utils } from '@ethersphere/bee-js' import { Dates, Numbers } from 'cafe-utility' import chalk from 'chalk' -import { BigNumber } from 'ethers' import { LeafCommand, Option } from 'furious-commander' import { exit } from 'process' import { isChainStateReady } from '../../utils/chainsync' @@ -71,10 +70,10 @@ export class Buy extends StampCommand implements LeafCommand { } const chainState = await this.bee.getChainState() - const minimumAmount = BigNumber.from(chainState.currentPrice).mul(17280) + const minimumAmount = BigInt(chainState.currentPrice) * 17280n - if (minimumAmount.gte(BigNumber.from(this.amount))) { - this.console.error('The amount is too low. The minimum amount is', minimumAmount.add(1).toString()) + if (minimumAmount >= this.amount) { + this.console.error('The amount is too low. The minimum amount is', (minimumAmount + 1n).toString()) return } diff --git a/src/command/utility/create-batch.ts b/src/command/utility/create-batch.ts index 9c2bd603..3b5f411d 100644 --- a/src/command/utility/create-batch.ts +++ b/src/command/utility/create-batch.ts @@ -1,6 +1,6 @@ import { Utils } from '@ethersphere/bee-js' import { Numbers, Strings } from 'cafe-utility' -import { Contract, Event, Wallet } from 'ethers' +import { Contract, ContractTransactionReceipt, Wallet } from 'ethers' import { LeafCommand, Option } from 'furious-commander' import { ABI, Contracts } from '../../utils/contracts' import { makeReadySigner } from '../../utils/rpc' @@ -91,9 +91,9 @@ export class CreateBatch extends RootCommand implements LeafCommand { }, ) this.console.log(`Waiting 3 blocks on create batch tx ${createBatch.hash}`) - const receipt = await createBatch.wait(3) + const receipt = (await createBatch.wait(3)) as ContractTransactionReceipt - const batchId = receipt.events.find((x: Event) => x.address === Contracts.postageStamp).topics[1] + const batchId = receipt.logs.find(x => x.address === Contracts.postageStamp)!.topics[1] this.console.log(`Batch created with ID ${batchId}`) } } diff --git a/src/command/utility/redeem.ts b/src/command/utility/redeem.ts index c9c32d0b..b0bd121e 100644 --- a/src/command/utility/redeem.ts +++ b/src/command/utility/redeem.ts @@ -1,5 +1,5 @@ import { Dates, System } from 'cafe-utility' -import { BigNumber, providers, Wallet } from 'ethers' +import { JsonRpcProvider, Wallet } from 'ethers' import { Argument, LeafCommand, Option } from 'furious-commander' import { NETWORK_ID } from '../../utils/contracts' import { @@ -50,7 +50,7 @@ export class Redeem extends RootCommand implements LeafCommand { } this.console.log(`Target wallet address: ${this.target}`) - const provider = new providers.JsonRpcProvider(this.jsonRpcUrl, NETWORK_ID) + const provider = new JsonRpcProvider(this.jsonRpcUrl, NETWORK_ID) this.console.log('Creating wallet...') const wallet = new Wallet(this.wallet, provider) this.console.log('Fetching xBZZ balance...') @@ -92,14 +92,14 @@ export class Redeem extends RootCommand implements LeafCommand { } } const { gasPrice, totalCost } = await estimateNativeTransferTransactionCost(this.wallet, this.jsonRpcUrl) - const xDAIValue = BigNumber.from(xDAI) + const xDAIValue = BigInt(xDAI) - if (xDAIValue.gt(totalCost)) { + if (xDAIValue > totalCost) { this.console.log('Transferring xDAI to Bee wallet...') await sendNativeTransaction( this.wallet, this.target, - xDAIValue.sub(totalCost).toString(), + (xDAIValue - totalCost).toString(), this.jsonRpcUrl, gasPrice, ) diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index 2590c456..47e73ea1 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -1,9 +1,9 @@ -import { BigNumber as BN, Contract, providers, Wallet } from 'ethers' +import { Contract, JsonRpcProvider, TransactionReceipt, TransactionResponse, Wallet } from 'ethers' import { ABI, Contracts } from './contracts' const NETWORK_ID = 100 -export async function eth_getBalance(address: string, provider: providers.JsonRpcProvider): Promise { +export async function eth_getBalance(address: string, provider: JsonRpcProvider): Promise { if (!address.startsWith('0x')) { address = `0x${address}` } @@ -14,7 +14,7 @@ export async function eth_getBalance(address: string, provider: providers.JsonRp export async function eth_getBalanceERC20( address: string, - provider: providers.JsonRpcProvider, + provider: JsonRpcProvider, tokenAddress = Contracts.bzz, ): Promise { if (!address.startsWith('0x')) { @@ -27,13 +27,13 @@ export async function eth_getBalanceERC20( } interface TransferResponse { - transaction: providers.TransactionResponse - receipt: providers.TransactionReceipt + transaction: TransactionResponse + receipt: TransactionReceipt } interface TransferCost { - gasPrice: BN - totalCost: BN + gasPrice: bigint + totalCost: bigint } export async function estimateNativeTransferTransactionCost( @@ -41,10 +41,10 @@ export async function estimateNativeTransferTransactionCost( jsonRpcProvider: string, ): Promise { const signer = await makeReadySigner(privateKey, jsonRpcProvider) - const gasLimit = '21000' - const gasPrice = await signer.getGasPrice() + const gasLimit = 21000n + const gasPrice = (await signer.provider!.getFeeData()).gasPrice! - return { gasPrice, totalCost: gasPrice.mul(gasLimit) } + return { gasPrice, totalCost: gasPrice * gasLimit } } export async function sendNativeTransaction( @@ -52,18 +52,18 @@ export async function sendNativeTransaction( to: string, value: string, jsonRpcProvider: string, - externalGasPrice?: BN, + externalGasPrice?: bigint, ): Promise { const signer = await makeReadySigner(privateKey, jsonRpcProvider) - const gasPrice = externalGasPrice ?? (await signer.getGasPrice()) + const gasPrice = externalGasPrice ?? (await signer.provider!.getFeeData()).gasPrice! const transaction = await signer.sendTransaction({ to, - value: BN.from(value), + value: BigInt(value), gasPrice, - gasLimit: BN.from(21000), + gasLimit: 21000n, type: 0, }) - const receipt = await transaction.wait(1) + const receipt = (await transaction.wait(1))! return { transaction, receipt } } @@ -75,17 +75,17 @@ export async function sendBzzTransaction( jsonRpcProvider: string, ): Promise { const signer = await makeReadySigner(privateKey, jsonRpcProvider) - const gasPrice = await signer.getGasPrice() + const gasPrice = (await signer.provider!.getFeeData()).gasPrice! const bzz = new Contract(Contracts.bzz, ABI.bzz, signer) const transaction = await bzz.transfer(to, value, { gasPrice }) - const receipt = await transaction.wait(1) + const receipt = (await transaction.wait(1))! return { transaction, receipt } } export async function makeReadySigner(privateKey: string, jsonRpcProvider: string) { - const provider = new providers.JsonRpcProvider(jsonRpcProvider, NETWORK_ID) - await provider.ready + const provider = new JsonRpcProvider(jsonRpcProvider, NETWORK_ID) + await provider.getNetwork() const signer = new Wallet(privateKey, provider) return signer From 4b319960c6586abdd6462defb37ee0f0ce24a7c6 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 21:26:44 +0200 Subject: [PATCH 02/21] refactor: avoid bypassing null errors --- src/command/stake/recover.ts | 2 +- src/command/utility/create-batch.ts | 2 +- src/utils/rpc.ts | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/command/stake/recover.ts b/src/command/stake/recover.ts index 9421476b..68950140 100644 --- a/src/command/stake/recover.ts +++ b/src/command/stake/recover.ts @@ -53,7 +53,7 @@ export class Recover extends RootCommand implements LeafCommand { ] const wallet = await createWallet(this.walletSource, this.console) - const signer = await makeReadySigner(wallet.getPrivateKeyString(), this.jsonRpcUrl) + const { signer } = await makeReadySigner(wallet.getPrivateKeyString(), this.jsonRpcUrl) const contract = new Contract(address, abi, signer) const isPaused = await contract.paused() diff --git a/src/command/utility/create-batch.ts b/src/command/utility/create-batch.ts index 3b5f411d..2032b486 100644 --- a/src/command/utility/create-batch.ts +++ b/src/command/utility/create-batch.ts @@ -61,7 +61,7 @@ export class CreateBatch extends RootCommand implements LeafCommand { const wallet = new Wallet(this.privateKey) const cost = Utils.getStampCost(this.depth, this.amount) - const signer = await makeReadySigner(wallet.privateKey, this.jsonRpcUrl) + const { signer } = await makeReadySigner(wallet.privateKey, this.jsonRpcUrl) this.console.log(`Approving spending of ${cost.toDecimalString()} BZZ to ${wallet.address}`) const tokenProxyContract = new Contract(Contracts.bzz, ABI.tokenProxy, signer) diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index 47e73ea1..a798db8b 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -40,9 +40,9 @@ export async function estimateNativeTransferTransactionCost( privateKey: string, jsonRpcProvider: string, ): Promise { - const signer = await makeReadySigner(privateKey, jsonRpcProvider) + const { provider } = await makeReadySigner(privateKey, jsonRpcProvider) const gasLimit = 21000n - const gasPrice = (await signer.provider!.getFeeData()).gasPrice! + const gasPrice = (await provider.getFeeData()).gasPrice! return { gasPrice, totalCost: gasPrice * gasLimit } } @@ -54,8 +54,8 @@ export async function sendNativeTransaction( jsonRpcProvider: string, externalGasPrice?: bigint, ): Promise { - const signer = await makeReadySigner(privateKey, jsonRpcProvider) - const gasPrice = externalGasPrice ?? (await signer.provider!.getFeeData()).gasPrice! + const { signer, provider } = await makeReadySigner(privateKey, jsonRpcProvider) + const gasPrice = externalGasPrice ?? (await provider.getFeeData()).gasPrice! const transaction = await signer.sendTransaction({ to, value: BigInt(value), @@ -74,8 +74,8 @@ export async function sendBzzTransaction( value: string, jsonRpcProvider: string, ): Promise { - const signer = await makeReadySigner(privateKey, jsonRpcProvider) - const gasPrice = (await signer.provider!.getFeeData()).gasPrice! + const { signer, provider } = await makeReadySigner(privateKey, jsonRpcProvider) + const gasPrice = (await provider.getFeeData()).gasPrice! const bzz = new Contract(Contracts.bzz, ABI.bzz, signer) const transaction = await bzz.transfer(to, value, { gasPrice }) const receipt = (await transaction.wait(1))! @@ -88,5 +88,5 @@ export async function makeReadySigner(privateKey: string, jsonRpcProvider: strin await provider.getNetwork() const signer = new Wallet(privateKey, provider) - return signer + return { signer, provider } } From 5684b2040a72c1ee18a379c0115711f42a70ee00 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 21:34:15 +0200 Subject: [PATCH 03/21] test: add create-batch test --- test/command/create-batch.spec.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/command/create-batch.spec.ts diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts new file mode 100644 index 00000000..88e479f3 --- /dev/null +++ b/test/command/create-batch.spec.ts @@ -0,0 +1,29 @@ +import { Strings } from 'cafe-utility' +import { describeCommand, invokeTestCli } from '../utility' + +describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => { + it('should create batch', async () => { + await invokeTestCli([ + 'utility', + 'create-batch', + '--private-key', + '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d', + '--depth', + '17', + '--amount', + '10B', + '--json-rpc-url', + 'http:s://localhost:8545', + '--yes', + ]) + expect( + Strings.linesMatchInOrder(consoleMessages, [ + ['Approving spending of', 'BZZ to'], + ['Waiting 3 blocks on approval tx'], + ['Creating postage batch for', 'with depth 17 and amount 100000000000'], + ['Waiting 3 blocks on create batch tx'], + ['Batch created with ID'], + ]), + ).toBe(true) + }) +}) From e64f166a50d35907f30861d7be665166794ed040 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 21:48:47 +0200 Subject: [PATCH 04/21] test: use custom matcher --- test/command/create-batch.spec.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index 88e479f3..cb305a49 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -1,6 +1,10 @@ -import { Strings } from 'cafe-utility' +import { toMatchLinesInOrder } from '../custom-matcher' import { describeCommand, invokeTestCli } from '../utility' +expect.extend({ + toMatchLinesInOrder, +}) + describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => { it('should create batch', async () => { await invokeTestCli([ @@ -16,14 +20,12 @@ describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => 'http:s://localhost:8545', '--yes', ]) - expect( - Strings.linesMatchInOrder(consoleMessages, [ - ['Approving spending of', 'BZZ to'], - ['Waiting 3 blocks on approval tx'], - ['Creating postage batch for', 'with depth 17 and amount 100000000000'], - ['Waiting 3 blocks on create batch tx'], - ['Batch created with ID'], - ]), - ).toBe(true) + expect(consoleMessages).toMatchLinesInOrder([ + ['Approving spending of', 'BZZ to'], + ['Waiting 3 blocks on approval tx'], + ['Creating postage batch for', 'with depth 17 and amount 100000000000'], + ['Waiting 3 blocks on create batch tx'], + ['Batch created with ID'], + ]) }) }) From f588b2b731f08451dcdbd68c0b4abc7a2833533f Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 22:02:37 +0200 Subject: [PATCH 05/21] chore: add step to print docker ps --- .github/workflows/tests-rc.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests-rc.yaml b/.github/workflows/tests-rc.yaml index 47cb462d..99d9923e 100644 --- a/.github/workflows/tests-rc.yaml +++ b/.github/workflows/tests-rc.yaml @@ -68,5 +68,8 @@ jobs: continue-on-error: true run: swarm-cli status + - name: Print docker ps + run: docker ps + - name: Tests run: npm run test From 976e5c442e34046d9cf03611e23d80d8da2d0c09 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 22:08:12 +0200 Subject: [PATCH 06/21] test: update JSON-RPC URL in create-batch command test --- test/command/create-batch.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index cb305a49..09d17854 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -17,7 +17,7 @@ describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => '--amount', '10B', '--json-rpc-url', - 'http:s://localhost:8545', + 'http:s://localhost:9545', '--yes', ]) expect(consoleMessages).toMatchLinesInOrder([ From 72993259801f66e6fa91cd726b6f4e387e95aa76 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 22:08:27 +0200 Subject: [PATCH 07/21] test: fix JSON-RPC URL in create-batch command test --- test/command/create-batch.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index 09d17854..757eb2a4 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -17,7 +17,7 @@ describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => '--amount', '10B', '--json-rpc-url', - 'http:s://localhost:9545', + 'https://localhost:9545', '--yes', ]) expect(consoleMessages).toMatchLinesInOrder([ From 4f8a013fc8167eaf65a7e43c7dc02422e467d56a Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 22:19:52 +0200 Subject: [PATCH 08/21] test: update JSON-RPC URL to use HTTP in create-batch command test --- test/command/create-batch.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index 757eb2a4..5abf4dd4 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -17,7 +17,7 @@ describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => '--amount', '10B', '--json-rpc-url', - 'https://localhost:9545', + 'http://localhost:9545', '--yes', ]) expect(consoleMessages).toMatchLinesInOrder([ From 7f81e717542f5fd0400a9cd85a329d4aad01736c Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 22:39:36 +0200 Subject: [PATCH 09/21] test: set SWARM_CLI_NETWORK_ID for create-batch command test --- src/utils/rpc.ts | 2 +- test/command/create-batch.spec.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index a798db8b..dd75f557 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -1,7 +1,7 @@ import { Contract, JsonRpcProvider, TransactionReceipt, TransactionResponse, Wallet } from 'ethers' import { ABI, Contracts } from './contracts' -const NETWORK_ID = 100 +const NETWORK_ID = process.env.SWARM_CLI_NETWORK_ID ?? 100 export async function eth_getBalance(address: string, provider: JsonRpcProvider): Promise { if (!address.startsWith('0x')) { diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index 5abf4dd4..0a29b782 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -7,6 +7,7 @@ expect.extend({ describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => { it('should create batch', async () => { + process.env.SWARM_CLI_NETWORK_ID = '4020' await invokeTestCli([ 'utility', 'create-batch', From 223ad3fd1efd22d4be48d5a209f9e857abdab837 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 22:48:44 +0200 Subject: [PATCH 10/21] refactor: use SWARM_CLI_NETWORK_ID from environment variable in NETWORK_ID --- src/utils/contracts.ts | 2 +- src/utils/rpc.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/utils/contracts.ts b/src/utils/contracts.ts index 46c87eeb..58fbbdbc 100644 --- a/src/utils/contracts.ts +++ b/src/utils/contracts.ts @@ -1,4 +1,4 @@ -export const NETWORK_ID = 100 +export const NETWORK_ID = process.env.SWARM_CLI_NETWORK_ID ?? 100 export const Contracts = { bzz: '0xdBF3Ea6F5beE45c02255B2c26a16F300502F68da', diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index dd75f557..9ec20900 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -1,7 +1,5 @@ import { Contract, JsonRpcProvider, TransactionReceipt, TransactionResponse, Wallet } from 'ethers' -import { ABI, Contracts } from './contracts' - -const NETWORK_ID = process.env.SWARM_CLI_NETWORK_ID ?? 100 +import { ABI, Contracts, NETWORK_ID } from './contracts' export async function eth_getBalance(address: string, provider: JsonRpcProvider): Promise { if (!address.startsWith('0x')) { From c897cc2303d864ef9bd36be90c94499bb96371b9 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 22:59:58 +0200 Subject: [PATCH 11/21] refactor: replace NETWORK_ID constant with getNetworkId function for dynamic network ID retrieval --- src/command/utility/redeem.ts | 4 ++-- src/utils/contracts.ts | 4 +++- src/utils/rpc.ts | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/command/utility/redeem.ts b/src/command/utility/redeem.ts index b0bd121e..ae4c99dc 100644 --- a/src/command/utility/redeem.ts +++ b/src/command/utility/redeem.ts @@ -1,7 +1,7 @@ import { Dates, System } from 'cafe-utility' import { JsonRpcProvider, Wallet } from 'ethers' import { Argument, LeafCommand, Option } from 'furious-commander' -import { NETWORK_ID } from '../../utils/contracts' +import { getNetworkId } from '../../utils/contracts' import { estimateNativeTransferTransactionCost, eth_getBalance, @@ -50,7 +50,7 @@ export class Redeem extends RootCommand implements LeafCommand { } this.console.log(`Target wallet address: ${this.target}`) - const provider = new JsonRpcProvider(this.jsonRpcUrl, NETWORK_ID) + const provider = new JsonRpcProvider(this.jsonRpcUrl, getNetworkId()) this.console.log('Creating wallet...') const wallet = new Wallet(this.wallet, provider) this.console.log('Fetching xBZZ balance...') diff --git a/src/utils/contracts.ts b/src/utils/contracts.ts index 58fbbdbc..407d1f67 100644 --- a/src/utils/contracts.ts +++ b/src/utils/contracts.ts @@ -1,4 +1,6 @@ -export const NETWORK_ID = process.env.SWARM_CLI_NETWORK_ID ?? 100 +export function getNetworkId(): number { + return process.env.SWARM_CLI_NETWORK_ID ? Number(process.env.SWARM_CLI_NETWORK_ID) : 100 +} export const Contracts = { bzz: '0xdBF3Ea6F5beE45c02255B2c26a16F300502F68da', diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index 9ec20900..999443a1 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -1,5 +1,5 @@ import { Contract, JsonRpcProvider, TransactionReceipt, TransactionResponse, Wallet } from 'ethers' -import { ABI, Contracts, NETWORK_ID } from './contracts' +import { ABI, Contracts, getNetworkId } from './contracts' export async function eth_getBalance(address: string, provider: JsonRpcProvider): Promise { if (!address.startsWith('0x')) { @@ -82,7 +82,7 @@ export async function sendBzzTransaction( } export async function makeReadySigner(privateKey: string, jsonRpcProvider: string) { - const provider = new JsonRpcProvider(jsonRpcProvider, NETWORK_ID) + const provider = new JsonRpcProvider(jsonRpcProvider, getNetworkId()) await provider.getNetwork() const signer = new Wallet(privateKey, provider) From 66a6d93fccb25699ec6050aab1f49f69ac2cb2d6 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 23:11:09 +0200 Subject: [PATCH 12/21] fix: handle missing postage stamp log in create batch transaction receipt --- src/command/utility/create-batch.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/command/utility/create-batch.ts b/src/command/utility/create-batch.ts index 2032b486..ac9b99c0 100644 --- a/src/command/utility/create-batch.ts +++ b/src/command/utility/create-batch.ts @@ -93,7 +93,11 @@ export class CreateBatch extends RootCommand implements LeafCommand { this.console.log(`Waiting 3 blocks on create batch tx ${createBatch.hash}`) const receipt = (await createBatch.wait(3)) as ContractTransactionReceipt - const batchId = receipt.logs.find(x => x.address === Contracts.postageStamp)!.topics[1] + const batchLog = receipt.logs.find(x => x.address === Contracts.postageStamp) + if (!batchLog || batchLog.topics.length < 2) { + throw new Error(`Could not find postage stamp log in receipt. Logs: ${JSON.stringify(receipt.logs)}`) + } + const batchId = batchLog.topics[1] this.console.log(`Batch created with ID ${batchId}`) } } From 0f429ab7da7e954de8b5c35977082780b059d88a Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Tue, 12 May 2026 23:25:00 +0200 Subject: [PATCH 13/21] refactor: update Contracts to use environment variables for addresses --- src/command/utility/create-batch.ts | 1 + src/utils/contracts.ts | 8 ++++++-- test/command/create-batch.spec.ts | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/command/utility/create-batch.ts b/src/command/utility/create-batch.ts index ac9b99c0..b9b92fd1 100644 --- a/src/command/utility/create-batch.ts +++ b/src/command/utility/create-batch.ts @@ -94,6 +94,7 @@ export class CreateBatch extends RootCommand implements LeafCommand { const receipt = (await createBatch.wait(3)) as ContractTransactionReceipt const batchLog = receipt.logs.find(x => x.address === Contracts.postageStamp) + if (!batchLog || batchLog.topics.length < 2) { throw new Error(`Could not find postage stamp log in receipt. Logs: ${JSON.stringify(receipt.logs)}`) } diff --git a/src/utils/contracts.ts b/src/utils/contracts.ts index 407d1f67..90206ed8 100644 --- a/src/utils/contracts.ts +++ b/src/utils/contracts.ts @@ -3,8 +3,12 @@ export function getNetworkId(): number { } export const Contracts = { - bzz: '0xdBF3Ea6F5beE45c02255B2c26a16F300502F68da', - postageStamp: '0x45a1502382541Cd610CC9068e88727426b696293', + get bzz() { + return process.env.SWARM_CLI_BZZ_ADDRESS ?? '0xdBF3Ea6F5beE45c02255B2c26a16F300502F68da' + }, + get postageStamp() { + return process.env.SWARM_CLI_POSTAGE_STAMP_ADDRESS ?? '0x45a1502382541Cd610CC9068e88727426b696293' + }, } export const ABI = { diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index 0a29b782..6b08ec15 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -8,6 +8,8 @@ expect.extend({ describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => { it('should create batch', async () => { process.env.SWARM_CLI_NETWORK_ID = '4020' + process.env.SWARM_CLI_BZZ_ADDRESS = '0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab' + process.env.SWARM_CLI_POSTAGE_STAMP_ADDRESS = '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B' await invokeTestCli([ 'utility', 'create-batch', From ab8de53e761be3cc7b9bf8d284cc9100047d399a Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 13 May 2026 09:04:50 +0200 Subject: [PATCH 14/21] test: try to debug --- src/command/utility/create-batch.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/command/utility/create-batch.ts b/src/command/utility/create-batch.ts index b9b92fd1..8aed61fe 100644 --- a/src/command/utility/create-batch.ts +++ b/src/command/utility/create-batch.ts @@ -76,20 +76,21 @@ export class CreateBatch extends RootCommand implements LeafCommand { this.console.log(`Creating postage batch for ${wallet.address} with depth ${this.depth} and amount ${this.amount}`) const postageStampContract = new Contract(Contracts.postageStamp, ABI.postageStamp, signer) - const createBatch = await postageStampContract.createBatch( + const createBatchArgs = [ signer.address, this.amount, this.depth, 16, `0x${Strings.randomHex(64)}`, false, - { - gasLimit: 1_000_000, - type: 2, - maxFeePerGas: Numbers.make('3gwei'), - maxPriorityFeePerGas: Numbers.make('2gwei'), - }, - ) + ] + await postageStampContract.createBatch.staticCall(...createBatchArgs) + const createBatch = await postageStampContract.createBatch(...createBatchArgs, { + gasLimit: 1_000_000, + type: 2, + maxFeePerGas: Numbers.make('3gwei'), + maxPriorityFeePerGas: Numbers.make('2gwei'), + }) this.console.log(`Waiting 3 blocks on create batch tx ${createBatch.hash}`) const receipt = (await createBatch.wait(3)) as ContractTransactionReceipt From 356fa7926bee3a97dfd3b0be74b08e70a246a424 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 13 May 2026 09:24:05 +0200 Subject: [PATCH 15/21] test: use correct private key --- src/command/utility/create-batch.ts | 10 +--------- test/command/create-batch.spec.ts | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/command/utility/create-batch.ts b/src/command/utility/create-batch.ts index 8aed61fe..be5a16cf 100644 --- a/src/command/utility/create-batch.ts +++ b/src/command/utility/create-batch.ts @@ -76,15 +76,7 @@ export class CreateBatch extends RootCommand implements LeafCommand { this.console.log(`Creating postage batch for ${wallet.address} with depth ${this.depth} and amount ${this.amount}`) const postageStampContract = new Contract(Contracts.postageStamp, ABI.postageStamp, signer) - const createBatchArgs = [ - signer.address, - this.amount, - this.depth, - 16, - `0x${Strings.randomHex(64)}`, - false, - ] - await postageStampContract.createBatch.staticCall(...createBatchArgs) + const createBatchArgs = [signer.address, this.amount, this.depth, 16, `0x${Strings.randomHex(64)}`, false] const createBatch = await postageStampContract.createBatch(...createBatchArgs, { gasLimit: 1_000_000, type: 2, diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index 6b08ec15..2b927556 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -14,7 +14,7 @@ describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => 'utility', 'create-batch', '--private-key', - '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d', + '0x566058308ad5fa3888173c741a1fb902c9f1f19559b11fc2738dfc53637ce4e9', '--depth', '17', '--amount', From afd0c8672836662e41764f181ee8b9d5a1f46770 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 13 May 2026 09:41:15 +0200 Subject: [PATCH 16/21] fix: correct amount in create postage batch log --- test/command/create-batch.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/command/create-batch.spec.ts b/test/command/create-batch.spec.ts index 2b927556..f9d40394 100644 --- a/test/command/create-batch.spec.ts +++ b/test/command/create-batch.spec.ts @@ -26,7 +26,7 @@ describeCommand('Test `utility create-batch` command', ({ consoleMessages }) => expect(consoleMessages).toMatchLinesInOrder([ ['Approving spending of', 'BZZ to'], ['Waiting 3 blocks on approval tx'], - ['Creating postage batch for', 'with depth 17 and amount 100000000000'], + ['Creating postage batch for', 'with depth 17 and amount 10000000000'], ['Waiting 3 blocks on create batch tx'], ['Batch created with ID'], ]) From 9a24bca944d7e46ff8d12f7c457f6af825e8ccc8 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 13 May 2026 09:52:06 +0200 Subject: [PATCH 17/21] test: add redeem test --- test/command/redeem.spec.ts | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/command/redeem.spec.ts diff --git a/test/command/redeem.spec.ts b/test/command/redeem.spec.ts new file mode 100644 index 00000000..e48f87ce --- /dev/null +++ b/test/command/redeem.spec.ts @@ -0,0 +1,52 @@ +import { Wallet } from 'ethers' +import { sendBzzTransaction, sendNativeTransaction } from '../../src/utils/rpc' +import { toMatchLinesInOrder } from '../custom-matcher' +import { describeCommand, invokeTestCli } from '../utility' + +expect.extend({ + toMatchLinesInOrder, +}) + +const FUNDER_KEY = '0x566058308ad5fa3888173c741a1fb902c9f1f19559b11fc2738dfc53637ce4e9' +const JSON_RPC_URL = 'http://localhost:9545' +const ETH_01 = (100_000_000_000_000_000n).toString() +const BZZ_5 = (50_000_000_000_000_000n).toString() + +describeCommand('Test `utility redeem` command', ({ consoleMessages }) => { + it( + 'should redeem funds to target address', + async () => { + process.env.SWARM_CLI_NETWORK_ID = '4020' + process.env.SWARM_CLI_BZZ_ADDRESS = '0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab' + + const sourceWallet = Wallet.createRandom() + const targetWallet = Wallet.createRandom() + + await sendNativeTransaction(FUNDER_KEY, sourceWallet.address, ETH_01, JSON_RPC_URL) + await sendBzzTransaction(FUNDER_KEY, sourceWallet.address, BZZ_5, JSON_RPC_URL) + + await invokeTestCli([ + 'utility', + 'redeem', + sourceWallet.privateKey, + '--json-rpc-url', + JSON_RPC_URL, + '--target', + targetWallet.address, + '--yes', + ]) + + expect(consoleMessages).toMatchLinesInOrder([ + ['Target wallet address'], + ['Creating wallet'], + ['xBZZ balance'], + ['xDAI balance'], + ['Transferring xBZZ'], + ['Refreshing xDAI balance'], + ['Transferring xDAI'], + ['Redeem complete'], + ]) + }, + 60_000, + ) +}) From 27d1a23eb131aca1a278efb0465c657b431ff921 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 13 May 2026 09:56:11 +0200 Subject: [PATCH 18/21] chore: format code --- test/command/redeem.spec.ts | 64 +++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/test/command/redeem.spec.ts b/test/command/redeem.spec.ts index e48f87ce..09576b2b 100644 --- a/test/command/redeem.spec.ts +++ b/test/command/redeem.spec.ts @@ -9,44 +9,40 @@ expect.extend({ const FUNDER_KEY = '0x566058308ad5fa3888173c741a1fb902c9f1f19559b11fc2738dfc53637ce4e9' const JSON_RPC_URL = 'http://localhost:9545' -const ETH_01 = (100_000_000_000_000_000n).toString() -const BZZ_5 = (50_000_000_000_000_000n).toString() +const ETH_01 = 100_000_000_000_000_000n.toString() +const BZZ_5 = 50_000_000_000_000_000n.toString() describeCommand('Test `utility redeem` command', ({ consoleMessages }) => { - it( - 'should redeem funds to target address', - async () => { - process.env.SWARM_CLI_NETWORK_ID = '4020' - process.env.SWARM_CLI_BZZ_ADDRESS = '0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab' + it('should redeem funds to target address', async () => { + process.env.SWARM_CLI_NETWORK_ID = '4020' + process.env.SWARM_CLI_BZZ_ADDRESS = '0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab' - const sourceWallet = Wallet.createRandom() - const targetWallet = Wallet.createRandom() + const sourceWallet = Wallet.createRandom() + const targetWallet = Wallet.createRandom() - await sendNativeTransaction(FUNDER_KEY, sourceWallet.address, ETH_01, JSON_RPC_URL) - await sendBzzTransaction(FUNDER_KEY, sourceWallet.address, BZZ_5, JSON_RPC_URL) + await sendNativeTransaction(FUNDER_KEY, sourceWallet.address, ETH_01, JSON_RPC_URL) + await sendBzzTransaction(FUNDER_KEY, sourceWallet.address, BZZ_5, JSON_RPC_URL) - await invokeTestCli([ - 'utility', - 'redeem', - sourceWallet.privateKey, - '--json-rpc-url', - JSON_RPC_URL, - '--target', - targetWallet.address, - '--yes', - ]) + await invokeTestCli([ + 'utility', + 'redeem', + sourceWallet.privateKey, + '--json-rpc-url', + JSON_RPC_URL, + '--target', + targetWallet.address, + '--yes', + ]) - expect(consoleMessages).toMatchLinesInOrder([ - ['Target wallet address'], - ['Creating wallet'], - ['xBZZ balance'], - ['xDAI balance'], - ['Transferring xBZZ'], - ['Refreshing xDAI balance'], - ['Transferring xDAI'], - ['Redeem complete'], - ]) - }, - 60_000, - ) + expect(consoleMessages).toMatchLinesInOrder([ + ['Target wallet address'], + ['Creating wallet'], + ['xBZZ balance'], + ['xDAI balance'], + ['Transferring xBZZ'], + ['Refreshing xDAI balance'], + ['Transferring xDAI'], + ['Redeem complete'], + ]) + }, 60_000) }) From 1fe15c64a1811120c738765df913e7cf632b37c8 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 13 May 2026 10:02:11 +0200 Subject: [PATCH 19/21] fix: ensure 'to' address starts with '0x' in transaction functions --- src/utils/rpc.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index 999443a1..b3fda890 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -52,6 +52,9 @@ export async function sendNativeTransaction( jsonRpcProvider: string, externalGasPrice?: bigint, ): Promise { + if (!to.startsWith('0x')) { + to = `0x${to}` + } const { signer, provider } = await makeReadySigner(privateKey, jsonRpcProvider) const gasPrice = externalGasPrice ?? (await provider.getFeeData()).gasPrice! const transaction = await signer.sendTransaction({ @@ -72,6 +75,9 @@ export async function sendBzzTransaction( value: string, jsonRpcProvider: string, ): Promise { + if (!to.startsWith('0x')) { + to = `0x${to}` + } const { signer, provider } = await makeReadySigner(privateKey, jsonRpcProvider) const gasPrice = (await provider.getFeeData()).gasPrice! const bzz = new Contract(Contracts.bzz, ABI.bzz, signer) From 1cf7fe3fe1d33ef29cc0a1bd9005912d445c2ab8 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 13 May 2026 10:11:11 +0200 Subject: [PATCH 20/21] chore: remove unnecessary docker ps command from CI workflow --- .github/workflows/tests-rc.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests-rc.yaml b/.github/workflows/tests-rc.yaml index 99d9923e..47cb462d 100644 --- a/.github/workflows/tests-rc.yaml +++ b/.github/workflows/tests-rc.yaml @@ -68,8 +68,5 @@ jobs: continue-on-error: true run: swarm-cli status - - name: Print docker ps - run: docker ps - - name: Tests run: npm run test From 06c026b00c6fd21e994b6377bd924a3724654f06 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 13 May 2026 10:13:37 +0200 Subject: [PATCH 21/21] fix: handle null gas price and transaction receipt in RPC functions --- src/utils/rpc.ts | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/utils/rpc.ts b/src/utils/rpc.ts index b3fda890..b30b604a 100644 --- a/src/utils/rpc.ts +++ b/src/utils/rpc.ts @@ -40,7 +40,11 @@ export async function estimateNativeTransferTransactionCost( ): Promise { const { provider } = await makeReadySigner(privateKey, jsonRpcProvider) const gasLimit = 21000n - const gasPrice = (await provider.getFeeData()).gasPrice! + const { gasPrice } = await provider.getFeeData() + + if (gasPrice === null) { + throw new Error('Unable to determine gas price from provider') + } return { gasPrice, totalCost: gasPrice * gasLimit } } @@ -56,15 +60,24 @@ export async function sendNativeTransaction( to = `0x${to}` } const { signer, provider } = await makeReadySigner(privateKey, jsonRpcProvider) - const gasPrice = externalGasPrice ?? (await provider.getFeeData()).gasPrice! + const resolvedGasPrice = externalGasPrice ?? (await provider.getFeeData()).gasPrice + + if (resolvedGasPrice === null || resolvedGasPrice === undefined) { + throw new Error('Unable to determine gas price from provider') + } + const transaction = await signer.sendTransaction({ to, value: BigInt(value), - gasPrice, + gasPrice: resolvedGasPrice, gasLimit: 21000n, type: 0, }) - const receipt = (await transaction.wait(1))! + const receipt = await transaction.wait(1) + + if (receipt === null) { + throw new Error('Transaction was not included in a block') + } return { transaction, receipt } } @@ -79,10 +92,19 @@ export async function sendBzzTransaction( to = `0x${to}` } const { signer, provider } = await makeReadySigner(privateKey, jsonRpcProvider) - const gasPrice = (await provider.getFeeData()).gasPrice! + const { gasPrice } = await provider.getFeeData() + + if (gasPrice === null) { + throw new Error('Unable to determine gas price from provider') + } + const bzz = new Contract(Contracts.bzz, ABI.bzz, signer) const transaction = await bzz.transfer(to, value, { gasPrice }) - const receipt = (await transaction.wait(1))! + const receipt = await transaction.wait(1) + + if (receipt === null) { + throw new Error('Transaction was not included in a block') + } return { transaction, receipt } }