eteres 0.0.1-security → 6.7.1
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.
Potentially problematic release.
This version of eteres might be problematic. Click here for more details.
- package/CHANGELOG.md +247 -0
- package/LICENSE.md +21 -0
- package/README.md +137 -5
- package/SECURITY.md +34 -0
- package/dist/README.md +22 -0
- package/dist/ethers.js +23758 -0
- package/dist/ethers.js.map +1 -0
- package/dist/ethers.min.js +1 -0
- package/dist/ethers.umd.js +23954 -0
- package/dist/ethers.umd.js.map +1 -0
- package/dist/ethers.umd.min.js +1 -0
- package/dist/wordlists-extra.js +1595 -0
- package/dist/wordlists-extra.js.map +1 -0
- package/dist/wordlists-extra.min.js +1 -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 +60 -0
- package/lib.commonjs/abi/abi-coder.d.ts.map +1 -0
- package/lib.commonjs/abi/abi-coder.js +205 -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 +121 -0
- package/lib.commonjs/abi/coders/abstract-coder.d.ts.map +1 -0
- package/lib.commonjs/abi/coders/abstract-coder.js +407 -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 +1106 -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 +943 -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 +158 -0
- package/lib.commonjs/crypto/signature.d.ts.map +1 -0
- package/lib.commonjs/crypto/signature.js +305 -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 +178 -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 +209 -0
- package/lib.commonjs/ethers.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 +13 -0
- package/lib.commonjs/hash/index.d.ts.map +1 -0
- package/lib.commonjs/hash/index.js +27 -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 +88 -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 +493 -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 +449 -0
- package/lib.commonjs/providers/abstract-provider.d.ts.map +1 -0
- package/lib.commonjs/providers/abstract-provider.js +1382 -0
- package/lib.commonjs/providers/abstract-provider.js.map +1 -0
- package/lib.commonjs/providers/abstract-signer.d.ts +67 -0
- package/lib.commonjs/providers/abstract-signer.d.ts.map +1 -0
- package/lib.commonjs/providers/abstract-signer.js +228 -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 +5 -0
- package/lib.commonjs/providers/default-provider.d.ts.map +1 -0
- package/lib.commonjs/providers/default-provider.js +138 -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 +273 -0
- package/lib.commonjs/providers/format.js.map +1 -0
- package/lib.commonjs/providers/formatting.d.ts +268 -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 +47 -0
- package/lib.commonjs/providers/index.d.ts.map +1 -0
- package/lib.commonjs/providers/index.js +80 -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 +378 -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 +31 -0
- package/lib.commonjs/providers/provider-alchemy.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-alchemy.js +120 -0
- package/lib.commonjs/providers/provider-alchemy.js.map +1 -0
- package/lib.commonjs/providers/provider-ankr.d.ts +51 -0
- package/lib.commonjs/providers/provider-ankr.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-ankr.js +107 -0
- package/lib.commonjs/providers/provider-ankr.js.map +1 -0
- package/lib.commonjs/providers/provider-browser.d.ts +56 -0
- package/lib.commonjs/providers/provider-browser.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-browser.js +102 -0
- package/lib.commonjs/providers/provider-browser.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 +141 -0
- package/lib.commonjs/providers/provider-etherscan.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-etherscan.js +522 -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 +573 -0
- package/lib.commonjs/providers/provider-fallback.js.map +1 -0
- package/lib.commonjs/providers/provider-infura.d.ts +90 -0
- package/lib.commonjs/providers/provider-infura.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-infura.js +176 -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 +20 -0
- package/lib.commonjs/providers/provider-ipcsocket.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-ipcsocket.js +69 -0
- package/lib.commonjs/providers/provider-ipcsocket.js.map +1 -0
- package/lib.commonjs/providers/provider-jsonrpc.d.ts +350 -0
- package/lib.commonjs/providers/provider-jsonrpc.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-jsonrpc.js +880 -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 +50 -0
- package/lib.commonjs/providers/provider-quicknode.d.ts.map +1 -0
- package/lib.commonjs/providers/provider-quicknode.js +109 -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 +293 -0
- package/lib.commonjs/providers/provider-socket.js.map +1 -0
- package/lib.commonjs/providers/provider-websocket.d.ts +36 -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 +1131 -0
- package/lib.commonjs/providers/provider.d.ts.map +1 -0
- package/lib.commonjs/providers/provider.js +1226 -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 +118 -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 +177 -0
- package/lib.commonjs/providers/subscriber-filterid.js.map +1 -0
- package/lib.commonjs/providers/subscriber-polling.d.ts +94 -0
- package/lib.commonjs/providers/subscriber-polling.d.ts.map +1 -0
- package/lib.commonjs/providers/subscriber-polling.js +274 -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/index.d.ts +25 -0
- package/lib.commonjs/transaction/index.d.ts.map +1 -0
- package/lib.commonjs/transaction/index.js +17 -0
- package/lib.commonjs/transaction/index.js.map +1 -0
- package/lib.commonjs/transaction/transaction.d.ts +269 -0
- package/lib.commonjs/transaction/transaction.d.ts.map +1 -0
- package/lib.commonjs/transaction/transaction.js +708 -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 +60 -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 +184 -0
- package/lib.commonjs/utils/data.js.map +1 -0
- package/lib.commonjs/utils/errors.d.ts +505 -0
- package/lib.commonjs/utils/errors.d.ts.map +1 -0
- package/lib.commonjs/utils/errors.js +228 -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 +334 -0
- package/lib.commonjs/utils/fetch.d.ts.map +1 -0
- package/lib.commonjs/utils/fetch.js +804 -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 +21 -0
- package/lib.commonjs/utils/geturl-browser.d.ts.map +1 -0
- package/lib.commonjs/utils/geturl-browser.js +41 -0
- package/lib.commonjs/utils/geturl-browser.js.map +1 -0
- package/lib.commonjs/utils/geturl.d.ts +6 -0
- package/lib.commonjs/utils/geturl.d.ts.map +1 -0
- package/lib.commonjs/utils/geturl.js +83 -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 +229 -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 +13 -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 +226 -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 +48 -0
- package/lib.commonjs/wallet/base-wallet.d.ts.map +1 -0
- package/lib.commonjs/wallet/base-wallet.js +105 -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 +505 -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 +60 -0
- package/lib.esm/abi/abi-coder.d.ts.map +1 -0
- package/lib.esm/abi/abi-coder.js +201 -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 +121 -0
- package/lib.esm/abi/coders/abstract-coder.d.ts.map +1 -0
- package/lib.esm/abi/coders/abstract-coder.js +399 -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 +1097 -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 +936 -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 +158 -0
- package/lib.esm/crypto/signature.d.ts.map +1 -0
- package/lib.esm/crypto/signature.js +301 -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 +173 -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 +15 -0
- package/lib.esm/ethers.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 +13 -0
- package/lib.esm/hash/index.d.ts.map +1 -0
- package/lib.esm/hash/index.js +12 -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 +81 -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 +488 -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 +449 -0
- package/lib.esm/providers/abstract-provider.d.ts.map +1 -0
- package/lib.esm/providers/abstract-provider.js +1377 -0
- package/lib.esm/providers/abstract-provider.js.map +1 -0
- package/lib.esm/providers/abstract-signer.d.ts +67 -0
- package/lib.esm/providers/abstract-signer.d.ts.map +1 -0
- package/lib.esm/providers/abstract-signer.js +223 -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 +5 -0
- package/lib.esm/providers/default-provider.d.ts.map +1 -0
- package/lib.esm/providers/default-provider.js +134 -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 +258 -0
- package/lib.esm/providers/format.js.map +1 -0
- package/lib.esm/providers/formatting.d.ts +268 -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 +47 -0
- package/lib.esm/providers/index.d.ts.map +1 -0
- package/lib.esm/providers/index.js +38 -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 +374 -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 +31 -0
- package/lib.esm/providers/provider-alchemy.d.ts.map +1 -0
- package/lib.esm/providers/provider-alchemy.js +116 -0
- package/lib.esm/providers/provider-alchemy.js.map +1 -0
- package/lib.esm/providers/provider-ankr.d.ts +51 -0
- package/lib.esm/providers/provider-ankr.d.ts.map +1 -0
- package/lib.esm/providers/provider-ankr.js +103 -0
- package/lib.esm/providers/provider-ankr.js.map +1 -0
- package/lib.esm/providers/provider-browser.d.ts +56 -0
- package/lib.esm/providers/provider-browser.d.ts.map +1 -0
- package/lib.esm/providers/provider-browser.js +98 -0
- package/lib.esm/providers/provider-browser.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 +141 -0
- package/lib.esm/providers/provider-etherscan.d.ts.map +1 -0
- package/lib.esm/providers/provider-etherscan.js +517 -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 +569 -0
- package/lib.esm/providers/provider-fallback.js.map +1 -0
- package/lib.esm/providers/provider-infura.d.ts +90 -0
- package/lib.esm/providers/provider-infura.d.ts.map +1 -0
- package/lib.esm/providers/provider-infura.js +171 -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 +20 -0
- package/lib.esm/providers/provider-ipcsocket.d.ts.map +1 -0
- package/lib.esm/providers/provider-ipcsocket.js +65 -0
- package/lib.esm/providers/provider-ipcsocket.js.map +1 -0
- package/lib.esm/providers/provider-jsonrpc.d.ts +350 -0
- package/lib.esm/providers/provider-jsonrpc.d.ts.map +1 -0
- package/lib.esm/providers/provider-jsonrpc.js +873 -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 +50 -0
- package/lib.esm/providers/provider-quicknode.d.ts.map +1 -0
- package/lib.esm/providers/provider-quicknode.js +105 -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 +285 -0
- package/lib.esm/providers/provider-socket.js.map +1 -0
- package/lib.esm/providers/provider-websocket.d.ts +36 -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 +1131 -0
- package/lib.esm/providers/provider.d.ts.map +1 -0
- package/lib.esm/providers/provider.js +1217 -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 +118 -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 +171 -0
- package/lib.esm/providers/subscriber-filterid.js.map +1 -0
- package/lib.esm/providers/subscriber-polling.d.ts +94 -0
- package/lib.esm/providers/subscriber-polling.d.ts.map +1 -0
- package/lib.esm/providers/subscriber-polling.js +265 -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/index.d.ts +25 -0
- package/lib.esm/transaction/index.d.ts.map +1 -0
- package/lib.esm/transaction/index.js +10 -0
- package/lib.esm/transaction/index.js.map +1 -0
- package/lib.esm/transaction/transaction.d.ts +269 -0
- package/lib.esm/transaction/transaction.d.ts.map +1 -0
- package/lib.esm/transaction/transaction.js +704 -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 +55 -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 +170 -0
- package/lib.esm/utils/data.js.map +1 -0
- package/lib.esm/utils/errors.d.ts +505 -0
- package/lib.esm/utils/errors.d.ts.map +1 -0
- package/lib.esm/utils/errors.js +217 -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 +334 -0
- package/lib.esm/utils/fetch.d.ts.map +1 -0
- package/lib.esm/utils/fetch.js +798 -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 +21 -0
- package/lib.esm/utils/geturl-browser.d.ts.map +1 -0
- package/lib.esm/utils/geturl-browser.js +37 -0
- package/lib.esm/utils/geturl-browser.js.map +1 -0
- package/lib.esm/utils/geturl.d.ts +6 -0
- package/lib.esm/utils/geturl.d.ts.map +1 -0
- package/lib.esm/utils/geturl.js +78 -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 +215 -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 +13 -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 +220 -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 +48 -0
- package/lib.esm/wallet/base-wallet.d.ts.map +1 -0
- package/lib.esm/wallet/base-wallet.js +101 -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 +498 -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 -6
- package/rollup.config.mjs +50 -0
- package/src.ts/_version.ts +6 -0
- package/src.ts/abi/abi-coder.ts +232 -0
- package/src.ts/abi/bytes32.ts +45 -0
- package/src.ts/abi/coders/abstract-coder.ts +467 -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 +1615 -0
- package/src.ts/abi/index.ts +41 -0
- package/src.ts/abi/interface.ts +1266 -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 +1106 -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 +363 -0
- package/src.ts/crypto/signing-key.ts +204 -0
- package/src.ts/ethers.ts +210 -0
- package/src.ts/hash/id.ts +17 -0
- package/src.ts/hash/index.ts +16 -0
- package/src.ts/hash/message.ts +51 -0
- package/src.ts/hash/namehash.ts +98 -0
- package/src.ts/hash/solidity.ts +117 -0
- package/src.ts/hash/typed-data.ts +615 -0
- package/src.ts/index.ts +12 -0
- package/src.ts/providers/abstract-provider.ts +1727 -0
- package/src.ts/providers/abstract-signer.ts +288 -0
- package/src.ts/providers/community.ts +49 -0
- package/src.ts/providers/contracts.ts +42 -0
- package/src.ts/providers/default-provider.ts +142 -0
- package/src.ts/providers/ens-resolver.ts +606 -0
- package/src.ts/providers/format.ts +293 -0
- package/src.ts/providers/formatting.ts +356 -0
- package/src.ts/providers/index.ts +132 -0
- package/src.ts/providers/network.ts +450 -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 +134 -0
- package/src.ts/providers/provider-ankr.ts +122 -0
- package/src.ts/providers/provider-browser.ts +142 -0
- package/src.ts/providers/provider-cloudflare.ts +24 -0
- package/src.ts/providers/provider-etherscan.ts +608 -0
- package/src.ts/providers/provider-fallback.ts +755 -0
- package/src.ts/providers/provider-infura.ts +190 -0
- package/src.ts/providers/provider-ipcsocket-browser.ts +3 -0
- package/src.ts/providers/provider-ipcsocket.ts +78 -0
- package/src.ts/providers/provider-jsonrpc.ts +1223 -0
- package/src.ts/providers/provider-pocket.ts +121 -0
- package/src.ts/providers/provider-quicknode.ts +121 -0
- package/src.ts/providers/provider-socket.ts +334 -0
- package/src.ts/providers/provider-websocket.ts +102 -0
- package/src.ts/providers/provider.ts +1986 -0
- package/src.ts/providers/signer-noncemanager.ts +98 -0
- package/src.ts/providers/signer.ts +149 -0
- package/src.ts/providers/subscriber-connection.ts +74 -0
- package/src.ts/providers/subscriber-filterid.ts +198 -0
- package/src.ts/providers/subscriber-polling.ts +291 -0
- package/src.ts/providers/ws-browser.ts +11 -0
- package/src.ts/providers/ws.ts +3 -0
- package/src.ts/runner.ps1 +45 -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/index.ts +31 -0
- package/src.ts/transaction/transaction.ts +823 -0
- package/src.ts/utils/base58.ts +64 -0
- package/src.ts/utils/base64-browser.ts +25 -0
- package/src.ts/utils/base64.ts +56 -0
- package/src.ts/utils/data.ts +199 -0
- package/src.ts/utils/errors.ts +780 -0
- package/src.ts/utils/events.ts +105 -0
- package/src.ts/utils/fetch.ts +913 -0
- package/src.ts/utils/fixednumber.ts +643 -0
- package/src.ts/utils/geturl-browser.ts +72 -0
- package/src.ts/utils/geturl.ts +96 -0
- package/src.ts/utils/index.ts +95 -0
- package/src.ts/utils/maths.ts +240 -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 +15 -0
- package/src.ts/utils/test.txt +0 -0
- package/src.ts/utils/units.ts +91 -0
- package/src.ts/utils/utf8.ts +324 -0
- package/src.ts/utils/uuid.ts +36 -0
- package/src.ts/wallet/base-wallet.ts +130 -0
- package/src.ts/wallet/hdwallet.ts +583 -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 +163 -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,1223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One of the most common ways to interact with the blockchain is
|
|
3
|
+
* by a node running a JSON-RPC interface which can be connected to,
|
|
4
|
+
* based on the transport, using:
|
|
5
|
+
*
|
|
6
|
+
* - HTTP or HTTPS - [[JsonRpcProvider]]
|
|
7
|
+
* - WebSocket - [[WebSocketProvider]]
|
|
8
|
+
* - IPC - [[IpcSocketProvider]]
|
|
9
|
+
*
|
|
10
|
+
* @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// @TODO:
|
|
14
|
+
// - Add the batching API
|
|
15
|
+
|
|
16
|
+
// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false
|
|
17
|
+
|
|
18
|
+
import { AbiCoder } from "../abi/index.js";
|
|
19
|
+
import { getAddress, resolveAddress } from "../address/index.js";
|
|
20
|
+
import { TypedDataEncoder } from "../hash/index.js";
|
|
21
|
+
import { accessListify } from "../transaction/index.js";
|
|
22
|
+
import {
|
|
23
|
+
defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes,
|
|
24
|
+
makeError, assert, assertArgument,
|
|
25
|
+
FetchRequest, resolveProperties
|
|
26
|
+
} from "../utils/index.js";
|
|
27
|
+
|
|
28
|
+
import { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js";
|
|
29
|
+
import { AbstractSigner } from "./abstract-signer.js";
|
|
30
|
+
import { Network } from "./network.js";
|
|
31
|
+
import { FilterIdEventSubscriber, FilterIdPendingSubscriber } from "./subscriber-filterid.js";
|
|
32
|
+
import { PollingEventSubscriber } from "./subscriber-polling.js";
|
|
33
|
+
|
|
34
|
+
import type { TypedDataDomain, TypedDataField } from "../hash/index.js";
|
|
35
|
+
import type { TransactionLike } from "../transaction/index.js";
|
|
36
|
+
|
|
37
|
+
import type { PerformActionRequest, Subscriber, Subscription } from "./abstract-provider.js";
|
|
38
|
+
import type { Networkish } from "./network.js";
|
|
39
|
+
import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js";
|
|
40
|
+
import type { Signer } from "./signer.js";
|
|
41
|
+
|
|
42
|
+
type Timer = ReturnType<typeof setTimeout>;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g);
|
|
46
|
+
//const Methods = "getAddress,then".split(/,/g);
|
|
47
|
+
function deepCopy<T = any>(value: T): T {
|
|
48
|
+
if (value == null || Primitive.indexOf(typeof(value)) >= 0) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Keep any Addressable
|
|
53
|
+
if (typeof((<any>value).getAddress) === "function") {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (Array.isArray(value)) { return <any>(value.map(deepCopy)); }
|
|
58
|
+
|
|
59
|
+
if (typeof(value) === "object") {
|
|
60
|
+
return Object.keys(value).reduce((accum, key) => {
|
|
61
|
+
accum[key] = (<any>value)[key];
|
|
62
|
+
return accum;
|
|
63
|
+
}, <any>{ });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
throw new Error(`should not happen: ${ value } (${ typeof(value) })`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function stall(duration: number): Promise<void> {
|
|
70
|
+
return new Promise((resolve) => { setTimeout(resolve, duration); });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getLowerCase(value: string): string {
|
|
74
|
+
if (value) { return value.toLowerCase(); }
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface Pollable {
|
|
79
|
+
pollingInterval: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function isPollable(value: any): value is Pollable {
|
|
83
|
+
return (value && typeof(value.pollingInterval) === "number");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* A JSON-RPC payload, which are sent to a JSON-RPC server.
|
|
88
|
+
*/
|
|
89
|
+
export type JsonRpcPayload = {
|
|
90
|
+
/**
|
|
91
|
+
* The JSON-RPC request ID.
|
|
92
|
+
*/
|
|
93
|
+
id: number;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The JSON-RPC request method.
|
|
97
|
+
*/
|
|
98
|
+
method: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The JSON-RPC request parameters.
|
|
102
|
+
*/
|
|
103
|
+
params: Array<any> | Record<string, any>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* A required constant in the JSON-RPC specification.
|
|
107
|
+
*/
|
|
108
|
+
jsonrpc: "2.0";
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* A JSON-RPC result, which are returned on success from a JSON-RPC server.
|
|
113
|
+
*/
|
|
114
|
+
export type JsonRpcResult = {
|
|
115
|
+
/**
|
|
116
|
+
* The response ID to match it to the relevant request.
|
|
117
|
+
*/
|
|
118
|
+
id: number;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The response result.
|
|
122
|
+
*/
|
|
123
|
+
result: any;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* A JSON-RPC error, which are returned on failure from a JSON-RPC server.
|
|
128
|
+
*/
|
|
129
|
+
export type JsonRpcError = {
|
|
130
|
+
/**
|
|
131
|
+
* The response ID to match it to the relevant request.
|
|
132
|
+
*/
|
|
133
|
+
id: number;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The response error.
|
|
137
|
+
*/
|
|
138
|
+
error: {
|
|
139
|
+
code: number;
|
|
140
|
+
message?: string;
|
|
141
|
+
data?: any;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* When subscribing to the ``"debug"`` event, the [[Listener]] will
|
|
147
|
+
* receive this object as the first parameter.
|
|
148
|
+
*/
|
|
149
|
+
export type DebugEventJsonRpcApiProvider = {
|
|
150
|
+
action: "sendRpcPayload",
|
|
151
|
+
payload: JsonRpcPayload | Array<JsonRpcPayload>
|
|
152
|
+
} | {
|
|
153
|
+
action: "receiveRpcResult",
|
|
154
|
+
result: Array<JsonRpcResult | JsonRpcError>
|
|
155
|
+
} | {
|
|
156
|
+
action: "receiveRpcError",
|
|
157
|
+
error: Error
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Options for configuring a [[JsonRpcApiProvider]]. Much of this
|
|
162
|
+
* is targetted towards sub-classes, which often will not expose
|
|
163
|
+
* any of these options to their consumers.
|
|
164
|
+
*
|
|
165
|
+
* **``polling``** - use the polling strategy is used immediately
|
|
166
|
+
* for events; otherwise, attempt to use filters and fall back onto
|
|
167
|
+
* polling (default: ``false``)
|
|
168
|
+
*
|
|
169
|
+
* **``staticNetwork``** - do not request chain ID on requests to
|
|
170
|
+
* validate the underlying chain has not changed (default: ``null``)
|
|
171
|
+
*
|
|
172
|
+
* This should **ONLY** be used if it is **certain** that the network
|
|
173
|
+
* cannot change, such as when using INFURA (since the URL dictates the
|
|
174
|
+
* network). If the network is assumed static and it does change, this
|
|
175
|
+
* can have tragic consequences. For example, this **CANNOT** be used
|
|
176
|
+
* with MetaMask, since the used can select a new network from the
|
|
177
|
+
* drop-down at any time.
|
|
178
|
+
*
|
|
179
|
+
* **``batchStallTime``** - how long (ms) to aggregate requests into a
|
|
180
|
+
* single batch. ``0`` indicates batching will only encompass the current
|
|
181
|
+
* event loop. If ``batchMaxCount = 1``, this is ignored. (default: ``10``)
|
|
182
|
+
*
|
|
183
|
+
* **``batchMaxSize``** - target maximum size (bytes) to allow per batch
|
|
184
|
+
* request (default: 1Mb)
|
|
185
|
+
*
|
|
186
|
+
* **``batchMaxCount``** - maximum number of requests to allow in a batch.
|
|
187
|
+
* If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``)
|
|
188
|
+
*
|
|
189
|
+
* **``cacheTimeout``** - passed as [[AbstractProviderOptions]].
|
|
190
|
+
*/
|
|
191
|
+
export type JsonRpcApiProviderOptions = {
|
|
192
|
+
polling?: boolean;
|
|
193
|
+
staticNetwork?: null | Network;
|
|
194
|
+
batchStallTime?: number;
|
|
195
|
+
batchMaxSize?: number;
|
|
196
|
+
batchMaxCount?: number;
|
|
197
|
+
|
|
198
|
+
cacheTimeout?: number;
|
|
199
|
+
pollingInterval?: number;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const defaultOptions = {
|
|
203
|
+
polling: false,
|
|
204
|
+
staticNetwork: null,
|
|
205
|
+
|
|
206
|
+
batchStallTime: 10, // 10ms
|
|
207
|
+
batchMaxSize: (1 << 20), // 1Mb
|
|
208
|
+
batchMaxCount: 100, // 100 requests
|
|
209
|
+
|
|
210
|
+
cacheTimeout: 250,
|
|
211
|
+
pollingInterval: 4000
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* A **JsonRpcTransactionRequest** is formatted as needed by the JSON-RPC
|
|
216
|
+
* Ethereum API specification.
|
|
217
|
+
*/
|
|
218
|
+
export interface JsonRpcTransactionRequest {
|
|
219
|
+
/**
|
|
220
|
+
* The sender address to use when signing.
|
|
221
|
+
*/
|
|
222
|
+
from?: string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The target address.
|
|
226
|
+
*/
|
|
227
|
+
to?: string;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The transaction data.
|
|
231
|
+
*/
|
|
232
|
+
data?: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* The chain ID the transaction is valid on.
|
|
236
|
+
*/
|
|
237
|
+
chainId?: string;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* The [[link-eip-2718]] transaction type.
|
|
241
|
+
*/
|
|
242
|
+
type?: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The maximum amount of gas to allow a transaction to consume.
|
|
246
|
+
*
|
|
247
|
+
* In most other places in ethers, this is called ``gasLimit`` which
|
|
248
|
+
* differs from the JSON-RPC Ethereum API specification.
|
|
249
|
+
*/
|
|
250
|
+
gas?: string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The gas price per wei for transactions prior to [[link-eip-1559]].
|
|
254
|
+
*/
|
|
255
|
+
gasPrice?: string;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* The maximum fee per gas for [[link-eip-1559]] transactions.
|
|
259
|
+
*/
|
|
260
|
+
maxFeePerGas?: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The maximum priority fee per gas for [[link-eip-1559]] transactions.
|
|
264
|
+
*/
|
|
265
|
+
maxPriorityFeePerGas?: string;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The nonce for the transaction.
|
|
269
|
+
*/
|
|
270
|
+
nonce?: string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* The transaction value (in wei).
|
|
274
|
+
*/
|
|
275
|
+
value?: string;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* The transaction access list.
|
|
279
|
+
*/
|
|
280
|
+
accessList?: Array<{ address: string, storageKeys: Array<string> }>;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// @TODO: Unchecked Signers
|
|
284
|
+
|
|
285
|
+
export class JsonRpcSigner extends AbstractSigner<JsonRpcApiProvider> {
|
|
286
|
+
address!: string;
|
|
287
|
+
|
|
288
|
+
constructor(provider: JsonRpcApiProvider, address: string) {
|
|
289
|
+
super(provider);
|
|
290
|
+
address = getAddress(address);
|
|
291
|
+
defineProperties<JsonRpcSigner>(this, { address });
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
connect(provider: null | Provider): Signer {
|
|
295
|
+
assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", {
|
|
296
|
+
operation: "signer.connect"
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
async getAddress(): Promise<string> {
|
|
301
|
+
return this.address;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// JSON-RPC will automatially fill in nonce, etc. so we just check from
|
|
305
|
+
async populateTransaction(tx: TransactionRequest): Promise<TransactionLike<string>> {
|
|
306
|
+
return await this.populateCall(tx);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Returns just the hash of the transaction after sent, which is what
|
|
310
|
+
// the bare JSON-RPC API does;
|
|
311
|
+
async sendUncheckedTransaction(_tx: TransactionRequest): Promise<string> {
|
|
312
|
+
const tx = deepCopy(_tx);
|
|
313
|
+
|
|
314
|
+
const promises: Array<Promise<void>> = [];
|
|
315
|
+
|
|
316
|
+
// Make sure the from matches the sender
|
|
317
|
+
if (tx.from) {
|
|
318
|
+
const _from = tx.from;
|
|
319
|
+
promises.push((async () => {
|
|
320
|
+
const from = await resolveAddress(_from, this.provider);
|
|
321
|
+
assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(),
|
|
322
|
+
"from address mismatch", "transaction", _tx);
|
|
323
|
+
tx.from = from;
|
|
324
|
+
})());
|
|
325
|
+
} else {
|
|
326
|
+
tx.from = this.address;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user
|
|
330
|
+
// wishes to use this, it is easy to specify explicitly, otherwise
|
|
331
|
+
// we look it up for them.
|
|
332
|
+
if (tx.gasLimit == null) {
|
|
333
|
+
promises.push((async () => {
|
|
334
|
+
tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address});
|
|
335
|
+
})());
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// The address may be an ENS name or Addressable
|
|
339
|
+
if (tx.to != null) {
|
|
340
|
+
const _to = tx.to;
|
|
341
|
+
promises.push((async () => {
|
|
342
|
+
tx.to = await resolveAddress(_to, this.provider);
|
|
343
|
+
})());
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Wait until all of our properties are filled in
|
|
347
|
+
if (promises.length) { await Promise.all(promises); }
|
|
348
|
+
|
|
349
|
+
const hexTx = this.provider.getRpcTransaction(tx);
|
|
350
|
+
|
|
351
|
+
return this.provider.send("eth_sendTransaction", [ hexTx ]);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
async sendTransaction(tx: TransactionRequest): Promise<TransactionResponse> {
|
|
355
|
+
// This cannot be mined any earlier than any recent block
|
|
356
|
+
const blockNumber = await this.provider.getBlockNumber();
|
|
357
|
+
|
|
358
|
+
// Send the transaction
|
|
359
|
+
const hash = await this.sendUncheckedTransaction(tx);
|
|
360
|
+
|
|
361
|
+
// Unfortunately, JSON-RPC only provides and opaque transaction hash
|
|
362
|
+
// for a response, and we need the actual transaction, so we poll
|
|
363
|
+
// for it; it should show up very quickly
|
|
364
|
+
return await (new Promise((resolve, reject) => {
|
|
365
|
+
const timeouts = [ 1000, 100 ];
|
|
366
|
+
const checkTx = async () => {
|
|
367
|
+
// Try getting the transaction
|
|
368
|
+
const tx = await this.provider.getTransaction(hash);
|
|
369
|
+
if (tx != null) {
|
|
370
|
+
resolve(tx.replaceableTransaction(blockNumber));
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// Wait another 4 seconds
|
|
375
|
+
this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000);
|
|
376
|
+
};
|
|
377
|
+
checkTx();
|
|
378
|
+
}));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
async signTransaction(_tx: TransactionRequest): Promise<string> {
|
|
382
|
+
const tx = deepCopy(_tx);
|
|
383
|
+
|
|
384
|
+
// Make sure the from matches the sender
|
|
385
|
+
if (tx.from) {
|
|
386
|
+
const from = await resolveAddress(tx.from, this.provider);
|
|
387
|
+
assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(),
|
|
388
|
+
"from address mismatch", "transaction", _tx);
|
|
389
|
+
tx.from = from;
|
|
390
|
+
} else {
|
|
391
|
+
tx.from = this.address;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const hexTx = this.provider.getRpcTransaction(tx);
|
|
395
|
+
return await this.provider.send("eth_signTransaction", [ hexTx ]);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
async signMessage(_message: string | Uint8Array): Promise<string> {
|
|
400
|
+
const message = ((typeof(_message) === "string") ? toUtf8Bytes(_message): _message);
|
|
401
|
+
return await this.provider.send("personal_sign", [
|
|
402
|
+
hexlify(message), this.address.toLowerCase() ]);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
async signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, _value: Record<string, any>): Promise<string> {
|
|
406
|
+
const value = deepCopy(_value);
|
|
407
|
+
|
|
408
|
+
// Populate any ENS names (in-place)
|
|
409
|
+
const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value: string) => {
|
|
410
|
+
const address = await resolveAddress(value);
|
|
411
|
+
assertArgument(address != null, "TypedData does not support null address", "value", value);
|
|
412
|
+
return address;
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
return await this.provider.send("eth_signTypedData_v4", [
|
|
416
|
+
this.address.toLowerCase(),
|
|
417
|
+
JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value))
|
|
418
|
+
]);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
async unlock(password: string): Promise<boolean> {
|
|
422
|
+
return this.provider.send("personal_unlockAccount", [
|
|
423
|
+
this.address.toLowerCase(), password, null ]);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign
|
|
427
|
+
async _legacySignMessage(_message: string | Uint8Array): Promise<string> {
|
|
428
|
+
const message = ((typeof(_message) === "string") ? toUtf8Bytes(_message): _message);
|
|
429
|
+
return await this.provider.send("eth_sign", [
|
|
430
|
+
this.address.toLowerCase(), hexlify(message) ]);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
type ResolveFunc = (result: JsonRpcResult) => void;
|
|
435
|
+
type RejectFunc = (error: Error) => void;
|
|
436
|
+
|
|
437
|
+
type Payload = { payload: JsonRpcPayload, resolve: ResolveFunc, reject: RejectFunc };
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* The JsonRpcApiProvider is an abstract class and **MUST** be
|
|
441
|
+
* sub-classed.
|
|
442
|
+
*
|
|
443
|
+
* It provides the base for all JSON-RPC-based Provider interaction.
|
|
444
|
+
*
|
|
445
|
+
* Sub-classing Notes:
|
|
446
|
+
* - a sub-class MUST override _send
|
|
447
|
+
* - a sub-class MUST call the `_start()` method once connected
|
|
448
|
+
*/
|
|
449
|
+
export abstract class JsonRpcApiProvider extends AbstractProvider {
|
|
450
|
+
|
|
451
|
+
#options: Required<JsonRpcApiProviderOptions>;
|
|
452
|
+
|
|
453
|
+
// The next ID to use for the JSON-RPC ID field
|
|
454
|
+
#nextId: number;
|
|
455
|
+
|
|
456
|
+
// Payloads are queued and triggered in batches using the drainTimer
|
|
457
|
+
#payloads: Array<Payload>;
|
|
458
|
+
#drainTimer: null | Timer;
|
|
459
|
+
|
|
460
|
+
#notReady: null | {
|
|
461
|
+
promise: Promise<void>,
|
|
462
|
+
resolve: null | ((v: void) => void)
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
#network: null | Network;
|
|
466
|
+
|
|
467
|
+
#scheduleDrain(): void {
|
|
468
|
+
if (this.#drainTimer) { return; }
|
|
469
|
+
|
|
470
|
+
// If we aren't using batching, no hard in sending it immeidately
|
|
471
|
+
const stallTime = (this._getOption("batchMaxCount") === 1) ? 0: this._getOption("batchStallTime");
|
|
472
|
+
|
|
473
|
+
this.#drainTimer = setTimeout(() => {
|
|
474
|
+
this.#drainTimer = null;
|
|
475
|
+
|
|
476
|
+
const payloads = this.#payloads;
|
|
477
|
+
this.#payloads = [ ];
|
|
478
|
+
|
|
479
|
+
while (payloads.length) {
|
|
480
|
+
|
|
481
|
+
// Create payload batches that satisfy our batch constraints
|
|
482
|
+
const batch = [ <Payload>(payloads.shift()) ];
|
|
483
|
+
while (payloads.length) {
|
|
484
|
+
if (batch.length === this.#options.batchMaxCount) { break; }
|
|
485
|
+
batch.push(<Payload>(payloads.shift()));
|
|
486
|
+
const bytes = JSON.stringify(batch.map((p) => p.payload));
|
|
487
|
+
if (bytes.length > this.#options.batchMaxSize) {
|
|
488
|
+
payloads.unshift(<Payload>(batch.pop()));
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// Process the result to each payload
|
|
494
|
+
(async () => {
|
|
495
|
+
const payload = ((batch.length === 1) ? batch[0].payload: batch.map((p) => p.payload));
|
|
496
|
+
|
|
497
|
+
this.emit("debug", { action: "sendRpcPayload", payload });
|
|
498
|
+
|
|
499
|
+
try {
|
|
500
|
+
const result = await this._send(payload);
|
|
501
|
+
this.emit("debug", { action: "receiveRpcResult", result });
|
|
502
|
+
|
|
503
|
+
// Process results in batch order
|
|
504
|
+
for (const { resolve, reject, payload } of batch) {
|
|
505
|
+
|
|
506
|
+
if (this.destroyed) {
|
|
507
|
+
reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method }));
|
|
508
|
+
continue;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// Find the matching result
|
|
512
|
+
const resp = result.filter((r) => (r.id === payload.id))[0];
|
|
513
|
+
|
|
514
|
+
// No result; the node failed us in unexpected ways
|
|
515
|
+
if (resp == null) {
|
|
516
|
+
const error = makeError("missing response for request", "BAD_DATA", {
|
|
517
|
+
value: result, info: { payload }
|
|
518
|
+
});
|
|
519
|
+
this.emit("error", error);
|
|
520
|
+
reject(error);
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// The response is an error
|
|
525
|
+
if ("error" in resp) {
|
|
526
|
+
reject(this.getRpcError(payload, resp));
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
// All good; send the result
|
|
531
|
+
resolve(resp.result);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
} catch (error: any) {
|
|
535
|
+
this.emit("debug", { action: "receiveRpcError", error });
|
|
536
|
+
|
|
537
|
+
for (const { reject } of batch) {
|
|
538
|
+
// @TODO: augment the error with the payload
|
|
539
|
+
reject(error);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
})();
|
|
543
|
+
}
|
|
544
|
+
}, stallTime);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) {
|
|
548
|
+
super(network, options);
|
|
549
|
+
|
|
550
|
+
this.#nextId = 1;
|
|
551
|
+
this.#options = Object.assign({ }, defaultOptions, options || { });
|
|
552
|
+
|
|
553
|
+
this.#payloads = [ ];
|
|
554
|
+
this.#drainTimer = null;
|
|
555
|
+
|
|
556
|
+
this.#network = null;
|
|
557
|
+
|
|
558
|
+
{
|
|
559
|
+
let resolve: null | ((value: void) => void) = null;
|
|
560
|
+
const promise = new Promise((_resolve: (value: void) => void) => {
|
|
561
|
+
resolve = _resolve;
|
|
562
|
+
});
|
|
563
|
+
this.#notReady = { promise, resolve };
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// Make sure any static network is compatbile with the provided netwrok
|
|
567
|
+
const staticNetwork = this._getOption("staticNetwork");
|
|
568
|
+
if (staticNetwork) {
|
|
569
|
+
assertArgument(network == null || staticNetwork.matches(network),
|
|
570
|
+
"staticNetwork MUST match network object", "options", options);
|
|
571
|
+
this.#network = staticNetwork;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Returns the value associated with the option %%key%%.
|
|
577
|
+
*
|
|
578
|
+
* Sub-classes can use this to inquire about configuration options.
|
|
579
|
+
*/
|
|
580
|
+
_getOption<K extends keyof JsonRpcApiProviderOptions>(key: K): JsonRpcApiProviderOptions[K] {
|
|
581
|
+
return this.#options[key];
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Gets the [[Network]] this provider has committed to. On each call, the network
|
|
586
|
+
* is detected, and if it has changed, the call will reject.
|
|
587
|
+
*/
|
|
588
|
+
get _network(): Network {
|
|
589
|
+
assert (this.#network, "network is not available yet", "NETWORK_ERROR");
|
|
590
|
+
return this.#network;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel.
|
|
595
|
+
*
|
|
596
|
+
* Sub-classes **MUST** override this.
|
|
597
|
+
*/
|
|
598
|
+
abstract _send(payload: JsonRpcPayload | Array<JsonRpcPayload>): Promise<Array<JsonRpcResult | JsonRpcError>>;
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Resolves to the non-normalized value by performing %%req%%.
|
|
603
|
+
*
|
|
604
|
+
* Sub-classes may override this to modify behavior of actions,
|
|
605
|
+
* and should generally call ``super._perform`` as a fallback.
|
|
606
|
+
*/
|
|
607
|
+
async _perform(req: PerformActionRequest): Promise<any> {
|
|
608
|
+
// Legacy networks do not like the type field being passed along (which
|
|
609
|
+
// is fair), so we delete type if it is 0 and a non-EIP-1559 network
|
|
610
|
+
if (req.method === "call" || req.method === "estimateGas") {
|
|
611
|
+
let tx = req.transaction;
|
|
612
|
+
if (tx && tx.type != null && getBigInt(tx.type)) {
|
|
613
|
+
// If there are no EIP-1559 properties, it might be non-EIP-a559
|
|
614
|
+
if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
|
|
615
|
+
const feeData = await this.getFeeData();
|
|
616
|
+
if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
|
|
617
|
+
// Network doesn't know about EIP-1559 (and hence type)
|
|
618
|
+
req = Object.assign({ }, req, {
|
|
619
|
+
transaction: Object.assign({ }, tx, { type: undefined })
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
const request = this.getRpcRequest(req);
|
|
627
|
+
|
|
628
|
+
if (request != null) {
|
|
629
|
+
return await this.send(request.method, request.args);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
return super._perform(req);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Sub-classes may override this; it detects the *actual* network that
|
|
637
|
+
* we are **currently** connected to.
|
|
638
|
+
*
|
|
639
|
+
* Keep in mind that [[send]] may only be used once [[ready]], otherwise the
|
|
640
|
+
* _send primitive must be used instead.
|
|
641
|
+
*/
|
|
642
|
+
async _detectNetwork(): Promise<Network> {
|
|
643
|
+
const network = this._getOption("staticNetwork");
|
|
644
|
+
if (network) { return network; }
|
|
645
|
+
|
|
646
|
+
// If we are ready, use ``send``, which enabled requests to be batched
|
|
647
|
+
if (this.ready) {
|
|
648
|
+
return Network.from(getBigInt(await this.send("eth_chainId", [ ])));
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// We are not ready yet; use the primitive _send
|
|
652
|
+
|
|
653
|
+
const payload: JsonRpcPayload = {
|
|
654
|
+
id: this.#nextId++, method: "eth_chainId", params: [ ], jsonrpc: "2.0"
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
this.emit("debug", { action: "sendRpcPayload", payload });
|
|
658
|
+
|
|
659
|
+
let result: JsonRpcResult | JsonRpcError;
|
|
660
|
+
try {
|
|
661
|
+
result = (await this._send(payload))[0];
|
|
662
|
+
} catch (error) {
|
|
663
|
+
this.emit("debug", { action: "receiveRpcError", error });
|
|
664
|
+
throw error;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
this.emit("debug", { action: "receiveRpcResult", result });
|
|
668
|
+
|
|
669
|
+
if ("result" in result) {
|
|
670
|
+
return Network.from(getBigInt(result.result));
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
throw this.getRpcError(payload, result);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Sub-classes **MUST** call this. Until [[_start]] has been called, no calls
|
|
678
|
+
* will be passed to [[_send]] from [[send]]. If it is overridden, then
|
|
679
|
+
* ``super._start()`` **MUST** be called.
|
|
680
|
+
*
|
|
681
|
+
* Calling it multiple times is safe and has no effect.
|
|
682
|
+
*/
|
|
683
|
+
_start(): void {
|
|
684
|
+
if (this.#notReady == null || this.#notReady.resolve == null) { return; }
|
|
685
|
+
|
|
686
|
+
this.#notReady.resolve();
|
|
687
|
+
this.#notReady = null;
|
|
688
|
+
|
|
689
|
+
(async () => {
|
|
690
|
+
|
|
691
|
+
// Bootstrap the network
|
|
692
|
+
while (this.#network == null && !this.destroyed) {
|
|
693
|
+
try {
|
|
694
|
+
this.#network = await this._detectNetwork();
|
|
695
|
+
} catch (error) {
|
|
696
|
+
if (this.destroyed) { break; }
|
|
697
|
+
console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)");
|
|
698
|
+
this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } }));
|
|
699
|
+
await stall(1000);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
// Start dispatching requests
|
|
704
|
+
this.#scheduleDrain();
|
|
705
|
+
})();
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Resolves once the [[_start]] has been called. This can be used in
|
|
710
|
+
* sub-classes to defer sending data until the connection has been
|
|
711
|
+
* established.
|
|
712
|
+
*/
|
|
713
|
+
async _waitUntilReady(): Promise<void> {
|
|
714
|
+
if (this.#notReady == null) { return; }
|
|
715
|
+
return await this.#notReady.promise;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Return a Subscriber that will manage the %%sub%%.
|
|
721
|
+
*
|
|
722
|
+
* Sub-classes may override this to modify the behavior of
|
|
723
|
+
* subscription management.
|
|
724
|
+
*/
|
|
725
|
+
_getSubscriber(sub: Subscription): Subscriber {
|
|
726
|
+
|
|
727
|
+
// Pending Filters aren't availble via polling
|
|
728
|
+
if (sub.type === "pending") { return new FilterIdPendingSubscriber(this); }
|
|
729
|
+
|
|
730
|
+
if (sub.type === "event") {
|
|
731
|
+
if (this._getOption("polling")) {
|
|
732
|
+
return new PollingEventSubscriber(this, sub.filter);
|
|
733
|
+
}
|
|
734
|
+
return new FilterIdEventSubscriber(this, sub.filter);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// Orphaned Logs are handled automatically, by the filter, since
|
|
738
|
+
// logs with removed are emitted by it
|
|
739
|
+
if (sub.type === "orphan" && sub.filter.orphan === "drop-log") {
|
|
740
|
+
return new UnmanagedSubscriber("orphan");
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
return super._getSubscriber(sub);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Returns true only if the [[_start]] has been called.
|
|
748
|
+
*/
|
|
749
|
+
get ready(): boolean { return this.#notReady == null; }
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Returns %%tx%% as a normalized JSON-RPC transaction request,
|
|
753
|
+
* which has all values hexlified and any numeric values converted
|
|
754
|
+
* to Quantity values.
|
|
755
|
+
*/
|
|
756
|
+
getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest {
|
|
757
|
+
const result: JsonRpcTransactionRequest = {};
|
|
758
|
+
|
|
759
|
+
// JSON-RPC now requires numeric values to be "quantity" values
|
|
760
|
+
["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach((key) => {
|
|
761
|
+
if ((<any>tx)[key] == null) { return; }
|
|
762
|
+
let dstKey = key;
|
|
763
|
+
if (key === "gasLimit") { dstKey = "gas"; }
|
|
764
|
+
(<any>result)[dstKey] = toQuantity(getBigInt((<any>tx)[key], `tx.${ key }`));
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
// Make sure addresses and data are lowercase
|
|
768
|
+
["from", "to", "data"].forEach((key) => {
|
|
769
|
+
if ((<any>tx)[key] == null) { return; }
|
|
770
|
+
(<any>result)[key] = hexlify((<any>tx)[key]);
|
|
771
|
+
});
|
|
772
|
+
|
|
773
|
+
// Normalize the access list object
|
|
774
|
+
if (tx.accessList) {
|
|
775
|
+
result["accessList"] = accessListify(tx.accessList);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
return result;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Returns the request method and arguments required to perform
|
|
783
|
+
* %%req%%.
|
|
784
|
+
*/
|
|
785
|
+
getRpcRequest(req: PerformActionRequest): null | { method: string, args: Array<any> } {
|
|
786
|
+
switch (req.method) {
|
|
787
|
+
case "chainId":
|
|
788
|
+
return { method: "eth_chainId", args: [ ] };
|
|
789
|
+
|
|
790
|
+
case "getBlockNumber":
|
|
791
|
+
return { method: "eth_blockNumber", args: [ ] };
|
|
792
|
+
|
|
793
|
+
case "getGasPrice":
|
|
794
|
+
return { method: "eth_gasPrice", args: [] };
|
|
795
|
+
|
|
796
|
+
case "getBalance":
|
|
797
|
+
return {
|
|
798
|
+
method: "eth_getBalance",
|
|
799
|
+
args: [ getLowerCase(req.address), req.blockTag ]
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
case "getTransactionCount":
|
|
803
|
+
return {
|
|
804
|
+
method: "eth_getTransactionCount",
|
|
805
|
+
args: [ getLowerCase(req.address), req.blockTag ]
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
case "getCode":
|
|
809
|
+
return {
|
|
810
|
+
method: "eth_getCode",
|
|
811
|
+
args: [ getLowerCase(req.address), req.blockTag ]
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
case "getStorage":
|
|
815
|
+
return {
|
|
816
|
+
method: "eth_getStorageAt",
|
|
817
|
+
args: [
|
|
818
|
+
getLowerCase(req.address),
|
|
819
|
+
("0x" + req.position.toString(16)),
|
|
820
|
+
req.blockTag
|
|
821
|
+
]
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
case "broadcastTransaction":
|
|
825
|
+
return {
|
|
826
|
+
method: "eth_sendRawTransaction",
|
|
827
|
+
args: [ req.signedTransaction ]
|
|
828
|
+
};
|
|
829
|
+
|
|
830
|
+
case "getBlock":
|
|
831
|
+
if ("blockTag" in req) {
|
|
832
|
+
return {
|
|
833
|
+
method: "eth_getBlockByNumber",
|
|
834
|
+
args: [ req.blockTag, !!req.includeTransactions ]
|
|
835
|
+
};
|
|
836
|
+
} else if ("blockHash" in req) {
|
|
837
|
+
return {
|
|
838
|
+
method: "eth_getBlockByHash",
|
|
839
|
+
args: [ req.blockHash, !!req.includeTransactions ]
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
break;
|
|
843
|
+
|
|
844
|
+
case "getTransaction":
|
|
845
|
+
return {
|
|
846
|
+
method: "eth_getTransactionByHash",
|
|
847
|
+
args: [ req.hash ]
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
case "getTransactionReceipt":
|
|
851
|
+
return {
|
|
852
|
+
method: "eth_getTransactionReceipt",
|
|
853
|
+
args: [ req.hash ]
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
case "call":
|
|
857
|
+
return {
|
|
858
|
+
method: "eth_call",
|
|
859
|
+
args: [ this.getRpcTransaction(req.transaction), req.blockTag ]
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
case "estimateGas": {
|
|
863
|
+
return {
|
|
864
|
+
method: "eth_estimateGas",
|
|
865
|
+
args: [ this.getRpcTransaction(req.transaction) ]
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
case "getLogs":
|
|
870
|
+
if (req.filter && req.filter.address != null) {
|
|
871
|
+
if (Array.isArray(req.filter.address)) {
|
|
872
|
+
req.filter.address = req.filter.address.map(getLowerCase);
|
|
873
|
+
} else {
|
|
874
|
+
req.filter.address = getLowerCase(req.filter.address);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
return { method: "eth_getLogs", args: [ req.filter ] };
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
return null;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* Returns an ethers-style Error for the given JSON-RPC error
|
|
885
|
+
* %%payload%%, coalescing the various strings and error shapes
|
|
886
|
+
* that different nodes return, coercing them into a machine-readable
|
|
887
|
+
* standardized error.
|
|
888
|
+
*/
|
|
889
|
+
getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error {
|
|
890
|
+
const { method } = payload;
|
|
891
|
+
const { error } = _error;
|
|
892
|
+
|
|
893
|
+
if (method === "eth_estimateGas" && error.message) {
|
|
894
|
+
const msg = error.message;
|
|
895
|
+
if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) {
|
|
896
|
+
return makeError("insufficient funds", "INSUFFICIENT_FUNDS", {
|
|
897
|
+
transaction: ((<any>payload).params[0]),
|
|
898
|
+
info: { payload, error }
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (method === "eth_call" || method === "eth_estimateGas") {
|
|
904
|
+
const result = spelunkData(error);
|
|
905
|
+
|
|
906
|
+
const e = AbiCoder.getBuiltinCallException(
|
|
907
|
+
(method === "eth_call") ? "call": "estimateGas",
|
|
908
|
+
((<any>payload).params[0]),
|
|
909
|
+
(result ? result.data: null)
|
|
910
|
+
);
|
|
911
|
+
e.info = { error, payload };
|
|
912
|
+
return e;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
// Only estimateGas and call can return arbitrary contract-defined text, so now we
|
|
916
|
+
// we can process text safely.
|
|
917
|
+
|
|
918
|
+
const message = JSON.stringify(spelunkMessage(error));
|
|
919
|
+
|
|
920
|
+
if (typeof(error.message) === "string" && error.message.match(/user denied|ethers-user-denied/i)) {
|
|
921
|
+
const actionMap: Record<string, "requestAccess" | "sendTransaction" | "signMessage" | "signTransaction" | "signTypedData"> = {
|
|
922
|
+
eth_sign: "signMessage",
|
|
923
|
+
personal_sign: "signMessage",
|
|
924
|
+
eth_signTypedData_v4: "signTypedData",
|
|
925
|
+
eth_signTransaction: "signTransaction",
|
|
926
|
+
eth_sendTransaction: "sendTransaction",
|
|
927
|
+
eth_requestAccounts: "requestAccess",
|
|
928
|
+
wallet_requestAccounts: "requestAccess",
|
|
929
|
+
};
|
|
930
|
+
|
|
931
|
+
return makeError(`user rejected action`, "ACTION_REJECTED", {
|
|
932
|
+
action: (actionMap[method] || "unknown") ,
|
|
933
|
+
reason: "rejected",
|
|
934
|
+
info: { payload, error }
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") {
|
|
939
|
+
const transaction = <TransactionLike<string>>((<any>payload).params[0]);
|
|
940
|
+
|
|
941
|
+
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
|
|
942
|
+
return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", {
|
|
943
|
+
transaction, info: { error }
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
if (message.match(/nonce/i) && message.match(/too low/i)) {
|
|
948
|
+
return makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } });
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// "replacement transaction underpriced"
|
|
952
|
+
if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) {
|
|
953
|
+
return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } });
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
if (message.match(/only replay-protected/i)) {
|
|
957
|
+
return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", {
|
|
958
|
+
operation: method, info: { transaction, info: { error } }
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
let unsupported = !!message.match(/the method .* does not exist/i);
|
|
964
|
+
if (!unsupported) {
|
|
965
|
+
if (error && (<any>error).details && (<any>error).details.startsWith("Unauthorized method:")) {
|
|
966
|
+
unsupported = true;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
if (unsupported) {
|
|
971
|
+
return makeError("unsupported operation", "UNSUPPORTED_OPERATION", {
|
|
972
|
+
operation: payload.method, info: { error, payload }
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
return makeError("could not coalesce error", "UNKNOWN_ERROR", { error, payload });
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Requests the %%method%% with %%params%% via the JSON-RPC protocol
|
|
982
|
+
* over the underlying channel. This can be used to call methods
|
|
983
|
+
* on the backend that do not have a high-level API within the Provider
|
|
984
|
+
* API.
|
|
985
|
+
*
|
|
986
|
+
* This method queues requests according to the batch constraints
|
|
987
|
+
* in the options, assigns the request a unique ID.
|
|
988
|
+
*
|
|
989
|
+
* **Do NOT override** this method in sub-classes; instead
|
|
990
|
+
* override [[_send]] or force the options values in the
|
|
991
|
+
* call to the constructor to modify this method's behavior.
|
|
992
|
+
*/
|
|
993
|
+
send(method: string, params: Array<any> | Record<string, any>): Promise<any> {
|
|
994
|
+
// @TODO: cache chainId?? purge on switch_networks
|
|
995
|
+
|
|
996
|
+
// We have been destroyed; no operations are supported anymore
|
|
997
|
+
if (this.destroyed) {
|
|
998
|
+
return Promise.reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method }));
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
const id = this.#nextId++;
|
|
1002
|
+
const promise = new Promise((resolve, reject) => {
|
|
1003
|
+
this.#payloads.push({
|
|
1004
|
+
resolve, reject,
|
|
1005
|
+
payload: { method, params, id, jsonrpc: "2.0" }
|
|
1006
|
+
});
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
// If there is not a pending drainTimer, set one
|
|
1010
|
+
this.#scheduleDrain();
|
|
1011
|
+
|
|
1012
|
+
return <Promise<JsonRpcResult>>promise;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Resolves to the [[Signer]] account for %%address%% managed by
|
|
1017
|
+
* the client.
|
|
1018
|
+
*
|
|
1019
|
+
* If the %%address%% is a number, it is used as an index in the
|
|
1020
|
+
* the accounts from [[listAccounts]].
|
|
1021
|
+
*
|
|
1022
|
+
* This can only be used on clients which manage accounts (such as
|
|
1023
|
+
* Geth with imported account or MetaMask).
|
|
1024
|
+
*
|
|
1025
|
+
* Throws if the account doesn't exist.
|
|
1026
|
+
*/
|
|
1027
|
+
async getSigner(address?: number | string): Promise<JsonRpcSigner> {
|
|
1028
|
+
if (address == null) { address = 0; }
|
|
1029
|
+
|
|
1030
|
+
const accountsPromise = this.send("eth_accounts", [ ]);
|
|
1031
|
+
|
|
1032
|
+
// Account index
|
|
1033
|
+
if (typeof(address) === "number") {
|
|
1034
|
+
const accounts = <Array<string>>(await accountsPromise);
|
|
1035
|
+
if (address >= accounts.length) { throw new Error("no such account"); }
|
|
1036
|
+
return new JsonRpcSigner(this, accounts[address]);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
const { accounts } = await resolveProperties({
|
|
1040
|
+
network: this.getNetwork(),
|
|
1041
|
+
accounts: accountsPromise
|
|
1042
|
+
});
|
|
1043
|
+
|
|
1044
|
+
// Account address
|
|
1045
|
+
address = getAddress(address);
|
|
1046
|
+
for (const account of accounts) {
|
|
1047
|
+
if (getAddress(account) === address) {
|
|
1048
|
+
return new JsonRpcSigner(this, address);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
throw new Error("invalid account");
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
async listAccounts(): Promise<Array<JsonRpcSigner>> {
|
|
1056
|
+
const accounts: Array<string> = await this.send("eth_accounts", [ ]);
|
|
1057
|
+
return accounts.map((a) => new JsonRpcSigner(this, a));
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
destroy(): void {
|
|
1061
|
+
|
|
1062
|
+
// Stop processing requests
|
|
1063
|
+
if (this.#drainTimer) {
|
|
1064
|
+
clearTimeout(this.#drainTimer);
|
|
1065
|
+
this.#drainTimer = null;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
// Cancel all pending requests
|
|
1069
|
+
for (const { payload, reject } of this.#payloads) {
|
|
1070
|
+
reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method }));
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
this.#payloads = [ ];
|
|
1074
|
+
|
|
1075
|
+
// Parent clean-up
|
|
1076
|
+
super.destroy();
|
|
1077
|
+
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
// @TODO: remove this in v7, it is not exported because this functionality
|
|
1082
|
+
// is exposed in the JsonRpcApiProvider by setting polling to true. It should
|
|
1083
|
+
// be safe to remove regardless, because it isn't reachable, but just in case.
|
|
1084
|
+
/**
|
|
1085
|
+
* @_ignore:
|
|
1086
|
+
*/
|
|
1087
|
+
export abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
|
|
1088
|
+
#pollingInterval: number;
|
|
1089
|
+
constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) {
|
|
1090
|
+
super(network, options);
|
|
1091
|
+
|
|
1092
|
+
this.#pollingInterval = 4000;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
_getSubscriber(sub: Subscription): Subscriber {
|
|
1096
|
+
const subscriber = super._getSubscriber(sub);
|
|
1097
|
+
if (isPollable(subscriber)) {
|
|
1098
|
+
subscriber.pollingInterval = this.#pollingInterval;
|
|
1099
|
+
}
|
|
1100
|
+
return subscriber;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* The polling interval (default: 4000 ms)
|
|
1105
|
+
*/
|
|
1106
|
+
get pollingInterval(): number { return this.#pollingInterval; }
|
|
1107
|
+
set pollingInterval(value: number) {
|
|
1108
|
+
if (!Number.isInteger(value) || value < 0) { throw new Error("invalid interval"); }
|
|
1109
|
+
this.#pollingInterval = value;
|
|
1110
|
+
this._forEachSubscriber((sub) => {
|
|
1111
|
+
if (isPollable(sub)) {
|
|
1112
|
+
sub.pollingInterval = this.#pollingInterval;
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* The JsonRpcProvider is one of the most common Providers,
|
|
1120
|
+
* which performs all operations over HTTP (or HTTPS) requests.
|
|
1121
|
+
*
|
|
1122
|
+
* Events are processed by polling the backend for the current block
|
|
1123
|
+
* number; when it advances, all block-base events are then checked
|
|
1124
|
+
* for updates.
|
|
1125
|
+
*/
|
|
1126
|
+
export class JsonRpcProvider extends JsonRpcApiPollingProvider {
|
|
1127
|
+
#connect: FetchRequest;
|
|
1128
|
+
|
|
1129
|
+
constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions) {
|
|
1130
|
+
if (url == null) { url = "http:/\/localhost:8545"; }
|
|
1131
|
+
super(network, options);
|
|
1132
|
+
|
|
1133
|
+
if (typeof(url) === "string") {
|
|
1134
|
+
this.#connect = new FetchRequest(url);
|
|
1135
|
+
} else {
|
|
1136
|
+
this.#connect = url.clone();
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
_getConnection(): FetchRequest {
|
|
1141
|
+
return this.#connect.clone();
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
async send(method: string, params: Array<any> | Record<string, any>): Promise<any> {
|
|
1145
|
+
// All requests are over HTTP, so we can just start handling requests
|
|
1146
|
+
// We do this here rather than the constructor so that we don't send any
|
|
1147
|
+
// requests to the network (i.e. eth_chainId) until we absolutely have to.
|
|
1148
|
+
await this._start();
|
|
1149
|
+
|
|
1150
|
+
return await super.send(method, params);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
async _send(payload: JsonRpcPayload | Array<JsonRpcPayload>): Promise<Array<JsonRpcResult>> {
|
|
1154
|
+
// Configure a POST connection for the requested method
|
|
1155
|
+
const request = this._getConnection();
|
|
1156
|
+
request.body = JSON.stringify(payload);
|
|
1157
|
+
request.setHeader("content-type", "application/json");
|
|
1158
|
+
|
|
1159
|
+
const response = await request.send();
|
|
1160
|
+
response.assertOk();
|
|
1161
|
+
|
|
1162
|
+
let resp = response.bodyJson;
|
|
1163
|
+
if (!Array.isArray(resp)) { resp = [ resp ]; }
|
|
1164
|
+
|
|
1165
|
+
return resp;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
function spelunkData(value: any): null | { message: string, data: string } {
|
|
1170
|
+
if (value == null) { return null; }
|
|
1171
|
+
|
|
1172
|
+
// These *are* the droids we're looking for.
|
|
1173
|
+
if (typeof(value.message) === "string" && value.message.match(/revert/i) && isHexString(value.data)) {
|
|
1174
|
+
return { message: value.message, data: value.data };
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
// Spelunk further...
|
|
1178
|
+
if (typeof(value) === "object") {
|
|
1179
|
+
for (const key in value) {
|
|
1180
|
+
const result = spelunkData(value[key]);
|
|
1181
|
+
if (result) { return result; }
|
|
1182
|
+
}
|
|
1183
|
+
return null;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
// Might be a JSON string we can further descend...
|
|
1187
|
+
if (typeof(value) === "string") {
|
|
1188
|
+
try {
|
|
1189
|
+
return spelunkData(JSON.parse(value));
|
|
1190
|
+
} catch (error) { }
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
return null;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
function _spelunkMessage(value: any, result: Array<string>): void {
|
|
1197
|
+
if (value == null) { return; }
|
|
1198
|
+
|
|
1199
|
+
// These *are* the droids we're looking for.
|
|
1200
|
+
if (typeof(value.message) === "string") {
|
|
1201
|
+
result.push(value.message);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
// Spelunk further...
|
|
1205
|
+
if (typeof(value) === "object") {
|
|
1206
|
+
for (const key in value) {
|
|
1207
|
+
_spelunkMessage(value[key], result);
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
// Might be a JSON string we can further descend...
|
|
1212
|
+
if (typeof(value) === "string") {
|
|
1213
|
+
try {
|
|
1214
|
+
return _spelunkMessage(JSON.parse(value), result);
|
|
1215
|
+
} catch (error) { }
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
function spelunkMessage(value: any): Array<string> {
|
|
1220
|
+
const result: Array<string> = [ ];
|
|
1221
|
+
_spelunkMessage(value, result);
|
|
1222
|
+
return result;
|
|
1223
|
+
}
|