@alephium/web3 2.0.10 → 3.0.0-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +34 -40
- 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ReorgCallback, BlockSubscribeOptions, BlockSubscription } from './block';
|
package/dist/src/block/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.BlockSubscription = void 0;
|
|
21
|
-
var block_1 = require("./block");
|
|
22
|
-
Object.defineProperty(exports, "BlockSubscription", { enumerable: true, get: function () { return block_1.BlockSubscription; } });
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contractOutputRefsCodec = exports.contractOutputRefCodec = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
6
|
-
This file is part of the alephium project.
|
|
7
|
-
|
|
8
|
-
The library is free software: you can redistribute it and/or modify
|
|
9
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
(at your option) any later version.
|
|
12
|
-
|
|
13
|
-
The library is distributed in the hope that it will be useful,
|
|
14
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
GNU Lesser General Public License for more details.
|
|
17
|
-
|
|
18
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
const array_codec_1 = require("./array-codec");
|
|
22
|
-
const codec_1 = require("./codec");
|
|
23
|
-
const int_as_4bytes_codec_1 = require("./int-as-4bytes-codec");
|
|
24
|
-
exports.contractOutputRefCodec = new codec_1.ObjectCodec({
|
|
25
|
-
hint: int_as_4bytes_codec_1.intAs4BytesCodec,
|
|
26
|
-
key: codec_1.byte32Codec
|
|
27
|
-
});
|
|
28
|
-
exports.contractOutputRefsCodec = new array_codec_1.ArrayCodec(exports.contractOutputRefCodec);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.either = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
6
|
-
This file is part of the alephium project.
|
|
7
|
-
|
|
8
|
-
The library is free software: you can redistribute it and/or modify
|
|
9
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
(at your option) any later version.
|
|
12
|
-
|
|
13
|
-
The library is distributed in the hope that it will be useful,
|
|
14
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
GNU Lesser General Public License for more details.
|
|
17
|
-
|
|
18
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
const codec_1 = require("./codec");
|
|
22
|
-
function either(name, l, r) {
|
|
23
|
-
return new codec_1.EnumCodec(name, { Left: l, Right: r });
|
|
24
|
-
}
|
|
25
|
-
exports.either = either;
|
package/dist/src/codec/hash.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createHint = exports.djbIntHash = exports.blakeHash = void 0;
|
|
7
|
-
/*
|
|
8
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
9
|
-
This file is part of the alephium project.
|
|
10
|
-
|
|
11
|
-
The library is free software: you can redistribute it and/or modify
|
|
12
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
13
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
14
|
-
(at your option) any later version.
|
|
15
|
-
|
|
16
|
-
The library is distributed in the hope that it will be useful,
|
|
17
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
-
GNU Lesser General Public License for more details.
|
|
20
|
-
|
|
21
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
22
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
-
*/
|
|
24
|
-
const blakejs_1 = __importDefault(require("blakejs"));
|
|
25
|
-
function blakeHash(raw) {
|
|
26
|
-
return blakejs_1.default.blake2b(raw, undefined, 32);
|
|
27
|
-
}
|
|
28
|
-
exports.blakeHash = blakeHash;
|
|
29
|
-
function djbIntHash(bytes) {
|
|
30
|
-
let hash = 5381;
|
|
31
|
-
bytes.forEach((byte) => {
|
|
32
|
-
hash = (hash << 5) + hash + (byte & 0xff);
|
|
33
|
-
});
|
|
34
|
-
return hash;
|
|
35
|
-
}
|
|
36
|
-
exports.djbIntHash = djbIntHash;
|
|
37
|
-
function createHint(input) {
|
|
38
|
-
return djbIntHash(input) | 1;
|
|
39
|
-
}
|
|
40
|
-
exports.createHint = createHint;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.intAs4BytesCodec = exports.IntAs4BytesCodec = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
6
|
-
This file is part of the alephium project.
|
|
7
|
-
|
|
8
|
-
The library is free software: you can redistribute it and/or modify
|
|
9
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
(at your option) any later version.
|
|
12
|
-
|
|
13
|
-
The library is distributed in the hope that it will be useful,
|
|
14
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
GNU Lesser General Public License for more details.
|
|
17
|
-
|
|
18
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
const codec_1 = require("./codec");
|
|
22
|
-
class IntAs4BytesCodec extends codec_1.Codec {
|
|
23
|
-
encode(value) {
|
|
24
|
-
return new Uint8Array([(value >> 24) & 0xff, (value >> 16) & 0xff, (value >> 8) & 0xff, value & 0xff]);
|
|
25
|
-
}
|
|
26
|
-
_decode(input) {
|
|
27
|
-
const bytes = input.consumeBytes(4);
|
|
28
|
-
return ((bytes[0] & 0xff) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.IntAs4BytesCodec = IntAs4BytesCodec;
|
|
32
|
-
exports.intAs4BytesCodec = new IntAs4BytesCodec();
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.option = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
6
|
-
This file is part of the alephium project.
|
|
7
|
-
|
|
8
|
-
The library is free software: you can redistribute it and/or modify
|
|
9
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
(at your option) any later version.
|
|
12
|
-
|
|
13
|
-
The library is distributed in the hope that it will be useful,
|
|
14
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
GNU Lesser General Public License for more details.
|
|
17
|
-
|
|
18
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
const codec_1 = require("./codec");
|
|
22
|
-
const undefinedCodec = new (class extends codec_1.Codec {
|
|
23
|
-
encode() {
|
|
24
|
-
return new Uint8Array([]);
|
|
25
|
-
}
|
|
26
|
-
_decode() {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
})();
|
|
30
|
-
function option(codec) {
|
|
31
|
-
return new codec_1.EnumCodec('option', {
|
|
32
|
-
None: undefinedCodec,
|
|
33
|
-
Some: codec
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
exports.option = option;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.outputsCodec = exports.outputCodec = void 0;
|
|
21
|
-
const array_codec_1 = require("./array-codec");
|
|
22
|
-
const either_codec_1 = require("./either-codec");
|
|
23
|
-
const asset_output_codec_1 = require("./asset-output-codec");
|
|
24
|
-
const contract_output_codec_1 = require("./contract-output-codec");
|
|
25
|
-
exports.outputCodec = (0, either_codec_1.either)('output', asset_output_codec_1.assetOutputCodec, contract_output_codec_1.contractOutputCodec);
|
|
26
|
-
exports.outputsCodec = new array_codec_1.ArrayCodec(exports.outputCodec);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.safePublicKeyLikeCodec = exports.publicKeyLikeCodec = void 0;
|
|
21
|
-
const checksum_codec_1 = require("./checksum-codec");
|
|
22
|
-
const codec_1 = require("./codec");
|
|
23
|
-
const byte33Codec = new codec_1.FixedSizeCodec(33);
|
|
24
|
-
exports.publicKeyLikeCodec = new codec_1.EnumCodec('public key like', {
|
|
25
|
-
SecP256K1: byte33Codec,
|
|
26
|
-
SecP256R1: byte33Codec,
|
|
27
|
-
ED25519: codec_1.byte32Codec,
|
|
28
|
-
WebAuthn: byte33Codec
|
|
29
|
-
});
|
|
30
|
-
exports.safePublicKeyLikeCodec = new checksum_codec_1.Checksum(exports.publicKeyLikeCodec);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.statefulScriptCodecOpt = exports.scriptCodec = exports.ScriptCodec = void 0;
|
|
21
|
-
const codec_1 = require("./codec");
|
|
22
|
-
const method_codec_1 = require("./method-codec");
|
|
23
|
-
const option_codec_1 = require("./option-codec");
|
|
24
|
-
class ScriptCodec extends codec_1.Codec {
|
|
25
|
-
encode(input) {
|
|
26
|
-
return method_codec_1.methodsCodec.encode(input.methods);
|
|
27
|
-
}
|
|
28
|
-
_decode(input) {
|
|
29
|
-
return { methods: method_codec_1.methodsCodec._decode(input) };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.ScriptCodec = ScriptCodec;
|
|
33
|
-
exports.scriptCodec = new ScriptCodec();
|
|
34
|
-
exports.statefulScriptCodecOpt = (0, option_codec_1.option)(exports.scriptCodec);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.signaturesCodec = exports.signatureCodec = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
6
|
-
This file is part of the alephium project.
|
|
7
|
-
|
|
8
|
-
The library is free software: you can redistribute it and/or modify
|
|
9
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
(at your option) any later version.
|
|
12
|
-
|
|
13
|
-
The library is distributed in the hope that it will be useful,
|
|
14
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
GNU Lesser General Public License for more details.
|
|
17
|
-
|
|
18
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
const array_codec_1 = require("./array-codec");
|
|
22
|
-
const codec_1 = require("./codec");
|
|
23
|
-
exports.signatureCodec = new codec_1.FixedSizeCodec(64);
|
|
24
|
-
exports.signaturesCodec = new array_codec_1.ArrayCodec(exports.signatureCodec);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.tokensCodec = exports.tokenCodec = void 0;
|
|
21
|
-
const compact_int_codec_1 = require("./compact-int-codec");
|
|
22
|
-
const codec_1 = require("./codec");
|
|
23
|
-
const array_codec_1 = require("./array-codec");
|
|
24
|
-
exports.tokenCodec = new codec_1.ObjectCodec({
|
|
25
|
-
tokenId: codec_1.byte32Codec,
|
|
26
|
-
amount: compact_int_codec_1.u256Codec
|
|
27
|
-
});
|
|
28
|
-
exports.tokensCodec = new array_codec_1.ArrayCodec(exports.tokenCodec);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/src/debug.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.disableContractDebugMessage = exports.enableContractDebugMessage = exports.isContractDebugMessageEnabled = exports.disableDebugMode = exports.enableDebugMode = exports.isDebugModeEnabled = void 0;
|
|
21
|
-
let debugModeEnabled = false;
|
|
22
|
-
function isDebugModeEnabled() {
|
|
23
|
-
return debugModeEnabled;
|
|
24
|
-
}
|
|
25
|
-
exports.isDebugModeEnabled = isDebugModeEnabled;
|
|
26
|
-
function enableDebugMode() {
|
|
27
|
-
debugModeEnabled = true;
|
|
28
|
-
}
|
|
29
|
-
exports.enableDebugMode = enableDebugMode;
|
|
30
|
-
function disableDebugMode() {
|
|
31
|
-
debugModeEnabled = false;
|
|
32
|
-
}
|
|
33
|
-
exports.disableDebugMode = disableDebugMode;
|
|
34
|
-
let contractDebugMessageEnabled = true;
|
|
35
|
-
function isContractDebugMessageEnabled() {
|
|
36
|
-
return contractDebugMessageEnabled;
|
|
37
|
-
}
|
|
38
|
-
exports.isContractDebugMessageEnabled = isContractDebugMessageEnabled;
|
|
39
|
-
function enableContractDebugMessage() {
|
|
40
|
-
contractDebugMessageEnabled = true;
|
|
41
|
-
}
|
|
42
|
-
exports.enableContractDebugMessage = enableContractDebugMessage;
|
|
43
|
-
function disableContractDebugMessage() {
|
|
44
|
-
contractDebugMessageEnabled = false;
|
|
45
|
-
}
|
|
46
|
-
exports.disableContractDebugMessage = disableContractDebugMessage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { validateExchangeAddress, getSenderAddress, isALPHTransferTx, getALPHDepositInfo, BaseDepositInfo, TokenDepositInfo, DepositInfo, getDepositInfo } from './exchange';
|
package/dist/src/utils/djb2.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
function djb2(bytes) {
|
|
21
|
-
let hash = 5381;
|
|
22
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
23
|
-
hash = ((hash << 5) + hash + (bytes[`${i}`] & 0xff)) | 0;
|
|
24
|
-
}
|
|
25
|
-
return hash;
|
|
26
|
-
}
|
|
27
|
-
exports.default = djb2;
|
package/dist/src/utils/sign.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
22
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
23
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
24
|
-
}
|
|
25
|
-
Object.defineProperty(o, k2, desc);
|
|
26
|
-
}) : (function(o, m, k, k2) {
|
|
27
|
-
if (k2 === undefined) k2 = k;
|
|
28
|
-
o[k2] = m[k];
|
|
29
|
-
}));
|
|
30
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
31
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
32
|
-
}) : function(o, v) {
|
|
33
|
-
o["default"] = v;
|
|
34
|
-
});
|
|
35
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
36
|
-
if (mod && mod.__esModule) return mod;
|
|
37
|
-
var result = {};
|
|
38
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
39
|
-
__setModuleDefault(result, mod);
|
|
40
|
-
return result;
|
|
41
|
-
};
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.verifySignature = exports.sign = void 0;
|
|
44
|
-
const elliptic_1 = require("elliptic");
|
|
45
|
-
const utils_1 = require("../utils");
|
|
46
|
-
const necc = __importStar(require("@noble/secp256k1"));
|
|
47
|
-
const crypto_1 = require("crypto");
|
|
48
|
-
const ec = new elliptic_1.ec('secp256k1');
|
|
49
|
-
necc.utils.sha256Sync = (...messages) => {
|
|
50
|
-
const sha256 = (0, crypto_1.createHash)('sha256');
|
|
51
|
-
for (const message of messages)
|
|
52
|
-
sha256.update(message);
|
|
53
|
-
return sha256.digest();
|
|
54
|
-
};
|
|
55
|
-
necc.utils.hmacSha256Sync = (key, ...messages) => {
|
|
56
|
-
const hash = (0, crypto_1.createHmac)('sha256', key);
|
|
57
|
-
messages.forEach((m) => hash.update(m));
|
|
58
|
-
return Uint8Array.from(hash.digest());
|
|
59
|
-
};
|
|
60
|
-
function checkKeyType(keyType) {
|
|
61
|
-
if (keyType !== 'default' && keyType !== 'bip340-schnorr' && keyType !== 'gl-secp256k1') {
|
|
62
|
-
throw new Error(`Invalid key type ${keyType}, only supports secp256k1 and schnorr for now`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// hash has to be 32 bytes
|
|
66
|
-
function sign(hash, privateKey, _keyType) {
|
|
67
|
-
const keyType = _keyType ?? 'default';
|
|
68
|
-
checkKeyType(keyType);
|
|
69
|
-
if (keyType === 'default' || keyType === 'gl-secp256k1') {
|
|
70
|
-
const key = ec.keyFromPrivate(privateKey);
|
|
71
|
-
const signature = key.sign(hash);
|
|
72
|
-
return (0, utils_1.encodeSignature)(signature);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
const signature = necc.schnorr.signSync((0, utils_1.hexToBinUnsafe)(hash), (0, utils_1.hexToBinUnsafe)(privateKey));
|
|
76
|
-
return (0, utils_1.binToHex)(signature);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.sign = sign;
|
|
80
|
-
function verifySignature(hash, publicKey, signature, _keyType) {
|
|
81
|
-
const keyType = _keyType ?? 'default';
|
|
82
|
-
checkKeyType(keyType);
|
|
83
|
-
try {
|
|
84
|
-
if (keyType === 'default' || keyType === 'gl-secp256k1') {
|
|
85
|
-
const key = ec.keyFromPublic(publicKey, 'hex');
|
|
86
|
-
return key.verify(hash, (0, utils_1.signatureDecode)(ec, signature));
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
return necc.schnorr.verifySync((0, utils_1.hexToBinUnsafe)(signature), (0, utils_1.hexToBinUnsafe)(hash), (0, utils_1.hexToBinUnsafe)(publicKey));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.verifySignature = verifySignature;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
4
|
-
This file is part of the alephium project.
|
|
5
|
-
|
|
6
|
-
The library is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
The library is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Lesser General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.WebCrypto = void 0;
|
|
21
|
-
const crypto_1 = require("crypto");
|
|
22
|
-
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
23
|
-
class WebCrypto {
|
|
24
|
-
constructor() {
|
|
25
|
-
this.subtle = isBrowser ? globalThis.crypto.subtle : crypto_1.webcrypto ? crypto_1.webcrypto.subtle : crypto.subtle;
|
|
26
|
-
}
|
|
27
|
-
getRandomValues(array) {
|
|
28
|
-
if (!ArrayBuffer.isView(array)) {
|
|
29
|
-
throw new TypeError("Failed to execute 'getRandomValues' on 'Crypto': parameter 1 is not of type 'ArrayBufferView'");
|
|
30
|
-
}
|
|
31
|
-
const bytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);
|
|
32
|
-
// Prefer global Web Crypto (e.g. react-native-get-random-values) for mobile compatibility
|
|
33
|
-
if (globalThis.crypto && typeof globalThis.crypto.getRandomValues === 'function') {
|
|
34
|
-
globalThis.crypto.getRandomValues(bytes);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
(0, crypto_1.randomFillSync)(bytes);
|
|
38
|
-
}
|
|
39
|
-
return array;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.WebCrypto = WebCrypto;
|
package/webpack.config.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2018 - 2022 The Alephium Authors
|
|
3
|
-
This file is part of the alephium project.
|
|
4
|
-
|
|
5
|
-
The library is free software: you can redistribute it and/or modify
|
|
6
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
7
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
(at your option) any later version.
|
|
9
|
-
|
|
10
|
-
The library is distributed in the hope that it will be useful,
|
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
GNU Lesser General Public License for more details.
|
|
14
|
-
|
|
15
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
16
|
-
along with the library. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
const webpack = require('webpack')
|
|
20
|
-
|
|
21
|
-
module.exports = {
|
|
22
|
-
mode: 'production',
|
|
23
|
-
entry: {
|
|
24
|
-
alephium: './dist/src/index.js'
|
|
25
|
-
},
|
|
26
|
-
plugins: [
|
|
27
|
-
new webpack.SourceMapDevToolPlugin({ filename: '[file].map' }),
|
|
28
|
-
new webpack.IgnorePlugin({
|
|
29
|
-
checkResource(resource) {
|
|
30
|
-
// The "bip39/src/wordlists" node module consists of json files for multiple languages. We only need English.
|
|
31
|
-
return /.*\/wordlists\/(?!english).*\.json/.test(resource)
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
],
|
|
35
|
-
resolve: {
|
|
36
|
-
extensions: ['.js'],
|
|
37
|
-
fallback: {
|
|
38
|
-
fs: false,
|
|
39
|
-
stream: require.resolve('stream-browserify'),
|
|
40
|
-
crypto: require.resolve('crypto-browserify')
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
output: {
|
|
44
|
-
filename: 'alephium-web3.min.js',
|
|
45
|
-
library: {
|
|
46
|
-
name: 'alephium',
|
|
47
|
-
type: 'umd'
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
experiments: {
|
|
51
|
-
asyncWebAssembly: true
|
|
52
|
-
},
|
|
53
|
-
optimization: {
|
|
54
|
-
minimize: true
|
|
55
|
-
}
|
|
56
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|