@alephium/web3 2.0.10 → 3.0.0-test.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/LICENSE +165 -0
- package/README.md +11 -1
- package/dist/{src → _cjs}/address/address.js +60 -77
- package/dist/_cjs/address/address.js.map +1 -0
- package/dist/{src → _cjs}/address/index.js +1 -17
- package/dist/_cjs/address/index.js.map +1 -0
- package/dist/_cjs/api/api-alephium.d.ts +1152 -0
- package/dist/{src → _cjs}/api/api-alephium.js +5 -756
- package/dist/_cjs/api/api-alephium.js.map +1 -0
- package/dist/_cjs/api/api-explorer.d.ts +586 -0
- package/dist/{src → _cjs}/api/api-explorer.js +14 -454
- package/dist/_cjs/api/api-explorer.js.map +1 -0
- package/dist/{src → _cjs}/api/explorer-provider.js +1 -18
- package/dist/_cjs/api/explorer-provider.js.map +1 -0
- package/dist/{src → _cjs}/api/index.js +18 -24
- package/dist/_cjs/api/index.js.map +1 -0
- package/dist/{src → _cjs}/api/node-provider.d.ts +1 -1
- package/dist/{src → _cjs}/api/node-provider.js +4 -26
- package/dist/_cjs/api/node-provider.js.map +1 -0
- package/dist/{src → _cjs}/api/types.js +25 -43
- package/dist/_cjs/api/types.js.map +1 -0
- package/dist/{src → _cjs}/api/utils.d.ts +1 -1
- package/dist/{src → _cjs}/api/utils.js +9 -21
- package/dist/_cjs/api/utils.js.map +1 -0
- package/dist/{src → _cjs}/block/block.js +20 -26
- package/dist/_cjs/block/block.js.map +1 -0
- package/dist/_cjs/block/index.d.ts +2 -0
- package/dist/_cjs/block/index.js +6 -0
- package/dist/_cjs/block/index.js.map +1 -0
- package/dist/{src → _cjs}/codec/array-codec.js +1 -17
- package/dist/_cjs/codec/array-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/asset-output-codec.js +1 -17
- package/dist/_cjs/codec/asset-output-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/bigint-codec.js +2 -33
- package/dist/_cjs/codec/bigint-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/bytestring-codec.d.ts +1 -1
- package/dist/{src → _cjs}/codec/bytestring-codec.js +1 -17
- package/dist/_cjs/codec/bytestring-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/checksum-codec.js +1 -17
- package/dist/_cjs/codec/checksum-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/codec.js +3 -19
- package/dist/_cjs/codec/codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/compact-int-codec.js +2 -18
- package/dist/_cjs/codec/compact-int-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/contract-codec.js +1 -17
- package/dist/_cjs/codec/contract-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/contract-output-codec.js +1 -17
- package/dist/_cjs/codec/contract-output-codec.js.map +1 -0
- package/dist/_cjs/codec/contract-output-ref-codec.js +12 -0
- package/dist/_cjs/codec/contract-output-ref-codec.js.map +1 -0
- package/dist/_cjs/codec/either-codec.js +8 -0
- package/dist/_cjs/codec/either-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/hash.d.ts +1 -1
- package/dist/_cjs/codec/hash.js +20 -0
- package/dist/_cjs/codec/hash.js.map +1 -0
- package/dist/{src → _cjs}/codec/index.js +18 -24
- package/dist/_cjs/codec/index.js.map +1 -0
- package/dist/{src → _cjs}/codec/input-codec.js +1 -0
- package/dist/_cjs/codec/input-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/instr-codec.js +4 -21
- package/dist/_cjs/codec/instr-codec.js.map +1 -0
- package/dist/_cjs/codec/int-as-4bytes-codec.js +16 -0
- package/dist/_cjs/codec/int-as-4bytes-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/lockup-script-codec.d.ts +1 -1
- package/dist/{src → _cjs}/codec/lockup-script-codec.js +1 -17
- package/dist/_cjs/codec/lockup-script-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/method-codec.js +1 -17
- package/dist/_cjs/codec/method-codec.js.map +1 -0
- package/dist/_cjs/codec/option-codec.js +19 -0
- package/dist/_cjs/codec/option-codec.js.map +1 -0
- package/dist/_cjs/codec/output-codec.js +10 -0
- package/dist/_cjs/codec/output-codec.js.map +1 -0
- package/dist/_cjs/codec/public-key-like-codec.js +14 -0
- package/dist/_cjs/codec/public-key-like-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/reader.js +1 -17
- package/dist/_cjs/codec/reader.js.map +1 -0
- package/dist/_cjs/codec/script-codec.js +18 -0
- package/dist/_cjs/codec/script-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/signature-codec.d.ts +1 -1
- package/dist/_cjs/codec/signature-codec.js +8 -0
- package/dist/_cjs/codec/signature-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/timestamp-codec.js +1 -17
- package/dist/_cjs/codec/timestamp-codec.js.map +1 -0
- package/dist/_cjs/codec/token-codec.js +12 -0
- package/dist/_cjs/codec/token-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/transaction-codec.js +1 -17
- package/dist/_cjs/codec/transaction-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/unlock-script-codec.d.ts +1 -1
- package/dist/{src → _cjs}/codec/unlock-script-codec.js +1 -17
- package/dist/_cjs/codec/unlock-script-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/unsigned-tx-codec.js +1 -0
- package/dist/_cjs/codec/unsigned-tx-codec.js.map +1 -0
- package/dist/{src → _cjs}/codec/val.js +1 -17
- package/dist/_cjs/codec/val.js.map +1 -0
- package/dist/{src → _cjs}/constants.d.ts +0 -3
- package/dist/{src → _cjs}/constants.js +1 -20
- package/dist/_cjs/constants.js.map +1 -0
- package/dist/{src → _cjs}/contract/contract.js +60 -78
- package/dist/_cjs/contract/contract.js.map +1 -0
- package/dist/{src → _cjs}/contract/dapp-tx-builder.js +3 -19
- package/dist/_cjs/contract/dapp-tx-builder.js.map +1 -0
- package/dist/_cjs/contract/deployment.js +3 -0
- package/dist/_cjs/contract/deployment.js.map +1 -0
- package/dist/{src → _cjs}/contract/events.js +20 -26
- package/dist/_cjs/contract/events.js.map +1 -0
- package/dist/{src → _cjs}/contract/index.js +1 -17
- package/dist/_cjs/contract/index.js.map +1 -0
- package/dist/{src → _cjs}/contract/ralph.js +35 -69
- package/dist/_cjs/contract/ralph.js.map +1 -0
- package/dist/{src → _cjs}/contract/script-simulator.d.ts +0 -12
- package/dist/{src → _cjs}/contract/script-simulator.js +23 -64
- package/dist/_cjs/contract/script-simulator.js.map +1 -0
- package/dist/_cjs/debug.js +29 -0
- package/dist/_cjs/debug.js.map +1 -0
- package/dist/{src → _cjs}/error.js +1 -17
- package/dist/_cjs/error.js.map +1 -0
- package/dist/{src → _cjs}/exchange/exchange.js +8 -26
- package/dist/_cjs/exchange/exchange.js.map +1 -0
- package/dist/_cjs/exchange/index.d.ts +2 -0
- package/dist/{src → _cjs}/exchange/index.js +1 -17
- package/dist/_cjs/exchange/index.js.map +1 -0
- package/dist/{src → _cjs}/global.js +7 -26
- package/dist/_cjs/global.js.map +1 -0
- package/dist/{src → _cjs}/index.js +18 -27
- package/dist/_cjs/index.js.map +1 -0
- package/dist/_cjs/package.json +1 -0
- package/dist/{src → _cjs}/signer/index.js +1 -17
- package/dist/_cjs/signer/index.js.map +1 -0
- package/dist/{src → _cjs}/signer/signer.js +16 -63
- package/dist/_cjs/signer/signer.js.map +1 -0
- package/dist/{src → _cjs}/signer/tx-builder.js +4 -21
- package/dist/_cjs/signer/tx-builder.js.map +1 -0
- package/dist/{src → _cjs}/signer/types.js +6 -22
- package/dist/_cjs/signer/types.js.map +1 -0
- package/dist/{src → _cjs}/token/index.js +1 -17
- package/dist/_cjs/token/index.js.map +1 -0
- package/dist/{src → _cjs}/token/nft.d.ts +0 -1
- package/dist/{src → _cjs}/token/nft.js +5 -24
- package/dist/_cjs/token/nft.js.map +1 -0
- package/dist/{src → _cjs}/transaction/index.js +1 -17
- package/dist/_cjs/transaction/index.js.map +1 -0
- package/dist/{src → _cjs}/transaction/sign-verify.js +20 -27
- package/dist/_cjs/transaction/sign-verify.js.map +1 -0
- package/dist/{src → _cjs}/transaction/status.js +20 -26
- package/dist/_cjs/transaction/status.js.map +1 -0
- package/dist/{src → _cjs}/transaction/utils.js +3 -20
- package/dist/_cjs/transaction/utils.js.map +1 -0
- package/dist/{src → _cjs}/utils/bs58.d.ts +0 -1
- package/dist/{src → _cjs}/utils/bs58.js +4 -21
- package/dist/_cjs/utils/bs58.js.map +1 -0
- package/dist/_cjs/utils/djb2.js +11 -0
- package/dist/_cjs/utils/djb2.js.map +1 -0
- package/dist/{src → _cjs}/utils/index.js +1 -17
- package/dist/_cjs/utils/index.js.map +1 -0
- package/dist/{src → _cjs}/utils/number.d.ts +0 -2
- package/dist/{src → _cjs}/utils/number.fixture.js +1 -17
- package/dist/_cjs/utils/number.fixture.js.map +1 -0
- package/dist/{src → _cjs}/utils/number.js +10 -44
- package/dist/_cjs/utils/number.js.map +1 -0
- package/dist/_cjs/utils/sign.js +89 -0
- package/dist/_cjs/utils/sign.js.map +1 -0
- package/dist/{src → _cjs}/utils/subscription.js +1 -17
- package/dist/_cjs/utils/subscription.js.map +1 -0
- package/dist/{src → _cjs}/utils/utils.d.ts +7 -6
- package/dist/{src → _cjs}/utils/utils.js +60 -57
- package/dist/_cjs/utils/utils.js.map +1 -0
- package/dist/{src → _cjs}/utils/webcrypto.d.ts +1 -3
- package/dist/_cjs/utils/webcrypto.js +18 -0
- package/dist/_cjs/utils/webcrypto.js.map +1 -0
- package/dist/_esm/address/address.d.ts +36 -0
- package/dist/_esm/address/address.js +309 -0
- package/dist/_esm/address/address.js.map +1 -0
- package/dist/_esm/address/index.d.ts +1 -0
- package/dist/_esm/address/index.js +2 -0
- package/dist/_esm/address/index.js.map +1 -0
- package/dist/_esm/api/api-alephium.d.ts +1152 -0
- package/dist/_esm/api/api-alephium.js +797 -0
- package/dist/_esm/api/api-alephium.js.map +1 -0
- package/dist/_esm/api/api-explorer.d.ts +586 -0
- package/dist/_esm/api/api-explorer.js +577 -0
- package/dist/_esm/api/api-explorer.js.map +1 -0
- package/dist/_esm/api/explorer-provider.d.ts +21 -0
- package/dist/_esm/api/explorer-provider.js +48 -0
- package/dist/_esm/api/explorer-provider.js.map +1 -0
- package/dist/_esm/api/index.d.ts +6 -0
- package/dist/_esm/api/index.js +7 -0
- package/dist/_esm/api/index.js.map +1 -0
- package/dist/_esm/api/node-provider.d.ts +46 -0
- package/dist/_esm/api/node-provider.js +178 -0
- package/dist/_esm/api/node-provider.js.map +1 -0
- package/dist/_esm/api/types.d.ts +71 -0
- package/dist/_esm/api/types.js +219 -0
- package/dist/_esm/api/types.js.map +1 -0
- package/dist/_esm/api/utils.d.ts +10 -0
- package/dist/_esm/api/utils.js +37 -0
- package/dist/_esm/api/utils.js.map +1 -0
- package/dist/_esm/block/block.d.ts +27 -0
- package/dist/_esm/block/block.js +128 -0
- package/dist/_esm/block/block.js.map +1 -0
- package/dist/_esm/block/index.d.ts +2 -0
- package/dist/_esm/block/index.js +2 -0
- package/dist/_esm/block/index.js.map +1 -0
- package/dist/_esm/codec/array-codec.d.ts +8 -0
- package/dist/_esm/codec/array-codec.js +25 -0
- package/dist/_esm/codec/array-codec.js.map +1 -0
- package/dist/_esm/codec/asset-output-codec.d.ts +21 -0
- package/dist/_esm/codec/asset-output-codec.js +74 -0
- package/dist/_esm/codec/asset-output-codec.js.map +1 -0
- package/dist/_esm/codec/bigint-codec.d.ts +5 -0
- package/dist/_esm/codec/bigint-codec.js +62 -0
- package/dist/_esm/codec/bigint-codec.js.map +1 -0
- package/dist/_esm/codec/bytestring-codec.d.ts +10 -0
- package/dist/_esm/codec/bytestring-codec.js +16 -0
- package/dist/_esm/codec/bytestring-codec.js.map +1 -0
- package/dist/_esm/codec/checksum-codec.d.ts +8 -0
- package/dist/_esm/codec/checksum-codec.js +27 -0
- package/dist/_esm/codec/checksum-codec.js.map +1 -0
- package/dist/_esm/codec/codec.d.ts +57 -0
- package/dist/_esm/codec/codec.js +114 -0
- package/dist/_esm/codec/codec.js.map +1 -0
- package/dist/_esm/codec/compact-int-codec.d.ts +68 -0
- package/dist/_esm/codec/compact-int-codec.js +287 -0
- package/dist/_esm/codec/compact-int-codec.js.map +1 -0
- package/dist/_esm/codec/contract-codec.d.ts +19 -0
- package/dist/_esm/codec/contract-codec.js +47 -0
- package/dist/_esm/codec/contract-codec.js.map +1 -0
- package/dist/_esm/codec/contract-output-codec.d.ts +14 -0
- package/dist/_esm/codec/contract-output-codec.js +40 -0
- package/dist/_esm/codec/contract-output-codec.js.map +1 -0
- package/dist/_esm/codec/contract-output-ref-codec.d.ts +8 -0
- package/dist/_esm/codec/contract-output-ref-codec.js +9 -0
- package/dist/_esm/codec/contract-output-ref-codec.js.map +1 -0
- package/dist/_esm/codec/either-codec.d.ts +9 -0
- package/dist/_esm/codec/either-codec.js +5 -0
- package/dist/_esm/codec/either-codec.js.map +1 -0
- package/dist/_esm/codec/hash.d.ts +3 -0
- package/dist/_esm/codec/hash.js +15 -0
- package/dist/_esm/codec/hash.js.map +1 -0
- package/dist/_esm/codec/index.d.ts +24 -0
- package/dist/_esm/codec/index.js +25 -0
- package/dist/_esm/codec/index.js.map +1 -0
- package/dist/_esm/codec/input-codec.d.ts +15 -0
- package/dist/_esm/codec/input-codec.js +33 -0
- package/dist/_esm/codec/input-codec.js.map +1 -0
- package/dist/_esm/codec/instr-codec.d.ts +857 -0
- package/dist/_esm/codec/instr-codec.js +1138 -0
- package/dist/_esm/codec/instr-codec.js.map +1 -0
- package/dist/_esm/codec/int-as-4bytes-codec.d.ts +7 -0
- package/dist/_esm/codec/int-as-4bytes-codec.js +12 -0
- package/dist/_esm/codec/int-as-4bytes-codec.js.map +1 -0
- package/dist/_esm/codec/lockup-script-codec.d.ts +42 -0
- package/dist/_esm/codec/lockup-script-codec.js +28 -0
- package/dist/_esm/codec/lockup-script-codec.js.map +1 -0
- package/dist/_esm/codec/method-codec.d.ts +20 -0
- package/dist/_esm/codec/method-codec.js +54 -0
- package/dist/_esm/codec/method-codec.js.map +1 -0
- package/dist/_esm/codec/option-codec.d.ts +9 -0
- package/dist/_esm/codec/option-codec.js +16 -0
- package/dist/_esm/codec/option-codec.js.map +1 -0
- package/dist/_esm/codec/output-codec.d.ts +7 -0
- package/dist/_esm/codec/output-codec.js +7 -0
- package/dist/_esm/codec/output-codec.js.map +1 -0
- package/dist/_esm/codec/public-key-like-codec.d.ts +17 -0
- package/dist/_esm/codec/public-key-like-codec.js +11 -0
- package/dist/_esm/codec/public-key-like-codec.js.map +1 -0
- package/dist/_esm/codec/reader.d.ts +10 -0
- package/dist/_esm/codec/reader.js +38 -0
- package/dist/_esm/codec/reader.js.map +1 -0
- package/dist/_esm/codec/script-codec.d.ts +12 -0
- package/dist/_esm/codec/script-codec.js +14 -0
- package/dist/_esm/codec/script-codec.js.map +1 -0
- package/dist/_esm/codec/signature-codec.d.ts +5 -0
- package/dist/_esm/codec/signature-codec.js +5 -0
- package/dist/_esm/codec/signature-codec.js.map +1 -0
- package/dist/_esm/codec/timestamp-codec.d.ts +8 -0
- package/dist/_esm/codec/timestamp-codec.js +19 -0
- package/dist/_esm/codec/timestamp-codec.js.map +1 -0
- package/dist/_esm/codec/token-codec.d.ts +8 -0
- package/dist/_esm/codec/token-codec.js +9 -0
- package/dist/_esm/codec/token-codec.js.map +1 -0
- package/dist/_esm/codec/transaction-codec.d.ts +21 -0
- package/dist/_esm/codec/transaction-codec.js +82 -0
- package/dist/_esm/codec/transaction-codec.js.map +1 -0
- package/dist/_esm/codec/unlock-script-codec.d.ts +44 -0
- package/dist/_esm/codec/unlock-script-codec.js +49 -0
- package/dist/_esm/codec/unlock-script-codec.js.map +1 -0
- package/dist/_esm/codec/unsigned-tx-codec.d.ts +23 -0
- package/dist/_esm/codec/unsigned-tx-codec.js +57 -0
- package/dist/_esm/codec/unsigned-tx-codec.js.map +1 -0
- package/dist/_esm/codec/val.d.ts +27 -0
- package/dist/_esm/codec/val.js +14 -0
- package/dist/_esm/codec/val.js.map +1 -0
- package/dist/_esm/constants.d.ts +14 -0
- package/dist/_esm/constants.js +15 -0
- package/dist/_esm/constants.js.map +1 -0
- package/dist/_esm/contract/contract.d.ts +328 -0
- package/dist/_esm/contract/contract.js +1449 -0
- package/dist/_esm/contract/contract.js.map +1 -0
- package/dist/_esm/contract/dapp-tx-builder.d.ts +26 -0
- package/dist/_esm/contract/dapp-tx-builder.js +166 -0
- package/dist/_esm/contract/dapp-tx-builder.js.map +1 -0
- package/dist/_esm/contract/deployment.d.ts +21 -0
- package/dist/_esm/contract/deployment.js +2 -0
- package/dist/_esm/contract/deployment.js.map +1 -0
- package/dist/_esm/contract/events.d.ts +17 -0
- package/dist/_esm/contract/events.js +59 -0
- package/dist/_esm/contract/events.js.map +1 -0
- package/dist/_esm/contract/index.d.ts +6 -0
- package/dist/_esm/contract/index.js +7 -0
- package/dist/_esm/contract/index.js.map +1 -0
- package/dist/_esm/contract/ralph.d.ts +73 -0
- package/dist/_esm/contract/ralph.js +372 -0
- package/dist/_esm/contract/ralph.js.map +1 -0
- package/dist/_esm/contract/script-simulator.d.ts +15 -0
- package/dist/_esm/contract/script-simulator.js +712 -0
- package/dist/_esm/contract/script-simulator.js.map +1 -0
- package/dist/_esm/debug.d.ts +6 -0
- package/dist/_esm/debug.js +21 -0
- package/dist/_esm/debug.js.map +1 -0
- package/dist/_esm/error.d.ts +4 -0
- package/dist/_esm/error.js +16 -0
- package/dist/_esm/error.js.map +1 -0
- package/dist/_esm/exchange/exchange.d.ts +21 -0
- package/dist/_esm/exchange/exchange.js +137 -0
- package/dist/_esm/exchange/exchange.js.map +1 -0
- package/dist/_esm/exchange/index.d.ts +2 -0
- package/dist/_esm/exchange/index.js +2 -0
- package/dist/_esm/exchange/index.js.map +1 -0
- package/dist/_esm/global.d.ts +10 -0
- package/dist/_esm/global.js +49 -0
- package/dist/_esm/global.js.map +1 -0
- package/dist/_esm/index.d.ts +15 -0
- package/dist/_esm/index.js +16 -0
- package/dist/_esm/index.js.map +1 -0
- package/dist/_esm/package.json +1 -0
- package/dist/_esm/signer/index.d.ts +3 -0
- package/dist/_esm/signer/index.js +4 -0
- package/dist/_esm/signer/index.js.map +1 -0
- package/dist/_esm/signer/signer.d.ts +63 -0
- package/dist/_esm/signer/signer.js +279 -0
- package/dist/_esm/signer/signer.js.map +1 -0
- package/dist/_esm/signer/tx-builder.d.ts +22 -0
- package/dist/_esm/signer/tx-builder.js +270 -0
- package/dist/_esm/signer/tx-builder.js.map +1 -0
- package/dist/_esm/signer/types.d.ts +167 -0
- package/dist/_esm/signer/types.js +27 -0
- package/dist/_esm/signer/types.js.map +1 -0
- package/dist/_esm/token/index.d.ts +1 -0
- package/dist/_esm/token/index.js +2 -0
- package/dist/_esm/token/index.js.map +1 -0
- package/dist/_esm/token/nft.d.ts +8 -0
- package/dist/_esm/token/nft.js +95 -0
- package/dist/_esm/token/nft.js.map +1 -0
- package/dist/_esm/transaction/index.d.ts +3 -0
- package/dist/_esm/transaction/index.js +4 -0
- package/dist/_esm/transaction/index.js.map +1 -0
- package/dist/_esm/transaction/sign-verify.d.ts +3 -0
- package/dist/_esm/transaction/sign-verify.js +8 -0
- package/dist/_esm/transaction/sign-verify.js.map +1 -0
- package/dist/_esm/transaction/status.d.ts +12 -0
- package/dist/_esm/transaction/status.js +33 -0
- package/dist/_esm/transaction/status.js.map +1 -0
- package/dist/_esm/transaction/utils.d.ts +4 -0
- package/dist/_esm/transaction/utils.js +35 -0
- package/dist/_esm/transaction/utils.js.map +1 -0
- package/dist/_esm/utils/bs58.d.ts +5 -0
- package/dist/_esm/utils/bs58.js +25 -0
- package/dist/_esm/utils/bs58.js.map +1 -0
- package/dist/_esm/utils/djb2.d.ts +1 -0
- package/dist/_esm/utils/djb2.js +8 -0
- package/dist/_esm/utils/djb2.js.map +1 -0
- package/dist/_esm/utils/index.d.ts +7 -0
- package/dist/_esm/utils/index.js +8 -0
- package/dist/_esm/utils/index.js.map +1 -0
- package/dist/_esm/utils/number.d.ts +17 -0
- package/dist/_esm/utils/number.fixture.d.ts +12 -0
- package/dist/_esm/utils/number.fixture.js +170 -0
- package/dist/_esm/utils/number.fixture.js.map +1 -0
- package/dist/_esm/utils/number.js +104 -0
- package/dist/_esm/utils/number.js.map +1 -0
- package/dist/_esm/utils/sign.d.ts +3 -0
- package/dist/_esm/utils/sign.js +52 -0
- package/dist/_esm/utils/sign.js.map +1 -0
- package/dist/_esm/utils/subscription.d.ts +22 -0
- package/dist/_esm/utils/subscription.js +31 -0
- package/dist/_esm/utils/subscription.js.map +1 -0
- package/dist/_esm/utils/utils.d.ts +40 -0
- package/dist/_esm/utils/utils.js +116 -0
- package/dist/_esm/utils/utils.js.map +1 -0
- package/dist/_esm/utils/webcrypto.d.ts +4 -0
- package/dist/_esm/utils/webcrypto.js +14 -0
- package/dist/_esm/utils/webcrypto.js.map +1 -0
- package/package.json +58 -34
- package/src/address/address.ts +12 -17
- package/src/api/api-alephium.ts +4 -5
- package/src/api/api-explorer.ts +4 -5
- package/src/api/types.ts +3 -2
- package/src/api/utils.ts +13 -1
- package/src/block/index.ts +2 -1
- package/src/codec/hash.ts +2 -2
- package/src/contract/contract.ts +14 -12
- package/src/exchange/index.ts +1 -3
- package/src/index.ts +0 -4
- package/src/signer/signer.ts +17 -11
- package/src/token/nft.ts +0 -1
- package/src/utils/sign.ts +19 -20
- package/src/utils/utils.ts +9 -20
- package/src/utils/webcrypto.ts +4 -11
- package/tsconfig.build.json +9 -0
- package/dist/alephium-web3.min.js +0 -3
- package/dist/alephium-web3.min.js.LICENSE.txt +0 -12
- package/dist/alephium-web3.min.js.map +0 -1
- package/dist/scripts/check-versions.d.ts +0 -1
- package/dist/scripts/check-versions.js +0 -39
- package/dist/scripts/header.d.ts +0 -0
- package/dist/scripts/header.js +0 -18
- package/dist/src/api/api-alephium.d.ts +0 -2433
- package/dist/src/api/api-explorer.d.ts +0 -1472
- package/dist/src/block/index.d.ts +0 -1
- package/dist/src/block/index.js +0 -22
- package/dist/src/codec/contract-output-ref-codec.js +0 -28
- package/dist/src/codec/either-codec.js +0 -25
- package/dist/src/codec/hash.js +0 -40
- package/dist/src/codec/int-as-4bytes-codec.js +0 -32
- package/dist/src/codec/option-codec.js +0 -36
- package/dist/src/codec/output-codec.js +0 -26
- package/dist/src/codec/public-key-like-codec.js +0 -30
- package/dist/src/codec/script-codec.js +0 -34
- package/dist/src/codec/signature-codec.js +0 -24
- package/dist/src/codec/token-codec.js +0 -28
- package/dist/src/contract/deployment.js +0 -19
- package/dist/src/debug.js +0 -46
- package/dist/src/exchange/index.d.ts +0 -1
- package/dist/src/utils/djb2.js +0 -27
- package/dist/src/utils/sign.js +0 -96
- package/dist/src/utils/webcrypto.js +0 -42
- package/webpack.config.js +0 -56
- /package/dist/{src → _cjs}/address/address.d.ts +0 -0
- /package/dist/{src → _cjs}/address/index.d.ts +0 -0
- /package/dist/{src → _cjs}/api/explorer-provider.d.ts +0 -0
- /package/dist/{src → _cjs}/api/index.d.ts +0 -0
- /package/dist/{src → _cjs}/api/types.d.ts +0 -0
- /package/dist/{src → _cjs}/block/block.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/array-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/asset-output-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/bigint-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/checksum-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/compact-int-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/contract-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/contract-output-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/contract-output-ref-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/either-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/index.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/input-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/instr-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/int-as-4bytes-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/method-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/option-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/output-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/public-key-like-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/reader.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/script-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/timestamp-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/token-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/transaction-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/unsigned-tx-codec.d.ts +0 -0
- /package/dist/{src → _cjs}/codec/val.d.ts +0 -0
- /package/dist/{src → _cjs}/contract/contract.d.ts +0 -0
- /package/dist/{src → _cjs}/contract/dapp-tx-builder.d.ts +0 -0
- /package/dist/{src → _cjs}/contract/deployment.d.ts +0 -0
- /package/dist/{src → _cjs}/contract/events.d.ts +0 -0
- /package/dist/{src → _cjs}/contract/index.d.ts +0 -0
- /package/dist/{src → _cjs}/contract/ralph.d.ts +0 -0
- /package/dist/{src → _cjs}/debug.d.ts +0 -0
- /package/dist/{src → _cjs}/error.d.ts +0 -0
- /package/dist/{src → _cjs}/exchange/exchange.d.ts +0 -0
- /package/dist/{src → _cjs}/global.d.ts +0 -0
- /package/dist/{src → _cjs}/index.d.ts +0 -0
- /package/dist/{src → _cjs}/signer/index.d.ts +0 -0
- /package/dist/{src → _cjs}/signer/signer.d.ts +0 -0
- /package/dist/{src → _cjs}/signer/tx-builder.d.ts +0 -0
- /package/dist/{src → _cjs}/signer/types.d.ts +0 -0
- /package/dist/{src → _cjs}/token/index.d.ts +0 -0
- /package/dist/{src → _cjs}/transaction/index.d.ts +0 -0
- /package/dist/{src → _cjs}/transaction/sign-verify.d.ts +0 -0
- /package/dist/{src → _cjs}/transaction/status.d.ts +0 -0
- /package/dist/{src → _cjs}/transaction/utils.d.ts +0 -0
- /package/dist/{src → _cjs}/utils/djb2.d.ts +0 -0
- /package/dist/{src → _cjs}/utils/index.d.ts +0 -0
- /package/dist/{src → _cjs}/utils/number.fixture.d.ts +0 -0
- /package/dist/{src → _cjs}/utils/sign.d.ts +0 -0
- /package/dist/{src → _cjs}/utils/subscription.d.ts +0 -0
|
@@ -0,0 +1,1152 @@
|
|
|
1
|
+
export interface AddressAssetState {
|
|
2
|
+
address: string;
|
|
3
|
+
attoAlphAmount: string;
|
|
4
|
+
tokens?: Token[];
|
|
5
|
+
}
|
|
6
|
+
export interface AddressBalance {
|
|
7
|
+
address: string;
|
|
8
|
+
balance: string;
|
|
9
|
+
balanceHint: string;
|
|
10
|
+
lockedBalance: string;
|
|
11
|
+
lockedBalanceHint: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AddressInfo {
|
|
14
|
+
address: string;
|
|
15
|
+
publicKey: string;
|
|
16
|
+
group: number;
|
|
17
|
+
path: string;
|
|
18
|
+
}
|
|
19
|
+
export interface Addresses {
|
|
20
|
+
activeAddress: string;
|
|
21
|
+
addresses: AddressInfo[];
|
|
22
|
+
}
|
|
23
|
+
export interface AssetInput {
|
|
24
|
+
outputRef: OutputRef;
|
|
25
|
+
unlockScript: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AssetOutput {
|
|
28
|
+
hint: number;
|
|
29
|
+
key: string;
|
|
30
|
+
attoAlphAmount: string;
|
|
31
|
+
address: string;
|
|
32
|
+
tokens: Token[];
|
|
33
|
+
lockTime: number;
|
|
34
|
+
message: string;
|
|
35
|
+
type: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AssetState {
|
|
38
|
+
attoAlphAmount: string;
|
|
39
|
+
tokens?: Token[];
|
|
40
|
+
}
|
|
41
|
+
export interface BadRequest {
|
|
42
|
+
detail: string;
|
|
43
|
+
}
|
|
44
|
+
export interface Balance {
|
|
45
|
+
balance: string;
|
|
46
|
+
balanceHint: string;
|
|
47
|
+
lockedBalance: string;
|
|
48
|
+
lockedBalanceHint: string;
|
|
49
|
+
tokenBalances?: Token[];
|
|
50
|
+
lockedTokenBalances?: Token[];
|
|
51
|
+
utxoNum: number;
|
|
52
|
+
}
|
|
53
|
+
export interface Balances {
|
|
54
|
+
totalBalance: string;
|
|
55
|
+
totalBalanceHint: string;
|
|
56
|
+
balances: AddressBalance[];
|
|
57
|
+
}
|
|
58
|
+
export interface Ban {
|
|
59
|
+
peers: string[];
|
|
60
|
+
type: string;
|
|
61
|
+
}
|
|
62
|
+
export interface Banned {
|
|
63
|
+
until: number;
|
|
64
|
+
type: string;
|
|
65
|
+
}
|
|
66
|
+
export interface BlockAndEvents {
|
|
67
|
+
block: BlockEntry;
|
|
68
|
+
events: ContractEventByBlockHash[];
|
|
69
|
+
}
|
|
70
|
+
export interface BlockEntry {
|
|
71
|
+
hash: string;
|
|
72
|
+
timestamp: number;
|
|
73
|
+
chainFrom: number;
|
|
74
|
+
chainTo: number;
|
|
75
|
+
height: number;
|
|
76
|
+
deps: string[];
|
|
77
|
+
transactions: Transaction[];
|
|
78
|
+
nonce: string;
|
|
79
|
+
version: number;
|
|
80
|
+
depStateHash: string;
|
|
81
|
+
txsHash: string;
|
|
82
|
+
target: string;
|
|
83
|
+
ghostUncles: GhostUncleBlockEntry[];
|
|
84
|
+
conflictedTxs?: string[];
|
|
85
|
+
}
|
|
86
|
+
export interface BlockHeaderEntry {
|
|
87
|
+
hash: string;
|
|
88
|
+
timestamp: number;
|
|
89
|
+
chainFrom: number;
|
|
90
|
+
chainTo: number;
|
|
91
|
+
height: number;
|
|
92
|
+
deps: string[];
|
|
93
|
+
}
|
|
94
|
+
export interface BlocksAndEventsPerTimeStampRange {
|
|
95
|
+
blocksAndEvents: BlockAndEvents[][];
|
|
96
|
+
}
|
|
97
|
+
export interface BlocksPerTimeStampRange {
|
|
98
|
+
blocks: BlockEntry[][];
|
|
99
|
+
}
|
|
100
|
+
export interface BrokerInfo {
|
|
101
|
+
cliqueId: string;
|
|
102
|
+
brokerId: number;
|
|
103
|
+
brokerNum: number;
|
|
104
|
+
address: {
|
|
105
|
+
addr: string;
|
|
106
|
+
port: number;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export interface BuildChainedDeployContractTx {
|
|
110
|
+
value: BuildDeployContractTx;
|
|
111
|
+
type: string;
|
|
112
|
+
}
|
|
113
|
+
export interface BuildChainedDeployContractTxResult {
|
|
114
|
+
value: BuildSimpleDeployContractTxResult;
|
|
115
|
+
type: string;
|
|
116
|
+
}
|
|
117
|
+
export interface BuildChainedExecuteScriptTx {
|
|
118
|
+
value: BuildExecuteScriptTx;
|
|
119
|
+
type: string;
|
|
120
|
+
}
|
|
121
|
+
export interface BuildChainedExecuteScriptTxResult {
|
|
122
|
+
value: BuildSimpleExecuteScriptTxResult;
|
|
123
|
+
type: string;
|
|
124
|
+
}
|
|
125
|
+
export interface BuildChainedTransferTx {
|
|
126
|
+
value: BuildTransferTx;
|
|
127
|
+
type: string;
|
|
128
|
+
}
|
|
129
|
+
export interface BuildChainedTransferTxResult {
|
|
130
|
+
value: BuildSimpleTransferTxResult;
|
|
131
|
+
type: string;
|
|
132
|
+
}
|
|
133
|
+
export type BuildChainedTx = BuildChainedDeployContractTx | BuildChainedExecuteScriptTx | BuildChainedTransferTx;
|
|
134
|
+
export type BuildChainedTxResult = BuildChainedDeployContractTxResult | BuildChainedExecuteScriptTxResult | BuildChainedTransferTxResult;
|
|
135
|
+
export interface BuildDeployContractTx {
|
|
136
|
+
fromPublicKey: string;
|
|
137
|
+
fromPublicKeyType?: string;
|
|
138
|
+
bytecode: string;
|
|
139
|
+
initialAttoAlphAmount?: string;
|
|
140
|
+
initialTokenAmounts?: Token[];
|
|
141
|
+
issueTokenAmount?: string;
|
|
142
|
+
issueTokenTo?: string;
|
|
143
|
+
gasAmount?: number;
|
|
144
|
+
gasPrice?: string;
|
|
145
|
+
group?: number;
|
|
146
|
+
targetBlockHash?: string;
|
|
147
|
+
}
|
|
148
|
+
export type BuildDeployContractTxResult = BuildGrouplessDeployContractTxResult | BuildSimpleDeployContractTxResult;
|
|
149
|
+
export interface BuildExecuteScriptTx {
|
|
150
|
+
fromPublicKey: string;
|
|
151
|
+
fromPublicKeyType?: string;
|
|
152
|
+
bytecode: string;
|
|
153
|
+
attoAlphAmount?: string;
|
|
154
|
+
tokens?: Token[];
|
|
155
|
+
gasAmount?: number;
|
|
156
|
+
gasPrice?: string;
|
|
157
|
+
targetBlockHash?: string;
|
|
158
|
+
group?: number;
|
|
159
|
+
gasEstimationMultiplier?: number;
|
|
160
|
+
dustAmount?: string;
|
|
161
|
+
}
|
|
162
|
+
export type BuildExecuteScriptTxResult = BuildGrouplessExecuteScriptTxResult | BuildSimpleExecuteScriptTxResult;
|
|
163
|
+
export interface BuildGrouplessDeployContractTxResult {
|
|
164
|
+
fromGroup: number;
|
|
165
|
+
toGroup: number;
|
|
166
|
+
unsignedTx: string;
|
|
167
|
+
gasAmount: number;
|
|
168
|
+
gasPrice: string;
|
|
169
|
+
txId: string;
|
|
170
|
+
contractAddress: string;
|
|
171
|
+
fundingTxs?: BuildSimpleTransferTxResult[];
|
|
172
|
+
}
|
|
173
|
+
export interface BuildGrouplessExecuteScriptTxResult {
|
|
174
|
+
fromGroup: number;
|
|
175
|
+
toGroup: number;
|
|
176
|
+
unsignedTx: string;
|
|
177
|
+
gasAmount: number;
|
|
178
|
+
gasPrice: string;
|
|
179
|
+
txId: string;
|
|
180
|
+
simulationResult: SimulationResult;
|
|
181
|
+
fundingTxs?: BuildSimpleTransferTxResult[];
|
|
182
|
+
}
|
|
183
|
+
export interface BuildGrouplessTransferTxResult {
|
|
184
|
+
unsignedTx: string;
|
|
185
|
+
gasAmount: number;
|
|
186
|
+
gasPrice: string;
|
|
187
|
+
txId: string;
|
|
188
|
+
fromGroup: number;
|
|
189
|
+
toGroup: number;
|
|
190
|
+
fundingTxs?: BuildSimpleTransferTxResult[];
|
|
191
|
+
}
|
|
192
|
+
export interface BuildInfo {
|
|
193
|
+
releaseVersion: string;
|
|
194
|
+
commit: string;
|
|
195
|
+
}
|
|
196
|
+
export interface BuildMultiAddressesTransaction {
|
|
197
|
+
from: Source[];
|
|
198
|
+
gasPrice?: string;
|
|
199
|
+
targetBlockHash?: string;
|
|
200
|
+
}
|
|
201
|
+
export interface BuildMultisig {
|
|
202
|
+
fromAddress: string;
|
|
203
|
+
fromPublicKeys: string[];
|
|
204
|
+
fromPublicKeyTypes?: string[];
|
|
205
|
+
fromPublicKeyIndexes?: number[];
|
|
206
|
+
destinations: Destination[];
|
|
207
|
+
gas?: number;
|
|
208
|
+
gasPrice?: string;
|
|
209
|
+
group?: number;
|
|
210
|
+
multiSigType?: 'P2HMPK' | 'P2MPKH';
|
|
211
|
+
}
|
|
212
|
+
export interface BuildMultisigAddress {
|
|
213
|
+
keys: string[];
|
|
214
|
+
keyTypes?: string[];
|
|
215
|
+
mrequired: number;
|
|
216
|
+
multiSigType?: 'P2HMPK' | 'P2MPKH';
|
|
217
|
+
}
|
|
218
|
+
export interface BuildMultisigAddressResult {
|
|
219
|
+
address: string;
|
|
220
|
+
}
|
|
221
|
+
export interface BuildSimpleDeployContractTxResult {
|
|
222
|
+
fromGroup: number;
|
|
223
|
+
toGroup: number;
|
|
224
|
+
unsignedTx: string;
|
|
225
|
+
gasAmount: number;
|
|
226
|
+
gasPrice: string;
|
|
227
|
+
txId: string;
|
|
228
|
+
contractAddress: string;
|
|
229
|
+
}
|
|
230
|
+
export interface BuildSimpleExecuteScriptTxResult {
|
|
231
|
+
fromGroup: number;
|
|
232
|
+
toGroup: number;
|
|
233
|
+
unsignedTx: string;
|
|
234
|
+
gasAmount: number;
|
|
235
|
+
gasPrice: string;
|
|
236
|
+
txId: string;
|
|
237
|
+
simulationResult: SimulationResult;
|
|
238
|
+
}
|
|
239
|
+
export interface BuildSimpleTransferTxResult {
|
|
240
|
+
unsignedTx: string;
|
|
241
|
+
gasAmount: number;
|
|
242
|
+
gasPrice: string;
|
|
243
|
+
txId: string;
|
|
244
|
+
fromGroup: number;
|
|
245
|
+
toGroup: number;
|
|
246
|
+
}
|
|
247
|
+
export interface BuildSweepAddressTransactions {
|
|
248
|
+
fromPublicKey: string;
|
|
249
|
+
fromPublicKeyType?: string;
|
|
250
|
+
toAddress: string;
|
|
251
|
+
maxAttoAlphPerUTXO?: string;
|
|
252
|
+
lockTime?: number;
|
|
253
|
+
gasAmount?: number;
|
|
254
|
+
gasPrice?: string;
|
|
255
|
+
targetBlockHash?: string;
|
|
256
|
+
utxosLimit?: number;
|
|
257
|
+
group?: number;
|
|
258
|
+
sweepAlphOnly?: boolean;
|
|
259
|
+
}
|
|
260
|
+
export interface BuildSweepAddressTransactionsResult {
|
|
261
|
+
unsignedTxs: SweepAddressTransaction[];
|
|
262
|
+
fromGroup: number;
|
|
263
|
+
toGroup: number;
|
|
264
|
+
}
|
|
265
|
+
export interface BuildSweepMultisig {
|
|
266
|
+
fromAddress: string;
|
|
267
|
+
fromPublicKeys: string[];
|
|
268
|
+
fromPublicKeyTypes?: string[];
|
|
269
|
+
fromPublicKeyIndexes?: number[];
|
|
270
|
+
toAddress: string;
|
|
271
|
+
maxAttoAlphPerUTXO?: string;
|
|
272
|
+
lockTime?: number;
|
|
273
|
+
gasAmount?: number;
|
|
274
|
+
gasPrice?: string;
|
|
275
|
+
utxosLimit?: number;
|
|
276
|
+
targetBlockHash?: string;
|
|
277
|
+
group?: number;
|
|
278
|
+
multiSigType?: 'P2HMPK' | 'P2MPKH';
|
|
279
|
+
sweepAlphOnly?: boolean;
|
|
280
|
+
}
|
|
281
|
+
export interface BuildTransferTx {
|
|
282
|
+
fromPublicKey: string;
|
|
283
|
+
fromPublicKeyType?: string;
|
|
284
|
+
destinations: Destination[];
|
|
285
|
+
utxos?: OutputRef[];
|
|
286
|
+
gasAmount?: number;
|
|
287
|
+
gasPrice?: string;
|
|
288
|
+
group?: number;
|
|
289
|
+
targetBlockHash?: string;
|
|
290
|
+
}
|
|
291
|
+
export type BuildTransferTxResult = BuildGrouplessTransferTxResult | BuildSimpleTransferTxResult;
|
|
292
|
+
export interface CallContract {
|
|
293
|
+
group: number;
|
|
294
|
+
worldStateBlockHash?: string;
|
|
295
|
+
txId?: string;
|
|
296
|
+
address: string;
|
|
297
|
+
callerAddress?: string;
|
|
298
|
+
methodIndex: number;
|
|
299
|
+
args?: Val[];
|
|
300
|
+
interestedContracts?: string[];
|
|
301
|
+
inputAssets?: TestInputAsset[];
|
|
302
|
+
}
|
|
303
|
+
export interface CallContractFailed {
|
|
304
|
+
error: string;
|
|
305
|
+
type: string;
|
|
306
|
+
}
|
|
307
|
+
export type CallContractResult = CallContractFailed | CallContractSucceeded;
|
|
308
|
+
export interface CallContractSucceeded {
|
|
309
|
+
returns: Val[];
|
|
310
|
+
gasUsed: number;
|
|
311
|
+
contracts: ContractState[];
|
|
312
|
+
txInputs: string[];
|
|
313
|
+
txOutputs: Output[];
|
|
314
|
+
events: ContractEventByTxId[];
|
|
315
|
+
debugMessages: DebugMessage[];
|
|
316
|
+
type: string;
|
|
317
|
+
}
|
|
318
|
+
export interface CallTxScript {
|
|
319
|
+
group: number;
|
|
320
|
+
bytecode: string;
|
|
321
|
+
callerAddress?: string;
|
|
322
|
+
worldStateBlockHash?: string;
|
|
323
|
+
txId?: string;
|
|
324
|
+
inputAssets?: TestInputAsset[];
|
|
325
|
+
interestedContracts?: string[];
|
|
326
|
+
}
|
|
327
|
+
export interface CallTxScriptResult {
|
|
328
|
+
returns: Val[];
|
|
329
|
+
gasUsed: number;
|
|
330
|
+
contracts: ContractState[];
|
|
331
|
+
txInputs: string[];
|
|
332
|
+
txOutputs: Output[];
|
|
333
|
+
events: ContractEventByTxId[];
|
|
334
|
+
debugMessages: DebugMessage[];
|
|
335
|
+
}
|
|
336
|
+
export interface ChainInfo {
|
|
337
|
+
currentHeight: number;
|
|
338
|
+
}
|
|
339
|
+
export interface ChainParams {
|
|
340
|
+
networkId: number;
|
|
341
|
+
numZerosAtLeastInHash: number;
|
|
342
|
+
groupNumPerBroker: number;
|
|
343
|
+
groups: number;
|
|
344
|
+
}
|
|
345
|
+
export interface ChangeActiveAddress {
|
|
346
|
+
address: string;
|
|
347
|
+
}
|
|
348
|
+
export interface CompileContractResult {
|
|
349
|
+
version: string;
|
|
350
|
+
name: string;
|
|
351
|
+
bytecode: string;
|
|
352
|
+
bytecodeDebugPatch: string;
|
|
353
|
+
codeHash: string;
|
|
354
|
+
codeHashDebug: string;
|
|
355
|
+
fields: FieldsSig;
|
|
356
|
+
functions: FunctionSig[];
|
|
357
|
+
constants: Constant[];
|
|
358
|
+
enums: Enum[];
|
|
359
|
+
events: EventSig[];
|
|
360
|
+
warnings: string[];
|
|
361
|
+
maps?: MapsSig;
|
|
362
|
+
stdInterfaceId?: string;
|
|
363
|
+
}
|
|
364
|
+
export interface CompileProjectResult {
|
|
365
|
+
contracts: CompileContractResult[];
|
|
366
|
+
scripts: CompileScriptResult[];
|
|
367
|
+
structs?: StructSig[];
|
|
368
|
+
constants?: Constant[];
|
|
369
|
+
enums?: Enum[];
|
|
370
|
+
warnings?: string[];
|
|
371
|
+
testError?: string;
|
|
372
|
+
}
|
|
373
|
+
export interface CompileScriptResult {
|
|
374
|
+
version: string;
|
|
375
|
+
name: string;
|
|
376
|
+
bytecodeTemplate: string;
|
|
377
|
+
bytecodeDebugPatch: string;
|
|
378
|
+
fields: FieldsSig;
|
|
379
|
+
functions: FunctionSig[];
|
|
380
|
+
warnings: string[];
|
|
381
|
+
}
|
|
382
|
+
export interface CompilerOptions {
|
|
383
|
+
ignoreUnusedConstantsWarnings?: boolean;
|
|
384
|
+
ignoreUnusedVariablesWarnings?: boolean;
|
|
385
|
+
ignoreUnusedFieldsWarnings?: boolean;
|
|
386
|
+
ignoreUnusedPrivateFunctionsWarnings?: boolean;
|
|
387
|
+
ignoreUpdateFieldsCheckWarnings?: boolean;
|
|
388
|
+
ignoreCheckExternalCallerWarnings?: boolean;
|
|
389
|
+
ignoreUnusedFunctionReturnWarnings?: boolean;
|
|
390
|
+
skipAbstractContractCheck?: boolean;
|
|
391
|
+
skipTests?: boolean;
|
|
392
|
+
}
|
|
393
|
+
export interface Confirmed {
|
|
394
|
+
blockHash: string;
|
|
395
|
+
txIndex: number;
|
|
396
|
+
chainConfirmations: number;
|
|
397
|
+
fromGroupConfirmations: number;
|
|
398
|
+
toGroupConfirmations: number;
|
|
399
|
+
type: string;
|
|
400
|
+
}
|
|
401
|
+
export interface Conflicted {
|
|
402
|
+
blockHash: string;
|
|
403
|
+
txIndex: number;
|
|
404
|
+
chainConfirmations: number;
|
|
405
|
+
fromGroupConfirmations: number;
|
|
406
|
+
toGroupConfirmations: number;
|
|
407
|
+
type: string;
|
|
408
|
+
}
|
|
409
|
+
export interface Constant {
|
|
410
|
+
name: string;
|
|
411
|
+
value: Val;
|
|
412
|
+
}
|
|
413
|
+
export interface Contract {
|
|
414
|
+
code: string;
|
|
415
|
+
compilerOptions?: CompilerOptions;
|
|
416
|
+
}
|
|
417
|
+
export interface ContractEvent {
|
|
418
|
+
blockHash: string;
|
|
419
|
+
txId: string;
|
|
420
|
+
eventIndex: number;
|
|
421
|
+
fields: Val[];
|
|
422
|
+
}
|
|
423
|
+
export interface ContractEventByBlockHash {
|
|
424
|
+
txId: string;
|
|
425
|
+
contractAddress: string;
|
|
426
|
+
eventIndex: number;
|
|
427
|
+
fields: Val[];
|
|
428
|
+
}
|
|
429
|
+
export interface ContractEventByTxId {
|
|
430
|
+
blockHash: string;
|
|
431
|
+
contractAddress: string;
|
|
432
|
+
eventIndex: number;
|
|
433
|
+
fields: Val[];
|
|
434
|
+
}
|
|
435
|
+
export interface ContractEvents {
|
|
436
|
+
events: ContractEvent[];
|
|
437
|
+
nextStart: number;
|
|
438
|
+
}
|
|
439
|
+
export interface ContractEventsByBlockHash {
|
|
440
|
+
events: ContractEventByBlockHash[];
|
|
441
|
+
}
|
|
442
|
+
export interface ContractEventsByTxId {
|
|
443
|
+
events: ContractEventByTxId[];
|
|
444
|
+
}
|
|
445
|
+
export interface ContractOutput {
|
|
446
|
+
hint: number;
|
|
447
|
+
key: string;
|
|
448
|
+
attoAlphAmount: string;
|
|
449
|
+
address: string;
|
|
450
|
+
tokens: Token[];
|
|
451
|
+
type: string;
|
|
452
|
+
}
|
|
453
|
+
export interface ContractState {
|
|
454
|
+
address: string;
|
|
455
|
+
bytecode: string;
|
|
456
|
+
codeHash: string;
|
|
457
|
+
initialStateHash?: string;
|
|
458
|
+
immFields: Val[];
|
|
459
|
+
mutFields: Val[];
|
|
460
|
+
asset: AssetState;
|
|
461
|
+
}
|
|
462
|
+
export interface CurrentDifficulty {
|
|
463
|
+
difficulty: string;
|
|
464
|
+
}
|
|
465
|
+
export interface DebugMessage {
|
|
466
|
+
contractAddress: string;
|
|
467
|
+
message: string;
|
|
468
|
+
}
|
|
469
|
+
export interface DecodeUnsignedTx {
|
|
470
|
+
unsignedTx: string;
|
|
471
|
+
}
|
|
472
|
+
export interface DecodeUnsignedTxResult {
|
|
473
|
+
fromGroup: number;
|
|
474
|
+
toGroup: number;
|
|
475
|
+
unsignedTx: UnsignedTx;
|
|
476
|
+
}
|
|
477
|
+
export interface Destination {
|
|
478
|
+
address: string;
|
|
479
|
+
attoAlphAmount?: string;
|
|
480
|
+
tokens?: Token[];
|
|
481
|
+
lockTime?: number;
|
|
482
|
+
message?: string;
|
|
483
|
+
}
|
|
484
|
+
export type DiscoveryAction = Reachable | Unreachable;
|
|
485
|
+
export interface Enum {
|
|
486
|
+
name: string;
|
|
487
|
+
fields: EnumField[];
|
|
488
|
+
}
|
|
489
|
+
export interface EnumField {
|
|
490
|
+
name: string;
|
|
491
|
+
value: Val;
|
|
492
|
+
}
|
|
493
|
+
export interface EventSig {
|
|
494
|
+
name: string;
|
|
495
|
+
fieldNames: string[];
|
|
496
|
+
fieldTypes: string[];
|
|
497
|
+
}
|
|
498
|
+
export interface FieldsSig {
|
|
499
|
+
names: string[];
|
|
500
|
+
types: string[];
|
|
501
|
+
isMutable: boolean[];
|
|
502
|
+
}
|
|
503
|
+
export interface FixedAssetOutput {
|
|
504
|
+
hint: number;
|
|
505
|
+
key: string;
|
|
506
|
+
attoAlphAmount: string;
|
|
507
|
+
address: string;
|
|
508
|
+
tokens: Token[];
|
|
509
|
+
lockTime: number;
|
|
510
|
+
message: string;
|
|
511
|
+
}
|
|
512
|
+
export interface FunctionSig {
|
|
513
|
+
name: string;
|
|
514
|
+
usePreapprovedAssets: boolean;
|
|
515
|
+
useAssetsInContract: boolean;
|
|
516
|
+
isPublic: boolean;
|
|
517
|
+
paramNames: string[];
|
|
518
|
+
paramTypes: string[];
|
|
519
|
+
paramIsMutable: boolean[];
|
|
520
|
+
returnTypes: string[];
|
|
521
|
+
}
|
|
522
|
+
export interface GatewayTimeout {
|
|
523
|
+
detail: string;
|
|
524
|
+
}
|
|
525
|
+
export interface GhostUncleBlockEntry {
|
|
526
|
+
blockHash: string;
|
|
527
|
+
miner: string;
|
|
528
|
+
}
|
|
529
|
+
export interface Group {
|
|
530
|
+
group: number;
|
|
531
|
+
}
|
|
532
|
+
export interface HashRateResponse {
|
|
533
|
+
hashrate: string;
|
|
534
|
+
}
|
|
535
|
+
export interface HashesAtHeight {
|
|
536
|
+
headers: string[];
|
|
537
|
+
}
|
|
538
|
+
export interface InterCliquePeerInfo {
|
|
539
|
+
cliqueId: string;
|
|
540
|
+
brokerId: number;
|
|
541
|
+
groupNumPerBroker: number;
|
|
542
|
+
address: {
|
|
543
|
+
addr: string;
|
|
544
|
+
port: number;
|
|
545
|
+
};
|
|
546
|
+
isSynced: boolean;
|
|
547
|
+
clientVersion: string;
|
|
548
|
+
}
|
|
549
|
+
export interface InternalServerError {
|
|
550
|
+
detail: string;
|
|
551
|
+
}
|
|
552
|
+
export interface MapsSig {
|
|
553
|
+
names: string[];
|
|
554
|
+
types: string[];
|
|
555
|
+
}
|
|
556
|
+
export interface MemPooled {
|
|
557
|
+
type: string;
|
|
558
|
+
}
|
|
559
|
+
export interface MempoolTransactions {
|
|
560
|
+
fromGroup: number;
|
|
561
|
+
toGroup: number;
|
|
562
|
+
transactions: TransactionTemplate[];
|
|
563
|
+
}
|
|
564
|
+
export interface MinerAddresses {
|
|
565
|
+
addresses: string[];
|
|
566
|
+
}
|
|
567
|
+
export interface MinerAddressesInfo {
|
|
568
|
+
addresses: AddressInfo[];
|
|
569
|
+
}
|
|
570
|
+
export type MisbehaviorAction = Ban | Unban;
|
|
571
|
+
export interface MultipleCallContract {
|
|
572
|
+
calls: CallContract[];
|
|
573
|
+
}
|
|
574
|
+
export interface MultipleCallContractResult {
|
|
575
|
+
results: CallContractResult[];
|
|
576
|
+
}
|
|
577
|
+
export interface NodeInfo {
|
|
578
|
+
buildInfo: BuildInfo;
|
|
579
|
+
upnp: boolean;
|
|
580
|
+
externalAddress?: {
|
|
581
|
+
addr: string;
|
|
582
|
+
port: number;
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
export interface NodeVersion {
|
|
586
|
+
version: string;
|
|
587
|
+
}
|
|
588
|
+
export interface NotFound {
|
|
589
|
+
detail: string;
|
|
590
|
+
resource: string;
|
|
591
|
+
}
|
|
592
|
+
export type Output = AssetOutput | ContractOutput;
|
|
593
|
+
export interface OutputRef {
|
|
594
|
+
hint: number;
|
|
595
|
+
key: string;
|
|
596
|
+
}
|
|
597
|
+
export interface PeerAddress {
|
|
598
|
+
address: string;
|
|
599
|
+
restPort: number;
|
|
600
|
+
wsPort: number;
|
|
601
|
+
minerApiPort: number;
|
|
602
|
+
}
|
|
603
|
+
export interface PeerMisbehavior {
|
|
604
|
+
peer: string;
|
|
605
|
+
status: PeerStatus;
|
|
606
|
+
}
|
|
607
|
+
export type PeerStatus = Banned | Penalty;
|
|
608
|
+
export interface Penalty {
|
|
609
|
+
value: number;
|
|
610
|
+
type: string;
|
|
611
|
+
}
|
|
612
|
+
export interface Project {
|
|
613
|
+
code: string;
|
|
614
|
+
compilerOptions?: CompilerOptions;
|
|
615
|
+
}
|
|
616
|
+
export interface RawBlock {
|
|
617
|
+
value: string;
|
|
618
|
+
}
|
|
619
|
+
export interface RawTransaction {
|
|
620
|
+
value: string;
|
|
621
|
+
}
|
|
622
|
+
export interface Reachable {
|
|
623
|
+
peers: string[];
|
|
624
|
+
type: string;
|
|
625
|
+
}
|
|
626
|
+
export interface Result {
|
|
627
|
+
hashrate: string;
|
|
628
|
+
}
|
|
629
|
+
export interface RevealMnemonic {
|
|
630
|
+
password: string;
|
|
631
|
+
}
|
|
632
|
+
export interface RevealMnemonicResult {
|
|
633
|
+
mnemonic: string;
|
|
634
|
+
}
|
|
635
|
+
export interface RichAssetInput {
|
|
636
|
+
hint: number;
|
|
637
|
+
key: string;
|
|
638
|
+
unlockScript: string;
|
|
639
|
+
attoAlphAmount: string;
|
|
640
|
+
address: string;
|
|
641
|
+
tokens: Token[];
|
|
642
|
+
outputRefTxId: string;
|
|
643
|
+
}
|
|
644
|
+
export interface RichBlockAndEvents {
|
|
645
|
+
block: RichBlockEntry;
|
|
646
|
+
events: ContractEventByBlockHash[];
|
|
647
|
+
}
|
|
648
|
+
export interface RichBlockEntry {
|
|
649
|
+
hash: string;
|
|
650
|
+
timestamp: number;
|
|
651
|
+
chainFrom: number;
|
|
652
|
+
chainTo: number;
|
|
653
|
+
height: number;
|
|
654
|
+
deps: string[];
|
|
655
|
+
transactions: RichTransaction[];
|
|
656
|
+
nonce: string;
|
|
657
|
+
version: number;
|
|
658
|
+
depStateHash: string;
|
|
659
|
+
txsHash: string;
|
|
660
|
+
target: string;
|
|
661
|
+
ghostUncles: GhostUncleBlockEntry[];
|
|
662
|
+
conflictedTxs?: string[];
|
|
663
|
+
}
|
|
664
|
+
export interface RichBlocksAndEventsPerTimeStampRange {
|
|
665
|
+
blocksAndEvents: RichBlockAndEvents[][];
|
|
666
|
+
}
|
|
667
|
+
export interface RichContractInput {
|
|
668
|
+
hint: number;
|
|
669
|
+
key: string;
|
|
670
|
+
attoAlphAmount: string;
|
|
671
|
+
address: string;
|
|
672
|
+
tokens: Token[];
|
|
673
|
+
outputRefTxId: string;
|
|
674
|
+
}
|
|
675
|
+
export interface RichTransaction {
|
|
676
|
+
unsigned: RichUnsignedTx;
|
|
677
|
+
scriptExecutionOk: boolean;
|
|
678
|
+
contractInputs: RichContractInput[];
|
|
679
|
+
generatedOutputs: Output[];
|
|
680
|
+
inputSignatures: string[];
|
|
681
|
+
scriptSignatures: string[];
|
|
682
|
+
}
|
|
683
|
+
export interface RichUnsignedTx {
|
|
684
|
+
txId: string;
|
|
685
|
+
version: number;
|
|
686
|
+
networkId: number;
|
|
687
|
+
scriptOpt?: string;
|
|
688
|
+
gasAmount: number;
|
|
689
|
+
gasPrice: string;
|
|
690
|
+
inputs: RichAssetInput[];
|
|
691
|
+
fixedOutputs: FixedAssetOutput[];
|
|
692
|
+
}
|
|
693
|
+
export interface Script {
|
|
694
|
+
code: string;
|
|
695
|
+
compilerOptions?: CompilerOptions;
|
|
696
|
+
}
|
|
697
|
+
export interface SelfClique {
|
|
698
|
+
cliqueId: string;
|
|
699
|
+
nodes: PeerAddress[];
|
|
700
|
+
selfReady: boolean;
|
|
701
|
+
synced: boolean;
|
|
702
|
+
}
|
|
703
|
+
export interface ServiceUnavailable {
|
|
704
|
+
detail: string;
|
|
705
|
+
}
|
|
706
|
+
export interface Sign {
|
|
707
|
+
data: string;
|
|
708
|
+
}
|
|
709
|
+
export interface SignResult {
|
|
710
|
+
signature: string;
|
|
711
|
+
}
|
|
712
|
+
export interface SimulationResult {
|
|
713
|
+
contractInputs: AddressAssetState[];
|
|
714
|
+
generatedOutputs: AddressAssetState[];
|
|
715
|
+
}
|
|
716
|
+
export interface Source {
|
|
717
|
+
fromPublicKey: string;
|
|
718
|
+
destinations: Destination[];
|
|
719
|
+
fromPublicKeyType?: string;
|
|
720
|
+
gasAmount?: number;
|
|
721
|
+
utxos?: OutputRef[];
|
|
722
|
+
}
|
|
723
|
+
export interface StructSig {
|
|
724
|
+
name: string;
|
|
725
|
+
fieldNames: string[];
|
|
726
|
+
fieldTypes: string[];
|
|
727
|
+
isMutable: boolean[];
|
|
728
|
+
}
|
|
729
|
+
export interface SubContracts {
|
|
730
|
+
subContracts: string[];
|
|
731
|
+
nextStart: number;
|
|
732
|
+
}
|
|
733
|
+
export interface SubmitMultisig {
|
|
734
|
+
unsignedTx: string;
|
|
735
|
+
signatures: string[];
|
|
736
|
+
}
|
|
737
|
+
export interface SubmitTransaction {
|
|
738
|
+
unsignedTx: string;
|
|
739
|
+
signature: string;
|
|
740
|
+
}
|
|
741
|
+
export interface SubmitTxResult {
|
|
742
|
+
txId: string;
|
|
743
|
+
fromGroup: number;
|
|
744
|
+
toGroup: number;
|
|
745
|
+
}
|
|
746
|
+
export interface Sweep {
|
|
747
|
+
toAddress: string;
|
|
748
|
+
lockTime?: number;
|
|
749
|
+
gasAmount?: number;
|
|
750
|
+
gasPrice?: string;
|
|
751
|
+
utxosLimit?: number;
|
|
752
|
+
targetBlockHash?: string;
|
|
753
|
+
}
|
|
754
|
+
export interface SweepAddressTransaction {
|
|
755
|
+
txId: string;
|
|
756
|
+
unsignedTx: string;
|
|
757
|
+
gasAmount: number;
|
|
758
|
+
gasPrice: string;
|
|
759
|
+
}
|
|
760
|
+
export interface TargetToHashrate {
|
|
761
|
+
target: string;
|
|
762
|
+
}
|
|
763
|
+
export interface TestContract {
|
|
764
|
+
group?: number;
|
|
765
|
+
blockHash?: string;
|
|
766
|
+
blockTimeStamp?: number;
|
|
767
|
+
txId?: string;
|
|
768
|
+
address?: string;
|
|
769
|
+
callerContractAddress?: string;
|
|
770
|
+
bytecode: string;
|
|
771
|
+
initialImmFields?: Val[];
|
|
772
|
+
initialMutFields?: Val[];
|
|
773
|
+
initialAsset?: AssetState;
|
|
774
|
+
methodIndex?: number;
|
|
775
|
+
args?: Val[];
|
|
776
|
+
existingContracts?: ContractState[];
|
|
777
|
+
inputAssets?: TestInputAsset[];
|
|
778
|
+
dustAmount?: string;
|
|
779
|
+
}
|
|
780
|
+
export interface TestContractResult {
|
|
781
|
+
address: string;
|
|
782
|
+
codeHash: string;
|
|
783
|
+
returns: Val[];
|
|
784
|
+
gasUsed: number;
|
|
785
|
+
contracts: ContractState[];
|
|
786
|
+
txInputs: string[];
|
|
787
|
+
txOutputs: Output[];
|
|
788
|
+
events: ContractEventByTxId[];
|
|
789
|
+
debugMessages: DebugMessage[];
|
|
790
|
+
}
|
|
791
|
+
export interface TestInputAsset {
|
|
792
|
+
address: string;
|
|
793
|
+
asset: AssetState;
|
|
794
|
+
}
|
|
795
|
+
export interface Token {
|
|
796
|
+
id: string;
|
|
797
|
+
amount: string;
|
|
798
|
+
}
|
|
799
|
+
export interface Transaction {
|
|
800
|
+
unsigned: UnsignedTx;
|
|
801
|
+
scriptExecutionOk: boolean;
|
|
802
|
+
contractInputs: OutputRef[];
|
|
803
|
+
generatedOutputs: Output[];
|
|
804
|
+
inputSignatures: string[];
|
|
805
|
+
scriptSignatures: string[];
|
|
806
|
+
}
|
|
807
|
+
export interface TransactionTemplate {
|
|
808
|
+
unsigned: UnsignedTx;
|
|
809
|
+
inputSignatures: string[];
|
|
810
|
+
scriptSignatures: string[];
|
|
811
|
+
seenAt: number;
|
|
812
|
+
}
|
|
813
|
+
export interface Transfer {
|
|
814
|
+
destinations: Destination[];
|
|
815
|
+
gas?: number;
|
|
816
|
+
gasPrice?: string;
|
|
817
|
+
utxosLimit?: number;
|
|
818
|
+
}
|
|
819
|
+
export interface TransferResult {
|
|
820
|
+
txId: string;
|
|
821
|
+
fromGroup: number;
|
|
822
|
+
toGroup: number;
|
|
823
|
+
}
|
|
824
|
+
export interface TransferResults {
|
|
825
|
+
results: TransferResult[];
|
|
826
|
+
}
|
|
827
|
+
export interface TxNotFound {
|
|
828
|
+
type: string;
|
|
829
|
+
}
|
|
830
|
+
export type TxStatus = Confirmed | Conflicted | MemPooled | TxNotFound;
|
|
831
|
+
export interface UTXO {
|
|
832
|
+
ref: OutputRef;
|
|
833
|
+
amount: string;
|
|
834
|
+
tokens?: Token[];
|
|
835
|
+
lockTime?: number;
|
|
836
|
+
additionalData?: string;
|
|
837
|
+
}
|
|
838
|
+
export interface UTXOs {
|
|
839
|
+
utxos: UTXO[];
|
|
840
|
+
}
|
|
841
|
+
export interface Unauthorized {
|
|
842
|
+
detail: string;
|
|
843
|
+
}
|
|
844
|
+
export interface Unban {
|
|
845
|
+
peers: string[];
|
|
846
|
+
type: string;
|
|
847
|
+
}
|
|
848
|
+
export interface Unreachable {
|
|
849
|
+
peers: string[];
|
|
850
|
+
type: string;
|
|
851
|
+
}
|
|
852
|
+
export interface UnsignedTx {
|
|
853
|
+
txId: string;
|
|
854
|
+
version: number;
|
|
855
|
+
networkId: number;
|
|
856
|
+
scriptOpt?: string;
|
|
857
|
+
gasAmount: number;
|
|
858
|
+
gasPrice: string;
|
|
859
|
+
inputs: AssetInput[];
|
|
860
|
+
fixedOutputs: FixedAssetOutput[];
|
|
861
|
+
}
|
|
862
|
+
export type Val = ValAddress | ValArray | ValBool | ValByteVec | ValI256 | ValU256;
|
|
863
|
+
export interface ValAddress {
|
|
864
|
+
value: string;
|
|
865
|
+
type: string;
|
|
866
|
+
}
|
|
867
|
+
export interface ValArray {
|
|
868
|
+
value: Val[];
|
|
869
|
+
type: string;
|
|
870
|
+
}
|
|
871
|
+
export interface ValBool {
|
|
872
|
+
value: boolean;
|
|
873
|
+
type: string;
|
|
874
|
+
}
|
|
875
|
+
export interface ValByteVec {
|
|
876
|
+
value: string;
|
|
877
|
+
type: string;
|
|
878
|
+
}
|
|
879
|
+
export interface ValI256 {
|
|
880
|
+
value: string;
|
|
881
|
+
type: string;
|
|
882
|
+
}
|
|
883
|
+
export interface ValU256 {
|
|
884
|
+
value: string;
|
|
885
|
+
type: string;
|
|
886
|
+
}
|
|
887
|
+
export interface VerifySignature {
|
|
888
|
+
data: string;
|
|
889
|
+
signature: string;
|
|
890
|
+
publicKey: string;
|
|
891
|
+
}
|
|
892
|
+
export interface WalletCreation {
|
|
893
|
+
password: string;
|
|
894
|
+
walletName: string;
|
|
895
|
+
isMiner?: boolean;
|
|
896
|
+
mnemonicPassphrase?: string;
|
|
897
|
+
mnemonicSize?: number;
|
|
898
|
+
}
|
|
899
|
+
export interface WalletCreationResult {
|
|
900
|
+
walletName: string;
|
|
901
|
+
mnemonic: string;
|
|
902
|
+
}
|
|
903
|
+
export interface WalletRestore {
|
|
904
|
+
password: string;
|
|
905
|
+
mnemonic: string;
|
|
906
|
+
walletName: string;
|
|
907
|
+
isMiner?: boolean;
|
|
908
|
+
mnemonicPassphrase?: string;
|
|
909
|
+
}
|
|
910
|
+
export interface WalletRestoreResult {
|
|
911
|
+
walletName: string;
|
|
912
|
+
}
|
|
913
|
+
export interface WalletStatus {
|
|
914
|
+
walletName: string;
|
|
915
|
+
locked: boolean;
|
|
916
|
+
}
|
|
917
|
+
export interface WalletUnlock {
|
|
918
|
+
password: string;
|
|
919
|
+
mnemonicPassphrase?: string;
|
|
920
|
+
}
|
|
921
|
+
export type QueryParamsType = Record<string | number, any>;
|
|
922
|
+
export type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
|
|
923
|
+
export interface FullRequestParams extends Omit<RequestInit, 'body'> {
|
|
924
|
+
secure?: boolean;
|
|
925
|
+
path: string;
|
|
926
|
+
type?: ContentType;
|
|
927
|
+
query?: QueryParamsType;
|
|
928
|
+
format?: ResponseFormat;
|
|
929
|
+
body?: unknown;
|
|
930
|
+
baseUrl?: string;
|
|
931
|
+
cancelToken?: CancelToken;
|
|
932
|
+
}
|
|
933
|
+
export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
|
|
934
|
+
export interface ApiConfig<SecurityDataType = unknown> {
|
|
935
|
+
baseUrl?: string;
|
|
936
|
+
baseApiParams?: Omit<RequestParams, 'baseUrl' | 'cancelToken' | 'signal'>;
|
|
937
|
+
securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
|
|
938
|
+
customFetch?: typeof fetch;
|
|
939
|
+
}
|
|
940
|
+
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
|
|
941
|
+
data: D;
|
|
942
|
+
error: E;
|
|
943
|
+
}
|
|
944
|
+
type CancelToken = Symbol | string | number;
|
|
945
|
+
export declare enum ContentType {
|
|
946
|
+
Json = "application/json",
|
|
947
|
+
FormData = "multipart/form-data",
|
|
948
|
+
UrlEncoded = "application/x-www-form-urlencoded",
|
|
949
|
+
Text = "text/plain"
|
|
950
|
+
}
|
|
951
|
+
export declare class HttpClient<SecurityDataType = unknown> {
|
|
952
|
+
baseUrl: string;
|
|
953
|
+
private securityData;
|
|
954
|
+
private securityWorker?;
|
|
955
|
+
private abortControllers;
|
|
956
|
+
private customFetch;
|
|
957
|
+
private baseApiParams;
|
|
958
|
+
constructor(apiConfig?: ApiConfig<SecurityDataType>);
|
|
959
|
+
setSecurityData: (data: SecurityDataType | null) => void;
|
|
960
|
+
protected encodeQueryParam(key: string, value: any): string;
|
|
961
|
+
protected addQueryParam(query: QueryParamsType, key: string): string;
|
|
962
|
+
protected addArrayQueryParam(query: QueryParamsType, key: string): any;
|
|
963
|
+
protected toQueryString(rawQuery?: QueryParamsType): string;
|
|
964
|
+
protected addQueryParams(rawQuery?: QueryParamsType): string;
|
|
965
|
+
private contentFormatters;
|
|
966
|
+
protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
|
|
967
|
+
protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
|
|
968
|
+
abortRequest: (cancelToken: CancelToken) => void;
|
|
969
|
+
request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
|
|
970
|
+
}
|
|
971
|
+
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
972
|
+
wallets: {
|
|
973
|
+
getWallets: (params?: RequestParams) => Promise<WalletStatus[]>;
|
|
974
|
+
putWallets: (data: WalletRestore, params?: RequestParams) => Promise<WalletRestoreResult>;
|
|
975
|
+
postWallets: (data: WalletCreation, params?: RequestParams) => Promise<WalletCreationResult>;
|
|
976
|
+
getWalletsWalletName: (walletName: string, params?: RequestParams) => Promise<WalletStatus>;
|
|
977
|
+
deleteWalletsWalletName: (walletName: string, query: {
|
|
978
|
+
password: string;
|
|
979
|
+
}, params?: RequestParams) => Promise<void>;
|
|
980
|
+
postWalletsWalletNameLock: (walletName: string, params?: RequestParams) => Promise<void>;
|
|
981
|
+
postWalletsWalletNameUnlock: (walletName: string, data: WalletUnlock, params?: RequestParams) => Promise<void>;
|
|
982
|
+
getWalletsWalletNameBalances: (walletName: string, params?: RequestParams) => Promise<Balances>;
|
|
983
|
+
postWalletsWalletNameRevealMnemonic: (walletName: string, data: RevealMnemonic, params?: RequestParams) => Promise<RevealMnemonicResult>;
|
|
984
|
+
postWalletsWalletNameTransfer: (walletName: string, data: Transfer, params?: RequestParams) => Promise<TransferResult>;
|
|
985
|
+
postWalletsWalletNameSweepActiveAddress: (walletName: string, data: Sweep, params?: RequestParams) => Promise<TransferResults>;
|
|
986
|
+
postWalletsWalletNameSweepAllAddresses: (walletName: string, data: Sweep, params?: RequestParams) => Promise<TransferResults>;
|
|
987
|
+
postWalletsWalletNameSign: (walletName: string, data: Sign, params?: RequestParams) => Promise<SignResult>;
|
|
988
|
+
getWalletsWalletNameAddresses: (walletName: string, params?: RequestParams) => Promise<Addresses>;
|
|
989
|
+
getWalletsWalletNameAddressesAddress: (walletName: string, address: string, params?: RequestParams) => Promise<AddressInfo>;
|
|
990
|
+
getWalletsWalletNameMinerAddresses: (walletName: string, params?: RequestParams) => Promise<MinerAddressesInfo[]>;
|
|
991
|
+
postWalletsWalletNameDeriveNextAddress: (walletName: string, query?: {
|
|
992
|
+
group?: number;
|
|
993
|
+
}, params?: RequestParams) => Promise<AddressInfo>;
|
|
994
|
+
postWalletsWalletNameDeriveNextMinerAddresses: (walletName: string, params?: RequestParams) => Promise<AddressInfo[]>;
|
|
995
|
+
postWalletsWalletNameChangeActiveAddress: (walletName: string, data: ChangeActiveAddress, params?: RequestParams) => Promise<void>;
|
|
996
|
+
};
|
|
997
|
+
infos: {
|
|
998
|
+
getInfosNode: (params?: RequestParams) => Promise<NodeInfo>;
|
|
999
|
+
getInfosVersion: (params?: RequestParams) => Promise<NodeVersion>;
|
|
1000
|
+
getInfosChainParams: (params?: RequestParams) => Promise<ChainParams>;
|
|
1001
|
+
getInfosSelfClique: (params?: RequestParams) => Promise<SelfClique>;
|
|
1002
|
+
getInfosInterCliquePeerInfo: (params?: RequestParams) => Promise<InterCliquePeerInfo[]>;
|
|
1003
|
+
getInfosDiscoveredNeighbors: (params?: RequestParams) => Promise<BrokerInfo[]>;
|
|
1004
|
+
getInfosMisbehaviors: (params?: RequestParams) => Promise<PeerMisbehavior[]>;
|
|
1005
|
+
postInfosMisbehaviors: (data: MisbehaviorAction, params?: RequestParams) => Promise<void>;
|
|
1006
|
+
getInfosUnreachable: (params?: RequestParams) => Promise<string[]>;
|
|
1007
|
+
postInfosDiscovery: (data: DiscoveryAction, params?: RequestParams) => Promise<void>;
|
|
1008
|
+
getInfosHistoryHashrate: (query: {
|
|
1009
|
+
fromTs: number;
|
|
1010
|
+
toTs?: number;
|
|
1011
|
+
}, params?: RequestParams) => Promise<HashRateResponse>;
|
|
1012
|
+
getInfosCurrentHashrate: (query?: {
|
|
1013
|
+
timespan?: number;
|
|
1014
|
+
}, params?: RequestParams) => Promise<HashRateResponse>;
|
|
1015
|
+
getInfosCurrentDifficulty: (params?: RequestParams) => Promise<CurrentDifficulty>;
|
|
1016
|
+
};
|
|
1017
|
+
blockflow: {
|
|
1018
|
+
getBlockflowBlocks: (query: {
|
|
1019
|
+
fromTs: number;
|
|
1020
|
+
toTs?: number;
|
|
1021
|
+
}, params?: RequestParams) => Promise<BlocksPerTimeStampRange>;
|
|
1022
|
+
getBlockflowBlocksWithEvents: (query: {
|
|
1023
|
+
fromTs: number;
|
|
1024
|
+
toTs?: number;
|
|
1025
|
+
}, params?: RequestParams) => Promise<BlocksAndEventsPerTimeStampRange>;
|
|
1026
|
+
getBlockflowRichBlocks: (query: {
|
|
1027
|
+
fromTs: number;
|
|
1028
|
+
toTs?: number;
|
|
1029
|
+
}, params?: RequestParams) => Promise<RichBlocksAndEventsPerTimeStampRange>;
|
|
1030
|
+
getBlockflowBlocksBlockHash: (blockHash: string, params?: RequestParams) => Promise<BlockEntry>;
|
|
1031
|
+
getBlockflowMainChainBlockByGhostUncleGhostUncleHash: (ghostUncleHash: string, params?: RequestParams) => Promise<BlockEntry>;
|
|
1032
|
+
getBlockflowBlocksWithEventsBlockHash: (blockHash: string, params?: RequestParams) => Promise<BlockAndEvents>;
|
|
1033
|
+
getBlockflowRichBlocksBlockHash: (blockHash: string, params?: RequestParams) => Promise<RichBlockAndEvents>;
|
|
1034
|
+
getBlockflowIsBlockInMainChain: (query: {
|
|
1035
|
+
blockHash: string;
|
|
1036
|
+
}, params?: RequestParams) => Promise<boolean>;
|
|
1037
|
+
getBlockflowHashes: (query: {
|
|
1038
|
+
fromGroup: number;
|
|
1039
|
+
toGroup: number;
|
|
1040
|
+
height: number;
|
|
1041
|
+
}, params?: RequestParams) => Promise<HashesAtHeight>;
|
|
1042
|
+
getBlockflowChainInfo: (query: {
|
|
1043
|
+
fromGroup: number;
|
|
1044
|
+
toGroup: number;
|
|
1045
|
+
}, params?: RequestParams) => Promise<ChainInfo>;
|
|
1046
|
+
getBlockflowHeadersBlockHash: (blockHash: string, params?: RequestParams) => Promise<BlockHeaderEntry>;
|
|
1047
|
+
getBlockflowRawBlocksBlockHash: (blockHash: string, params?: RequestParams) => Promise<RawBlock>;
|
|
1048
|
+
};
|
|
1049
|
+
addresses: {
|
|
1050
|
+
getAddressesAddressBalance: (address: string, query?: {
|
|
1051
|
+
mempool?: boolean;
|
|
1052
|
+
}, params?: RequestParams) => Promise<Balance>;
|
|
1053
|
+
getAddressesAddressUtxos: (address: string, query?: {
|
|
1054
|
+
"error-if-exceed-max-utxos"?: boolean;
|
|
1055
|
+
}, params?: RequestParams) => Promise<UTXOs>;
|
|
1056
|
+
getAddressesAddressGroup: (address: string, params?: RequestParams) => Promise<Group>;
|
|
1057
|
+
};
|
|
1058
|
+
transactions: {
|
|
1059
|
+
postTransactionsBuild: (data: BuildTransferTx, params?: RequestParams) => Promise<BuildSimpleTransferTxResult | BuildGrouplessTransferTxResult>;
|
|
1060
|
+
postTransactionsBuildTransferFromOneToManyGroups: (data: BuildTransferTx, params?: RequestParams) => Promise<BuildSimpleTransferTxResult[]>;
|
|
1061
|
+
postTransactionsBuildMultiAddresses: (data: BuildMultiAddressesTransaction, params?: RequestParams) => Promise<BuildSimpleTransferTxResult>;
|
|
1062
|
+
postTransactionsSweepAddressBuild: (data: BuildSweepAddressTransactions, params?: RequestParams) => Promise<BuildSweepAddressTransactionsResult>;
|
|
1063
|
+
postTransactionsSubmit: (data: SubmitTransaction, params?: RequestParams) => Promise<SubmitTxResult>;
|
|
1064
|
+
postTransactionsDecodeUnsignedTx: (data: DecodeUnsignedTx, params?: RequestParams) => Promise<DecodeUnsignedTxResult>;
|
|
1065
|
+
getTransactionsDetailsTxid: (txId: string, query?: {
|
|
1066
|
+
fromGroup?: number;
|
|
1067
|
+
toGroup?: number;
|
|
1068
|
+
}, params?: RequestParams) => Promise<Transaction>;
|
|
1069
|
+
getTransactionsRichDetailsTxid: (txId: string, query?: {
|
|
1070
|
+
fromGroup?: number;
|
|
1071
|
+
toGroup?: number;
|
|
1072
|
+
}, params?: RequestParams) => Promise<RichTransaction>;
|
|
1073
|
+
getTransactionsRawTxid: (txId: string, query?: {
|
|
1074
|
+
fromGroup?: number;
|
|
1075
|
+
toGroup?: number;
|
|
1076
|
+
}, params?: RequestParams) => Promise<RawTransaction>;
|
|
1077
|
+
getTransactionsStatus: (query: {
|
|
1078
|
+
txId: string;
|
|
1079
|
+
fromGroup?: number;
|
|
1080
|
+
toGroup?: number;
|
|
1081
|
+
}, params?: RequestParams) => Promise<Confirmed | Conflicted | MemPooled | TxNotFound>;
|
|
1082
|
+
getTransactionsTxIdFromOutputref: (query: {
|
|
1083
|
+
hint: number;
|
|
1084
|
+
key: string;
|
|
1085
|
+
}, params?: RequestParams) => Promise<string>;
|
|
1086
|
+
postTransactionsBuildChained: (data: BuildChainedTx[], params?: RequestParams) => Promise<BuildChainedTxResult[]>;
|
|
1087
|
+
};
|
|
1088
|
+
mempool: {
|
|
1089
|
+
getMempoolTransactions: (params?: RequestParams) => Promise<MempoolTransactions[]>;
|
|
1090
|
+
deleteMempoolTransactions: (params?: RequestParams) => Promise<void>;
|
|
1091
|
+
putMempoolTransactionsRebroadcast: (query: {
|
|
1092
|
+
txId: string;
|
|
1093
|
+
}, params?: RequestParams) => Promise<void>;
|
|
1094
|
+
putMempoolTransactionsValidate: (params?: RequestParams) => Promise<void>;
|
|
1095
|
+
};
|
|
1096
|
+
contracts: {
|
|
1097
|
+
postContractsCompileScript: (data: Script, params?: RequestParams) => Promise<CompileScriptResult>;
|
|
1098
|
+
postContractsUnsignedTxExecuteScript: (data: BuildExecuteScriptTx, params?: RequestParams) => Promise<BuildSimpleExecuteScriptTxResult | BuildGrouplessExecuteScriptTxResult>;
|
|
1099
|
+
postContractsCompileContract: (data: Contract, params?: RequestParams) => Promise<CompileContractResult>;
|
|
1100
|
+
postContractsCompileProject: (data: Project, params?: RequestParams) => Promise<CompileProjectResult>;
|
|
1101
|
+
postContractsUnsignedTxDeployContract: (data: BuildDeployContractTx, params?: RequestParams) => Promise<BuildSimpleDeployContractTxResult | BuildGrouplessDeployContractTxResult>;
|
|
1102
|
+
getContractsAddressState: (address: string, params?: RequestParams) => Promise<ContractState>;
|
|
1103
|
+
getContractsCodehashCode: (codeHash: string, params?: RequestParams) => Promise<string>;
|
|
1104
|
+
postContractsTestContract: (data: TestContract, params?: RequestParams) => Promise<TestContractResult>;
|
|
1105
|
+
postContractsCallContract: (data: CallContract, params?: RequestParams) => Promise<CallContractFailed | CallContractSucceeded>;
|
|
1106
|
+
postContractsMulticallContract: (data: MultipleCallContract, params?: RequestParams) => Promise<MultipleCallContractResult>;
|
|
1107
|
+
getContractsAddressParent: (address: string, params?: RequestParams) => Promise<string>;
|
|
1108
|
+
getContractsAddressSubContracts: (address: string, query: {
|
|
1109
|
+
start: number;
|
|
1110
|
+
limit?: number;
|
|
1111
|
+
}, params?: RequestParams) => Promise<SubContracts>;
|
|
1112
|
+
getContractsAddressSubContractsCurrentCount: (address: string, params?: RequestParams) => Promise<number>;
|
|
1113
|
+
postContractsCallTxScript: (data: CallTxScript, params?: RequestParams) => Promise<CallTxScriptResult>;
|
|
1114
|
+
};
|
|
1115
|
+
multisig: {
|
|
1116
|
+
postMultisigAddress: (data: BuildMultisigAddress, params?: RequestParams) => Promise<BuildMultisigAddressResult>;
|
|
1117
|
+
postMultisigBuild: (data: BuildMultisig, params?: RequestParams) => Promise<BuildSimpleTransferTxResult | BuildGrouplessTransferTxResult>;
|
|
1118
|
+
postMultisigSweep: (data: BuildSweepMultisig, params?: RequestParams) => Promise<BuildSweepAddressTransactionsResult>;
|
|
1119
|
+
postMultisigSubmit: (data: SubmitMultisig, params?: RequestParams) => Promise<SubmitTxResult>;
|
|
1120
|
+
};
|
|
1121
|
+
miners: {
|
|
1122
|
+
postMinersCpuMining: (query: {
|
|
1123
|
+
action: string;
|
|
1124
|
+
}, params?: RequestParams) => Promise<boolean>;
|
|
1125
|
+
postMinersCpuMiningMineOneBlock: (query: {
|
|
1126
|
+
fromGroup: number;
|
|
1127
|
+
toGroup: number;
|
|
1128
|
+
}, params?: RequestParams) => Promise<boolean>;
|
|
1129
|
+
getMinersAddresses: (params?: RequestParams) => Promise<MinerAddresses>;
|
|
1130
|
+
putMinersAddresses: (data: MinerAddresses, params?: RequestParams) => Promise<void>;
|
|
1131
|
+
};
|
|
1132
|
+
events: {
|
|
1133
|
+
getEventsContractContractaddress: (contractAddress: string, query: {
|
|
1134
|
+
start: number;
|
|
1135
|
+
limit?: number;
|
|
1136
|
+
group?: number;
|
|
1137
|
+
}, params?: RequestParams) => Promise<ContractEvents>;
|
|
1138
|
+
getEventsContractContractaddressCurrentCount: (contractAddress: string, params?: RequestParams) => Promise<number>;
|
|
1139
|
+
getEventsTxIdTxid: (txId: string, query?: {
|
|
1140
|
+
group?: number;
|
|
1141
|
+
}, params?: RequestParams) => Promise<ContractEventsByTxId>;
|
|
1142
|
+
getEventsBlockHashBlockhash: (blockHash: string, query?: {
|
|
1143
|
+
group?: number;
|
|
1144
|
+
}, params?: RequestParams) => Promise<ContractEventsByBlockHash>;
|
|
1145
|
+
};
|
|
1146
|
+
utils: {
|
|
1147
|
+
postUtilsVerifySignature: (data: VerifySignature, params?: RequestParams) => Promise<boolean>;
|
|
1148
|
+
postUtilsTargetToHashrate: (data: TargetToHashrate, params?: RequestParams) => Promise<Result>;
|
|
1149
|
+
putUtilsCheckHashIndexing: (params?: RequestParams) => Promise<void>;
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
export {};
|