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