quantumcoin 7.0.15 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-SDK.md +79 -0
- package/README.md +48 -1
- package/generate-sdk.js +8 -6
- package/package.json +26 -6
- 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 +128 -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 +97 -76
- package/src/utils/hashing.js +95 -177
- package/src/utils/index.d.ts +2 -1
- package/src/utils/rlp.js +1 -1
- package/src/wallet/index.d.ts +1 -0
- package/src/wallet/wallet.d.ts +85 -29
- package/src/wallet/wallet.js +114 -4
- 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
package/README-SDK.md
CHANGED
|
@@ -12,6 +12,7 @@ This document is the **complete, detailed SDK reference** for QuantumCoin.js (et
|
|
|
12
12
|
- [Install](#install)
|
|
13
13
|
- [Initialization (required)](#initialization-required)
|
|
14
14
|
- [Key differences vs ethers/Ethereum](#key-differences-vs-ethersethereum)
|
|
15
|
+
- [Platform support (Node.js and browser)](#platform-support-nodejs-and-browser)
|
|
15
16
|
- [Configuration (`quantumcoin/config`)](#configuration-quantumcoinconfig)
|
|
16
17
|
- [`Config`](#config)
|
|
17
18
|
- [`Initialize(config)`](#initializeconfig)
|
|
@@ -100,6 +101,43 @@ await Initialize(new Config(123123, "https://public.rpc.quantumcoinapi.com"));
|
|
|
100
101
|
- **Signing and ABI encoding/decoding** are delegated to `quantum-coin-js-sdk` (WASM)
|
|
101
102
|
- **Initialize must be called** once at startup for wallet/address/ABI helpers
|
|
102
103
|
|
|
104
|
+
### Platform support (Node.js and browser)
|
|
105
|
+
|
|
106
|
+
QuantumCoin.js is **platform agnostic** and runs in both Node.js (20+) and modern
|
|
107
|
+
browsers. It does **not** depend on Node's built-in `crypto` module: all
|
|
108
|
+
cryptographic primitives (`keccak256`, `sha256`, `sha512`, `ripemd160`,
|
|
109
|
+
`computeHmac`, `pbkdf2`, `scrypt`/`scryptSync`) are provided by
|
|
110
|
+
`quantum-coin-js-sdk` (WebAssembly), and `randomBytes` uses the standard Web
|
|
111
|
+
Crypto API (`globalThis.crypto`).
|
|
112
|
+
|
|
113
|
+
Because the crypto primitives come from `quantum-coin-js-sdk`, **the hashing and
|
|
114
|
+
KDF helpers require `Initialize()` to have completed** before use. Calling them
|
|
115
|
+
beforehand throws a `NOT_INITIALIZED` error:
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
const qc = require("quantumcoin");
|
|
119
|
+
const { Initialize } = require("quantumcoin/config");
|
|
120
|
+
|
|
121
|
+
await Initialize(null);
|
|
122
|
+
qc.keccak256(qc.toUtf8Bytes("hello")); // ok after Initialize()
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Notes for browser usage:
|
|
126
|
+
|
|
127
|
+
- Bundle your app with a browser bundler (esbuild, webpack, Vite, Rollup, etc.).
|
|
128
|
+
`quantum-coin-js-sdk` ships its WASM embedded, so no extra asset fetching or
|
|
129
|
+
`wasm_exec.js` wiring is required — just `require`/`import` the SDK and call
|
|
130
|
+
`Initialize()`.
|
|
131
|
+
- The `IpcSocketProvider` (Unix domain socket / named pipe transport) is
|
|
132
|
+
**Node-only**; it lazily loads `node:net` and throws `NOT_IMPLEMENTED` in the
|
|
133
|
+
browser. `JsonRpcProvider` (via `fetch`), `WebSocketProvider` (via
|
|
134
|
+
`globalThis.WebSocket`) and `BrowserProvider` (EIP-1193) all work in browsers.
|
|
135
|
+
The package's `browser` field maps `node:net` to `false` so bundlers can drop
|
|
136
|
+
the IPC code path.
|
|
137
|
+
|
|
138
|
+
The browser surface is validated by an automated headless-browser suite
|
|
139
|
+
(`npm run test:browser`, Playwright + esbuild).
|
|
140
|
+
|
|
103
141
|
## Configuration (`quantumcoin/config`)
|
|
104
142
|
|
|
105
143
|
### `Config`
|
|
@@ -381,6 +419,8 @@ Core signing implementation.
|
|
|
381
419
|
- `getAddress(): Promise<string>`
|
|
382
420
|
- `signTransaction(tx: TransactionRequest): Promise<string>`
|
|
383
421
|
- `sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>`
|
|
422
|
+
- `signMessageSync(message: string | Uint8Array, signingContext?: number | null): string` — signs an arbitrary message using the EIP-191 personal-message digest (see [Message signing](#message-signing-eip-191)). Returns an opaque post-quantum signature blob (0x hex) that embeds the signer's public key. The message may be at most 1 MiB once UTF-8 encoded (`INVALID_ARGUMENT` otherwise). Optional `signingContext`: omitted/`null` derives the compact context from the key type (`0` for keyType 3, `1` for keyType 5); `2` selects the full-signature scheme for a keyType 3 wallet.
|
|
423
|
+
- `signMessage(message: string | Uint8Array, signingContext?: number | null): Promise<string>` — async wrapper over `signMessageSync` (honors the ethers `Signer` interface contract; the underlying signing is synchronous).
|
|
384
424
|
|
|
385
425
|
### `Wallet`
|
|
386
426
|
|
|
@@ -449,6 +489,38 @@ Address-only signer.
|
|
|
449
489
|
- `new VoidSigner(address: string, provider?: AbstractProvider)`
|
|
450
490
|
- `getAddress(): Promise<string>`
|
|
451
491
|
|
|
492
|
+
### Message signing (EIP-191)
|
|
493
|
+
|
|
494
|
+
Arbitrary-message signing and verification, adapted from ethers for
|
|
495
|
+
QuantumCoin's post-quantum cryptography.
|
|
496
|
+
|
|
497
|
+
- `Wallet.signMessage(message, signingContext?)` / `Wallet.signMessageSync(message, signingContext?)` — see [`BaseWallet`](#basewallet).
|
|
498
|
+
- `hashMessage(message: string | Uint8Array): string` — the EIP-191 digest,
|
|
499
|
+
`keccak256("\x19Ethereum Signed Message:\n" + len + message)` (32 bytes). Same
|
|
500
|
+
prefix as Ethereum, so it matches `personal_sign` in `quantum-coin-go`. Strings
|
|
501
|
+
are UTF-8 encoded; the length prefix counts message **bytes**.
|
|
502
|
+
- `verifyMessage(message: string | Uint8Array, signature: string | Uint8Array): string`
|
|
503
|
+
— **synchronous** (matches ethers; there is no `verifyMessageSync`). Returns the
|
|
504
|
+
recovered 32-byte signer address; throws `INVALID_ARGUMENT` if the signature is
|
|
505
|
+
malformed or does not verify.
|
|
506
|
+
|
|
507
|
+
```js
|
|
508
|
+
const { Wallet, verifyMessage } = require("quantumcoin");
|
|
509
|
+
const wallet = Wallet.createRandom();
|
|
510
|
+
const sig = await wallet.signMessage("Hello Joe");
|
|
511
|
+
verifyMessage("Hello Joe", sig) === wallet.address; // true
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
**Key differences vs Ethereum**
|
|
515
|
+
|
|
516
|
+
| Property | Ethereum | QuantumCoin |
|
|
517
|
+
| --- | --- | --- |
|
|
518
|
+
| Message prefix / hash | EIP-191 + keccak256 | Identical EIP-191 + keccak256 |
|
|
519
|
+
| Signature | 65-byte `(r, s, v)` | Opaque multi-KB blob (scheme id byte + **embedded public key**) |
|
|
520
|
+
| Address size | 20 bytes | 32 bytes |
|
|
521
|
+
| Recovery | ECDSA `ecrecover` | Extract embedded public key + PQC verify (no `ecrecover`) |
|
|
522
|
+
| `signTypedData` (EIP-712) | Supported | Not yet supported |
|
|
523
|
+
|
|
452
524
|
## Contracts
|
|
453
525
|
|
|
454
526
|
### `Contract`
|
|
@@ -641,12 +713,19 @@ const asOutput: Uint256 = 123n;
|
|
|
641
713
|
- `sha512(data: BytesLike): string`
|
|
642
714
|
- `ripemd160(data: BytesLike): string`
|
|
643
715
|
- `id(text: string): string` (=`keccak256(utf8Bytes(text))`)
|
|
716
|
+
- `hashMessage(message: BytesLike): string` — EIP-191 personal-message digest, `keccak256("\x19Ethereum Signed Message:\n" + len + message)`. See [Message signing](#message-signing-eip-191).
|
|
644
717
|
- `randomBytes(length: number): Uint8Array`
|
|
645
718
|
- `computeHmac(algorithm: string, key: BytesLike, data: BytesLike): string`
|
|
646
719
|
- `pbkdf2(password: BytesLike, salt: BytesLike, iterations: number, keylen: number, algorithm?: string): string`
|
|
647
720
|
- `scrypt(password: BytesLike, salt: BytesLike, N: number, r: number, p: number, dkLen: number): Promise<string>`
|
|
648
721
|
- `scryptSync(password: BytesLike, salt: BytesLike, N: number, r: number, p: number, dkLen: number): string`
|
|
649
722
|
|
|
723
|
+
> These helpers are backed by `quantum-coin-js-sdk` (WASM) and therefore require
|
|
724
|
+
> `Initialize()` to have completed first; otherwise they throw a
|
|
725
|
+
> `NOT_INITIALIZED` error. `computeHmac` and `pbkdf2` support the `"sha256"`
|
|
726
|
+
> (default) and `"sha512"` algorithms. `randomBytes` uses the Web Crypto API and
|
|
727
|
+
> works without initialization.
|
|
728
|
+
|
|
650
729
|
### Units
|
|
651
730
|
|
|
652
731
|
- `formatUnits(value: BigNumberish, decimals?: number): string`
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## QuantumCoin.js
|
|
6
6
|
|
|
7
|
-
QuantumCoin.js is
|
|
7
|
+
QuantumCoin.js is a SDK for the QuantumCoin blockchain that maintains close compatibility with **ethers.js v6**.
|
|
8
8
|
|
|
9
9
|
Key differences vs Ethereum/ethers:
|
|
10
10
|
|
|
@@ -86,6 +86,52 @@ const restored = Wallet.fromEncryptedJsonSync(json, "mySecurePassword123");
|
|
|
86
86
|
console.log(restored.address);
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
## Message signing (EIP-191 / `personal_sign`)
|
|
90
|
+
|
|
91
|
+
Sign and verify arbitrary messages using QuantumCoin's post-quantum keys. The
|
|
92
|
+
message digest uses the exact same EIP-191 prefix as Ethereum
|
|
93
|
+
(`keccak256("\x19Ethereum Signed Message:\n" + len + message)`), so it is
|
|
94
|
+
byte-for-byte compatible with `personal_sign` in `quantum-coin-go`.
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
const { Wallet, verifyMessage, hashMessage } = require("quantumcoin");
|
|
98
|
+
const { Initialize } = require("quantumcoin/config");
|
|
99
|
+
|
|
100
|
+
await Initialize(null);
|
|
101
|
+
|
|
102
|
+
const wallet = Wallet.createRandom();
|
|
103
|
+
|
|
104
|
+
// async (ethers Signer contract) or sync
|
|
105
|
+
const signature = await wallet.signMessage("Hello Joe");
|
|
106
|
+
const signatureSync = wallet.signMessageSync("Hello Joe");
|
|
107
|
+
|
|
108
|
+
// verifyMessage is synchronous and returns the recovered signer address
|
|
109
|
+
const signer = verifyMessage("Hello Joe", signature);
|
|
110
|
+
console.log(signer === wallet.address); // true
|
|
111
|
+
|
|
112
|
+
// The EIP-191 digest is available on its own if needed
|
|
113
|
+
console.log(hashMessage("Hello Joe")); // 0x...32-byte hash
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Differences vs Ethereum
|
|
117
|
+
|
|
118
|
+
- **Signature shape:** not a 65-byte `(r, s, v)` value. It is an opaque,
|
|
119
|
+
scheme-dependent multi-kilobyte hex blob whose first byte is the scheme id and
|
|
120
|
+
which **embeds the signer's public key**. There is no `Signature`/`r`/`s`/`v`
|
|
121
|
+
object.
|
|
122
|
+
- **Address size:** recovered addresses are the full 32 bytes (66 hex chars).
|
|
123
|
+
- **No `ecrecover`:** `verifyMessage` does not recover a key from `(digest, sig)`
|
|
124
|
+
cryptographically. It extracts the embedded public key, verifies it against the
|
|
125
|
+
digest, and returns its address; a signature that fails verification throws.
|
|
126
|
+
- **Signing context:** `signMessage`/`signMessageSync` accept an optional
|
|
127
|
+
`signingContext`. When omitted it derives the compact context from the key type
|
|
128
|
+
(`0` for keyType 3, `1` for keyType 5); pass `2` to request the full-signature
|
|
129
|
+
scheme for a keyType 3 wallet.
|
|
130
|
+
- **Message size:** the message must be at most 1 MiB (once UTF-8 encoded);
|
|
131
|
+
larger inputs throw `INVALID_ARGUMENT`. The message is only ever hashed to a
|
|
132
|
+
32-byte digest, so there is no need for larger payloads.
|
|
133
|
+
- **EIP-712 (`signTypedData`)** is not yet supported.
|
|
134
|
+
|
|
89
135
|
## Contracts (read-only)
|
|
90
136
|
|
|
91
137
|
```js
|
|
@@ -156,6 +202,7 @@ Common types:
|
|
|
156
202
|
```bash
|
|
157
203
|
npm run example
|
|
158
204
|
npm run example:wallet
|
|
205
|
+
npm run example:sign-message
|
|
159
206
|
npm run example:contract:read
|
|
160
207
|
npm run example:events
|
|
161
208
|
# Run all examples (including SDK generator JS/TS)
|
package/generate-sdk.js
CHANGED
|
@@ -1744,11 +1744,13 @@ function _createPackageScaffold({ outDir, pkgName, pkgDesc, pkgAuthor, pkgLicens
|
|
|
1744
1744
|
const outLang = _normalizeLang(lang);
|
|
1745
1745
|
const isTs = outLang === "ts";
|
|
1746
1746
|
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
//
|
|
1751
|
-
|
|
1747
|
+
// The generated SDK only imports from "quantumcoin" (and "quantumcoin/config").
|
|
1748
|
+
// quantum-coin-js-sdk and seed-words are pulled in transitively via quantumcoin,
|
|
1749
|
+
// so we intentionally do NOT copy them as direct dependencies here — the
|
|
1750
|
+
// generated package.json lists only the minimum it actually needs.
|
|
1751
|
+
const dependencies = {
|
|
1752
|
+
quantumcoin: `file:${__dirname.replace(/\\\\/g, "/")}`,
|
|
1753
|
+
};
|
|
1752
1754
|
|
|
1753
1755
|
const pkgJson = {
|
|
1754
1756
|
name: pkgName,
|
|
@@ -1774,7 +1776,7 @@ function _createPackageScaffold({ outDir, pkgName, pkgDesc, pkgAuthor, pkgLicens
|
|
|
1774
1776
|
"test:e2e": "node --test --test-concurrency=1 \"test/e2e/**/*.test.js\"",
|
|
1775
1777
|
}),
|
|
1776
1778
|
},
|
|
1777
|
-
dependencies
|
|
1779
|
+
dependencies,
|
|
1778
1780
|
devDependencies: {},
|
|
1779
1781
|
};
|
|
1780
1782
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quantumcoin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "QuantumCoin.js - a post quantum cryptography SDK for QuantumCoin",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
7
|
+
"browser": {
|
|
8
|
+
"node:net": false
|
|
9
|
+
},
|
|
7
10
|
"typesVersions": {
|
|
8
11
|
"*": {
|
|
9
12
|
"types": [
|
|
@@ -43,6 +46,8 @@
|
|
|
43
46
|
"test:ts:integration": "npx tsx --test \"test/integration/**/*.test.ts\"",
|
|
44
47
|
"test:ts:security": "npx tsx --test \"test/security/**/*.test.ts\"",
|
|
45
48
|
"test:ts:e2e": "npx tsx --test --test-concurrency=1 \"test/e2e/*.test.ts\" \"test/e2e/*.e2e.test.ts\" \"test/e2e/*.dynamic.test.ts\"",
|
|
49
|
+
"test:browser:build": "node test/browser/build.js",
|
|
50
|
+
"test:browser": "npm run test:browser:build && npx playwright test",
|
|
46
51
|
"example": "node examples/example.js",
|
|
47
52
|
"example:ts": "npx tsx examples/example.ts",
|
|
48
53
|
"example:provider": "node examples/example.js",
|
|
@@ -54,12 +59,14 @@
|
|
|
54
59
|
"example:events:ts": "npx tsx examples/events.ts",
|
|
55
60
|
"example:offline-signing": "node examples/offline-signing.js",
|
|
56
61
|
"example:offline-signing:ts": "npx tsx examples/offline-signing.ts",
|
|
62
|
+
"example:sign-message": "node examples/sign-message.js",
|
|
63
|
+
"example:sign-message:ts": "npx tsx examples/sign-message.ts",
|
|
57
64
|
"example:generator-js": "node examples/example-generator-sdk-js.js",
|
|
58
65
|
"example:generator-js:ts": "npx tsx examples/example-generator-sdk-js.ts",
|
|
59
66
|
"example:generator-ts": "node examples/example-generator-sdk-ts.js",
|
|
60
67
|
"example:generator-ts:ts": "npx tsx examples/example-generator-sdk-ts.ts",
|
|
61
|
-
"examples": "node examples/example.js && node examples/wallet-offline.js && node examples/read-operations.js && node examples/events.js && node examples/example-generator-sdk-js.js && node examples/example-generator-sdk-ts.js",
|
|
62
|
-
"examples:ts": "npx tsx examples/example.ts && npx tsx examples/wallet-offline.ts && npx tsx examples/read-operations.ts && npx tsx examples/events.ts && npx tsx examples/example-generator-sdk-js.ts && npx tsx examples/example-generator-sdk-ts.ts",
|
|
68
|
+
"examples": "node examples/example.js && node examples/wallet-offline.js && node examples/sign-message.js && node examples/read-operations.js && node examples/events.js && node examples/example-generator-sdk-js.js && node examples/example-generator-sdk-ts.js",
|
|
69
|
+
"examples:ts": "npx tsx examples/example.ts && npx tsx examples/wallet-offline.ts && npx tsx examples/sign-message.ts && npx tsx examples/read-operations.ts && npx tsx examples/events.ts && npx tsx examples/example-generator-sdk-js.ts && npx tsx examples/example-generator-sdk-ts.ts",
|
|
63
70
|
"build": "npx -p typescript tsc -p tsconfig.build.json && node scripts/copy-declarations.js"
|
|
64
71
|
},
|
|
65
72
|
"repository": {
|
|
@@ -67,7 +74,15 @@
|
|
|
67
74
|
"url": "git+https://github.com/quantumcoinproject/quantumcoin.js.git"
|
|
68
75
|
},
|
|
69
76
|
"files": [
|
|
70
|
-
"
|
|
77
|
+
"index.js",
|
|
78
|
+
"config.js",
|
|
79
|
+
"config.d.ts",
|
|
80
|
+
"generate-sdk.js",
|
|
81
|
+
"src/**/*.js",
|
|
82
|
+
"src/**/*.d.ts",
|
|
83
|
+
"README.md",
|
|
84
|
+
"README-SDK.md",
|
|
85
|
+
"LICENSE"
|
|
71
86
|
],
|
|
72
87
|
"keywords": [
|
|
73
88
|
"cryptography",
|
|
@@ -86,10 +101,15 @@
|
|
|
86
101
|
"sdkgen": "./generate-sdk.js"
|
|
87
102
|
},
|
|
88
103
|
"devDependencies": {
|
|
104
|
+
"@playwright/test": "^1.61.1",
|
|
105
|
+
"esbuild": "^0.28.1",
|
|
89
106
|
"tsx": "^4.19.0"
|
|
90
107
|
},
|
|
91
108
|
"dependencies": {
|
|
92
|
-
"
|
|
93
|
-
"
|
|
109
|
+
"quantum-coin-js-sdk": "2.1.1",
|
|
110
|
+
"seed-words": "^1.1.1"
|
|
111
|
+
},
|
|
112
|
+
"allowScripts": {
|
|
113
|
+
"esbuild@0.28.1": true
|
|
94
114
|
}
|
|
95
115
|
}
|
package/src/abi/interface.d.ts
CHANGED
|
@@ -1,128 +1,133 @@
|
|
|
1
|
-
export class Interface {
|
|
2
|
-
/**
|
|
3
|
-
* @param {any[]|Interface} abi
|
|
4
|
-
*/
|
|
5
|
-
constructor(abi: any[] | Interface);
|
|
6
|
-
abi: any;
|
|
7
|
-
_abiJson: string;
|
|
8
|
-
_qcsdkAbi: any[];
|
|
9
|
-
_qcsdkAbiJson: string;
|
|
10
|
-
/**
|
|
11
|
-
* Returns JSON format of ABI.
|
|
12
|
-
* @returns {string}
|
|
13
|
-
*/
|
|
14
|
-
formatJson(): string;
|
|
15
|
-
/**
|
|
16
|
-
* Internal: normalized ABI JSON for qcsdk.
|
|
17
|
-
* @returns {string}
|
|
18
|
-
*/
|
|
19
|
-
_qcsdkFormatJson(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Internal: normalize argument values for qcsdk based on original ABI params.
|
|
22
|
-
* @param {Array<any>} params
|
|
23
|
-
* @param {Array<any>} values
|
|
24
|
-
* @returns {Array<any>}
|
|
25
|
-
*/
|
|
26
|
-
_qcsdkNormalizeValues(params: Array<any>, values: Array<any>): Array<any>;
|
|
27
|
-
/**
|
|
28
|
-
* Basic formatter (ethers supports multiple formats).
|
|
29
|
-
* @param {string=} format
|
|
30
|
-
* @returns {string}
|
|
31
|
-
*/
|
|
32
|
-
format(format?: string | undefined): string;
|
|
33
|
-
/**
|
|
34
|
-
* Get a function fragment by name (first match).
|
|
35
|
-
* @param {string} nameOrSignature
|
|
36
|
-
* @returns {FunctionFragment}
|
|
37
|
-
*/
|
|
38
|
-
getFunction(nameOrSignature: string): FunctionFragment;
|
|
39
|
-
/**
|
|
40
|
-
* Get an event fragment by name (first match).
|
|
41
|
-
* @param {string} nameOrSignature
|
|
42
|
-
* @returns {EventFragment}
|
|
43
|
-
*/
|
|
44
|
-
getEvent(nameOrSignature: string): EventFragment;
|
|
45
|
-
/**
|
|
46
|
-
* Get an error fragment by name (first match).
|
|
47
|
-
* @param {string} nameOrSignature
|
|
48
|
-
* @returns {ErrorFragment}
|
|
49
|
-
*/
|
|
50
|
-
getError(nameOrSignature: string): ErrorFragment;
|
|
51
|
-
/**
|
|
52
|
-
* Returns the constructor fragment if present.
|
|
53
|
-
* @returns {ConstructorFragment|null}
|
|
54
|
-
*/
|
|
55
|
-
getConstructor(): ConstructorFragment | null;
|
|
56
|
-
/**
|
|
57
|
-
* Encode function data using quantum-coin-js-sdk.
|
|
58
|
-
* @param {FunctionFragment|string} functionFragment
|
|
59
|
-
* @param {any[]} values
|
|
60
|
-
* @returns {string}
|
|
61
|
-
*/
|
|
62
|
-
encodeFunctionData(functionFragment: FunctionFragment | string, values: any[]): string;
|
|
63
|
-
/**
|
|
64
|
-
* Decode function result using quantum-coin-js-sdk.
|
|
65
|
-
* @param {FunctionFragment|string} functionFragment
|
|
66
|
-
* @param {string} data
|
|
67
|
-
* @returns {any}
|
|
68
|
-
*/
|
|
69
|
-
decodeFunctionResult(functionFragment: FunctionFragment | string, data: string): any;
|
|
70
|
-
/**
|
|
71
|
-
* Encode an event log from values.
|
|
72
|
-
* @param {EventFragment|any} eventFragment
|
|
73
|
-
* @param {any[]} values
|
|
74
|
-
* @returns {{ topics: string[], data: string }}
|
|
75
|
-
*/
|
|
76
|
-
encodeEventLog(eventFragment: EventFragment | any, values: any[]): {
|
|
77
|
-
topics: string[];
|
|
78
|
-
data: string;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Decode an event log.
|
|
82
|
-
* @param {EventFragment|any} eventFragment
|
|
83
|
-
* @param {string[]} topics
|
|
84
|
-
* @param {string} data
|
|
85
|
-
* @returns {any}
|
|
86
|
-
*/
|
|
87
|
-
decodeEventLog(eventFragment: EventFragment | any, topics: string[], data: string): any;
|
|
88
|
-
parseTransaction(): void;
|
|
89
|
-
parseLog(...args: any[]): {
|
|
90
|
-
fragment: EventFragment;
|
|
91
|
-
name: any;
|
|
92
|
-
signature: any;
|
|
93
|
-
topic: string;
|
|
94
|
-
args: Result;
|
|
95
|
-
};
|
|
96
|
-
parseError(): void;
|
|
97
|
-
getSighash(): void;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
*
|
|
112
|
-
* @
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
*
|
|
119
|
-
* @
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
1
|
+
export class Interface {
|
|
2
|
+
/**
|
|
3
|
+
* @param {any[]|Interface} abi
|
|
4
|
+
*/
|
|
5
|
+
constructor(abi: any[] | Interface);
|
|
6
|
+
abi: any;
|
|
7
|
+
_abiJson: string;
|
|
8
|
+
_qcsdkAbi: any[];
|
|
9
|
+
_qcsdkAbiJson: string;
|
|
10
|
+
/**
|
|
11
|
+
* Returns JSON format of ABI.
|
|
12
|
+
* @returns {string}
|
|
13
|
+
*/
|
|
14
|
+
formatJson(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Internal: normalized ABI JSON for qcsdk.
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
_qcsdkFormatJson(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Internal: normalize argument values for qcsdk based on original ABI params.
|
|
22
|
+
* @param {Array<any>} params
|
|
23
|
+
* @param {Array<any>} values
|
|
24
|
+
* @returns {Array<any>}
|
|
25
|
+
*/
|
|
26
|
+
_qcsdkNormalizeValues(params: Array<any>, values: Array<any>): Array<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Basic formatter (ethers supports multiple formats).
|
|
29
|
+
* @param {string=} format
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
format(format?: string | undefined): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get a function fragment by name (first match).
|
|
35
|
+
* @param {string} nameOrSignature
|
|
36
|
+
* @returns {FunctionFragment}
|
|
37
|
+
*/
|
|
38
|
+
getFunction(nameOrSignature: string): FunctionFragment;
|
|
39
|
+
/**
|
|
40
|
+
* Get an event fragment by name (first match).
|
|
41
|
+
* @param {string} nameOrSignature
|
|
42
|
+
* @returns {EventFragment}
|
|
43
|
+
*/
|
|
44
|
+
getEvent(nameOrSignature: string): EventFragment;
|
|
45
|
+
/**
|
|
46
|
+
* Get an error fragment by name (first match).
|
|
47
|
+
* @param {string} nameOrSignature
|
|
48
|
+
* @returns {ErrorFragment}
|
|
49
|
+
*/
|
|
50
|
+
getError(nameOrSignature: string): ErrorFragment;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the constructor fragment if present.
|
|
53
|
+
* @returns {ConstructorFragment|null}
|
|
54
|
+
*/
|
|
55
|
+
getConstructor(): ConstructorFragment | null;
|
|
56
|
+
/**
|
|
57
|
+
* Encode function data using quantum-coin-js-sdk.
|
|
58
|
+
* @param {FunctionFragment|string} functionFragment
|
|
59
|
+
* @param {any[]} values
|
|
60
|
+
* @returns {string}
|
|
61
|
+
*/
|
|
62
|
+
encodeFunctionData(functionFragment: FunctionFragment | string, values: any[]): string;
|
|
63
|
+
/**
|
|
64
|
+
* Decode function result using quantum-coin-js-sdk.
|
|
65
|
+
* @param {FunctionFragment|string} functionFragment
|
|
66
|
+
* @param {string} data
|
|
67
|
+
* @returns {any}
|
|
68
|
+
*/
|
|
69
|
+
decodeFunctionResult(functionFragment: FunctionFragment | string, data: string): any;
|
|
70
|
+
/**
|
|
71
|
+
* Encode an event log from values.
|
|
72
|
+
* @param {EventFragment|any} eventFragment
|
|
73
|
+
* @param {any[]} values
|
|
74
|
+
* @returns {{ topics: string[], data: string }}
|
|
75
|
+
*/
|
|
76
|
+
encodeEventLog(eventFragment: EventFragment | any, values: any[]): {
|
|
77
|
+
topics: string[];
|
|
78
|
+
data: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Decode an event log.
|
|
82
|
+
* @param {EventFragment|any} eventFragment
|
|
83
|
+
* @param {string[]} topics
|
|
84
|
+
* @param {string} data
|
|
85
|
+
* @returns {any}
|
|
86
|
+
*/
|
|
87
|
+
decodeEventLog(eventFragment: EventFragment | any, topics: string[], data: string): any;
|
|
88
|
+
parseTransaction(): void;
|
|
89
|
+
parseLog(...args: any[]): {
|
|
90
|
+
fragment: EventFragment;
|
|
91
|
+
name: any;
|
|
92
|
+
signature: any;
|
|
93
|
+
topic: string;
|
|
94
|
+
args: Result;
|
|
95
|
+
};
|
|
96
|
+
parseError(): void;
|
|
97
|
+
getSighash(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Compute the topic0 (event signature hash) for an event.
|
|
100
|
+
* @param {string|EventFragment|any} nameOrFragment
|
|
101
|
+
* @returns {string} normalized 0x-prefixed topic hash
|
|
102
|
+
*/
|
|
103
|
+
getEventTopic(nameOrFragment: string | EventFragment | any): string;
|
|
104
|
+
getFallback(): null;
|
|
105
|
+
getReceive(): null;
|
|
106
|
+
}
|
|
107
|
+
export class AbiCoder {
|
|
108
|
+
/**
|
|
109
|
+
* Encode values by types into ABI data.
|
|
110
|
+
* @param {(string|any)[]} types
|
|
111
|
+
* @param {any[]} values
|
|
112
|
+
* @returns {string}
|
|
113
|
+
*/
|
|
114
|
+
encode(types: (string | any)[], values: any[]): string;
|
|
115
|
+
/**
|
|
116
|
+
* Decode ABI data by output types.
|
|
117
|
+
* @param {(string|any)[]} types
|
|
118
|
+
* @param {string} data
|
|
119
|
+
* @returns {any}
|
|
120
|
+
*/
|
|
121
|
+
decode(types: (string | any)[], data: string): any;
|
|
122
|
+
/**
|
|
123
|
+
* Return a default value for types.
|
|
124
|
+
* @param {(string|any)[]} types
|
|
125
|
+
* @returns {any}
|
|
126
|
+
*/
|
|
127
|
+
getDefaultValue(types: (string | any)[]): any;
|
|
128
|
+
}
|
|
129
|
+
import { FunctionFragment } from "./fragments";
|
|
130
|
+
import { EventFragment } from "./fragments";
|
|
131
|
+
import { ErrorFragment } from "./fragments";
|
|
132
|
+
import { ConstructorFragment } from "./fragments";
|
|
133
|
+
import { Result } from "../utils/result";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export function hasTuple(params: any): boolean;
|
|
2
|
-
export function hasNestedArrays(params: any): boolean;
|
|
3
|
-
export function needsJsAbi(params: any): boolean;
|
|
4
|
-
export function canonicalType(param: any): any;
|
|
5
|
-
export function functionSelectorHex(name: any, inputs: any): string;
|
|
6
|
-
export function encodeFunctionData(name: any, inputs: any, values: any): string;
|
|
7
|
-
export function encodeTupleLike(params: any, values: any): Uint8Array<any>;
|
|
8
|
-
export function decodeFunctionResult(outputs: any, dataHex: any): any[];
|
|
1
|
+
export function hasTuple(params: any): boolean;
|
|
2
|
+
export function hasNestedArrays(params: any): boolean;
|
|
3
|
+
export function needsJsAbi(params: any): boolean;
|
|
4
|
+
export function canonicalType(param: any): any;
|
|
5
|
+
export function functionSelectorHex(name: any, inputs: any): string;
|
|
6
|
+
export function encodeFunctionData(name: any, inputs: any, values: any): string;
|
|
7
|
+
export function encodeTupleLike(params: any, values: any, depth: any): Uint8Array<any>;
|
|
8
|
+
export function decodeFunctionResult(outputs: any, dataHex: any): any[];
|