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