@ckb-ccc/core 0.0.0-canary-20250214032000
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/CHANGELOG.md +375 -0
- package/README.md +41 -0
- package/dist/address/address.advanced.d.ts +65 -0
- package/dist/address/address.advanced.d.ts.map +1 -0
- package/dist/address/address.advanced.js +147 -0
- package/dist/address/advanced.d.ts +2 -0
- package/dist/address/advanced.d.ts.map +1 -0
- package/dist/address/advanced.js +1 -0
- package/dist/address/index.d.ts +58 -0
- package/dist/address/index.d.ts.map +1 -0
- package/dist/address/index.js +78 -0
- package/dist/advanced.d.ts +3 -0
- package/dist/advanced.d.ts.map +1 -0
- package/dist/advanced.js +2 -0
- package/dist/advancedBarrel.d.ts +7 -0
- package/dist/advancedBarrel.d.ts.map +1 -0
- package/dist/advancedBarrel.js +6 -0
- package/dist/barrel.d.ts +14 -0
- package/dist/barrel.d.ts.map +1 -0
- package/dist/barrel.js +13 -0
- package/dist/bytes/advanced.d.ts +6 -0
- package/dist/bytes/advanced.d.ts.map +1 -0
- package/dist/bytes/advanced.js +1 -0
- package/dist/bytes/index.d.ts +108 -0
- package/dist/bytes/index.d.ts.map +1 -0
- package/dist/bytes/index.js +151 -0
- package/dist/ckb/advanced.d.ts +3 -0
- package/dist/ckb/advanced.d.ts.map +1 -0
- package/dist/ckb/advanced.js +2 -0
- package/dist/ckb/index.d.ts +4 -0
- package/dist/ckb/index.d.ts.map +1 -0
- package/dist/ckb/index.js +3 -0
- package/dist/ckb/script.advanced.d.ts +5 -0
- package/dist/ckb/script.advanced.d.ts.map +1 -0
- package/dist/ckb/script.advanced.js +13 -0
- package/dist/ckb/script.d.ts +143 -0
- package/dist/ckb/script.d.ts.map +1 -0
- package/dist/ckb/script.js +167 -0
- package/dist/ckb/transaction.advanced.d.ts +5 -0
- package/dist/ckb/transaction.advanced.d.ts.map +1 -0
- package/dist/ckb/transaction.advanced.js +9 -0
- package/dist/ckb/transaction.d.ts +893 -0
- package/dist/ckb/transaction.d.ts.map +1 -0
- package/dist/ckb/transaction.js +1299 -0
- package/dist/ckb/transactionLumos.d.ts +30 -0
- package/dist/ckb/transactionLumos.d.ts.map +1 -0
- package/dist/ckb/transactionLumos.js +1 -0
- package/dist/client/advanced.d.ts +6 -0
- package/dist/client/advanced.d.ts.map +1 -0
- package/dist/client/advanced.js +5 -0
- package/dist/client/cache/advanced.d.ts +2 -0
- package/dist/client/cache/advanced.d.ts.map +1 -0
- package/dist/client/cache/advanced.js +1 -0
- package/dist/client/cache/cache.d.ts +91 -0
- package/dist/client/cache/cache.d.ts.map +1 -0
- package/dist/client/cache/cache.js +128 -0
- package/dist/client/cache/index.d.ts +3 -0
- package/dist/client/cache/index.d.ts.map +1 -0
- package/dist/client/cache/index.js +2 -0
- package/dist/client/cache/memory.advanced.d.ts +22 -0
- package/dist/client/cache/memory.advanced.d.ts.map +1 -0
- package/dist/client/cache/memory.advanced.js +118 -0
- package/dist/client/cache/memory.d.ts +44 -0
- package/dist/client/cache/memory.d.ts.map +1 -0
- package/dist/client/cache/memory.js +137 -0
- package/dist/client/client.d.ts +98 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +323 -0
- package/dist/client/clientPublicMainnet.advanced.d.ts +3 -0
- package/dist/client/clientPublicMainnet.advanced.d.ts.map +1 -0
- package/dist/client/clientPublicMainnet.advanced.js +326 -0
- package/dist/client/clientPublicMainnet.d.ts +16 -0
- package/dist/client/clientPublicMainnet.d.ts.map +1 -0
- package/dist/client/clientPublicMainnet.js +40 -0
- package/dist/client/clientPublicTestnet.advanced.d.ts +3 -0
- package/dist/client/clientPublicTestnet.advanced.d.ts.map +1 -0
- package/dist/client/clientPublicTestnet.advanced.js +336 -0
- package/dist/client/clientPublicTestnet.d.ts +16 -0
- package/dist/client/clientPublicTestnet.d.ts.map +1 -0
- package/dist/client/clientPublicTestnet.js +40 -0
- package/dist/client/clientTypes.advanced.d.ts +26 -0
- package/dist/client/clientTypes.advanced.d.ts.map +1 -0
- package/dist/client/clientTypes.advanced.js +7 -0
- package/dist/client/clientTypes.d.ts +360 -0
- package/dist/client/clientTypes.d.ts.map +1 -0
- package/dist/client/clientTypes.js +259 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +6 -0
- package/dist/client/jsonRpc/advanced.d.ts +3 -0
- package/dist/client/jsonRpc/advanced.d.ts.map +1 -0
- package/dist/client/jsonRpc/advanced.js +2 -0
- package/dist/client/jsonRpc/client.d.ts +160 -0
- package/dist/client/jsonRpc/client.d.ts.map +1 -0
- package/dist/client/jsonRpc/client.js +220 -0
- package/dist/client/jsonRpc/index.d.ts +2 -0
- package/dist/client/jsonRpc/index.d.ts.map +1 -0
- package/dist/client/jsonRpc/index.js +1 -0
- package/dist/client/jsonRpc/transformers.d.ts +51 -0
- package/dist/client/jsonRpc/transformers.d.ts.map +1 -0
- package/dist/client/jsonRpc/transformers.js +246 -0
- package/dist/client/jsonRpc/types.d.ts +101 -0
- package/dist/client/jsonRpc/types.d.ts.map +1 -0
- package/dist/client/jsonRpc/types.js +1 -0
- package/dist/fixedPoint/index.d.ts +55 -0
- package/dist/fixedPoint/index.d.ts.map +1 -0
- package/dist/fixedPoint/index.js +68 -0
- package/dist/hasher/advanced.d.ts +2 -0
- package/dist/hasher/advanced.d.ts.map +1 -0
- package/dist/hasher/advanced.js +1 -0
- package/dist/hasher/hasher.d.ts +35 -0
- package/dist/hasher/hasher.d.ts.map +1 -0
- package/dist/hasher/hasher.js +1 -0
- package/dist/hasher/hasherCkb.d.ts +73 -0
- package/dist/hasher/hasherCkb.d.ts.map +1 -0
- package/dist/hasher/hasherCkb.js +88 -0
- package/dist/hasher/hasherKeecak256.d.ts +41 -0
- package/dist/hasher/hasherKeecak256.d.ts.map +1 -0
- package/dist/hasher/hasherKeecak256.js +46 -0
- package/dist/hasher/index.d.ts +4 -0
- package/dist/hasher/index.d.ts.map +1 -0
- package/dist/hasher/index.js +3 -0
- package/dist/hex/index.d.ts +27 -0
- package/dist/hex/index.d.ts.map +1 -0
- package/dist/hex/index.js +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/jsonRpc/advanced.d.ts +2 -0
- package/dist/jsonRpc/advanced.d.ts.map +1 -0
- package/dist/jsonRpc/advanced.js +1 -0
- package/dist/jsonRpc/index.d.ts +2 -0
- package/dist/jsonRpc/index.d.ts.map +1 -0
- package/dist/jsonRpc/index.js +1 -0
- package/dist/jsonRpc/requestor.d.ts +49 -0
- package/dist/jsonRpc/requestor.d.ts.map +1 -0
- package/dist/jsonRpc/requestor.js +109 -0
- package/dist/jsonRpc/transports/advanced.d.ts +6 -0
- package/dist/jsonRpc/transports/advanced.d.ts.map +1 -0
- package/dist/jsonRpc/transports/advanced.js +5 -0
- package/dist/jsonRpc/transports/factory.d.ts +6 -0
- package/dist/jsonRpc/transports/factory.d.ts.map +1 -0
- package/dist/jsonRpc/transports/factory.js +8 -0
- package/dist/jsonRpc/transports/fallback.d.ts +8 -0
- package/dist/jsonRpc/transports/fallback.d.ts.map +1 -0
- package/dist/jsonRpc/transports/fallback.js +22 -0
- package/dist/jsonRpc/transports/http.d.ts +8 -0
- package/dist/jsonRpc/transports/http.d.ts.map +1 -0
- package/dist/jsonRpc/transports/http.js +22 -0
- package/dist/jsonRpc/transports/transport.d.ts +18 -0
- package/dist/jsonRpc/transports/transport.d.ts.map +1 -0
- package/dist/jsonRpc/transports/transport.js +1 -0
- package/dist/jsonRpc/transports/webSocket.d.ts +11 -0
- package/dist/jsonRpc/transports/webSocket.d.ts.map +1 -0
- package/dist/jsonRpc/transports/webSocket.js +87 -0
- package/dist/keystore/index.d.ts +31 -0
- package/dist/keystore/index.d.ts.map +1 -0
- package/dist/keystore/index.js +106 -0
- package/dist/molecule/barrel.d.ts +4 -0
- package/dist/molecule/barrel.d.ts.map +1 -0
- package/dist/molecule/barrel.js +3 -0
- package/dist/molecule/codec.d.ts +120 -0
- package/dist/molecule/codec.d.ts.map +1 -0
- package/dist/molecule/codec.js +468 -0
- package/dist/molecule/entity.d.ts +119 -0
- package/dist/molecule/entity.d.ts.map +1 -0
- package/dist/molecule/entity.js +134 -0
- package/dist/molecule/index.d.ts +2 -0
- package/dist/molecule/index.d.ts.map +1 -0
- package/dist/molecule/index.js +1 -0
- package/dist/molecule/predefined.d.ts +57 -0
- package/dist/molecule/predefined.d.ts.map +1 -0
- package/dist/molecule/predefined.js +83 -0
- package/dist/num/index.d.ts +148 -0
- package/dist/num/index.d.ts.map +1 -0
- package/dist/num/index.js +188 -0
- package/dist/package.json +3 -0
- package/dist/signer/btc/index.d.ts +4 -0
- package/dist/signer/btc/index.d.ts.map +1 -0
- package/dist/signer/btc/index.js +3 -0
- package/dist/signer/btc/signerBtc.d.ts +59 -0
- package/dist/signer/btc/signerBtc.d.ts.map +1 -0
- package/dist/signer/btc/signerBtc.js +83 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts +55 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.js +61 -0
- package/dist/signer/btc/verify.d.ts +19 -0
- package/dist/signer/btc/verify.d.ts.map +1 -0
- package/dist/signer/btc/verify.js +33 -0
- package/dist/signer/ckb/index.d.ts +6 -0
- package/dist/signer/ckb/index.d.ts.map +1 -0
- package/dist/signer/ckb/index.js +5 -0
- package/dist/signer/ckb/signerCkbPrivateKey.d.ts +16 -0
- package/dist/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -0
- package/dist/signer/ckb/signerCkbPrivateKey.js +42 -0
- package/dist/signer/ckb/signerCkbPublicKey.d.ts +27 -0
- package/dist/signer/ckb/signerCkbPublicKey.d.ts.map +1 -0
- package/dist/signer/ckb/signerCkbPublicKey.js +105 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts +56 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.js +66 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.d.ts +11 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.js +20 -0
- package/dist/signer/ckb/verifyJoyId.d.ts +6 -0
- package/dist/signer/ckb/verifyJoyId.d.ts.map +1 -0
- package/dist/signer/ckb/verifyJoyId.js +16 -0
- package/dist/signer/doge/index.d.ts +5 -0
- package/dist/signer/doge/index.d.ts.map +1 -0
- package/dist/signer/doge/index.js +4 -0
- package/dist/signer/doge/signerDoge.d.ts +52 -0
- package/dist/signer/doge/signerDoge.d.ts.map +1 -0
- package/dist/signer/doge/signerDoge.js +82 -0
- package/dist/signer/doge/signerDogeAddressReadonly.d.ts +41 -0
- package/dist/signer/doge/signerDogeAddressReadonly.d.ts.map +1 -0
- package/dist/signer/doge/signerDogeAddressReadonly.js +45 -0
- package/dist/signer/doge/signerDogePrivateKey.d.ts +52 -0
- package/dist/signer/doge/signerDogePrivateKey.d.ts.map +1 -0
- package/dist/signer/doge/signerDogePrivateKey.js +68 -0
- package/dist/signer/doge/verify.d.ts +6 -0
- package/dist/signer/doge/verify.d.ts.map +1 -0
- package/dist/signer/doge/verify.js +19 -0
- package/dist/signer/dummy/alwaysError.d.ts +12 -0
- package/dist/signer/dummy/alwaysError.d.ts.map +1 -0
- package/dist/signer/dummy/alwaysError.js +13 -0
- package/dist/signer/dummy/dummy.d.ts +15 -0
- package/dist/signer/dummy/dummy.d.ts.map +1 -0
- package/dist/signer/dummy/dummy.js +22 -0
- package/dist/signer/dummy/index.d.ts +4 -0
- package/dist/signer/dummy/index.d.ts.map +1 -0
- package/dist/signer/dummy/index.js +3 -0
- package/dist/signer/dummy/openLink.d.ts +12 -0
- package/dist/signer/dummy/openLink.d.ts.map +1 -0
- package/dist/signer/dummy/openLink.js +13 -0
- package/dist/signer/evm/index.d.ts +4 -0
- package/dist/signer/evm/index.d.ts.map +1 -0
- package/dist/signer/evm/index.js +3 -0
- package/dist/signer/evm/signerEvm.d.ts +59 -0
- package/dist/signer/evm/signerEvm.d.ts.map +1 -0
- package/dist/signer/evm/signerEvm.js +139 -0
- package/dist/signer/evm/signerEvmAddressReadonly.d.ts +47 -0
- package/dist/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -0
- package/dist/signer/evm/signerEvmAddressReadonly.js +51 -0
- package/dist/signer/evm/verify.d.ts +6 -0
- package/dist/signer/evm/verify.d.ts.map +1 -0
- package/dist/signer/evm/verify.js +9 -0
- package/dist/signer/index.d.ts +8 -0
- package/dist/signer/index.d.ts.map +1 -0
- package/dist/signer/index.js +7 -0
- package/dist/signer/nostr/index.d.ts +4 -0
- package/dist/signer/nostr/index.d.ts.map +1 -0
- package/dist/signer/nostr/index.js +3 -0
- package/dist/signer/nostr/signerNostr.d.ts +72 -0
- package/dist/signer/nostr/signerNostr.d.ts.map +1 -0
- package/dist/signer/nostr/signerNostr.js +88 -0
- package/dist/signer/nostr/signerNostrPrivateKey.d.ts +12 -0
- package/dist/signer/nostr/signerNostrPrivateKey.d.ts.map +1 -0
- package/dist/signer/nostr/signerNostrPrivateKey.js +28 -0
- package/dist/signer/nostr/verify.d.ts +9 -0
- package/dist/signer/nostr/verify.d.ts.map +1 -0
- package/dist/signer/nostr/verify.js +55 -0
- package/dist/signer/signer/index.d.ts +237 -0
- package/dist/signer/signer/index.d.ts.map +1 -0
- package/dist/signer/signer/index.js +274 -0
- package/dist/utils/index.d.ts +97 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +55 -0
- package/dist.commonjs/address/address.advanced.d.ts +65 -0
- package/dist.commonjs/address/address.advanced.d.ts.map +1 -0
- package/dist.commonjs/address/address.advanced.js +152 -0
- package/dist.commonjs/address/advanced.d.ts +2 -0
- package/dist.commonjs/address/advanced.d.ts.map +1 -0
- package/dist.commonjs/address/advanced.js +17 -0
- package/dist.commonjs/address/index.d.ts +58 -0
- package/dist.commonjs/address/index.d.ts.map +1 -0
- package/dist.commonjs/address/index.js +82 -0
- package/dist.commonjs/advanced.d.ts +3 -0
- package/dist.commonjs/advanced.d.ts.map +1 -0
- package/dist.commonjs/advanced.js +41 -0
- package/dist.commonjs/advancedBarrel.d.ts +7 -0
- package/dist.commonjs/advancedBarrel.d.ts.map +1 -0
- package/dist.commonjs/advancedBarrel.js +22 -0
- package/dist.commonjs/barrel.d.ts +14 -0
- package/dist.commonjs/barrel.d.ts.map +1 -0
- package/dist.commonjs/barrel.js +29 -0
- package/dist.commonjs/bytes/advanced.d.ts +6 -0
- package/dist.commonjs/bytes/advanced.d.ts.map +1 -0
- package/dist.commonjs/bytes/advanced.js +2 -0
- package/dist.commonjs/bytes/index.d.ts +108 -0
- package/dist.commonjs/bytes/index.d.ts.map +1 -0
- package/dist.commonjs/bytes/index.js +158 -0
- package/dist.commonjs/ckb/advanced.d.ts +3 -0
- package/dist.commonjs/ckb/advanced.d.ts.map +1 -0
- package/dist.commonjs/ckb/advanced.js +18 -0
- package/dist.commonjs/ckb/index.d.ts +4 -0
- package/dist.commonjs/ckb/index.d.ts.map +1 -0
- package/dist.commonjs/ckb/index.js +19 -0
- package/dist.commonjs/ckb/script.advanced.d.ts +5 -0
- package/dist.commonjs/ckb/script.advanced.d.ts.map +1 -0
- package/dist.commonjs/ckb/script.advanced.js +16 -0
- package/dist.commonjs/ckb/script.d.ts +143 -0
- package/dist.commonjs/ckb/script.d.ts.map +1 -0
- package/dist.commonjs/ckb/script.js +173 -0
- package/dist.commonjs/ckb/transaction.advanced.d.ts +5 -0
- package/dist.commonjs/ckb/transaction.advanced.d.ts.map +1 -0
- package/dist.commonjs/ckb/transaction.advanced.js +12 -0
- package/dist.commonjs/ckb/transaction.d.ts +893 -0
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -0
- package/dist.commonjs/ckb/transaction.js +1310 -0
- package/dist.commonjs/ckb/transactionLumos.d.ts +30 -0
- package/dist.commonjs/ckb/transactionLumos.d.ts.map +1 -0
- package/dist.commonjs/ckb/transactionLumos.js +2 -0
- package/dist.commonjs/client/advanced.d.ts +6 -0
- package/dist.commonjs/client/advanced.d.ts.map +1 -0
- package/dist.commonjs/client/advanced.js +21 -0
- package/dist.commonjs/client/cache/advanced.d.ts +2 -0
- package/dist.commonjs/client/cache/advanced.d.ts.map +1 -0
- package/dist.commonjs/client/cache/advanced.js +17 -0
- package/dist.commonjs/client/cache/cache.d.ts +91 -0
- package/dist.commonjs/client/cache/cache.d.ts.map +1 -0
- package/dist.commonjs/client/cache/cache.js +132 -0
- package/dist.commonjs/client/cache/index.d.ts +3 -0
- package/dist.commonjs/client/cache/index.d.ts.map +1 -0
- package/dist.commonjs/client/cache/index.js +18 -0
- package/dist.commonjs/client/cache/memory.advanced.d.ts +22 -0
- package/dist.commonjs/client/cache/memory.advanced.d.ts.map +1 -0
- package/dist.commonjs/client/cache/memory.advanced.js +127 -0
- package/dist.commonjs/client/cache/memory.d.ts +44 -0
- package/dist.commonjs/client/cache/memory.d.ts.map +1 -0
- package/dist.commonjs/client/cache/memory.js +141 -0
- package/dist.commonjs/client/client.d.ts +98 -0
- package/dist.commonjs/client/client.d.ts.map +1 -0
- package/dist.commonjs/client/client.js +327 -0
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts +3 -0
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts.map +1 -0
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +329 -0
- package/dist.commonjs/client/clientPublicMainnet.d.ts +16 -0
- package/dist.commonjs/client/clientPublicMainnet.d.ts.map +1 -0
- package/dist.commonjs/client/clientPublicMainnet.js +47 -0
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts +3 -0
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts.map +1 -0
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +339 -0
- package/dist.commonjs/client/clientPublicTestnet.d.ts +16 -0
- package/dist.commonjs/client/clientPublicTestnet.d.ts.map +1 -0
- package/dist.commonjs/client/clientPublicTestnet.js +47 -0
- package/dist.commonjs/client/clientTypes.advanced.d.ts +26 -0
- package/dist.commonjs/client/clientTypes.advanced.d.ts.map +1 -0
- package/dist.commonjs/client/clientTypes.advanced.js +11 -0
- package/dist.commonjs/client/clientTypes.d.ts +360 -0
- package/dist.commonjs/client/clientTypes.d.ts.map +1 -0
- package/dist.commonjs/client/clientTypes.js +278 -0
- package/dist.commonjs/client/index.d.ts +7 -0
- package/dist.commonjs/client/index.d.ts.map +1 -0
- package/dist.commonjs/client/index.js +22 -0
- package/dist.commonjs/client/jsonRpc/advanced.d.ts +3 -0
- package/dist.commonjs/client/jsonRpc/advanced.d.ts.map +1 -0
- package/dist.commonjs/client/jsonRpc/advanced.js +18 -0
- package/dist.commonjs/client/jsonRpc/client.d.ts +160 -0
- package/dist.commonjs/client/jsonRpc/client.d.ts.map +1 -0
- package/dist.commonjs/client/jsonRpc/client.js +224 -0
- package/dist.commonjs/client/jsonRpc/index.d.ts +2 -0
- package/dist.commonjs/client/jsonRpc/index.d.ts.map +1 -0
- package/dist.commonjs/client/jsonRpc/index.js +17 -0
- package/dist.commonjs/client/jsonRpc/transformers.d.ts +51 -0
- package/dist.commonjs/client/jsonRpc/transformers.d.ts.map +1 -0
- package/dist.commonjs/client/jsonRpc/transformers.js +250 -0
- package/dist.commonjs/client/jsonRpc/types.d.ts +101 -0
- package/dist.commonjs/client/jsonRpc/types.d.ts.map +1 -0
- package/dist.commonjs/client/jsonRpc/types.js +2 -0
- package/dist.commonjs/fixedPoint/index.d.ts +55 -0
- package/dist.commonjs/fixedPoint/index.d.ts.map +1 -0
- package/dist.commonjs/fixedPoint/index.js +73 -0
- package/dist.commonjs/hasher/advanced.d.ts +2 -0
- package/dist.commonjs/hasher/advanced.d.ts.map +1 -0
- package/dist.commonjs/hasher/advanced.js +4 -0
- package/dist.commonjs/hasher/hasher.d.ts +35 -0
- package/dist.commonjs/hasher/hasher.d.ts.map +1 -0
- package/dist.commonjs/hasher/hasher.js +2 -0
- package/dist.commonjs/hasher/hasherCkb.d.ts +73 -0
- package/dist.commonjs/hasher/hasherCkb.d.ts.map +1 -0
- package/dist.commonjs/hasher/hasherCkb.js +94 -0
- package/dist.commonjs/hasher/hasherKeecak256.d.ts +41 -0
- package/dist.commonjs/hasher/hasherKeecak256.d.ts.map +1 -0
- package/dist.commonjs/hasher/hasherKeecak256.js +50 -0
- package/dist.commonjs/hasher/index.d.ts +4 -0
- package/dist.commonjs/hasher/index.d.ts.map +1 -0
- package/dist.commonjs/hasher/index.js +19 -0
- package/dist.commonjs/hex/index.d.ts +27 -0
- package/dist.commonjs/hex/index.d.ts.map +1 -0
- package/dist.commonjs/hex/index.js +20 -0
- package/dist.commonjs/index.d.ts +3 -0
- package/dist.commonjs/index.d.ts.map +1 -0
- package/dist.commonjs/index.js +41 -0
- package/dist.commonjs/jsonRpc/advanced.d.ts +2 -0
- package/dist.commonjs/jsonRpc/advanced.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/advanced.js +17 -0
- package/dist.commonjs/jsonRpc/index.d.ts +2 -0
- package/dist.commonjs/jsonRpc/index.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/index.js +17 -0
- package/dist.commonjs/jsonRpc/requestor.d.ts +49 -0
- package/dist.commonjs/jsonRpc/requestor.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/requestor.js +113 -0
- package/dist.commonjs/jsonRpc/transports/advanced.d.ts +6 -0
- package/dist.commonjs/jsonRpc/transports/advanced.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/transports/advanced.js +21 -0
- package/dist.commonjs/jsonRpc/transports/factory.d.ts +6 -0
- package/dist.commonjs/jsonRpc/transports/factory.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/transports/factory.js +11 -0
- package/dist.commonjs/jsonRpc/transports/fallback.d.ts +8 -0
- package/dist.commonjs/jsonRpc/transports/fallback.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/transports/fallback.js +26 -0
- package/dist.commonjs/jsonRpc/transports/http.d.ts +8 -0
- package/dist.commonjs/jsonRpc/transports/http.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/transports/http.js +26 -0
- package/dist.commonjs/jsonRpc/transports/transport.d.ts +18 -0
- package/dist.commonjs/jsonRpc/transports/transport.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/transports/transport.js +2 -0
- package/dist.commonjs/jsonRpc/transports/webSocket.d.ts +11 -0
- package/dist.commonjs/jsonRpc/transports/webSocket.d.ts.map +1 -0
- package/dist.commonjs/jsonRpc/transports/webSocket.js +94 -0
- package/dist.commonjs/keystore/index.d.ts +31 -0
- package/dist.commonjs/keystore/index.d.ts.map +1 -0
- package/dist.commonjs/keystore/index.js +110 -0
- package/dist.commonjs/molecule/barrel.d.ts +4 -0
- package/dist.commonjs/molecule/barrel.d.ts.map +1 -0
- package/dist.commonjs/molecule/barrel.js +19 -0
- package/dist.commonjs/molecule/codec.d.ts +120 -0
- package/dist.commonjs/molecule/codec.d.ts.map +1 -0
- package/dist.commonjs/molecule/codec.js +483 -0
- package/dist.commonjs/molecule/entity.d.ts +119 -0
- package/dist.commonjs/molecule/entity.d.ts.map +1 -0
- package/dist.commonjs/molecule/entity.js +139 -0
- package/dist.commonjs/molecule/index.d.ts +2 -0
- package/dist.commonjs/molecule/index.d.ts.map +1 -0
- package/dist.commonjs/molecule/index.js +37 -0
- package/dist.commonjs/molecule/predefined.d.ts +57 -0
- package/dist.commonjs/molecule/predefined.d.ts.map +1 -0
- package/dist.commonjs/molecule/predefined.js +87 -0
- package/dist.commonjs/num/index.d.ts +148 -0
- package/dist.commonjs/num/index.d.ts.map +1 -0
- package/dist.commonjs/num/index.js +200 -0
- package/dist.commonjs/package.json +3 -0
- package/dist.commonjs/signer/btc/index.d.ts +4 -0
- package/dist.commonjs/signer/btc/index.d.ts.map +1 -0
- package/dist.commonjs/signer/btc/index.js +19 -0
- package/dist.commonjs/signer/btc/signerBtc.d.ts +59 -0
- package/dist.commonjs/signer/btc/signerBtc.d.ts.map +1 -0
- package/dist.commonjs/signer/btc/signerBtc.js +87 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +55 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +65 -0
- package/dist.commonjs/signer/btc/verify.d.ts +19 -0
- package/dist.commonjs/signer/btc/verify.d.ts.map +1 -0
- package/dist.commonjs/signer/btc/verify.js +42 -0
- package/dist.commonjs/signer/ckb/index.d.ts +6 -0
- package/dist.commonjs/signer/ckb/index.d.ts.map +1 -0
- package/dist.commonjs/signer/ckb/index.js +21 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts +16 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.js +46 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts +27 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts.map +1 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.js +109 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +56 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +70 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts +11 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.js +24 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts +6 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts.map +1 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.js +19 -0
- package/dist.commonjs/signer/doge/index.d.ts +5 -0
- package/dist.commonjs/signer/doge/index.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/index.js +20 -0
- package/dist.commonjs/signer/doge/signerDoge.d.ts +52 -0
- package/dist.commonjs/signer/doge/signerDoge.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/signerDoge.js +89 -0
- package/dist.commonjs/signer/doge/signerDogeAddressReadonly.d.ts +41 -0
- package/dist.commonjs/signer/doge/signerDogeAddressReadonly.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/signerDogeAddressReadonly.js +49 -0
- package/dist.commonjs/signer/doge/signerDogePrivateKey.d.ts +52 -0
- package/dist.commonjs/signer/doge/signerDogePrivateKey.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/signerDogePrivateKey.js +72 -0
- package/dist.commonjs/signer/doge/verify.d.ts +6 -0
- package/dist.commonjs/signer/doge/verify.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/verify.js +22 -0
- package/dist.commonjs/signer/dummy/alwaysError.d.ts +12 -0
- package/dist.commonjs/signer/dummy/alwaysError.d.ts.map +1 -0
- package/dist.commonjs/signer/dummy/alwaysError.js +17 -0
- package/dist.commonjs/signer/dummy/dummy.d.ts +15 -0
- package/dist.commonjs/signer/dummy/dummy.d.ts.map +1 -0
- package/dist.commonjs/signer/dummy/dummy.js +26 -0
- package/dist.commonjs/signer/dummy/index.d.ts +4 -0
- package/dist.commonjs/signer/dummy/index.d.ts.map +1 -0
- package/dist.commonjs/signer/dummy/index.js +19 -0
- package/dist.commonjs/signer/dummy/openLink.d.ts +12 -0
- package/dist.commonjs/signer/dummy/openLink.d.ts.map +1 -0
- package/dist.commonjs/signer/dummy/openLink.js +17 -0
- package/dist.commonjs/signer/evm/index.d.ts +4 -0
- package/dist.commonjs/signer/evm/index.d.ts.map +1 -0
- package/dist.commonjs/signer/evm/index.js +19 -0
- package/dist.commonjs/signer/evm/signerEvm.d.ts +59 -0
- package/dist.commonjs/signer/evm/signerEvm.d.ts.map +1 -0
- package/dist.commonjs/signer/evm/signerEvm.js +143 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +47 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +55 -0
- package/dist.commonjs/signer/evm/verify.d.ts +6 -0
- package/dist.commonjs/signer/evm/verify.d.ts.map +1 -0
- package/dist.commonjs/signer/evm/verify.js +12 -0
- package/dist.commonjs/signer/index.d.ts +8 -0
- package/dist.commonjs/signer/index.d.ts.map +1 -0
- package/dist.commonjs/signer/index.js +23 -0
- package/dist.commonjs/signer/nostr/index.d.ts +4 -0
- package/dist.commonjs/signer/nostr/index.d.ts.map +1 -0
- package/dist.commonjs/signer/nostr/index.js +19 -0
- package/dist.commonjs/signer/nostr/signerNostr.d.ts +72 -0
- package/dist.commonjs/signer/nostr/signerNostr.d.ts.map +1 -0
- package/dist.commonjs/signer/nostr/signerNostr.js +92 -0
- package/dist.commonjs/signer/nostr/signerNostrPrivateKey.d.ts +12 -0
- package/dist.commonjs/signer/nostr/signerNostrPrivateKey.d.ts.map +1 -0
- package/dist.commonjs/signer/nostr/signerNostrPrivateKey.js +32 -0
- package/dist.commonjs/signer/nostr/verify.d.ts +9 -0
- package/dist.commonjs/signer/nostr/verify.d.ts.map +1 -0
- package/dist.commonjs/signer/nostr/verify.js +60 -0
- package/dist.commonjs/signer/signer/index.d.ts +237 -0
- package/dist.commonjs/signer/signer/index.d.ts.map +1 -0
- package/dist.commonjs/signer/signer/index.js +280 -0
- package/dist.commonjs/utils/index.d.ts +97 -0
- package/dist.commonjs/utils/index.d.ts.map +1 -0
- package/dist.commonjs/utils/index.js +62 -0
- package/jest.config.js +5 -0
- package/package.json +80 -0
- package/src/address/address.advanced.ts +182 -0
- package/src/address/advanced.ts +1 -0
- package/src/address/index.ts +127 -0
- package/src/advanced.ts +2 -0
- package/src/advancedBarrel.ts +6 -0
- package/src/barrel.ts +13 -0
- package/src/bytes/advanced.ts +14 -0
- package/src/bytes/index.ts +184 -0
- package/src/ckb/advanced.ts +2 -0
- package/src/ckb/index.ts +3 -0
- package/src/ckb/script.advanced.ts +15 -0
- package/src/ckb/script.ts +214 -0
- package/src/ckb/transaction.advanced.ts +11 -0
- package/src/ckb/transaction.ts +1781 -0
- package/src/ckb/transactionLumos.ts +27 -0
- package/src/client/advanced.ts +5 -0
- package/src/client/cache/advanced.ts +1 -0
- package/src/client/cache/cache.ts +188 -0
- package/src/client/cache/index.ts +2 -0
- package/src/client/cache/memory.advanced.ts +190 -0
- package/src/client/cache/memory.ts +219 -0
- package/src/client/client.ts +703 -0
- package/src/client/clientPublicMainnet.advanced.ts +372 -0
- package/src/client/clientPublicMainnet.ts +54 -0
- package/src/client/clientPublicTestnet.advanced.ts +384 -0
- package/src/client/clientPublicTestnet.ts +54 -0
- package/src/client/clientTypes.advanced.ts +30 -0
- package/src/client/clientTypes.ts +590 -0
- package/src/client/index.ts +6 -0
- package/src/client/jsonRpc/advanced.ts +2 -0
- package/src/client/jsonRpc/client.ts +397 -0
- package/src/client/jsonRpc/index.ts +1 -0
- package/src/client/jsonRpc/transformers.ts +358 -0
- package/src/client/jsonRpc/types.ts +115 -0
- package/src/fixedPoint/index.ts +92 -0
- package/src/hasher/advanced.ts +1 -0
- package/src/hasher/hasher.ts +38 -0
- package/src/hasher/hasherCkb.ts +107 -0
- package/src/hasher/hasherKeecak256.ts +55 -0
- package/src/hasher/index.ts +3 -0
- package/src/hex/index.ts +30 -0
- package/src/index.ts +2 -0
- package/src/jsonRpc/advanced.ts +1 -0
- package/src/jsonRpc/index.ts +1 -0
- package/src/jsonRpc/requestor.ts +166 -0
- package/src/jsonRpc/transports/advanced.ts +5 -0
- package/src/jsonRpc/transports/factory.ts +10 -0
- package/src/jsonRpc/transports/fallback.ts +27 -0
- package/src/jsonRpc/transports/http.ts +28 -0
- package/src/jsonRpc/transports/transport.ts +18 -0
- package/src/jsonRpc/transports/webSocket.ts +114 -0
- package/src/keystore/index.ts +162 -0
- package/src/molecule/barrel.ts +3 -0
- package/src/molecule/codec.ts +651 -0
- package/src/molecule/entity.ts +183 -0
- package/src/molecule/index.ts +1 -0
- package/src/molecule/predefined.ts +97 -0
- package/src/num/index.ts +217 -0
- package/src/signer/btc/index.ts +3 -0
- package/src/signer/btc/signerBtc.ts +126 -0
- package/src/signer/btc/signerBtcPublicKeyReadonly.ts +73 -0
- package/src/signer/btc/verify.ts +49 -0
- package/src/signer/ckb/index.ts +5 -0
- package/src/signer/ckb/signerCkbPrivateKey.ts +65 -0
- package/src/signer/ckb/signerCkbPublicKey.ts +151 -0
- package/src/signer/ckb/signerCkbScriptReadonly.ts +78 -0
- package/src/signer/ckb/verifyCkbSecp256k1.ts +33 -0
- package/src/signer/ckb/verifyJoyId.ts +27 -0
- package/src/signer/doge/index.ts +4 -0
- package/src/signer/doge/signerDoge.ts +116 -0
- package/src/signer/doge/signerDogeAddressReadonly.ts +52 -0
- package/src/signer/doge/signerDogePrivateKey.ts +97 -0
- package/src/signer/doge/verify.ts +40 -0
- package/src/signer/dummy/alwaysError.ts +20 -0
- package/src/signer/dummy/dummy.ts +31 -0
- package/src/signer/dummy/index.ts +3 -0
- package/src/signer/dummy/openLink.ts +20 -0
- package/src/signer/evm/index.ts +3 -0
- package/src/signer/evm/signerEvm.ts +259 -0
- package/src/signer/evm/signerEvmAddressReadonly.ts +60 -0
- package/src/signer/evm/verify.ts +19 -0
- package/src/signer/index.ts +7 -0
- package/src/signer/nostr/index.ts +3 -0
- package/src/signer/nostr/signerNostr.ts +141 -0
- package/src/signer/nostr/signerNostrPrivateKey.ts +37 -0
- package/src/signer/nostr/verify.ts +72 -0
- package/src/signer/signer/index.ts +468 -0
- package/src/utils/index.ts +198 -0
- package/typedoc.json +6 -0
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
import { Bytes, BytesLike } from "../bytes/index.js";
|
|
2
|
+
import type { ClientCollectableSearchKeyFilterLike } from "../client/clientTypes.advanced.js";
|
|
3
|
+
import type { CellDepInfoLike, Client, KnownScript } from "../client/index.js";
|
|
4
|
+
import { Hasher } from "../hasher/index.js";
|
|
5
|
+
import { Hex, HexLike } from "../hex/index.js";
|
|
6
|
+
import { mol } from "../molecule/index.js";
|
|
7
|
+
import { Num, NumLike } from "../num/index.js";
|
|
8
|
+
import type { Signer } from "../signer/index.js";
|
|
9
|
+
import { Script, ScriptLike } from "./script.js";
|
|
10
|
+
import type { LumosTransactionSkeletonType } from "./transactionLumos.js";
|
|
11
|
+
export declare const DepTypeCodec: mol.Codec<DepTypeLike, DepType>;
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export type DepTypeLike = string | number | bigint;
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export type DepType = "depGroup" | "code";
|
|
20
|
+
/**
|
|
21
|
+
* Converts a DepTypeLike value to a DepType.
|
|
22
|
+
* @public
|
|
23
|
+
*
|
|
24
|
+
* @param val - The value to convert, which can be a string, number, or bigint.
|
|
25
|
+
* @returns The corresponding DepType.
|
|
26
|
+
*
|
|
27
|
+
* @throws Will throw an error if the input value is not a valid dep type.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const depType = depTypeFrom(1); // Outputs "code"
|
|
32
|
+
* const depType = depTypeFrom("depGroup"); // Outputs "depGroup"
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function depTypeFrom(val: DepTypeLike): DepType;
|
|
36
|
+
/**
|
|
37
|
+
* Converts a DepTypeLike value to its corresponding byte representation.
|
|
38
|
+
* @public
|
|
39
|
+
*
|
|
40
|
+
* @param depType - The dep type value to convert.
|
|
41
|
+
* @returns A Uint8Array containing the byte representation of the dep type.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const depTypeBytes = depTypeToBytes("code"); // Outputs Uint8Array [1]
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function depTypeToBytes(depType: DepTypeLike): Bytes;
|
|
49
|
+
/**
|
|
50
|
+
* Converts a byte-like value to a DepType.
|
|
51
|
+
* @public
|
|
52
|
+
*
|
|
53
|
+
* @param bytes - The byte-like value to convert.
|
|
54
|
+
* @returns The corresponding DepType.
|
|
55
|
+
*
|
|
56
|
+
* @throws Will throw an error if the input bytes do not correspond to a valid dep type.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const depType = depTypeFromBytes(new Uint8Array([1])); // Outputs "code"
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function depTypeFromBytes(bytes: BytesLike): DepType;
|
|
64
|
+
/**
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
export type OutPointLike = {
|
|
68
|
+
txHash: HexLike;
|
|
69
|
+
index: NumLike;
|
|
70
|
+
};
|
|
71
|
+
declare const OutPoint_base: (abstract new () => {
|
|
72
|
+
toBytes(): Bytes;
|
|
73
|
+
clone(): OutPoint;
|
|
74
|
+
eq(other: OutPointLike): boolean;
|
|
75
|
+
hash(): Hex;
|
|
76
|
+
}) & {
|
|
77
|
+
byteLength?: number;
|
|
78
|
+
encode(_: OutPointLike): Bytes;
|
|
79
|
+
decode(_: BytesLike): OutPoint;
|
|
80
|
+
fromBytes(_bytes: BytesLike): OutPoint;
|
|
81
|
+
from(_: OutPointLike): OutPoint;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export declare class OutPoint extends OutPoint_base {
|
|
87
|
+
txHash: Hex;
|
|
88
|
+
index: Num;
|
|
89
|
+
/**
|
|
90
|
+
* Creates an instance of OutPoint.
|
|
91
|
+
*
|
|
92
|
+
* @param txHash - The transaction hash.
|
|
93
|
+
* @param index - The index of the output in the transaction.
|
|
94
|
+
*/
|
|
95
|
+
constructor(txHash: Hex, index: Num);
|
|
96
|
+
/**
|
|
97
|
+
* Creates an OutPoint instance from an OutPointLike object.
|
|
98
|
+
*
|
|
99
|
+
* @param outPoint - An OutPointLike object or an instance of OutPoint.
|
|
100
|
+
* @returns An OutPoint instance.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const outPoint = OutPoint.from({ txHash: "0x...", index: 0 });
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
static from(outPoint: OutPointLike): OutPoint;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
export type CellOutputLike = {
|
|
113
|
+
capacity: NumLike;
|
|
114
|
+
lock: ScriptLike;
|
|
115
|
+
type?: ScriptLike | null;
|
|
116
|
+
};
|
|
117
|
+
declare const CellOutput_base: (abstract new () => {
|
|
118
|
+
toBytes(): Bytes;
|
|
119
|
+
clone(): CellOutput;
|
|
120
|
+
eq(other: CellOutputLike): boolean;
|
|
121
|
+
hash(): Hex;
|
|
122
|
+
}) & {
|
|
123
|
+
byteLength?: number;
|
|
124
|
+
encode(_: CellOutputLike): Bytes;
|
|
125
|
+
decode(_: BytesLike): CellOutput;
|
|
126
|
+
fromBytes(_bytes: BytesLike): CellOutput;
|
|
127
|
+
from(_: CellOutputLike): CellOutput;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
132
|
+
export declare class CellOutput extends CellOutput_base {
|
|
133
|
+
capacity: Num;
|
|
134
|
+
lock: Script;
|
|
135
|
+
type?: Script | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Creates an instance of CellOutput.
|
|
138
|
+
*
|
|
139
|
+
* @param capacity - The capacity of the cell.
|
|
140
|
+
* @param lock - The lock script of the cell.
|
|
141
|
+
* @param type - The optional type script of the cell.
|
|
142
|
+
*/
|
|
143
|
+
constructor(capacity: Num, lock: Script, type?: Script | undefined);
|
|
144
|
+
get occupiedSize(): number;
|
|
145
|
+
/**
|
|
146
|
+
* Creates a CellOutput instance from a CellOutputLike object.
|
|
147
|
+
*
|
|
148
|
+
* @param cellOutput - A CellOutputLike object or an instance of CellOutput.
|
|
149
|
+
* @returns A CellOutput instance.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* const cellOutput = CellOutput.from({
|
|
154
|
+
* capacity: 1000n,
|
|
155
|
+
* lock: { codeHash: "0x...", hashType: "type", args: "0x..." },
|
|
156
|
+
* type: { codeHash: "0x...", hashType: "type", args: "0x..." }
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
static from(cellOutput: CellOutputLike): CellOutput;
|
|
161
|
+
}
|
|
162
|
+
export declare const CellOutputVec: mol.Codec<CellOutputLike[], CellOutput[]>;
|
|
163
|
+
/**
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
export type CellLike = ({
|
|
167
|
+
outPoint: OutPointLike;
|
|
168
|
+
} | {
|
|
169
|
+
previousOutput: OutPointLike;
|
|
170
|
+
}) & {
|
|
171
|
+
cellOutput: CellOutputLike;
|
|
172
|
+
outputData: HexLike;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
export declare class Cell {
|
|
178
|
+
outPoint: OutPoint;
|
|
179
|
+
cellOutput: CellOutput;
|
|
180
|
+
outputData: Hex;
|
|
181
|
+
/**
|
|
182
|
+
* Creates an instance of Cell.
|
|
183
|
+
*
|
|
184
|
+
* @param outPoint - The output point of the cell.
|
|
185
|
+
* @param cellOutput - The cell output of the cell.
|
|
186
|
+
* @param outputData - The output data of the cell.
|
|
187
|
+
*/
|
|
188
|
+
constructor(outPoint: OutPoint, cellOutput: CellOutput, outputData: Hex);
|
|
189
|
+
/**
|
|
190
|
+
* Creates a Cell instance from a CellLike object.
|
|
191
|
+
*
|
|
192
|
+
* @param cell - A CellLike object or an instance of Cell.
|
|
193
|
+
* @returns A Cell instance.
|
|
194
|
+
*/
|
|
195
|
+
static from(cell: CellLike): Cell;
|
|
196
|
+
/**
|
|
197
|
+
* Clone a Cell
|
|
198
|
+
*
|
|
199
|
+
* @returns A cloned Cell instance.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const cell1 = cell0.clone();
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
clone(): Cell;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* @public
|
|
210
|
+
*/
|
|
211
|
+
export type EpochLike = [NumLike, NumLike, NumLike];
|
|
212
|
+
/**
|
|
213
|
+
* @public
|
|
214
|
+
*/
|
|
215
|
+
export type Epoch = [Num, Num, Num];
|
|
216
|
+
/**
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
export declare function epochFrom(epochLike: EpochLike): Epoch;
|
|
220
|
+
/**
|
|
221
|
+
* @public
|
|
222
|
+
*/
|
|
223
|
+
export declare function epochFromHex(hex: HexLike): Epoch;
|
|
224
|
+
/**
|
|
225
|
+
* @public
|
|
226
|
+
*/
|
|
227
|
+
export declare function epochToHex(epochLike: EpochLike): Hex;
|
|
228
|
+
/**
|
|
229
|
+
* @public
|
|
230
|
+
*/
|
|
231
|
+
export type SinceLike = {
|
|
232
|
+
relative: "absolute" | "relative";
|
|
233
|
+
metric: "blockNumber" | "epoch" | "timestamp";
|
|
234
|
+
value: NumLike;
|
|
235
|
+
} | NumLike;
|
|
236
|
+
declare const Since_base: (abstract new () => {
|
|
237
|
+
toBytes(): Bytes;
|
|
238
|
+
clone(): Since;
|
|
239
|
+
eq(other: SinceLike): boolean;
|
|
240
|
+
hash(): Hex;
|
|
241
|
+
}) & {
|
|
242
|
+
byteLength?: number;
|
|
243
|
+
encode(_: SinceLike): Bytes;
|
|
244
|
+
decode(_: BytesLike): Since;
|
|
245
|
+
fromBytes(_bytes: BytesLike): Since;
|
|
246
|
+
from(_: SinceLike): Since;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* @public
|
|
250
|
+
*/
|
|
251
|
+
export declare class Since extends Since_base {
|
|
252
|
+
relative: "absolute" | "relative";
|
|
253
|
+
metric: "blockNumber" | "epoch" | "timestamp";
|
|
254
|
+
value: Num;
|
|
255
|
+
/**
|
|
256
|
+
* Creates an instance of Since.
|
|
257
|
+
*
|
|
258
|
+
* @param relative - Absolute or relative
|
|
259
|
+
* @param metric - The metric of since
|
|
260
|
+
* @param value - The value of since
|
|
261
|
+
*/
|
|
262
|
+
constructor(relative: "absolute" | "relative", metric: "blockNumber" | "epoch" | "timestamp", value: Num);
|
|
263
|
+
/**
|
|
264
|
+
* Clone a Since.
|
|
265
|
+
*
|
|
266
|
+
* @returns A cloned Since instance.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* ```typescript
|
|
270
|
+
* const since1 = since0.clone();
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
clone(): Since;
|
|
274
|
+
/**
|
|
275
|
+
* Creates a Since instance from a SinceLike object.
|
|
276
|
+
*
|
|
277
|
+
* @param since - A SinceLike object or an instance of Since.
|
|
278
|
+
* @returns A Since instance.
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* const since = Since.from("0x1234567812345678");
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
static from(since: SinceLike): Since;
|
|
286
|
+
/**
|
|
287
|
+
* Converts the Since instance to num.
|
|
288
|
+
*
|
|
289
|
+
* @returns A num
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```typescript
|
|
293
|
+
* const num = since.toNum();
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
toNum(): Num;
|
|
297
|
+
/**
|
|
298
|
+
* Creates a Since instance from a num-like value.
|
|
299
|
+
*
|
|
300
|
+
* @param numLike - The num-like value to convert.
|
|
301
|
+
* @returns A Since instance.
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* ```typescript
|
|
305
|
+
* const since = Since.fromNum("0x0");
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
static fromNum(numLike: NumLike): Since;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* @public
|
|
312
|
+
*/
|
|
313
|
+
export type CellInputLike = ({
|
|
314
|
+
previousOutput: OutPointLike;
|
|
315
|
+
} | {
|
|
316
|
+
outPoint: OutPointLike;
|
|
317
|
+
}) & {
|
|
318
|
+
since?: SinceLike | NumLike | null;
|
|
319
|
+
cellOutput?: CellOutputLike | null;
|
|
320
|
+
outputData?: HexLike | null;
|
|
321
|
+
};
|
|
322
|
+
declare const CellInput_base: (abstract new () => {
|
|
323
|
+
toBytes(): Bytes;
|
|
324
|
+
clone(): CellInput;
|
|
325
|
+
eq(other: CellInputLike): boolean;
|
|
326
|
+
hash(): Hex;
|
|
327
|
+
}) & {
|
|
328
|
+
byteLength?: number;
|
|
329
|
+
encode(_: CellInputLike): Bytes;
|
|
330
|
+
decode(_: BytesLike): CellInput;
|
|
331
|
+
fromBytes(_bytes: BytesLike): CellInput;
|
|
332
|
+
from(_: CellInputLike): CellInput;
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* @public
|
|
336
|
+
*/
|
|
337
|
+
export declare class CellInput extends CellInput_base {
|
|
338
|
+
previousOutput: OutPoint;
|
|
339
|
+
since: Num;
|
|
340
|
+
cellOutput?: CellOutput | undefined;
|
|
341
|
+
outputData?: Hex | undefined;
|
|
342
|
+
/**
|
|
343
|
+
* Creates an instance of CellInput.
|
|
344
|
+
*
|
|
345
|
+
* @param previousOutput - The previous outpoint of the cell.
|
|
346
|
+
* @param since - The since value of the cell input.
|
|
347
|
+
* @param cellOutput - The optional cell output associated with the cell input.
|
|
348
|
+
* @param outputData - The optional output data associated with the cell input.
|
|
349
|
+
*/
|
|
350
|
+
constructor(previousOutput: OutPoint, since: Num, cellOutput?: CellOutput | undefined, outputData?: Hex | undefined);
|
|
351
|
+
/**
|
|
352
|
+
* Creates a CellInput instance from a CellInputLike object.
|
|
353
|
+
*
|
|
354
|
+
* @param cellInput - A CellInputLike object or an instance of CellInput.
|
|
355
|
+
* @returns A CellInput instance.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```typescript
|
|
359
|
+
* const cellInput = CellInput.from({
|
|
360
|
+
* previousOutput: { txHash: "0x...", index: 0 },
|
|
361
|
+
* since: 0n
|
|
362
|
+
* });
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
365
|
+
static from(cellInput: CellInputLike): CellInput;
|
|
366
|
+
/**
|
|
367
|
+
* Complete extra infos in the input. Like the output of the out point.
|
|
368
|
+
* The instance will be modified.
|
|
369
|
+
*
|
|
370
|
+
* @returns true if succeed.
|
|
371
|
+
* @example
|
|
372
|
+
* ```typescript
|
|
373
|
+
* await cellInput.completeExtraInfos();
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
completeExtraInfos(client: Client): Promise<void>;
|
|
377
|
+
clone(): CellInput;
|
|
378
|
+
}
|
|
379
|
+
export declare const CellInputVec: mol.Codec<CellInputLike[], CellInput[]>;
|
|
380
|
+
/**
|
|
381
|
+
* @public
|
|
382
|
+
*/
|
|
383
|
+
export type CellDepLike = {
|
|
384
|
+
outPoint: OutPointLike;
|
|
385
|
+
depType: DepTypeLike;
|
|
386
|
+
};
|
|
387
|
+
declare const CellDep_base: (abstract new () => {
|
|
388
|
+
toBytes(): Bytes;
|
|
389
|
+
clone(): CellDep;
|
|
390
|
+
eq(other: CellDepLike): boolean;
|
|
391
|
+
hash(): Hex;
|
|
392
|
+
}) & {
|
|
393
|
+
byteLength?: number;
|
|
394
|
+
encode(_: CellDepLike): Bytes;
|
|
395
|
+
decode(_: BytesLike): CellDep;
|
|
396
|
+
fromBytes(_bytes: BytesLike): CellDep;
|
|
397
|
+
from(_: CellDepLike): CellDep;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* @public
|
|
401
|
+
*/
|
|
402
|
+
export declare class CellDep extends CellDep_base {
|
|
403
|
+
outPoint: OutPoint;
|
|
404
|
+
depType: DepType;
|
|
405
|
+
/**
|
|
406
|
+
* Creates an instance of CellDep.
|
|
407
|
+
*
|
|
408
|
+
* @param outPoint - The outpoint of the cell dependency.
|
|
409
|
+
* @param depType - The dependency type.
|
|
410
|
+
*/
|
|
411
|
+
constructor(outPoint: OutPoint, depType: DepType);
|
|
412
|
+
/**
|
|
413
|
+
* Clone a CellDep.
|
|
414
|
+
*
|
|
415
|
+
* @returns A cloned CellDep instance.
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```typescript
|
|
419
|
+
* const cellDep1 = cellDep0.clone();
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
422
|
+
clone(): CellDep;
|
|
423
|
+
/**
|
|
424
|
+
* Creates a CellDep instance from a CellDepLike object.
|
|
425
|
+
*
|
|
426
|
+
* @param cellDep - A CellDepLike object or an instance of CellDep.
|
|
427
|
+
* @returns A CellDep instance.
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* ```typescript
|
|
431
|
+
* const cellDep = CellDep.from({
|
|
432
|
+
* outPoint: { txHash: "0x...", index: 0 },
|
|
433
|
+
* depType: "depGroup"
|
|
434
|
+
* });
|
|
435
|
+
* ```
|
|
436
|
+
*/
|
|
437
|
+
static from(cellDep: CellDepLike): CellDep;
|
|
438
|
+
}
|
|
439
|
+
export declare const CellDepVec: mol.Codec<CellDepLike[], CellDep[]>;
|
|
440
|
+
/**
|
|
441
|
+
* @public
|
|
442
|
+
*/
|
|
443
|
+
export type WitnessArgsLike = {
|
|
444
|
+
lock?: HexLike | null;
|
|
445
|
+
inputType?: HexLike | null;
|
|
446
|
+
outputType?: HexLike | null;
|
|
447
|
+
};
|
|
448
|
+
declare const WitnessArgs_base: (abstract new () => {
|
|
449
|
+
toBytes(): Bytes;
|
|
450
|
+
clone(): WitnessArgs;
|
|
451
|
+
eq(other: WitnessArgsLike): boolean;
|
|
452
|
+
hash(): Hex;
|
|
453
|
+
}) & {
|
|
454
|
+
byteLength?: number;
|
|
455
|
+
encode(_: WitnessArgsLike): Bytes;
|
|
456
|
+
decode(_: BytesLike): WitnessArgs;
|
|
457
|
+
fromBytes(_bytes: BytesLike): WitnessArgs;
|
|
458
|
+
from(_: WitnessArgsLike): WitnessArgs;
|
|
459
|
+
};
|
|
460
|
+
/**
|
|
461
|
+
* @public
|
|
462
|
+
*/
|
|
463
|
+
export declare class WitnessArgs extends WitnessArgs_base {
|
|
464
|
+
lock?: Hex | undefined;
|
|
465
|
+
inputType?: Hex | undefined;
|
|
466
|
+
outputType?: Hex | undefined;
|
|
467
|
+
/**
|
|
468
|
+
* Creates an instance of WitnessArgs.
|
|
469
|
+
*
|
|
470
|
+
* @param lock - The optional lock field of the witness.
|
|
471
|
+
* @param inputType - The optional input type field of the witness.
|
|
472
|
+
* @param outputType - The optional output type field of the witness.
|
|
473
|
+
*/
|
|
474
|
+
constructor(lock?: Hex | undefined, inputType?: Hex | undefined, outputType?: Hex | undefined);
|
|
475
|
+
/**
|
|
476
|
+
* Creates a WitnessArgs instance from a WitnessArgsLike object.
|
|
477
|
+
*
|
|
478
|
+
* @param witnessArgs - A WitnessArgsLike object or an instance of WitnessArgs.
|
|
479
|
+
* @returns A WitnessArgs instance.
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```typescript
|
|
483
|
+
* const witnessArgs = WitnessArgs.from({
|
|
484
|
+
* lock: "0x...",
|
|
485
|
+
* inputType: "0x...",
|
|
486
|
+
* outputType: "0x..."
|
|
487
|
+
* });
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
static from(witnessArgs: WitnessArgsLike): WitnessArgs;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* @public
|
|
494
|
+
*/
|
|
495
|
+
export declare function udtBalanceFrom(dataLike: BytesLike): Num;
|
|
496
|
+
export declare const RawTransaction: mol.Codec<mol.EncodableRecord<{
|
|
497
|
+
version: mol.Codec<NumLike, number>;
|
|
498
|
+
cellDeps: mol.Codec<CellDepLike[], CellDep[]>;
|
|
499
|
+
headerDeps: mol.Codec<BytesLike[], `0x${string}`[]>;
|
|
500
|
+
inputs: mol.Codec<CellInputLike[], CellInput[]>;
|
|
501
|
+
outputs: mol.Codec<CellOutputLike[], CellOutput[]>;
|
|
502
|
+
outputsData: mol.Codec<BytesLike[], `0x${string}`[]>;
|
|
503
|
+
}>, mol.DecodedRecord<{
|
|
504
|
+
version: mol.Codec<NumLike, number>;
|
|
505
|
+
cellDeps: mol.Codec<CellDepLike[], CellDep[]>;
|
|
506
|
+
headerDeps: mol.Codec<BytesLike[], `0x${string}`[]>;
|
|
507
|
+
inputs: mol.Codec<CellInputLike[], CellInput[]>;
|
|
508
|
+
outputs: mol.Codec<CellOutputLike[], CellOutput[]>;
|
|
509
|
+
outputsData: mol.Codec<BytesLike[], `0x${string}`[]>;
|
|
510
|
+
}>>;
|
|
511
|
+
/**
|
|
512
|
+
* @public
|
|
513
|
+
*/
|
|
514
|
+
export type TransactionLike = {
|
|
515
|
+
version?: NumLike | null;
|
|
516
|
+
cellDeps?: CellDepLike[] | null;
|
|
517
|
+
headerDeps?: HexLike[] | null;
|
|
518
|
+
inputs?: CellInputLike[] | null;
|
|
519
|
+
outputs?: (Omit<CellOutputLike, "capacity"> & Partial<Pick<CellOutputLike, "capacity">>)[] | null;
|
|
520
|
+
outputsData?: HexLike[] | null;
|
|
521
|
+
witnesses?: HexLike[] | null;
|
|
522
|
+
};
|
|
523
|
+
declare const Transaction_base: (abstract new () => {
|
|
524
|
+
toBytes(): Bytes;
|
|
525
|
+
clone(): Transaction;
|
|
526
|
+
eq(other: TransactionLike): boolean;
|
|
527
|
+
hash(): Hex;
|
|
528
|
+
}) & {
|
|
529
|
+
byteLength?: number;
|
|
530
|
+
encode(_: TransactionLike): Bytes;
|
|
531
|
+
decode(_: BytesLike): Transaction;
|
|
532
|
+
fromBytes(_bytes: BytesLike): Transaction;
|
|
533
|
+
from(_: TransactionLike): Transaction;
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* @public
|
|
537
|
+
*/
|
|
538
|
+
export declare class Transaction extends Transaction_base {
|
|
539
|
+
version: Num;
|
|
540
|
+
cellDeps: CellDep[];
|
|
541
|
+
headerDeps: Hex[];
|
|
542
|
+
inputs: CellInput[];
|
|
543
|
+
outputs: CellOutput[];
|
|
544
|
+
outputsData: Hex[];
|
|
545
|
+
witnesses: Hex[];
|
|
546
|
+
/**
|
|
547
|
+
* Creates an instance of Transaction.
|
|
548
|
+
*
|
|
549
|
+
* @param version - The version of the transaction.
|
|
550
|
+
* @param cellDeps - The cell dependencies of the transaction.
|
|
551
|
+
* @param headerDeps - The header dependencies of the transaction.
|
|
552
|
+
* @param inputs - The inputs of the transaction.
|
|
553
|
+
* @param outputs - The outputs of the transaction.
|
|
554
|
+
* @param outputsData - The data associated with the outputs.
|
|
555
|
+
* @param witnesses - The witnesses of the transaction.
|
|
556
|
+
*/
|
|
557
|
+
constructor(version: Num, cellDeps: CellDep[], headerDeps: Hex[], inputs: CellInput[], outputs: CellOutput[], outputsData: Hex[], witnesses: Hex[]);
|
|
558
|
+
/**
|
|
559
|
+
* Creates a default Transaction instance with empty fields.
|
|
560
|
+
*
|
|
561
|
+
* @returns A default Transaction instance.
|
|
562
|
+
*
|
|
563
|
+
* @example
|
|
564
|
+
* ```typescript
|
|
565
|
+
* const defaultTx = Transaction.default();
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
static default(): Transaction;
|
|
569
|
+
/**
|
|
570
|
+
* Copy every properties from another transaction.
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* ```typescript
|
|
574
|
+
* this.copy(Transaction.default());
|
|
575
|
+
* ```
|
|
576
|
+
*/
|
|
577
|
+
copy(txLike: TransactionLike): void;
|
|
578
|
+
/**
|
|
579
|
+
* Creates a Transaction instance from a TransactionLike object.
|
|
580
|
+
*
|
|
581
|
+
* @param tx - A TransactionLike object or an instance of Transaction.
|
|
582
|
+
* @returns A Transaction instance.
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
* ```typescript
|
|
586
|
+
* const transaction = Transaction.from({
|
|
587
|
+
* version: 0,
|
|
588
|
+
* cellDeps: [],
|
|
589
|
+
* headerDeps: [],
|
|
590
|
+
* inputs: [],
|
|
591
|
+
* outputs: [],
|
|
592
|
+
* outputsData: [],
|
|
593
|
+
* witnesses: []
|
|
594
|
+
* });
|
|
595
|
+
* ```
|
|
596
|
+
*/
|
|
597
|
+
static from(tx: TransactionLike): Transaction;
|
|
598
|
+
/**
|
|
599
|
+
* Creates a Transaction instance from a Lumos skeleton.
|
|
600
|
+
*
|
|
601
|
+
* @param skeleton - The Lumos transaction skeleton.
|
|
602
|
+
* @returns A Transaction instance.
|
|
603
|
+
*
|
|
604
|
+
* @throws Will throw an error if an input's outPoint is missing.
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* ```typescript
|
|
608
|
+
* const transaction = Transaction.fromLumosSkeleton(skeleton);
|
|
609
|
+
* ```
|
|
610
|
+
*/
|
|
611
|
+
static fromLumosSkeleton(skeleton: LumosTransactionSkeletonType): Transaction;
|
|
612
|
+
/**
|
|
613
|
+
* @deprecated
|
|
614
|
+
* Use ccc.stringify instead.
|
|
615
|
+
* stringify the tx to JSON string.
|
|
616
|
+
*/
|
|
617
|
+
stringify(): string;
|
|
618
|
+
/**
|
|
619
|
+
* Converts the raw transaction data to bytes.
|
|
620
|
+
*
|
|
621
|
+
* @returns A Uint8Array containing the raw transaction bytes.
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```typescript
|
|
625
|
+
* const rawTxBytes = transaction.rawToBytes();
|
|
626
|
+
* ```
|
|
627
|
+
*/
|
|
628
|
+
rawToBytes(): Bytes;
|
|
629
|
+
/**
|
|
630
|
+
* Calculates the hash of the transaction without witnesses. This is the transaction hash in the usual sense.
|
|
631
|
+
* To calculate the hash of the whole transaction including the witnesses, use transaction.hashFull() instead.
|
|
632
|
+
*
|
|
633
|
+
* @returns The hash of the transaction.
|
|
634
|
+
*
|
|
635
|
+
* @example
|
|
636
|
+
* ```typescript
|
|
637
|
+
* const txHash = transaction.hash();
|
|
638
|
+
* ```
|
|
639
|
+
*/
|
|
640
|
+
hash(): Hex;
|
|
641
|
+
/**
|
|
642
|
+
* Calculates the hash of the transaction with witnesses.
|
|
643
|
+
*
|
|
644
|
+
* @returns The hash of the transaction with witnesses.
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* ```typescript
|
|
648
|
+
* const txFullHash = transaction.hashFull();
|
|
649
|
+
* ```
|
|
650
|
+
*/
|
|
651
|
+
hashFull(): Hex;
|
|
652
|
+
/**
|
|
653
|
+
* Hashes a witness and updates the hasher.
|
|
654
|
+
*
|
|
655
|
+
* @param witness - The witness to hash.
|
|
656
|
+
* @param hasher - The hasher instance to update.
|
|
657
|
+
*
|
|
658
|
+
* @example
|
|
659
|
+
* ```typescript
|
|
660
|
+
* Transaction.hashWitnessToHasher("0x...", hasher);
|
|
661
|
+
* ```
|
|
662
|
+
*/
|
|
663
|
+
static hashWitnessToHasher(witness: HexLike, hasher: Hasher): void;
|
|
664
|
+
/**
|
|
665
|
+
* Computes the signing hash information for a given script.
|
|
666
|
+
*
|
|
667
|
+
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
668
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
669
|
+
* @returns A promise that resolves to an object containing the signing message and the witness position,
|
|
670
|
+
* or undefined if no matching input is found.
|
|
671
|
+
*
|
|
672
|
+
* @example
|
|
673
|
+
* ```typescript
|
|
674
|
+
* const signHashInfo = await tx.getSignHashInfo(scriptLike, client);
|
|
675
|
+
* if (signHashInfo) {
|
|
676
|
+
* console.log(signHashInfo.message); // Outputs the signing message
|
|
677
|
+
* console.log(signHashInfo.position); // Outputs the witness position
|
|
678
|
+
* }
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
getSignHashInfo(scriptLike: ScriptLike, client: Client, hasher?: Hasher): Promise<{
|
|
682
|
+
message: Hex;
|
|
683
|
+
position: number;
|
|
684
|
+
} | undefined>;
|
|
685
|
+
/**
|
|
686
|
+
* Find the first occurrence of a input with the specified lock id
|
|
687
|
+
*
|
|
688
|
+
* @param scriptIdLike - The script associated with the transaction, represented as a ScriptLike object without args.
|
|
689
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
690
|
+
* @returns A promise that resolves to the found index
|
|
691
|
+
*
|
|
692
|
+
* @example
|
|
693
|
+
* ```typescript
|
|
694
|
+
* const index = await tx.findInputIndexByLockId(scriptIdLike, client);
|
|
695
|
+
* ```
|
|
696
|
+
*/
|
|
697
|
+
findInputIndexByLockId(scriptIdLike: Pick<ScriptLike, "codeHash" | "hashType">, client: Client): Promise<number | undefined>;
|
|
698
|
+
/**
|
|
699
|
+
* Find the first occurrence of a input with the specified lock
|
|
700
|
+
*
|
|
701
|
+
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
702
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
703
|
+
* @returns A promise that resolves to the prepared transaction
|
|
704
|
+
*
|
|
705
|
+
* @example
|
|
706
|
+
* ```typescript
|
|
707
|
+
* const index = await tx.findInputIndexByLock(scriptLike, client);
|
|
708
|
+
* ```
|
|
709
|
+
*/
|
|
710
|
+
findInputIndexByLock(scriptLike: ScriptLike, client: Client): Promise<number | undefined>;
|
|
711
|
+
/**
|
|
712
|
+
* Find the last occurrence of a input with the specified lock
|
|
713
|
+
*
|
|
714
|
+
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
715
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
716
|
+
* @returns A promise that resolves to the prepared transaction
|
|
717
|
+
*
|
|
718
|
+
* @example
|
|
719
|
+
* ```typescript
|
|
720
|
+
* const index = await tx.findLastInputIndexByLock(scriptLike, client);
|
|
721
|
+
* ```
|
|
722
|
+
*/
|
|
723
|
+
findLastInputIndexByLock(scriptLike: ScriptLike, client: Client): Promise<number | undefined>;
|
|
724
|
+
/**
|
|
725
|
+
* Add cell deps if they are not existed
|
|
726
|
+
*
|
|
727
|
+
* @param cellDepLikes - The cell deps to add
|
|
728
|
+
*
|
|
729
|
+
* @example
|
|
730
|
+
* ```typescript
|
|
731
|
+
* tx.addCellDeps(cellDep);
|
|
732
|
+
* ```
|
|
733
|
+
*/
|
|
734
|
+
addCellDeps(...cellDepLikes: (CellDepLike | CellDepLike[])[]): void;
|
|
735
|
+
/**
|
|
736
|
+
* Add cell deps at the start if they are not existed
|
|
737
|
+
*
|
|
738
|
+
* @param cellDepLikes - The cell deps to add
|
|
739
|
+
*
|
|
740
|
+
* @example
|
|
741
|
+
* ```typescript
|
|
742
|
+
* tx.addCellDepsAtBegin(cellDep);
|
|
743
|
+
* ```
|
|
744
|
+
*/
|
|
745
|
+
addCellDepsAtStart(...cellDepLikes: (CellDepLike | CellDepLike[])[]): void;
|
|
746
|
+
/**
|
|
747
|
+
* Add cell dep from infos if they are not existed
|
|
748
|
+
*
|
|
749
|
+
* @param client - A client for searching cell deps
|
|
750
|
+
* @param cellDepInfoLikes - The cell dep infos to add
|
|
751
|
+
*
|
|
752
|
+
* @example
|
|
753
|
+
* ```typescript
|
|
754
|
+
* tx.addCellDepInfos(client, cellDepInfos);
|
|
755
|
+
* ```
|
|
756
|
+
*/
|
|
757
|
+
addCellDepInfos(client: Client, ...cellDepInfoLikes: (CellDepInfoLike | CellDepInfoLike[])[]): Promise<void>;
|
|
758
|
+
/**
|
|
759
|
+
* Add cell deps from known script
|
|
760
|
+
*
|
|
761
|
+
* @param client - The client for searching known script and cell deps
|
|
762
|
+
* @param scripts - The known scripts to add
|
|
763
|
+
*
|
|
764
|
+
* @example
|
|
765
|
+
* ```typescript
|
|
766
|
+
* tx.addCellDepsOfKnownScripts(client, KnownScript.OmniLock);
|
|
767
|
+
* ```
|
|
768
|
+
*/
|
|
769
|
+
addCellDepsOfKnownScripts(client: Client, ...scripts: (KnownScript | KnownScript[])[]): Promise<void>;
|
|
770
|
+
/**
|
|
771
|
+
* Set output data at index.
|
|
772
|
+
*
|
|
773
|
+
* @param index - The index of the output data.
|
|
774
|
+
* @param witness - The data to set.
|
|
775
|
+
*
|
|
776
|
+
* @example
|
|
777
|
+
* ```typescript
|
|
778
|
+
* await tx.setOutputDataAt(0, "0x00");
|
|
779
|
+
* ```
|
|
780
|
+
*/
|
|
781
|
+
setOutputDataAt(index: number, witness: HexLike): void;
|
|
782
|
+
/**
|
|
783
|
+
* get input
|
|
784
|
+
*
|
|
785
|
+
* @param index - The cell input index
|
|
786
|
+
*
|
|
787
|
+
* @example
|
|
788
|
+
* ```typescript
|
|
789
|
+
* await tx.getInput(0);
|
|
790
|
+
* ```
|
|
791
|
+
*/
|
|
792
|
+
getInput(index: NumLike): CellInput | undefined;
|
|
793
|
+
/**
|
|
794
|
+
* add input
|
|
795
|
+
*
|
|
796
|
+
* @param inputLike - The cell input.
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
* ```typescript
|
|
800
|
+
* await tx.addInput({ });
|
|
801
|
+
* ```
|
|
802
|
+
*/
|
|
803
|
+
addInput(inputLike: CellInputLike): number;
|
|
804
|
+
/**
|
|
805
|
+
* get output
|
|
806
|
+
*
|
|
807
|
+
* @param index - The cell output index
|
|
808
|
+
*
|
|
809
|
+
* @example
|
|
810
|
+
* ```typescript
|
|
811
|
+
* await tx.getOutput(0);
|
|
812
|
+
* ```
|
|
813
|
+
*/
|
|
814
|
+
getOutput(index: NumLike): {
|
|
815
|
+
cellOutput: CellOutput;
|
|
816
|
+
outputData: Hex;
|
|
817
|
+
} | undefined;
|
|
818
|
+
/**
|
|
819
|
+
* Add output
|
|
820
|
+
*
|
|
821
|
+
* @param outputLike - The cell output to add
|
|
822
|
+
* @param outputData - optional output data
|
|
823
|
+
*
|
|
824
|
+
* @example
|
|
825
|
+
* ```typescript
|
|
826
|
+
* await tx.addOutput(cellOutput, "0xabcd");
|
|
827
|
+
* ```
|
|
828
|
+
*/
|
|
829
|
+
addOutput(outputLike: Omit<CellOutputLike, "capacity"> & Partial<Pick<CellOutputLike, "capacity">>, outputData?: HexLike): number;
|
|
830
|
+
/**
|
|
831
|
+
* Get witness at index as WitnessArgs
|
|
832
|
+
*
|
|
833
|
+
* @param index - The index of the witness.
|
|
834
|
+
* @returns The witness parsed as WitnessArgs.
|
|
835
|
+
*
|
|
836
|
+
* @example
|
|
837
|
+
* ```typescript
|
|
838
|
+
* const witnessArgs = await tx.getWitnessArgsAt(0);
|
|
839
|
+
* ```
|
|
840
|
+
*/
|
|
841
|
+
getWitnessArgsAt(index: number): WitnessArgs | undefined;
|
|
842
|
+
/**
|
|
843
|
+
* Set witness at index by WitnessArgs
|
|
844
|
+
*
|
|
845
|
+
* @param index - The index of the witness.
|
|
846
|
+
* @param witness - The WitnessArgs to set.
|
|
847
|
+
*
|
|
848
|
+
* @example
|
|
849
|
+
* ```typescript
|
|
850
|
+
* await tx.setWitnessArgsAt(0, witnessArgs);
|
|
851
|
+
* ```
|
|
852
|
+
*/
|
|
853
|
+
setWitnessArgsAt(index: number, witness: WitnessArgs): void;
|
|
854
|
+
/**
|
|
855
|
+
* Prepare dummy witness for sighash all method
|
|
856
|
+
*
|
|
857
|
+
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
858
|
+
* @param lockLen - The length of dummy lock bytes.
|
|
859
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
860
|
+
* @returns A promise that resolves to the prepared transaction
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* ```typescript
|
|
864
|
+
* await tx.prepareSighashAllWitness(scriptLike, 85, client);
|
|
865
|
+
* ```
|
|
866
|
+
*/
|
|
867
|
+
prepareSighashAllWitness(scriptLike: ScriptLike, lockLen: number, client: Client): Promise<void>;
|
|
868
|
+
getInputsCapacity(client: Client): Promise<Num>;
|
|
869
|
+
getOutputsCapacity(): Num;
|
|
870
|
+
getInputsUdtBalance(client: Client, type: ScriptLike): Promise<Num>;
|
|
871
|
+
getOutputsUdtBalance(type: ScriptLike): Num;
|
|
872
|
+
completeInputs<T>(from: Signer, filter: ClientCollectableSearchKeyFilterLike, accumulator: (acc: T, v: Cell, i: number, array: Cell[]) => Promise<T | undefined> | T | undefined, init: T): Promise<{
|
|
873
|
+
addedCount: number;
|
|
874
|
+
accumulated?: T;
|
|
875
|
+
}>;
|
|
876
|
+
completeInputsByCapacity(from: Signer, capacityTweak?: NumLike, filter?: ClientCollectableSearchKeyFilterLike): Promise<number>;
|
|
877
|
+
completeInputsAll(from: Signer, filter?: ClientCollectableSearchKeyFilterLike): Promise<number>;
|
|
878
|
+
completeInputsByUdt(from: Signer, type: ScriptLike, balanceTweak?: NumLike): Promise<number>;
|
|
879
|
+
completeInputsAddOne(from: Signer, filter?: ClientCollectableSearchKeyFilterLike): Promise<number>;
|
|
880
|
+
completeInputsAtLeastOne(from: Signer, filter?: ClientCollectableSearchKeyFilterLike): Promise<number>;
|
|
881
|
+
fee(client: Client): Promise<Num>;
|
|
882
|
+
feeRate(client: Client): Promise<Num>;
|
|
883
|
+
estimateFee(feeRate: NumLike): Num;
|
|
884
|
+
completeFee(from: Signer, change: (tx: Transaction, capacity: Num) => Promise<NumLike> | NumLike, expectedFeeRate?: NumLike, filter?: ClientCollectableSearchKeyFilterLike, options?: {
|
|
885
|
+
feeRateBlockRange?: NumLike;
|
|
886
|
+
maxFeeRate?: NumLike;
|
|
887
|
+
}): Promise<[number, boolean]>;
|
|
888
|
+
completeFeeChangeToLock(from: Signer, change: ScriptLike, feeRate?: NumLike, filter?: ClientCollectableSearchKeyFilterLike): Promise<[number, boolean]>;
|
|
889
|
+
completeFeeBy(from: Signer, feeRate?: NumLike, filter?: ClientCollectableSearchKeyFilterLike): Promise<[number, boolean]>;
|
|
890
|
+
completeFeeChangeToOutput(from: Signer, index: NumLike, feeRate?: NumLike, filter?: ClientCollectableSearchKeyFilterLike): Promise<[number, boolean]>;
|
|
891
|
+
}
|
|
892
|
+
export {};
|
|
893
|
+
//# sourceMappingURL=transaction.d.ts.map
|