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,873 @@
|
|
|
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
|
+
// @TODO:
|
|
13
|
+
// - Add the batching API
|
|
14
|
+
// 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
|
|
15
|
+
import { AbiCoder } from "../abi/index.js";
|
|
16
|
+
import { getAddress, resolveAddress } from "../address/index.js";
|
|
17
|
+
import { TypedDataEncoder } from "../hash/index.js";
|
|
18
|
+
import { accessListify } from "../transaction/index.js";
|
|
19
|
+
import { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, makeError, assert, assertArgument, FetchRequest, resolveProperties } from "../utils/index.js";
|
|
20
|
+
import { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js";
|
|
21
|
+
import { AbstractSigner } from "./abstract-signer.js";
|
|
22
|
+
import { Network } from "./network.js";
|
|
23
|
+
import { FilterIdEventSubscriber, FilterIdPendingSubscriber } from "./subscriber-filterid.js";
|
|
24
|
+
import { PollingEventSubscriber } from "./subscriber-polling.js";
|
|
25
|
+
const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g);
|
|
26
|
+
//const Methods = "getAddress,then".split(/,/g);
|
|
27
|
+
function deepCopy(value) {
|
|
28
|
+
if (value == null || Primitive.indexOf(typeof (value)) >= 0) {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
// Keep any Addressable
|
|
32
|
+
if (typeof (value.getAddress) === "function") {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
if (Array.isArray(value)) {
|
|
36
|
+
return (value.map(deepCopy));
|
|
37
|
+
}
|
|
38
|
+
if (typeof (value) === "object") {
|
|
39
|
+
return Object.keys(value).reduce((accum, key) => {
|
|
40
|
+
accum[key] = value[key];
|
|
41
|
+
return accum;
|
|
42
|
+
}, {});
|
|
43
|
+
}
|
|
44
|
+
throw new Error(`should not happen: ${value} (${typeof (value)})`);
|
|
45
|
+
}
|
|
46
|
+
function stall(duration) {
|
|
47
|
+
return new Promise((resolve) => { setTimeout(resolve, duration); });
|
|
48
|
+
}
|
|
49
|
+
function getLowerCase(value) {
|
|
50
|
+
if (value) {
|
|
51
|
+
return value.toLowerCase();
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
function isPollable(value) {
|
|
56
|
+
return (value && typeof (value.pollingInterval) === "number");
|
|
57
|
+
}
|
|
58
|
+
const defaultOptions = {
|
|
59
|
+
polling: false,
|
|
60
|
+
staticNetwork: null,
|
|
61
|
+
batchStallTime: 10,
|
|
62
|
+
batchMaxSize: (1 << 20),
|
|
63
|
+
batchMaxCount: 100,
|
|
64
|
+
cacheTimeout: 250,
|
|
65
|
+
pollingInterval: 4000
|
|
66
|
+
};
|
|
67
|
+
// @TODO: Unchecked Signers
|
|
68
|
+
export class JsonRpcSigner extends AbstractSigner {
|
|
69
|
+
address;
|
|
70
|
+
constructor(provider, address) {
|
|
71
|
+
super(provider);
|
|
72
|
+
address = getAddress(address);
|
|
73
|
+
defineProperties(this, { address });
|
|
74
|
+
}
|
|
75
|
+
connect(provider) {
|
|
76
|
+
assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", {
|
|
77
|
+
operation: "signer.connect"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async getAddress() {
|
|
81
|
+
return this.address;
|
|
82
|
+
}
|
|
83
|
+
// JSON-RPC will automatially fill in nonce, etc. so we just check from
|
|
84
|
+
async populateTransaction(tx) {
|
|
85
|
+
return await this.populateCall(tx);
|
|
86
|
+
}
|
|
87
|
+
// Returns just the hash of the transaction after sent, which is what
|
|
88
|
+
// the bare JSON-RPC API does;
|
|
89
|
+
async sendUncheckedTransaction(_tx) {
|
|
90
|
+
const tx = deepCopy(_tx);
|
|
91
|
+
const promises = [];
|
|
92
|
+
// Make sure the from matches the sender
|
|
93
|
+
if (tx.from) {
|
|
94
|
+
const _from = tx.from;
|
|
95
|
+
promises.push((async () => {
|
|
96
|
+
const from = await resolveAddress(_from, this.provider);
|
|
97
|
+
assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx);
|
|
98
|
+
tx.from = from;
|
|
99
|
+
})());
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
tx.from = this.address;
|
|
103
|
+
}
|
|
104
|
+
// The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user
|
|
105
|
+
// wishes to use this, it is easy to specify explicitly, otherwise
|
|
106
|
+
// we look it up for them.
|
|
107
|
+
if (tx.gasLimit == null) {
|
|
108
|
+
promises.push((async () => {
|
|
109
|
+
tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address });
|
|
110
|
+
})());
|
|
111
|
+
}
|
|
112
|
+
// The address may be an ENS name or Addressable
|
|
113
|
+
if (tx.to != null) {
|
|
114
|
+
const _to = tx.to;
|
|
115
|
+
promises.push((async () => {
|
|
116
|
+
tx.to = await resolveAddress(_to, this.provider);
|
|
117
|
+
})());
|
|
118
|
+
}
|
|
119
|
+
// Wait until all of our properties are filled in
|
|
120
|
+
if (promises.length) {
|
|
121
|
+
await Promise.all(promises);
|
|
122
|
+
}
|
|
123
|
+
const hexTx = this.provider.getRpcTransaction(tx);
|
|
124
|
+
return this.provider.send("eth_sendTransaction", [hexTx]);
|
|
125
|
+
}
|
|
126
|
+
async sendTransaction(tx) {
|
|
127
|
+
// This cannot be mined any earlier than any recent block
|
|
128
|
+
const blockNumber = await this.provider.getBlockNumber();
|
|
129
|
+
// Send the transaction
|
|
130
|
+
const hash = await this.sendUncheckedTransaction(tx);
|
|
131
|
+
// Unfortunately, JSON-RPC only provides and opaque transaction hash
|
|
132
|
+
// for a response, and we need the actual transaction, so we poll
|
|
133
|
+
// for it; it should show up very quickly
|
|
134
|
+
return await (new Promise((resolve, reject) => {
|
|
135
|
+
const timeouts = [1000, 100];
|
|
136
|
+
const checkTx = async () => {
|
|
137
|
+
// Try getting the transaction
|
|
138
|
+
const tx = await this.provider.getTransaction(hash);
|
|
139
|
+
if (tx != null) {
|
|
140
|
+
resolve(tx.replaceableTransaction(blockNumber));
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
// Wait another 4 seconds
|
|
144
|
+
this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000);
|
|
145
|
+
};
|
|
146
|
+
checkTx();
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
async signTransaction(_tx) {
|
|
150
|
+
const tx = deepCopy(_tx);
|
|
151
|
+
// Make sure the from matches the sender
|
|
152
|
+
if (tx.from) {
|
|
153
|
+
const from = await resolveAddress(tx.from, this.provider);
|
|
154
|
+
assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx);
|
|
155
|
+
tx.from = from;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
tx.from = this.address;
|
|
159
|
+
}
|
|
160
|
+
const hexTx = this.provider.getRpcTransaction(tx);
|
|
161
|
+
return await this.provider.send("eth_signTransaction", [hexTx]);
|
|
162
|
+
}
|
|
163
|
+
async signMessage(_message) {
|
|
164
|
+
const message = ((typeof (_message) === "string") ? toUtf8Bytes(_message) : _message);
|
|
165
|
+
return await this.provider.send("personal_sign", [
|
|
166
|
+
hexlify(message), this.address.toLowerCase()
|
|
167
|
+
]);
|
|
168
|
+
}
|
|
169
|
+
async signTypedData(domain, types, _value) {
|
|
170
|
+
const value = deepCopy(_value);
|
|
171
|
+
// Populate any ENS names (in-place)
|
|
172
|
+
const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => {
|
|
173
|
+
const address = await resolveAddress(value);
|
|
174
|
+
assertArgument(address != null, "TypedData does not support null address", "value", value);
|
|
175
|
+
return address;
|
|
176
|
+
});
|
|
177
|
+
return await this.provider.send("eth_signTypedData_v4", [
|
|
178
|
+
this.address.toLowerCase(),
|
|
179
|
+
JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value))
|
|
180
|
+
]);
|
|
181
|
+
}
|
|
182
|
+
async unlock(password) {
|
|
183
|
+
return this.provider.send("personal_unlockAccount", [
|
|
184
|
+
this.address.toLowerCase(), password, null
|
|
185
|
+
]);
|
|
186
|
+
}
|
|
187
|
+
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign
|
|
188
|
+
async _legacySignMessage(_message) {
|
|
189
|
+
const message = ((typeof (_message) === "string") ? toUtf8Bytes(_message) : _message);
|
|
190
|
+
return await this.provider.send("eth_sign", [
|
|
191
|
+
this.address.toLowerCase(), hexlify(message)
|
|
192
|
+
]);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* The JsonRpcApiProvider is an abstract class and **MUST** be
|
|
197
|
+
* sub-classed.
|
|
198
|
+
*
|
|
199
|
+
* It provides the base for all JSON-RPC-based Provider interaction.
|
|
200
|
+
*
|
|
201
|
+
* Sub-classing Notes:
|
|
202
|
+
* - a sub-class MUST override _send
|
|
203
|
+
* - a sub-class MUST call the `_start()` method once connected
|
|
204
|
+
*/
|
|
205
|
+
export class JsonRpcApiProvider extends AbstractProvider {
|
|
206
|
+
#options;
|
|
207
|
+
// The next ID to use for the JSON-RPC ID field
|
|
208
|
+
#nextId;
|
|
209
|
+
// Payloads are queued and triggered in batches using the drainTimer
|
|
210
|
+
#payloads;
|
|
211
|
+
#drainTimer;
|
|
212
|
+
#notReady;
|
|
213
|
+
#network;
|
|
214
|
+
#scheduleDrain() {
|
|
215
|
+
if (this.#drainTimer) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
// If we aren't using batching, no hard in sending it immeidately
|
|
219
|
+
const stallTime = (this._getOption("batchMaxCount") === 1) ? 0 : this._getOption("batchStallTime");
|
|
220
|
+
this.#drainTimer = setTimeout(() => {
|
|
221
|
+
this.#drainTimer = null;
|
|
222
|
+
const payloads = this.#payloads;
|
|
223
|
+
this.#payloads = [];
|
|
224
|
+
while (payloads.length) {
|
|
225
|
+
// Create payload batches that satisfy our batch constraints
|
|
226
|
+
const batch = [(payloads.shift())];
|
|
227
|
+
while (payloads.length) {
|
|
228
|
+
if (batch.length === this.#options.batchMaxCount) {
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
batch.push((payloads.shift()));
|
|
232
|
+
const bytes = JSON.stringify(batch.map((p) => p.payload));
|
|
233
|
+
if (bytes.length > this.#options.batchMaxSize) {
|
|
234
|
+
payloads.unshift((batch.pop()));
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
// Process the result to each payload
|
|
239
|
+
(async () => {
|
|
240
|
+
const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload));
|
|
241
|
+
this.emit("debug", { action: "sendRpcPayload", payload });
|
|
242
|
+
try {
|
|
243
|
+
const result = await this._send(payload);
|
|
244
|
+
this.emit("debug", { action: "receiveRpcResult", result });
|
|
245
|
+
// Process results in batch order
|
|
246
|
+
for (const { resolve, reject, payload } of batch) {
|
|
247
|
+
if (this.destroyed) {
|
|
248
|
+
reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method }));
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
// Find the matching result
|
|
252
|
+
const resp = result.filter((r) => (r.id === payload.id))[0];
|
|
253
|
+
// No result; the node failed us in unexpected ways
|
|
254
|
+
if (resp == null) {
|
|
255
|
+
const error = makeError("missing response for request", "BAD_DATA", {
|
|
256
|
+
value: result, info: { payload }
|
|
257
|
+
});
|
|
258
|
+
this.emit("error", error);
|
|
259
|
+
reject(error);
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
// The response is an error
|
|
263
|
+
if ("error" in resp) {
|
|
264
|
+
reject(this.getRpcError(payload, resp));
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
// All good; send the result
|
|
268
|
+
resolve(resp.result);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
this.emit("debug", { action: "receiveRpcError", error });
|
|
273
|
+
for (const { reject } of batch) {
|
|
274
|
+
// @TODO: augment the error with the payload
|
|
275
|
+
reject(error);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
})();
|
|
279
|
+
}
|
|
280
|
+
}, stallTime);
|
|
281
|
+
}
|
|
282
|
+
constructor(network, options) {
|
|
283
|
+
super(network, options);
|
|
284
|
+
this.#nextId = 1;
|
|
285
|
+
this.#options = Object.assign({}, defaultOptions, options || {});
|
|
286
|
+
this.#payloads = [];
|
|
287
|
+
this.#drainTimer = null;
|
|
288
|
+
this.#network = null;
|
|
289
|
+
{
|
|
290
|
+
let resolve = null;
|
|
291
|
+
const promise = new Promise((_resolve) => {
|
|
292
|
+
resolve = _resolve;
|
|
293
|
+
});
|
|
294
|
+
this.#notReady = { promise, resolve };
|
|
295
|
+
}
|
|
296
|
+
// Make sure any static network is compatbile with the provided netwrok
|
|
297
|
+
const staticNetwork = this._getOption("staticNetwork");
|
|
298
|
+
if (staticNetwork) {
|
|
299
|
+
assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options);
|
|
300
|
+
this.#network = staticNetwork;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Returns the value associated with the option %%key%%.
|
|
305
|
+
*
|
|
306
|
+
* Sub-classes can use this to inquire about configuration options.
|
|
307
|
+
*/
|
|
308
|
+
_getOption(key) {
|
|
309
|
+
return this.#options[key];
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Gets the [[Network]] this provider has committed to. On each call, the network
|
|
313
|
+
* is detected, and if it has changed, the call will reject.
|
|
314
|
+
*/
|
|
315
|
+
get _network() {
|
|
316
|
+
assert(this.#network, "network is not available yet", "NETWORK_ERROR");
|
|
317
|
+
return this.#network;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Resolves to the non-normalized value by performing %%req%%.
|
|
321
|
+
*
|
|
322
|
+
* Sub-classes may override this to modify behavior of actions,
|
|
323
|
+
* and should generally call ``super._perform`` as a fallback.
|
|
324
|
+
*/
|
|
325
|
+
async _perform(req) {
|
|
326
|
+
// Legacy networks do not like the type field being passed along (which
|
|
327
|
+
// is fair), so we delete type if it is 0 and a non-EIP-1559 network
|
|
328
|
+
if (req.method === "call" || req.method === "estimateGas") {
|
|
329
|
+
let tx = req.transaction;
|
|
330
|
+
if (tx && tx.type != null && getBigInt(tx.type)) {
|
|
331
|
+
// If there are no EIP-1559 properties, it might be non-EIP-a559
|
|
332
|
+
if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
|
|
333
|
+
const feeData = await this.getFeeData();
|
|
334
|
+
if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
|
|
335
|
+
// Network doesn't know about EIP-1559 (and hence type)
|
|
336
|
+
req = Object.assign({}, req, {
|
|
337
|
+
transaction: Object.assign({}, tx, { type: undefined })
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
const request = this.getRpcRequest(req);
|
|
344
|
+
if (request != null) {
|
|
345
|
+
return await this.send(request.method, request.args);
|
|
346
|
+
}
|
|
347
|
+
return super._perform(req);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Sub-classes may override this; it detects the *actual* network that
|
|
351
|
+
* we are **currently** connected to.
|
|
352
|
+
*
|
|
353
|
+
* Keep in mind that [[send]] may only be used once [[ready]], otherwise the
|
|
354
|
+
* _send primitive must be used instead.
|
|
355
|
+
*/
|
|
356
|
+
async _detectNetwork() {
|
|
357
|
+
const network = this._getOption("staticNetwork");
|
|
358
|
+
if (network) {
|
|
359
|
+
return network;
|
|
360
|
+
}
|
|
361
|
+
// If we are ready, use ``send``, which enabled requests to be batched
|
|
362
|
+
if (this.ready) {
|
|
363
|
+
return Network.from(getBigInt(await this.send("eth_chainId", [])));
|
|
364
|
+
}
|
|
365
|
+
// We are not ready yet; use the primitive _send
|
|
366
|
+
const payload = {
|
|
367
|
+
id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0"
|
|
368
|
+
};
|
|
369
|
+
this.emit("debug", { action: "sendRpcPayload", payload });
|
|
370
|
+
let result;
|
|
371
|
+
try {
|
|
372
|
+
result = (await this._send(payload))[0];
|
|
373
|
+
}
|
|
374
|
+
catch (error) {
|
|
375
|
+
this.emit("debug", { action: "receiveRpcError", error });
|
|
376
|
+
throw error;
|
|
377
|
+
}
|
|
378
|
+
this.emit("debug", { action: "receiveRpcResult", result });
|
|
379
|
+
if ("result" in result) {
|
|
380
|
+
return Network.from(getBigInt(result.result));
|
|
381
|
+
}
|
|
382
|
+
throw this.getRpcError(payload, result);
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Sub-classes **MUST** call this. Until [[_start]] has been called, no calls
|
|
386
|
+
* will be passed to [[_send]] from [[send]]. If it is overridden, then
|
|
387
|
+
* ``super._start()`` **MUST** be called.
|
|
388
|
+
*
|
|
389
|
+
* Calling it multiple times is safe and has no effect.
|
|
390
|
+
*/
|
|
391
|
+
_start() {
|
|
392
|
+
if (this.#notReady == null || this.#notReady.resolve == null) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
this.#notReady.resolve();
|
|
396
|
+
this.#notReady = null;
|
|
397
|
+
(async () => {
|
|
398
|
+
// Bootstrap the network
|
|
399
|
+
while (this.#network == null && !this.destroyed) {
|
|
400
|
+
try {
|
|
401
|
+
this.#network = await this._detectNetwork();
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
if (this.destroyed) {
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
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)");
|
|
408
|
+
this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } }));
|
|
409
|
+
await stall(1000);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
// Start dispatching requests
|
|
413
|
+
this.#scheduleDrain();
|
|
414
|
+
})();
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Resolves once the [[_start]] has been called. This can be used in
|
|
418
|
+
* sub-classes to defer sending data until the connection has been
|
|
419
|
+
* established.
|
|
420
|
+
*/
|
|
421
|
+
async _waitUntilReady() {
|
|
422
|
+
if (this.#notReady == null) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
return await this.#notReady.promise;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Return a Subscriber that will manage the %%sub%%.
|
|
429
|
+
*
|
|
430
|
+
* Sub-classes may override this to modify the behavior of
|
|
431
|
+
* subscription management.
|
|
432
|
+
*/
|
|
433
|
+
_getSubscriber(sub) {
|
|
434
|
+
// Pending Filters aren't availble via polling
|
|
435
|
+
if (sub.type === "pending") {
|
|
436
|
+
return new FilterIdPendingSubscriber(this);
|
|
437
|
+
}
|
|
438
|
+
if (sub.type === "event") {
|
|
439
|
+
if (this._getOption("polling")) {
|
|
440
|
+
return new PollingEventSubscriber(this, sub.filter);
|
|
441
|
+
}
|
|
442
|
+
return new FilterIdEventSubscriber(this, sub.filter);
|
|
443
|
+
}
|
|
444
|
+
// Orphaned Logs are handled automatically, by the filter, since
|
|
445
|
+
// logs with removed are emitted by it
|
|
446
|
+
if (sub.type === "orphan" && sub.filter.orphan === "drop-log") {
|
|
447
|
+
return new UnmanagedSubscriber("orphan");
|
|
448
|
+
}
|
|
449
|
+
return super._getSubscriber(sub);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Returns true only if the [[_start]] has been called.
|
|
453
|
+
*/
|
|
454
|
+
get ready() { return this.#notReady == null; }
|
|
455
|
+
/**
|
|
456
|
+
* Returns %%tx%% as a normalized JSON-RPC transaction request,
|
|
457
|
+
* which has all values hexlified and any numeric values converted
|
|
458
|
+
* to Quantity values.
|
|
459
|
+
*/
|
|
460
|
+
getRpcTransaction(tx) {
|
|
461
|
+
const result = {};
|
|
462
|
+
// JSON-RPC now requires numeric values to be "quantity" values
|
|
463
|
+
["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach((key) => {
|
|
464
|
+
if (tx[key] == null) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
let dstKey = key;
|
|
468
|
+
if (key === "gasLimit") {
|
|
469
|
+
dstKey = "gas";
|
|
470
|
+
}
|
|
471
|
+
result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`));
|
|
472
|
+
});
|
|
473
|
+
// Make sure addresses and data are lowercase
|
|
474
|
+
["from", "to", "data"].forEach((key) => {
|
|
475
|
+
if (tx[key] == null) {
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
result[key] = hexlify(tx[key]);
|
|
479
|
+
});
|
|
480
|
+
// Normalize the access list object
|
|
481
|
+
if (tx.accessList) {
|
|
482
|
+
result["accessList"] = accessListify(tx.accessList);
|
|
483
|
+
}
|
|
484
|
+
return result;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Returns the request method and arguments required to perform
|
|
488
|
+
* %%req%%.
|
|
489
|
+
*/
|
|
490
|
+
getRpcRequest(req) {
|
|
491
|
+
switch (req.method) {
|
|
492
|
+
case "chainId":
|
|
493
|
+
return { method: "eth_chainId", args: [] };
|
|
494
|
+
case "getBlockNumber":
|
|
495
|
+
return { method: "eth_blockNumber", args: [] };
|
|
496
|
+
case "getGasPrice":
|
|
497
|
+
return { method: "eth_gasPrice", args: [] };
|
|
498
|
+
case "getBalance":
|
|
499
|
+
return {
|
|
500
|
+
method: "eth_getBalance",
|
|
501
|
+
args: [getLowerCase(req.address), req.blockTag]
|
|
502
|
+
};
|
|
503
|
+
case "getTransactionCount":
|
|
504
|
+
return {
|
|
505
|
+
method: "eth_getTransactionCount",
|
|
506
|
+
args: [getLowerCase(req.address), req.blockTag]
|
|
507
|
+
};
|
|
508
|
+
case "getCode":
|
|
509
|
+
return {
|
|
510
|
+
method: "eth_getCode",
|
|
511
|
+
args: [getLowerCase(req.address), req.blockTag]
|
|
512
|
+
};
|
|
513
|
+
case "getStorage":
|
|
514
|
+
return {
|
|
515
|
+
method: "eth_getStorageAt",
|
|
516
|
+
args: [
|
|
517
|
+
getLowerCase(req.address),
|
|
518
|
+
("0x" + req.position.toString(16)),
|
|
519
|
+
req.blockTag
|
|
520
|
+
]
|
|
521
|
+
};
|
|
522
|
+
case "broadcastTransaction":
|
|
523
|
+
return {
|
|
524
|
+
method: "eth_sendRawTransaction",
|
|
525
|
+
args: [req.signedTransaction]
|
|
526
|
+
};
|
|
527
|
+
case "getBlock":
|
|
528
|
+
if ("blockTag" in req) {
|
|
529
|
+
return {
|
|
530
|
+
method: "eth_getBlockByNumber",
|
|
531
|
+
args: [req.blockTag, !!req.includeTransactions]
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
else if ("blockHash" in req) {
|
|
535
|
+
return {
|
|
536
|
+
method: "eth_getBlockByHash",
|
|
537
|
+
args: [req.blockHash, !!req.includeTransactions]
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
break;
|
|
541
|
+
case "getTransaction":
|
|
542
|
+
return {
|
|
543
|
+
method: "eth_getTransactionByHash",
|
|
544
|
+
args: [req.hash]
|
|
545
|
+
};
|
|
546
|
+
case "getTransactionReceipt":
|
|
547
|
+
return {
|
|
548
|
+
method: "eth_getTransactionReceipt",
|
|
549
|
+
args: [req.hash]
|
|
550
|
+
};
|
|
551
|
+
case "call":
|
|
552
|
+
return {
|
|
553
|
+
method: "eth_call",
|
|
554
|
+
args: [this.getRpcTransaction(req.transaction), req.blockTag]
|
|
555
|
+
};
|
|
556
|
+
case "estimateGas": {
|
|
557
|
+
return {
|
|
558
|
+
method: "eth_estimateGas",
|
|
559
|
+
args: [this.getRpcTransaction(req.transaction)]
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
case "getLogs":
|
|
563
|
+
if (req.filter && req.filter.address != null) {
|
|
564
|
+
if (Array.isArray(req.filter.address)) {
|
|
565
|
+
req.filter.address = req.filter.address.map(getLowerCase);
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
req.filter.address = getLowerCase(req.filter.address);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return { method: "eth_getLogs", args: [req.filter] };
|
|
572
|
+
}
|
|
573
|
+
return null;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Returns an ethers-style Error for the given JSON-RPC error
|
|
577
|
+
* %%payload%%, coalescing the various strings and error shapes
|
|
578
|
+
* that different nodes return, coercing them into a machine-readable
|
|
579
|
+
* standardized error.
|
|
580
|
+
*/
|
|
581
|
+
getRpcError(payload, _error) {
|
|
582
|
+
const { method } = payload;
|
|
583
|
+
const { error } = _error;
|
|
584
|
+
if (method === "eth_estimateGas" && error.message) {
|
|
585
|
+
const msg = error.message;
|
|
586
|
+
if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) {
|
|
587
|
+
return makeError("insufficient funds", "INSUFFICIENT_FUNDS", {
|
|
588
|
+
transaction: (payload.params[0]),
|
|
589
|
+
info: { payload, error }
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
if (method === "eth_call" || method === "eth_estimateGas") {
|
|
594
|
+
const result = spelunkData(error);
|
|
595
|
+
const e = AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null));
|
|
596
|
+
e.info = { error, payload };
|
|
597
|
+
return e;
|
|
598
|
+
}
|
|
599
|
+
// Only estimateGas and call can return arbitrary contract-defined text, so now we
|
|
600
|
+
// we can process text safely.
|
|
601
|
+
const message = JSON.stringify(spelunkMessage(error));
|
|
602
|
+
if (typeof (error.message) === "string" && error.message.match(/user denied|ethers-user-denied/i)) {
|
|
603
|
+
const actionMap = {
|
|
604
|
+
eth_sign: "signMessage",
|
|
605
|
+
personal_sign: "signMessage",
|
|
606
|
+
eth_signTypedData_v4: "signTypedData",
|
|
607
|
+
eth_signTransaction: "signTransaction",
|
|
608
|
+
eth_sendTransaction: "sendTransaction",
|
|
609
|
+
eth_requestAccounts: "requestAccess",
|
|
610
|
+
wallet_requestAccounts: "requestAccess",
|
|
611
|
+
};
|
|
612
|
+
return makeError(`user rejected action`, "ACTION_REJECTED", {
|
|
613
|
+
action: (actionMap[method] || "unknown"),
|
|
614
|
+
reason: "rejected",
|
|
615
|
+
info: { payload, error }
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") {
|
|
619
|
+
const transaction = (payload.params[0]);
|
|
620
|
+
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
|
|
621
|
+
return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", {
|
|
622
|
+
transaction, info: { error }
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
if (message.match(/nonce/i) && message.match(/too low/i)) {
|
|
626
|
+
return makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } });
|
|
627
|
+
}
|
|
628
|
+
// "replacement transaction underpriced"
|
|
629
|
+
if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) {
|
|
630
|
+
return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } });
|
|
631
|
+
}
|
|
632
|
+
if (message.match(/only replay-protected/i)) {
|
|
633
|
+
return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", {
|
|
634
|
+
operation: method, info: { transaction, info: { error } }
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
let unsupported = !!message.match(/the method .* does not exist/i);
|
|
639
|
+
if (!unsupported) {
|
|
640
|
+
if (error && error.details && error.details.startsWith("Unauthorized method:")) {
|
|
641
|
+
unsupported = true;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
if (unsupported) {
|
|
645
|
+
return makeError("unsupported operation", "UNSUPPORTED_OPERATION", {
|
|
646
|
+
operation: payload.method, info: { error, payload }
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
return makeError("could not coalesce error", "UNKNOWN_ERROR", { error, payload });
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Requests the %%method%% with %%params%% via the JSON-RPC protocol
|
|
653
|
+
* over the underlying channel. This can be used to call methods
|
|
654
|
+
* on the backend that do not have a high-level API within the Provider
|
|
655
|
+
* API.
|
|
656
|
+
*
|
|
657
|
+
* This method queues requests according to the batch constraints
|
|
658
|
+
* in the options, assigns the request a unique ID.
|
|
659
|
+
*
|
|
660
|
+
* **Do NOT override** this method in sub-classes; instead
|
|
661
|
+
* override [[_send]] or force the options values in the
|
|
662
|
+
* call to the constructor to modify this method's behavior.
|
|
663
|
+
*/
|
|
664
|
+
send(method, params) {
|
|
665
|
+
// @TODO: cache chainId?? purge on switch_networks
|
|
666
|
+
// We have been destroyed; no operations are supported anymore
|
|
667
|
+
if (this.destroyed) {
|
|
668
|
+
return Promise.reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method }));
|
|
669
|
+
}
|
|
670
|
+
const id = this.#nextId++;
|
|
671
|
+
const promise = new Promise((resolve, reject) => {
|
|
672
|
+
this.#payloads.push({
|
|
673
|
+
resolve, reject,
|
|
674
|
+
payload: { method, params, id, jsonrpc: "2.0" }
|
|
675
|
+
});
|
|
676
|
+
});
|
|
677
|
+
// If there is not a pending drainTimer, set one
|
|
678
|
+
this.#scheduleDrain();
|
|
679
|
+
return promise;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Resolves to the [[Signer]] account for %%address%% managed by
|
|
683
|
+
* the client.
|
|
684
|
+
*
|
|
685
|
+
* If the %%address%% is a number, it is used as an index in the
|
|
686
|
+
* the accounts from [[listAccounts]].
|
|
687
|
+
*
|
|
688
|
+
* This can only be used on clients which manage accounts (such as
|
|
689
|
+
* Geth with imported account or MetaMask).
|
|
690
|
+
*
|
|
691
|
+
* Throws if the account doesn't exist.
|
|
692
|
+
*/
|
|
693
|
+
async getSigner(address) {
|
|
694
|
+
if (address == null) {
|
|
695
|
+
address = 0;
|
|
696
|
+
}
|
|
697
|
+
const accountsPromise = this.send("eth_accounts", []);
|
|
698
|
+
// Account index
|
|
699
|
+
if (typeof (address) === "number") {
|
|
700
|
+
const accounts = (await accountsPromise);
|
|
701
|
+
if (address >= accounts.length) {
|
|
702
|
+
throw new Error("no such account");
|
|
703
|
+
}
|
|
704
|
+
return new JsonRpcSigner(this, accounts[address]);
|
|
705
|
+
}
|
|
706
|
+
const { accounts } = await resolveProperties({
|
|
707
|
+
network: this.getNetwork(),
|
|
708
|
+
accounts: accountsPromise
|
|
709
|
+
});
|
|
710
|
+
// Account address
|
|
711
|
+
address = getAddress(address);
|
|
712
|
+
for (const account of accounts) {
|
|
713
|
+
if (getAddress(account) === address) {
|
|
714
|
+
return new JsonRpcSigner(this, address);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
throw new Error("invalid account");
|
|
718
|
+
}
|
|
719
|
+
async listAccounts() {
|
|
720
|
+
const accounts = await this.send("eth_accounts", []);
|
|
721
|
+
return accounts.map((a) => new JsonRpcSigner(this, a));
|
|
722
|
+
}
|
|
723
|
+
destroy() {
|
|
724
|
+
// Stop processing requests
|
|
725
|
+
if (this.#drainTimer) {
|
|
726
|
+
clearTimeout(this.#drainTimer);
|
|
727
|
+
this.#drainTimer = null;
|
|
728
|
+
}
|
|
729
|
+
// Cancel all pending requests
|
|
730
|
+
for (const { payload, reject } of this.#payloads) {
|
|
731
|
+
reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method }));
|
|
732
|
+
}
|
|
733
|
+
this.#payloads = [];
|
|
734
|
+
// Parent clean-up
|
|
735
|
+
super.destroy();
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
// @TODO: remove this in v7, it is not exported because this functionality
|
|
739
|
+
// is exposed in the JsonRpcApiProvider by setting polling to true. It should
|
|
740
|
+
// be safe to remove regardless, because it isn't reachable, but just in case.
|
|
741
|
+
/**
|
|
742
|
+
* @_ignore:
|
|
743
|
+
*/
|
|
744
|
+
export class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
|
|
745
|
+
#pollingInterval;
|
|
746
|
+
constructor(network, options) {
|
|
747
|
+
super(network, options);
|
|
748
|
+
this.#pollingInterval = 4000;
|
|
749
|
+
}
|
|
750
|
+
_getSubscriber(sub) {
|
|
751
|
+
const subscriber = super._getSubscriber(sub);
|
|
752
|
+
if (isPollable(subscriber)) {
|
|
753
|
+
subscriber.pollingInterval = this.#pollingInterval;
|
|
754
|
+
}
|
|
755
|
+
return subscriber;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* The polling interval (default: 4000 ms)
|
|
759
|
+
*/
|
|
760
|
+
get pollingInterval() { return this.#pollingInterval; }
|
|
761
|
+
set pollingInterval(value) {
|
|
762
|
+
if (!Number.isInteger(value) || value < 0) {
|
|
763
|
+
throw new Error("invalid interval");
|
|
764
|
+
}
|
|
765
|
+
this.#pollingInterval = value;
|
|
766
|
+
this._forEachSubscriber((sub) => {
|
|
767
|
+
if (isPollable(sub)) {
|
|
768
|
+
sub.pollingInterval = this.#pollingInterval;
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* The JsonRpcProvider is one of the most common Providers,
|
|
775
|
+
* which performs all operations over HTTP (or HTTPS) requests.
|
|
776
|
+
*
|
|
777
|
+
* Events are processed by polling the backend for the current block
|
|
778
|
+
* number; when it advances, all block-base events are then checked
|
|
779
|
+
* for updates.
|
|
780
|
+
*/
|
|
781
|
+
export class JsonRpcProvider extends JsonRpcApiPollingProvider {
|
|
782
|
+
#connect;
|
|
783
|
+
constructor(url, network, options) {
|
|
784
|
+
if (url == null) {
|
|
785
|
+
url = "http:/\/localhost:8545";
|
|
786
|
+
}
|
|
787
|
+
super(network, options);
|
|
788
|
+
if (typeof (url) === "string") {
|
|
789
|
+
this.#connect = new FetchRequest(url);
|
|
790
|
+
}
|
|
791
|
+
else {
|
|
792
|
+
this.#connect = url.clone();
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
_getConnection() {
|
|
796
|
+
return this.#connect.clone();
|
|
797
|
+
}
|
|
798
|
+
async send(method, params) {
|
|
799
|
+
// All requests are over HTTP, so we can just start handling requests
|
|
800
|
+
// We do this here rather than the constructor so that we don't send any
|
|
801
|
+
// requests to the network (i.e. eth_chainId) until we absolutely have to.
|
|
802
|
+
await this._start();
|
|
803
|
+
return await super.send(method, params);
|
|
804
|
+
}
|
|
805
|
+
async _send(payload) {
|
|
806
|
+
// Configure a POST connection for the requested method
|
|
807
|
+
const request = this._getConnection();
|
|
808
|
+
request.body = JSON.stringify(payload);
|
|
809
|
+
request.setHeader("content-type", "application/json");
|
|
810
|
+
const response = await request.send();
|
|
811
|
+
response.assertOk();
|
|
812
|
+
let resp = response.bodyJson;
|
|
813
|
+
if (!Array.isArray(resp)) {
|
|
814
|
+
resp = [resp];
|
|
815
|
+
}
|
|
816
|
+
return resp;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
function spelunkData(value) {
|
|
820
|
+
if (value == null) {
|
|
821
|
+
return null;
|
|
822
|
+
}
|
|
823
|
+
// These *are* the droids we're looking for.
|
|
824
|
+
if (typeof (value.message) === "string" && value.message.match(/revert/i) && isHexString(value.data)) {
|
|
825
|
+
return { message: value.message, data: value.data };
|
|
826
|
+
}
|
|
827
|
+
// Spelunk further...
|
|
828
|
+
if (typeof (value) === "object") {
|
|
829
|
+
for (const key in value) {
|
|
830
|
+
const result = spelunkData(value[key]);
|
|
831
|
+
if (result) {
|
|
832
|
+
return result;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
return null;
|
|
836
|
+
}
|
|
837
|
+
// Might be a JSON string we can further descend...
|
|
838
|
+
if (typeof (value) === "string") {
|
|
839
|
+
try {
|
|
840
|
+
return spelunkData(JSON.parse(value));
|
|
841
|
+
}
|
|
842
|
+
catch (error) { }
|
|
843
|
+
}
|
|
844
|
+
return null;
|
|
845
|
+
}
|
|
846
|
+
function _spelunkMessage(value, result) {
|
|
847
|
+
if (value == null) {
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
// These *are* the droids we're looking for.
|
|
851
|
+
if (typeof (value.message) === "string") {
|
|
852
|
+
result.push(value.message);
|
|
853
|
+
}
|
|
854
|
+
// Spelunk further...
|
|
855
|
+
if (typeof (value) === "object") {
|
|
856
|
+
for (const key in value) {
|
|
857
|
+
_spelunkMessage(value[key], result);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
// Might be a JSON string we can further descend...
|
|
861
|
+
if (typeof (value) === "string") {
|
|
862
|
+
try {
|
|
863
|
+
return _spelunkMessage(JSON.parse(value), result);
|
|
864
|
+
}
|
|
865
|
+
catch (error) { }
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
function spelunkMessage(value) {
|
|
869
|
+
const result = [];
|
|
870
|
+
_spelunkMessage(value, result);
|
|
871
|
+
return result;
|
|
872
|
+
}
|
|
873
|
+
//# sourceMappingURL=provider-jsonrpc.js.map
|