quantumcoin 7.0.15 → 8.0.0
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 +44 -0
- package/README.md +1 -1
- package/generate-sdk.js +8 -6
- package/package.json +22 -4
- package/src/abi/interface.d.ts +133 -128
- package/src/abi/js-abi-coder.d.ts +8 -8
- package/src/constants.d.ts +61 -61
- package/src/contract/contract-factory.d.ts +28 -28
- package/src/contract/contract.d.ts +121 -113
- package/src/contract/index.d.ts +1 -0
- package/src/errors/index.d.ts +10 -2
- package/src/errors/index.js +1 -1
- package/src/generator/index.d.ts +109 -81
- package/src/index.d.ts +126 -123
- package/src/internal/event-emitter.d.ts +76 -0
- package/src/internal/event-emitter.js +144 -0
- package/src/internal/hex.d.ts +27 -4
- package/src/internal/hex.js +7 -3
- package/src/providers/extra-providers.d.ts +141 -139
- package/src/providers/extra-providers.js +15 -1
- package/src/providers/index.d.ts +18 -18
- package/src/providers/json-rpc-provider.d.ts +1 -0
- package/src/providers/provider.d.ts +233 -222
- package/src/providers/provider.js +1 -1
- package/src/utils/encoding.js +16 -4
- package/src/utils/fixednumber.d.ts +57 -57
- package/src/utils/hashing.d.ts +79 -76
- package/src/utils/hashing.js +68 -177
- package/src/utils/index.d.ts +1 -1
- package/src/utils/rlp.js +1 -1
- package/src/wallet/wallet.d.ts +54 -29
- package/src/wallet/wallet.js +3 -3
- package/.github/workflows/publish-npmjs.yaml +0 -22
- package/.gitignore +0 -15
- package/examples/AllSolidityTypes.sol +0 -184
- package/examples/SimpleIERC20.sol +0 -74
- package/examples/events.js +0 -41
- package/examples/events.ts +0 -35
- package/examples/example-generated-sdk-js/README.md +0 -65
- package/examples/example-generated-sdk-js/examples/_test-wallet.js +0 -17
- package/examples/example-generated-sdk-js/examples/deploy.js +0 -41
- package/examples/example-generated-sdk-js/examples/events.js +0 -36
- package/examples/example-generated-sdk-js/examples/read-operations.js +0 -46
- package/examples/example-generated-sdk-js/examples/write-operations.js +0 -44
- package/examples/example-generated-sdk-js/index.d.ts +0 -1
- package/examples/example-generated-sdk-js/index.js +0 -15
- package/examples/example-generated-sdk-js/package-lock.json +0 -59
- package/examples/example-generated-sdk-js/package.json +0 -22
- package/examples/example-generated-sdk-js/src/SimpleERC20.d.ts +0 -19
- package/examples/example-generated-sdk-js/src/SimpleERC20.js +0 -353
- package/examples/example-generated-sdk-js/src/SimpleERC20__factory.d.ts +0 -10
- package/examples/example-generated-sdk-js/src/SimpleERC20__factory.js +0 -29
- package/examples/example-generated-sdk-js/src/index.d.ts +0 -4
- package/examples/example-generated-sdk-js/src/index.js +0 -5
- package/examples/example-generated-sdk-js/src/quantumcoin-shims.d.ts +0 -23
- package/examples/example-generated-sdk-js/src/types.d.ts +0 -3
- package/examples/example-generated-sdk-js/src/types.js +0 -3
- package/examples/example-generated-sdk-js/test/e2e/SimpleERC20.e2e.test.js +0 -78
- package/examples/example-generated-sdk-ts/README.md +0 -65
- package/examples/example-generated-sdk-ts/examples/_test-wallet.js +0 -17
- package/examples/example-generated-sdk-ts/examples/deploy.js +0 -41
- package/examples/example-generated-sdk-ts/examples/events.js +0 -36
- package/examples/example-generated-sdk-ts/examples/read-operations.js +0 -46
- package/examples/example-generated-sdk-ts/examples/write-operations.js +0 -44
- package/examples/example-generated-sdk-ts/index.d.ts +0 -1
- package/examples/example-generated-sdk-ts/index.js +0 -15
- package/examples/example-generated-sdk-ts/package-lock.json +0 -59
- package/examples/example-generated-sdk-ts/package.json +0 -23
- package/examples/example-generated-sdk-ts/src/SimpleERC20.ts +0 -334
- package/examples/example-generated-sdk-ts/src/SimpleERC20__factory.ts +0 -28
- package/examples/example-generated-sdk-ts/src/index.ts +0 -4
- package/examples/example-generated-sdk-ts/src/quantumcoin-shims.d.ts +0 -23
- package/examples/example-generated-sdk-ts/src/types.ts +0 -4
- package/examples/example-generated-sdk-ts/test/e2e/SimpleERC20.e2e.test.js +0 -78
- package/examples/example-generated-sdk-ts/tsconfig.json +0 -14
- package/examples/example-generator-sdk-js.js +0 -100
- package/examples/example-generator-sdk-js.ts +0 -77
- package/examples/example-generator-sdk-ts.js +0 -100
- package/examples/example-generator-sdk-ts.ts +0 -77
- package/examples/example.js +0 -67
- package/examples/example.ts +0 -56
- 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 -1689
- 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 -100
- 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 -115
- package/examples/node_modules/quantum-coin-js-sdk/example/example-send.js +0 -69
- package/examples/node_modules/quantum-coin-js-sdk/example/example-token-pack-unpack.js +0 -960
- package/examples/node_modules/quantum-coin-js-sdk/example/example-wallet-version4.js +0 -34
- 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 -56
- 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 -1047
- package/examples/node_modules/quantum-coin-js-sdk/index.js +0 -3182
- 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/get-gas-price.test.js +0 -59
- 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/examples/offline-signing.js +0 -77
- package/examples/offline-signing.ts +0 -65
- package/examples/package-lock.json +0 -596
- package/examples/package.json +0 -32
- package/examples/read-operations.js +0 -32
- package/examples/read-operations.ts +0 -31
- package/examples/sdk-generator-erc20.inline.json +0 -251
- package/examples/solidity-types.ts +0 -43
- package/examples/wallet-offline.js +0 -36
- package/examples/wallet-offline.ts +0 -26
- package/scripts/copy-declarations.js +0 -31
- package/scripts/run-all-one-by-one.js +0 -151
- package/test/e2e/all-solidity-types.dynamic.test.js +0 -207
- package/test/e2e/all-solidity-types.dynamic.test.ts +0 -191
- package/test/e2e/all-solidity-types.fixtures.js +0 -231
- package/test/e2e/all-solidity-types.generated-sdks.e2e.test.js +0 -387
- package/test/e2e/all-solidity-types.generated-sdks.e2e.test.ts +0 -350
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/README.md +0 -83
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/artifacts/AllSolidityTypes.abi.json +0 -12544
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/artifacts/AllSolidityTypes.bin +0 -1
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/_test-wallet.js +0 -17
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/_test-wallet.ts +0 -10
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/deploy.js +0 -41
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/deploy.ts +0 -41
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/events.js +0 -36
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/events.ts +0 -36
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/offline-signing.js +0 -82
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/offline-signing.ts +0 -80
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/read-operations.js +0 -46
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/read-operations.ts +0 -44
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/write-operations.js +0 -44
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/examples/write-operations.ts +0 -44
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/index.d.ts +0 -1
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/index.js +0 -21
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/package-lock.json +0 -597
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/package.json +0 -25
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/AllSolidityTypes.d.ts +0 -1280
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/AllSolidityTypes.js +0 -14021
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/AllSolidityTypes__factory.d.ts +0 -11
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/AllSolidityTypes__factory.js +0 -31
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/index.d.ts +0 -4
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/index.js +0 -5
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/quantumcoin-shims.d.ts +0 -25
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/types.d.ts +0 -3
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/src/types.js +0 -3
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/test/e2e/AllSolidityTypes.e2e.test.js +0 -77
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-js/test/e2e/AllSolidityTypes.extra.test.js +0 -195
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/README.md +0 -83
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/artifacts/AllSolidityTypes.abi.json +0 -12544
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/artifacts/AllSolidityTypes.bin +0 -1
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/_test-wallet.js +0 -17
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/_test-wallet.ts +0 -10
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/deploy.js +0 -41
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/deploy.ts +0 -41
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/events.js +0 -36
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/events.ts +0 -36
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/offline-signing.js +0 -82
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/offline-signing.ts +0 -80
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/read-operations.js +0 -46
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/read-operations.ts +0 -44
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/write-operations.js +0 -44
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/examples/write-operations.ts +0 -44
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/index.d.ts +0 -1
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/index.js +0 -21
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/package-lock.json +0 -597
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/package.json +0 -26
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/AllSolidityTypes.ts +0 -13940
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/AllSolidityTypes__factory.ts +0 -31
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/index.ts +0 -4
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/quantumcoin-shims.d.ts +0 -25
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/src/types.ts +0 -4
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/test/e2e/AllSolidityTypes.e2e.test.js +0 -77
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/test/e2e/AllSolidityTypes.extra.test.js +0 -195
- package/test/e2e/generated-sdks/all-solidity-types/all-solidity-types-ts/tsconfig.json +0 -18
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/README.md +0 -74
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/artifacts/SimpleERC20.abi.json +0 -245
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/artifacts/SimpleERC20.bin +0 -1
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/_test-wallet.js +0 -17
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/_test-wallet.ts +0 -10
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/deploy.js +0 -41
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/deploy.ts +0 -41
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/events.js +0 -36
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/events.ts +0 -36
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/offline-signing.js +0 -82
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/offline-signing.ts +0 -80
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/read-operations.js +0 -46
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/read-operations.ts +0 -44
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/write-operations.js +0 -44
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/examples/write-operations.ts +0 -44
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/index.d.ts +0 -1
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/index.js +0 -16
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/package-lock.json +0 -597
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/package.json +0 -25
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/SimpleERC20.d.ts +0 -24
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/SimpleERC20.js +0 -378
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/SimpleERC20__factory.d.ts +0 -10
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/SimpleERC20__factory.js +0 -31
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/index.d.ts +0 -4
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/index.js +0 -5
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/quantumcoin-shims.d.ts +0 -25
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/types.d.ts +0 -3
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/src/types.js +0 -3
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-js/test/e2e/SimpleERC20.e2e.test.js +0 -90
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/README.md +0 -74
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/artifacts/SimpleERC20.abi.json +0 -245
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/artifacts/SimpleERC20.bin +0 -1
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/_test-wallet.js +0 -17
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/_test-wallet.ts +0 -10
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/deploy.js +0 -41
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/deploy.ts +0 -41
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/events.js +0 -36
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/events.ts +0 -36
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/offline-signing.js +0 -82
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/offline-signing.ts +0 -80
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/read-operations.js +0 -46
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/read-operations.ts +0 -44
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/write-operations.js +0 -44
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/examples/write-operations.ts +0 -44
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/index.d.ts +0 -1
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/index.js +0 -16
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/package-lock.json +0 -597
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/package.json +0 -26
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/SimpleERC20.ts +0 -361
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/SimpleERC20__factory.ts +0 -30
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/index.ts +0 -4
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/quantumcoin-shims.d.ts +0 -25
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/src/types.ts +0 -4
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/test/e2e/SimpleERC20.e2e.test.js +0 -90
- package/test/e2e/generated-sdks/simple-erc20/simple-erc20-ts/tsconfig.json +0 -18
- package/test/e2e/generator-interface.e2e.test.js +0 -165
- package/test/e2e/generator-interface.e2e.test.ts +0 -160
- package/test/e2e/helpers.js +0 -59
- package/test/e2e/signing-context-and-fee.e2e.test.js +0 -141
- package/test/e2e/signing-context-and-fee.e2e.test.ts +0 -128
- package/test/e2e/simple-erc20.generated-sdks.e2e.test.js +0 -168
- package/test/e2e/simple-erc20.generated-sdks.e2e.test.ts +0 -141
- package/test/e2e/transactional.test.js +0 -245
- package/test/e2e/transactional.test.ts +0 -208
- package/test/e2e/typed-generator.e2e.test.js +0 -407
- package/test/e2e/typed-generator.e2e.test.ts +0 -337
- package/test/fixtures/ConstructorParam.sol +0 -23
- package/test/fixtures/MultiContracts.sol +0 -37
- package/test/fixtures/SimpleStorage.sol +0 -18
- package/test/fixtures/StakingContract.abi.json +0 -1
- package/test/integration/ipc-provider.test.js +0 -49
- package/test/integration/ipc-provider.test.ts +0 -44
- package/test/integration/provider.test.js +0 -88
- package/test/integration/provider.test.ts +0 -85
- package/test/integration/ws-provider.test.js +0 -41
- package/test/integration/ws-provider.test.ts +0 -38
- package/test/security/abi-decoder-bounds.test.js +0 -122
- package/test/security/contract-overrides.test.js +0 -112
- package/test/security/generator-injection.test.js +0 -195
- package/test/security/malformed-input.test.js +0 -330
- package/test/security/malformed-input.test.ts +0 -35
- package/test/security/rpc-numeric-bounds.test.js +0 -81
- package/test/security/rpc-trust.test.js +0 -202
- package/test/unit/_encrypted-output.txt +0 -6
- package/test/unit/_log-encrypted-jsons.js +0 -45
- package/test/unit/_write-keystore-fixture.js +0 -16
- package/test/unit/abi-interface.test.js +0 -110
- package/test/unit/abi-interface.test.ts +0 -109
- package/test/unit/address-wallet.test.js +0 -945
- package/test/unit/address-wallet.test.ts +0 -899
- package/test/unit/browser-provider.test.js +0 -85
- package/test/unit/browser-provider.test.ts +0 -79
- package/test/unit/contract.test.js +0 -85
- package/test/unit/contract.test.ts +0 -83
- package/test/unit/encoding-units-rlp.test.js +0 -127
- package/test/unit/encoding-units-rlp.test.ts +0 -91
- package/test/unit/errors.test.js +0 -77
- package/test/unit/errors.test.ts +0 -76
- package/test/unit/filter-by-blockhash.test.js +0 -55
- package/test/unit/filter-by-blockhash.test.ts +0 -54
- package/test/unit/fixednumber.test.js +0 -656
- package/test/unit/fixednumber.test.ts +0 -660
- package/test/unit/fixtures/encrypted-keystores-48-32-36.js +0 -9
- package/test/unit/generate-contract-cli.test.js +0 -42
- package/test/unit/generate-contract-cli.test.ts +0 -41
- package/test/unit/generate-sdk-artifacts-json.test.js +0 -113
- package/test/unit/generate-sdk-artifacts-json.test.ts +0 -110
- package/test/unit/generator.test.js +0 -149
- package/test/unit/generator.test.ts +0 -148
- package/test/unit/hashing.test.js +0 -64
- package/test/unit/hashing.test.ts +0 -63
- package/test/unit/init.test.js +0 -39
- package/test/unit/init.test.ts +0 -38
- package/test/unit/interface.test.js +0 -56
- package/test/unit/interface.test.ts +0 -54
- package/test/unit/internal-hex.test.js +0 -81
- package/test/unit/internal-hex.test.ts +0 -80
- package/test/unit/populate-transaction.test.js +0 -98
- package/test/unit/populate-transaction.test.ts +0 -64
- package/test/unit/providers.test.js +0 -305
- package/test/unit/providers.test.ts +0 -304
- package/test/unit/result.test.js +0 -80
- package/test/unit/result.test.ts +0 -79
- package/test/unit/solidity-types.test.js +0 -49
- package/test/unit/solidity-types.test.ts +0 -39
- package/test/unit/utils.test.js +0 -57
- package/test/unit/utils.test.ts +0 -56
- package/test/verbose-logger.js +0 -74
- package/tsconfig.build.json +0 -14
|
@@ -1,113 +1,121 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BaseContract placeholder (ethers-like).
|
|
3
|
-
*/
|
|
4
|
-
export class BaseContract {
|
|
5
|
-
}
|
|
6
|
-
export class Contract extends BaseContract {
|
|
7
|
-
static from(target: any, abi: any, runner: any): Contract;
|
|
8
|
-
/**
|
|
9
|
-
* @param {string} address
|
|
10
|
-
* @param {any[]|Interface} abi
|
|
11
|
-
* @param {any=} providerOrSigner
|
|
12
|
-
* @param {string=} bytecode
|
|
13
|
-
*/
|
|
14
|
-
constructor(address: string, abi: any[] | Interface, providerOrSigner?: any | undefined, bytecode?: string | undefined);
|
|
15
|
-
address: string;
|
|
16
|
-
target: string;
|
|
17
|
-
bytecode: string;
|
|
18
|
-
interface: Interface;
|
|
19
|
-
provider: any;
|
|
20
|
-
signer: any;
|
|
21
|
-
runner: any;
|
|
22
|
-
_listeners: Map<any, any>;
|
|
23
|
-
populateTransaction: {};
|
|
24
|
-
getAddress(): string;
|
|
25
|
-
/**
|
|
26
|
-
* Invoke a contract function, dispatching to call() or send().
|
|
27
|
-
* @param {string} methodName
|
|
28
|
-
* @param {any[]} args
|
|
29
|
-
* @returns {Promise<any>}
|
|
30
|
-
*/
|
|
31
|
-
_invoke(methodName: string, args: any[]): Promise<any>;
|
|
32
|
-
/**
|
|
33
|
-
* Build an unsigned transaction request for a contract method call.
|
|
34
|
-
* @param {string} methodName
|
|
35
|
-
* @param {any[]} args
|
|
36
|
-
* @returns {Promise<import("../providers/provider").TransactionRequest>}
|
|
37
|
-
*/
|
|
38
|
-
_populate(methodName: string, args: any[]): Promise<import("../providers/provider").TransactionRequest>;
|
|
39
|
-
/**
|
|
40
|
-
* Perform a read-only call.
|
|
41
|
-
* @param {string} methodName
|
|
42
|
-
* @param {any[]} args
|
|
43
|
-
* @param {import("../providers/provider").TransactionRequest=} overrides
|
|
44
|
-
* @returns {Promise<any>}
|
|
45
|
-
*/
|
|
46
|
-
call(methodName: string, args: any[], overrides?: import("../providers/provider").TransactionRequest | undefined): Promise<any>;
|
|
47
|
-
/**
|
|
48
|
-
* Send a state-changing transaction.
|
|
49
|
-
* @param {string} methodName
|
|
50
|
-
* @param {any[]} args
|
|
51
|
-
* @param {import("../providers/provider").TransactionRequest=} overrides
|
|
52
|
-
* @returns {Promise<ContractTransactionResponse>}
|
|
53
|
-
*/
|
|
54
|
-
send(methodName: string, args: any[], overrides?: import("../providers/provider").TransactionRequest | undefined): Promise<ContractTransactionResponse>;
|
|
55
|
-
/**
|
|
56
|
-
* Query logs for an event.
|
|
57
|
-
* @param {any} event
|
|
58
|
-
* @param {number|string=} fromBlock
|
|
59
|
-
* @param {number|string=} toBlock
|
|
60
|
-
* @returns {Promise<EventLog[]>}
|
|
61
|
-
*/
|
|
62
|
-
queryFilter(event: any, fromBlock?: (number | string) | undefined, toBlock?: (number | string) | undefined): Promise<EventLog[]>;
|
|
63
|
-
on(event: any, callback: any): this;
|
|
64
|
-
once(event: any, callback: any): this;
|
|
65
|
-
removeListener(event: any, callback: any): this;
|
|
66
|
-
removeAllListeners(event: any): this;
|
|
67
|
-
connect(signerOrProvider: any): Contract;
|
|
68
|
-
attach(address: any): Contract;
|
|
69
|
-
deployTransaction(): any;
|
|
70
|
-
getTransactionReceipt(hash: any): Promise<ContractTransactionReceipt>;
|
|
71
|
-
waitForDeployment(): Promise<this>;
|
|
72
|
-
getDeployedCode(): Promise<any>;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* ContractTransactionResponse (aliasing provider TransactionResponse).
|
|
76
|
-
*/
|
|
77
|
-
export class ContractTransactionResponse {
|
|
78
|
-
/**
|
|
79
|
-
* @param {any} tx
|
|
80
|
-
*/
|
|
81
|
-
constructor(tx: any);
|
|
82
|
-
_tx: any;
|
|
83
|
-
/**
|
|
84
|
-
* Wait for confirmations (delegated to underlying TransactionResponse).
|
|
85
|
-
* @param {number=} confirmations
|
|
86
|
-
* @param {number=} timeoutMs
|
|
87
|
-
* @returns {Promise<any>}
|
|
88
|
-
*/
|
|
89
|
-
wait(confirmations?: number | undefined, timeoutMs?: number | undefined): Promise<any>;
|
|
90
|
-
/**
|
|
91
|
-
* Return the underlying transaction response object.
|
|
92
|
-
* @returns {any}
|
|
93
|
-
*/
|
|
94
|
-
getTransaction(): any;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* ContractTransactionReceipt (aliasing provider TransactionReceipt).
|
|
98
|
-
*/
|
|
99
|
-
export class ContractTransactionReceipt {
|
|
100
|
-
/**
|
|
101
|
-
* @param {any} receipt
|
|
102
|
-
*/
|
|
103
|
-
constructor(receipt: any);
|
|
104
|
-
getEvent(eventName: any): any;
|
|
105
|
-
getEvents(eventName: any): any;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* EventLog placeholder.
|
|
109
|
-
*/
|
|
110
|
-
export class EventLog {
|
|
111
|
-
constructor(log: any);
|
|
112
|
-
}
|
|
113
|
-
|
|
1
|
+
/**
|
|
2
|
+
* BaseContract placeholder (ethers-like).
|
|
3
|
+
*/
|
|
4
|
+
export class BaseContract {
|
|
5
|
+
}
|
|
6
|
+
export class Contract extends BaseContract {
|
|
7
|
+
static from(target: any, abi: any, runner: any): Contract;
|
|
8
|
+
/**
|
|
9
|
+
* @param {string} address
|
|
10
|
+
* @param {any[]|Interface} abi
|
|
11
|
+
* @param {any=} providerOrSigner
|
|
12
|
+
* @param {string=} bytecode
|
|
13
|
+
*/
|
|
14
|
+
constructor(address: string, abi: any[] | Interface, providerOrSigner?: any | undefined, bytecode?: string | undefined);
|
|
15
|
+
address: string;
|
|
16
|
+
target: string;
|
|
17
|
+
bytecode: string | null;
|
|
18
|
+
interface: Interface;
|
|
19
|
+
provider: any;
|
|
20
|
+
signer: any;
|
|
21
|
+
runner: any;
|
|
22
|
+
_listeners: Map<any, any>;
|
|
23
|
+
populateTransaction: {};
|
|
24
|
+
getAddress(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Invoke a contract function, dispatching to call() or send().
|
|
27
|
+
* @param {string} methodName
|
|
28
|
+
* @param {any[]} args
|
|
29
|
+
* @returns {Promise<any>}
|
|
30
|
+
*/
|
|
31
|
+
_invoke(methodName: string, args: any[]): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* Build an unsigned transaction request for a contract method call.
|
|
34
|
+
* @param {string} methodName
|
|
35
|
+
* @param {any[]} args
|
|
36
|
+
* @returns {Promise<import("../providers/provider").TransactionRequest>}
|
|
37
|
+
*/
|
|
38
|
+
_populate(methodName: string, args: any[]): Promise<import("../providers/provider").TransactionRequest>;
|
|
39
|
+
/**
|
|
40
|
+
* Perform a read-only call.
|
|
41
|
+
* @param {string} methodName
|
|
42
|
+
* @param {any[]} args
|
|
43
|
+
* @param {import("../providers/provider").TransactionRequest=} overrides
|
|
44
|
+
* @returns {Promise<any>}
|
|
45
|
+
*/
|
|
46
|
+
call(methodName: string, args: any[], overrides?: import("../providers/provider").TransactionRequest | undefined): Promise<any>;
|
|
47
|
+
/**
|
|
48
|
+
* Send a state-changing transaction.
|
|
49
|
+
* @param {string} methodName
|
|
50
|
+
* @param {any[]} args
|
|
51
|
+
* @param {import("../providers/provider").TransactionRequest=} overrides
|
|
52
|
+
* @returns {Promise<ContractTransactionResponse>}
|
|
53
|
+
*/
|
|
54
|
+
send(methodName: string, args: any[], overrides?: import("../providers/provider").TransactionRequest | undefined): Promise<ContractTransactionResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Query logs for an event.
|
|
57
|
+
* @param {any} event
|
|
58
|
+
* @param {number|string=} fromBlock
|
|
59
|
+
* @param {number|string=} toBlock
|
|
60
|
+
* @returns {Promise<EventLog[]>}
|
|
61
|
+
*/
|
|
62
|
+
queryFilter(event: any, fromBlock?: (number | string) | undefined, toBlock?: (number | string) | undefined): Promise<EventLog[]>;
|
|
63
|
+
on(event: any, callback: any): this;
|
|
64
|
+
once(event: any, callback: any): this;
|
|
65
|
+
removeListener(event: any, callback: any): this;
|
|
66
|
+
removeAllListeners(event: any): this;
|
|
67
|
+
connect(signerOrProvider: any): Contract;
|
|
68
|
+
attach(address: any): Contract;
|
|
69
|
+
deployTransaction(): any;
|
|
70
|
+
getTransactionReceipt(hash: any): Promise<ContractTransactionReceipt | null>;
|
|
71
|
+
waitForDeployment(): Promise<this>;
|
|
72
|
+
getDeployedCode(): Promise<any>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* ContractTransactionResponse (aliasing provider TransactionResponse).
|
|
76
|
+
*/
|
|
77
|
+
export class ContractTransactionResponse {
|
|
78
|
+
/**
|
|
79
|
+
* @param {any} tx
|
|
80
|
+
*/
|
|
81
|
+
constructor(tx: any);
|
|
82
|
+
_tx: any;
|
|
83
|
+
/**
|
|
84
|
+
* Wait for confirmations (delegated to underlying TransactionResponse).
|
|
85
|
+
* @param {number=} confirmations
|
|
86
|
+
* @param {number=} timeoutMs
|
|
87
|
+
* @returns {Promise<any>}
|
|
88
|
+
*/
|
|
89
|
+
wait(confirmations?: number | undefined, timeoutMs?: number | undefined): Promise<any>;
|
|
90
|
+
/**
|
|
91
|
+
* Return the underlying transaction response object.
|
|
92
|
+
* @returns {any}
|
|
93
|
+
*/
|
|
94
|
+
getTransaction(): any;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* ContractTransactionReceipt (aliasing provider TransactionReceipt).
|
|
98
|
+
*/
|
|
99
|
+
export class ContractTransactionReceipt {
|
|
100
|
+
/**
|
|
101
|
+
* @param {any} receipt
|
|
102
|
+
*/
|
|
103
|
+
constructor(receipt: any);
|
|
104
|
+
getEvent(eventName: any): any;
|
|
105
|
+
getEvents(eventName: any): any;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* EventLog placeholder.
|
|
109
|
+
*/
|
|
110
|
+
export class EventLog {
|
|
111
|
+
constructor(log: any);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Return a copy of `overrides` containing only the allow-listed fields.
|
|
115
|
+
* Drops `to`, `data`, `from`, and any unknown/prototype keys so the protected
|
|
116
|
+
* fields computed by the contract layer always win.
|
|
117
|
+
* @param {any} overrides
|
|
118
|
+
* @returns {Record<string, any>}
|
|
119
|
+
*/
|
|
120
|
+
export function _sanitizeOverrides(overrides: any): Record<string, any>;
|
|
121
|
+
import { Interface } from "../abi/interface";
|
package/src/contract/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const _exports: {
|
|
2
2
|
ContractFactory: typeof import("./contract-factory").ContractFactory;
|
|
3
|
+
_sanitizeOverrides(overrides: any): Record<string, any>;
|
|
3
4
|
BaseContract: typeof import("./contract").BaseContract;
|
|
4
5
|
Contract: typeof import("./contract").Contract;
|
|
5
6
|
ContractTransactionResponse: typeof import("./contract").ContractTransactionResponse;
|
package/src/errors/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ErrorCode = "INVALID_ARGUMENT" | "NUMERIC_FAULT" | "BUFFER_OVERRUN" | "CALL_EXCEPTION" | "UNKNOWN_ERROR" | "NOT_IMPLEMENTED";
|
|
1
|
+
export type ErrorCode = "INVALID_ARGUMENT" | "NUMERIC_FAULT" | "BUFFER_OVERRUN" | "CALL_EXCEPTION" | "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "NOT_INITIALIZED";
|
|
2
2
|
/**
|
|
3
3
|
* @fileoverview Error helpers and error classes.
|
|
4
4
|
*
|
|
@@ -8,7 +8,7 @@ export type ErrorCode = "INVALID_ARGUMENT" | "NUMERIC_FAULT" | "BUFFER_OVERRUN"
|
|
|
8
8
|
* - errors may include extra fields depending on the failure
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
|
-
* @typedef {"INVALID_ARGUMENT"|"NUMERIC_FAULT"|"BUFFER_OVERRUN"|"CALL_EXCEPTION"|"UNKNOWN_ERROR"|"NOT_IMPLEMENTED"} ErrorCode
|
|
11
|
+
* @typedef {"INVALID_ARGUMENT"|"NUMERIC_FAULT"|"BUFFER_OVERRUN"|"CALL_EXCEPTION"|"UNKNOWN_ERROR"|"NOT_IMPLEMENTED"|"NOT_INITIALIZED"} ErrorCode
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
14
|
* Returns true if the error matches the given code.
|
|
@@ -51,6 +51,14 @@ export function assert(check: any, message: string, code: ErrorCode, info?: Reco
|
|
|
51
51
|
* @param {any} value
|
|
52
52
|
*/
|
|
53
53
|
export function assertArgument(check: any, message: string, name: string, value: any): void;
|
|
54
|
+
/**
|
|
55
|
+
* Assert an argument constraint for sensitive material (keys, seeds, passwords).
|
|
56
|
+
* Uses "[REDACTED]" instead of the actual value to prevent leaking secrets in logs.
|
|
57
|
+
* @param {any} check
|
|
58
|
+
* @param {string} message
|
|
59
|
+
* @param {string} name
|
|
60
|
+
*/
|
|
61
|
+
export function assertSecretArgument(check: any, message: string, name: string): void;
|
|
54
62
|
/**
|
|
55
63
|
* Provider error.
|
|
56
64
|
*/
|
package/src/errors/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @typedef {"INVALID_ARGUMENT"|"NUMERIC_FAULT"|"BUFFER_OVERRUN"|"CALL_EXCEPTION"|"UNKNOWN_ERROR"|"NOT_IMPLEMENTED"} ErrorCode
|
|
11
|
+
* @typedef {"INVALID_ARGUMENT"|"NUMERIC_FAULT"|"BUFFER_OVERRUN"|"CALL_EXCEPTION"|"UNKNOWN_ERROR"|"NOT_IMPLEMENTED"|"NOT_INITIALIZED"} ErrorCode
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
package/src/generator/index.d.ts
CHANGED
|
@@ -1,81 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
declare namespace _exports {
|
|
2
|
+
export { GenerateOptions };
|
|
3
|
+
}
|
|
4
|
+
declare namespace _exports {
|
|
5
|
+
export { generate };
|
|
6
|
+
export { generateFromArtifacts };
|
|
7
|
+
export { generateTransactionalTestJs };
|
|
8
|
+
export { generateAllContractsTransactionalTestJs };
|
|
9
|
+
export { _assertSafeIdentifier as assertSafeIdentifier };
|
|
10
|
+
}
|
|
11
|
+
export = _exports;
|
|
12
|
+
type GenerateOptions = {
|
|
13
|
+
abiPath: string;
|
|
14
|
+
binPath: string;
|
|
15
|
+
outDir: string;
|
|
16
|
+
contractName: string;
|
|
17
|
+
packageName?: string | undefined;
|
|
18
|
+
createPackage?: boolean | undefined;
|
|
19
|
+
dependencies?: Record<string, string> | undefined;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Generate typed contract files.
|
|
23
|
+
* @param {GenerateOptions} opts
|
|
24
|
+
* @returns {{ contractFile: string, factoryFile: string, typesFile: string, indexFile: string }}
|
|
25
|
+
*/
|
|
26
|
+
declare function generate(opts: GenerateOptions): {
|
|
27
|
+
contractFile: string;
|
|
28
|
+
factoryFile: string;
|
|
29
|
+
typesFile: string;
|
|
30
|
+
indexFile: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @typedef {Object} GenerateOptions
|
|
34
|
+
* @property {string} abiPath
|
|
35
|
+
* @property {string} binPath
|
|
36
|
+
* @property {string} outDir
|
|
37
|
+
* @property {string} contractName
|
|
38
|
+
* @property {string=} packageName
|
|
39
|
+
* @property {boolean=} createPackage
|
|
40
|
+
* @property {Record<string,string>=} dependencies
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Generate multiple typed contract files.
|
|
44
|
+
* @param {{ outDir: string, artifacts: Array<{ contractName: string, abi: any[], bytecode: string }> }} opts
|
|
45
|
+
* @returns {{ contracts: Array<{ contractFile: string, factoryFile: string }>, typesFile: string, indexFile: string }}
|
|
46
|
+
*/
|
|
47
|
+
declare function generateFromArtifacts(opts: {
|
|
48
|
+
outDir: string;
|
|
49
|
+
artifacts: Array<{
|
|
50
|
+
contractName: string;
|
|
51
|
+
abi: any[];
|
|
52
|
+
bytecode: string;
|
|
53
|
+
}>;
|
|
54
|
+
}): {
|
|
55
|
+
contracts: Array<{
|
|
56
|
+
contractFile: string;
|
|
57
|
+
factoryFile: string;
|
|
58
|
+
}>;
|
|
59
|
+
typesFile: string;
|
|
60
|
+
indexFile: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Generate a transactional e2e test file (JavaScript) for the typed contract package.
|
|
64
|
+
* The test deploys the contract with constructor args (if any) and invokes one write method.
|
|
65
|
+
*
|
|
66
|
+
* When `bytecode` is omitted, empty, or `"0x"` the contract is treated as an interface:
|
|
67
|
+
* the generated test still attempts the deploy (the receipt-status assertion still validates
|
|
68
|
+
* SDK wrapper wiring) but the post-deploy `provider.getCode(...)` bytecode assertion is
|
|
69
|
+
* skipped, since interfaces deploy with no runtime code by design.
|
|
70
|
+
*
|
|
71
|
+
* @param {{ contractName: string, abi: any[], bytecode?: string }} opts
|
|
72
|
+
* @returns {string}
|
|
73
|
+
*/
|
|
74
|
+
declare function generateTransactionalTestJs(opts: {
|
|
75
|
+
contractName: string;
|
|
76
|
+
abi: any[];
|
|
77
|
+
bytecode?: string;
|
|
78
|
+
}): string;
|
|
79
|
+
/**
|
|
80
|
+
* Generate a single transactional e2e test that deploys and invokes methods on ALL contracts.
|
|
81
|
+
* Used when the package has multiple contracts so one test exercises every contract.
|
|
82
|
+
*
|
|
83
|
+
* Accepts `bytecode` per artifact for forward-compatibility, although the multi-contract
|
|
84
|
+
* template currently emits no `getCode` assertion (so the value is not yet consumed).
|
|
85
|
+
*
|
|
86
|
+
* @param {{ artifacts: Array<{ contractName: string, abi: any[], bytecode?: string }> }} opts
|
|
87
|
+
* @returns {string}
|
|
88
|
+
*/
|
|
89
|
+
declare function generateAllContractsTransactionalTestJs(opts: {
|
|
90
|
+
artifacts: Array<{
|
|
91
|
+
contractName: string;
|
|
92
|
+
abi: any[];
|
|
93
|
+
bytecode?: string;
|
|
94
|
+
}>;
|
|
95
|
+
}): string;
|
|
96
|
+
/**
|
|
97
|
+
* Assert that `name` is safe to interpolate verbatim into generated source code
|
|
98
|
+
* (class names, function names, type names, require/import specifiers, file names).
|
|
99
|
+
*
|
|
100
|
+
* This is the primary defense against code-injection and path-traversal
|
|
101
|
+
* via attacker-controlled ABI / artifact `name` fields: only strict JS/TS
|
|
102
|
+
* identifiers are allowed, which by construction cannot contain quotes, newlines,
|
|
103
|
+
* path separators, `..`, or other breakout characters.
|
|
104
|
+
*
|
|
105
|
+
* @param {any} name
|
|
106
|
+
* @param {string=} kind Human-readable description for error messages.
|
|
107
|
+
* @returns {string} the validated name
|
|
108
|
+
*/
|
|
109
|
+
declare function _assertSafeIdentifier(name: any, kind?: string | undefined): string;
|