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,1377 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The available providers should suffice for most developers purposes,
|
|
3
|
+
* but the [[AbstractProvider]] class has many features which enable
|
|
4
|
+
* sub-classing it for specific purposes.
|
|
5
|
+
*
|
|
6
|
+
* @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider]
|
|
7
|
+
*/
|
|
8
|
+
// @TODO
|
|
9
|
+
// Event coalescence
|
|
10
|
+
// When we register an event with an async value (e.g. address is a Signer
|
|
11
|
+
// or ENS name), we need to add it immeidately for the Event API, but also
|
|
12
|
+
// need time to resolve the address. Upon resolving the address, we need to
|
|
13
|
+
// migrate the listener to the static event. We also need to maintain a map
|
|
14
|
+
// of Signer/ENS name to address so we can sync respond to listenerCount.
|
|
15
|
+
import { getAddress, resolveAddress } from "../address/index.js";
|
|
16
|
+
import { ZeroAddress } from "../constants/index.js";
|
|
17
|
+
import { Contract } from "../contract/index.js";
|
|
18
|
+
import { namehash } from "../hash/index.js";
|
|
19
|
+
import { Transaction } from "../transaction/index.js";
|
|
20
|
+
import { concat, dataLength, dataSlice, hexlify, isHexString, getBigInt, getBytes, getNumber, isCallException, isError, makeError, assert, assertArgument, FetchRequest, toBeArray, toQuantity, defineProperties, EventPayload, resolveProperties, toUtf8String } from "../utils/index.js";
|
|
21
|
+
import { EnsResolver } from "./ens-resolver.js";
|
|
22
|
+
import { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse } from "./format.js";
|
|
23
|
+
import { Network } from "./network.js";
|
|
24
|
+
import { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js";
|
|
25
|
+
import { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber } from "./subscriber-polling.js";
|
|
26
|
+
// Constants
|
|
27
|
+
const BN_2 = BigInt(2);
|
|
28
|
+
const MAX_CCIP_REDIRECTS = 10;
|
|
29
|
+
function isPromise(value) {
|
|
30
|
+
return (value && typeof (value.then) === "function");
|
|
31
|
+
}
|
|
32
|
+
function getTag(prefix, value) {
|
|
33
|
+
return prefix + ":" + JSON.stringify(value, (k, v) => {
|
|
34
|
+
if (v == null) {
|
|
35
|
+
return "null";
|
|
36
|
+
}
|
|
37
|
+
if (typeof (v) === "bigint") {
|
|
38
|
+
return `bigint:${v.toString()}`;
|
|
39
|
+
}
|
|
40
|
+
if (typeof (v) === "string") {
|
|
41
|
+
return v.toLowerCase();
|
|
42
|
+
}
|
|
43
|
+
// Sort object keys
|
|
44
|
+
if (typeof (v) === "object" && !Array.isArray(v)) {
|
|
45
|
+
const keys = Object.keys(v);
|
|
46
|
+
keys.sort();
|
|
47
|
+
return keys.reduce((accum, key) => {
|
|
48
|
+
accum[key] = v[key];
|
|
49
|
+
return accum;
|
|
50
|
+
}, {});
|
|
51
|
+
}
|
|
52
|
+
return v;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* An **UnmanagedSubscriber** is useful for events which do not require
|
|
57
|
+
* any additional management, such as ``"debug"`` which only requires
|
|
58
|
+
* emit in synchronous event loop triggered calls.
|
|
59
|
+
*/
|
|
60
|
+
export class UnmanagedSubscriber {
|
|
61
|
+
/**
|
|
62
|
+
* The name fof the event.
|
|
63
|
+
*/
|
|
64
|
+
name;
|
|
65
|
+
/**
|
|
66
|
+
* Create a new UnmanagedSubscriber with %%name%%.
|
|
67
|
+
*/
|
|
68
|
+
constructor(name) { defineProperties(this, { name }); }
|
|
69
|
+
start() { }
|
|
70
|
+
stop() { }
|
|
71
|
+
pause(dropWhilePaused) { }
|
|
72
|
+
resume() { }
|
|
73
|
+
}
|
|
74
|
+
function copy(value) {
|
|
75
|
+
return JSON.parse(JSON.stringify(value));
|
|
76
|
+
}
|
|
77
|
+
function concisify(items) {
|
|
78
|
+
items = Array.from((new Set(items)).values());
|
|
79
|
+
items.sort();
|
|
80
|
+
return items;
|
|
81
|
+
}
|
|
82
|
+
async function getSubscription(_event, provider) {
|
|
83
|
+
if (_event == null) {
|
|
84
|
+
throw new Error("invalid event");
|
|
85
|
+
}
|
|
86
|
+
// Normalize topic array info an EventFilter
|
|
87
|
+
if (Array.isArray(_event)) {
|
|
88
|
+
_event = { topics: _event };
|
|
89
|
+
}
|
|
90
|
+
if (typeof (_event) === "string") {
|
|
91
|
+
switch (_event) {
|
|
92
|
+
case "block":
|
|
93
|
+
case "pending":
|
|
94
|
+
case "debug":
|
|
95
|
+
case "error":
|
|
96
|
+
case "network": {
|
|
97
|
+
return { type: _event, tag: _event };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (isHexString(_event, 32)) {
|
|
102
|
+
const hash = _event.toLowerCase();
|
|
103
|
+
return { type: "transaction", tag: getTag("tx", { hash }), hash };
|
|
104
|
+
}
|
|
105
|
+
if (_event.orphan) {
|
|
106
|
+
const event = _event;
|
|
107
|
+
// @TODO: Should lowercase and whatnot things here instead of copy...
|
|
108
|
+
return { type: "orphan", tag: getTag("orphan", event), filter: copy(event) };
|
|
109
|
+
}
|
|
110
|
+
if ((_event.address || _event.topics)) {
|
|
111
|
+
const event = _event;
|
|
112
|
+
const filter = {
|
|
113
|
+
topics: ((event.topics || []).map((t) => {
|
|
114
|
+
if (t == null) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
if (Array.isArray(t)) {
|
|
118
|
+
return concisify(t.map((t) => t.toLowerCase()));
|
|
119
|
+
}
|
|
120
|
+
return t.toLowerCase();
|
|
121
|
+
}))
|
|
122
|
+
};
|
|
123
|
+
if (event.address) {
|
|
124
|
+
const addresses = [];
|
|
125
|
+
const promises = [];
|
|
126
|
+
const addAddress = (addr) => {
|
|
127
|
+
if (isHexString(addr)) {
|
|
128
|
+
addresses.push(addr);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
promises.push((async () => {
|
|
132
|
+
addresses.push(await resolveAddress(addr, provider));
|
|
133
|
+
})());
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
if (Array.isArray(event.address)) {
|
|
137
|
+
event.address.forEach(addAddress);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
addAddress(event.address);
|
|
141
|
+
}
|
|
142
|
+
if (promises.length) {
|
|
143
|
+
await Promise.all(promises);
|
|
144
|
+
}
|
|
145
|
+
filter.address = concisify(addresses.map((a) => a.toLowerCase()));
|
|
146
|
+
}
|
|
147
|
+
return { filter, tag: getTag("event", filter), type: "event" };
|
|
148
|
+
}
|
|
149
|
+
assertArgument(false, "unknown ProviderEvent", "event", _event);
|
|
150
|
+
}
|
|
151
|
+
function getTime() { return (new Date()).getTime(); }
|
|
152
|
+
const defaultOptions = {
|
|
153
|
+
cacheTimeout: 250,
|
|
154
|
+
pollingInterval: 4000
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* An **AbstractProvider** provides a base class for other sub-classes to
|
|
158
|
+
* implement the [[Provider]] API by normalizing input arguments and
|
|
159
|
+
* formatting output results as well as tracking events for consistent
|
|
160
|
+
* behaviour on an eventually-consistent network.
|
|
161
|
+
*/
|
|
162
|
+
export class AbstractProvider {
|
|
163
|
+
#subs;
|
|
164
|
+
#plugins;
|
|
165
|
+
// null=unpaused, true=paused+dropWhilePaused, false=paused
|
|
166
|
+
#pausedState;
|
|
167
|
+
#destroyed;
|
|
168
|
+
#networkPromise;
|
|
169
|
+
#anyNetwork;
|
|
170
|
+
#performCache;
|
|
171
|
+
// The most recent block number if running an event or -1 if no "block" event
|
|
172
|
+
#lastBlockNumber;
|
|
173
|
+
#nextTimer;
|
|
174
|
+
#timers;
|
|
175
|
+
#disableCcipRead;
|
|
176
|
+
#options;
|
|
177
|
+
/**
|
|
178
|
+
* Create a new **AbstractProvider** connected to %%network%%, or
|
|
179
|
+
* use the various network detection capabilities to discover the
|
|
180
|
+
* [[Network]] if necessary.
|
|
181
|
+
*/
|
|
182
|
+
constructor(_network, options) {
|
|
183
|
+
this.#options = Object.assign({}, defaultOptions, options || {});
|
|
184
|
+
if (_network === "any") {
|
|
185
|
+
this.#anyNetwork = true;
|
|
186
|
+
this.#networkPromise = null;
|
|
187
|
+
}
|
|
188
|
+
else if (_network) {
|
|
189
|
+
const network = Network.from(_network);
|
|
190
|
+
this.#anyNetwork = false;
|
|
191
|
+
this.#networkPromise = Promise.resolve(network);
|
|
192
|
+
setTimeout(() => { this.emit("network", network, null); }, 0);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
this.#anyNetwork = false;
|
|
196
|
+
this.#networkPromise = null;
|
|
197
|
+
}
|
|
198
|
+
this.#lastBlockNumber = -1;
|
|
199
|
+
this.#performCache = new Map();
|
|
200
|
+
this.#subs = new Map();
|
|
201
|
+
this.#plugins = new Map();
|
|
202
|
+
this.#pausedState = null;
|
|
203
|
+
this.#destroyed = false;
|
|
204
|
+
this.#nextTimer = 1;
|
|
205
|
+
this.#timers = new Map();
|
|
206
|
+
this.#disableCcipRead = false;
|
|
207
|
+
}
|
|
208
|
+
get pollingInterval() { return this.#options.pollingInterval; }
|
|
209
|
+
/**
|
|
210
|
+
* Returns ``this``, to allow an **AbstractProvider** to implement
|
|
211
|
+
* the [[ContractRunner]] interface.
|
|
212
|
+
*/
|
|
213
|
+
get provider() { return this; }
|
|
214
|
+
/**
|
|
215
|
+
* Returns all the registered plug-ins.
|
|
216
|
+
*/
|
|
217
|
+
get plugins() {
|
|
218
|
+
return Array.from(this.#plugins.values());
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Attach a new plug-in.
|
|
222
|
+
*/
|
|
223
|
+
attachPlugin(plugin) {
|
|
224
|
+
if (this.#plugins.get(plugin.name)) {
|
|
225
|
+
throw new Error(`cannot replace existing plugin: ${plugin.name} `);
|
|
226
|
+
}
|
|
227
|
+
this.#plugins.set(plugin.name, plugin.connect(this));
|
|
228
|
+
return this;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Get a plugin by name.
|
|
232
|
+
*/
|
|
233
|
+
getPlugin(name) {
|
|
234
|
+
return (this.#plugins.get(name)) || null;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Prevent any CCIP-read operation, regardless of whether requested
|
|
238
|
+
* in a [[call]] using ``enableCcipRead``.
|
|
239
|
+
*/
|
|
240
|
+
get disableCcipRead() { return this.#disableCcipRead; }
|
|
241
|
+
set disableCcipRead(value) { this.#disableCcipRead = !!value; }
|
|
242
|
+
// Shares multiple identical requests made during the same 250ms
|
|
243
|
+
async #perform(req) {
|
|
244
|
+
const timeout = this.#options.cacheTimeout;
|
|
245
|
+
// Caching disabled
|
|
246
|
+
if (timeout < 0) {
|
|
247
|
+
return await this._perform(req);
|
|
248
|
+
}
|
|
249
|
+
// Create a tag
|
|
250
|
+
const tag = getTag(req.method, req);
|
|
251
|
+
let perform = this.#performCache.get(tag);
|
|
252
|
+
if (!perform) {
|
|
253
|
+
perform = this._perform(req);
|
|
254
|
+
this.#performCache.set(tag, perform);
|
|
255
|
+
setTimeout(() => {
|
|
256
|
+
if (this.#performCache.get(tag) === perform) {
|
|
257
|
+
this.#performCache.delete(tag);
|
|
258
|
+
}
|
|
259
|
+
}, timeout);
|
|
260
|
+
}
|
|
261
|
+
return await perform;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Resolves to the data for executing the CCIP-read operations.
|
|
265
|
+
*/
|
|
266
|
+
async ccipReadFetch(tx, calldata, urls) {
|
|
267
|
+
if (this.disableCcipRead || urls.length === 0 || tx.to == null) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
const sender = tx.to.toLowerCase();
|
|
271
|
+
const data = calldata.toLowerCase();
|
|
272
|
+
const errorMessages = [];
|
|
273
|
+
for (let i = 0; i < urls.length; i++) {
|
|
274
|
+
const url = urls[i];
|
|
275
|
+
// URL expansion
|
|
276
|
+
const href = url.replace("{sender}", sender).replace("{data}", data);
|
|
277
|
+
// If no {data} is present, use POST; otherwise GET
|
|
278
|
+
//const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender });
|
|
279
|
+
//const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => {
|
|
280
|
+
// value.status = response.statusCode;
|
|
281
|
+
// return value;
|
|
282
|
+
//});
|
|
283
|
+
const request = new FetchRequest(href);
|
|
284
|
+
if (url.indexOf("{data}") === -1) {
|
|
285
|
+
request.body = { data, sender };
|
|
286
|
+
}
|
|
287
|
+
this.emit("debug", { action: "sendCcipReadFetchRequest", request, index: i, urls });
|
|
288
|
+
let errorMessage = "unknown error";
|
|
289
|
+
const resp = await request.send();
|
|
290
|
+
try {
|
|
291
|
+
const result = resp.bodyJson;
|
|
292
|
+
if (result.data) {
|
|
293
|
+
this.emit("debug", { action: "receiveCcipReadFetchResult", request, result });
|
|
294
|
+
return result.data;
|
|
295
|
+
}
|
|
296
|
+
if (result.message) {
|
|
297
|
+
errorMessage = result.message;
|
|
298
|
+
}
|
|
299
|
+
this.emit("debug", { action: "receiveCcipReadFetchError", request, result });
|
|
300
|
+
}
|
|
301
|
+
catch (error) { }
|
|
302
|
+
// 4xx indicates the result is not present; stop
|
|
303
|
+
assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, "OFFCHAIN_FAULT", { reason: "404_MISSING_RESOURCE", transaction: tx, info: { url, errorMessage } });
|
|
304
|
+
// 5xx indicates server issue; try the next url
|
|
305
|
+
errorMessages.push(errorMessage);
|
|
306
|
+
}
|
|
307
|
+
assert(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, "OFFCHAIN_FAULT", {
|
|
308
|
+
reason: "500_SERVER_ERROR",
|
|
309
|
+
transaction: tx, info: { urls, errorMessages }
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Provides the opportunity for a sub-class to wrap a block before
|
|
314
|
+
* returning it, to add additional properties or an alternate
|
|
315
|
+
* sub-class of [[Block]].
|
|
316
|
+
*/
|
|
317
|
+
_wrapBlock(value, network) {
|
|
318
|
+
return new Block(formatBlock(value), this);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Provides the opportunity for a sub-class to wrap a log before
|
|
322
|
+
* returning it, to add additional properties or an alternate
|
|
323
|
+
* sub-class of [[Log]].
|
|
324
|
+
*/
|
|
325
|
+
_wrapLog(value, network) {
|
|
326
|
+
return new Log(formatLog(value), this);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Provides the opportunity for a sub-class to wrap a transaction
|
|
330
|
+
* receipt before returning it, to add additional properties or an
|
|
331
|
+
* alternate sub-class of [[TransactionReceipt]].
|
|
332
|
+
*/
|
|
333
|
+
_wrapTransactionReceipt(value, network) {
|
|
334
|
+
return new TransactionReceipt(formatTransactionReceipt(value), this);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Provides the opportunity for a sub-class to wrap a transaction
|
|
338
|
+
* response before returning it, to add additional properties or an
|
|
339
|
+
* alternate sub-class of [[TransactionResponse]].
|
|
340
|
+
*/
|
|
341
|
+
_wrapTransactionResponse(tx, network) {
|
|
342
|
+
return new TransactionResponse(formatTransactionResponse(tx), this);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Resolves to the Network, forcing a network detection using whatever
|
|
346
|
+
* technique the sub-class requires.
|
|
347
|
+
*
|
|
348
|
+
* Sub-classes **must** override this.
|
|
349
|
+
*/
|
|
350
|
+
_detectNetwork() {
|
|
351
|
+
assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", {
|
|
352
|
+
operation: "_detectNetwork"
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Sub-classes should use this to perform all built-in operations. All
|
|
357
|
+
* methods sanitizes and normalizes the values passed into this.
|
|
358
|
+
*
|
|
359
|
+
* Sub-classes **must** override this.
|
|
360
|
+
*/
|
|
361
|
+
async _perform(req) {
|
|
362
|
+
assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", {
|
|
363
|
+
operation: req.method,
|
|
364
|
+
info: req
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
// State
|
|
368
|
+
async getBlockNumber() {
|
|
369
|
+
const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response");
|
|
370
|
+
if (this.#lastBlockNumber >= 0) {
|
|
371
|
+
this.#lastBlockNumber = blockNumber;
|
|
372
|
+
}
|
|
373
|
+
return blockNumber;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Returns or resolves to the address for %%address%%, resolving ENS
|
|
377
|
+
* names and [[Addressable]] objects and returning if already an
|
|
378
|
+
* address.
|
|
379
|
+
*/
|
|
380
|
+
_getAddress(address) {
|
|
381
|
+
return resolveAddress(address, this);
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Returns or resolves to a valid block tag for %%blockTag%%, resolving
|
|
385
|
+
* negative values and returning if already a valid block tag.
|
|
386
|
+
*/
|
|
387
|
+
_getBlockTag(blockTag) {
|
|
388
|
+
if (blockTag == null) {
|
|
389
|
+
return "latest";
|
|
390
|
+
}
|
|
391
|
+
switch (blockTag) {
|
|
392
|
+
case "earliest":
|
|
393
|
+
return "0x0";
|
|
394
|
+
case "latest":
|
|
395
|
+
case "pending":
|
|
396
|
+
case "safe":
|
|
397
|
+
case "finalized":
|
|
398
|
+
return blockTag;
|
|
399
|
+
}
|
|
400
|
+
if (isHexString(blockTag)) {
|
|
401
|
+
if (isHexString(blockTag, 32)) {
|
|
402
|
+
return blockTag;
|
|
403
|
+
}
|
|
404
|
+
return toQuantity(blockTag);
|
|
405
|
+
}
|
|
406
|
+
if (typeof (blockTag) === "bigint") {
|
|
407
|
+
blockTag = getNumber(blockTag, "blockTag");
|
|
408
|
+
}
|
|
409
|
+
if (typeof (blockTag) === "number") {
|
|
410
|
+
if (blockTag >= 0) {
|
|
411
|
+
return toQuantity(blockTag);
|
|
412
|
+
}
|
|
413
|
+
if (this.#lastBlockNumber >= 0) {
|
|
414
|
+
return toQuantity(this.#lastBlockNumber + blockTag);
|
|
415
|
+
}
|
|
416
|
+
return this.getBlockNumber().then((b) => toQuantity(b + blockTag));
|
|
417
|
+
}
|
|
418
|
+
assertArgument(false, "invalid blockTag", "blockTag", blockTag);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Returns or resolves to a filter for %%filter%%, resolving any ENS
|
|
422
|
+
* names or [[Addressable]] object and returning if already a valid
|
|
423
|
+
* filter.
|
|
424
|
+
*/
|
|
425
|
+
_getFilter(filter) {
|
|
426
|
+
// Create a canonical representation of the topics
|
|
427
|
+
const topics = (filter.topics || []).map((t) => {
|
|
428
|
+
if (t == null) {
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
431
|
+
if (Array.isArray(t)) {
|
|
432
|
+
return concisify(t.map((t) => t.toLowerCase()));
|
|
433
|
+
}
|
|
434
|
+
return t.toLowerCase();
|
|
435
|
+
});
|
|
436
|
+
const blockHash = ("blockHash" in filter) ? filter.blockHash : undefined;
|
|
437
|
+
const resolve = (_address, fromBlock, toBlock) => {
|
|
438
|
+
let address = undefined;
|
|
439
|
+
switch (_address.length) {
|
|
440
|
+
case 0: break;
|
|
441
|
+
case 1:
|
|
442
|
+
address = _address[0];
|
|
443
|
+
break;
|
|
444
|
+
default:
|
|
445
|
+
_address.sort();
|
|
446
|
+
address = _address;
|
|
447
|
+
}
|
|
448
|
+
if (blockHash) {
|
|
449
|
+
if (fromBlock != null || toBlock != null) {
|
|
450
|
+
throw new Error("invalid filter");
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const filter = {};
|
|
454
|
+
if (address) {
|
|
455
|
+
filter.address = address;
|
|
456
|
+
}
|
|
457
|
+
if (topics.length) {
|
|
458
|
+
filter.topics = topics;
|
|
459
|
+
}
|
|
460
|
+
if (fromBlock) {
|
|
461
|
+
filter.fromBlock = fromBlock;
|
|
462
|
+
}
|
|
463
|
+
if (toBlock) {
|
|
464
|
+
filter.toBlock = toBlock;
|
|
465
|
+
}
|
|
466
|
+
if (blockHash) {
|
|
467
|
+
filter.blockHash = blockHash;
|
|
468
|
+
}
|
|
469
|
+
return filter;
|
|
470
|
+
};
|
|
471
|
+
// Addresses could be async (ENS names or Addressables)
|
|
472
|
+
let address = [];
|
|
473
|
+
if (filter.address) {
|
|
474
|
+
if (Array.isArray(filter.address)) {
|
|
475
|
+
for (const addr of filter.address) {
|
|
476
|
+
address.push(this._getAddress(addr));
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
address.push(this._getAddress(filter.address));
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
let fromBlock = undefined;
|
|
484
|
+
if ("fromBlock" in filter) {
|
|
485
|
+
fromBlock = this._getBlockTag(filter.fromBlock);
|
|
486
|
+
}
|
|
487
|
+
let toBlock = undefined;
|
|
488
|
+
if ("toBlock" in filter) {
|
|
489
|
+
toBlock = this._getBlockTag(filter.toBlock);
|
|
490
|
+
}
|
|
491
|
+
if (address.filter((a) => (typeof (a) !== "string")).length ||
|
|
492
|
+
(fromBlock != null && typeof (fromBlock) !== "string") ||
|
|
493
|
+
(toBlock != null && typeof (toBlock) !== "string")) {
|
|
494
|
+
return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => {
|
|
495
|
+
return resolve(result[0], result[1], result[2]);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
return resolve(address, fromBlock, toBlock);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Returns or resovles to a transaction for %%request%%, resolving
|
|
502
|
+
* any ENS names or [[Addressable]] and returning if already a valid
|
|
503
|
+
* transaction.
|
|
504
|
+
*/
|
|
505
|
+
_getTransactionRequest(_request) {
|
|
506
|
+
const request = copyRequest(_request);
|
|
507
|
+
const promises = [];
|
|
508
|
+
["to", "from"].forEach((key) => {
|
|
509
|
+
if (request[key] == null) {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
const addr = resolveAddress(request[key]);
|
|
513
|
+
if (isPromise(addr)) {
|
|
514
|
+
promises.push((async function () { request[key] = await addr; })());
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
request[key] = addr;
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
if (request.blockTag != null) {
|
|
521
|
+
const blockTag = this._getBlockTag(request.blockTag);
|
|
522
|
+
if (isPromise(blockTag)) {
|
|
523
|
+
promises.push((async function () { request.blockTag = await blockTag; })());
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
request.blockTag = blockTag;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (promises.length) {
|
|
530
|
+
return (async function () {
|
|
531
|
+
await Promise.all(promises);
|
|
532
|
+
return request;
|
|
533
|
+
})();
|
|
534
|
+
}
|
|
535
|
+
return request;
|
|
536
|
+
}
|
|
537
|
+
async getNetwork() {
|
|
538
|
+
// No explicit network was set and this is our first time
|
|
539
|
+
if (this.#networkPromise == null) {
|
|
540
|
+
// Detect the current network (shared with all calls)
|
|
541
|
+
const detectNetwork = this._detectNetwork().then((network) => {
|
|
542
|
+
this.emit("network", network, null);
|
|
543
|
+
return network;
|
|
544
|
+
}, (error) => {
|
|
545
|
+
// Reset the networkPromise on failure, so we will try again
|
|
546
|
+
if (this.#networkPromise === detectNetwork) {
|
|
547
|
+
this.#networkPromise = null;
|
|
548
|
+
}
|
|
549
|
+
throw error;
|
|
550
|
+
});
|
|
551
|
+
this.#networkPromise = detectNetwork;
|
|
552
|
+
return (await detectNetwork).clone();
|
|
553
|
+
}
|
|
554
|
+
const networkPromise = this.#networkPromise;
|
|
555
|
+
const [expected, actual] = await Promise.all([
|
|
556
|
+
networkPromise,
|
|
557
|
+
this._detectNetwork() // The actual connected network
|
|
558
|
+
]);
|
|
559
|
+
if (expected.chainId !== actual.chainId) {
|
|
560
|
+
if (this.#anyNetwork) {
|
|
561
|
+
// The "any" network can change, so notify listeners
|
|
562
|
+
this.emit("network", actual, expected);
|
|
563
|
+
// Update the network if something else hasn't already changed it
|
|
564
|
+
if (this.#networkPromise === networkPromise) {
|
|
565
|
+
this.#networkPromise = Promise.resolve(actual);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
// Otherwise, we do not allow changes to the underlying network
|
|
570
|
+
assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, "NETWORK_ERROR", {
|
|
571
|
+
event: "changed"
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
return expected.clone();
|
|
576
|
+
}
|
|
577
|
+
async getFeeData() {
|
|
578
|
+
const network = await this.getNetwork();
|
|
579
|
+
const getFeeDataFunc = async () => {
|
|
580
|
+
const { _block, gasPrice } = await resolveProperties({
|
|
581
|
+
_block: this.#getBlock("latest", false),
|
|
582
|
+
gasPrice: ((async () => {
|
|
583
|
+
try {
|
|
584
|
+
const gasPrice = await this.#perform({ method: "getGasPrice" });
|
|
585
|
+
return getBigInt(gasPrice, "%response");
|
|
586
|
+
}
|
|
587
|
+
catch (error) { }
|
|
588
|
+
return null;
|
|
589
|
+
})())
|
|
590
|
+
});
|
|
591
|
+
let maxFeePerGas = null;
|
|
592
|
+
let maxPriorityFeePerGas = null;
|
|
593
|
+
// These are the recommended EIP-1559 heuristics for fee data
|
|
594
|
+
const block = this._wrapBlock(_block, network);
|
|
595
|
+
if (block && block.baseFeePerGas) {
|
|
596
|
+
maxPriorityFeePerGas = BigInt("1000000000");
|
|
597
|
+
maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;
|
|
598
|
+
}
|
|
599
|
+
return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);
|
|
600
|
+
};
|
|
601
|
+
// Check for a FeeDataNetWorkPlugin
|
|
602
|
+
const plugin = network.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
|
|
603
|
+
if (plugin) {
|
|
604
|
+
const req = new FetchRequest(plugin.url);
|
|
605
|
+
const feeData = await plugin.processFunc(getFeeDataFunc, this, req);
|
|
606
|
+
return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);
|
|
607
|
+
}
|
|
608
|
+
return await getFeeDataFunc();
|
|
609
|
+
}
|
|
610
|
+
async estimateGas(_tx) {
|
|
611
|
+
let tx = this._getTransactionRequest(_tx);
|
|
612
|
+
if (isPromise(tx)) {
|
|
613
|
+
tx = await tx;
|
|
614
|
+
}
|
|
615
|
+
return getBigInt(await this.#perform({
|
|
616
|
+
method: "estimateGas", transaction: tx
|
|
617
|
+
}), "%response");
|
|
618
|
+
}
|
|
619
|
+
async #call(tx, blockTag, attempt) {
|
|
620
|
+
assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", {
|
|
621
|
+
reason: "TOO_MANY_REDIRECTS",
|
|
622
|
+
transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true })
|
|
623
|
+
});
|
|
624
|
+
// This came in as a PerformActionTransaction, so to/from are safe; we can cast
|
|
625
|
+
const transaction = copyRequest(tx);
|
|
626
|
+
try {
|
|
627
|
+
return hexlify(await this._perform({ method: "call", transaction, blockTag }));
|
|
628
|
+
}
|
|
629
|
+
catch (error) {
|
|
630
|
+
// CCIP Read OffchainLookup
|
|
631
|
+
if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && dataSlice(error.data, 0, 4) === "0x556f1830") {
|
|
632
|
+
const data = error.data;
|
|
633
|
+
const txSender = await resolveAddress(transaction.to, this);
|
|
634
|
+
// Parse the CCIP Read Arguments
|
|
635
|
+
let ccipArgs;
|
|
636
|
+
try {
|
|
637
|
+
ccipArgs = parseOffchainLookup(dataSlice(error.data, 4));
|
|
638
|
+
}
|
|
639
|
+
catch (error) {
|
|
640
|
+
assert(false, error.message, "OFFCHAIN_FAULT", {
|
|
641
|
+
reason: "BAD_DATA", transaction, info: { data }
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
// Check the sender of the OffchainLookup matches the transaction
|
|
645
|
+
assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", {
|
|
646
|
+
action: "call",
|
|
647
|
+
data,
|
|
648
|
+
reason: "OffchainLookup",
|
|
649
|
+
transaction: transaction,
|
|
650
|
+
invocation: null,
|
|
651
|
+
revert: {
|
|
652
|
+
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
653
|
+
name: "OffchainLookup",
|
|
654
|
+
args: ccipArgs.errorArgs
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls);
|
|
658
|
+
assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", {
|
|
659
|
+
reason: "FETCH_FAILED", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs }
|
|
660
|
+
});
|
|
661
|
+
const tx = {
|
|
662
|
+
to: txSender,
|
|
663
|
+
data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])])
|
|
664
|
+
};
|
|
665
|
+
this.emit("debug", { action: "sendCcipReadCall", transaction: tx });
|
|
666
|
+
try {
|
|
667
|
+
const result = await this.#call(tx, blockTag, attempt + 1);
|
|
668
|
+
this.emit("debug", { action: "receiveCcipReadCallResult", transaction: Object.assign({}, tx), result });
|
|
669
|
+
return result;
|
|
670
|
+
}
|
|
671
|
+
catch (error) {
|
|
672
|
+
this.emit("debug", { action: "receiveCcipReadCallError", transaction: Object.assign({}, tx), error });
|
|
673
|
+
throw error;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
throw error;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
async #checkNetwork(promise) {
|
|
680
|
+
const { value } = await resolveProperties({
|
|
681
|
+
network: this.getNetwork(),
|
|
682
|
+
value: promise
|
|
683
|
+
});
|
|
684
|
+
return value;
|
|
685
|
+
}
|
|
686
|
+
async call(_tx) {
|
|
687
|
+
const { tx, blockTag } = await resolveProperties({
|
|
688
|
+
tx: this._getTransactionRequest(_tx),
|
|
689
|
+
blockTag: this._getBlockTag(_tx.blockTag)
|
|
690
|
+
});
|
|
691
|
+
return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1));
|
|
692
|
+
}
|
|
693
|
+
// Account
|
|
694
|
+
async #getAccountValue(request, _address, _blockTag) {
|
|
695
|
+
let address = this._getAddress(_address);
|
|
696
|
+
let blockTag = this._getBlockTag(_blockTag);
|
|
697
|
+
if (typeof (address) !== "string" || typeof (blockTag) !== "string") {
|
|
698
|
+
[address, blockTag] = await Promise.all([address, blockTag]);
|
|
699
|
+
}
|
|
700
|
+
return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag })));
|
|
701
|
+
}
|
|
702
|
+
async getBalance(address, blockTag) {
|
|
703
|
+
return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response");
|
|
704
|
+
}
|
|
705
|
+
async getTransactionCount(address, blockTag) {
|
|
706
|
+
return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response");
|
|
707
|
+
}
|
|
708
|
+
async getCode(address, blockTag) {
|
|
709
|
+
return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag));
|
|
710
|
+
}
|
|
711
|
+
async getStorage(address, _position, blockTag) {
|
|
712
|
+
const position = getBigInt(_position, "position");
|
|
713
|
+
return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag));
|
|
714
|
+
}
|
|
715
|
+
// Write
|
|
716
|
+
async broadcastTransaction(signedTx) {
|
|
717
|
+
const { blockNumber, hash, network } = await resolveProperties({
|
|
718
|
+
blockNumber: this.getBlockNumber(),
|
|
719
|
+
hash: this._perform({
|
|
720
|
+
method: "broadcastTransaction",
|
|
721
|
+
signedTransaction: signedTx
|
|
722
|
+
}),
|
|
723
|
+
network: this.getNetwork()
|
|
724
|
+
});
|
|
725
|
+
const tx = Transaction.from(signedTx);
|
|
726
|
+
if (tx.hash !== hash) {
|
|
727
|
+
throw new Error("@TODO: the returned hash did not match");
|
|
728
|
+
}
|
|
729
|
+
return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber);
|
|
730
|
+
}
|
|
731
|
+
async #getBlock(block, includeTransactions) {
|
|
732
|
+
// @TODO: Add CustomBlockPlugin check
|
|
733
|
+
if (isHexString(block, 32)) {
|
|
734
|
+
return await this.#perform({
|
|
735
|
+
method: "getBlock", blockHash: block, includeTransactions
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
let blockTag = this._getBlockTag(block);
|
|
739
|
+
if (typeof (blockTag) !== "string") {
|
|
740
|
+
blockTag = await blockTag;
|
|
741
|
+
}
|
|
742
|
+
return await this.#perform({
|
|
743
|
+
method: "getBlock", blockTag, includeTransactions
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
// Queries
|
|
747
|
+
async getBlock(block, prefetchTxs) {
|
|
748
|
+
const { network, params } = await resolveProperties({
|
|
749
|
+
network: this.getNetwork(),
|
|
750
|
+
params: this.#getBlock(block, !!prefetchTxs)
|
|
751
|
+
});
|
|
752
|
+
if (params == null) {
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
return this._wrapBlock(params, network);
|
|
756
|
+
}
|
|
757
|
+
async getTransaction(hash) {
|
|
758
|
+
const { network, params } = await resolveProperties({
|
|
759
|
+
network: this.getNetwork(),
|
|
760
|
+
params: this.#perform({ method: "getTransaction", hash })
|
|
761
|
+
});
|
|
762
|
+
if (params == null) {
|
|
763
|
+
return null;
|
|
764
|
+
}
|
|
765
|
+
return this._wrapTransactionResponse(params, network);
|
|
766
|
+
}
|
|
767
|
+
async getTransactionReceipt(hash) {
|
|
768
|
+
const { network, params } = await resolveProperties({
|
|
769
|
+
network: this.getNetwork(),
|
|
770
|
+
params: this.#perform({ method: "getTransactionReceipt", hash })
|
|
771
|
+
});
|
|
772
|
+
if (params == null) {
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
775
|
+
// Some backends did not backfill the effectiveGasPrice into old transactions
|
|
776
|
+
// in the receipt, so we look it up manually and inject it.
|
|
777
|
+
if (params.gasPrice == null && params.effectiveGasPrice == null) {
|
|
778
|
+
const tx = await this.#perform({ method: "getTransaction", hash });
|
|
779
|
+
if (tx == null) {
|
|
780
|
+
throw new Error("report this; could not find tx or effectiveGasPrice");
|
|
781
|
+
}
|
|
782
|
+
params.effectiveGasPrice = tx.gasPrice;
|
|
783
|
+
}
|
|
784
|
+
return this._wrapTransactionReceipt(params, network);
|
|
785
|
+
}
|
|
786
|
+
async getTransactionResult(hash) {
|
|
787
|
+
const { result } = await resolveProperties({
|
|
788
|
+
network: this.getNetwork(),
|
|
789
|
+
result: this.#perform({ method: "getTransactionResult", hash })
|
|
790
|
+
});
|
|
791
|
+
if (result == null) {
|
|
792
|
+
return null;
|
|
793
|
+
}
|
|
794
|
+
return hexlify(result);
|
|
795
|
+
}
|
|
796
|
+
// Bloom-filter Queries
|
|
797
|
+
async getLogs(_filter) {
|
|
798
|
+
let filter = this._getFilter(_filter);
|
|
799
|
+
if (isPromise(filter)) {
|
|
800
|
+
filter = await filter;
|
|
801
|
+
}
|
|
802
|
+
const { network, params } = await resolveProperties({
|
|
803
|
+
network: this.getNetwork(),
|
|
804
|
+
params: this.#perform({ method: "getLogs", filter })
|
|
805
|
+
});
|
|
806
|
+
return params.map((p) => this._wrapLog(p, network));
|
|
807
|
+
}
|
|
808
|
+
// ENS
|
|
809
|
+
_getProvider(chainId) {
|
|
810
|
+
assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", {
|
|
811
|
+
operation: "_getProvider()"
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
async getResolver(name) {
|
|
815
|
+
return await EnsResolver.fromName(this, name);
|
|
816
|
+
}
|
|
817
|
+
async getAvatar(name) {
|
|
818
|
+
const resolver = await this.getResolver(name);
|
|
819
|
+
if (resolver) {
|
|
820
|
+
return await resolver.getAvatar();
|
|
821
|
+
}
|
|
822
|
+
return null;
|
|
823
|
+
}
|
|
824
|
+
async resolveName(name) {
|
|
825
|
+
const resolver = await this.getResolver(name);
|
|
826
|
+
if (resolver) {
|
|
827
|
+
return await resolver.getAddress();
|
|
828
|
+
}
|
|
829
|
+
return null;
|
|
830
|
+
}
|
|
831
|
+
async lookupAddress(address) {
|
|
832
|
+
address = getAddress(address);
|
|
833
|
+
const node = namehash(address.substring(2).toLowerCase() + ".addr.reverse");
|
|
834
|
+
try {
|
|
835
|
+
const ensAddr = await EnsResolver.getEnsAddress(this);
|
|
836
|
+
const ensContract = new Contract(ensAddr, [
|
|
837
|
+
"function resolver(bytes32) view returns (address)"
|
|
838
|
+
], this);
|
|
839
|
+
const resolver = await ensContract.resolver(node);
|
|
840
|
+
if (resolver == null || resolver === ZeroAddress) {
|
|
841
|
+
return null;
|
|
842
|
+
}
|
|
843
|
+
const resolverContract = new Contract(resolver, [
|
|
844
|
+
"function name(bytes32) view returns (string)"
|
|
845
|
+
], this);
|
|
846
|
+
const name = await resolverContract.name(node);
|
|
847
|
+
// Failed forward resolution
|
|
848
|
+
const check = await this.resolveName(name);
|
|
849
|
+
if (check !== address) {
|
|
850
|
+
return null;
|
|
851
|
+
}
|
|
852
|
+
return name;
|
|
853
|
+
}
|
|
854
|
+
catch (error) {
|
|
855
|
+
// No data was returned from the resolver
|
|
856
|
+
if (isError(error, "BAD_DATA") && error.value === "0x") {
|
|
857
|
+
return null;
|
|
858
|
+
}
|
|
859
|
+
// Something reerted
|
|
860
|
+
if (isError(error, "CALL_EXCEPTION")) {
|
|
861
|
+
return null;
|
|
862
|
+
}
|
|
863
|
+
throw error;
|
|
864
|
+
}
|
|
865
|
+
return null;
|
|
866
|
+
}
|
|
867
|
+
async waitForTransaction(hash, _confirms, timeout) {
|
|
868
|
+
const confirms = (_confirms != null) ? _confirms : 1;
|
|
869
|
+
if (confirms === 0) {
|
|
870
|
+
return this.getTransactionReceipt(hash);
|
|
871
|
+
}
|
|
872
|
+
return new Promise(async (resolve, reject) => {
|
|
873
|
+
let timer = null;
|
|
874
|
+
const listener = (async (blockNumber) => {
|
|
875
|
+
try {
|
|
876
|
+
const receipt = await this.getTransactionReceipt(hash);
|
|
877
|
+
if (receipt != null) {
|
|
878
|
+
if (blockNumber - receipt.blockNumber + 1 >= confirms) {
|
|
879
|
+
resolve(receipt);
|
|
880
|
+
//this.off("block", listener);
|
|
881
|
+
if (timer) {
|
|
882
|
+
clearTimeout(timer);
|
|
883
|
+
timer = null;
|
|
884
|
+
}
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
catch (error) {
|
|
890
|
+
console.log("EEE", error);
|
|
891
|
+
}
|
|
892
|
+
this.once("block", listener);
|
|
893
|
+
});
|
|
894
|
+
if (timeout != null) {
|
|
895
|
+
timer = setTimeout(() => {
|
|
896
|
+
if (timer == null) {
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
timer = null;
|
|
900
|
+
this.off("block", listener);
|
|
901
|
+
reject(makeError("timeout", "TIMEOUT", { reason: "timeout" }));
|
|
902
|
+
}, timeout);
|
|
903
|
+
}
|
|
904
|
+
listener(await this.getBlockNumber());
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
async waitForBlock(blockTag) {
|
|
908
|
+
assert(false, "not implemented yet", "NOT_IMPLEMENTED", {
|
|
909
|
+
operation: "waitForBlock"
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Clear a timer created using the [[_setTimeout]] method.
|
|
914
|
+
*/
|
|
915
|
+
_clearTimeout(timerId) {
|
|
916
|
+
const timer = this.#timers.get(timerId);
|
|
917
|
+
if (!timer) {
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
if (timer.timer) {
|
|
921
|
+
clearTimeout(timer.timer);
|
|
922
|
+
}
|
|
923
|
+
this.#timers.delete(timerId);
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Create a timer that will execute %%func%% after at least %%timeout%%
|
|
927
|
+
* (in ms). If %%timeout%% is unspecified, then %%func%% will execute
|
|
928
|
+
* in the next event loop.
|
|
929
|
+
*
|
|
930
|
+
* [Pausing](AbstractProvider-paused) the provider will pause any
|
|
931
|
+
* associated timers.
|
|
932
|
+
*/
|
|
933
|
+
_setTimeout(_func, timeout) {
|
|
934
|
+
if (timeout == null) {
|
|
935
|
+
timeout = 0;
|
|
936
|
+
}
|
|
937
|
+
const timerId = this.#nextTimer++;
|
|
938
|
+
const func = () => {
|
|
939
|
+
this.#timers.delete(timerId);
|
|
940
|
+
_func();
|
|
941
|
+
};
|
|
942
|
+
if (this.paused) {
|
|
943
|
+
this.#timers.set(timerId, { timer: null, func, time: timeout });
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
const timer = setTimeout(func, timeout);
|
|
947
|
+
this.#timers.set(timerId, { timer, func, time: getTime() });
|
|
948
|
+
}
|
|
949
|
+
return timerId;
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Perform %%func%% on each subscriber.
|
|
953
|
+
*/
|
|
954
|
+
_forEachSubscriber(func) {
|
|
955
|
+
for (const sub of this.#subs.values()) {
|
|
956
|
+
func(sub.subscriber);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Sub-classes may override this to customize subscription
|
|
961
|
+
* implementations.
|
|
962
|
+
*/
|
|
963
|
+
_getSubscriber(sub) {
|
|
964
|
+
switch (sub.type) {
|
|
965
|
+
case "debug":
|
|
966
|
+
case "error":
|
|
967
|
+
case "network":
|
|
968
|
+
return new UnmanagedSubscriber(sub.type);
|
|
969
|
+
case "block": {
|
|
970
|
+
const subscriber = new PollingBlockSubscriber(this);
|
|
971
|
+
subscriber.pollingInterval = this.pollingInterval;
|
|
972
|
+
return subscriber;
|
|
973
|
+
}
|
|
974
|
+
case "event":
|
|
975
|
+
return new PollingEventSubscriber(this, sub.filter);
|
|
976
|
+
case "transaction":
|
|
977
|
+
return new PollingTransactionSubscriber(this, sub.hash);
|
|
978
|
+
case "orphan":
|
|
979
|
+
return new PollingOrphanSubscriber(this, sub.filter);
|
|
980
|
+
}
|
|
981
|
+
throw new Error(`unsupported event: ${sub.type}`);
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* If a [[Subscriber]] fails and needs to replace itself, this
|
|
985
|
+
* method may be used.
|
|
986
|
+
*
|
|
987
|
+
* For example, this is used for providers when using the
|
|
988
|
+
* ``eth_getFilterChanges`` method, which can return null if state
|
|
989
|
+
* filters are not supported by the backend, allowing the Subscriber
|
|
990
|
+
* to swap in a [[PollingEventSubscriber]].
|
|
991
|
+
*/
|
|
992
|
+
_recoverSubscriber(oldSub, newSub) {
|
|
993
|
+
for (const sub of this.#subs.values()) {
|
|
994
|
+
if (sub.subscriber === oldSub) {
|
|
995
|
+
if (sub.started) {
|
|
996
|
+
sub.subscriber.stop();
|
|
997
|
+
}
|
|
998
|
+
sub.subscriber = newSub;
|
|
999
|
+
if (sub.started) {
|
|
1000
|
+
newSub.start();
|
|
1001
|
+
}
|
|
1002
|
+
if (this.#pausedState != null) {
|
|
1003
|
+
newSub.pause(this.#pausedState);
|
|
1004
|
+
}
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
async #hasSub(event, emitArgs) {
|
|
1010
|
+
let sub = await getSubscription(event, this);
|
|
1011
|
+
// This is a log that is removing an existing log; we actually want
|
|
1012
|
+
// to emit an orphan event for the removed log
|
|
1013
|
+
if (sub.type === "event" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) {
|
|
1014
|
+
sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this);
|
|
1015
|
+
}
|
|
1016
|
+
return this.#subs.get(sub.tag) || null;
|
|
1017
|
+
}
|
|
1018
|
+
async #getSub(event) {
|
|
1019
|
+
const subscription = await getSubscription(event, this);
|
|
1020
|
+
// Prevent tampering with our tag in any subclass' _getSubscriber
|
|
1021
|
+
const tag = subscription.tag;
|
|
1022
|
+
let sub = this.#subs.get(tag);
|
|
1023
|
+
if (!sub) {
|
|
1024
|
+
const subscriber = this._getSubscriber(subscription);
|
|
1025
|
+
const addressableMap = new WeakMap();
|
|
1026
|
+
const nameMap = new Map();
|
|
1027
|
+
sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] };
|
|
1028
|
+
this.#subs.set(tag, sub);
|
|
1029
|
+
}
|
|
1030
|
+
return sub;
|
|
1031
|
+
}
|
|
1032
|
+
async on(event, listener) {
|
|
1033
|
+
const sub = await this.#getSub(event);
|
|
1034
|
+
sub.listeners.push({ listener, once: false });
|
|
1035
|
+
if (!sub.started) {
|
|
1036
|
+
sub.subscriber.start();
|
|
1037
|
+
sub.started = true;
|
|
1038
|
+
if (this.#pausedState != null) {
|
|
1039
|
+
sub.subscriber.pause(this.#pausedState);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
return this;
|
|
1043
|
+
}
|
|
1044
|
+
async once(event, listener) {
|
|
1045
|
+
const sub = await this.#getSub(event);
|
|
1046
|
+
sub.listeners.push({ listener, once: true });
|
|
1047
|
+
if (!sub.started) {
|
|
1048
|
+
sub.subscriber.start();
|
|
1049
|
+
sub.started = true;
|
|
1050
|
+
if (this.#pausedState != null) {
|
|
1051
|
+
sub.subscriber.pause(this.#pausedState);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
return this;
|
|
1055
|
+
}
|
|
1056
|
+
async emit(event, ...args) {
|
|
1057
|
+
const sub = await this.#hasSub(event, args);
|
|
1058
|
+
// If there is not subscription or if a recent emit removed
|
|
1059
|
+
// the last of them (which also deleted the sub) do nothing
|
|
1060
|
+
if (!sub || sub.listeners.length === 0) {
|
|
1061
|
+
return false;
|
|
1062
|
+
}
|
|
1063
|
+
;
|
|
1064
|
+
const count = sub.listeners.length;
|
|
1065
|
+
sub.listeners = sub.listeners.filter(({ listener, once }) => {
|
|
1066
|
+
const payload = new EventPayload(this, (once ? null : listener), event);
|
|
1067
|
+
try {
|
|
1068
|
+
listener.call(this, ...args, payload);
|
|
1069
|
+
}
|
|
1070
|
+
catch (error) { }
|
|
1071
|
+
return !once;
|
|
1072
|
+
});
|
|
1073
|
+
if (sub.listeners.length === 0) {
|
|
1074
|
+
if (sub.started) {
|
|
1075
|
+
sub.subscriber.stop();
|
|
1076
|
+
}
|
|
1077
|
+
this.#subs.delete(sub.tag);
|
|
1078
|
+
}
|
|
1079
|
+
return (count > 0);
|
|
1080
|
+
}
|
|
1081
|
+
async listenerCount(event) {
|
|
1082
|
+
if (event) {
|
|
1083
|
+
const sub = await this.#hasSub(event);
|
|
1084
|
+
if (!sub) {
|
|
1085
|
+
return 0;
|
|
1086
|
+
}
|
|
1087
|
+
return sub.listeners.length;
|
|
1088
|
+
}
|
|
1089
|
+
let total = 0;
|
|
1090
|
+
for (const { listeners } of this.#subs.values()) {
|
|
1091
|
+
total += listeners.length;
|
|
1092
|
+
}
|
|
1093
|
+
return total;
|
|
1094
|
+
}
|
|
1095
|
+
async listeners(event) {
|
|
1096
|
+
if (event) {
|
|
1097
|
+
const sub = await this.#hasSub(event);
|
|
1098
|
+
if (!sub) {
|
|
1099
|
+
return [];
|
|
1100
|
+
}
|
|
1101
|
+
return sub.listeners.map(({ listener }) => listener);
|
|
1102
|
+
}
|
|
1103
|
+
let result = [];
|
|
1104
|
+
for (const { listeners } of this.#subs.values()) {
|
|
1105
|
+
result = result.concat(listeners.map(({ listener }) => listener));
|
|
1106
|
+
}
|
|
1107
|
+
return result;
|
|
1108
|
+
}
|
|
1109
|
+
async off(event, listener) {
|
|
1110
|
+
const sub = await this.#hasSub(event);
|
|
1111
|
+
if (!sub) {
|
|
1112
|
+
return this;
|
|
1113
|
+
}
|
|
1114
|
+
if (listener) {
|
|
1115
|
+
const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);
|
|
1116
|
+
if (index >= 0) {
|
|
1117
|
+
sub.listeners.splice(index, 1);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
if (!listener || sub.listeners.length === 0) {
|
|
1121
|
+
if (sub.started) {
|
|
1122
|
+
sub.subscriber.stop();
|
|
1123
|
+
}
|
|
1124
|
+
this.#subs.delete(sub.tag);
|
|
1125
|
+
}
|
|
1126
|
+
return this;
|
|
1127
|
+
}
|
|
1128
|
+
async removeAllListeners(event) {
|
|
1129
|
+
if (event) {
|
|
1130
|
+
const { tag, started, subscriber } = await this.#getSub(event);
|
|
1131
|
+
if (started) {
|
|
1132
|
+
subscriber.stop();
|
|
1133
|
+
}
|
|
1134
|
+
this.#subs.delete(tag);
|
|
1135
|
+
}
|
|
1136
|
+
else {
|
|
1137
|
+
for (const [tag, { started, subscriber }] of this.#subs) {
|
|
1138
|
+
if (started) {
|
|
1139
|
+
subscriber.stop();
|
|
1140
|
+
}
|
|
1141
|
+
this.#subs.delete(tag);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
return this;
|
|
1145
|
+
}
|
|
1146
|
+
// Alias for "on"
|
|
1147
|
+
async addListener(event, listener) {
|
|
1148
|
+
return await this.on(event, listener);
|
|
1149
|
+
}
|
|
1150
|
+
// Alias for "off"
|
|
1151
|
+
async removeListener(event, listener) {
|
|
1152
|
+
return this.off(event, listener);
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* If this provider has been destroyed using the [[destroy]] method.
|
|
1156
|
+
*
|
|
1157
|
+
* Once destroyed, all resources are reclaimed, internal event loops
|
|
1158
|
+
* and timers are cleaned up and no further requests may be sent to
|
|
1159
|
+
* the provider.
|
|
1160
|
+
*/
|
|
1161
|
+
get destroyed() {
|
|
1162
|
+
return this.#destroyed;
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Sub-classes may use this to shutdown any sockets or release their
|
|
1166
|
+
* resources and reject any pending requests.
|
|
1167
|
+
*
|
|
1168
|
+
* Sub-classes **must** call ``super.destroy()``.
|
|
1169
|
+
*/
|
|
1170
|
+
destroy() {
|
|
1171
|
+
// Stop all listeners
|
|
1172
|
+
this.removeAllListeners();
|
|
1173
|
+
// Shut down all tiemrs
|
|
1174
|
+
for (const timerId of this.#timers.keys()) {
|
|
1175
|
+
this._clearTimeout(timerId);
|
|
1176
|
+
}
|
|
1177
|
+
this.#destroyed = true;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Whether the provider is currently paused.
|
|
1181
|
+
*
|
|
1182
|
+
* A paused provider will not emit any events, and generally should
|
|
1183
|
+
* not make any requests to the network, but that is up to sub-classes
|
|
1184
|
+
* to manage.
|
|
1185
|
+
*
|
|
1186
|
+
* Setting ``paused = true`` is identical to calling ``.pause(false)``,
|
|
1187
|
+
* which will buffer any events that occur while paused until the
|
|
1188
|
+
* provider is unpaused.
|
|
1189
|
+
*/
|
|
1190
|
+
get paused() { return (this.#pausedState != null); }
|
|
1191
|
+
set paused(pause) {
|
|
1192
|
+
if (!!pause === this.paused) {
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
if (this.paused) {
|
|
1196
|
+
this.resume();
|
|
1197
|
+
}
|
|
1198
|
+
else {
|
|
1199
|
+
this.pause(false);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* Pause the provider. If %%dropWhilePaused%%, any events that occur
|
|
1204
|
+
* while paused are dropped, otherwise all events will be emitted once
|
|
1205
|
+
* the provider is unpaused.
|
|
1206
|
+
*/
|
|
1207
|
+
pause(dropWhilePaused) {
|
|
1208
|
+
this.#lastBlockNumber = -1;
|
|
1209
|
+
if (this.#pausedState != null) {
|
|
1210
|
+
if (this.#pausedState == !!dropWhilePaused) {
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", {
|
|
1214
|
+
operation: "pause"
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
this._forEachSubscriber((s) => s.pause(dropWhilePaused));
|
|
1218
|
+
this.#pausedState = !!dropWhilePaused;
|
|
1219
|
+
for (const timer of this.#timers.values()) {
|
|
1220
|
+
// Clear the timer
|
|
1221
|
+
if (timer.timer) {
|
|
1222
|
+
clearTimeout(timer.timer);
|
|
1223
|
+
}
|
|
1224
|
+
// Remaining time needed for when we become unpaused
|
|
1225
|
+
timer.time = getTime() - timer.time;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Resume the provider.
|
|
1230
|
+
*/
|
|
1231
|
+
resume() {
|
|
1232
|
+
if (this.#pausedState == null) {
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
this._forEachSubscriber((s) => s.resume());
|
|
1236
|
+
this.#pausedState = null;
|
|
1237
|
+
for (const timer of this.#timers.values()) {
|
|
1238
|
+
// Remaining time when we were paused
|
|
1239
|
+
let timeout = timer.time;
|
|
1240
|
+
if (timeout < 0) {
|
|
1241
|
+
timeout = 0;
|
|
1242
|
+
}
|
|
1243
|
+
// Start time (in cause paused, so we con compute remaininf time)
|
|
1244
|
+
timer.time = getTime();
|
|
1245
|
+
// Start the timer
|
|
1246
|
+
setTimeout(timer.func, timeout);
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
function _parseString(result, start) {
|
|
1251
|
+
try {
|
|
1252
|
+
const bytes = _parseBytes(result, start);
|
|
1253
|
+
if (bytes) {
|
|
1254
|
+
return toUtf8String(bytes);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
catch (error) { }
|
|
1258
|
+
return null;
|
|
1259
|
+
}
|
|
1260
|
+
function _parseBytes(result, start) {
|
|
1261
|
+
if (result === "0x") {
|
|
1262
|
+
return null;
|
|
1263
|
+
}
|
|
1264
|
+
try {
|
|
1265
|
+
const offset = getNumber(dataSlice(result, start, start + 32));
|
|
1266
|
+
const length = getNumber(dataSlice(result, offset, offset + 32));
|
|
1267
|
+
return dataSlice(result, offset + 32, offset + 32 + length);
|
|
1268
|
+
}
|
|
1269
|
+
catch (error) { }
|
|
1270
|
+
return null;
|
|
1271
|
+
}
|
|
1272
|
+
function numPad(value) {
|
|
1273
|
+
const result = toBeArray(value);
|
|
1274
|
+
if (result.length > 32) {
|
|
1275
|
+
throw new Error("internal; should not happen");
|
|
1276
|
+
}
|
|
1277
|
+
const padded = new Uint8Array(32);
|
|
1278
|
+
padded.set(result, 32 - result.length);
|
|
1279
|
+
return padded;
|
|
1280
|
+
}
|
|
1281
|
+
function bytesPad(value) {
|
|
1282
|
+
if ((value.length % 32) === 0) {
|
|
1283
|
+
return value;
|
|
1284
|
+
}
|
|
1285
|
+
const result = new Uint8Array(Math.ceil(value.length / 32) * 32);
|
|
1286
|
+
result.set(value);
|
|
1287
|
+
return result;
|
|
1288
|
+
}
|
|
1289
|
+
const empty = new Uint8Array([]);
|
|
1290
|
+
// ABI Encodes a series of (bytes, bytes, ...)
|
|
1291
|
+
function encodeBytes(datas) {
|
|
1292
|
+
const result = [];
|
|
1293
|
+
let byteCount = 0;
|
|
1294
|
+
// Add place-holders for pointers as we add items
|
|
1295
|
+
for (let i = 0; i < datas.length; i++) {
|
|
1296
|
+
result.push(empty);
|
|
1297
|
+
byteCount += 32;
|
|
1298
|
+
}
|
|
1299
|
+
for (let i = 0; i < datas.length; i++) {
|
|
1300
|
+
const data = getBytes(datas[i]);
|
|
1301
|
+
// Update the bytes offset
|
|
1302
|
+
result[i] = numPad(byteCount);
|
|
1303
|
+
// The length and padded value of data
|
|
1304
|
+
result.push(numPad(data.length));
|
|
1305
|
+
result.push(bytesPad(data));
|
|
1306
|
+
byteCount += 32 + Math.ceil(data.length / 32) * 32;
|
|
1307
|
+
}
|
|
1308
|
+
return concat(result);
|
|
1309
|
+
}
|
|
1310
|
+
const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
1311
|
+
function parseOffchainLookup(data) {
|
|
1312
|
+
const result = {
|
|
1313
|
+
sender: "", urls: [], calldata: "", selector: "", extraData: "", errorArgs: []
|
|
1314
|
+
};
|
|
1315
|
+
assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", {
|
|
1316
|
+
reason: "insufficient OffchainLookup data"
|
|
1317
|
+
});
|
|
1318
|
+
const sender = dataSlice(data, 0, 32);
|
|
1319
|
+
assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", {
|
|
1320
|
+
reason: "corrupt OffchainLookup sender"
|
|
1321
|
+
});
|
|
1322
|
+
result.sender = dataSlice(sender, 12);
|
|
1323
|
+
// Read the URLs from the response
|
|
1324
|
+
try {
|
|
1325
|
+
const urls = [];
|
|
1326
|
+
const urlsOffset = getNumber(dataSlice(data, 32, 64));
|
|
1327
|
+
const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32));
|
|
1328
|
+
const urlsData = dataSlice(data, urlsOffset + 32);
|
|
1329
|
+
for (let u = 0; u < urlsLength; u++) {
|
|
1330
|
+
const url = _parseString(urlsData, u * 32);
|
|
1331
|
+
if (url == null) {
|
|
1332
|
+
throw new Error("abort");
|
|
1333
|
+
}
|
|
1334
|
+
urls.push(url);
|
|
1335
|
+
}
|
|
1336
|
+
result.urls = urls;
|
|
1337
|
+
}
|
|
1338
|
+
catch (error) {
|
|
1339
|
+
assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", {
|
|
1340
|
+
reason: "corrupt OffchainLookup urls"
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
// Get the CCIP calldata to forward
|
|
1344
|
+
try {
|
|
1345
|
+
const calldata = _parseBytes(data, 64);
|
|
1346
|
+
if (calldata == null) {
|
|
1347
|
+
throw new Error("abort");
|
|
1348
|
+
}
|
|
1349
|
+
result.calldata = calldata;
|
|
1350
|
+
}
|
|
1351
|
+
catch (error) {
|
|
1352
|
+
assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", {
|
|
1353
|
+
reason: "corrupt OffchainLookup calldata"
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
// Get the callbackSelector (bytes4)
|
|
1357
|
+
assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", {
|
|
1358
|
+
reason: "corrupt OffchainLookup callbaackSelector"
|
|
1359
|
+
});
|
|
1360
|
+
result.selector = dataSlice(data, 96, 100);
|
|
1361
|
+
// Get the extra data to send back to the contract as context
|
|
1362
|
+
try {
|
|
1363
|
+
const extraData = _parseBytes(data, 128);
|
|
1364
|
+
if (extraData == null) {
|
|
1365
|
+
throw new Error("abort");
|
|
1366
|
+
}
|
|
1367
|
+
result.extraData = extraData;
|
|
1368
|
+
}
|
|
1369
|
+
catch (error) {
|
|
1370
|
+
assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", {
|
|
1371
|
+
reason: "corrupt OffchainLookup extraData"
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((k) => result[k]);
|
|
1375
|
+
return result;
|
|
1376
|
+
}
|
|
1377
|
+
//# sourceMappingURL=abstract-provider.js.map
|