etherwallets-latest 6.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +478 -0
- package/FUNDING.json +10 -0
- package/LICENSE.md +21 -0
- package/README.md +140 -0
- package/SECURITY.md +34 -0
- package/lib.commonjs/README.md +16 -0
- package/lib.commonjs/_version.d.ts +5 -0
- package/lib.commonjs/_version.d.ts.map +1 -0
- package/lib.commonjs/_version.js +9 -0
- package/lib.commonjs/_version.js.map +1 -0
- package/lib.commonjs/abi/abi-coder.d.ts +61 -0
- package/lib.commonjs/abi/abi-coder.d.ts.map +1 -0
- package/lib.commonjs/abi/abi-coder.js +210 -0
- package/lib.commonjs/abi/abi-coder.js.map +1 -0
- package/lib.commonjs/abi/bytes32.d.ts +15 -0
- package/lib.commonjs/abi/bytes32.d.ts.map +1 -0
- package/lib.commonjs/abi/bytes32.js +45 -0
- package/lib.commonjs/abi/bytes32.js.map +1 -0
- package/lib.commonjs/abi/coders/abstract-coder.d.ts +124 -0
- package/lib.commonjs/abi/coders/abstract-coder.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/abstract-coder.js +472 -0
- package/lib.commonjs/abi/coders/abstract-coder.js.map +1 -0
- package/lib.commonjs/abi/coders/address.d.ts +13 -0
- package/lib.commonjs/abi/coders/address.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/address.js +33 -0
- package/lib.commonjs/abi/coders/address.js.map +1 -0
- package/lib.commonjs/abi/coders/anonymous.d.ts +15 -0
- package/lib.commonjs/abi/coders/anonymous.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/anonymous.js +27 -0
- package/lib.commonjs/abi/coders/anonymous.js.map +1 -0
- package/lib.commonjs/abi/coders/array.d.ts +25 -0
- package/lib.commonjs/abi/coders/array.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/array.js +165 -0
- package/lib.commonjs/abi/coders/array.js.map +1 -0
- package/lib.commonjs/abi/coders/boolean.d.ts +13 -0
- package/lib.commonjs/abi/coders/boolean.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/boolean.js +25 -0
- package/lib.commonjs/abi/coders/boolean.js.map +1 -0
- package/lib.commonjs/abi/coders/bytes.d.ts +19 -0
- package/lib.commonjs/abi/coders/bytes.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/bytes.js +39 -0
- package/lib.commonjs/abi/coders/bytes.js.map +1 -0
- package/lib.commonjs/abi/coders/fixed-bytes.d.ts +15 -0
- package/lib.commonjs/abi/coders/fixed-bytes.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/fixed-bytes.js +32 -0
- package/lib.commonjs/abi/coders/fixed-bytes.js.map +1 -0
- package/lib.commonjs/abi/coders/null.d.ts +12 -0
- package/lib.commonjs/abi/coders/null.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/null.js +28 -0
- package/lib.commonjs/abi/coders/null.js.map +1 -0
- package/lib.commonjs/abi/coders/number.d.ts +16 -0
- package/lib.commonjs/abi/coders/number.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/number.js +49 -0
- package/lib.commonjs/abi/coders/number.js.map +1 -0
- package/lib.commonjs/abi/coders/string.d.ts +13 -0
- package/lib.commonjs/abi/coders/string.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/string.js +25 -0
- package/lib.commonjs/abi/coders/string.js.map +1 -0
- package/lib.commonjs/abi/coders/tuple.d.ts +16 -0
- package/lib.commonjs/abi/coders/tuple.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/tuple.js +67 -0
- package/lib.commonjs/abi/coders/tuple.js.map +1 -0
- package/lib.commonjs/abi/fragments.d.ts +466 -0
- package/lib.commonjs/abi/fragments.d.ts.map +1 -0
- package/lib.commonjs/abi/fragments.js +1331 -0
- package/lib.commonjs/abi/fragments.js.map +1 -0
- package/lib.commonjs/abi/index.d.ts +18 -0
- package/lib.commonjs/abi/index.d.ts.map +1 -0
- package/lib.commonjs/abi/index.js +40 -0
- package/lib.commonjs/abi/index.js.map +1 -0
- package/lib.commonjs/abi/interface.d.ts +382 -0
- package/lib.commonjs/abi/interface.d.ts.map +1 -0
- package/lib.commonjs/abi/interface.js +1110 -0
- package/lib.commonjs/abi/interface.js.map +1 -0
- package/lib.commonjs/abi/typed.d.ts +570 -0
- package/lib.commonjs/abi/typed.d.ts.map +1 -0
- package/lib.commonjs/abi/typed.js +606 -0
- package/lib.commonjs/abi/typed.js.map +1 -0
- package/lib.commonjs/address/address.d.ts +56 -0
- package/lib.commonjs/address/address.d.ts.map +1 -0
- package/lib.commonjs/address/address.js +161 -0
- package/lib.commonjs/address/address.js.map +1 -0
- package/lib.commonjs/address/checks.d.ts +81 -0
- package/lib.commonjs/address/checks.d.ts.map +1 -0
- package/lib.commonjs/address/checks.js +120 -0
- package/lib.commonjs/address/checks.js.map +1 -0
- package/lib.commonjs/address/contract-address.d.ts +48 -0
- package/lib.commonjs/address/contract-address.d.ts.map +1 -0
- package/lib.commonjs/address/contract-address.js +74 -0
- package/lib.commonjs/address/contract-address.js.map +1 -0
- package/lib.commonjs/address/index.d.ts +49 -0
- package/lib.commonjs/address/index.d.ts.map +1 -0
- package/lib.commonjs/address/index.js +29 -0
- package/lib.commonjs/address/index.js.map +1 -0
- package/lib.commonjs/constants/addresses.d.ts +7 -0
- package/lib.commonjs/constants/addresses.d.ts.map +1 -0
- package/lib.commonjs/constants/addresses.js +10 -0
- package/lib.commonjs/constants/addresses.js.map +1 -0
- package/lib.commonjs/constants/hashes.d.ts +7 -0
- package/lib.commonjs/constants/hashes.d.ts.map +1 -0
- package/lib.commonjs/constants/hashes.js +10 -0
- package/lib.commonjs/constants/hashes.js.map +1 -0
- package/lib.commonjs/constants/index.d.ts +10 -0
- package/lib.commonjs/constants/index.d.ts.map +1 -0
- package/lib.commonjs/constants/index.js +22 -0
- package/lib.commonjs/constants/index.js.map +1 -0
- package/lib.commonjs/constants/numbers.d.ts +31 -0
- package/lib.commonjs/constants/numbers.d.ts.map +1 -0
- package/lib.commonjs/constants/numbers.js +34 -0
- package/lib.commonjs/constants/numbers.js.map +1 -0
- package/lib.commonjs/constants/strings.d.ts +13 -0
- package/lib.commonjs/constants/strings.d.ts.map +1 -0
- package/lib.commonjs/constants/strings.js +17 -0
- package/lib.commonjs/constants/strings.js.map +1 -0
- package/lib.commonjs/contract/contract.d.ts +168 -0
- package/lib.commonjs/contract/contract.d.ts.map +1 -0
- package/lib.commonjs/contract/contract.js +960 -0
- package/lib.commonjs/contract/contract.js.map +1 -0
- package/lib.commonjs/contract/factory.d.ts +62 -0
- package/lib.commonjs/contract/factory.d.ts.map +1 -0
- package/lib.commonjs/contract/factory.js +116 -0
- package/lib.commonjs/contract/factory.js.map +1 -0
- package/lib.commonjs/contract/index.d.ts +13 -0
- package/lib.commonjs/contract/index.d.ts.map +1 -0
- package/lib.commonjs/contract/index.js +24 -0
- package/lib.commonjs/contract/index.js.map +1 -0
- package/lib.commonjs/contract/types.d.ts +193 -0
- package/lib.commonjs/contract/types.d.ts.map +1 -0
- package/lib.commonjs/contract/types.js +6 -0
- package/lib.commonjs/contract/types.js.map +1 -0
- package/lib.commonjs/contract/wrappers.d.ts +143 -0
- package/lib.commonjs/contract/wrappers.d.ts.map +1 -0
- package/lib.commonjs/contract/wrappers.js +186 -0
- package/lib.commonjs/contract/wrappers.js.map +1 -0
- package/lib.commonjs/crypto/crypto-browser.d.ts +15 -0
- package/lib.commonjs/crypto/crypto-browser.d.ts.map +1 -0
- package/lib.commonjs/crypto/crypto-browser.js +55 -0
- package/lib.commonjs/crypto/crypto-browser.js.map +1 -0
- package/lib.commonjs/crypto/crypto.d.ts +2 -0
- package/lib.commonjs/crypto/crypto.d.ts.map +1 -0
- package/lib.commonjs/crypto/crypto.js +9 -0
- package/lib.commonjs/crypto/crypto.js.map +1 -0
- package/lib.commonjs/crypto/hmac.d.ts +25 -0
- package/lib.commonjs/crypto/hmac.d.ts.map +1 -0
- package/lib.commonjs/crypto/hmac.js +51 -0
- package/lib.commonjs/crypto/hmac.js.map +1 -0
- package/lib.commonjs/crypto/index.d.ts +25 -0
- package/lib.commonjs/crypto/index.d.ts.map +1 -0
- package/lib.commonjs/crypto/index.js +49 -0
- package/lib.commonjs/crypto/index.js.map +1 -0
- package/lib.commonjs/crypto/keccak.d.ts +35 -0
- package/lib.commonjs/crypto/keccak.d.ts.map +1 -0
- package/lib.commonjs/crypto/keccak.js +52 -0
- package/lib.commonjs/crypto/keccak.js.map +1 -0
- package/lib.commonjs/crypto/pbkdf2.d.ts +35 -0
- package/lib.commonjs/crypto/pbkdf2.d.ts.map +1 -0
- package/lib.commonjs/crypto/pbkdf2.js +53 -0
- package/lib.commonjs/crypto/pbkdf2.js.map +1 -0
- package/lib.commonjs/crypto/random.d.ts +14 -0
- package/lib.commonjs/crypto/random.d.ts.map +1 -0
- package/lib.commonjs/crypto/random.js +38 -0
- package/lib.commonjs/crypto/random.js.map +1 -0
- package/lib.commonjs/crypto/ripemd160.d.ts +25 -0
- package/lib.commonjs/crypto/ripemd160.d.ts.map +1 -0
- package/lib.commonjs/crypto/ripemd160.js +42 -0
- package/lib.commonjs/crypto/ripemd160.js.map +1 -0
- package/lib.commonjs/crypto/scrypt.d.ts +82 -0
- package/lib.commonjs/crypto/scrypt.d.ts.map +1 -0
- package/lib.commonjs/crypto/scrypt.js +104 -0
- package/lib.commonjs/crypto/scrypt.js.map +1 -0
- package/lib.commonjs/crypto/sha2.d.ts +47 -0
- package/lib.commonjs/crypto/sha2.d.ts.map +1 -0
- package/lib.commonjs/crypto/sha2.js +76 -0
- package/lib.commonjs/crypto/sha2.js.map +1 -0
- package/lib.commonjs/crypto/signature.d.ts +183 -0
- package/lib.commonjs/crypto/signature.d.ts.map +1 -0
- package/lib.commonjs/crypto/signature.js +350 -0
- package/lib.commonjs/crypto/signature.js.map +1 -0
- package/lib.commonjs/crypto/signing-key.d.ts +122 -0
- package/lib.commonjs/crypto/signing-key.d.ts.map +1 -0
- package/lib.commonjs/crypto/signing-key.js +170 -0
- package/lib.commonjs/crypto/signing-key.js.map +1 -0
- package/lib.commonjs/ethers.d.ts +22 -0
- package/lib.commonjs/ethers.d.ts.map +1 -0
- package/lib.commonjs/ethers.js +215 -0
- package/lib.commonjs/ethers.js.map +1 -0
- package/lib.commonjs/hash/authorization.d.ts +18 -0
- package/lib.commonjs/hash/authorization.d.ts.map +1 -0
- package/lib.commonjs/hash/authorization.js +30 -0
- package/lib.commonjs/hash/authorization.js.map +1 -0
- package/lib.commonjs/hash/id.d.ts +13 -0
- package/lib.commonjs/hash/id.d.ts.map +1 -0
- package/lib.commonjs/hash/id.js +21 -0
- package/lib.commonjs/hash/id.js.map +1 -0
- package/lib.commonjs/hash/index.d.ts +15 -0
- package/lib.commonjs/hash/index.d.ts.map +1 -0
- package/lib.commonjs/hash/index.js +30 -0
- package/lib.commonjs/hash/index.js.map +1 -0
- package/lib.commonjs/hash/message.d.ts +36 -0
- package/lib.commonjs/hash/message.d.ts.map +1 -0
- package/lib.commonjs/hash/message.js +56 -0
- package/lib.commonjs/hash/message.js.map +1 -0
- package/lib.commonjs/hash/namehash.d.ts +20 -0
- package/lib.commonjs/hash/namehash.d.ts.map +1 -0
- package/lib.commonjs/hash/namehash.js +91 -0
- package/lib.commonjs/hash/namehash.js.map +1 -0
- package/lib.commonjs/hash/solidity.d.ts +31 -0
- package/lib.commonjs/hash/solidity.d.ts.map +1 -0
- package/lib.commonjs/hash/solidity.js +109 -0
- package/lib.commonjs/hash/solidity.js.map +1 -0
- package/lib.commonjs/hash/typed-data.d.ts +150 -0
- package/lib.commonjs/hash/typed-data.d.ts.map +1 -0
- package/lib.commonjs/hash/typed-data.js +524 -0
- package/lib.commonjs/hash/typed-data.js.map +1 -0
- package/lib.commonjs/index.d.ts +11 -0
- package/lib.commonjs/index.d.ts.map +1 -0
- package/lib.commonjs/index.js +15 -0
- package/lib.commonjs/index.js.map +1 -0
- package/lib.commonjs/package.json +12 -0
- package/lib.commonjs/providers/abstract-provider.d.ts +451 -0
- package/lib.commonjs/providers/abstract-provider.d.ts.map +1 -0
- package/lib.commonjs/providers/abstract-provider.js +1409 -0
- package/lib.commonjs/providers/abstract-provider.js.map +1 -0
- package/lib.commonjs/providers/abstract-signer.d.ts +69 -0
- package/lib.commonjs/providers/abstract-signer.d.ts.map +1 -0
- package/lib.commonjs/providers/abstract-signer.js +249 -0
- package/lib.commonjs/providers/abstract-signer.js.map +1 -0
- package/lib.commonjs/providers/community.d.ts +29 -0
- package/lib.commonjs/providers/community.d.ts.map +1 -0
- package/lib.commonjs/providers/community.js +40 -0
- package/lib.commonjs/providers/community.js.map +1 -0
- package/lib.commonjs/providers/contracts.d.ts +36 -0
- package/lib.commonjs/providers/contracts.d.ts.map +1 -0
- package/lib.commonjs/providers/contracts.js +3 -0
- package/lib.commonjs/providers/contracts.js.map +1 -0
- package/lib.commonjs/providers/default-provider.d.ts +49 -0
- package/lib.commonjs/providers/default-provider.d.ts.map +1 -0
- package/lib.commonjs/providers/default-provider.js +200 -0
- package/lib.commonjs/providers/default-provider.js.map +1 -0
- package/lib.commonjs/providers/ens-resolver.d.ts +147 -0
- package/lib.commonjs/providers/ens-resolver.d.ts.map +1 -0
- package/lib.commonjs/providers/ens-resolver.js +502 -0
- package/lib.commonjs/providers/ens-resolver.js.map +1 -0
- package/lib.commonjs/providers/format.d.ts +15 -0
- package/lib.commonjs/providers/format.d.ts.map +1 -0
- package/lib.commonjs/providers/format.js +312 -0
- package/lib.commonjs/providers/format.js.map +1 -0
- package/lib.commonjs/providers/formatting.d.ts +318 -0
- package/lib.commonjs/providers/formatting.d.ts.map +1 -0
- package/lib.commonjs/providers/formatting.js +10 -0
- package/lib.commonjs/providers/formatting.js.map +1 -0
- package/lib.commonjs/providers/index.d.ts +50 -0
- package/lib.commonjs/providers/index.d.ts.map +1 -0
- package/lib.commonjs/providers/index.js +84 -0
- package/lib.commonjs/providers/index.js.map +1 -0
- package/lib.commonjs/providers/network.d.ts +99 -0
- package/lib.commonjs/providers/network.d.ts.map +1 -0
- package/lib.commonjs/providers/network.js +369 -0
- package/lib.commonjs/providers/network.js.map +1 -0
- package/lib.commonjs/providers/pagination.d.ts +6 -0
- package/lib.commonjs/providers/pagination.d.ts.map +1 -0
- package/lib.commonjs/providers/pagination.js +3 -0
- package/lib.commonjs/providers/pagination.js.map +1 -0
- package/lib.commonjs/providers/plugin-fallback.d.ts +13 -0
- package/lib.commonjs/providers/plugin-fallback.d.ts.map +1 -0
- package/lib.commonjs/providers/plugin-fallback.js +31 -0
- package/lib.commonjs/providers/plugin-fallback.js.map +1 -0
- package/lib.commonjs/providers/plugins-network.d.ts +170 -0
- package/lib.commonjs/providers/plugins-network.d.ts.map +1 -0
- package/lib.commonjs/providers/plugins-network.js +216 -0
- package/lib.commonjs/providers/plugins-network.js.map +1 -0
- package/lib.commonjs/providers/provider-alchemy.d.ts +50 -0
- package/lib.commonjs/providers/provider-alchemy.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-alchemy.js +151 -0
- package/lib.commonjs/providers/provider-alchemy.js.map +1 -0
- package/lib.commonjs/providers/provider-ankr.d.ts +63 -0
- package/lib.commonjs/providers/provider-ankr.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-ankr.js +143 -0
- package/lib.commonjs/providers/provider-ankr.js.map +1 -0
- package/lib.commonjs/providers/provider-blockscout.d.ts +59 -0
- package/lib.commonjs/providers/provider-blockscout.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-blockscout.js +145 -0
- package/lib.commonjs/providers/provider-blockscout.js.map +1 -0
- package/lib.commonjs/providers/provider-browser.d.ts +108 -0
- package/lib.commonjs/providers/provider-browser.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-browser.js +204 -0
- package/lib.commonjs/providers/provider-browser.js.map +1 -0
- package/lib.commonjs/providers/provider-chainstack.d.ts +46 -0
- package/lib.commonjs/providers/provider-chainstack.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-chainstack.js +102 -0
- package/lib.commonjs/providers/provider-chainstack.js.map +1 -0
- package/lib.commonjs/providers/provider-cloudflare.d.ts +14 -0
- package/lib.commonjs/providers/provider-cloudflare.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-cloudflare.js +26 -0
- package/lib.commonjs/providers/provider-cloudflare.js.map +1 -0
- package/lib.commonjs/providers/provider-etherscan.d.ts +152 -0
- package/lib.commonjs/providers/provider-etherscan.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-etherscan.js +601 -0
- package/lib.commonjs/providers/provider-etherscan.js.map +1 -0
- package/lib.commonjs/providers/provider-fallback.d.ts +115 -0
- package/lib.commonjs/providers/provider-fallback.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-fallback.js +624 -0
- package/lib.commonjs/providers/provider-fallback.js.map +1 -0
- package/lib.commonjs/providers/provider-infura.d.ts +101 -0
- package/lib.commonjs/providers/provider-infura.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-infura.js +206 -0
- package/lib.commonjs/providers/provider-infura.js.map +1 -0
- package/lib.commonjs/providers/provider-ipcsocket-browser.d.ts +3 -0
- package/lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-ipcsocket-browser.js +6 -0
- package/lib.commonjs/providers/provider-ipcsocket-browser.js.map +1 -0
- package/lib.commonjs/providers/provider-ipcsocket.d.ts +21 -0
- package/lib.commonjs/providers/provider-ipcsocket.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-ipcsocket.js +72 -0
- package/lib.commonjs/providers/provider-ipcsocket.js.map +1 -0
- package/lib.commonjs/providers/provider-jsonrpc.d.ts +361 -0
- package/lib.commonjs/providers/provider-jsonrpc.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-jsonrpc.js +980 -0
- package/lib.commonjs/providers/provider-jsonrpc.js.map +1 -0
- package/lib.commonjs/providers/provider-pocket.d.ts +54 -0
- package/lib.commonjs/providers/provider-pocket.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-pocket.js +109 -0
- package/lib.commonjs/providers/provider-pocket.js.map +1 -0
- package/lib.commonjs/providers/provider-quicknode.d.ts +59 -0
- package/lib.commonjs/providers/provider-quicknode.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-quicknode.js +163 -0
- package/lib.commonjs/providers/provider-quicknode.js.map +1 -0
- package/lib.commonjs/providers/provider-socket.d.ts +113 -0
- package/lib.commonjs/providers/provider-socket.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-socket.js +309 -0
- package/lib.commonjs/providers/provider-socket.js.map +1 -0
- package/lib.commonjs/providers/provider-websocket.d.ts +37 -0
- package/lib.commonjs/providers/provider-websocket.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-websocket.js +80 -0
- package/lib.commonjs/providers/provider-websocket.js.map +1 -0
- package/lib.commonjs/providers/provider.d.ts +1230 -0
- package/lib.commonjs/providers/provider.d.ts.map +1 -0
- package/lib.commonjs/providers/provider.js +1324 -0
- package/lib.commonjs/providers/provider.js.map +1 -0
- package/lib.commonjs/providers/signer-noncemanager.d.ts +38 -0
- package/lib.commonjs/providers/signer-noncemanager.d.ts.map +1 -0
- package/lib.commonjs/providers/signer-noncemanager.js +78 -0
- package/lib.commonjs/providers/signer-noncemanager.js.map +1 -0
- package/lib.commonjs/providers/signer.d.ts +131 -0
- package/lib.commonjs/providers/signer.d.ts.map +1 -0
- package/lib.commonjs/providers/signer.js +3 -0
- package/lib.commonjs/providers/signer.js.map +1 -0
- package/lib.commonjs/providers/subscriber-connection.d.ts +25 -0
- package/lib.commonjs/providers/subscriber-connection.d.ts.map +1 -0
- package/lib.commonjs/providers/subscriber-connection.js +56 -0
- package/lib.commonjs/providers/subscriber-connection.js.map +1 -0
- package/lib.commonjs/providers/subscriber-filterid.d.ts +64 -0
- package/lib.commonjs/providers/subscriber-filterid.d.ts.map +1 -0
- package/lib.commonjs/providers/subscriber-filterid.js +180 -0
- package/lib.commonjs/providers/subscriber-filterid.js.map +1 -0
- package/lib.commonjs/providers/subscriber-polling.d.ts +100 -0
- package/lib.commonjs/providers/subscriber-polling.d.ts.map +1 -0
- package/lib.commonjs/providers/subscriber-polling.js +303 -0
- package/lib.commonjs/providers/subscriber-polling.js.map +1 -0
- package/lib.commonjs/providers/ws-browser.d.ts +3 -0
- package/lib.commonjs/providers/ws-browser.d.ts.map +1 -0
- package/lib.commonjs/providers/ws-browser.js +19 -0
- package/lib.commonjs/providers/ws-browser.js.map +1 -0
- package/lib.commonjs/providers/ws.d.ts +2 -0
- package/lib.commonjs/providers/ws.d.ts.map +1 -0
- package/lib.commonjs/providers/ws.js +6 -0
- package/lib.commonjs/providers/ws.js.map +1 -0
- package/lib.commonjs/transaction/accesslist.d.ts +6 -0
- package/lib.commonjs/transaction/accesslist.d.ts.map +1 -0
- package/lib.commonjs/transaction/accesslist.js +41 -0
- package/lib.commonjs/transaction/accesslist.js.map +1 -0
- package/lib.commonjs/transaction/address.d.ts +15 -0
- package/lib.commonjs/transaction/address.d.ts.map +1 -0
- package/lib.commonjs/transaction/address.js +30 -0
- package/lib.commonjs/transaction/address.js.map +1 -0
- package/lib.commonjs/transaction/authorization.d.ts +3 -0
- package/lib.commonjs/transaction/authorization.d.ts.map +1 -0
- package/lib.commonjs/transaction/authorization.js +16 -0
- package/lib.commonjs/transaction/authorization.js.map +1 -0
- package/lib.commonjs/transaction/index.d.ts +40 -0
- package/lib.commonjs/transaction/index.d.ts.map +1 -0
- package/lib.commonjs/transaction/index.js +19 -0
- package/lib.commonjs/transaction/index.js.map +1 -0
- package/lib.commonjs/transaction/transaction.d.ts +430 -0
- package/lib.commonjs/transaction/transaction.d.ts.map +1 -0
- package/lib.commonjs/transaction/transaction.js +1293 -0
- package/lib.commonjs/transaction/transaction.js.map +1 -0
- package/lib.commonjs/utils/base58.d.ts +23 -0
- package/lib.commonjs/utils/base58.d.ts.map +1 -0
- package/lib.commonjs/utils/base58.js +68 -0
- package/lib.commonjs/utils/base58.js.map +1 -0
- package/lib.commonjs/utils/base64-browser.d.ts +4 -0
- package/lib.commonjs/utils/base64-browser.d.ts.map +1 -0
- package/lib.commonjs/utils/base64-browser.js +24 -0
- package/lib.commonjs/utils/base64-browser.js.map +1 -0
- package/lib.commonjs/utils/base64.d.ts +40 -0
- package/lib.commonjs/utils/base64.d.ts.map +1 -0
- package/lib.commonjs/utils/base64.js +58 -0
- package/lib.commonjs/utils/base64.js.map +1 -0
- package/lib.commonjs/utils/data.d.ts +93 -0
- package/lib.commonjs/utils/data.d.ts.map +1 -0
- package/lib.commonjs/utils/data.js +185 -0
- package/lib.commonjs/utils/data.js.map +1 -0
- package/lib.commonjs/utils/errors.d.ts +512 -0
- package/lib.commonjs/utils/errors.d.ts.map +1 -0
- package/lib.commonjs/utils/errors.js +243 -0
- package/lib.commonjs/utils/errors.js.map +1 -0
- package/lib.commonjs/utils/events.d.ts +77 -0
- package/lib.commonjs/utils/events.d.ts.map +1 -0
- package/lib.commonjs/utils/events.js +46 -0
- package/lib.commonjs/utils/events.js.map +1 -0
- package/lib.commonjs/utils/fetch.d.ts +363 -0
- package/lib.commonjs/utils/fetch.d.ts.map +1 -0
- package/lib.commonjs/utils/fetch.js +858 -0
- package/lib.commonjs/utils/fetch.js.map +1 -0
- package/lib.commonjs/utils/fixednumber.d.ts +252 -0
- package/lib.commonjs/utils/fixednumber.d.ts.map +1 -0
- package/lib.commonjs/utils/fixednumber.js +530 -0
- package/lib.commonjs/utils/fixednumber.js.map +1 -0
- package/lib.commonjs/utils/geturl-browser.d.ts +4 -0
- package/lib.commonjs/utils/geturl-browser.d.ts.map +1 -0
- package/lib.commonjs/utils/geturl-browser.js +67 -0
- package/lib.commonjs/utils/geturl-browser.js.map +1 -0
- package/lib.commonjs/utils/geturl.d.ts +10 -0
- package/lib.commonjs/utils/geturl.d.ts.map +1 -0
- package/lib.commonjs/utils/geturl.js +127 -0
- package/lib.commonjs/utils/geturl.js.map +1 -0
- package/lib.commonjs/utils/index.d.ts +30 -0
- package/lib.commonjs/utils/index.d.ts.map +1 -0
- package/lib.commonjs/utils/index.js +78 -0
- package/lib.commonjs/utils/index.js.map +1 -0
- package/lib.commonjs/utils/maths.d.ts +66 -0
- package/lib.commonjs/utils/maths.d.ts.map +1 -0
- package/lib.commonjs/utils/maths.js +245 -0
- package/lib.commonjs/utils/maths.js.map +1 -0
- package/lib.commonjs/utils/properties.d.ts +23 -0
- package/lib.commonjs/utils/properties.d.ts.map +1 -0
- package/lib.commonjs/utils/properties.js +59 -0
- package/lib.commonjs/utils/properties.js.map +1 -0
- package/lib.commonjs/utils/rlp-decode.d.ts +6 -0
- package/lib.commonjs/utils/rlp-decode.d.ts.map +1 -0
- package/lib.commonjs/utils/rlp-decode.js +83 -0
- package/lib.commonjs/utils/rlp-decode.js.map +1 -0
- package/lib.commonjs/utils/rlp-encode.d.ts +6 -0
- package/lib.commonjs/utils/rlp-encode.d.ts.map +1 -0
- package/lib.commonjs/utils/rlp-encode.js +53 -0
- package/lib.commonjs/utils/rlp-encode.js.map +1 -0
- package/lib.commonjs/utils/rlp.d.ts +17 -0
- package/lib.commonjs/utils/rlp.d.ts.map +1 -0
- package/lib.commonjs/utils/rlp.js +14 -0
- package/lib.commonjs/utils/rlp.js.map +1 -0
- package/lib.commonjs/utils/units.d.ts +24 -0
- package/lib.commonjs/utils/units.d.ts.map +1 -0
- package/lib.commonjs/utils/units.js +90 -0
- package/lib.commonjs/utils/units.js.map +1 -0
- package/lib.commonjs/utils/utf8.d.ts +96 -0
- package/lib.commonjs/utils/utf8.d.ts.map +1 -0
- package/lib.commonjs/utils/utf8.js +227 -0
- package/lib.commonjs/utils/utf8.js.map +1 -0
- package/lib.commonjs/utils/uuid.d.ts +8 -0
- package/lib.commonjs/utils/uuid.d.ts.map +1 -0
- package/lib.commonjs/utils/uuid.js +34 -0
- package/lib.commonjs/utils/uuid.js.map +1 -0
- package/lib.commonjs/wallet/base-wallet.d.ts +57 -0
- package/lib.commonjs/wallet/base-wallet.d.ts.map +1 -0
- package/lib.commonjs/wallet/base-wallet.js +127 -0
- package/lib.commonjs/wallet/base-wallet.js.map +1 -0
- package/lib.commonjs/wallet/hdwallet.d.ts +248 -0
- package/lib.commonjs/wallet/hdwallet.d.ts.map +1 -0
- package/lib.commonjs/wallet/hdwallet.js +506 -0
- package/lib.commonjs/wallet/hdwallet.js.map +1 -0
- package/lib.commonjs/wallet/index.d.ts +27 -0
- package/lib.commonjs/wallet/index.d.ts.map +1 -0
- package/lib.commonjs/wallet/index.js +43 -0
- package/lib.commonjs/wallet/index.js.map +1 -0
- package/lib.commonjs/wallet/json-crowdsale.d.ts +27 -0
- package/lib.commonjs/wallet/json-crowdsale.d.ts.map +1 -0
- package/lib.commonjs/wallet/json-crowdsale.js +60 -0
- package/lib.commonjs/wallet/json-crowdsale.js.map +1 -0
- package/lib.commonjs/wallet/json-keystore.d.ts +89 -0
- package/lib.commonjs/wallet/json-keystore.d.ts.map +1 -0
- package/lib.commonjs/wallet/json-keystore.js +295 -0
- package/lib.commonjs/wallet/json-keystore.js.map +1 -0
- package/lib.commonjs/wallet/mnemonic.d.ts +65 -0
- package/lib.commonjs/wallet/mnemonic.d.ts.map +1 -0
- package/lib.commonjs/wallet/mnemonic.js +169 -0
- package/lib.commonjs/wallet/mnemonic.js.map +1 -0
- package/lib.commonjs/wallet/utils.d.ts +8 -0
- package/lib.commonjs/wallet/utils.d.ts.map +1 -0
- package/lib.commonjs/wallet/utils.js +149 -0
- package/lib.commonjs/wallet/utils.js.map +1 -0
- package/lib.commonjs/wallet/wallet.d.ts +71 -0
- package/lib.commonjs/wallet/wallet.d.ts.map +1 -0
- package/lib.commonjs/wallet/wallet.js +148 -0
- package/lib.commonjs/wallet/wallet.js.map +1 -0
- package/lib.commonjs/wordlists/bit-reader.d.ts +5 -0
- package/lib.commonjs/wordlists/bit-reader.d.ts.map +1 -0
- package/lib.commonjs/wordlists/bit-reader.js +36 -0
- package/lib.commonjs/wordlists/bit-reader.js.map +1 -0
- package/lib.commonjs/wordlists/decode-owl.d.ts +9 -0
- package/lib.commonjs/wordlists/decode-owl.d.ts.map +1 -0
- package/lib.commonjs/wordlists/decode-owl.js +60 -0
- package/lib.commonjs/wordlists/decode-owl.js.map +1 -0
- package/lib.commonjs/wordlists/decode-owla.d.ts +5 -0
- package/lib.commonjs/wordlists/decode-owla.d.ts.map +1 -0
- package/lib.commonjs/wordlists/decode-owla.js +32 -0
- package/lib.commonjs/wordlists/decode-owla.js.map +1 -0
- package/lib.commonjs/wordlists/generation/encode-latin.d.ts +25 -0
- package/lib.commonjs/wordlists/generation/encode-latin.d.ts.map +1 -0
- package/lib.commonjs/wordlists/generation/encode-latin.js +351 -0
- package/lib.commonjs/wordlists/generation/encode-latin.js.map +1 -0
- package/lib.commonjs/wordlists/index.d.ts +25 -0
- package/lib.commonjs/wordlists/index.d.ts.map +1 -0
- package/lib.commonjs/wordlists/index.js +33 -0
- package/lib.commonjs/wordlists/index.js.map +1 -0
- package/lib.commonjs/wordlists/lang-cz.d.ts +23 -0
- package/lib.commonjs/wordlists/lang-cz.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-cz.js +35 -0
- package/lib.commonjs/wordlists/lang-cz.js.map +1 -0
- package/lib.commonjs/wordlists/lang-en.d.ts +23 -0
- package/lib.commonjs/wordlists/lang-en.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-en.js +35 -0
- package/lib.commonjs/wordlists/lang-en.js.map +1 -0
- package/lib.commonjs/wordlists/lang-es.d.ts +23 -0
- package/lib.commonjs/wordlists/lang-es.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-es.js +36 -0
- package/lib.commonjs/wordlists/lang-es.js.map +1 -0
- package/lib.commonjs/wordlists/lang-fr.d.ts +23 -0
- package/lib.commonjs/wordlists/lang-fr.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-fr.js +36 -0
- package/lib.commonjs/wordlists/lang-fr.js.map +1 -0
- package/lib.commonjs/wordlists/lang-it.d.ts +23 -0
- package/lib.commonjs/wordlists/lang-it.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-it.js +35 -0
- package/lib.commonjs/wordlists/lang-it.js.map +1 -0
- package/lib.commonjs/wordlists/lang-ja.d.ts +27 -0
- package/lib.commonjs/wordlists/lang-ja.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-ja.js +158 -0
- package/lib.commonjs/wordlists/lang-ja.js.map +1 -0
- package/lib.commonjs/wordlists/lang-ko.d.ts +25 -0
- package/lib.commonjs/wordlists/lang-ko.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-ko.js +93 -0
- package/lib.commonjs/wordlists/lang-ko.js.map +1 -0
- package/lib.commonjs/wordlists/lang-pt.d.ts +23 -0
- package/lib.commonjs/wordlists/lang-pt.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-pt.js +35 -0
- package/lib.commonjs/wordlists/lang-pt.js.map +1 -0
- package/lib.commonjs/wordlists/lang-zh.d.ts +32 -0
- package/lib.commonjs/wordlists/lang-zh.d.ts.map +1 -0
- package/lib.commonjs/wordlists/lang-zh.js +96 -0
- package/lib.commonjs/wordlists/lang-zh.js.map +1 -0
- package/lib.commonjs/wordlists/wordlist-owl.d.ts +32 -0
- package/lib.commonjs/wordlists/wordlist-owl.d.ts.map +1 -0
- package/lib.commonjs/wordlists/wordlist-owl.js +70 -0
- package/lib.commonjs/wordlists/wordlist-owl.js.map +1 -0
- package/lib.commonjs/wordlists/wordlist-owla.d.ts +30 -0
- package/lib.commonjs/wordlists/wordlist-owla.d.ts.map +1 -0
- package/lib.commonjs/wordlists/wordlist-owla.js +40 -0
- package/lib.commonjs/wordlists/wordlist-owla.js.map +1 -0
- package/lib.commonjs/wordlists/wordlist.d.ts +47 -0
- package/lib.commonjs/wordlists/wordlist.d.ts.map +1 -0
- package/lib.commonjs/wordlists/wordlist.js +46 -0
- package/lib.commonjs/wordlists/wordlist.js.map +1 -0
- package/lib.commonjs/wordlists/wordlists-browser.d.ts +3 -0
- package/lib.commonjs/wordlists/wordlists-browser.d.ts.map +1 -0
- package/lib.commonjs/wordlists/wordlists-browser.js +8 -0
- package/lib.commonjs/wordlists/wordlists-browser.js.map +1 -0
- package/lib.commonjs/wordlists/wordlists-extra.d.ts +9 -0
- package/lib.commonjs/wordlists/wordlists-extra.d.ts.map +1 -0
- package/lib.commonjs/wordlists/wordlists-extra.js +20 -0
- package/lib.commonjs/wordlists/wordlists-extra.js.map +1 -0
- package/lib.commonjs/wordlists/wordlists.d.ts +16 -0
- package/lib.commonjs/wordlists/wordlists.d.ts.map +1 -0
- package/lib.commonjs/wordlists/wordlists.js +38 -0
- package/lib.commonjs/wordlists/wordlists.js.map +1 -0
- package/lib.esm/README.md +16 -0
- package/lib.esm/_version.d.ts +5 -0
- package/lib.esm/_version.d.ts.map +1 -0
- package/lib.esm/_version.js +6 -0
- package/lib.esm/_version.js.map +1 -0
- package/lib.esm/abi/abi-coder.d.ts +61 -0
- package/lib.esm/abi/abi-coder.d.ts.map +1 -0
- package/lib.esm/abi/abi-coder.js +206 -0
- package/lib.esm/abi/abi-coder.js.map +1 -0
- package/lib.esm/abi/bytes32.d.ts +15 -0
- package/lib.esm/abi/bytes32.d.ts.map +1 -0
- package/lib.esm/abi/bytes32.js +40 -0
- package/lib.esm/abi/bytes32.js.map +1 -0
- package/lib.esm/abi/coders/abstract-coder.d.ts +124 -0
- package/lib.esm/abi/coders/abstract-coder.d.ts.map +1 -0
- package/lib.esm/abi/coders/abstract-coder.js +466 -0
- package/lib.esm/abi/coders/abstract-coder.js.map +1 -0
- package/lib.esm/abi/coders/address.d.ts +13 -0
- package/lib.esm/abi/coders/address.d.ts.map +1 -0
- package/lib.esm/abi/coders/address.js +29 -0
- package/lib.esm/abi/coders/address.js.map +1 -0
- package/lib.esm/abi/coders/anonymous.d.ts +15 -0
- package/lib.esm/abi/coders/anonymous.d.ts.map +1 -0
- package/lib.esm/abi/coders/anonymous.js +23 -0
- package/lib.esm/abi/coders/anonymous.js.map +1 -0
- package/lib.esm/abi/coders/array.d.ts +25 -0
- package/lib.esm/abi/coders/array.d.ts.map +1 -0
- package/lib.esm/abi/coders/array.js +159 -0
- package/lib.esm/abi/coders/array.js.map +1 -0
- package/lib.esm/abi/coders/boolean.d.ts +13 -0
- package/lib.esm/abi/coders/boolean.d.ts.map +1 -0
- package/lib.esm/abi/coders/boolean.js +21 -0
- package/lib.esm/abi/coders/boolean.js.map +1 -0
- package/lib.esm/abi/coders/bytes.d.ts +19 -0
- package/lib.esm/abi/coders/bytes.d.ts.map +1 -0
- package/lib.esm/abi/coders/bytes.js +34 -0
- package/lib.esm/abi/coders/bytes.js.map +1 -0
- package/lib.esm/abi/coders/fixed-bytes.d.ts +15 -0
- package/lib.esm/abi/coders/fixed-bytes.d.ts.map +1 -0
- package/lib.esm/abi/coders/fixed-bytes.js +28 -0
- package/lib.esm/abi/coders/fixed-bytes.js.map +1 -0
- package/lib.esm/abi/coders/null.d.ts +12 -0
- package/lib.esm/abi/coders/null.d.ts.map +1 -0
- package/lib.esm/abi/coders/null.js +24 -0
- package/lib.esm/abi/coders/null.js.map +1 -0
- package/lib.esm/abi/coders/number.d.ts +16 -0
- package/lib.esm/abi/coders/number.d.ts.map +1 -0
- package/lib.esm/abi/coders/number.js +45 -0
- package/lib.esm/abi/coders/number.js.map +1 -0
- package/lib.esm/abi/coders/string.d.ts +13 -0
- package/lib.esm/abi/coders/string.d.ts.map +1 -0
- package/lib.esm/abi/coders/string.js +21 -0
- package/lib.esm/abi/coders/string.js.map +1 -0
- package/lib.esm/abi/coders/tuple.d.ts +16 -0
- package/lib.esm/abi/coders/tuple.d.ts.map +1 -0
- package/lib.esm/abi/coders/tuple.js +63 -0
- package/lib.esm/abi/coders/tuple.js.map +1 -0
- package/lib.esm/abi/fragments.d.ts +466 -0
- package/lib.esm/abi/fragments.d.ts.map +1 -0
- package/lib.esm/abi/fragments.js +1319 -0
- package/lib.esm/abi/fragments.js.map +1 -0
- package/lib.esm/abi/index.d.ts +18 -0
- package/lib.esm/abi/index.d.ts.map +1 -0
- package/lib.esm/abi/index.js +17 -0
- package/lib.esm/abi/index.js.map +1 -0
- package/lib.esm/abi/interface.d.ts +382 -0
- package/lib.esm/abi/interface.d.ts.map +1 -0
- package/lib.esm/abi/interface.js +1101 -0
- package/lib.esm/abi/interface.js.map +1 -0
- package/lib.esm/abi/typed.d.ts +570 -0
- package/lib.esm/abi/typed.d.ts.map +1 -0
- package/lib.esm/abi/typed.js +602 -0
- package/lib.esm/abi/typed.js.map +1 -0
- package/lib.esm/address/address.d.ts +56 -0
- package/lib.esm/address/address.d.ts.map +1 -0
- package/lib.esm/address/address.js +156 -0
- package/lib.esm/address/address.js.map +1 -0
- package/lib.esm/address/checks.d.ts +81 -0
- package/lib.esm/address/checks.d.ts.map +1 -0
- package/lib.esm/address/checks.js +114 -0
- package/lib.esm/address/checks.js.map +1 -0
- package/lib.esm/address/contract-address.d.ts +48 -0
- package/lib.esm/address/contract-address.d.ts.map +1 -0
- package/lib.esm/address/contract-address.js +69 -0
- package/lib.esm/address/contract-address.js.map +1 -0
- package/lib.esm/address/index.d.ts +49 -0
- package/lib.esm/address/index.d.ts.map +1 -0
- package/lib.esm/address/index.js +19 -0
- package/lib.esm/address/index.js.map +1 -0
- package/lib.esm/constants/addresses.d.ts +7 -0
- package/lib.esm/constants/addresses.d.ts.map +1 -0
- package/lib.esm/constants/addresses.js +7 -0
- package/lib.esm/constants/addresses.js.map +1 -0
- package/lib.esm/constants/hashes.d.ts +7 -0
- package/lib.esm/constants/hashes.d.ts.map +1 -0
- package/lib.esm/constants/hashes.js +7 -0
- package/lib.esm/constants/hashes.js.map +1 -0
- package/lib.esm/constants/index.d.ts +10 -0
- package/lib.esm/constants/index.d.ts.map +1 -0
- package/lib.esm/constants/index.js +10 -0
- package/lib.esm/constants/index.js.map +1 -0
- package/lib.esm/constants/numbers.d.ts +31 -0
- package/lib.esm/constants/numbers.d.ts.map +1 -0
- package/lib.esm/constants/numbers.js +31 -0
- package/lib.esm/constants/numbers.js.map +1 -0
- package/lib.esm/constants/strings.d.ts +13 -0
- package/lib.esm/constants/strings.d.ts.map +1 -0
- package/lib.esm/constants/strings.js +14 -0
- package/lib.esm/constants/strings.js.map +1 -0
- package/lib.esm/contract/contract.d.ts +168 -0
- package/lib.esm/contract/contract.d.ts.map +1 -0
- package/lib.esm/contract/contract.js +953 -0
- package/lib.esm/contract/contract.js.map +1 -0
- package/lib.esm/contract/factory.d.ts +62 -0
- package/lib.esm/contract/factory.d.ts.map +1 -0
- package/lib.esm/contract/factory.js +112 -0
- package/lib.esm/contract/factory.js.map +1 -0
- package/lib.esm/contract/index.d.ts +13 -0
- package/lib.esm/contract/index.d.ts.map +1 -0
- package/lib.esm/contract/index.js +12 -0
- package/lib.esm/contract/index.js.map +1 -0
- package/lib.esm/contract/types.d.ts +193 -0
- package/lib.esm/contract/types.d.ts.map +1 -0
- package/lib.esm/contract/types.js +5 -0
- package/lib.esm/contract/types.js.map +1 -0
- package/lib.esm/contract/wrappers.d.ts +143 -0
- package/lib.esm/contract/wrappers.d.ts.map +1 -0
- package/lib.esm/contract/wrappers.js +177 -0
- package/lib.esm/contract/wrappers.js.map +1 -0
- package/lib.esm/crypto/crypto-browser.d.ts +15 -0
- package/lib.esm/crypto/crypto-browser.d.ts.map +1 -0
- package/lib.esm/crypto/crypto-browser.js +48 -0
- package/lib.esm/crypto/crypto-browser.js.map +1 -0
- package/lib.esm/crypto/crypto.d.ts +2 -0
- package/lib.esm/crypto/crypto.d.ts.map +1 -0
- package/lib.esm/crypto/crypto.js +2 -0
- package/lib.esm/crypto/crypto.js.map +1 -0
- package/lib.esm/crypto/hmac.d.ts +25 -0
- package/lib.esm/crypto/hmac.d.ts.map +1 -0
- package/lib.esm/crypto/hmac.js +47 -0
- package/lib.esm/crypto/hmac.js.map +1 -0
- package/lib.esm/crypto/index.d.ts +25 -0
- package/lib.esm/crypto/index.d.ts.map +1 -0
- package/lib.esm/crypto/index.js +36 -0
- package/lib.esm/crypto/index.js.map +1 -0
- package/lib.esm/crypto/keccak.d.ts +35 -0
- package/lib.esm/crypto/keccak.d.ts.map +1 -0
- package/lib.esm/crypto/keccak.js +48 -0
- package/lib.esm/crypto/keccak.js.map +1 -0
- package/lib.esm/crypto/pbkdf2.d.ts +35 -0
- package/lib.esm/crypto/pbkdf2.d.ts.map +1 -0
- package/lib.esm/crypto/pbkdf2.js +49 -0
- package/lib.esm/crypto/pbkdf2.js.map +1 -0
- package/lib.esm/crypto/random.d.ts +14 -0
- package/lib.esm/crypto/random.d.ts.map +1 -0
- package/lib.esm/crypto/random.js +34 -0
- package/lib.esm/crypto/random.js.map +1 -0
- package/lib.esm/crypto/ripemd160.d.ts +25 -0
- package/lib.esm/crypto/ripemd160.d.ts.map +1 -0
- package/lib.esm/crypto/ripemd160.js +38 -0
- package/lib.esm/crypto/ripemd160.js.map +1 -0
- package/lib.esm/crypto/scrypt.d.ts +82 -0
- package/lib.esm/crypto/scrypt.d.ts.map +1 -0
- package/lib.esm/crypto/scrypt.js +99 -0
- package/lib.esm/crypto/scrypt.js.map +1 -0
- package/lib.esm/crypto/sha2.d.ts +47 -0
- package/lib.esm/crypto/sha2.d.ts.map +1 -0
- package/lib.esm/crypto/sha2.js +71 -0
- package/lib.esm/crypto/sha2.js.map +1 -0
- package/lib.esm/crypto/signature.d.ts +183 -0
- package/lib.esm/crypto/signature.d.ts.map +1 -0
- package/lib.esm/crypto/signature.js +346 -0
- package/lib.esm/crypto/signature.js.map +1 -0
- package/lib.esm/crypto/signing-key.d.ts +122 -0
- package/lib.esm/crypto/signing-key.d.ts.map +1 -0
- package/lib.esm/crypto/signing-key.js +166 -0
- package/lib.esm/crypto/signing-key.js.map +1 -0
- package/lib.esm/ethers.d.ts +22 -0
- package/lib.esm/ethers.d.ts.map +1 -0
- package/lib.esm/ethers.js +16 -0
- package/lib.esm/ethers.js.map +1 -0
- package/lib.esm/hash/authorization.d.ts +18 -0
- package/lib.esm/hash/authorization.d.ts.map +1 -0
- package/lib.esm/hash/authorization.js +25 -0
- package/lib.esm/hash/authorization.js.map +1 -0
- package/lib.esm/hash/id.d.ts +13 -0
- package/lib.esm/hash/id.d.ts.map +1 -0
- package/lib.esm/hash/id.js +17 -0
- package/lib.esm/hash/id.js.map +1 -0
- package/lib.esm/hash/index.d.ts +15 -0
- package/lib.esm/hash/index.d.ts.map +1 -0
- package/lib.esm/hash/index.js +13 -0
- package/lib.esm/hash/index.js.map +1 -0
- package/lib.esm/hash/message.d.ts +36 -0
- package/lib.esm/hash/message.d.ts.map +1 -0
- package/lib.esm/hash/message.js +51 -0
- package/lib.esm/hash/message.js.map +1 -0
- package/lib.esm/hash/namehash.d.ts +20 -0
- package/lib.esm/hash/namehash.d.ts.map +1 -0
- package/lib.esm/hash/namehash.js +84 -0
- package/lib.esm/hash/namehash.js.map +1 -0
- package/lib.esm/hash/solidity.d.ts +31 -0
- package/lib.esm/hash/solidity.d.ts.map +1 -0
- package/lib.esm/hash/solidity.js +103 -0
- package/lib.esm/hash/solidity.js.map +1 -0
- package/lib.esm/hash/typed-data.d.ts +150 -0
- package/lib.esm/hash/typed-data.d.ts.map +1 -0
- package/lib.esm/hash/typed-data.js +519 -0
- package/lib.esm/hash/typed-data.js.map +1 -0
- package/lib.esm/index.d.ts +11 -0
- package/lib.esm/index.d.ts.map +1 -0
- package/lib.esm/index.js +11 -0
- package/lib.esm/index.js.map +1 -0
- package/lib.esm/package.json +12 -0
- package/lib.esm/providers/abstract-provider.d.ts +451 -0
- package/lib.esm/providers/abstract-provider.d.ts.map +1 -0
- package/lib.esm/providers/abstract-provider.js +1404 -0
- package/lib.esm/providers/abstract-provider.js.map +1 -0
- package/lib.esm/providers/abstract-signer.d.ts +69 -0
- package/lib.esm/providers/abstract-signer.d.ts.map +1 -0
- package/lib.esm/providers/abstract-signer.js +244 -0
- package/lib.esm/providers/abstract-signer.js.map +1 -0
- package/lib.esm/providers/community.d.ts +29 -0
- package/lib.esm/providers/community.d.ts.map +1 -0
- package/lib.esm/providers/community.js +36 -0
- package/lib.esm/providers/community.js.map +1 -0
- package/lib.esm/providers/contracts.d.ts +36 -0
- package/lib.esm/providers/contracts.d.ts.map +1 -0
- package/lib.esm/providers/contracts.js +2 -0
- package/lib.esm/providers/contracts.js.map +1 -0
- package/lib.esm/providers/default-provider.d.ts +49 -0
- package/lib.esm/providers/default-provider.d.ts.map +1 -0
- package/lib.esm/providers/default-provider.js +196 -0
- package/lib.esm/providers/default-provider.js.map +1 -0
- package/lib.esm/providers/ens-resolver.d.ts +147 -0
- package/lib.esm/providers/ens-resolver.d.ts.map +1 -0
- package/lib.esm/providers/ens-resolver.js +496 -0
- package/lib.esm/providers/ens-resolver.js.map +1 -0
- package/lib.esm/providers/format.d.ts +15 -0
- package/lib.esm/providers/format.d.ts.map +1 -0
- package/lib.esm/providers/format.js +297 -0
- package/lib.esm/providers/format.js.map +1 -0
- package/lib.esm/providers/formatting.d.ts +318 -0
- package/lib.esm/providers/formatting.d.ts.map +1 -0
- package/lib.esm/providers/formatting.js +9 -0
- package/lib.esm/providers/formatting.js.map +1 -0
- package/lib.esm/providers/index.d.ts +50 -0
- package/lib.esm/providers/index.d.ts.map +1 -0
- package/lib.esm/providers/index.js +40 -0
- package/lib.esm/providers/index.js.map +1 -0
- package/lib.esm/providers/network.d.ts +99 -0
- package/lib.esm/providers/network.d.ts.map +1 -0
- package/lib.esm/providers/network.js +365 -0
- package/lib.esm/providers/network.js.map +1 -0
- package/lib.esm/providers/pagination.d.ts +6 -0
- package/lib.esm/providers/pagination.d.ts.map +1 -0
- package/lib.esm/providers/pagination.js +2 -0
- package/lib.esm/providers/pagination.js.map +1 -0
- package/lib.esm/providers/plugin-fallback.d.ts +13 -0
- package/lib.esm/providers/plugin-fallback.d.ts.map +1 -0
- package/lib.esm/providers/plugin-fallback.js +26 -0
- package/lib.esm/providers/plugin-fallback.js.map +1 -0
- package/lib.esm/providers/plugins-network.d.ts +170 -0
- package/lib.esm/providers/plugins-network.d.ts.map +1 -0
- package/lib.esm/providers/plugins-network.js +208 -0
- package/lib.esm/providers/plugins-network.js.map +1 -0
- package/lib.esm/providers/provider-alchemy.d.ts +50 -0
- package/lib.esm/providers/provider-alchemy.d.ts.map +1 -0
- package/lib.esm/providers/provider-alchemy.js +147 -0
- package/lib.esm/providers/provider-alchemy.js.map +1 -0
- package/lib.esm/providers/provider-ankr.d.ts +63 -0
- package/lib.esm/providers/provider-ankr.d.ts.map +1 -0
- package/lib.esm/providers/provider-ankr.js +139 -0
- package/lib.esm/providers/provider-ankr.js.map +1 -0
- package/lib.esm/providers/provider-blockscout.d.ts +59 -0
- package/lib.esm/providers/provider-blockscout.d.ts.map +1 -0
- package/lib.esm/providers/provider-blockscout.js +141 -0
- package/lib.esm/providers/provider-blockscout.js.map +1 -0
- package/lib.esm/providers/provider-browser.d.ts +108 -0
- package/lib.esm/providers/provider-browser.d.ts.map +1 -0
- package/lib.esm/providers/provider-browser.js +200 -0
- package/lib.esm/providers/provider-browser.js.map +1 -0
- package/lib.esm/providers/provider-chainstack.d.ts +46 -0
- package/lib.esm/providers/provider-chainstack.d.ts.map +1 -0
- package/lib.esm/providers/provider-chainstack.js +98 -0
- package/lib.esm/providers/provider-chainstack.js.map +1 -0
- package/lib.esm/providers/provider-cloudflare.d.ts +14 -0
- package/lib.esm/providers/provider-cloudflare.d.ts.map +1 -0
- package/lib.esm/providers/provider-cloudflare.js +22 -0
- package/lib.esm/providers/provider-cloudflare.js.map +1 -0
- package/lib.esm/providers/provider-etherscan.d.ts +152 -0
- package/lib.esm/providers/provider-etherscan.d.ts.map +1 -0
- package/lib.esm/providers/provider-etherscan.js +598 -0
- package/lib.esm/providers/provider-etherscan.js.map +1 -0
- package/lib.esm/providers/provider-fallback.d.ts +115 -0
- package/lib.esm/providers/provider-fallback.d.ts.map +1 -0
- package/lib.esm/providers/provider-fallback.js +620 -0
- package/lib.esm/providers/provider-fallback.js.map +1 -0
- package/lib.esm/providers/provider-infura.d.ts +101 -0
- package/lib.esm/providers/provider-infura.d.ts.map +1 -0
- package/lib.esm/providers/provider-infura.js +201 -0
- package/lib.esm/providers/provider-infura.js.map +1 -0
- package/lib.esm/providers/provider-ipcsocket-browser.d.ts +3 -0
- package/lib.esm/providers/provider-ipcsocket-browser.d.ts.map +1 -0
- package/lib.esm/providers/provider-ipcsocket-browser.js +3 -0
- package/lib.esm/providers/provider-ipcsocket-browser.js.map +1 -0
- package/lib.esm/providers/provider-ipcsocket.d.ts +21 -0
- package/lib.esm/providers/provider-ipcsocket.d.ts.map +1 -0
- package/lib.esm/providers/provider-ipcsocket.js +68 -0
- package/lib.esm/providers/provider-ipcsocket.js.map +1 -0
- package/lib.esm/providers/provider-jsonrpc.d.ts +361 -0
- package/lib.esm/providers/provider-jsonrpc.d.ts.map +1 -0
- package/lib.esm/providers/provider-jsonrpc.js +973 -0
- package/lib.esm/providers/provider-jsonrpc.js.map +1 -0
- package/lib.esm/providers/provider-pocket.d.ts +54 -0
- package/lib.esm/providers/provider-pocket.d.ts.map +1 -0
- package/lib.esm/providers/provider-pocket.js +105 -0
- package/lib.esm/providers/provider-pocket.js.map +1 -0
- package/lib.esm/providers/provider-quicknode.d.ts +59 -0
- package/lib.esm/providers/provider-quicknode.d.ts.map +1 -0
- package/lib.esm/providers/provider-quicknode.js +159 -0
- package/lib.esm/providers/provider-quicknode.js.map +1 -0
- package/lib.esm/providers/provider-socket.d.ts +113 -0
- package/lib.esm/providers/provider-socket.d.ts.map +1 -0
- package/lib.esm/providers/provider-socket.js +301 -0
- package/lib.esm/providers/provider-socket.js.map +1 -0
- package/lib.esm/providers/provider-websocket.d.ts +37 -0
- package/lib.esm/providers/provider-websocket.d.ts.map +1 -0
- package/lib.esm/providers/provider-websocket.js +76 -0
- package/lib.esm/providers/provider-websocket.js.map +1 -0
- package/lib.esm/providers/provider.d.ts +1230 -0
- package/lib.esm/providers/provider.d.ts.map +1 -0
- package/lib.esm/providers/provider.js +1315 -0
- package/lib.esm/providers/provider.js.map +1 -0
- package/lib.esm/providers/signer-noncemanager.d.ts +38 -0
- package/lib.esm/providers/signer-noncemanager.d.ts.map +1 -0
- package/lib.esm/providers/signer-noncemanager.js +74 -0
- package/lib.esm/providers/signer-noncemanager.js.map +1 -0
- package/lib.esm/providers/signer.d.ts +131 -0
- package/lib.esm/providers/signer.d.ts.map +1 -0
- package/lib.esm/providers/signer.js +2 -0
- package/lib.esm/providers/signer.js.map +1 -0
- package/lib.esm/providers/subscriber-connection.d.ts +25 -0
- package/lib.esm/providers/subscriber-connection.d.ts.map +1 -0
- package/lib.esm/providers/subscriber-connection.js +52 -0
- package/lib.esm/providers/subscriber-connection.js.map +1 -0
- package/lib.esm/providers/subscriber-filterid.d.ts +64 -0
- package/lib.esm/providers/subscriber-filterid.d.ts.map +1 -0
- package/lib.esm/providers/subscriber-filterid.js +174 -0
- package/lib.esm/providers/subscriber-filterid.js.map +1 -0
- package/lib.esm/providers/subscriber-polling.d.ts +100 -0
- package/lib.esm/providers/subscriber-polling.d.ts.map +1 -0
- package/lib.esm/providers/subscriber-polling.js +293 -0
- package/lib.esm/providers/subscriber-polling.js.map +1 -0
- package/lib.esm/providers/ws-browser.d.ts +3 -0
- package/lib.esm/providers/ws-browser.d.ts.map +1 -0
- package/lib.esm/providers/ws-browser.js +16 -0
- package/lib.esm/providers/ws-browser.js.map +1 -0
- package/lib.esm/providers/ws.d.ts +2 -0
- package/lib.esm/providers/ws.d.ts.map +1 -0
- package/lib.esm/providers/ws.js +2 -0
- package/lib.esm/providers/ws.js.map +1 -0
- package/lib.esm/transaction/accesslist.d.ts +6 -0
- package/lib.esm/transaction/accesslist.d.ts.map +1 -0
- package/lib.esm/transaction/accesslist.js +37 -0
- package/lib.esm/transaction/accesslist.js.map +1 -0
- package/lib.esm/transaction/address.d.ts +15 -0
- package/lib.esm/transaction/address.d.ts.map +1 -0
- package/lib.esm/transaction/address.js +25 -0
- package/lib.esm/transaction/address.js.map +1 -0
- package/lib.esm/transaction/authorization.d.ts +3 -0
- package/lib.esm/transaction/authorization.d.ts.map +1 -0
- package/lib.esm/transaction/authorization.js +12 -0
- package/lib.esm/transaction/authorization.js.map +1 -0
- package/lib.esm/transaction/index.d.ts +40 -0
- package/lib.esm/transaction/index.d.ts.map +1 -0
- package/lib.esm/transaction/index.js +11 -0
- package/lib.esm/transaction/index.js.map +1 -0
- package/lib.esm/transaction/transaction.d.ts +430 -0
- package/lib.esm/transaction/transaction.d.ts.map +1 -0
- package/lib.esm/transaction/transaction.js +1288 -0
- package/lib.esm/transaction/transaction.js.map +1 -0
- package/lib.esm/utils/base58.d.ts +23 -0
- package/lib.esm/utils/base58.d.ts.map +1 -0
- package/lib.esm/utils/base58.js +63 -0
- package/lib.esm/utils/base58.js.map +1 -0
- package/lib.esm/utils/base64-browser.d.ts +4 -0
- package/lib.esm/utils/base64-browser.d.ts.map +1 -0
- package/lib.esm/utils/base64-browser.js +19 -0
- package/lib.esm/utils/base64-browser.js.map +1 -0
- package/lib.esm/utils/base64.d.ts +40 -0
- package/lib.esm/utils/base64.d.ts.map +1 -0
- package/lib.esm/utils/base64.js +53 -0
- package/lib.esm/utils/base64.js.map +1 -0
- package/lib.esm/utils/data.d.ts +93 -0
- package/lib.esm/utils/data.d.ts.map +1 -0
- package/lib.esm/utils/data.js +171 -0
- package/lib.esm/utils/data.js.map +1 -0
- package/lib.esm/utils/errors.d.ts +512 -0
- package/lib.esm/utils/errors.d.ts.map +1 -0
- package/lib.esm/utils/errors.js +232 -0
- package/lib.esm/utils/errors.js.map +1 -0
- package/lib.esm/utils/events.d.ts +77 -0
- package/lib.esm/utils/events.d.ts.map +1 -0
- package/lib.esm/utils/events.js +42 -0
- package/lib.esm/utils/events.js.map +1 -0
- package/lib.esm/utils/fetch.d.ts +363 -0
- package/lib.esm/utils/fetch.d.ts.map +1 -0
- package/lib.esm/utils/fetch.js +852 -0
- package/lib.esm/utils/fetch.js.map +1 -0
- package/lib.esm/utils/fixednumber.d.ts +252 -0
- package/lib.esm/utils/fixednumber.d.ts.map +1 -0
- package/lib.esm/utils/fixednumber.js +526 -0
- package/lib.esm/utils/fixednumber.js.map +1 -0
- package/lib.esm/utils/geturl-browser.d.ts +4 -0
- package/lib.esm/utils/geturl-browser.d.ts.map +1 -0
- package/lib.esm/utils/geturl-browser.js +62 -0
- package/lib.esm/utils/geturl-browser.js.map +1 -0
- package/lib.esm/utils/geturl.d.ts +10 -0
- package/lib.esm/utils/geturl.d.ts.map +1 -0
- package/lib.esm/utils/geturl.js +121 -0
- package/lib.esm/utils/geturl.js.map +1 -0
- package/lib.esm/utils/index.d.ts +30 -0
- package/lib.esm/utils/index.d.ts.map +1 -0
- package/lib.esm/utils/index.js +22 -0
- package/lib.esm/utils/index.js.map +1 -0
- package/lib.esm/utils/maths.d.ts +66 -0
- package/lib.esm/utils/maths.d.ts.map +1 -0
- package/lib.esm/utils/maths.js +231 -0
- package/lib.esm/utils/maths.js.map +1 -0
- package/lib.esm/utils/properties.d.ts +23 -0
- package/lib.esm/utils/properties.d.ts.map +1 -0
- package/lib.esm/utils/properties.js +54 -0
- package/lib.esm/utils/properties.js.map +1 -0
- package/lib.esm/utils/rlp-decode.d.ts +6 -0
- package/lib.esm/utils/rlp-decode.d.ts.map +1 -0
- package/lib.esm/utils/rlp-decode.js +79 -0
- package/lib.esm/utils/rlp-decode.js.map +1 -0
- package/lib.esm/utils/rlp-encode.d.ts +6 -0
- package/lib.esm/utils/rlp-encode.d.ts.map +1 -0
- package/lib.esm/utils/rlp-encode.js +49 -0
- package/lib.esm/utils/rlp-encode.js.map +1 -0
- package/lib.esm/utils/rlp.d.ts +17 -0
- package/lib.esm/utils/rlp.d.ts.map +1 -0
- package/lib.esm/utils/rlp.js +9 -0
- package/lib.esm/utils/rlp.js.map +1 -0
- package/lib.esm/utils/units.d.ts +24 -0
- package/lib.esm/utils/units.d.ts.map +1 -0
- package/lib.esm/utils/units.js +83 -0
- package/lib.esm/utils/units.js.map +1 -0
- package/lib.esm/utils/utf8.d.ts +96 -0
- package/lib.esm/utils/utf8.d.ts.map +1 -0
- package/lib.esm/utils/utf8.js +221 -0
- package/lib.esm/utils/utf8.js.map +1 -0
- package/lib.esm/utils/uuid.d.ts +8 -0
- package/lib.esm/utils/uuid.d.ts.map +1 -0
- package/lib.esm/utils/uuid.js +30 -0
- package/lib.esm/utils/uuid.js.map +1 -0
- package/lib.esm/wallet/base-wallet.d.ts +57 -0
- package/lib.esm/wallet/base-wallet.d.ts.map +1 -0
- package/lib.esm/wallet/base-wallet.js +123 -0
- package/lib.esm/wallet/base-wallet.js.map +1 -0
- package/lib.esm/wallet/hdwallet.d.ts +248 -0
- package/lib.esm/wallet/hdwallet.d.ts.map +1 -0
- package/lib.esm/wallet/hdwallet.js +499 -0
- package/lib.esm/wallet/hdwallet.js.map +1 -0
- package/lib.esm/wallet/index.d.ts +27 -0
- package/lib.esm/wallet/index.d.ts.map +1 -0
- package/lib.esm/wallet/index.js +25 -0
- package/lib.esm/wallet/index.js.map +1 -0
- package/lib.esm/wallet/json-crowdsale.d.ts +27 -0
- package/lib.esm/wallet/json-crowdsale.d.ts.map +1 -0
- package/lib.esm/wallet/json-crowdsale.js +55 -0
- package/lib.esm/wallet/json-crowdsale.js.map +1 -0
- package/lib.esm/wallet/json-keystore.d.ts +89 -0
- package/lib.esm/wallet/json-keystore.d.ts.map +1 -0
- package/lib.esm/wallet/json-keystore.js +287 -0
- package/lib.esm/wallet/json-keystore.js.map +1 -0
- package/lib.esm/wallet/mnemonic.d.ts +65 -0
- package/lib.esm/wallet/mnemonic.d.ts.map +1 -0
- package/lib.esm/wallet/mnemonic.js +165 -0
- package/lib.esm/wallet/mnemonic.js.map +1 -0
- package/lib.esm/wallet/utils.d.ts +8 -0
- package/lib.esm/wallet/utils.d.ts.map +1 -0
- package/lib.esm/wallet/utils.js +142 -0
- package/lib.esm/wallet/utils.js.map +1 -0
- package/lib.esm/wallet/wallet.d.ts +71 -0
- package/lib.esm/wallet/wallet.d.ts.map +1 -0
- package/lib.esm/wallet/wallet.js +144 -0
- package/lib.esm/wallet/wallet.js.map +1 -0
- package/lib.esm/wordlists/bit-reader.d.ts +5 -0
- package/lib.esm/wordlists/bit-reader.d.ts.map +1 -0
- package/lib.esm/wordlists/bit-reader.js +32 -0
- package/lib.esm/wordlists/bit-reader.js.map +1 -0
- package/lib.esm/wordlists/decode-owl.d.ts +9 -0
- package/lib.esm/wordlists/decode-owl.d.ts.map +1 -0
- package/lib.esm/wordlists/decode-owl.js +55 -0
- package/lib.esm/wordlists/decode-owl.js.map +1 -0
- package/lib.esm/wordlists/decode-owla.d.ts +5 -0
- package/lib.esm/wordlists/decode-owla.d.ts.map +1 -0
- package/lib.esm/wordlists/decode-owla.js +28 -0
- package/lib.esm/wordlists/decode-owla.js.map +1 -0
- package/lib.esm/wordlists/generation/encode-latin.d.ts +25 -0
- package/lib.esm/wordlists/generation/encode-latin.d.ts.map +1 -0
- package/lib.esm/wordlists/generation/encode-latin.js +344 -0
- package/lib.esm/wordlists/generation/encode-latin.js.map +1 -0
- package/lib.esm/wordlists/index.d.ts +25 -0
- package/lib.esm/wordlists/index.d.ts.map +1 -0
- package/lib.esm/wordlists/index.js +25 -0
- package/lib.esm/wordlists/index.js.map +1 -0
- package/lib.esm/wordlists/lang-cz.d.ts +23 -0
- package/lib.esm/wordlists/lang-cz.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-cz.js +31 -0
- package/lib.esm/wordlists/lang-cz.js.map +1 -0
- package/lib.esm/wordlists/lang-en.d.ts +23 -0
- package/lib.esm/wordlists/lang-en.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-en.js +31 -0
- package/lib.esm/wordlists/lang-en.js.map +1 -0
- package/lib.esm/wordlists/lang-es.d.ts +23 -0
- package/lib.esm/wordlists/lang-es.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-es.js +32 -0
- package/lib.esm/wordlists/lang-es.js.map +1 -0
- package/lib.esm/wordlists/lang-fr.d.ts +23 -0
- package/lib.esm/wordlists/lang-fr.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-fr.js +32 -0
- package/lib.esm/wordlists/lang-fr.js.map +1 -0
- package/lib.esm/wordlists/lang-it.d.ts +23 -0
- package/lib.esm/wordlists/lang-it.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-it.js +31 -0
- package/lib.esm/wordlists/lang-it.js.map +1 -0
- package/lib.esm/wordlists/lang-ja.d.ts +27 -0
- package/lib.esm/wordlists/lang-ja.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-ja.js +154 -0
- package/lib.esm/wordlists/lang-ja.js.map +1 -0
- package/lib.esm/wordlists/lang-ko.d.ts +25 -0
- package/lib.esm/wordlists/lang-ko.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-ko.js +89 -0
- package/lib.esm/wordlists/lang-ko.js.map +1 -0
- package/lib.esm/wordlists/lang-pt.d.ts +23 -0
- package/lib.esm/wordlists/lang-pt.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-pt.js +31 -0
- package/lib.esm/wordlists/lang-pt.js.map +1 -0
- package/lib.esm/wordlists/lang-zh.d.ts +32 -0
- package/lib.esm/wordlists/lang-zh.d.ts.map +1 -0
- package/lib.esm/wordlists/lang-zh.js +92 -0
- package/lib.esm/wordlists/lang-zh.js.map +1 -0
- package/lib.esm/wordlists/wordlist-owl.d.ts +32 -0
- package/lib.esm/wordlists/wordlist-owl.d.ts.map +1 -0
- package/lib.esm/wordlists/wordlist-owl.js +66 -0
- package/lib.esm/wordlists/wordlist-owl.js.map +1 -0
- package/lib.esm/wordlists/wordlist-owla.d.ts +30 -0
- package/lib.esm/wordlists/wordlist-owla.d.ts.map +1 -0
- package/lib.esm/wordlists/wordlist-owla.js +36 -0
- package/lib.esm/wordlists/wordlist-owla.js.map +1 -0
- package/lib.esm/wordlists/wordlist.d.ts +47 -0
- package/lib.esm/wordlists/wordlist.d.ts.map +1 -0
- package/lib.esm/wordlists/wordlist.js +42 -0
- package/lib.esm/wordlists/wordlist.js.map +1 -0
- package/lib.esm/wordlists/wordlists-browser.d.ts +3 -0
- package/lib.esm/wordlists/wordlists-browser.d.ts.map +1 -0
- package/lib.esm/wordlists/wordlists-browser.js +5 -0
- package/lib.esm/wordlists/wordlists-browser.js.map +1 -0
- package/lib.esm/wordlists/wordlists-extra.d.ts +9 -0
- package/lib.esm/wordlists/wordlists-extra.d.ts.map +1 -0
- package/lib.esm/wordlists/wordlists-extra.js +9 -0
- package/lib.esm/wordlists/wordlists-extra.js.map +1 -0
- package/lib.esm/wordlists/wordlists.d.ts +16 -0
- package/lib.esm/wordlists/wordlists.d.ts.map +1 -0
- package/lib.esm/wordlists/wordlists.js +35 -0
- package/lib.esm/wordlists/wordlists.js.map +1 -0
- package/package.json +135 -0
- package/rollup.config.mjs +50 -0
- package/src.ts/_version.ts +6 -0
- package/src.ts/abi/abi-coder.ts +237 -0
- package/src.ts/abi/bytes32.ts +45 -0
- package/src.ts/abi/coders/abstract-coder.ts +541 -0
- package/src.ts/abi/coders/address.ts +36 -0
- package/src.ts/abi/coders/anonymous.ts +29 -0
- package/src.ts/abi/coders/array.ts +199 -0
- package/src.ts/abi/coders/boolean.ts +27 -0
- package/src.ts/abi/coders/bytes.ts +43 -0
- package/src.ts/abi/coders/fixed-bytes.ts +37 -0
- package/src.ts/abi/coders/null.ts +28 -0
- package/src.ts/abi/coders/number.ts +63 -0
- package/src.ts/abi/coders/string.ts +29 -0
- package/src.ts/abi/coders/tuple.ts +69 -0
- package/src.ts/abi/fragments.ts +1617 -0
- package/src.ts/abi/index.ts +41 -0
- package/src.ts/abi/interface.ts +1271 -0
- package/src.ts/abi/typed.ts +796 -0
- package/src.ts/address/address.ts +173 -0
- package/src.ts/address/checks.ts +123 -0
- package/src.ts/address/contract-address.ts +80 -0
- package/src.ts/address/index.ts +57 -0
- package/src.ts/constants/addresses.ts +8 -0
- package/src.ts/constants/hashes.ts +7 -0
- package/src.ts/constants/index.ts +16 -0
- package/src.ts/constants/numbers.ts +35 -0
- package/src.ts/constants/strings.ts +16 -0
- package/src.ts/contract/contract.ts +1120 -0
- package/src.ts/contract/factory.ts +143 -0
- package/src.ts/contract/index.ts +31 -0
- package/src.ts/contract/types.ts +236 -0
- package/src.ts/contract/wrappers.ts +225 -0
- package/src.ts/crypto/crypto-browser.ts +64 -0
- package/src.ts/crypto/crypto.ts +4 -0
- package/src.ts/crypto/hmac.ts +51 -0
- package/src.ts/crypto/index.ts +59 -0
- package/src.ts/crypto/keccak.ts +54 -0
- package/src.ts/crypto/pbkdf2.ts +55 -0
- package/src.ts/crypto/random.ts +36 -0
- package/src.ts/crypto/ripemd160.ts +43 -0
- package/src.ts/crypto/scrypt.ts +114 -0
- package/src.ts/crypto/sha2.ts +78 -0
- package/src.ts/crypto/signature.ts +410 -0
- package/src.ts/crypto/signing-key.ts +196 -0
- package/src.ts/ethers.ts +221 -0
- package/src.ts/hash/authorization.ts +38 -0
- package/src.ts/hash/id.ts +17 -0
- package/src.ts/hash/index.ts +18 -0
- package/src.ts/hash/message.ts +51 -0
- package/src.ts/hash/namehash.ts +101 -0
- package/src.ts/hash/solidity.ts +117 -0
- package/src.ts/hash/typed-data.ts +658 -0
- package/src.ts/index.ts +12 -0
- package/src.ts/providers/abstract-provider.ts +1761 -0
- package/src.ts/providers/abstract-signer.ts +314 -0
- package/src.ts/providers/community.ts +49 -0
- package/src.ts/providers/contracts.ts +42 -0
- package/src.ts/providers/default-provider.ts +202 -0
- package/src.ts/providers/ens-resolver.ts +606 -0
- package/src.ts/providers/format.ts +335 -0
- package/src.ts/providers/formatting.ts +418 -0
- package/src.ts/providers/index.ts +135 -0
- package/src.ts/providers/network.ts +438 -0
- package/src.ts/providers/pagination.ts +8 -0
- package/src.ts/providers/plugin-fallback.ts +35 -0
- package/src.ts/providers/plugins-network.ts +281 -0
- package/src.ts/providers/provider-alchemy.ts +166 -0
- package/src.ts/providers/provider-ankr.ts +159 -0
- package/src.ts/providers/provider-blockscout.ts +167 -0
- package/src.ts/providers/provider-browser.ts +334 -0
- package/src.ts/providers/provider-chainstack.ts +113 -0
- package/src.ts/providers/provider-cloudflare.ts +24 -0
- package/src.ts/providers/provider-etherscan.ts +687 -0
- package/src.ts/providers/provider-fallback.ts +801 -0
- package/src.ts/providers/provider-infura.ts +220 -0
- package/src.ts/providers/provider-ipcsocket-browser.ts +3 -0
- package/src.ts/providers/provider-ipcsocket.ts +81 -0
- package/src.ts/providers/provider-jsonrpc.ts +1335 -0
- package/src.ts/providers/provider-pocket.ts +121 -0
- package/src.ts/providers/provider-quicknode.ts +177 -0
- package/src.ts/providers/provider-socket.ts +352 -0
- package/src.ts/providers/provider-websocket.ts +103 -0
- package/src.ts/providers/provider.ts +2146 -0
- package/src.ts/providers/signer-noncemanager.ts +98 -0
- package/src.ts/providers/signer.ts +166 -0
- package/src.ts/providers/subscriber-connection.ts +74 -0
- package/src.ts/providers/subscriber-filterid.ts +199 -0
- package/src.ts/providers/subscriber-polling.ts +321 -0
- package/src.ts/providers/ws-browser.ts +11 -0
- package/src.ts/providers/ws.ts +3 -0
- package/src.ts/thirdparty.d.ts +16 -0
- package/src.ts/transaction/accesslist.ts +43 -0
- package/src.ts/transaction/address.ts +28 -0
- package/src.ts/transaction/authorization.ts +14 -0
- package/src.ts/transaction/index.ts +51 -0
- package/src.ts/transaction/transaction.ts +1556 -0
- package/src.ts/utils/base58.ts +73 -0
- package/src.ts/utils/base64-browser.ts +25 -0
- package/src.ts/utils/base64.ts +56 -0
- package/src.ts/utils/data.ts +200 -0
- package/src.ts/utils/errors.ts +797 -0
- package/src.ts/utils/events.ts +105 -0
- package/src.ts/utils/fetch.ts +970 -0
- package/src.ts/utils/fixednumber.ts +643 -0
- package/src.ts/utils/geturl-browser.ts +81 -0
- package/src.ts/utils/geturl.ts +141 -0
- package/src.ts/utils/index.ts +95 -0
- package/src.ts/utils/maths.ts +259 -0
- package/src.ts/utils/properties.ts +60 -0
- package/src.ts/utils/rlp-decode.ts +104 -0
- package/src.ts/utils/rlp-encode.ts +64 -0
- package/src.ts/utils/rlp.ts +20 -0
- package/src.ts/utils/test.txt +0 -0
- package/src.ts/utils/units.ts +91 -0
- package/src.ts/utils/utf8.ts +325 -0
- package/src.ts/utils/uuid.ts +36 -0
- package/src.ts/wallet/base-wallet.ts +160 -0
- package/src.ts/wallet/hdwallet.ts +586 -0
- package/src.ts/wallet/index.ts +47 -0
- package/src.ts/wallet/json-crowdsale.ts +74 -0
- package/src.ts/wallet/json-keystore.ts +389 -0
- package/src.ts/wallet/mnemonic.ts +203 -0
- package/src.ts/wallet/utils.ts +147 -0
- package/src.ts/wallet/wallet.ts +165 -0
- package/src.ts/wordlists/bit-reader.ts +35 -0
- package/src.ts/wordlists/decode-owl.ts +58 -0
- package/src.ts/wordlists/decode-owla.ts +33 -0
- package/src.ts/wordlists/generation/encode-latin.ts +370 -0
- package/src.ts/wordlists/index.ts +26 -0
- package/src.ts/wordlists/lang-cz.ts +33 -0
- package/src.ts/wordlists/lang-en.ts +33 -0
- package/src.ts/wordlists/lang-es.ts +35 -0
- package/src.ts/wordlists/lang-fr.ts +34 -0
- package/src.ts/wordlists/lang-it.ts +33 -0
- package/src.ts/wordlists/lang-ja.ts +181 -0
- package/src.ts/wordlists/lang-ko.ts +104 -0
- package/src.ts/wordlists/lang-pt.ts +34 -0
- package/src.ts/wordlists/lang-zh.ts +112 -0
- package/src.ts/wordlists/wordlist-owl.ts +77 -0
- package/src.ts/wordlists/wordlist-owla.ts +41 -0
- package/src.ts/wordlists/wordlist.ts +59 -0
- package/src.ts/wordlists/wordlists-browser.ts +8 -0
- package/src.ts/wordlists/wordlists-extra.ts +9 -0
- package/src.ts/wordlists/wordlists.ts +38 -0
|
@@ -0,0 +1,1556 @@
|
|
|
1
|
+
|
|
2
|
+
import { getAddress } from "../address/index.js";
|
|
3
|
+
import { ZeroAddress } from "../constants/addresses.js";
|
|
4
|
+
import {
|
|
5
|
+
keccak256, sha256, Signature, SigningKey
|
|
6
|
+
} from "../crypto/index.js";
|
|
7
|
+
import {
|
|
8
|
+
concat, decodeRlp, encodeRlp, getBytes, getBigInt, getNumber, hexlify,
|
|
9
|
+
assert, assertArgument, isBytesLike, isHexString, toBeArray, zeroPadValue
|
|
10
|
+
} from "../utils/index.js";
|
|
11
|
+
|
|
12
|
+
import { accessListify } from "./accesslist.js";
|
|
13
|
+
import { authorizationify } from "./authorization.js";
|
|
14
|
+
import { recoverAddress } from "./address.js";
|
|
15
|
+
|
|
16
|
+
import type { BigNumberish, BytesLike } from "../utils/index.js";
|
|
17
|
+
import type { SignatureLike } from "../crypto/index.js";
|
|
18
|
+
|
|
19
|
+
import type {
|
|
20
|
+
AccessList, AccessListish, Authorization, AuthorizationLike
|
|
21
|
+
} from "./index.js";
|
|
22
|
+
|
|
23
|
+
const BN_0 = BigInt(0);
|
|
24
|
+
const BN_2 = BigInt(2);
|
|
25
|
+
const BN_27 = BigInt(27)
|
|
26
|
+
const BN_28 = BigInt(28)
|
|
27
|
+
const BN_35 = BigInt(35);
|
|
28
|
+
const BN_MAX_UINT = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
|
29
|
+
|
|
30
|
+
const inspect = Symbol.for("nodejs.util.inspect.custom");
|
|
31
|
+
|
|
32
|
+
const BLOB_SIZE = 4096 * 32;
|
|
33
|
+
const CELL_COUNT = 128;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb.
|
|
38
|
+
*
|
|
39
|
+
* The default %%cellCount%% is 128.
|
|
40
|
+
*/
|
|
41
|
+
export function splitBlobCells(_proof: BytesLike, cellCount?: number): Array<string> {
|
|
42
|
+
if (cellCount == null) { cellCount = CELL_COUNT; }
|
|
43
|
+
|
|
44
|
+
const cellProofs: Array<string> = [ ];
|
|
45
|
+
const proof = getBytes(_proof);
|
|
46
|
+
|
|
47
|
+
const cellSize = proof.length / cellCount;
|
|
48
|
+
for (let i = 0; i < proof.length; i += cellSize) {
|
|
49
|
+
cellProofs.push(hexlify(proof.subarray(i, i + cellSize)));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return cellProofs;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// The BLS Modulo; each field within a BLOb must be less than this
|
|
56
|
+
//const BLOB_BLS_MODULO = BigInt("0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001");
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A **TransactionLike** is an object which is appropriate as a loose
|
|
60
|
+
* input for many operations which will populate missing properties of
|
|
61
|
+
* a transaction.
|
|
62
|
+
*/
|
|
63
|
+
export interface TransactionLike<A = string> {
|
|
64
|
+
/**
|
|
65
|
+
* The type.
|
|
66
|
+
*/
|
|
67
|
+
type?: null | number;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The recipient address or ``null`` for an ``init`` transaction.
|
|
71
|
+
*/
|
|
72
|
+
to?: null | A;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The sender.
|
|
76
|
+
*/
|
|
77
|
+
from?: null | A;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The nonce.
|
|
81
|
+
*/
|
|
82
|
+
nonce?: null | number;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The maximum amount of gas that can be used.
|
|
86
|
+
*/
|
|
87
|
+
gasLimit?: null | BigNumberish;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The gas price for legacy and berlin transactions.
|
|
91
|
+
*/
|
|
92
|
+
gasPrice?: null | BigNumberish;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The maximum priority fee per gas for london transactions.
|
|
96
|
+
*/
|
|
97
|
+
maxPriorityFeePerGas?: null | BigNumberish;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The maximum total fee per gas for london transactions.
|
|
101
|
+
*/
|
|
102
|
+
maxFeePerGas?: null | BigNumberish;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The data.
|
|
106
|
+
*/
|
|
107
|
+
data?: null | string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The value (in wei) to send.
|
|
111
|
+
*/
|
|
112
|
+
value?: null | BigNumberish;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The chain ID the transaction is valid on.
|
|
116
|
+
*/
|
|
117
|
+
chainId?: null | BigNumberish;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The transaction hash.
|
|
121
|
+
*/
|
|
122
|
+
hash?: null | string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The signature provided by the sender.
|
|
126
|
+
*/
|
|
127
|
+
signature?: null | SignatureLike;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The access list for berlin and london transactions.
|
|
131
|
+
*/
|
|
132
|
+
accessList?: null | AccessListish;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The maximum fee per blob gas (see [[link-eip-4844]]).
|
|
136
|
+
*/
|
|
137
|
+
maxFeePerBlobGas?: null | BigNumberish;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The versioned hashes (see [[link-eip-4844]]).
|
|
141
|
+
*/
|
|
142
|
+
blobVersionedHashes?: null | Array<string>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The blobs (if any) attached to this transaction (see [[link-eip-4844]]).
|
|
146
|
+
*/
|
|
147
|
+
blobs?: null | Array<BlobLike>
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* An external library for computing the KZG commitments and
|
|
151
|
+
* proofs necessary for EIP-4844 transactions (see [[link-eip-4844]]).
|
|
152
|
+
*
|
|
153
|
+
* This is generally ``null``, unless you are creating BLOb
|
|
154
|
+
* transactions.
|
|
155
|
+
*/
|
|
156
|
+
kzg?: null | KzgLibraryLike;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The [[link-eip-7594]] BLOb Wrapper Version used for PeerDAS.
|
|
160
|
+
*
|
|
161
|
+
* For networks that use EIP-7594, this property is required to
|
|
162
|
+
* serialize the sidecar correctly.
|
|
163
|
+
*/
|
|
164
|
+
blobWrapperVersion?: null | number;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The [[link-eip-7702]] authorizations (if any).
|
|
168
|
+
*/
|
|
169
|
+
authorizationList?: null | Array<Authorization>;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* A full-valid BLOb object for [[link-eip-4844]] transactions.
|
|
174
|
+
*
|
|
175
|
+
* The commitment and proof should have been computed using a
|
|
176
|
+
* KZG library.
|
|
177
|
+
*/
|
|
178
|
+
export interface Blob {
|
|
179
|
+
/**
|
|
180
|
+
* The blob data.
|
|
181
|
+
*/
|
|
182
|
+
data: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* A EIP-4844 BLOb uses a string proof, while EIP-7594 use an
|
|
186
|
+
* array of strings representing the cells of the proof.
|
|
187
|
+
*/
|
|
188
|
+
proof: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The BLOb commitment.
|
|
192
|
+
*/
|
|
193
|
+
commitment: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* A BLOb object that can be passed for [[link-eip-4844]]
|
|
198
|
+
* transactions.
|
|
199
|
+
*
|
|
200
|
+
* It may have had its commitment and proof already provided
|
|
201
|
+
* or rely on an attached [[KzgLibrary]] to compute them.
|
|
202
|
+
*/
|
|
203
|
+
export type BlobLike = BytesLike | {
|
|
204
|
+
data: BytesLike;
|
|
205
|
+
proof: BytesLike;
|
|
206
|
+
commitment: BytesLike;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* A KZG Library with the necessary functions to compute
|
|
211
|
+
* BLOb commitments and proofs.
|
|
212
|
+
*/
|
|
213
|
+
export interface KzgLibrary {
|
|
214
|
+
blobToKzgCommitment: (blob: Uint8Array) => Uint8Array;
|
|
215
|
+
computeBlobKzgProof: (blob: Uint8Array, commitment: Uint8Array) => Uint8Array;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* A KZG Library with any of the various API configurations.
|
|
220
|
+
* As the library is still experimental and the API is not
|
|
221
|
+
* stable, depending on the version used the method names and
|
|
222
|
+
* signatures are still in flux.
|
|
223
|
+
*
|
|
224
|
+
* This allows any of the versions to be passed into Transaction
|
|
225
|
+
* while providing a stable external API.
|
|
226
|
+
*/
|
|
227
|
+
export type KzgLibraryLike = KzgLibrary | {
|
|
228
|
+
// kzg-wasm >= 0.5.0
|
|
229
|
+
blobToKZGCommitment: (blob: string) => string;
|
|
230
|
+
computeBlobKZGProof: (blob: string, commitment: string) => string;
|
|
231
|
+
} | {
|
|
232
|
+
// micro-ecc-signer
|
|
233
|
+
blobToKzgCommitment: (blob: string) => string | Uint8Array;
|
|
234
|
+
computeBlobProof: (blob: string, commitment: string) => string | Uint8Array;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
function getKzgLibrary(kzg: KzgLibraryLike): KzgLibrary {
|
|
238
|
+
|
|
239
|
+
const blobToKzgCommitment = (blob: Uint8Array) => {
|
|
240
|
+
|
|
241
|
+
if ("computeBlobProof" in kzg) {
|
|
242
|
+
// micro-ecc-signer; check for computeBlobProof since this API
|
|
243
|
+
// expects a string while the kzg-wasm below expects a Unit8Array
|
|
244
|
+
|
|
245
|
+
if ("blobToKzgCommitment" in kzg && typeof(kzg.blobToKzgCommitment) === "function") {
|
|
246
|
+
return getBytes(kzg.blobToKzgCommitment(hexlify(blob)))
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
} else if ("blobToKzgCommitment" in kzg && typeof(kzg.blobToKzgCommitment) === "function") {
|
|
250
|
+
// kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array
|
|
251
|
+
|
|
252
|
+
return getBytes(kzg.blobToKzgCommitment(blob));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string
|
|
256
|
+
if ("blobToKZGCommitment" in kzg && typeof(kzg.blobToKZGCommitment) === "function") {
|
|
257
|
+
return getBytes(kzg.blobToKZGCommitment(hexlify(blob)));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
assertArgument(false, "unsupported KZG library", "kzg", kzg);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const computeBlobKzgProof = (blob: Uint8Array, commitment: Uint8Array) => {
|
|
264
|
+
|
|
265
|
+
// micro-ecc-signer
|
|
266
|
+
if ("computeBlobProof" in kzg && typeof(kzg.computeBlobProof) === "function") {
|
|
267
|
+
return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment)))
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array
|
|
271
|
+
if ("computeBlobKzgProof" in kzg && typeof(kzg.computeBlobKzgProof) === "function") {
|
|
272
|
+
return kzg.computeBlobKzgProof(blob, commitment);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string
|
|
276
|
+
if ("computeBlobKZGProof" in kzg && typeof(kzg.computeBlobKZGProof) === "function") {
|
|
277
|
+
return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment)));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
assertArgument(false, "unsupported KZG library", "kzg", kzg);
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
return { blobToKzgCommitment, computeBlobKzgProof };
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function getVersionedHash(version: number, hash: BytesLike): string {
|
|
287
|
+
let versioned = version.toString(16);
|
|
288
|
+
while (versioned.length < 2) { versioned = "0" + versioned; }
|
|
289
|
+
versioned += sha256(hash).substring(4);
|
|
290
|
+
return "0x" + versioned;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function handleAddress(value: string): null | string {
|
|
294
|
+
if (value === "0x") { return null; }
|
|
295
|
+
return getAddress(value);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function handleAccessList(value: any, param: string): AccessList {
|
|
299
|
+
try {
|
|
300
|
+
return accessListify(value);
|
|
301
|
+
} catch (error: any) {
|
|
302
|
+
assertArgument(false, error.message, param, value);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function handleAuthorizationList(value: any, param: string): Array<Authorization> {
|
|
307
|
+
try {
|
|
308
|
+
if (!Array.isArray(value)) { throw new Error("authorizationList: invalid array"); }
|
|
309
|
+
const result: Array<Authorization> = [ ];
|
|
310
|
+
for (let i = 0; i < value.length; i++) {
|
|
311
|
+
const auth: Array<string> = value[i];
|
|
312
|
+
if (!Array.isArray(auth)) { throw new Error(`authorization[${ i }]: invalid array`); }
|
|
313
|
+
if (auth.length !== 6) { throw new Error(`authorization[${ i }]: wrong length`); }
|
|
314
|
+
if (!auth[1]) { throw new Error(`authorization[${ i }]: null address`); }
|
|
315
|
+
result.push({
|
|
316
|
+
address: <string>handleAddress(auth[1]),
|
|
317
|
+
nonce: handleUint(auth[2], "nonce"),
|
|
318
|
+
chainId: handleUint(auth[0], "chainId"),
|
|
319
|
+
signature: Signature.from({
|
|
320
|
+
yParity: <0 | 1>handleNumber(auth[3], "yParity"),
|
|
321
|
+
r: zeroPadValue(auth[4], 32),
|
|
322
|
+
s: zeroPadValue(auth[5], 32)
|
|
323
|
+
})
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
return result;
|
|
327
|
+
} catch (error: any) {
|
|
328
|
+
assertArgument(false, error.message, param, value);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function handleNumber(_value: string, param: string): number {
|
|
333
|
+
if (_value === "0x") { return 0; }
|
|
334
|
+
return getNumber(_value, param);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function handleUint(_value: string, param: string): bigint {
|
|
338
|
+
if (_value === "0x") { return BN_0; }
|
|
339
|
+
const value = getBigInt(_value, param);
|
|
340
|
+
assertArgument(value <= BN_MAX_UINT, "value exceeds uint size", param, value);
|
|
341
|
+
return value;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function formatNumber(_value: BigNumberish, name: string): Uint8Array {
|
|
345
|
+
const value = getBigInt(_value, "value");
|
|
346
|
+
const result = toBeArray(value);
|
|
347
|
+
assertArgument(result.length <= 32, `value too large`, `tx.${ name }`, value);
|
|
348
|
+
return result;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function formatAccessList(value: AccessListish): Array<[ string, Array<string> ]> {
|
|
352
|
+
return accessListify(value).map((set) => [ set.address, set.storageKeys ]);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function formatAuthorizationList(value: Array<Authorization>): Array<Array<string | Uint8Array>> {
|
|
356
|
+
return value.map((a) => {
|
|
357
|
+
return [
|
|
358
|
+
formatNumber(a.chainId, "chainId"),
|
|
359
|
+
a.address,
|
|
360
|
+
formatNumber(a.nonce, "nonce"),
|
|
361
|
+
formatNumber(a.signature.yParity, "yParity"),
|
|
362
|
+
toBeArray(a.signature.r),
|
|
363
|
+
toBeArray(a.signature._s)
|
|
364
|
+
];
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function formatHashes(value: Array<string>, param: string): Array<string> {
|
|
369
|
+
assertArgument(Array.isArray(value), `invalid ${ param }`, "value", value);
|
|
370
|
+
for (let i = 0; i < value.length; i++) {
|
|
371
|
+
assertArgument(isHexString(value[i], 32), "invalid ${ param } hash", `value[${ i }]`, value[i]);
|
|
372
|
+
}
|
|
373
|
+
return value;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function _parseLegacy(data: Uint8Array): TransactionLike {
|
|
377
|
+
const fields: any = decodeRlp(data);
|
|
378
|
+
|
|
379
|
+
assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6),
|
|
380
|
+
"invalid field count for legacy transaction", "data", data);
|
|
381
|
+
|
|
382
|
+
const tx: TransactionLike = {
|
|
383
|
+
type: 0,
|
|
384
|
+
nonce: handleNumber(fields[0], "nonce"),
|
|
385
|
+
gasPrice: handleUint(fields[1], "gasPrice"),
|
|
386
|
+
gasLimit: handleUint(fields[2], "gasLimit"),
|
|
387
|
+
to: handleAddress(fields[3]),
|
|
388
|
+
value: handleUint(fields[4], "value"),
|
|
389
|
+
data: hexlify(fields[5]),
|
|
390
|
+
chainId: BN_0
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
// Legacy unsigned transaction
|
|
394
|
+
if (fields.length === 6) { return tx; }
|
|
395
|
+
|
|
396
|
+
const v = handleUint(fields[6], "v");
|
|
397
|
+
const r = handleUint(fields[7], "r");
|
|
398
|
+
const s = handleUint(fields[8], "s");
|
|
399
|
+
|
|
400
|
+
if (r === BN_0 && s === BN_0) {
|
|
401
|
+
// EIP-155 unsigned transaction
|
|
402
|
+
tx.chainId = v;
|
|
403
|
+
|
|
404
|
+
} else {
|
|
405
|
+
|
|
406
|
+
// Compute the EIP-155 chain ID (or 0 for legacy)
|
|
407
|
+
let chainId = (v - BN_35) / BN_2;
|
|
408
|
+
if (chainId < BN_0) { chainId = BN_0; }
|
|
409
|
+
tx.chainId = chainId
|
|
410
|
+
|
|
411
|
+
// Signed Legacy Transaction
|
|
412
|
+
assertArgument(chainId !== BN_0 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]);
|
|
413
|
+
|
|
414
|
+
tx.signature = Signature.from({
|
|
415
|
+
r: zeroPadValue(fields[7], 32),
|
|
416
|
+
s: zeroPadValue(fields[8], 32),
|
|
417
|
+
v
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
//tx.hash = keccak256(data);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return tx;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function _serializeLegacy(tx: Transaction, sig: null | Signature): string {
|
|
427
|
+
const fields: Array<any> = [
|
|
428
|
+
formatNumber(tx.nonce, "nonce"),
|
|
429
|
+
formatNumber(tx.gasPrice || 0, "gasPrice"),
|
|
430
|
+
formatNumber(tx.gasLimit, "gasLimit"),
|
|
431
|
+
(tx.to || "0x"),
|
|
432
|
+
formatNumber(tx.value, "value"),
|
|
433
|
+
tx.data,
|
|
434
|
+
];
|
|
435
|
+
|
|
436
|
+
let chainId = BN_0;
|
|
437
|
+
if (tx.chainId != BN_0) {
|
|
438
|
+
// A chainId was provided; if non-zero we'll use EIP-155
|
|
439
|
+
chainId = getBigInt(tx.chainId, "tx.chainId");
|
|
440
|
+
|
|
441
|
+
// We have a chainId in the tx and an EIP-155 v in the signature,
|
|
442
|
+
// make sure they agree with each other
|
|
443
|
+
assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId,
|
|
444
|
+
"tx.chainId/sig.v mismatch", "sig", sig);
|
|
445
|
+
|
|
446
|
+
} else if (tx.signature) {
|
|
447
|
+
// No explicit chainId, but EIP-155 have a derived implicit chainId
|
|
448
|
+
const legacy = tx.signature.legacyChainId;
|
|
449
|
+
if (legacy != null) { chainId = legacy; }
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Requesting an unsigned transaction
|
|
453
|
+
if (!sig) {
|
|
454
|
+
// We have an EIP-155 transaction (chainId was specified and non-zero)
|
|
455
|
+
if (chainId !== BN_0) {
|
|
456
|
+
fields.push(toBeArray(chainId));
|
|
457
|
+
fields.push("0x");
|
|
458
|
+
fields.push("0x");
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return encodeRlp(fields);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// @TODO: We should probably check that tx.signature, chainId, and sig
|
|
465
|
+
// match but that logic could break existing code, so schedule
|
|
466
|
+
// this for the next major bump.
|
|
467
|
+
|
|
468
|
+
// Compute the EIP-155 v
|
|
469
|
+
let v = BigInt(27 + sig.yParity);
|
|
470
|
+
if (chainId !== BN_0) {
|
|
471
|
+
v = Signature.getChainIdV(chainId, sig.v);
|
|
472
|
+
} else if (BigInt(sig.v) !== v) {
|
|
473
|
+
assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// Add the signature
|
|
477
|
+
fields.push(toBeArray(v));
|
|
478
|
+
fields.push(toBeArray(sig.r));
|
|
479
|
+
fields.push(toBeArray(sig._s));
|
|
480
|
+
|
|
481
|
+
return encodeRlp(fields);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function _parseEipSignature(tx: TransactionLike, fields: Array<string>): void {
|
|
485
|
+
let yParity: number;
|
|
486
|
+
try {
|
|
487
|
+
yParity = handleNumber(fields[0], "yParity");
|
|
488
|
+
if (yParity !== 0 && yParity !== 1) { throw new Error("bad yParity"); }
|
|
489
|
+
} catch (error) {
|
|
490
|
+
assertArgument(false, "invalid yParity", "yParity", fields[0]);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
const r = zeroPadValue(fields[1], 32);
|
|
494
|
+
const s = zeroPadValue(fields[2], 32);
|
|
495
|
+
|
|
496
|
+
const signature = Signature.from({ r, s, yParity });
|
|
497
|
+
tx.signature = signature;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function _parseEip1559(data: Uint8Array): TransactionLike {
|
|
501
|
+
const fields: any = decodeRlp(getBytes(data).slice(1));
|
|
502
|
+
|
|
503
|
+
assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12),
|
|
504
|
+
"invalid field count for transaction type: 2", "data", hexlify(data));
|
|
505
|
+
|
|
506
|
+
const tx: TransactionLike = {
|
|
507
|
+
type: 2,
|
|
508
|
+
chainId: handleUint(fields[0], "chainId"),
|
|
509
|
+
nonce: handleNumber(fields[1], "nonce"),
|
|
510
|
+
maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"),
|
|
511
|
+
maxFeePerGas: handleUint(fields[3], "maxFeePerGas"),
|
|
512
|
+
gasPrice: null,
|
|
513
|
+
gasLimit: handleUint(fields[4], "gasLimit"),
|
|
514
|
+
to: handleAddress(fields[5]),
|
|
515
|
+
value: handleUint(fields[6], "value"),
|
|
516
|
+
data: hexlify(fields[7]),
|
|
517
|
+
accessList: handleAccessList(fields[8], "accessList"),
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
// Unsigned EIP-1559 Transaction
|
|
521
|
+
if (fields.length === 9) { return tx; }
|
|
522
|
+
|
|
523
|
+
//tx.hash = keccak256(data);
|
|
524
|
+
|
|
525
|
+
_parseEipSignature(tx, fields.slice(9));
|
|
526
|
+
|
|
527
|
+
return tx;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function _serializeEip1559(tx: Transaction, sig: null | Signature): string {
|
|
531
|
+
const fields: Array<any> = [
|
|
532
|
+
formatNumber(tx.chainId, "chainId"),
|
|
533
|
+
formatNumber(tx.nonce, "nonce"),
|
|
534
|
+
formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
535
|
+
formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"),
|
|
536
|
+
formatNumber(tx.gasLimit, "gasLimit"),
|
|
537
|
+
(tx.to || "0x"),
|
|
538
|
+
formatNumber(tx.value, "value"),
|
|
539
|
+
tx.data,
|
|
540
|
+
formatAccessList(tx.accessList || [ ])
|
|
541
|
+
];
|
|
542
|
+
|
|
543
|
+
if (sig) {
|
|
544
|
+
fields.push(formatNumber(sig.yParity, "yParity"));
|
|
545
|
+
fields.push(toBeArray(sig.r));
|
|
546
|
+
fields.push(toBeArray(sig.s));
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
return concat([ "0x02", encodeRlp(fields)]);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function _parseEip2930(data: Uint8Array): TransactionLike {
|
|
553
|
+
const fields: any = decodeRlp(getBytes(data).slice(1));
|
|
554
|
+
|
|
555
|
+
assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11),
|
|
556
|
+
"invalid field count for transaction type: 1", "data", hexlify(data));
|
|
557
|
+
|
|
558
|
+
const tx: TransactionLike = {
|
|
559
|
+
type: 1,
|
|
560
|
+
chainId: handleUint(fields[0], "chainId"),
|
|
561
|
+
nonce: handleNumber(fields[1], "nonce"),
|
|
562
|
+
gasPrice: handleUint(fields[2], "gasPrice"),
|
|
563
|
+
gasLimit: handleUint(fields[3], "gasLimit"),
|
|
564
|
+
to: handleAddress(fields[4]),
|
|
565
|
+
value: handleUint(fields[5], "value"),
|
|
566
|
+
data: hexlify(fields[6]),
|
|
567
|
+
accessList: handleAccessList(fields[7], "accessList")
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
// Unsigned EIP-2930 Transaction
|
|
571
|
+
if (fields.length === 8) { return tx; }
|
|
572
|
+
|
|
573
|
+
//tx.hash = keccak256(data);
|
|
574
|
+
|
|
575
|
+
_parseEipSignature(tx, fields.slice(8));
|
|
576
|
+
|
|
577
|
+
return tx;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
function _serializeEip2930(tx: Transaction, sig: null | Signature): string {
|
|
581
|
+
const fields: any = [
|
|
582
|
+
formatNumber(tx.chainId, "chainId"),
|
|
583
|
+
formatNumber(tx.nonce, "nonce"),
|
|
584
|
+
formatNumber(tx.gasPrice || 0, "gasPrice"),
|
|
585
|
+
formatNumber(tx.gasLimit, "gasLimit"),
|
|
586
|
+
(tx.to || "0x"),
|
|
587
|
+
formatNumber(tx.value, "value"),
|
|
588
|
+
tx.data,
|
|
589
|
+
formatAccessList(tx.accessList || [ ])
|
|
590
|
+
];
|
|
591
|
+
|
|
592
|
+
if (sig) {
|
|
593
|
+
fields.push(formatNumber(sig.yParity, "recoveryParam"));
|
|
594
|
+
fields.push(toBeArray(sig.r));
|
|
595
|
+
fields.push(toBeArray(sig.s));
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
return concat([ "0x01", encodeRlp(fields)]);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
function _parseEip4844(data: Uint8Array): TransactionLike {
|
|
602
|
+
let fields: any = decodeRlp(getBytes(data).slice(1));
|
|
603
|
+
|
|
604
|
+
let typeName = "3";
|
|
605
|
+
|
|
606
|
+
let blobWrapperVersion: null | number = null;
|
|
607
|
+
|
|
608
|
+
let blobs: null | Array<Blob> = null;
|
|
609
|
+
|
|
610
|
+
// Parse the network format
|
|
611
|
+
if (fields.length === 4 && Array.isArray(fields[0])) {
|
|
612
|
+
// EIP-4844 format with sidecar
|
|
613
|
+
|
|
614
|
+
typeName = "3 (network format)";
|
|
615
|
+
|
|
616
|
+
const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3];
|
|
617
|
+
assertArgument(Array.isArray(fBlobs), "invalid network format: blobs not an array", "fields[1]", fBlobs);
|
|
618
|
+
assertArgument(Array.isArray(fCommits), "invalid network format: commitments not an array", "fields[2]", fCommits);
|
|
619
|
+
assertArgument(Array.isArray(fProofs), "invalid network format: proofs not an array", "fields[3]", fProofs);
|
|
620
|
+
assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields);
|
|
621
|
+
assertArgument(fBlobs.length === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields);
|
|
622
|
+
|
|
623
|
+
blobs = [ ];
|
|
624
|
+
for (let i = 0; i < fields[1].length; i++) {
|
|
625
|
+
blobs.push({
|
|
626
|
+
data: fBlobs[i],
|
|
627
|
+
commitment: fCommits[i],
|
|
628
|
+
proof: fProofs[i],
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
fields = fields[0];
|
|
633
|
+
|
|
634
|
+
} else if (fields.length === 5 && Array.isArray(fields[0])) {
|
|
635
|
+
// EIP-7594 format with sidecar
|
|
636
|
+
|
|
637
|
+
typeName = "3 (EIP-7594 network format)";
|
|
638
|
+
|
|
639
|
+
blobWrapperVersion = getNumber(fields[1]);
|
|
640
|
+
const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4];
|
|
641
|
+
|
|
642
|
+
assertArgument(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${ blobWrapperVersion }`, "fields[1]", blobWrapperVersion);
|
|
643
|
+
assertArgument(Array.isArray(fBlobs), "invalid EIP-7594 network format: blobs not an array", "fields[2]", fBlobs);
|
|
644
|
+
assertArgument(Array.isArray(fCommits), "invalid EIP-7594 network format: commitments not an array", "fields[3]", fCommits);
|
|
645
|
+
assertArgument(Array.isArray(fProofs), "invalid EIP-7594 network format: proofs not an array", "fields[4]", fProofs);
|
|
646
|
+
assertArgument(fBlobs.length === fCommits.length, "invalid network format: blobs/commitments length mismatch", "fields", fields);
|
|
647
|
+
assertArgument(fBlobs.length * CELL_COUNT === fProofs.length, "invalid network format: blobs/proofs length mismatch", "fields", fields);
|
|
648
|
+
|
|
649
|
+
blobs = [ ];
|
|
650
|
+
for (let i = 0; i < fBlobs.length; i++) {
|
|
651
|
+
const proof = [ ];
|
|
652
|
+
for (let j = 0; j < CELL_COUNT; j++) {
|
|
653
|
+
proof.push(fProofs[(i * CELL_COUNT) + j]);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
blobs.push({
|
|
657
|
+
data: fBlobs[i],
|
|
658
|
+
commitment: fCommits[i],
|
|
659
|
+
proof: concat(proof)
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
fields = fields[0];
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14),
|
|
667
|
+
`invalid field count for transaction type: ${ typeName }`, "data", hexlify(data));
|
|
668
|
+
|
|
669
|
+
const tx: TransactionLike = {
|
|
670
|
+
type: 3,
|
|
671
|
+
chainId: handleUint(fields[0], "chainId"),
|
|
672
|
+
nonce: handleNumber(fields[1], "nonce"),
|
|
673
|
+
maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"),
|
|
674
|
+
maxFeePerGas: handleUint(fields[3], "maxFeePerGas"),
|
|
675
|
+
gasPrice: null,
|
|
676
|
+
gasLimit: handleUint(fields[4], "gasLimit"),
|
|
677
|
+
to: handleAddress(fields[5]),
|
|
678
|
+
value: handleUint(fields[6], "value"),
|
|
679
|
+
data: hexlify(fields[7]),
|
|
680
|
+
accessList: handleAccessList(fields[8], "accessList"),
|
|
681
|
+
maxFeePerBlobGas: handleUint(fields[9], "maxFeePerBlobGas"),
|
|
682
|
+
blobVersionedHashes: fields[10],
|
|
683
|
+
blobWrapperVersion
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
if (blobs) { tx.blobs = blobs; }
|
|
687
|
+
|
|
688
|
+
assertArgument(tx.to != null, `invalid address for transaction type: ${ typeName }`, "data", data);
|
|
689
|
+
|
|
690
|
+
assertArgument(Array.isArray(tx.blobVersionedHashes), "invalid blobVersionedHashes: must be an array", "data", data);
|
|
691
|
+
for (let i = 0; i < tx.blobVersionedHashes.length; i++) {
|
|
692
|
+
assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${ i }: must be length 32`, "data", data);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// Unsigned EIP-4844 Transaction
|
|
696
|
+
if (fields.length === 11) { return tx; }
|
|
697
|
+
|
|
698
|
+
// @TODO: Do we need to do this? This is only called internally
|
|
699
|
+
// and used to verify hashes; it might save time to not do this
|
|
700
|
+
//tx.hash = keccak256(concat([ "0x03", encodeRlp(fields) ]));
|
|
701
|
+
|
|
702
|
+
_parseEipSignature(tx, fields.slice(11));
|
|
703
|
+
|
|
704
|
+
return tx;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
function _serializeEip4844(tx: Transaction, sig: null | Signature, blobs: null | Array<Blob>): string {
|
|
708
|
+
const fields: Array<any> = [
|
|
709
|
+
formatNumber(tx.chainId, "chainId"),
|
|
710
|
+
formatNumber(tx.nonce, "nonce"),
|
|
711
|
+
formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
712
|
+
formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"),
|
|
713
|
+
formatNumber(tx.gasLimit, "gasLimit"),
|
|
714
|
+
(tx.to || ZeroAddress),
|
|
715
|
+
formatNumber(tx.value, "value"),
|
|
716
|
+
tx.data,
|
|
717
|
+
formatAccessList(tx.accessList || [ ]),
|
|
718
|
+
formatNumber(tx.maxFeePerBlobGas || 0, "maxFeePerBlobGas"),
|
|
719
|
+
formatHashes(tx.blobVersionedHashes || [ ], "blobVersionedHashes")
|
|
720
|
+
];
|
|
721
|
+
|
|
722
|
+
if (sig) {
|
|
723
|
+
fields.push(formatNumber(sig.yParity, "yParity"));
|
|
724
|
+
fields.push(toBeArray(sig.r));
|
|
725
|
+
fields.push(toBeArray(sig.s));
|
|
726
|
+
|
|
727
|
+
// We have blobs; return the network wrapped format
|
|
728
|
+
if (blobs) {
|
|
729
|
+
|
|
730
|
+
// Use EIP-7594
|
|
731
|
+
if (tx.blobWrapperVersion != null) {
|
|
732
|
+
const wrapperVersion = toBeArray(tx.blobWrapperVersion);
|
|
733
|
+
|
|
734
|
+
const cellProofs: Array<Uint8Array> = [ ];
|
|
735
|
+
for (const { proof } of blobs) {
|
|
736
|
+
const p = getBytes(proof);
|
|
737
|
+
const cellSize = p.length / CELL_COUNT;
|
|
738
|
+
for (let i = 0; i < p.length; i += cellSize) {
|
|
739
|
+
cellProofs.push(p.subarray(i, i + cellSize));
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
return concat([
|
|
744
|
+
"0x03",
|
|
745
|
+
encodeRlp([
|
|
746
|
+
fields,
|
|
747
|
+
wrapperVersion,
|
|
748
|
+
blobs.map((b) => b.data),
|
|
749
|
+
blobs.map((b) => b.commitment),
|
|
750
|
+
cellProofs
|
|
751
|
+
])
|
|
752
|
+
]);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// Fall back onto classic EIP-4844 behavior
|
|
756
|
+
return concat([
|
|
757
|
+
"0x03",
|
|
758
|
+
encodeRlp([
|
|
759
|
+
fields,
|
|
760
|
+
blobs.map((b) => b.data),
|
|
761
|
+
blobs.map((b) => b.commitment),
|
|
762
|
+
blobs.map((b) => b.proof),
|
|
763
|
+
])
|
|
764
|
+
]);
|
|
765
|
+
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
return concat([ "0x03", encodeRlp(fields)]);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
function _parseEip7702(data: Uint8Array): TransactionLike {
|
|
774
|
+
const fields: any = decodeRlp(getBytes(data).slice(1));
|
|
775
|
+
|
|
776
|
+
assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13),
|
|
777
|
+
"invalid field count for transaction type: 4", "data", hexlify(data));
|
|
778
|
+
|
|
779
|
+
const tx: TransactionLike = {
|
|
780
|
+
type: 4,
|
|
781
|
+
chainId: handleUint(fields[0], "chainId"),
|
|
782
|
+
nonce: handleNumber(fields[1], "nonce"),
|
|
783
|
+
maxPriorityFeePerGas: handleUint(fields[2], "maxPriorityFeePerGas"),
|
|
784
|
+
maxFeePerGas: handleUint(fields[3], "maxFeePerGas"),
|
|
785
|
+
gasPrice: null,
|
|
786
|
+
gasLimit: handleUint(fields[4], "gasLimit"),
|
|
787
|
+
to: handleAddress(fields[5]),
|
|
788
|
+
value: handleUint(fields[6], "value"),
|
|
789
|
+
data: hexlify(fields[7]),
|
|
790
|
+
accessList: handleAccessList(fields[8], "accessList"),
|
|
791
|
+
authorizationList: handleAuthorizationList(fields[9], "authorizationList"),
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
// Unsigned EIP-7702 Transaction
|
|
795
|
+
if (fields.length === 10) { return tx; }
|
|
796
|
+
|
|
797
|
+
_parseEipSignature(tx, fields.slice(10));
|
|
798
|
+
|
|
799
|
+
return tx;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
function _serializeEip7702(tx: Transaction, sig: null | Signature): string {
|
|
803
|
+
const fields: Array<any> = [
|
|
804
|
+
formatNumber(tx.chainId, "chainId"),
|
|
805
|
+
formatNumber(tx.nonce, "nonce"),
|
|
806
|
+
formatNumber(tx.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
807
|
+
formatNumber(tx.maxFeePerGas || 0, "maxFeePerGas"),
|
|
808
|
+
formatNumber(tx.gasLimit, "gasLimit"),
|
|
809
|
+
(tx.to || "0x"),
|
|
810
|
+
formatNumber(tx.value, "value"),
|
|
811
|
+
tx.data,
|
|
812
|
+
formatAccessList(tx.accessList || [ ]),
|
|
813
|
+
formatAuthorizationList(tx.authorizationList || [ ])
|
|
814
|
+
];
|
|
815
|
+
|
|
816
|
+
if (sig) {
|
|
817
|
+
fields.push(formatNumber(sig.yParity, "yParity"));
|
|
818
|
+
fields.push(toBeArray(sig.r));
|
|
819
|
+
fields.push(toBeArray(sig.s));
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
return concat([ "0x04", encodeRlp(fields)]);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* A **Transaction** describes an operation to be executed on
|
|
827
|
+
* Ethereum by an Externally Owned Account (EOA). It includes
|
|
828
|
+
* who (the [[to]] address), what (the [[data]]) and how much (the
|
|
829
|
+
* [[value]] in ether) the operation should entail.
|
|
830
|
+
*
|
|
831
|
+
* @example:
|
|
832
|
+
* tx = new Transaction()
|
|
833
|
+
* //_result:
|
|
834
|
+
*
|
|
835
|
+
* tx.data = "0x1234";
|
|
836
|
+
* //_result:
|
|
837
|
+
*/
|
|
838
|
+
export class Transaction implements TransactionLike<string> {
|
|
839
|
+
#type: null | number;
|
|
840
|
+
#to: null | string;
|
|
841
|
+
#data: string;
|
|
842
|
+
#nonce: number;
|
|
843
|
+
#gasLimit: bigint;
|
|
844
|
+
#gasPrice: null | bigint;
|
|
845
|
+
#maxPriorityFeePerGas: null | bigint;
|
|
846
|
+
#maxFeePerGas: null | bigint;
|
|
847
|
+
#value: bigint;
|
|
848
|
+
#chainId: bigint;
|
|
849
|
+
#sig: null | Signature;
|
|
850
|
+
#accessList: null | AccessList;
|
|
851
|
+
#maxFeePerBlobGas: null | bigint;
|
|
852
|
+
#blobVersionedHashes: null | Array<string>;
|
|
853
|
+
#kzg: null | KzgLibrary;
|
|
854
|
+
#blobs: null | Array<Blob>;
|
|
855
|
+
#auths: null | Array<Authorization>;
|
|
856
|
+
#blobWrapperVersion: null | number;
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* The transaction type.
|
|
860
|
+
*
|
|
861
|
+
* If null, the type will be automatically inferred based on
|
|
862
|
+
* explicit properties.
|
|
863
|
+
*/
|
|
864
|
+
get type(): null | number { return this.#type; }
|
|
865
|
+
set type(value: null | number | string) {
|
|
866
|
+
switch (value) {
|
|
867
|
+
case null:
|
|
868
|
+
this.#type = null;
|
|
869
|
+
break;
|
|
870
|
+
case 0: case "legacy":
|
|
871
|
+
this.#type = 0;
|
|
872
|
+
break;
|
|
873
|
+
case 1: case "berlin": case "eip-2930":
|
|
874
|
+
this.#type = 1;
|
|
875
|
+
break;
|
|
876
|
+
case 2: case "london": case "eip-1559":
|
|
877
|
+
this.#type = 2;
|
|
878
|
+
break;
|
|
879
|
+
case 3: case "cancun": case "eip-4844":
|
|
880
|
+
this.#type = 3;
|
|
881
|
+
break;
|
|
882
|
+
case 4: case "pectra": case "eip-7702":
|
|
883
|
+
this.#type = 4;
|
|
884
|
+
break;
|
|
885
|
+
default:
|
|
886
|
+
assertArgument(false, "unsupported transaction type", "type", value);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* The name of the transaction type.
|
|
892
|
+
*/
|
|
893
|
+
get typeName(): null | string {
|
|
894
|
+
switch (this.type) {
|
|
895
|
+
case 0: return "legacy";
|
|
896
|
+
case 1: return "eip-2930";
|
|
897
|
+
case 2: return "eip-1559";
|
|
898
|
+
case 3: return "eip-4844";
|
|
899
|
+
case 4: return "eip-7702";
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
return null;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* The ``to`` address for the transaction or ``null`` if the
|
|
907
|
+
* transaction is an ``init`` transaction.
|
|
908
|
+
*/
|
|
909
|
+
get to(): null | string {
|
|
910
|
+
const value = this.#to;
|
|
911
|
+
if (value == null && this.type === 3) { return ZeroAddress; }
|
|
912
|
+
return value;
|
|
913
|
+
}
|
|
914
|
+
set to(value: null | string) {
|
|
915
|
+
this.#to = (value == null) ? null: getAddress(value);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* The transaction nonce.
|
|
920
|
+
*/
|
|
921
|
+
get nonce(): number { return this.#nonce; }
|
|
922
|
+
set nonce(value: BigNumberish) { this.#nonce = getNumber(value, "value"); }
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* The gas limit.
|
|
926
|
+
*/
|
|
927
|
+
get gasLimit(): bigint { return this.#gasLimit; }
|
|
928
|
+
set gasLimit(value: BigNumberish) { this.#gasLimit = getBigInt(value); }
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* The gas price.
|
|
932
|
+
*
|
|
933
|
+
* On legacy networks this defines the fee that will be paid. On
|
|
934
|
+
* EIP-1559 networks, this should be ``null``.
|
|
935
|
+
*/
|
|
936
|
+
get gasPrice(): null | bigint {
|
|
937
|
+
const value = this.#gasPrice;
|
|
938
|
+
if (value == null && (this.type === 0 || this.type === 1)) { return BN_0; }
|
|
939
|
+
return value;
|
|
940
|
+
}
|
|
941
|
+
set gasPrice(value: null | BigNumberish) {
|
|
942
|
+
this.#gasPrice = (value == null) ? null: getBigInt(value, "gasPrice");
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* The maximum priority fee per unit of gas to pay. On legacy
|
|
947
|
+
* networks this should be ``null``.
|
|
948
|
+
*/
|
|
949
|
+
get maxPriorityFeePerGas(): null | bigint {
|
|
950
|
+
const value = this.#maxPriorityFeePerGas;
|
|
951
|
+
if (value == null) {
|
|
952
|
+
if (this.type === 2 || this.type === 3) { return BN_0; }
|
|
953
|
+
return null;
|
|
954
|
+
}
|
|
955
|
+
return value;
|
|
956
|
+
}
|
|
957
|
+
set maxPriorityFeePerGas(value: null | BigNumberish) {
|
|
958
|
+
this.#maxPriorityFeePerGas = (value == null) ? null: getBigInt(value, "maxPriorityFeePerGas");
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* The maximum total fee per unit of gas to pay. On legacy
|
|
963
|
+
* networks this should be ``null``.
|
|
964
|
+
*/
|
|
965
|
+
get maxFeePerGas(): null | bigint {
|
|
966
|
+
const value = this.#maxFeePerGas;
|
|
967
|
+
if (value == null) {
|
|
968
|
+
if (this.type === 2 || this.type === 3) { return BN_0; }
|
|
969
|
+
return null;
|
|
970
|
+
}
|
|
971
|
+
return value;
|
|
972
|
+
}
|
|
973
|
+
set maxFeePerGas(value: null | BigNumberish) {
|
|
974
|
+
this.#maxFeePerGas = (value == null) ? null: getBigInt(value, "maxFeePerGas");
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* The transaction data. For ``init`` transactions this is the
|
|
979
|
+
* deployment code.
|
|
980
|
+
*/
|
|
981
|
+
get data(): string { return this.#data; }
|
|
982
|
+
set data(value: BytesLike) { this.#data = hexlify(value); }
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* The amount of ether (in wei) to send in this transactions.
|
|
986
|
+
*/
|
|
987
|
+
get value(): bigint { return this.#value; }
|
|
988
|
+
set value(value: BigNumberish) {
|
|
989
|
+
this.#value = getBigInt(value, "value");
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* The chain ID this transaction is valid on.
|
|
994
|
+
*/
|
|
995
|
+
get chainId(): bigint { return this.#chainId; }
|
|
996
|
+
set chainId(value: BigNumberish) { this.#chainId = getBigInt(value); }
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* If signed, the signature for this transaction.
|
|
1000
|
+
*/
|
|
1001
|
+
get signature(): null | Signature { return this.#sig || null; }
|
|
1002
|
+
set signature(value: null | SignatureLike) {
|
|
1003
|
+
this.#sig = (value == null) ? null: Signature.from(value);
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
isValid(): boolean {
|
|
1007
|
+
const sig = this.signature;
|
|
1008
|
+
if (sig && !sig.isValid()) { return false; }
|
|
1009
|
+
|
|
1010
|
+
const auths = this.authorizationList;
|
|
1011
|
+
if (auths) {
|
|
1012
|
+
for (const auth of auths) {
|
|
1013
|
+
if (!auth.signature.isValid()) { return false; }
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
return true;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* The access list.
|
|
1022
|
+
*
|
|
1023
|
+
* An access list permits discounted (but pre-paid) access to
|
|
1024
|
+
* bytecode and state variable access within contract execution.
|
|
1025
|
+
*/
|
|
1026
|
+
get accessList(): null | AccessList {
|
|
1027
|
+
const value = this.#accessList || null;
|
|
1028
|
+
if (value == null) {
|
|
1029
|
+
if (this.type === 1 || this.type === 2 || this.type === 3) {
|
|
1030
|
+
// @TODO: in v7, this should assign the value or become
|
|
1031
|
+
// a live object itself, otherwise mutation is inconsistent
|
|
1032
|
+
return [ ];
|
|
1033
|
+
}
|
|
1034
|
+
return null;
|
|
1035
|
+
}
|
|
1036
|
+
return value;
|
|
1037
|
+
}
|
|
1038
|
+
set accessList(value: null | AccessListish) {
|
|
1039
|
+
this.#accessList = (value == null) ? null: accessListify(value);
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
get authorizationList(): null | Array<Authorization> {
|
|
1043
|
+
const value = this.#auths || null;
|
|
1044
|
+
if (value == null) {
|
|
1045
|
+
if (this.type === 4) {
|
|
1046
|
+
// @TODO: in v7, this should become a live object itself,
|
|
1047
|
+
// otherwise mutation is inconsistent
|
|
1048
|
+
return [ ];
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
return value;
|
|
1052
|
+
}
|
|
1053
|
+
set authorizationList(auths: null | Array<AuthorizationLike>) {
|
|
1054
|
+
this.#auths = (auths == null) ? null: auths.map((a) =>
|
|
1055
|
+
authorizationify(a));
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* The max fee per blob gas for Cancun transactions.
|
|
1060
|
+
*/
|
|
1061
|
+
get maxFeePerBlobGas(): null | bigint {
|
|
1062
|
+
const value = this.#maxFeePerBlobGas;
|
|
1063
|
+
if (value == null && this.type === 3) { return BN_0; }
|
|
1064
|
+
return value;
|
|
1065
|
+
}
|
|
1066
|
+
set maxFeePerBlobGas(value: null | BigNumberish) {
|
|
1067
|
+
this.#maxFeePerBlobGas = (value == null) ? null: getBigInt(value, "maxFeePerBlobGas");
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* The BLOb versioned hashes for Cancun transactions.
|
|
1072
|
+
*/
|
|
1073
|
+
get blobVersionedHashes(): null | Array<string> {
|
|
1074
|
+
// @TODO: Mutation is inconsistent; if unset, the returned value
|
|
1075
|
+
// cannot mutate the object, if set it can
|
|
1076
|
+
let value = this.#blobVersionedHashes;
|
|
1077
|
+
if (value == null && this.type === 3) { return [ ]; }
|
|
1078
|
+
return value;
|
|
1079
|
+
}
|
|
1080
|
+
set blobVersionedHashes(value: null | Array<string>) {
|
|
1081
|
+
if (value != null) {
|
|
1082
|
+
assertArgument(Array.isArray(value), "blobVersionedHashes must be an Array", "value", value);
|
|
1083
|
+
value = value.slice();
|
|
1084
|
+
for (let i = 0; i < value.length; i++) {
|
|
1085
|
+
assertArgument(isHexString(value[i], 32), "invalid blobVersionedHash", `value[${ i }]`, value[i]);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
this.#blobVersionedHashes = value;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* The BLObs for the Transaction, if any.
|
|
1093
|
+
*
|
|
1094
|
+
* If ``blobs`` is non-``null``, then the [[seriailized]]
|
|
1095
|
+
* will return the network formatted sidecar, otherwise it
|
|
1096
|
+
* will return the standard [[link-eip-2718]] payload. The
|
|
1097
|
+
* [[unsignedSerialized]] is unaffected regardless.
|
|
1098
|
+
*
|
|
1099
|
+
* When setting ``blobs``, either fully valid [[Blob]] objects
|
|
1100
|
+
* may be specified (i.e. correctly padded, with correct
|
|
1101
|
+
* committments and proofs) or a raw [[BytesLike]] may
|
|
1102
|
+
* be provided.
|
|
1103
|
+
*
|
|
1104
|
+
* If raw [[BytesLike]] are provided, the [[kzg]] property **must**
|
|
1105
|
+
* be already set. The blob will be correctly padded and the
|
|
1106
|
+
* [[KzgLibrary]] will be used to compute the committment and
|
|
1107
|
+
* proof for the blob.
|
|
1108
|
+
*
|
|
1109
|
+
* A BLOb is a sequence of field elements, each of which must
|
|
1110
|
+
* be within the BLS field modulo, so some additional processing
|
|
1111
|
+
* may be required to encode arbitrary data to ensure each 32 byte
|
|
1112
|
+
* field is within the valid range.
|
|
1113
|
+
*
|
|
1114
|
+
* Setting this automatically populates [[blobVersionedHashes]],
|
|
1115
|
+
* overwriting any existing values. Setting this to ``null``
|
|
1116
|
+
* does **not** remove the [[blobVersionedHashes]], leaving them
|
|
1117
|
+
* present.
|
|
1118
|
+
*/
|
|
1119
|
+
get blobs(): null | Array<Blob> {
|
|
1120
|
+
if (this.#blobs == null) { return null; }
|
|
1121
|
+
return this.#blobs.map((b) => Object.assign({ }, b));
|
|
1122
|
+
}
|
|
1123
|
+
set blobs(_blobs: null | Array<BlobLike>) {
|
|
1124
|
+
if (_blobs == null) {
|
|
1125
|
+
this.#blobs = null;
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
const blobs: Array<Blob> = [ ];
|
|
1130
|
+
const versionedHashes: Array<string> = [ ];
|
|
1131
|
+
for (let i = 0; i < _blobs.length; i++) {
|
|
1132
|
+
const blob = _blobs[i];
|
|
1133
|
+
|
|
1134
|
+
if (isBytesLike(blob)) {
|
|
1135
|
+
assert(this.#kzg, "adding a raw blob requires a KZG library", "UNSUPPORTED_OPERATION", {
|
|
1136
|
+
operation: "set blobs()"
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
let data = getBytes(blob);
|
|
1140
|
+
assertArgument(data.length <= BLOB_SIZE, "blob is too large", `blobs[${ i }]`, blob);
|
|
1141
|
+
|
|
1142
|
+
// Pad blob if necessary
|
|
1143
|
+
if (data.length !== BLOB_SIZE) {
|
|
1144
|
+
const padded = new Uint8Array(BLOB_SIZE);
|
|
1145
|
+
padded.set(data);
|
|
1146
|
+
data = padded;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
const commit = this.#kzg.blobToKzgCommitment(data);
|
|
1150
|
+
const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit));
|
|
1151
|
+
|
|
1152
|
+
blobs.push({
|
|
1153
|
+
data: hexlify(data),
|
|
1154
|
+
commitment: hexlify(commit),
|
|
1155
|
+
proof
|
|
1156
|
+
});
|
|
1157
|
+
versionedHashes.push(getVersionedHash(1, commit));
|
|
1158
|
+
|
|
1159
|
+
} else {
|
|
1160
|
+
const data = hexlify(blob.data);
|
|
1161
|
+
const commitment = hexlify(blob.commitment);
|
|
1162
|
+
const proof = hexlify(blob.proof);
|
|
1163
|
+
blobs.push({ data, commitment, proof });
|
|
1164
|
+
|
|
1165
|
+
versionedHashes.push(getVersionedHash(1, commitment));
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
this.#blobs = blobs;
|
|
1170
|
+
this.#blobVersionedHashes = versionedHashes;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
get kzg(): null | KzgLibrary { return this.#kzg; }
|
|
1174
|
+
set kzg(kzg: null | KzgLibraryLike) {
|
|
1175
|
+
if (kzg == null) {
|
|
1176
|
+
this.#kzg = null;
|
|
1177
|
+
} else {
|
|
1178
|
+
this.#kzg = getKzgLibrary(kzg);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
get blobWrapperVersion(): null | number {
|
|
1183
|
+
return this.#blobWrapperVersion;
|
|
1184
|
+
}
|
|
1185
|
+
set blobWrapperVersion(value: null | number) {
|
|
1186
|
+
this.#blobWrapperVersion = value;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* Creates a new Transaction with default values.
|
|
1191
|
+
*/
|
|
1192
|
+
constructor() {
|
|
1193
|
+
this.#type = null;
|
|
1194
|
+
this.#to = null;
|
|
1195
|
+
this.#nonce = 0;
|
|
1196
|
+
this.#gasLimit = BN_0;
|
|
1197
|
+
this.#gasPrice = null;
|
|
1198
|
+
this.#maxPriorityFeePerGas = null;
|
|
1199
|
+
this.#maxFeePerGas = null;
|
|
1200
|
+
this.#data = "0x";
|
|
1201
|
+
this.#value = BN_0;
|
|
1202
|
+
this.#chainId = BN_0;
|
|
1203
|
+
this.#sig = null;
|
|
1204
|
+
this.#accessList = null;
|
|
1205
|
+
this.#maxFeePerBlobGas = null;
|
|
1206
|
+
this.#blobVersionedHashes = null;
|
|
1207
|
+
this.#kzg = null;
|
|
1208
|
+
this.#blobs = null;
|
|
1209
|
+
this.#auths = null;
|
|
1210
|
+
this.#blobWrapperVersion = null;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* The transaction hash, if signed. Otherwise, ``null``.
|
|
1215
|
+
*/
|
|
1216
|
+
get hash(): null | string {
|
|
1217
|
+
if (this.signature == null) { return null; }
|
|
1218
|
+
return keccak256(this.#getSerialized(true, false));
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* The pre-image hash of this transaction.
|
|
1223
|
+
*
|
|
1224
|
+
* This is the digest that a [[Signer]] must sign to authorize
|
|
1225
|
+
* this transaction.
|
|
1226
|
+
*/
|
|
1227
|
+
get unsignedHash(): string {
|
|
1228
|
+
return keccak256(this.unsignedSerialized);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* The sending address, if signed. Otherwise, ``null``.
|
|
1233
|
+
*/
|
|
1234
|
+
get from(): null | string {
|
|
1235
|
+
if (this.signature == null) { return null; }
|
|
1236
|
+
return recoverAddress(this.unsignedHash, this.signature.getCanonical());
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* The public key of the sender, if signed. Otherwise, ``null``.
|
|
1241
|
+
*/
|
|
1242
|
+
get fromPublicKey(): null | string {
|
|
1243
|
+
if (this.signature == null) { return null; }
|
|
1244
|
+
return SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical());
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* Returns true if signed.
|
|
1249
|
+
*
|
|
1250
|
+
* This provides a Type Guard that properties requiring a signed
|
|
1251
|
+
* transaction are non-null.
|
|
1252
|
+
*/
|
|
1253
|
+
isSigned(): this is (Transaction & { type: number, typeName: string, from: string, signature: Signature }) {
|
|
1254
|
+
return this.signature != null;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
#getSerialized(signed: boolean, sidecar: boolean): string {
|
|
1258
|
+
assert(!signed || this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized"});
|
|
1259
|
+
|
|
1260
|
+
const sig = signed ? this.signature: null;
|
|
1261
|
+
switch (this.inferType()) {
|
|
1262
|
+
case 0:
|
|
1263
|
+
return _serializeLegacy(this, sig);
|
|
1264
|
+
case 1:
|
|
1265
|
+
return _serializeEip2930(this, sig);
|
|
1266
|
+
case 2:
|
|
1267
|
+
return _serializeEip1559(this, sig);
|
|
1268
|
+
case 3:
|
|
1269
|
+
return _serializeEip4844(this, sig, sidecar ? this.blobs: null);
|
|
1270
|
+
case 4:
|
|
1271
|
+
return _serializeEip7702(this, sig);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: ".serialized" });
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* The serialized transaction.
|
|
1279
|
+
*
|
|
1280
|
+
* This throws if the transaction is unsigned. For the pre-image,
|
|
1281
|
+
* use [[unsignedSerialized]].
|
|
1282
|
+
*/
|
|
1283
|
+
get serialized(): string {
|
|
1284
|
+
return this.#getSerialized(true, true);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
/**
|
|
1288
|
+
* The transaction pre-image.
|
|
1289
|
+
*
|
|
1290
|
+
* The hash of this is the digest which needs to be signed to
|
|
1291
|
+
* authorize this transaction.
|
|
1292
|
+
*/
|
|
1293
|
+
get unsignedSerialized(): string {
|
|
1294
|
+
return this.#getSerialized(false, false);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* Return the most "likely" type; currently the highest
|
|
1299
|
+
* supported transaction type.
|
|
1300
|
+
*/
|
|
1301
|
+
inferType(): number {
|
|
1302
|
+
const types = this.inferTypes();
|
|
1303
|
+
|
|
1304
|
+
// Prefer London (EIP-1559) over Cancun (BLOb)
|
|
1305
|
+
if (types.indexOf(2) >= 0) { return 2; }
|
|
1306
|
+
|
|
1307
|
+
// Return the highest inferred type
|
|
1308
|
+
return <number>(types.pop());
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Validates the explicit properties and returns a list of compatible
|
|
1313
|
+
* transaction types.
|
|
1314
|
+
*/
|
|
1315
|
+
inferTypes(): Array<number> {
|
|
1316
|
+
|
|
1317
|
+
// Checks that there are no conflicting properties set
|
|
1318
|
+
const hasGasPrice = this.gasPrice != null;
|
|
1319
|
+
const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null);
|
|
1320
|
+
const hasAccessList = (this.accessList != null);
|
|
1321
|
+
const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes);
|
|
1322
|
+
|
|
1323
|
+
//if (hasGasPrice && hasFee) {
|
|
1324
|
+
// throw new Error("transaction cannot have gasPrice and maxFeePerGas");
|
|
1325
|
+
//}
|
|
1326
|
+
|
|
1327
|
+
if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) {
|
|
1328
|
+
assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, "priorityFee cannot be more than maxFee", "BAD_DATA", { value: this });
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
//if (this.type === 2 && hasGasPrice) {
|
|
1332
|
+
// throw new Error("eip-1559 transaction cannot have gasPrice");
|
|
1333
|
+
//}
|
|
1334
|
+
|
|
1335
|
+
assert(!hasFee || (this.type !== 0 && this.type !== 1), "transaction type cannot have maxFeePerGas or maxPriorityFeePerGas", "BAD_DATA", { value: this });
|
|
1336
|
+
assert(this.type !== 0 || !hasAccessList, "legacy transaction cannot have accessList", "BAD_DATA", { value: this })
|
|
1337
|
+
|
|
1338
|
+
const types: Array<number> = [ ];
|
|
1339
|
+
|
|
1340
|
+
// Explicit type
|
|
1341
|
+
if (this.type != null) {
|
|
1342
|
+
types.push(this.type);
|
|
1343
|
+
|
|
1344
|
+
} else {
|
|
1345
|
+
if (this.authorizationList && this.authorizationList.length) {
|
|
1346
|
+
types.push(4);
|
|
1347
|
+
} else if (hasFee) {
|
|
1348
|
+
types.push(2);
|
|
1349
|
+
} else if (hasGasPrice) {
|
|
1350
|
+
types.push(1);
|
|
1351
|
+
if (!hasAccessList) { types.push(0); }
|
|
1352
|
+
} else if (hasAccessList) {
|
|
1353
|
+
types.push(1);
|
|
1354
|
+
types.push(2);
|
|
1355
|
+
} else if (hasBlob && this.to) {
|
|
1356
|
+
types.push(3);
|
|
1357
|
+
} else {
|
|
1358
|
+
types.push(0);
|
|
1359
|
+
types.push(1);
|
|
1360
|
+
types.push(2);
|
|
1361
|
+
types.push(3);
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
types.sort();
|
|
1366
|
+
|
|
1367
|
+
return types;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* Returns true if this transaction is a legacy transaction (i.e.
|
|
1372
|
+
* ``type === 0``).
|
|
1373
|
+
*
|
|
1374
|
+
* This provides a Type Guard that the related properties are
|
|
1375
|
+
* non-null.
|
|
1376
|
+
*/
|
|
1377
|
+
isLegacy(): this is (Transaction & { type: 0, gasPrice: bigint }) {
|
|
1378
|
+
return (this.type === 0);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* Returns true if this transaction is berlin hardform transaction (i.e.
|
|
1383
|
+
* ``type === 1``).
|
|
1384
|
+
*
|
|
1385
|
+
* This provides a Type Guard that the related properties are
|
|
1386
|
+
* non-null.
|
|
1387
|
+
*/
|
|
1388
|
+
isBerlin(): this is (Transaction & { type: 1, gasPrice: bigint, accessList: AccessList }) {
|
|
1389
|
+
return (this.type === 1);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* Returns true if this transaction is london hardform transaction (i.e.
|
|
1394
|
+
* ``type === 2``).
|
|
1395
|
+
*
|
|
1396
|
+
* This provides a Type Guard that the related properties are
|
|
1397
|
+
* non-null.
|
|
1398
|
+
*/
|
|
1399
|
+
isLondon(): this is (Transaction & { type: 2, accessList: AccessList, maxFeePerGas: bigint, maxPriorityFeePerGas: bigint }) {
|
|
1400
|
+
return (this.type === 2);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* Returns true if this transaction is an [[link-eip-4844]] BLOB
|
|
1405
|
+
* transaction.
|
|
1406
|
+
*
|
|
1407
|
+
* This provides a Type Guard that the related properties are
|
|
1408
|
+
* non-null.
|
|
1409
|
+
*/
|
|
1410
|
+
isCancun(): this is (Transaction & { type: 3, to: string, accessList: AccessList, maxFeePerGas: bigint, maxPriorityFeePerGas: bigint, maxFeePerBlobGas: bigint, blobVersionedHashes: Array<string> }) {
|
|
1411
|
+
return (this.type === 3);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
/**
|
|
1415
|
+
* Create a copy of this transaciton.
|
|
1416
|
+
*/
|
|
1417
|
+
clone(): Transaction {
|
|
1418
|
+
return Transaction.from(this);
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Return a JSON-friendly object.
|
|
1423
|
+
*/
|
|
1424
|
+
toJSON(): any {
|
|
1425
|
+
const s = (v: null | bigint) => {
|
|
1426
|
+
if (v == null) { return null; }
|
|
1427
|
+
return v.toString();
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1430
|
+
return {
|
|
1431
|
+
type: this.type,
|
|
1432
|
+
to: this.to,
|
|
1433
|
+
// from: this.from,
|
|
1434
|
+
data: this.data,
|
|
1435
|
+
nonce: this.nonce,
|
|
1436
|
+
gasLimit: s(this.gasLimit),
|
|
1437
|
+
gasPrice: s(this.gasPrice),
|
|
1438
|
+
maxPriorityFeePerGas: s(this.maxPriorityFeePerGas),
|
|
1439
|
+
maxFeePerGas: s(this.maxFeePerGas),
|
|
1440
|
+
value: s(this.value),
|
|
1441
|
+
chainId: s(this.chainId),
|
|
1442
|
+
sig: this.signature ? this.signature.toJSON(): null,
|
|
1443
|
+
accessList: this.accessList
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
[inspect](): string {
|
|
1448
|
+
return this.toString();
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
toString(): string {
|
|
1452
|
+
const output: Array<string> = [ ];
|
|
1453
|
+
const add = (key: string) => {
|
|
1454
|
+
let value = (<any>this)[key];
|
|
1455
|
+
if (typeof(value) === "string") { value = JSON.stringify(value); }
|
|
1456
|
+
output.push(`${ key }: ${ value }`);
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1459
|
+
if (this.type) { add("type"); }
|
|
1460
|
+
add("to");
|
|
1461
|
+
add("data");
|
|
1462
|
+
add("nonce");
|
|
1463
|
+
add("gasLimit");
|
|
1464
|
+
add("value");
|
|
1465
|
+
if (this.chainId != null) { add("chainId"); }
|
|
1466
|
+
if (this.signature) {
|
|
1467
|
+
add("from");
|
|
1468
|
+
output.push(`signature: ${ this.signature.toString() }`);
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
// @TODO: accessList
|
|
1472
|
+
|
|
1473
|
+
// @TODO: blobs (might make output huge; maybe just include a flag?)
|
|
1474
|
+
|
|
1475
|
+
const auths = this.authorizationList;
|
|
1476
|
+
if (auths) {
|
|
1477
|
+
const outputAuths: Array<string> = [ ];
|
|
1478
|
+
for (const auth of auths) {
|
|
1479
|
+
const o: Array<string> = [ ];
|
|
1480
|
+
o.push(`address: ${ JSON.stringify(auth.address) }`);
|
|
1481
|
+
if (auth.nonce != null) { o.push(`nonce: ${ auth.nonce }`); }
|
|
1482
|
+
if (auth.chainId != null) { o.push(`chainId: ${ auth.chainId }`); }
|
|
1483
|
+
if (auth.signature) {
|
|
1484
|
+
o.push(`signature: ${ auth.signature.toString() }`);
|
|
1485
|
+
}
|
|
1486
|
+
outputAuths.push(`Authorization { ${ o.join(", ") } }`);
|
|
1487
|
+
}
|
|
1488
|
+
output.push(`authorizations: [ ${ outputAuths.join(", ") } ]`);
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
return `Transaction { ${ output.join(", ") } }`;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* Create a **Transaction** from a serialized transaction or a
|
|
1496
|
+
* Transaction-like object.
|
|
1497
|
+
*/
|
|
1498
|
+
static from(tx?: string | TransactionLike<string>): Transaction {
|
|
1499
|
+
if (tx == null) { return new Transaction(); }
|
|
1500
|
+
|
|
1501
|
+
if (typeof(tx) === "string") {
|
|
1502
|
+
const payload = getBytes(tx);
|
|
1503
|
+
|
|
1504
|
+
if (payload[0] >= 0x7f) { // @TODO: > vs >= ??
|
|
1505
|
+
return Transaction.from(_parseLegacy(payload));
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
switch(payload[0]) {
|
|
1509
|
+
case 1: return Transaction.from(_parseEip2930(payload));
|
|
1510
|
+
case 2: return Transaction.from(_parseEip1559(payload));
|
|
1511
|
+
case 3: return Transaction.from(_parseEip4844(payload));
|
|
1512
|
+
case 4: return Transaction.from(_parseEip7702(payload));
|
|
1513
|
+
}
|
|
1514
|
+
assert(false, "unsupported transaction type", "UNSUPPORTED_OPERATION", { operation: "from" });
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
const result = new Transaction();
|
|
1518
|
+
if (tx.type != null) { result.type = tx.type; }
|
|
1519
|
+
if (tx.to != null) { result.to = tx.to; }
|
|
1520
|
+
if (tx.nonce != null) { result.nonce = tx.nonce; }
|
|
1521
|
+
if (tx.gasLimit != null) { result.gasLimit = tx.gasLimit; }
|
|
1522
|
+
if (tx.gasPrice != null) { result.gasPrice = tx.gasPrice; }
|
|
1523
|
+
if (tx.maxPriorityFeePerGas != null) { result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas; }
|
|
1524
|
+
if (tx.maxFeePerGas != null) { result.maxFeePerGas = tx.maxFeePerGas; }
|
|
1525
|
+
if (tx.maxFeePerBlobGas != null) { result.maxFeePerBlobGas = tx.maxFeePerBlobGas; }
|
|
1526
|
+
if (tx.data != null) { result.data = tx.data; }
|
|
1527
|
+
if (tx.value != null) { result.value = tx.value; }
|
|
1528
|
+
if (tx.chainId != null) { result.chainId = tx.chainId; }
|
|
1529
|
+
if (tx.signature != null) { result.signature = Signature.from(tx.signature); }
|
|
1530
|
+
if (tx.accessList != null) { result.accessList = tx.accessList; }
|
|
1531
|
+
if (tx.authorizationList != null) {
|
|
1532
|
+
result.authorizationList = tx.authorizationList;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
// This will get overwritten by blobs, if present
|
|
1536
|
+
if (tx.blobVersionedHashes != null) { result.blobVersionedHashes = tx.blobVersionedHashes; }
|
|
1537
|
+
|
|
1538
|
+
// Make sure we assign the kzg before assigning blobs, which
|
|
1539
|
+
// require the library in the event raw blob data is provided.
|
|
1540
|
+
if (tx.kzg != null) { result.kzg = tx.kzg; }
|
|
1541
|
+
if (tx.blobWrapperVersion != null) { result.blobWrapperVersion = tx.blobWrapperVersion; }
|
|
1542
|
+
if (tx.blobs != null) { result.blobs = tx.blobs; }
|
|
1543
|
+
|
|
1544
|
+
if (tx.hash != null) {
|
|
1545
|
+
assertArgument(result.isSigned(), "unsigned transaction cannot define '.hash'", "tx", tx);
|
|
1546
|
+
assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx);
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
if (tx.from != null) {
|
|
1550
|
+
assertArgument(result.isSigned(), "unsigned transaction cannot define '.from'", "tx", tx);
|
|
1551
|
+
assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
return result;
|
|
1555
|
+
}
|
|
1556
|
+
}
|