quantumcoin 7.0.12 → 7.0.13
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/README-SDK.md +828 -823
- package/README.md +4 -0
- package/config.d.ts +50 -50
- package/examples/example-generated-sdk-js/README.md +65 -0
- package/examples/example-generated-sdk-js/examples/_test-wallet.js +17 -0
- package/examples/example-generated-sdk-js/examples/deploy.js +41 -0
- package/examples/example-generated-sdk-js/examples/events.js +36 -0
- package/examples/example-generated-sdk-js/examples/read-operations.js +46 -0
- package/examples/example-generated-sdk-js/examples/write-operations.js +44 -0
- package/examples/example-generated-sdk-js/index.d.ts +1 -0
- package/examples/example-generated-sdk-js/index.js +15 -0
- package/examples/example-generated-sdk-js/package-lock.json +59 -0
- package/examples/example-generated-sdk-js/package.json +22 -0
- package/examples/example-generated-sdk-js/src/SimpleERC20.d.ts +19 -0
- package/examples/example-generated-sdk-js/src/SimpleERC20.js +353 -0
- package/examples/example-generated-sdk-js/src/SimpleERC20__factory.d.ts +10 -0
- package/examples/example-generated-sdk-js/src/SimpleERC20__factory.js +29 -0
- package/examples/example-generated-sdk-js/src/index.d.ts +4 -0
- package/examples/example-generated-sdk-js/src/index.js +5 -0
- package/examples/example-generated-sdk-js/src/quantumcoin-shims.d.ts +23 -0
- package/examples/example-generated-sdk-js/src/types.d.ts +3 -0
- package/examples/example-generated-sdk-js/src/types.js +3 -0
- package/examples/example-generated-sdk-js/test/e2e/SimpleERC20.e2e.test.js +78 -0
- package/examples/example-generated-sdk-ts/README.md +65 -0
- package/examples/example-generated-sdk-ts/examples/_test-wallet.js +17 -0
- package/examples/example-generated-sdk-ts/examples/deploy.js +41 -0
- package/examples/example-generated-sdk-ts/examples/events.js +36 -0
- package/examples/example-generated-sdk-ts/examples/read-operations.js +46 -0
- package/examples/example-generated-sdk-ts/examples/write-operations.js +44 -0
- package/examples/example-generated-sdk-ts/index.d.ts +1 -0
- package/examples/example-generated-sdk-ts/index.js +15 -0
- package/examples/example-generated-sdk-ts/package-lock.json +59 -0
- package/examples/example-generated-sdk-ts/package.json +23 -0
- package/examples/example-generated-sdk-ts/src/SimpleERC20.ts +334 -0
- package/examples/example-generated-sdk-ts/src/SimpleERC20__factory.ts +28 -0
- package/examples/example-generated-sdk-ts/src/index.ts +4 -0
- package/examples/example-generated-sdk-ts/src/quantumcoin-shims.d.ts +23 -0
- package/examples/example-generated-sdk-ts/src/types.ts +4 -0
- package/examples/example-generated-sdk-ts/test/e2e/SimpleERC20.e2e.test.js +78 -0
- package/examples/example-generated-sdk-ts/tsconfig.json +14 -0
- package/examples/sdk-generator-erc20.inline.json +251 -251
- package/generate-sdk.js +1824 -1822
- package/package.json +1 -1
- package/src/abi/fragments.d.ts +42 -42
- package/src/abi/index.d.ts +13 -13
- package/src/contract/index.d.ts +9 -9
- package/src/errors/index.d.ts +92 -92
- package/src/generator/index.d.ts +11 -4
- package/src/generator/index.js +33 -5
- package/src/internal/hex.d.ts +68 -61
- package/src/internal/hex.js +36 -0
- package/src/providers/json-rpc-provider.d.ts +12 -12
- package/src/providers/provider.js +3 -3
- package/src/utils/address.d.ts +58 -58
- package/src/utils/encoding.d.ts +120 -120
- package/src/utils/hashing.js +298 -298
- package/src/utils/index.d.ts +63 -63
- package/src/utils/index.js +14 -14
- package/src/utils/result.d.ts +57 -57
- package/src/utils/rlp.d.ts +12 -12
- package/src/utils/units.d.ts +29 -29
- package/src/wallet/index.d.ts +10 -10
- package/src/wallet/wallet.d.ts +192 -192
- package/src/wallet/wallet.js +630 -630
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/README.md +83 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/artifacts/AllSolidityTypes.abi.json +12544 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/artifacts/AllSolidityTypes.bin +1 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/_test-wallet.js +17 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/_test-wallet.ts +10 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/deploy.js +41 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/deploy.ts +41 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/events.js +36 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/events.ts +36 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/offline-signing.js +82 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/offline-signing.ts +80 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/read-operations.js +46 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/read-operations.ts +44 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/write-operations.js +44 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/write-operations.ts +44 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/index.d.ts +1 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/index.js +21 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/package-lock.json +597 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/package.json +25 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/AllSolidityTypes.d.ts +1280 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/AllSolidityTypes.js +14021 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/AllSolidityTypes__factory.d.ts +11 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/AllSolidityTypes__factory.js +29 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/index.d.ts +4 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/index.js +5 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/quantumcoin-shims.d.ts +25 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/types.d.ts +3 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/types.js +3 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/test/e2e/AllSolidityTypes.e2e.test.js +77 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/test/e2e/AllSolidityTypes.extra.test.js +195 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/README.md +83 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/artifacts/AllSolidityTypes.abi.json +12544 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/artifacts/AllSolidityTypes.bin +1 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/_test-wallet.js +17 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/_test-wallet.ts +10 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/deploy.js +41 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/deploy.ts +41 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/events.js +36 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/events.ts +36 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/offline-signing.js +82 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/offline-signing.ts +80 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/read-operations.js +46 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/read-operations.ts +44 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/write-operations.js +44 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/write-operations.ts +44 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/index.d.ts +1 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/index.js +21 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/package-lock.json +597 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/package.json +26 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/AllSolidityTypes.ts +13940 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/AllSolidityTypes__factory.ts +29 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/index.ts +4 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/quantumcoin-shims.d.ts +25 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/types.ts +4 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/test/e2e/AllSolidityTypes.e2e.test.js +77 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/test/e2e/AllSolidityTypes.extra.test.js +195 -0
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/tsconfig.json +18 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/README.md +74 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/artifacts/SimpleERC20.abi.json +245 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/artifacts/SimpleERC20.bin +1 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/_test-wallet.js +17 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/_test-wallet.ts +10 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/deploy.js +41 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/deploy.ts +41 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/events.js +36 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/events.ts +36 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/offline-signing.js +82 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/offline-signing.ts +80 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/read-operations.js +46 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/read-operations.ts +44 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/write-operations.js +44 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/write-operations.ts +44 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/index.d.ts +1 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/index.js +16 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/package-lock.json +597 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/package.json +25 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/SimpleERC20.d.ts +24 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/SimpleERC20.js +372 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/SimpleERC20__factory.d.ts +10 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/SimpleERC20__factory.js +29 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/index.d.ts +4 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/index.js +5 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/quantumcoin-shims.d.ts +25 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/types.d.ts +3 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/types.js +3 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/test/e2e/SimpleERC20.e2e.test.js +90 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/README.md +74 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/artifacts/SimpleERC20.abi.json +245 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/artifacts/SimpleERC20.bin +1 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/_test-wallet.js +17 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/_test-wallet.ts +10 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/deploy.js +41 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/deploy.ts +41 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/events.js +36 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/events.ts +36 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/offline-signing.js +82 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/offline-signing.ts +80 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/read-operations.js +46 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/read-operations.ts +44 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/write-operations.js +44 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/write-operations.ts +44 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/index.d.ts +1 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/index.js +16 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/package-lock.json +597 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/package.json +26 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/SimpleERC20.ts +355 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/SimpleERC20__factory.ts +28 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/index.ts +4 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/quantumcoin-shims.d.ts +25 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/types.ts +4 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/test/e2e/SimpleERC20.e2e.test.js +90 -0
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/tsconfig.json +18 -0
- package/test/e2e/generator-interface.e2e.test.js +163 -0
- package/test/e2e/generator-interface.e2e.test.ts +158 -0
- package/test/e2e/signing-context-and-fee.e2e.test.js +141 -141
- package/test/e2e/signing-context-and-fee.e2e.test.ts +128 -128
- package/test/integration/provider.test.js +88 -88
- package/test/unit/address-wallet.test.js +892 -892
- package/test/unit/address-wallet.test.ts +877 -877
- package/test/unit/generator.test.js +48 -1
- package/test/unit/generator.test.ts +48 -1
- package/test/unit/hashing.test.js +64 -64
- package/test/unit/hashing.test.ts +63 -63
- package/test/unit/internal-hex.test.js +32 -1
- package/test/unit/internal-hex.test.ts +32 -1
- package/test/unit/providers.test.js +51 -1
- package/test/unit/providers.test.ts +53 -0
- package/examples/node_modules/.bin/esbuild +0 -16
- package/examples/node_modules/.bin/esbuild.cmd +0 -17
- package/examples/node_modules/.bin/esbuild.ps1 +0 -28
- package/examples/node_modules/.bin/sdkgen +0 -16
- package/examples/node_modules/.bin/sdkgen.cmd +0 -17
- package/examples/node_modules/.bin/sdkgen.ps1 +0 -28
- package/examples/node_modules/.bin/tsx +0 -16
- package/examples/node_modules/.bin/tsx.cmd +0 -17
- package/examples/node_modules/.bin/tsx.ps1 +0 -28
- package/examples/node_modules/.package-lock.json +0 -144
- package/examples/node_modules/@esbuild/win32-x64/README.md +0 -3
- package/examples/node_modules/@esbuild/win32-x64/esbuild.exe +0 -0
- package/examples/node_modules/@esbuild/win32-x64/package.json +0 -20
- package/examples/node_modules/esbuild/LICENSE.md +0 -21
- package/examples/node_modules/esbuild/README.md +0 -3
- package/examples/node_modules/esbuild/bin/esbuild +0 -223
- package/examples/node_modules/esbuild/install.js +0 -289
- package/examples/node_modules/esbuild/lib/main.d.ts +0 -716
- package/examples/node_modules/esbuild/lib/main.js +0 -2532
- package/examples/node_modules/esbuild/package.json +0 -49
- package/examples/node_modules/get-tsconfig/LICENSE +0 -21
- package/examples/node_modules/get-tsconfig/README.md +0 -235
- package/examples/node_modules/get-tsconfig/dist/index.cjs +0 -7
- package/examples/node_modules/get-tsconfig/dist/index.d.cts +0 -2088
- package/examples/node_modules/get-tsconfig/dist/index.d.mts +0 -2088
- package/examples/node_modules/get-tsconfig/dist/index.mjs +0 -7
- package/examples/node_modules/get-tsconfig/package.json +0 -46
- package/examples/node_modules/quantum-coin-js-sdk/LICENSE +0 -21
- package/examples/node_modules/quantum-coin-js-sdk/LICENSE-wasm_exec.js.txt +0 -30
- package/examples/node_modules/quantum-coin-js-sdk/README.md +0 -1675
- package/examples/node_modules/quantum-coin-js-sdk/example/README.md +0 -14
- package/examples/node_modules/quantum-coin-js-sdk/example/conversion-example.js +0 -19
- package/examples/node_modules/quantum-coin-js-sdk/example/example-create-contract.js +0 -396
- package/examples/node_modules/quantum-coin-js-sdk/example/example-encode-decode-rlp.js +0 -225
- package/examples/node_modules/quantum-coin-js-sdk/example/example-event-pack-unpack.js +0 -391
- package/examples/node_modules/quantum-coin-js-sdk/example/example-misc.js +0 -101
- package/examples/node_modules/quantum-coin-js-sdk/example/example-rpc-send-signRawTransaction.js +0 -318
- package/examples/node_modules/quantum-coin-js-sdk/example/example-rpc-send.js +0 -116
- package/examples/node_modules/quantum-coin-js-sdk/example/example-send.js +0 -70
- package/examples/node_modules/quantum-coin-js-sdk/example/example-token-pack-unpack.js +0 -961
- package/examples/node_modules/quantum-coin-js-sdk/example/example-wallet-version4.js +0 -35
- package/examples/node_modules/quantum-coin-js-sdk/example/example-wallet.js +0 -43
- package/examples/node_modules/quantum-coin-js-sdk/example/example.js +0 -405
- package/examples/node_modules/quantum-coin-js-sdk/example/package-lock.json +0 -134
- package/examples/node_modules/quantum-coin-js-sdk/example/package.json +0 -15
- package/examples/node_modules/quantum-coin-js-sdk/index.d.ts +0 -1031
- package/examples/node_modules/quantum-coin-js-sdk/index.js +0 -3144
- package/examples/node_modules/quantum-coin-js-sdk/package.json +0 -34
- package/examples/node_modules/quantum-coin-js-sdk/tests/encrypted-32.json +0 -1
- package/examples/node_modules/quantum-coin-js-sdk/tests/encrypted-36.json +0 -1
- package/examples/node_modules/quantum-coin-js-sdk/tests/encrypted-48.json +0 -1
- package/examples/node_modules/quantum-coin-js-sdk/tests/generate-verify-vectors.js +0 -91
- package/examples/node_modules/quantum-coin-js-sdk/tests/non-transactional.preinit.test.js +0 -41
- package/examples/node_modules/quantum-coin-js-sdk/tests/non-transactional.test.js +0 -1389
- package/examples/node_modules/quantum-coin-js-sdk/tests/sign-raw-keytype5-context-null.test.js +0 -107
- package/examples/node_modules/quantum-coin-js-sdk/tests/sign-raw-transaction.test.js +0 -196
- package/examples/node_modules/quantum-coin-js-sdk/tests/sign-verify.test.js +0 -311
- package/examples/node_modules/quantum-coin-js-sdk/tests/transactional.relay.test.js +0 -131
- package/examples/node_modules/quantum-coin-js-sdk/tests/transactional.rpc.test.js +0 -103
- package/examples/node_modules/quantum-coin-js-sdk/tests/verify-vectors.json +0 -95035
- package/examples/node_modules/quantum-coin-js-sdk/wasmBase64.d.ts +0 -9
- package/examples/node_modules/quantum-coin-js-sdk/wasmBase64.js +0 -16
- package/examples/node_modules/quantum-coin-js-sdk/wasm_exec.d.ts +0 -0
- package/examples/node_modules/quantum-coin-js-sdk/wasm_exec.js +0 -587
- package/examples/node_modules/resolve-pkg-maps/LICENSE +0 -21
- package/examples/node_modules/resolve-pkg-maps/README.md +0 -216
- package/examples/node_modules/resolve-pkg-maps/dist/index.cjs +0 -1
- package/examples/node_modules/resolve-pkg-maps/dist/index.d.cts +0 -11
- package/examples/node_modules/resolve-pkg-maps/dist/index.d.mts +0 -11
- package/examples/node_modules/resolve-pkg-maps/dist/index.mjs +0 -1
- package/examples/node_modules/resolve-pkg-maps/package.json +0 -42
- package/examples/node_modules/seed-words/.github/workflows/publish-npmjs.yaml +0 -22
- package/examples/node_modules/seed-words/BUILD.md +0 -7
- package/examples/node_modules/seed-words/LICENSE +0 -121
- package/examples/node_modules/seed-words/README.md +0 -67
- package/examples/node_modules/seed-words/dist/seedwords.d.ts +0 -39
- package/examples/node_modules/seed-words/package.json +0 -27
- package/examples/node_modules/seed-words/seedwords.js +0 -315
- package/examples/node_modules/seed-words/seedwords.txt +0 -65536
- package/examples/node_modules/seed-words/tsconfig.json +0 -21
- package/examples/node_modules/tsx/LICENSE +0 -21
- package/examples/node_modules/tsx/README.md +0 -32
- package/examples/node_modules/tsx/dist/cjs/api/index.cjs +0 -1
- package/examples/node_modules/tsx/dist/cjs/api/index.d.cts +0 -35
- package/examples/node_modules/tsx/dist/cjs/api/index.d.mts +0 -35
- package/examples/node_modules/tsx/dist/cjs/api/index.mjs +0 -1
- package/examples/node_modules/tsx/dist/cjs/index.cjs +0 -1
- package/examples/node_modules/tsx/dist/cjs/index.mjs +0 -1
- package/examples/node_modules/tsx/dist/cli.cjs +0 -54
- package/examples/node_modules/tsx/dist/cli.mjs +0 -55
- package/examples/node_modules/tsx/dist/client-BQVF1NaW.mjs +0 -1
- package/examples/node_modules/tsx/dist/client-D6NvIMSC.cjs +0 -1
- package/examples/node_modules/tsx/dist/esm/api/index.cjs +0 -1
- package/examples/node_modules/tsx/dist/esm/api/index.d.cts +0 -35
- package/examples/node_modules/tsx/dist/esm/api/index.d.mts +0 -35
- package/examples/node_modules/tsx/dist/esm/api/index.mjs +0 -1
- package/examples/node_modules/tsx/dist/esm/index.cjs +0 -2
- package/examples/node_modules/tsx/dist/esm/index.mjs +0 -2
- package/examples/node_modules/tsx/dist/get-pipe-path-BHW2eJdv.mjs +0 -1
- package/examples/node_modules/tsx/dist/get-pipe-path-BoR10qr8.cjs +0 -1
- package/examples/node_modules/tsx/dist/index-7AaEi15b.mjs +0 -14
- package/examples/node_modules/tsx/dist/index-BWFBUo6r.cjs +0 -1
- package/examples/node_modules/tsx/dist/index-gbaejti9.mjs +0 -1
- package/examples/node_modules/tsx/dist/index-gckBtVBf.cjs +0 -14
- package/examples/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +0 -3
- package/examples/node_modules/tsx/dist/lexer-DgIbo0BU.cjs +0 -3
- package/examples/node_modules/tsx/dist/loader.cjs +0 -1
- package/examples/node_modules/tsx/dist/loader.mjs +0 -1
- package/examples/node_modules/tsx/dist/node-features-_8ZFwP_x.mjs +0 -1
- package/examples/node_modules/tsx/dist/node-features-roYmp9jK.cjs +0 -1
- package/examples/node_modules/tsx/dist/package-CeBgXWuR.mjs +0 -1
- package/examples/node_modules/tsx/dist/package-Dxt5kIHw.cjs +0 -1
- package/examples/node_modules/tsx/dist/patch-repl.cjs +0 -1
- package/examples/node_modules/tsx/dist/patch-repl.mjs +0 -1
- package/examples/node_modules/tsx/dist/preflight.cjs +0 -1
- package/examples/node_modules/tsx/dist/preflight.mjs +0 -1
- package/examples/node_modules/tsx/dist/register-2sWVXuRQ.cjs +0 -1
- package/examples/node_modules/tsx/dist/register-B7jrtLTO.mjs +0 -1
- package/examples/node_modules/tsx/dist/register-CFH5oNdT.mjs +0 -4
- package/examples/node_modules/tsx/dist/register-D46fvsV_.cjs +0 -4
- package/examples/node_modules/tsx/dist/repl.cjs +0 -3
- package/examples/node_modules/tsx/dist/repl.mjs +0 -3
- package/examples/node_modules/tsx/dist/require-D4F1Lv60.cjs +0 -1
- package/examples/node_modules/tsx/dist/require-DQxpCAr4.mjs +0 -1
- package/examples/node_modules/tsx/dist/suppress-warnings.cjs +0 -1
- package/examples/node_modules/tsx/dist/suppress-warnings.mjs +0 -1
- package/examples/node_modules/tsx/dist/temporary-directory-B83uKxJF.cjs +0 -1
- package/examples/node_modules/tsx/dist/temporary-directory-CwHp0_NW.mjs +0 -1
- package/examples/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +0 -5
- package/examples/node_modules/tsx/package.json +0 -68
package/package.json
CHANGED
package/src/abi/fragments.d.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Minimal ABI fragment classes (ethers.js v6 compatible surface).
|
|
3
|
-
*
|
|
4
|
-
* This SDK keeps fragment handling lightweight and delegates ABI encoding/decoding
|
|
5
|
-
* to `quantum-coin-js-sdk` (WASM).
|
|
6
|
-
*/
|
|
7
|
-
export class Fragment {
|
|
8
|
-
/**
|
|
9
|
-
* @param {any} fragment
|
|
10
|
-
*/
|
|
11
|
-
constructor(fragment: any);
|
|
12
|
-
type: any;
|
|
13
|
-
name: any;
|
|
14
|
-
inputs: any;
|
|
15
|
-
outputs: any;
|
|
16
|
-
stateMutability: any;
|
|
17
|
-
anonymous: any;
|
|
18
|
-
/**
|
|
19
|
-
* Formats the fragment.
|
|
20
|
-
* @param {string=} format
|
|
21
|
-
* @returns {string}
|
|
22
|
-
*/
|
|
23
|
-
format(format?: string | undefined): string;
|
|
24
|
-
/**
|
|
25
|
-
* @returns {any}
|
|
26
|
-
*/
|
|
27
|
-
toJSON(): any;
|
|
28
|
-
}
|
|
29
|
-
export class NamedFragment extends Fragment {
|
|
30
|
-
}
|
|
31
|
-
export class FunctionFragment extends NamedFragment {
|
|
32
|
-
}
|
|
33
|
-
export class EventFragment extends NamedFragment {
|
|
34
|
-
}
|
|
35
|
-
export class ErrorFragment extends NamedFragment {
|
|
36
|
-
}
|
|
37
|
-
export class ConstructorFragment extends Fragment {
|
|
38
|
-
}
|
|
39
|
-
export class StructFragment extends Fragment {
|
|
40
|
-
}
|
|
41
|
-
export class FallbackFragment extends Fragment {
|
|
42
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Minimal ABI fragment classes (ethers.js v6 compatible surface).
|
|
3
|
+
*
|
|
4
|
+
* This SDK keeps fragment handling lightweight and delegates ABI encoding/decoding
|
|
5
|
+
* to `quantum-coin-js-sdk` (WASM).
|
|
6
|
+
*/
|
|
7
|
+
export class Fragment {
|
|
8
|
+
/**
|
|
9
|
+
* @param {any} fragment
|
|
10
|
+
*/
|
|
11
|
+
constructor(fragment: any);
|
|
12
|
+
type: any;
|
|
13
|
+
name: any;
|
|
14
|
+
inputs: any;
|
|
15
|
+
outputs: any;
|
|
16
|
+
stateMutability: any;
|
|
17
|
+
anonymous: any;
|
|
18
|
+
/**
|
|
19
|
+
* Formats the fragment.
|
|
20
|
+
* @param {string=} format
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
format(format?: string | undefined): string;
|
|
24
|
+
/**
|
|
25
|
+
* @returns {any}
|
|
26
|
+
*/
|
|
27
|
+
toJSON(): any;
|
|
28
|
+
}
|
|
29
|
+
export class NamedFragment extends Fragment {
|
|
30
|
+
}
|
|
31
|
+
export class FunctionFragment extends NamedFragment {
|
|
32
|
+
}
|
|
33
|
+
export class EventFragment extends NamedFragment {
|
|
34
|
+
}
|
|
35
|
+
export class ErrorFragment extends NamedFragment {
|
|
36
|
+
}
|
|
37
|
+
export class ConstructorFragment extends Fragment {
|
|
38
|
+
}
|
|
39
|
+
export class StructFragment extends Fragment {
|
|
40
|
+
}
|
|
41
|
+
export class FallbackFragment extends Fragment {
|
|
42
|
+
}
|
package/src/abi/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
declare const _exports: {
|
|
2
|
-
Interface: typeof import("./interface").Interface;
|
|
3
|
-
AbiCoder: typeof import("./interface").AbiCoder;
|
|
4
|
-
Fragment: typeof import("./fragments").Fragment;
|
|
5
|
-
NamedFragment: typeof import("./fragments").NamedFragment;
|
|
6
|
-
FunctionFragment: typeof import("./fragments").FunctionFragment;
|
|
7
|
-
EventFragment: typeof import("./fragments").EventFragment;
|
|
8
|
-
ErrorFragment: typeof import("./fragments").ErrorFragment;
|
|
9
|
-
ConstructorFragment: typeof import("./fragments").ConstructorFragment;
|
|
10
|
-
StructFragment: typeof import("./fragments").StructFragment;
|
|
11
|
-
FallbackFragment: typeof import("./fragments").FallbackFragment;
|
|
12
|
-
};
|
|
13
|
-
export = _exports;
|
|
1
|
+
declare const _exports: {
|
|
2
|
+
Interface: typeof import("./interface").Interface;
|
|
3
|
+
AbiCoder: typeof import("./interface").AbiCoder;
|
|
4
|
+
Fragment: typeof import("./fragments").Fragment;
|
|
5
|
+
NamedFragment: typeof import("./fragments").NamedFragment;
|
|
6
|
+
FunctionFragment: typeof import("./fragments").FunctionFragment;
|
|
7
|
+
EventFragment: typeof import("./fragments").EventFragment;
|
|
8
|
+
ErrorFragment: typeof import("./fragments").ErrorFragment;
|
|
9
|
+
ConstructorFragment: typeof import("./fragments").ConstructorFragment;
|
|
10
|
+
StructFragment: typeof import("./fragments").StructFragment;
|
|
11
|
+
FallbackFragment: typeof import("./fragments").FallbackFragment;
|
|
12
|
+
};
|
|
13
|
+
export = _exports;
|
package/src/contract/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
declare const _exports: {
|
|
2
|
-
ContractFactory: typeof import("./contract-factory").ContractFactory;
|
|
3
|
-
BaseContract: typeof import("./contract").BaseContract;
|
|
4
|
-
Contract: typeof import("./contract").Contract;
|
|
5
|
-
ContractTransactionResponse: typeof import("./contract").ContractTransactionResponse;
|
|
6
|
-
ContractTransactionReceipt: typeof import("./contract").ContractTransactionReceipt;
|
|
7
|
-
EventLog: typeof import("./contract").EventLog;
|
|
8
|
-
};
|
|
9
|
-
export = _exports;
|
|
1
|
+
declare const _exports: {
|
|
2
|
+
ContractFactory: typeof import("./contract-factory").ContractFactory;
|
|
3
|
+
BaseContract: typeof import("./contract").BaseContract;
|
|
4
|
+
Contract: typeof import("./contract").Contract;
|
|
5
|
+
ContractTransactionResponse: typeof import("./contract").ContractTransactionResponse;
|
|
6
|
+
ContractTransactionReceipt: typeof import("./contract").ContractTransactionReceipt;
|
|
7
|
+
EventLog: typeof import("./contract").EventLog;
|
|
8
|
+
};
|
|
9
|
+
export = _exports;
|
package/src/errors/index.d.ts
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
export type ErrorCode = "INVALID_ARGUMENT" | "NUMERIC_FAULT" | "BUFFER_OVERRUN" | "CALL_EXCEPTION" | "UNKNOWN_ERROR" | "NOT_IMPLEMENTED";
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Error helpers and error classes.
|
|
4
|
-
*
|
|
5
|
-
* The QuantumCoin.js SDK follows ethers.js v6 error patterns:
|
|
6
|
-
* - errors include a machine-readable `code`
|
|
7
|
-
* - errors include `shortMessage`
|
|
8
|
-
* - errors may include extra fields depending on the failure
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {"INVALID_ARGUMENT"|"NUMERIC_FAULT"|"BUFFER_OVERRUN"|"CALL_EXCEPTION"|"UNKNOWN_ERROR"|"NOT_IMPLEMENTED"} ErrorCode
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Returns true if the error matches the given code.
|
|
15
|
-
* @param {any} error
|
|
16
|
-
* @param {string} code
|
|
17
|
-
* @returns {boolean}
|
|
18
|
-
*/
|
|
19
|
-
export function isError(error: any, code: string): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Returns true if the error is a CALL_EXCEPTION.
|
|
22
|
-
* @param {any} error
|
|
23
|
-
* @returns {boolean}
|
|
24
|
-
*/
|
|
25
|
-
export function isCallException(error: any): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Create an Error configured like ethers emits errors.
|
|
28
|
-
*
|
|
29
|
-
* @param {string} message
|
|
30
|
-
* @param {ErrorCode} code
|
|
31
|
-
* @param {Record<string, any>=} info
|
|
32
|
-
* @returns {Error & { code: ErrorCode, shortMessage: string }}
|
|
33
|
-
*/
|
|
34
|
-
export function makeError(message: string, code: ErrorCode, info?: Record<string, any> | undefined): Error & {
|
|
35
|
-
code: ErrorCode;
|
|
36
|
-
shortMessage: string;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Assert a condition, throwing an ethers-style error otherwise.
|
|
40
|
-
* @param {any} check
|
|
41
|
-
* @param {string} message
|
|
42
|
-
* @param {ErrorCode} code
|
|
43
|
-
* @param {Record<string, any>=} info
|
|
44
|
-
*/
|
|
45
|
-
export function assert(check: any, message: string, code: ErrorCode, info?: Record<string, any> | undefined): void;
|
|
46
|
-
/**
|
|
47
|
-
* Assert an argument constraint.
|
|
48
|
-
* @param {any} check
|
|
49
|
-
* @param {string} message
|
|
50
|
-
* @param {string} name
|
|
51
|
-
* @param {any} value
|
|
52
|
-
*/
|
|
53
|
-
export function assertArgument(check: any, message: string, name: string, value: any): void;
|
|
54
|
-
/**
|
|
55
|
-
* Provider error.
|
|
56
|
-
*/
|
|
57
|
-
export class ProviderError extends Error {
|
|
58
|
-
/**
|
|
59
|
-
* @param {string} message
|
|
60
|
-
* @param {Record<string, any>=} info
|
|
61
|
-
*/
|
|
62
|
-
constructor(message: string, info?: Record<string, any> | undefined);
|
|
63
|
-
/** @type {ErrorCode} */
|
|
64
|
-
code: ErrorCode;
|
|
65
|
-
shortMessage: string;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Transaction error.
|
|
69
|
-
*/
|
|
70
|
-
export class TransactionError extends Error {
|
|
71
|
-
/**
|
|
72
|
-
* @param {string} message
|
|
73
|
-
* @param {Record<string, any>=} info
|
|
74
|
-
*/
|
|
75
|
-
constructor(message: string, info?: Record<string, any> | undefined);
|
|
76
|
-
/** @type {ErrorCode} */
|
|
77
|
-
code: ErrorCode;
|
|
78
|
-
shortMessage: string;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Contract error.
|
|
82
|
-
*/
|
|
83
|
-
export class ContractError extends Error {
|
|
84
|
-
/**
|
|
85
|
-
* @param {string} message
|
|
86
|
-
* @param {Record<string, any>=} info
|
|
87
|
-
*/
|
|
88
|
-
constructor(message: string, info?: Record<string, any> | undefined);
|
|
89
|
-
/** @type {ErrorCode} */
|
|
90
|
-
code: ErrorCode;
|
|
91
|
-
shortMessage: string;
|
|
92
|
-
}
|
|
1
|
+
export type ErrorCode = "INVALID_ARGUMENT" | "NUMERIC_FAULT" | "BUFFER_OVERRUN" | "CALL_EXCEPTION" | "UNKNOWN_ERROR" | "NOT_IMPLEMENTED";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Error helpers and error classes.
|
|
4
|
+
*
|
|
5
|
+
* The QuantumCoin.js SDK follows ethers.js v6 error patterns:
|
|
6
|
+
* - errors include a machine-readable `code`
|
|
7
|
+
* - errors include `shortMessage`
|
|
8
|
+
* - errors may include extra fields depending on the failure
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {"INVALID_ARGUMENT"|"NUMERIC_FAULT"|"BUFFER_OVERRUN"|"CALL_EXCEPTION"|"UNKNOWN_ERROR"|"NOT_IMPLEMENTED"} ErrorCode
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Returns true if the error matches the given code.
|
|
15
|
+
* @param {any} error
|
|
16
|
+
* @param {string} code
|
|
17
|
+
* @returns {boolean}
|
|
18
|
+
*/
|
|
19
|
+
export function isError(error: any, code: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Returns true if the error is a CALL_EXCEPTION.
|
|
22
|
+
* @param {any} error
|
|
23
|
+
* @returns {boolean}
|
|
24
|
+
*/
|
|
25
|
+
export function isCallException(error: any): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Create an Error configured like ethers emits errors.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} message
|
|
30
|
+
* @param {ErrorCode} code
|
|
31
|
+
* @param {Record<string, any>=} info
|
|
32
|
+
* @returns {Error & { code: ErrorCode, shortMessage: string }}
|
|
33
|
+
*/
|
|
34
|
+
export function makeError(message: string, code: ErrorCode, info?: Record<string, any> | undefined): Error & {
|
|
35
|
+
code: ErrorCode;
|
|
36
|
+
shortMessage: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Assert a condition, throwing an ethers-style error otherwise.
|
|
40
|
+
* @param {any} check
|
|
41
|
+
* @param {string} message
|
|
42
|
+
* @param {ErrorCode} code
|
|
43
|
+
* @param {Record<string, any>=} info
|
|
44
|
+
*/
|
|
45
|
+
export function assert(check: any, message: string, code: ErrorCode, info?: Record<string, any> | undefined): void;
|
|
46
|
+
/**
|
|
47
|
+
* Assert an argument constraint.
|
|
48
|
+
* @param {any} check
|
|
49
|
+
* @param {string} message
|
|
50
|
+
* @param {string} name
|
|
51
|
+
* @param {any} value
|
|
52
|
+
*/
|
|
53
|
+
export function assertArgument(check: any, message: string, name: string, value: any): void;
|
|
54
|
+
/**
|
|
55
|
+
* Provider error.
|
|
56
|
+
*/
|
|
57
|
+
export class ProviderError extends Error {
|
|
58
|
+
/**
|
|
59
|
+
* @param {string} message
|
|
60
|
+
* @param {Record<string, any>=} info
|
|
61
|
+
*/
|
|
62
|
+
constructor(message: string, info?: Record<string, any> | undefined);
|
|
63
|
+
/** @type {ErrorCode} */
|
|
64
|
+
code: ErrorCode;
|
|
65
|
+
shortMessage: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Transaction error.
|
|
69
|
+
*/
|
|
70
|
+
export class TransactionError extends Error {
|
|
71
|
+
/**
|
|
72
|
+
* @param {string} message
|
|
73
|
+
* @param {Record<string, any>=} info
|
|
74
|
+
*/
|
|
75
|
+
constructor(message: string, info?: Record<string, any> | undefined);
|
|
76
|
+
/** @type {ErrorCode} */
|
|
77
|
+
code: ErrorCode;
|
|
78
|
+
shortMessage: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Contract error.
|
|
82
|
+
*/
|
|
83
|
+
export class ContractError extends Error {
|
|
84
|
+
/**
|
|
85
|
+
* @param {string} message
|
|
86
|
+
* @param {Record<string, any>=} info
|
|
87
|
+
*/
|
|
88
|
+
constructor(message: string, info?: Record<string, any> | undefined);
|
|
89
|
+
/** @type {ErrorCode} */
|
|
90
|
+
code: ErrorCode;
|
|
91
|
+
shortMessage: string;
|
|
92
|
+
}
|
package/src/generator/index.d.ts
CHANGED
|
@@ -52,23 +52,30 @@ export function generateFromArtifacts(opts: {
|
|
|
52
52
|
* Generate a transactional e2e test file (JavaScript) for the typed contract package.
|
|
53
53
|
* The test deploys the contract with constructor args (if any) and invokes one write method.
|
|
54
54
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
55
|
+
* When `bytecode` is omitted, empty, or `"0x"` the contract is treated as an interface
|
|
56
|
+
* and the post-deploy `provider.getCode(...)` bytecode assertion is omitted from the
|
|
57
|
+
* generated test (interfaces deploy with no runtime code by design).
|
|
58
|
+
*
|
|
59
|
+
* @param opts
|
|
57
60
|
*/
|
|
58
61
|
export function generateTransactionalTestJs(opts: {
|
|
59
62
|
contractName: string;
|
|
60
63
|
abi: any[];
|
|
64
|
+
bytecode?: string;
|
|
61
65
|
}): string;
|
|
62
66
|
/**
|
|
63
67
|
* Generate a single transactional e2e test that deploys and invokes methods on ALL contracts.
|
|
64
68
|
* Used when the package has multiple contracts so one test exercises every contract.
|
|
65
69
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
70
|
+
* Accepts `bytecode` per artifact for forward-compatibility; the multi-contract template
|
|
71
|
+
* currently emits no `getCode` assertion (so the value is not yet consumed).
|
|
72
|
+
*
|
|
73
|
+
* @param opts
|
|
68
74
|
*/
|
|
69
75
|
export function generateAllContractsTransactionalTestJs(opts: {
|
|
70
76
|
artifacts: Array<{
|
|
71
77
|
contractName: string;
|
|
72
78
|
abi: any[];
|
|
79
|
+
bytecode?: string;
|
|
73
80
|
}>;
|
|
74
81
|
}): string;
|
package/src/generator/index.js
CHANGED
|
@@ -381,6 +381,23 @@ function _findConstructor(abi) {
|
|
|
381
381
|
return ctor || { type: "constructor", inputs: [] };
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
+
/**
|
|
385
|
+
* Return true if the given bytecode artifact represents an interface
|
|
386
|
+
* (or otherwise non-deployable contract with no runtime code).
|
|
387
|
+
*
|
|
388
|
+
* `solc` writes an empty `.bin` for `interface` declarations and fully
|
|
389
|
+
* abstract `contract` declarations. We treat `null`, `undefined`, empty
|
|
390
|
+
* string, and the bare `"0x"` / `"0X"` prefix as interface bytecode.
|
|
391
|
+
*
|
|
392
|
+
* @param {string|null|undefined} bytecode
|
|
393
|
+
* @returns {boolean}
|
|
394
|
+
*/
|
|
395
|
+
function _isInterfaceBytecode(bytecode) {
|
|
396
|
+
if (bytecode == null) return true;
|
|
397
|
+
const s = String(bytecode).trim().toLowerCase();
|
|
398
|
+
return s === "" || s === "0x";
|
|
399
|
+
}
|
|
400
|
+
|
|
384
401
|
function _solTypeToTestValueExpr(param) {
|
|
385
402
|
const type = typeof param === "string" ? param : String(param && param.type ? param.type : "");
|
|
386
403
|
const internalType = typeof param === "object" && param ? String(param.internalType || "") : "";
|
|
@@ -957,11 +974,17 @@ function _renderIndexDts(contractNames) {
|
|
|
957
974
|
* Generate a transactional e2e test file (JavaScript) for the typed contract package.
|
|
958
975
|
* The test deploys the contract with constructor args (if any) and invokes one write method.
|
|
959
976
|
*
|
|
960
|
-
*
|
|
977
|
+
* When `bytecode` is omitted, empty, or `"0x"` the contract is treated as an interface:
|
|
978
|
+
* the generated test still attempts the deploy (the receipt-status assertion still validates
|
|
979
|
+
* SDK wrapper wiring) but the post-deploy `provider.getCode(...)` bytecode assertion is
|
|
980
|
+
* skipped, since interfaces deploy with no runtime code by design.
|
|
981
|
+
*
|
|
982
|
+
* @param {{ contractName: string, abi: any[], bytecode?: string }} opts
|
|
961
983
|
* @returns {string}
|
|
962
984
|
*/
|
|
963
985
|
function generateTransactionalTestJs(opts) {
|
|
964
|
-
const { contractName, abi } = opts;
|
|
986
|
+
const { contractName, abi, bytecode } = opts;
|
|
987
|
+
const isInterface = _isInterfaceBytecode(bytecode);
|
|
965
988
|
const factoryName = `${contractName}__factory`;
|
|
966
989
|
const ctor = _findConstructor(abi);
|
|
967
990
|
const ctorInputs = ctor.inputs || [];
|
|
@@ -1127,8 +1150,10 @@ describe("${contractName} transactional", () => {
|
|
|
1127
1150
|
assert.ok(deployReceipt);
|
|
1128
1151
|
assert.ok(deployReceipt.blockNumber != null);
|
|
1129
1152
|
|
|
1130
|
-
|
|
1131
|
-
|
|
1153
|
+
${isInterface
|
|
1154
|
+
? `// Skipping bytecode check: ${contractName} is an interface (no bytecode).`
|
|
1155
|
+
: `const code = await provider.getCode(contract.target, "latest");
|
|
1156
|
+
assert.ok(code && code !== "0x");`}
|
|
1132
1157
|
|
|
1133
1158
|
${erc20Assertions ? erc20Assertions : `// (no ERC-20 surface detected for extra assertions)`}
|
|
1134
1159
|
|
|
@@ -1191,7 +1216,10 @@ function _getContractTestMeta(opts) {
|
|
|
1191
1216
|
* Generate a single transactional e2e test that deploys and invokes methods on ALL contracts.
|
|
1192
1217
|
* Used when the package has multiple contracts so one test exercises every contract.
|
|
1193
1218
|
*
|
|
1194
|
-
*
|
|
1219
|
+
* Accepts `bytecode` per artifact for forward-compatibility, although the multi-contract
|
|
1220
|
+
* template currently emits no `getCode` assertion (so the value is not yet consumed).
|
|
1221
|
+
*
|
|
1222
|
+
* @param {{ artifacts: Array<{ contractName: string, abi: any[], bytecode?: string }> }} opts
|
|
1195
1223
|
* @returns {string}
|
|
1196
1224
|
*/
|
|
1197
1225
|
function generateAllContractsTransactionalTestJs(opts) {
|
package/src/internal/hex.d.ts
CHANGED
|
@@ -1,61 +1,68 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return true if `value` is a Uint8Array.
|
|
3
|
-
* @param {any} value
|
|
4
|
-
* @returns {value is Uint8Array}
|
|
5
|
-
*/
|
|
6
|
-
export function isUint8Array(value: any): value is Uint8Array;
|
|
7
|
-
/**
|
|
8
|
-
* Normalize a hex string.
|
|
9
|
-
* @param {string} hex
|
|
10
|
-
* @returns {string}
|
|
11
|
-
*/
|
|
12
|
-
export function normalizeHex(hex: string): string;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
export
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {
|
|
23
|
-
* @
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
* @
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
* @
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
* @
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*
|
|
53
|
-
* @
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
* @
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Return true if `value` is a Uint8Array.
|
|
3
|
+
* @param {any} value
|
|
4
|
+
* @returns {value is Uint8Array}
|
|
5
|
+
*/
|
|
6
|
+
export function isUint8Array(value: any): value is Uint8Array;
|
|
7
|
+
/**
|
|
8
|
+
* Normalize a hex string.
|
|
9
|
+
* @param {string} hex
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
export function normalizeHex(hex: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Format a number/bigint as a JSON-RPC QUANTITY hex string (no leading zeros).
|
|
15
|
+
* @param value
|
|
16
|
+
*/
|
|
17
|
+
export function toQuantityHex(value: number | bigint): string;
|
|
18
|
+
/** Alias of `toQuantityHex` matching ethers.js v6 naming. */
|
|
19
|
+
export const toQuantity: typeof toQuantityHex;
|
|
20
|
+
/**
|
|
21
|
+
* Returns true if value is a hex string.
|
|
22
|
+
* @param {any} value
|
|
23
|
+
* @param {number=} lengthBytes Optional exact byte length.
|
|
24
|
+
* @returns {boolean}
|
|
25
|
+
*/
|
|
26
|
+
export function isHexString(value: any, lengthBytes?: number | undefined): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Strip 0x prefix.
|
|
29
|
+
* @param {string} hex
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
export function strip0x(hex: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Ensure a 0x prefix.
|
|
35
|
+
* @param {string} hex
|
|
36
|
+
* @returns {string}
|
|
37
|
+
*/
|
|
38
|
+
export function add0x(hex: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Convert a hex string to bytes.
|
|
41
|
+
* @param {string} hex
|
|
42
|
+
* @returns {Uint8Array}
|
|
43
|
+
*/
|
|
44
|
+
export function hexToBytes(hex: string): Uint8Array;
|
|
45
|
+
/**
|
|
46
|
+
* Convert bytes to hex string.
|
|
47
|
+
* @param {Uint8Array} bytes
|
|
48
|
+
* @returns {string}
|
|
49
|
+
*/
|
|
50
|
+
export function bytesToHex(bytes: Uint8Array): string;
|
|
51
|
+
/**
|
|
52
|
+
* UTF-8 encode a string to bytes.
|
|
53
|
+
* @param {string} str
|
|
54
|
+
* @returns {Uint8Array}
|
|
55
|
+
*/
|
|
56
|
+
export function utf8ToBytes(str: string): Uint8Array;
|
|
57
|
+
/**
|
|
58
|
+
* UTF-8 decode bytes to a string.
|
|
59
|
+
* @param {Uint8Array} bytes
|
|
60
|
+
* @returns {string}
|
|
61
|
+
*/
|
|
62
|
+
export function bytesToUtf8(bytes: Uint8Array): string;
|
|
63
|
+
/**
|
|
64
|
+
* Convert BytesLike to Uint8Array.
|
|
65
|
+
* @param {string | Uint8Array} data
|
|
66
|
+
* @returns {Uint8Array}
|
|
67
|
+
*/
|
|
68
|
+
export function arrayify(data: string | Uint8Array): Uint8Array;
|
package/src/internal/hex.js
CHANGED
|
@@ -35,6 +35,40 @@ function normalizeHex(hex) {
|
|
|
35
35
|
return h;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Format a number/bigint as a JSON-RPC QUANTITY hex string.
|
|
40
|
+
*
|
|
41
|
+
* Per the Ethereum JSON-RPC spec, quantities use the most compact
|
|
42
|
+
* representation with no leading zeros, with the single exception that
|
|
43
|
+
* zero is encoded as "0x0".
|
|
44
|
+
*
|
|
45
|
+
* Use this for block numbers, gas amounts, nonces, balances, and other
|
|
46
|
+
* numeric RPC parameters. Do NOT use it for DATA hex (addresses,
|
|
47
|
+
* bytecode, byte-arrays) — use `normalizeHex` for those.
|
|
48
|
+
*
|
|
49
|
+
* @param {number|bigint} value
|
|
50
|
+
* @returns {string}
|
|
51
|
+
*/
|
|
52
|
+
function toQuantityHex(value) {
|
|
53
|
+
let n;
|
|
54
|
+
if (typeof value === "bigint") {
|
|
55
|
+
n = value;
|
|
56
|
+
} else if (typeof value === "number") {
|
|
57
|
+
if (!Number.isInteger(value)) {
|
|
58
|
+
throw new TypeError("toQuantityHex: value must be an integer or bigint");
|
|
59
|
+
}
|
|
60
|
+
n = BigInt(value);
|
|
61
|
+
} else {
|
|
62
|
+
throw new TypeError("toQuantityHex: value must be a number or bigint");
|
|
63
|
+
}
|
|
64
|
+
if (n < 0n) throw new RangeError("toQuantityHex: value must be non-negative");
|
|
65
|
+
if (n === 0n) return "0x0";
|
|
66
|
+
return "0x" + n.toString(16);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Alias of `toQuantityHex` matching ethers.js v6 naming. */
|
|
70
|
+
const toQuantity = toQuantityHex;
|
|
71
|
+
|
|
38
72
|
/**
|
|
39
73
|
* Returns true if value is a hex string.
|
|
40
74
|
* @param {any} value
|
|
@@ -132,6 +166,8 @@ function arrayify(data) {
|
|
|
132
166
|
module.exports = {
|
|
133
167
|
isUint8Array,
|
|
134
168
|
normalizeHex,
|
|
169
|
+
toQuantityHex,
|
|
170
|
+
toQuantity,
|
|
135
171
|
isHexString,
|
|
136
172
|
strip0x,
|
|
137
173
|
add0x,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export class JsonRpcProvider extends AbstractProvider {
|
|
2
|
-
/**
|
|
3
|
-
* @param {string=} url RPC endpoint (defaults to Config.rpcEndpoint or https://public.rpc.quantumcoinapi.com)
|
|
4
|
-
* @param {number=} chainId Chain ID (defaults to 123123)
|
|
5
|
-
*/
|
|
6
|
-
constructor(url?: string | undefined, chainId?: number | undefined);
|
|
7
|
-
url: string;
|
|
8
|
-
chainId: number;
|
|
9
|
-
}
|
|
10
|
-
export class JsonRpcApiProvider extends JsonRpcProvider {
|
|
11
|
-
}
|
|
12
|
-
import { AbstractProvider } from "./provider";
|
|
1
|
+
export class JsonRpcProvider extends AbstractProvider {
|
|
2
|
+
/**
|
|
3
|
+
* @param {string=} url RPC endpoint (defaults to Config.rpcEndpoint or https://public.rpc.quantumcoinapi.com)
|
|
4
|
+
* @param {number=} chainId Chain ID (defaults to 123123)
|
|
5
|
+
*/
|
|
6
|
+
constructor(url?: string | undefined, chainId?: number | undefined);
|
|
7
|
+
url: string;
|
|
8
|
+
chainId: number;
|
|
9
|
+
}
|
|
10
|
+
export class JsonRpcApiProvider extends JsonRpcProvider {
|
|
11
|
+
}
|
|
12
|
+
import { AbstractProvider } from "./provider";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const { EventEmitter } = require("events");
|
|
9
9
|
const { makeError, assertArgument } = require("../errors");
|
|
10
|
-
const { normalizeHex, isHexString } = require("../internal/hex");
|
|
10
|
+
const { normalizeHex, toQuantityHex, isHexString } = require("../internal/hex");
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @typedef {import("../utils/encoding").BytesLike} BytesLike
|
|
@@ -58,7 +58,7 @@ function _blockTagToHex(blockTag) {
|
|
|
58
58
|
if (s === "latest" || s === "pending" || s === "earliest") return s;
|
|
59
59
|
const n = typeof blockTag === "number" ? blockTag : Number(blockTag);
|
|
60
60
|
if (!Number.isInteger(n) || n < 0) return undefined;
|
|
61
|
-
return
|
|
61
|
+
return toQuantityHex(n);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -251,7 +251,7 @@ class AbstractProvider extends Provider {
|
|
|
251
251
|
* @returns {Promise<Block>}
|
|
252
252
|
*/
|
|
253
253
|
async getBlock(blockNumber) {
|
|
254
|
-
const tag = blockNumber === "latest" ? "latest" :
|
|
254
|
+
const tag = blockNumber === "latest" ? "latest" : toQuantityHex(blockNumber);
|
|
255
255
|
const block = await this._perform("eth_getBlockByNumber", [tag, false]);
|
|
256
256
|
return new Block(block, this);
|
|
257
257
|
}
|