quantumcoin 6.14.4 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish-npmjs.yaml +22 -0
- package/.gitignore +12 -0
- package/{LICENSE.md → LICENSE} +1 -1
- package/README-SDK.md +700 -0
- package/README.md +84 -89
- package/config.d.ts +50 -0
- package/config.js +115 -0
- package/examples/events.js +35 -0
- package/examples/example.js +61 -0
- package/examples/package-lock.json +1150 -0
- package/examples/package.json +17 -0
- package/examples/read-operations.js +28 -0
- package/examples/wallet-offline.js +29 -0
- package/generate-sdk.js +888 -0
- package/index.js +12 -0
- package/package.json +44 -120
- 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 +114 -0
- package/src/abi/interface.js +352 -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 +93 -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 +426 -0
- package/src/index.d.ts +111 -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 +194 -0
- package/src/providers/provider.js +359 -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/helpers.js +47 -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 +38 -0
- package/test/unit/generate-sdk-artifacts-json.test.js +65 -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/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/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 -145
- package/lib.commonjs/crypto/signature.d.ts.map +0 -1
- package/lib.commonjs/crypto/signature.js +0 -302
- 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 -102
- 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 -361
- package/lib.commonjs/providers/provider-jsonrpc.d.ts.map +0 -1
- package/lib.commonjs/providers/provider-jsonrpc.js +0 -980
- 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 -1148
- 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 -145
- package/lib.esm/crypto/signature.d.ts.map +0 -1
- package/lib.esm/crypto/signature.js +0 -300
- 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 -97
- 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 -361
- package/lib.esm/providers/provider-jsonrpc.d.ts.map +0 -1
- package/lib.esm/providers/provider-jsonrpc.js +0 -973
- 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 -1144
- 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 -349
- package/src.ts/crypto/signing-key.ts +0 -123
- 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 -1335
- 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 -1379
- 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
package/generate-sdk.js
ADDED
|
@@ -0,0 +1,888 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* quantumcoin-sdk-generator
|
|
4
|
+
*
|
|
5
|
+
* NOTE: This script is the SDK generator CLI entrypoint.
|
|
6
|
+
*
|
|
7
|
+
* SPEC.md section 15: Typed Contract Generator
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* - Non-interactive:
|
|
11
|
+
* `node generate-sdk.js --abi path/to/abi.json --bin path/to/bytecode.bin --out ./out --name MyContract`
|
|
12
|
+
*
|
|
13
|
+
* - Interactive:
|
|
14
|
+
* `node generate-sdk.js --abi path/to/abi.json --bin path/to/bytecode.bin`
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const fs = require("node:fs");
|
|
18
|
+
const path = require("node:path");
|
|
19
|
+
const readline = require("node:readline/promises");
|
|
20
|
+
const { stdin, stdout } = require("node:process");
|
|
21
|
+
const { execFileSync, spawnSync } = require("node:child_process");
|
|
22
|
+
|
|
23
|
+
const { generate, generateFromArtifacts, generateTransactionalTestJs } = require("./src/generator");
|
|
24
|
+
|
|
25
|
+
function _helpText() {
|
|
26
|
+
return `
|
|
27
|
+
quantumcoin-sdk-generator (generate-sdk.js)
|
|
28
|
+
|
|
29
|
+
Generates TypeScript contract wrappers (plus optional package scaffold, examples and transactional tests).
|
|
30
|
+
|
|
31
|
+
If you run this script with no parameters, it prints this help.
|
|
32
|
+
|
|
33
|
+
USAGE
|
|
34
|
+
node generate-sdk.js [options]
|
|
35
|
+
|
|
36
|
+
INPUT MODES
|
|
37
|
+
1) ABI + BIN (bytecode)
|
|
38
|
+
--abi <path/to/Contract.abi.json>
|
|
39
|
+
--bin <path/to/Contract.bin>
|
|
40
|
+
--name <ContractName> (optional; defaults from ABI filename)
|
|
41
|
+
|
|
42
|
+
2) Solidity (.sol) sources
|
|
43
|
+
--sol "<A.sol,B.sol,...>" (comma-separated list; can be 1+ files)
|
|
44
|
+
--name <ContractName> (optional; if omitted, generates ALL deployable contracts found)
|
|
45
|
+
--solc <path/to/solc.exe> (optional; defaults from env; see ENV below)
|
|
46
|
+
|
|
47
|
+
3) Artifacts JSON (array of ABI+BIN pairs)
|
|
48
|
+
--artifacts-json <path/to/artifacts.json>
|
|
49
|
+
The JSON file should be an array. Each entry supports:
|
|
50
|
+
- { abi: "<path|abiArray>", bin: "<path|0x...>", name?: "<ContractName>" }
|
|
51
|
+
If "name" is omitted and abi is a path, the contract name defaults from the ABI filename.
|
|
52
|
+
|
|
53
|
+
PACKAGE OUTPUT (optional)
|
|
54
|
+
--create-package
|
|
55
|
+
--package-dir <folder>
|
|
56
|
+
--package-name <name>
|
|
57
|
+
--package-description <text>
|
|
58
|
+
--package-author <text>
|
|
59
|
+
--package-license <spdx> (default: MIT)
|
|
60
|
+
--package-version <semver> (default: 0.0.1)
|
|
61
|
+
|
|
62
|
+
Notes:
|
|
63
|
+
- When --create-package is used, the generator creates a complete npm package scaffold with:
|
|
64
|
+
- src/*.ts (typed contracts + factories)
|
|
65
|
+
- test/e2e/*.e2e.test.js (transactional tests)
|
|
66
|
+
- examples/ (deploy/read/write/events)
|
|
67
|
+
- artifacts/ (only when using --sol)
|
|
68
|
+
- index.js + index.d.ts + README.md (generated by build scripts)
|
|
69
|
+
- The generator will run:
|
|
70
|
+
npm install
|
|
71
|
+
npm run build:ts
|
|
72
|
+
npm run build-powershell (Windows) or npm run build (non-Windows)
|
|
73
|
+
as the final step, so README.md and index.d.ts are produced immediately.
|
|
74
|
+
|
|
75
|
+
GENERAL OPTIONS
|
|
76
|
+
--out <folder> Output folder (default: ./generated-contract)
|
|
77
|
+
--non-interactive | --yes Disable prompts (required for CI)
|
|
78
|
+
-h | --help Show this help
|
|
79
|
+
|
|
80
|
+
ENVIRONMENT
|
|
81
|
+
QC_SOLC_PATH / SOLC / SOLC_PATH
|
|
82
|
+
Path to solc executable used when compiling Solidity.
|
|
83
|
+
Default: c:\\solc\\solc.exe
|
|
84
|
+
|
|
85
|
+
QC_RPC_URL / QC_CHAIN_ID
|
|
86
|
+
Used by the auto-generated transactional tests in the generated package.
|
|
87
|
+
|
|
88
|
+
EXAMPLES
|
|
89
|
+
Generate typed files from ABI+BIN into ./out:
|
|
90
|
+
node generate-sdk.js --abi .\\artifacts\\MyContract.abi.json --bin .\\artifacts\\MyContract.bin --out .\\out --name MyContract --non-interactive
|
|
91
|
+
|
|
92
|
+
Generate a new typed package from ABI+BIN:
|
|
93
|
+
node generate-sdk.js --abi .\\My.abi.json --bin .\\My.bin --name MyContract --create-package --package-dir .\\tmp --package-name my-typed-contract --package-description "My typed contract" --package-author "me" --non-interactive
|
|
94
|
+
|
|
95
|
+
Generate a new typed package from Solidity (single file):
|
|
96
|
+
set QC_SOLC_PATH=c:\\solc\\solc.exe
|
|
97
|
+
node generate-sdk.js --sol ".\\contracts\\MyContract.sol" --create-package --package-dir .\\tmp --package-name my-typed-contract --package-description "My typed contract" --package-author "me" --non-interactive
|
|
98
|
+
|
|
99
|
+
Generate a new typed package from Solidity (multiple files):
|
|
100
|
+
node generate-sdk.js --sol ".\\contracts\\A.sol,.\\contracts\\B.sol,.\\contracts\\lib\\C.sol" --create-package --package-dir .\\tmp --package-name my-typed-contract --package-description "My typed contract" --package-author "me" --non-interactive
|
|
101
|
+
|
|
102
|
+
`.trimStart();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function _argValue(argv, name) {
|
|
106
|
+
const idx = argv.indexOf(name);
|
|
107
|
+
if (idx === -1) return null;
|
|
108
|
+
return argv[idx + 1] || null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function _hasFlag(argv, name) {
|
|
112
|
+
return argv.includes(name);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function _basenameNoExt(p) {
|
|
116
|
+
const b = path.basename(p);
|
|
117
|
+
const i = b.lastIndexOf(".");
|
|
118
|
+
return i === -1 ? b : b.slice(0, i);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function _defaultContractNameFromAbiPath(abiPath) {
|
|
122
|
+
const b = path.basename(abiPath);
|
|
123
|
+
if (/\.abi\.json$/i.test(b)) return b.replace(/\.abi\.json$/i, "");
|
|
124
|
+
return _basenameNoExt(abiPath);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function _ensureDir(p) {
|
|
128
|
+
fs.mkdirSync(p, { recursive: true });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function _readRootDependencies() {
|
|
132
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8"));
|
|
133
|
+
return pkg.dependencies || {};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function _readRootPackageJson() {
|
|
137
|
+
return JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8"));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function _readJson(filePath) {
|
|
141
|
+
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function _looksLikeHex(s) {
|
|
145
|
+
if (typeof s !== "string") return false;
|
|
146
|
+
const t = s.trim();
|
|
147
|
+
if (!t) return false;
|
|
148
|
+
if (t.startsWith("0x")) return /^0x[0-9a-fA-F]*$/.test(t);
|
|
149
|
+
return /^[0-9a-fA-F]*$/.test(t);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function _readArtifactsJson(fileAbs) {
|
|
153
|
+
const baseDir = path.dirname(fileAbs);
|
|
154
|
+
const parsed = _readJson(fileAbs);
|
|
155
|
+
if (!Array.isArray(parsed)) throw new Error(`Artifacts JSON must be an array: ${fileAbs}`);
|
|
156
|
+
|
|
157
|
+
/** @type {Array<{ contractName: string, abi: any[], bytecode: string, docs?: any }>} */
|
|
158
|
+
const artifacts = [];
|
|
159
|
+
|
|
160
|
+
for (let i = 0; i < parsed.length; i++) {
|
|
161
|
+
const entry = parsed[i];
|
|
162
|
+
if (!entry || typeof entry !== "object") throw new Error(`Invalid artifacts entry at index ${i} (expected object)`);
|
|
163
|
+
|
|
164
|
+
const abiField = entry.abi ?? entry.abiPath;
|
|
165
|
+
const binField = entry.bin ?? entry.bytecode ?? entry.binPath ?? entry.bytecodePath;
|
|
166
|
+
const nameField = entry.name ?? entry.contractName;
|
|
167
|
+
|
|
168
|
+
let abi;
|
|
169
|
+
let abiPath = null;
|
|
170
|
+
if (typeof abiField === "string") {
|
|
171
|
+
abiPath = path.resolve(baseDir, abiField);
|
|
172
|
+
if (!fs.existsSync(abiPath)) throw new Error(`ABI file not found (entry ${i}): ${abiPath}`);
|
|
173
|
+
abi = _readJson(abiPath);
|
|
174
|
+
} else if (Array.isArray(abiField)) {
|
|
175
|
+
abi = abiField;
|
|
176
|
+
} else {
|
|
177
|
+
throw new Error(`Invalid "abi" for artifacts entry ${i} (expected path or ABI array)`);
|
|
178
|
+
}
|
|
179
|
+
if (!Array.isArray(abi)) throw new Error(`ABI must be an array (entry ${i})`);
|
|
180
|
+
|
|
181
|
+
let bytecodeRaw;
|
|
182
|
+
if (typeof binField === "string") {
|
|
183
|
+
const maybePath = path.resolve(baseDir, binField);
|
|
184
|
+
if (fs.existsSync(maybePath) && fs.statSync(maybePath).isFile()) {
|
|
185
|
+
bytecodeRaw = fs.readFileSync(maybePath, "utf8").trim();
|
|
186
|
+
} else if (_looksLikeHex(binField)) {
|
|
187
|
+
bytecodeRaw = binField.trim();
|
|
188
|
+
} else {
|
|
189
|
+
throw new Error(`BIN/bytecode file not found (entry ${i}): ${maybePath}`);
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
throw new Error(`Invalid "bin" for artifacts entry ${i} (expected path or hex string)`);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const bytecode = bytecodeRaw.startsWith("0x") ? bytecodeRaw : `0x${bytecodeRaw}`;
|
|
196
|
+
|
|
197
|
+
let contractName = null;
|
|
198
|
+
if (typeof nameField === "string" && nameField.trim()) {
|
|
199
|
+
contractName = _cap(nameField.trim());
|
|
200
|
+
} else if (abiPath) {
|
|
201
|
+
contractName = _cap(_defaultContractNameFromAbiPath(abiPath));
|
|
202
|
+
} else {
|
|
203
|
+
throw new Error(`Missing contract name for artifacts entry ${i}. Provide "name" or use abi as a path.`);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
artifacts.push({ contractName, abi, bytecode, docs: null });
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Ensure stable ordering and unique names
|
|
210
|
+
artifacts.sort((a, b) => a.contractName.localeCompare(b.contractName));
|
|
211
|
+
const seen = new Set();
|
|
212
|
+
for (const a of artifacts) {
|
|
213
|
+
if (seen.has(a.contractName)) throw new Error(`Duplicate contractName in artifacts JSON: ${a.contractName}`);
|
|
214
|
+
seen.add(a.contractName);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (artifacts.length === 0) throw new Error("Artifacts JSON contained no entries.");
|
|
218
|
+
return artifacts;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function _rewriteFileDepsToAbsolute(deps, rootDir) {
|
|
222
|
+
const out = { ...deps };
|
|
223
|
+
for (const [name, ver] of Object.entries(out)) {
|
|
224
|
+
if (typeof ver === "string" && ver.startsWith("file:")) {
|
|
225
|
+
const rel = ver.slice("file:".length);
|
|
226
|
+
const abs = path.resolve(rootDir, rel);
|
|
227
|
+
out[name] = `file:${abs.replace(/\\\\/g, "/")}`;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return out;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function _writeJson(filePath, obj) {
|
|
234
|
+
fs.writeFileSync(filePath, JSON.stringify(obj, null, 2) + "\n", "utf8");
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function _writeText(filePath, content) {
|
|
238
|
+
fs.writeFileSync(filePath, content, "utf8");
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function _findConstructor(abi) {
|
|
242
|
+
const ctor = (abi || []).find((f) => f && f.type === "constructor");
|
|
243
|
+
return ctor || { type: "constructor", inputs: [] };
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function _solTypeToExampleValueExpr(type) {
|
|
247
|
+
if (typeof type !== "string") return "undefined";
|
|
248
|
+
if (type.endsWith("]")) {
|
|
249
|
+
const inner = type.slice(0, type.lastIndexOf("["));
|
|
250
|
+
return `[${_solTypeToExampleValueExpr(inner)}]`;
|
|
251
|
+
}
|
|
252
|
+
if (type === "address") return "wallet.address";
|
|
253
|
+
if (type === "bool") return "true";
|
|
254
|
+
if (type === "string") return JSON.stringify("hello");
|
|
255
|
+
if (type === "bytes") return JSON.stringify("0x");
|
|
256
|
+
if (type === "bytes32") return `encodeBytes32String("init")`;
|
|
257
|
+
if (type.startsWith("uint") || type.startsWith("int")) return "123n";
|
|
258
|
+
return "undefined";
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function _parseCommaSeparatedFiles(v) {
|
|
262
|
+
if (!v) return [];
|
|
263
|
+
return v
|
|
264
|
+
.split(",")
|
|
265
|
+
.map((s) => s.trim())
|
|
266
|
+
.filter(Boolean);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function _resolveSolcPath(argv) {
|
|
270
|
+
const solcArg = _argValue(argv, "--solc") || _argValue(argv, "--solc-path") || _argValue(argv, "--solcPath");
|
|
271
|
+
const env =
|
|
272
|
+
solcArg ||
|
|
273
|
+
process.env.QC_SOLC_PATH ||
|
|
274
|
+
process.env.SOLC ||
|
|
275
|
+
process.env.SOLC_PATH ||
|
|
276
|
+
process.env.solc ||
|
|
277
|
+
null;
|
|
278
|
+
return env || "c:\\gethbuild\\solc.exe";
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function _assertSolcExists(solcPath) {
|
|
282
|
+
if (!fs.existsSync(solcPath)) {
|
|
283
|
+
throw new Error(
|
|
284
|
+
`solc not found at ${solcPath}. Set env QC_SOLC_PATH or SOLC (e.g. c:\\\\solc\\\\solc.exe) or pass --solc <path>.`,
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function _compileSolidityToArtifacts({ solcPath, solFilesAbs, contractNameFilter }) {
|
|
290
|
+
_assertSolcExists(solcPath);
|
|
291
|
+
const out = execFileSync(solcPath, ["--optimize", "--combined-json", "abi,bin", ...solFilesAbs], { encoding: "utf8" });
|
|
292
|
+
const parsed = JSON.parse(out);
|
|
293
|
+
|
|
294
|
+
const artifacts = [];
|
|
295
|
+
for (const key of Object.keys(parsed.contracts || {})) {
|
|
296
|
+
const entry = parsed.contracts[key];
|
|
297
|
+
const name = key.includes(":") ? key.split(":").pop() : key;
|
|
298
|
+
if (!name) continue;
|
|
299
|
+
if (contractNameFilter && name !== contractNameFilter) continue;
|
|
300
|
+
const abi = entry && entry.abi ? JSON.parse(entry.abi) : null;
|
|
301
|
+
const bin = entry && typeof entry.bin === "string" ? entry.bin : "";
|
|
302
|
+
if (!abi || !Array.isArray(abi)) continue;
|
|
303
|
+
if (!bin) continue; // skip abstract/interfaces
|
|
304
|
+
artifacts.push({ contractName: name, abi, bytecode: bin.startsWith("0x") ? bin : `0x${bin}` });
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (contractNameFilter && artifacts.length === 0) {
|
|
308
|
+
throw new Error(`No compiled contract matched --name ${contractNameFilter}`);
|
|
309
|
+
}
|
|
310
|
+
if (artifacts.length === 0) {
|
|
311
|
+
throw new Error("No deployable contracts found in solc output (empty bytecode).");
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Stable ordering
|
|
315
|
+
artifacts.sort((a, b) => a.contractName.localeCompare(b.contractName));
|
|
316
|
+
return artifacts;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function _writeSolcArtifacts(outRoot, artifacts) {
|
|
320
|
+
const artifactsDir = path.join(outRoot, "artifacts");
|
|
321
|
+
_ensureDir(artifactsDir);
|
|
322
|
+
for (const a of artifacts) {
|
|
323
|
+
_writeText(path.join(artifactsDir, `${a.contractName}.abi.json`), JSON.stringify(a.abi, null, 2) + "\n");
|
|
324
|
+
_writeText(path.join(artifactsDir, `${a.contractName}.bin`), a.bytecode + "\n");
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function _normalizeSolDoc(text) {
|
|
329
|
+
if (!text) return "";
|
|
330
|
+
return text
|
|
331
|
+
.split(/\r?\n/g)
|
|
332
|
+
.map((l) => l.trim())
|
|
333
|
+
.filter(Boolean)
|
|
334
|
+
.map((l) => {
|
|
335
|
+
// Normalize common NatSpec tags into plain text (but keep @param/@return as-is)
|
|
336
|
+
if (l.startsWith("@title ")) return l.slice("@title ".length).trim();
|
|
337
|
+
if (l.startsWith("@notice ")) return l.slice("@notice ".length).trim();
|
|
338
|
+
if (l.startsWith("@dev ")) return l.slice("@dev ".length).trim();
|
|
339
|
+
return l;
|
|
340
|
+
})
|
|
341
|
+
.filter(Boolean)
|
|
342
|
+
.join("\n")
|
|
343
|
+
.trim();
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function _extractSolDocs(solFilesAbs) {
|
|
347
|
+
/** @type {Record<string, { contract?: string, functions: Record<string,string> }>} */
|
|
348
|
+
const out = {};
|
|
349
|
+
|
|
350
|
+
for (const file of solFilesAbs) {
|
|
351
|
+
const src = fs.readFileSync(file, "utf8");
|
|
352
|
+
const lines = src.split(/\r?\n/g);
|
|
353
|
+
|
|
354
|
+
let pending = [];
|
|
355
|
+
let inBlock = false;
|
|
356
|
+
let currentContract = null;
|
|
357
|
+
|
|
358
|
+
const flushPending = () => {
|
|
359
|
+
const s = _normalizeSolDoc(pending.join("\n"));
|
|
360
|
+
pending = [];
|
|
361
|
+
return s;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
for (let i = 0; i < lines.length; i++) {
|
|
365
|
+
const raw = lines[i];
|
|
366
|
+
const t = raw.trim();
|
|
367
|
+
|
|
368
|
+
if (inBlock) {
|
|
369
|
+
// Capture block comment content lines, stripping leading '*' and the closing '*/'
|
|
370
|
+
const endIdx = raw.indexOf("*/");
|
|
371
|
+
const content = endIdx !== -1 ? raw.slice(0, endIdx) : raw;
|
|
372
|
+
const cleaned = content.replace(/^\s*\*\s?/, "").trim();
|
|
373
|
+
if (cleaned) pending.push(cleaned);
|
|
374
|
+
if (endIdx !== -1) inBlock = false;
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Solidity NatSpec / doc comments
|
|
379
|
+
if (t.startsWith("/**")) {
|
|
380
|
+
inBlock = true;
|
|
381
|
+
// Capture anything after '/**' on the same line and handle one-line comments.
|
|
382
|
+
const startIdx = raw.indexOf("/**") + 3;
|
|
383
|
+
const rest = raw.slice(startIdx);
|
|
384
|
+
const endIdx = rest.indexOf("*/");
|
|
385
|
+
const content = endIdx !== -1 ? rest.slice(0, endIdx) : rest;
|
|
386
|
+
const cleaned = content.replace(/^\s*\*\s?/, "").trim();
|
|
387
|
+
if (cleaned) pending.push(cleaned);
|
|
388
|
+
if (endIdx !== -1) inBlock = false;
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
if (t.startsWith("///")) {
|
|
392
|
+
pending.push(t.slice(3).trim());
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Skip empty lines without breaking pending docs
|
|
397
|
+
if (!t) continue;
|
|
398
|
+
|
|
399
|
+
// Contract/interface/library declaration
|
|
400
|
+
const cMatch = t.match(/^(contract|interface|library)\s+([A-Za-z_][A-Za-z0-9_]*)\b/);
|
|
401
|
+
if (cMatch) {
|
|
402
|
+
const name = cMatch[2];
|
|
403
|
+
const doc = flushPending();
|
|
404
|
+
currentContract = name;
|
|
405
|
+
if (!out[name]) out[name] = { contract: "", functions: {} };
|
|
406
|
+
if (doc) out[name].contract = doc;
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Function declaration
|
|
411
|
+
const fMatch = t.match(/^function\s+([A-Za-z_][A-Za-z0-9_]*)\b/);
|
|
412
|
+
if (fMatch && currentContract) {
|
|
413
|
+
const fn = fMatch[1];
|
|
414
|
+
const doc = flushPending();
|
|
415
|
+
if (!out[currentContract]) out[currentContract] = { contract: "", functions: {} };
|
|
416
|
+
if (doc) out[currentContract].functions[fn] = doc;
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// If we hit a real code line that's not a declaration, discard any pending doc
|
|
421
|
+
pending = [];
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// Normalize all docs
|
|
426
|
+
for (const k of Object.keys(out)) {
|
|
427
|
+
out[k].contract = _normalizeSolDoc(out[k].contract || "");
|
|
428
|
+
for (const fn of Object.keys(out[k].functions || {})) {
|
|
429
|
+
out[k].functions[fn] = _normalizeSolDoc(out[k].functions[fn]);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return out;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function _renderPackageIndexJs({ artifacts }) {
|
|
437
|
+
const lines = [];
|
|
438
|
+
lines.push("/**");
|
|
439
|
+
lines.push(" * Auto-generated typed contract package.");
|
|
440
|
+
lines.push(" *");
|
|
441
|
+
lines.push(" * This file is used by `jsdoc-to-markdown` (jsdoc2md) to generate README.md.");
|
|
442
|
+
lines.push(" */");
|
|
443
|
+
lines.push("");
|
|
444
|
+
lines.push("const dist = require(\"./dist\");");
|
|
445
|
+
lines.push("Object.assign(exports, dist);");
|
|
446
|
+
lines.push("");
|
|
447
|
+
|
|
448
|
+
for (const a of artifacts) {
|
|
449
|
+
const doc = a.docs && typeof a.docs.contract === "string" ? a.docs.contract : "";
|
|
450
|
+
if (doc && doc.trim()) {
|
|
451
|
+
lines.push("/**");
|
|
452
|
+
for (const l of doc.split(/\r?\n/g)) {
|
|
453
|
+
const t = l.trim();
|
|
454
|
+
if (!t) continue;
|
|
455
|
+
lines.push(` * ${t}`);
|
|
456
|
+
}
|
|
457
|
+
lines.push(" */");
|
|
458
|
+
} else {
|
|
459
|
+
lines.push("/**");
|
|
460
|
+
lines.push(` * ${a.contractName}`);
|
|
461
|
+
lines.push(" */");
|
|
462
|
+
}
|
|
463
|
+
lines.push(`exports.${a.contractName} = dist.${a.contractName};`);
|
|
464
|
+
lines.push(`exports.${a.contractName}__factory = dist.${a.contractName}__factory;`);
|
|
465
|
+
lines.push("");
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
return lines.join("\n") + "\n";
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function _quoteIfNeeded(s) {
|
|
472
|
+
if (typeof s !== "string") return s;
|
|
473
|
+
return /[ \t"]/g.test(s) ? `"${s.replace(/"/g, '\\"')}"` : s;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function _npmCmd() {
|
|
477
|
+
return process.platform === "win32" ? "npm.cmd" : "npm";
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function _runNpm(args, cwd) {
|
|
481
|
+
if (process.platform === "win32") {
|
|
482
|
+
const cmd = `${_npmCmd()} ${args.map(_quoteIfNeeded).join(" ")}`;
|
|
483
|
+
const res = spawnSync("cmd.exe", ["/d", "/s", "/c", cmd], { cwd, encoding: "utf8", stdio: "inherit" });
|
|
484
|
+
if (res.error) throw res.error;
|
|
485
|
+
if (res.status !== 0) throw new Error(`npm command failed: ${cmd}`);
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const res = spawnSync(_npmCmd(), args, { cwd, encoding: "utf8", stdio: "inherit" });
|
|
490
|
+
if (res.error) throw res.error;
|
|
491
|
+
if (res.status !== 0) throw new Error(`npm command failed: ${_npmCmd()} ${args.join(" ")}`);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
async function main() {
|
|
495
|
+
const argv = process.argv.slice(2);
|
|
496
|
+
|
|
497
|
+
if (argv.length === 0 || _hasFlag(argv, "--help") || _hasFlag(argv, "-h")) {
|
|
498
|
+
process.stdout.write(_helpText());
|
|
499
|
+
process.exitCode = 0;
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
const abiPathArg = _argValue(argv, "--abi");
|
|
504
|
+
const binPathArg = _argValue(argv, "--bin");
|
|
505
|
+
const solArg = _argValue(argv, "--sol") || _argValue(argv, "--sol-files") || _argValue(argv, "--solFiles");
|
|
506
|
+
const artifactsJsonArg =
|
|
507
|
+
_argValue(argv, "--artifacts-json") || _argValue(argv, "--artifactsJson") || _argValue(argv, "--artifacts");
|
|
508
|
+
const outArg = _argValue(argv, "--out");
|
|
509
|
+
const nameArg = _argValue(argv, "--name");
|
|
510
|
+
const nonInteractive = _hasFlag(argv, "--non-interactive") || _hasFlag(argv, "--yes");
|
|
511
|
+
const createPackageFlag = _hasFlag(argv, "--create-package");
|
|
512
|
+
const pkgDirArg = _argValue(argv, "--package-dir");
|
|
513
|
+
const pkgNameArg = _argValue(argv, "--package-name");
|
|
514
|
+
const pkgDescArg = _argValue(argv, "--package-description") || "";
|
|
515
|
+
const pkgAuthorArg = _argValue(argv, "--package-author") || "";
|
|
516
|
+
const pkgLicenseArg = _argValue(argv, "--package-license") || "MIT";
|
|
517
|
+
const pkgVersionArg = _argValue(argv, "--package-version") || "0.0.1";
|
|
518
|
+
|
|
519
|
+
// Decide input type.
|
|
520
|
+
let inputType = null; // "abibin" | "sol" | "artifactsjson"
|
|
521
|
+
if (solArg) inputType = "sol";
|
|
522
|
+
if (artifactsJsonArg) inputType = inputType || "artifactsjson";
|
|
523
|
+
if (abiPathArg || binPathArg) inputType = inputType || "abibin";
|
|
524
|
+
if ((solArg ? 1 : 0) + (artifactsJsonArg ? 1 : 0) + (abiPathArg || binPathArg ? 1 : 0) > 1) {
|
|
525
|
+
throw new Error("Select only one input mode: --abi/--bin OR --sol OR --artifacts-json.");
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
let createPackage = false;
|
|
529
|
+
let outDir = outArg ? path.resolve(outArg) : null;
|
|
530
|
+
let contractName = nameArg || null;
|
|
531
|
+
|
|
532
|
+
// Interactive prompt: ask input type first.
|
|
533
|
+
let absAbi = null;
|
|
534
|
+
let absBin = null;
|
|
535
|
+
let solFilesAbs = [];
|
|
536
|
+
let artifactsJsonAbs = null;
|
|
537
|
+
|
|
538
|
+
if (!nonInteractive) {
|
|
539
|
+
const rl0 = readline.createInterface({ input: stdin, output: stdout });
|
|
540
|
+
try {
|
|
541
|
+
if (!inputType) {
|
|
542
|
+
const ans = (await rl0.question("Input type? (1) ABI+BIN (2) SOL (3) ARTIFACTS JSON ")).trim();
|
|
543
|
+
inputType = ans === "2" ? "sol" : ans === "3" ? "artifactsjson" : "abibin";
|
|
544
|
+
}
|
|
545
|
+
if (inputType === "abibin") {
|
|
546
|
+
const abiP = abiPathArg || (await rl0.question("Enter ABI path (.json): ")).trim();
|
|
547
|
+
const binP = binPathArg || (await rl0.question("Enter bytecode path (.bin): ")).trim();
|
|
548
|
+
if (!abiP || !binP) throw new Error("Missing ABI/BIN paths.");
|
|
549
|
+
absAbi = path.resolve(abiP);
|
|
550
|
+
absBin = path.resolve(binP);
|
|
551
|
+
if (!fs.existsSync(absAbi)) throw new Error(`ABI file not found: ${absAbi}`);
|
|
552
|
+
if (!fs.existsSync(absBin)) throw new Error(`Bytecode file not found: ${absBin}`);
|
|
553
|
+
contractName = contractName || _cap(_defaultContractNameFromAbiPath(absAbi));
|
|
554
|
+
} else if (inputType === "sol") {
|
|
555
|
+
const solP = solArg || (await rl0.question("Enter Solidity file(s) (comma-separated): ")).trim();
|
|
556
|
+
const files = _parseCommaSeparatedFiles(solP);
|
|
557
|
+
if (files.length === 0) throw new Error("Missing Solidity file(s).");
|
|
558
|
+
solFilesAbs = files.map((p) => path.resolve(p));
|
|
559
|
+
for (const f of solFilesAbs) {
|
|
560
|
+
if (!fs.existsSync(f)) throw new Error(`Solidity file not found: ${f}`);
|
|
561
|
+
}
|
|
562
|
+
if (!contractName) {
|
|
563
|
+
const maybe = (await rl0.question("Contract name (optional; empty = generate all): ")).trim();
|
|
564
|
+
if (maybe) contractName = maybe;
|
|
565
|
+
}
|
|
566
|
+
} else {
|
|
567
|
+
const p = artifactsJsonArg || (await rl0.question("Enter artifacts JSON path (.json): ")).trim();
|
|
568
|
+
if (!p) throw new Error("Missing artifacts JSON path.");
|
|
569
|
+
artifactsJsonAbs = path.resolve(p);
|
|
570
|
+
if (!fs.existsSync(artifactsJsonAbs)) throw new Error(`Artifacts JSON file not found: ${artifactsJsonAbs}`);
|
|
571
|
+
}
|
|
572
|
+
} finally {
|
|
573
|
+
rl0.close();
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// Non-interactive input validation
|
|
578
|
+
if (nonInteractive) {
|
|
579
|
+
if (!inputType) {
|
|
580
|
+
throw new Error("Select an input type: pass --abi/--bin OR pass --sol <file1.sol,file2.sol> OR pass --artifacts-json <file.json>.");
|
|
581
|
+
}
|
|
582
|
+
if (inputType === "abibin") {
|
|
583
|
+
if (!abiPathArg || !binPathArg) {
|
|
584
|
+
throw new Error("Missing required arguments: --abi <path> --bin <path>");
|
|
585
|
+
}
|
|
586
|
+
absAbi = path.resolve(abiPathArg);
|
|
587
|
+
absBin = path.resolve(binPathArg);
|
|
588
|
+
if (!fs.existsSync(absAbi)) throw new Error(`ABI file not found: ${absAbi}`);
|
|
589
|
+
if (!fs.existsSync(absBin)) throw new Error(`Bytecode file not found: ${absBin}`);
|
|
590
|
+
contractName = contractName || _cap(_defaultContractNameFromAbiPath(absAbi));
|
|
591
|
+
} else if (inputType === "sol") {
|
|
592
|
+
const files = _parseCommaSeparatedFiles(solArg);
|
|
593
|
+
if (files.length === 0) throw new Error("Missing required argument: --sol <file1.sol,file2.sol>");
|
|
594
|
+
solFilesAbs = files.map((p) => path.resolve(p));
|
|
595
|
+
for (const f of solFilesAbs) {
|
|
596
|
+
if (!fs.existsSync(f)) throw new Error(`Solidity file not found: ${f}`);
|
|
597
|
+
}
|
|
598
|
+
// contractName can be null => generate all
|
|
599
|
+
} else {
|
|
600
|
+
if (!artifactsJsonArg) throw new Error("Missing required argument: --artifacts-json <path/to/artifacts.json>");
|
|
601
|
+
artifactsJsonAbs = path.resolve(artifactsJsonArg);
|
|
602
|
+
if (!fs.existsSync(artifactsJsonAbs)) throw new Error(`Artifacts JSON file not found: ${artifactsJsonAbs}`);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
if (createPackageFlag) {
|
|
607
|
+
createPackage = true;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
if (!nonInteractive && !createPackageFlag) {
|
|
611
|
+
const rl = readline.createInterface({ input: stdin, output: stdout });
|
|
612
|
+
try {
|
|
613
|
+
const ans = (await rl.question("Do you want to create a new package? (Y/N) ")).trim().toLowerCase();
|
|
614
|
+
createPackage = ans === "y" || ans === "yes";
|
|
615
|
+
|
|
616
|
+
if (createPackage) {
|
|
617
|
+
const pkgFolder = (await rl.question("Enter the folder path where the package should be created: ")).trim();
|
|
618
|
+
const pkgName = (await rl.question("Enter package name: ")).trim();
|
|
619
|
+
const pkgDesc = (await rl.question("Enter package description: ")).trim();
|
|
620
|
+
const pkgAuthor = (await rl.question("Enter author name: ")).trim();
|
|
621
|
+
const pkgLicense = (await rl.question("Enter license (default: MIT): ")).trim() || "MIT";
|
|
622
|
+
const pkgVersion = (await rl.question("Enter version (default: 0.0.1): ")).trim() || "0.0.1";
|
|
623
|
+
|
|
624
|
+
outDir = path.resolve(pkgFolder, pkgName);
|
|
625
|
+
_ensureDir(outDir);
|
|
626
|
+
|
|
627
|
+
_createPackageScaffold({
|
|
628
|
+
outDir,
|
|
629
|
+
pkgName,
|
|
630
|
+
pkgDesc,
|
|
631
|
+
pkgAuthor,
|
|
632
|
+
pkgLicense,
|
|
633
|
+
pkgVersion,
|
|
634
|
+
});
|
|
635
|
+
} else {
|
|
636
|
+
const target = (await rl.question("Enter the location in your existing package (relative to package root): ")).trim();
|
|
637
|
+
outDir = path.resolve(process.cwd(), target || "src/contracts");
|
|
638
|
+
}
|
|
639
|
+
} finally {
|
|
640
|
+
rl.close();
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
if (createPackage && nonInteractive) {
|
|
645
|
+
const pkgFolder = pkgDirArg ? path.resolve(pkgDirArg) : null;
|
|
646
|
+
const pkgName = pkgNameArg || null;
|
|
647
|
+
if (!pkgFolder || !pkgName) {
|
|
648
|
+
throw new Error("When using --create-package in non-interactive mode, pass --package-dir <dir> and --package-name <name>.");
|
|
649
|
+
}
|
|
650
|
+
outDir = path.resolve(pkgFolder, pkgName);
|
|
651
|
+
_ensureDir(outDir);
|
|
652
|
+
_createPackageScaffold({
|
|
653
|
+
outDir,
|
|
654
|
+
pkgName,
|
|
655
|
+
pkgDesc: pkgDescArg,
|
|
656
|
+
pkgAuthor: pkgAuthorArg,
|
|
657
|
+
pkgLicense: pkgLicenseArg,
|
|
658
|
+
pkgVersion: pkgVersionArg,
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
if (!outDir) outDir = path.resolve(process.cwd(), "generated-contract");
|
|
663
|
+
|
|
664
|
+
const targetSrcDir = createPackage ? path.join(outDir, "src") : outDir;
|
|
665
|
+
_ensureDir(targetSrcDir);
|
|
666
|
+
|
|
667
|
+
// Resolve compilation / artifacts
|
|
668
|
+
/** @type {Array<{ contractName: string, abi: any[], bytecode: string }>} */
|
|
669
|
+
let artifacts = [];
|
|
670
|
+
if (inputType === "abibin") {
|
|
671
|
+
const abi = _readJson(absAbi);
|
|
672
|
+
const bytecodeRaw = fs.readFileSync(absBin, "utf8").trim();
|
|
673
|
+
const bytecode = bytecodeRaw.startsWith("0x") ? bytecodeRaw : `0x${bytecodeRaw}`;
|
|
674
|
+
artifacts = [{ contractName, abi, bytecode, docs: null }];
|
|
675
|
+
} else if (inputType === "sol") {
|
|
676
|
+
const solcPath = _resolveSolcPath(argv);
|
|
677
|
+
artifacts = _compileSolidityToArtifacts({ solcPath, solFilesAbs, contractNameFilter: contractName });
|
|
678
|
+
|
|
679
|
+
// Attach Solidity doc comments (NatSpec) to artifacts
|
|
680
|
+
const docsByContract = _extractSolDocs(solFilesAbs);
|
|
681
|
+
for (const a of artifacts) {
|
|
682
|
+
a.docs = docsByContract[a.contractName] || null;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// As requested: emit ABI/BIN artifacts to disk
|
|
686
|
+
_writeSolcArtifacts(createPackage ? outDir : targetSrcDir, artifacts);
|
|
687
|
+
} else {
|
|
688
|
+
// Artifacts JSON
|
|
689
|
+
artifacts = _readArtifactsJson(artifactsJsonAbs || path.resolve(artifactsJsonArg));
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
if (artifacts.length === 1) {
|
|
693
|
+
// Keep the old API/behavior for single-contract generation.
|
|
694
|
+
const a = artifacts[0];
|
|
695
|
+
generateFromArtifacts({ outDir: targetSrcDir, artifacts: [a] });
|
|
696
|
+
} else {
|
|
697
|
+
generateFromArtifacts({ outDir: targetSrcDir, artifacts });
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
if (createPackage) {
|
|
701
|
+
_writeText(
|
|
702
|
+
path.join(outDir, "README.md"),
|
|
703
|
+
_packageReadme({
|
|
704
|
+
pkgName: pkgNameArg || path.basename(outDir),
|
|
705
|
+
pkgDesc: pkgDescArg,
|
|
706
|
+
contractNames: artifacts.map((a) => a.contractName),
|
|
707
|
+
}),
|
|
708
|
+
);
|
|
709
|
+
|
|
710
|
+
// Transactional tests (always per-contract)
|
|
711
|
+
_ensureDir(path.join(outDir, "test", "e2e"));
|
|
712
|
+
_ensureDir(path.join(outDir, "examples"));
|
|
713
|
+
|
|
714
|
+
for (const a of artifacts) {
|
|
715
|
+
_writeText(
|
|
716
|
+
path.join(outDir, "test", "e2e", `${a.contractName}.e2e.test.js`),
|
|
717
|
+
generateTransactionalTestJs({ contractName: a.contractName, abi: a.abi }),
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
if (artifacts.length === 1) {
|
|
722
|
+
// Back-compat: keep original example filenames for a single-contract package.
|
|
723
|
+
const a = artifacts[0];
|
|
724
|
+
const ctor = _findConstructor(a.abi);
|
|
725
|
+
const ctorArgsExpr = (ctor.inputs || []).map((i) => _solTypeToExampleValueExpr(i.type)).join(", ");
|
|
726
|
+
|
|
727
|
+
_writeText(
|
|
728
|
+
path.join(outDir, "examples", "deploy.ts"),
|
|
729
|
+
`import { Initialize } from "quantumcoin/config";\nimport { JsonRpcProvider, Wallet, encodeBytes32String } from "quantumcoin";\nimport { ${a.contractName}__factory } from "../src";\n\nasync function main() {\n const rpcUrl = process.env.QC_RPC_URL || "http://127.0.0.1:8545";\n const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;\n await Initialize(null);\n\n const provider = new JsonRpcProvider(rpcUrl, chainId);\n const wallet = Wallet.createRandom().connect(provider);\n\n const factory = new ${a.contractName}__factory(wallet);\n const contract = await factory.deploy(${ctorArgsExpr}${ctorArgsExpr ? ", " : ""}{ gasLimit: 600000 });\n const tx = contract.deployTransaction();\n if (tx) await tx.wait();\n\n console.log("Deployed at:", contract.target);\n}\n\nmain().catch((e) => {\n console.error(e);\n process.exitCode = 1;\n});\n`,
|
|
730
|
+
);
|
|
731
|
+
|
|
732
|
+
_writeText(
|
|
733
|
+
path.join(outDir, "examples", "read-operations.ts"),
|
|
734
|
+
`import { Initialize } from "quantumcoin/config";\nimport { JsonRpcProvider } from "quantumcoin";\nimport { ${a.contractName} } from "../src";\n\nasync function main() {\n const rpcUrl = process.env.QC_RPC_URL || "http://127.0.0.1:8545";\n const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;\n const address = process.env.CONTRACT_ADDRESS || "0x...";\n await Initialize(null);\n\n const provider = new JsonRpcProvider(rpcUrl, chainId);\n const contract = ${a.contractName}.connect(address, provider);\n\n console.log("Contract:", contract.target);\n}\n\nmain().catch((e) => {\n console.error(e);\n process.exitCode = 1;\n});\n`,
|
|
735
|
+
);
|
|
736
|
+
|
|
737
|
+
_writeText(
|
|
738
|
+
path.join(outDir, "examples", "write-operations.ts"),
|
|
739
|
+
`import { Initialize } from "quantumcoin/config";\nimport { JsonRpcProvider, Wallet } from "quantumcoin";\nimport { ${a.contractName} } from "../src";\n\nasync function main() {\n const rpcUrl = process.env.QC_RPC_URL || "http://127.0.0.1:8545";\n const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;\n const address = process.env.CONTRACT_ADDRESS || "0x...";\n await Initialize(null);\n\n const provider = new JsonRpcProvider(rpcUrl, chainId);\n const wallet = Wallet.createRandom().connect(provider);\n const contract = ${a.contractName}.connect(address, wallet);\n\n // const tx = await contract.someWriteMethod(/* args */);\n // await tx.wait();\n console.log("Done");\n}\n\nmain().catch((e) => {\n console.error(e);\n process.exitCode = 1;\n});\n`,
|
|
740
|
+
);
|
|
741
|
+
|
|
742
|
+
_writeText(
|
|
743
|
+
path.join(outDir, "examples", "events.ts"),
|
|
744
|
+
`import { Initialize } from "quantumcoin/config";\nimport { JsonRpcProvider } from "quantumcoin";\nimport { ${a.contractName} } from "../src";\n\nasync function main() {\n const rpcUrl = process.env.QC_RPC_URL || "http://127.0.0.1:8545";\n const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;\n const address = process.env.CONTRACT_ADDRESS || "0x...";\n await Initialize(null);\n\n const provider = new JsonRpcProvider(rpcUrl, chainId);\n const contract = ${a.contractName}.connect(address, provider);\n\n console.log("Contract:", contract.target);\n}\n\nmain().catch((e) => {\n console.error(e);\n process.exitCode = 1;\n});\n`,
|
|
745
|
+
);
|
|
746
|
+
} else {
|
|
747
|
+
// Multi-contract: avoid filename collisions.
|
|
748
|
+
for (const a of artifacts) {
|
|
749
|
+
const ctor = _findConstructor(a.abi);
|
|
750
|
+
const ctorArgsExpr = (ctor.inputs || []).map((i) => _solTypeToExampleValueExpr(i.type)).join(", ");
|
|
751
|
+
|
|
752
|
+
_writeText(
|
|
753
|
+
path.join(outDir, "examples", `deploy-${a.contractName}.ts`),
|
|
754
|
+
`import { Initialize } from "quantumcoin/config";\nimport { JsonRpcProvider, Wallet, encodeBytes32String } from "quantumcoin";\nimport { ${a.contractName}__factory } from "../src";\n\nasync function main() {\n const rpcUrl = process.env.QC_RPC_URL || "http://127.0.0.1:8545";\n const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;\n await Initialize(null);\n\n const provider = new JsonRpcProvider(rpcUrl, chainId);\n const wallet = Wallet.createRandom().connect(provider);\n\n const factory = new ${a.contractName}__factory(wallet);\n const contract = await factory.deploy(${ctorArgsExpr}${ctorArgsExpr ? ", " : ""}{ gasLimit: 600000 });\n const tx = contract.deployTransaction();\n if (tx) await tx.wait();\n\n console.log("Deployed ${a.contractName} at:", contract.target);\n}\n\nmain().catch((e) => {\n console.error(e);\n process.exitCode = 1;\n});\n`,
|
|
755
|
+
);
|
|
756
|
+
|
|
757
|
+
_writeText(
|
|
758
|
+
path.join(outDir, "examples", `read-operations-${a.contractName}.ts`),
|
|
759
|
+
`import { Initialize } from "quantumcoin/config";\nimport { JsonRpcProvider } from "quantumcoin";\nimport { ${a.contractName} } from "../src";\n\nasync function main() {\n const rpcUrl = process.env.QC_RPC_URL || "http://127.0.0.1:8545";\n const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;\n const address = process.env.CONTRACT_ADDRESS || "0x...";\n await Initialize(null);\n\n const provider = new JsonRpcProvider(rpcUrl, chainId);\n const contract = ${a.contractName}.connect(address, provider);\n\n console.log("${a.contractName}:", contract.target);\n}\n\nmain().catch((e) => {\n console.error(e);\n process.exitCode = 1;\n});\n`,
|
|
760
|
+
);
|
|
761
|
+
|
|
762
|
+
_writeText(
|
|
763
|
+
path.join(outDir, "examples", `write-operations-${a.contractName}.ts`),
|
|
764
|
+
`import { Initialize } from "quantumcoin/config";\nimport { JsonRpcProvider, Wallet } from "quantumcoin";\nimport { ${a.contractName} } from "../src";\n\nasync function main() {\n const rpcUrl = process.env.QC_RPC_URL || "http://127.0.0.1:8545";\n const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;\n const address = process.env.CONTRACT_ADDRESS || "0x...";\n await Initialize(null);\n\n const provider = new JsonRpcProvider(rpcUrl, chainId);\n const wallet = Wallet.createRandom().connect(provider);\n const contract = ${a.contractName}.connect(address, wallet);\n\n // const tx = await contract.someWriteMethod(/* args */);\n // await tx.wait();\n console.log("Done");\n}\n\nmain().catch((e) => {\n console.error(e);\n process.exitCode = 1;\n});\n`,
|
|
765
|
+
);
|
|
766
|
+
|
|
767
|
+
_writeText(
|
|
768
|
+
path.join(outDir, "examples", `events-${a.contractName}.ts`),
|
|
769
|
+
`import { Initialize } from "quantumcoin/config";\nimport { JsonRpcProvider } from "quantumcoin";\nimport { ${a.contractName} } from "../src";\n\nasync function main() {\n const rpcUrl = process.env.QC_RPC_URL || "http://127.0.0.1:8545";\n const chainId = process.env.QC_CHAIN_ID ? Number(process.env.QC_CHAIN_ID) : 123123;\n const address = process.env.CONTRACT_ADDRESS || "0x...";\n await Initialize(null);\n\n const provider = new JsonRpcProvider(rpcUrl, chainId);\n const contract = ${a.contractName}.connect(address, provider);\n\n console.log("${a.contractName}:", contract.target);\n}\n\nmain().catch((e) => {\n console.error(e);\n process.exitCode = 1;\n});\n`,
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// Write an index.js for jsdoc-to-markdown, then install and run build scripts.
|
|
775
|
+
_writeText(path.join(outDir, "index.js"), _renderPackageIndexJs({ artifacts }));
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// Final step: after package creation, build docs/README.
|
|
779
|
+
if (createPackage) {
|
|
780
|
+
_runNpm(["install", "--no-fund", "--no-audit"], outDir);
|
|
781
|
+
_runNpm(["run", "build:ts"], outDir);
|
|
782
|
+
if (process.platform === "win32") {
|
|
783
|
+
_runNpm(["run", "build-powershell"], outDir);
|
|
784
|
+
} else {
|
|
785
|
+
_runNpm(["run", "build"], outDir);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
console.log(`Generated contract files in: ${targetSrcDir}`);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function _cap(s) {
|
|
793
|
+
return s ? s[0].toUpperCase() + s.slice(1) : s;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function _packageReadme({ pkgName, pkgDesc, contractNames }) {
|
|
797
|
+
const list = (contractNames || []).map((n) => `- \`${n}\``).join("\n");
|
|
798
|
+
return `# ${pkgName}\n\n${pkgDesc}\n\n## Contracts\n\n${list || "- (none)"}\n\n## Running\n\n- \`npm install\`\n- \`npm test\`\n\nTransactional tests require:\n- \`QC_RPC_URL\`\n- \`QC_CHAIN_ID\` (optional)\n`;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function _createPackageScaffold({ outDir, pkgName, pkgDesc, pkgAuthor, pkgLicense, pkgVersion }) {
|
|
802
|
+
_ensureDir(outDir);
|
|
803
|
+
_ensureDir(path.join(outDir, "src"));
|
|
804
|
+
_ensureDir(path.join(outDir, "test", "e2e"));
|
|
805
|
+
_ensureDir(path.join(outDir, "examples"));
|
|
806
|
+
|
|
807
|
+
const rootPkg = _readRootPackageJson();
|
|
808
|
+
const rootDeps = _rewriteFileDepsToAbsolute(rootPkg.dependencies || {}, __dirname);
|
|
809
|
+
|
|
810
|
+
// Ensure the generated package depends on this repo's quantumcoin via absolute file path.
|
|
811
|
+
rootDeps.quantumcoin = `file:${__dirname.replace(/\\\\/g, "/")}`;
|
|
812
|
+
// Ensure docs tool is present (required by build scripts below).
|
|
813
|
+
if (!rootDeps["jsdoc-to-markdown"]) {
|
|
814
|
+
rootDeps["jsdoc-to-markdown"] = "latest";
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
const pkgJson = {
|
|
818
|
+
name: pkgName,
|
|
819
|
+
version: pkgVersion,
|
|
820
|
+
description: pkgDesc,
|
|
821
|
+
author: pkgAuthor,
|
|
822
|
+
license: pkgLicense,
|
|
823
|
+
main: "dist/index.js",
|
|
824
|
+
types: "dist/index.d.ts",
|
|
825
|
+
scripts: {
|
|
826
|
+
"build:ts": "npx -p typescript tsc -p tsconfig.json",
|
|
827
|
+
"build": "npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly && jsdoc2md index.js >README.md",
|
|
828
|
+
"build-powershell": "powershell npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly; jsdoc2md index.js >README.md",
|
|
829
|
+
test: "npm run build:ts && node --test --test-concurrency=1 \"test/**/*.test.js\"",
|
|
830
|
+
"test:e2e": "npm run build:ts && node --test --test-concurrency=1 \"test/e2e/**/*.test.js\"",
|
|
831
|
+
},
|
|
832
|
+
dependencies: rootDeps,
|
|
833
|
+
devDependencies: {},
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
_writeJson(path.join(outDir, "package.json"), pkgJson);
|
|
837
|
+
_writeJson(path.join(outDir, "tsconfig.json"), {
|
|
838
|
+
compilerOptions: {
|
|
839
|
+
target: "ES2022",
|
|
840
|
+
module: "CommonJS",
|
|
841
|
+
declaration: true,
|
|
842
|
+
outDir: "dist",
|
|
843
|
+
strict: true,
|
|
844
|
+
esModuleInterop: true,
|
|
845
|
+
skipLibCheck: true,
|
|
846
|
+
},
|
|
847
|
+
include: ["src/**/*.ts"],
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
_writeText(path.join(outDir, "README.md"), _packageReadme({ pkgName, pkgDesc, contractNames: [] }));
|
|
851
|
+
|
|
852
|
+
_writeText(path.join(outDir, ".gitignore"), `node_modules\n/dist\n*.log\n`);
|
|
853
|
+
|
|
854
|
+
// Minimal shims so the generated TypeScript can compile even though `quantumcoin`
|
|
855
|
+
// is a JavaScript package (no bundled .d.ts in this repo).
|
|
856
|
+
_writeText(
|
|
857
|
+
path.join(outDir, "src", "quantumcoin-shims.d.ts"),
|
|
858
|
+
`declare module "quantumcoin" {\n` +
|
|
859
|
+
` export type ContractRunner = any;\n` +
|
|
860
|
+
` export type TransactionResponse = any;\n` +
|
|
861
|
+
` export type ContractTransactionResponse = any;\n` +
|
|
862
|
+
` export type TransactionRequest = any;\n` +
|
|
863
|
+
`\n` +
|
|
864
|
+
` export class Contract {\n` +
|
|
865
|
+
` constructor(address: string, abi: any, runner?: any, bytecode?: any);\n` +
|
|
866
|
+
` target: string;\n` +
|
|
867
|
+
` address: string;\n` +
|
|
868
|
+
` call(methodName: string, args: any[], overrides?: TransactionRequest): Promise<any>;\n` +
|
|
869
|
+
` send(methodName: string, args: any[], overrides?: TransactionRequest): Promise<ContractTransactionResponse>;\n` +
|
|
870
|
+
` deployTransaction(): TransactionResponse | null;\n` +
|
|
871
|
+
` }\n` +
|
|
872
|
+
`\n` +
|
|
873
|
+
` export class ContractFactory {\n` +
|
|
874
|
+
` signer: any;\n` +
|
|
875
|
+
` constructor(abi: any, bytecode: string, signer: any);\n` +
|
|
876
|
+
` getDeployTransaction(...args: any[]): TransactionRequest;\n` +
|
|
877
|
+
` }\n` +
|
|
878
|
+
`\n` +
|
|
879
|
+
` export function getCreateAddress(opts: { from: string; nonce: number }): string;\n` +
|
|
880
|
+
`}\n`,
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
main().catch((e) => {
|
|
885
|
+
console.error(e);
|
|
886
|
+
process.exitCode = 1;
|
|
887
|
+
});
|
|
888
|
+
|