@ckb-ccc/core 0.0.12-alpha.0 → 0.0.12
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 +3 -0
- package/README.md +5 -5
- package/dist/address/index.d.ts +4 -0
- package/dist/address/index.d.ts.map +1 -1
- package/dist/address/index.js +1 -0
- package/dist/advancedBarrel.d.ts +1 -0
- package/dist/advancedBarrel.d.ts.map +1 -1
- package/dist/advancedBarrel.js +1 -0
- package/dist/bytes/advanced.d.ts +1 -0
- package/dist/bytes/advanced.d.ts.map +1 -1
- package/dist/bytes/index.d.ts +9 -0
- package/dist/bytes/index.d.ts.map +1 -1
- package/dist/bytes/index.js +3 -0
- package/dist/ckb/index.d.ts +1 -0
- package/dist/ckb/index.d.ts.map +1 -1
- package/dist/ckb/index.js +1 -0
- package/dist/ckb/script.d.ts +15 -0
- package/dist/ckb/script.d.ts.map +1 -1
- package/dist/ckb/script.js +6 -0
- package/dist/ckb/transaction.d.ts +65 -11
- package/dist/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +41 -14
- package/dist/ckb/transactionLumos.d.ts +29 -0
- package/dist/ckb/transactionLumos.d.ts.map +1 -0
- package/dist/ckb/transactionLumos.js +1 -0
- package/dist/client/client.d.ts +13 -1
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +10 -1
- package/dist/client/clientPublicMainnet.advanced.d.ts.map +1 -1
- package/dist/client/clientPublicMainnet.advanced.js +9 -0
- package/dist/client/clientPublicMainnet.d.ts +3 -0
- package/dist/client/clientPublicMainnet.d.ts.map +1 -1
- package/dist/client/clientPublicMainnet.js +3 -0
- package/dist/client/clientPublicTestnet.advanced.d.ts.map +1 -1
- package/dist/client/clientPublicTestnet.advanced.js +9 -0
- package/dist/client/clientPublicTestnet.d.ts +3 -0
- package/dist/client/clientPublicTestnet.d.ts.map +1 -1
- package/dist/client/clientPublicTestnet.js +3 -0
- package/dist/client/clientTypes.d.ts +45 -0
- package/dist/client/clientTypes.d.ts.map +1 -1
- package/dist/client/clientTypes.js +9 -0
- package/dist/client/jsonRpc/index.d.ts +6 -6
- package/dist/client/jsonRpc/index.d.ts.map +1 -1
- package/dist/client/jsonRpc/index.js +3 -3
- package/dist/fixedPoint/index.d.ts +6 -0
- package/dist/fixedPoint/index.d.ts.map +1 -1
- package/dist/fixedPoint/index.js +5 -0
- package/dist/hasher/hasher.d.ts +3 -0
- package/dist/hasher/hasher.d.ts.map +1 -1
- package/dist/hasher/hasherCkb.d.ts +6 -1
- package/dist/hasher/hasherCkb.d.ts.map +1 -1
- package/dist/hasher/hasherCkb.js +6 -1
- package/dist/hasher/hasherKeecak256.d.ts +3 -0
- package/dist/hasher/hasherKeecak256.d.ts.map +1 -1
- package/dist/hasher/hasherKeecak256.js +3 -0
- package/dist/hex/index.d.ts +3 -0
- package/dist/hex/index.d.ts.map +1 -1
- package/dist/hex/index.js +1 -0
- package/dist/keystore/index.d.ts +6 -0
- package/dist/keystore/index.d.ts.map +1 -1
- package/dist/keystore/index.js +6 -0
- package/dist/num/index.d.ts +11 -0
- package/dist/num/index.d.ts.map +1 -1
- package/dist/num/index.js +9 -0
- package/dist/package.json +1 -1
- package/dist/signer/btc/signerBtc.d.ts +1 -0
- package/dist/signer/btc/signerBtc.d.ts.map +1 -1
- package/dist/signer/btc/signerBtc.js +1 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts +1 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
- package/dist/signer/btc/signerBtcPublicKeyReadonly.js +1 -0
- package/dist/signer/btc/verify.d.ts +3 -0
- package/dist/signer/btc/verify.d.ts.map +1 -1
- package/dist/signer/btc/verify.js +3 -0
- package/dist/signer/ckb/signerCkbPrivateKey.d.ts +3 -0
- package/dist/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbPrivateKey.js +3 -0
- package/dist/signer/ckb/signerCkbPublicKey.d.ts +3 -0
- package/dist/signer/ckb/signerCkbPublicKey.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbPublicKey.js +3 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts +1 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbScriptReadonly.js +1 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.d.ts +6 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -1
- package/dist/signer/ckb/verifyCkbSecp256k1.js +6 -0
- package/dist/signer/ckb/verifyJoyId.d.ts +3 -0
- package/dist/signer/ckb/verifyJoyId.d.ts.map +1 -1
- package/dist/signer/ckb/verifyJoyId.js +3 -0
- package/dist/signer/dummy/alwaysError.d.ts +3 -0
- package/dist/signer/dummy/alwaysError.d.ts.map +1 -1
- package/dist/signer/dummy/alwaysError.js +3 -0
- package/dist/signer/dummy/dummy.d.ts +3 -0
- package/dist/signer/dummy/dummy.d.ts.map +1 -1
- package/dist/signer/dummy/dummy.js +3 -0
- package/dist/signer/dummy/openLink.d.ts +3 -0
- package/dist/signer/dummy/openLink.d.ts.map +1 -1
- package/dist/signer/dummy/openLink.js +3 -0
- package/dist/signer/evm/signerEvm.d.ts +1 -0
- package/dist/signer/evm/signerEvm.d.ts.map +1 -1
- package/dist/signer/evm/signerEvm.js +1 -0
- package/dist/signer/evm/signerEvmAddressReadonly.d.ts +1 -0
- package/dist/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
- package/dist/signer/evm/signerEvmAddressReadonly.js +1 -0
- package/dist/signer/evm/verify.d.ts +3 -0
- package/dist/signer/evm/verify.d.ts.map +1 -1
- package/dist/signer/evm/verify.js +3 -0
- package/dist/signer/nostr/signerNostr.d.ts +6 -0
- package/dist/signer/nostr/signerNostr.d.ts.map +1 -1
- package/dist/signer/nostr/signerNostr.js +3 -0
- package/dist/signer/nostr/verify.d.ts +3 -0
- package/dist/signer/nostr/verify.d.ts.map +1 -1
- package/dist/signer/nostr/verify.js +3 -0
- package/dist/signer/signer/index.d.ts +26 -3
- package/dist/signer/signer/index.d.ts.map +1 -1
- package/dist/signer/signer/index.js +12 -3
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +13 -0
- package/dist.commonjs/address/index.d.ts +4 -0
- package/dist.commonjs/address/index.d.ts.map +1 -1
- package/dist.commonjs/address/index.js +1 -0
- package/dist.commonjs/advancedBarrel.d.ts +1 -0
- package/dist.commonjs/advancedBarrel.d.ts.map +1 -1
- package/dist.commonjs/advancedBarrel.js +1 -0
- package/dist.commonjs/bytes/advanced.d.ts +1 -0
- package/dist.commonjs/bytes/advanced.d.ts.map +1 -1
- package/dist.commonjs/bytes/index.d.ts +9 -0
- package/dist.commonjs/bytes/index.d.ts.map +1 -1
- package/dist.commonjs/bytes/index.js +3 -0
- package/dist.commonjs/ckb/index.d.ts +1 -0
- package/dist.commonjs/ckb/index.d.ts.map +1 -1
- package/dist.commonjs/ckb/index.js +1 -0
- package/dist.commonjs/ckb/script.d.ts +15 -0
- package/dist.commonjs/ckb/script.d.ts.map +1 -1
- package/dist.commonjs/ckb/script.js +6 -0
- package/dist.commonjs/ckb/transaction.d.ts +65 -11
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +41 -14
- package/dist.commonjs/ckb/transactionLumos.d.ts +29 -0
- package/dist.commonjs/ckb/transactionLumos.d.ts.map +1 -0
- package/dist.commonjs/ckb/transactionLumos.js +2 -0
- package/dist.commonjs/client/client.d.ts +13 -1
- package/dist.commonjs/client/client.d.ts.map +1 -1
- package/dist.commonjs/client/client.js +10 -1
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +9 -0
- package/dist.commonjs/client/clientPublicMainnet.d.ts +3 -0
- package/dist.commonjs/client/clientPublicMainnet.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicMainnet.js +3 -0
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +9 -0
- package/dist.commonjs/client/clientPublicTestnet.d.ts +3 -0
- package/dist.commonjs/client/clientPublicTestnet.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicTestnet.js +3 -0
- package/dist.commonjs/client/clientTypes.d.ts +45 -0
- package/dist.commonjs/client/clientTypes.d.ts.map +1 -1
- package/dist.commonjs/client/clientTypes.js +9 -0
- package/dist.commonjs/client/jsonRpc/index.d.ts +6 -6
- package/dist.commonjs/client/jsonRpc/index.d.ts.map +1 -1
- package/dist.commonjs/client/jsonRpc/index.js +3 -3
- package/dist.commonjs/fixedPoint/index.d.ts +6 -0
- package/dist.commonjs/fixedPoint/index.d.ts.map +1 -1
- package/dist.commonjs/fixedPoint/index.js +5 -0
- package/dist.commonjs/hasher/hasher.d.ts +3 -0
- package/dist.commonjs/hasher/hasher.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherCkb.d.ts +6 -1
- package/dist.commonjs/hasher/hasherCkb.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherCkb.js +6 -1
- package/dist.commonjs/hasher/hasherKeecak256.d.ts +3 -0
- package/dist.commonjs/hasher/hasherKeecak256.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherKeecak256.js +3 -0
- package/dist.commonjs/hex/index.d.ts +3 -0
- package/dist.commonjs/hex/index.d.ts.map +1 -1
- package/dist.commonjs/hex/index.js +1 -0
- package/dist.commonjs/keystore/index.d.ts +6 -0
- package/dist.commonjs/keystore/index.d.ts.map +1 -1
- package/dist.commonjs/keystore/index.js +6 -0
- package/dist.commonjs/num/index.d.ts +11 -0
- package/dist.commonjs/num/index.d.ts.map +1 -1
- package/dist.commonjs/num/index.js +9 -0
- package/dist.commonjs/signer/btc/signerBtc.d.ts +1 -0
- package/dist.commonjs/signer/btc/signerBtc.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/signerBtc.js +1 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +1 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +1 -0
- package/dist.commonjs/signer/btc/verify.d.ts +3 -0
- package/dist.commonjs/signer/btc/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/verify.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +1 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +1 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts +6 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.js +6 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts +3 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/verifyJoyId.js +3 -0
- package/dist.commonjs/signer/dummy/alwaysError.d.ts +3 -0
- package/dist.commonjs/signer/dummy/alwaysError.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/alwaysError.js +3 -0
- package/dist.commonjs/signer/dummy/dummy.d.ts +3 -0
- package/dist.commonjs/signer/dummy/dummy.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/dummy.js +3 -0
- package/dist.commonjs/signer/dummy/openLink.d.ts +3 -0
- package/dist.commonjs/signer/dummy/openLink.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/openLink.js +3 -0
- package/dist.commonjs/signer/evm/signerEvm.d.ts +1 -0
- package/dist.commonjs/signer/evm/signerEvm.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/signerEvm.js +1 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +1 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +1 -0
- package/dist.commonjs/signer/evm/verify.d.ts +3 -0
- package/dist.commonjs/signer/evm/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/verify.js +3 -0
- package/dist.commonjs/signer/nostr/signerNostr.d.ts +6 -0
- package/dist.commonjs/signer/nostr/signerNostr.d.ts.map +1 -1
- package/dist.commonjs/signer/nostr/signerNostr.js +3 -0
- package/dist.commonjs/signer/nostr/verify.d.ts +3 -0
- package/dist.commonjs/signer/nostr/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/nostr/verify.js +3 -0
- package/dist.commonjs/signer/signer/index.d.ts +26 -3
- package/dist.commonjs/signer/signer/index.d.ts.map +1 -1
- package/dist.commonjs/signer/signer/index.js +12 -3
- package/dist.commonjs/utils/index.d.ts +12 -0
- package/dist.commonjs/utils/index.d.ts.map +1 -1
- package/dist.commonjs/utils/index.js +13 -0
- package/package.json +8 -10
- package/src/address/index.ts +4 -1
- package/src/advancedBarrel.ts +1 -0
- package/src/bytes/advanced.ts +1 -0
- package/src/bytes/index.ts +9 -0
- package/src/ckb/index.ts +1 -0
- package/src/ckb/script.ts +15 -0
- package/src/ckb/transaction.ts +72 -16
- package/src/ckb/transactionLumos.ts +26 -0
- package/src/client/client.ts +13 -1
- package/src/client/clientPublicMainnet.advanced.ts +10 -0
- package/src/client/clientPublicMainnet.ts +3 -0
- package/src/client/clientPublicTestnet.advanced.ts +10 -0
- package/src/client/clientPublicTestnet.ts +3 -0
- package/src/client/clientTypes.ts +45 -0
- package/src/client/jsonRpc/index.ts +5 -6
- package/src/fixedPoint/index.ts +6 -0
- package/src/hasher/hasher.ts +3 -0
- package/src/hasher/hasherCkb.ts +6 -1
- package/src/hasher/hasherKeecak256.ts +3 -0
- package/src/hex/index.ts +3 -0
- package/src/keystore/index.ts +6 -0
- package/src/num/index.ts +11 -0
- package/src/signer/btc/signerBtc.ts +1 -0
- package/src/signer/btc/signerBtcPublicKeyReadonly.ts +1 -0
- package/src/signer/btc/verify.ts +3 -0
- package/src/signer/ckb/signerCkbPrivateKey.ts +3 -0
- package/src/signer/ckb/signerCkbPublicKey.ts +3 -0
- package/src/signer/ckb/signerCkbScriptReadonly.ts +1 -0
- package/src/signer/ckb/verifyCkbSecp256k1.ts +6 -0
- package/src/signer/ckb/verifyJoyId.ts +3 -0
- package/src/signer/dummy/alwaysError.ts +3 -0
- package/src/signer/dummy/dummy.ts +3 -0
- package/src/signer/dummy/openLink.ts +3 -0
- package/src/signer/evm/signerEvm.ts +1 -0
- package/src/signer/evm/signerEvmAddressReadonly.ts +1 -0
- package/src/signer/evm/verify.ts +3 -0
- package/src/signer/nostr/signerNostr.ts +6 -0
- package/src/signer/nostr/verify.ts +3 -0
- package/src/signer/signer/index.ts +26 -14
- package/src/utils/index.ts +22 -0
- package/typedoc.json +6 -0
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { BytesFromEncoding } from "./advanced.js";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export type Bytes = Uint8Array;
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
3
9
|
export type BytesLike = string | Uint8Array | ArrayBuffer | number[];
|
|
4
10
|
/**
|
|
5
11
|
* Concatenates multiple byte-like arrays into a single byte array.
|
|
12
|
+
* @public
|
|
6
13
|
*
|
|
7
14
|
* @param args - The byte-like arrays to concatenate.
|
|
8
15
|
* @returns A Uint8Array containing the concatenated bytes.
|
|
@@ -21,6 +28,7 @@ export type BytesLike = string | Uint8Array | ArrayBuffer | number[];
|
|
|
21
28
|
export declare function bytesConcat(...args: BytesLike[]): Bytes;
|
|
22
29
|
/**
|
|
23
30
|
* Converts a byte-like value to a string using the specified encoding.
|
|
31
|
+
* @public
|
|
24
32
|
*
|
|
25
33
|
* @param val - The byte-like value to convert.
|
|
26
34
|
* @param encoding - The encoding to use for the conversion, as defined by the BytesFromEncoding type.
|
|
@@ -38,6 +46,7 @@ export declare function bytesConcat(...args: BytesLike[]): Bytes;
|
|
|
38
46
|
export declare function bytesTo(val: BytesLike, encoding: BytesFromEncoding): string;
|
|
39
47
|
/**
|
|
40
48
|
* Converts various types of byte-like values to a Uint8Array.
|
|
49
|
+
* @public
|
|
41
50
|
*
|
|
42
51
|
* @param bytes - The byte-like value to convert. It can be a string, Uint8Array, ArrayBuffer, or number array.
|
|
43
52
|
* @param encoding - Optional encoding to use if the input is a string. Defaults to hexadecimal if not specified.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bytes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC;AAC/B,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,EAAE,CAAC;AAErE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bytes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC;AAC/B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,EAAE,CAAC;AAErE;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAgB,WAAW,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAOvD;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAgB,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAE3E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,EAChB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,KAAK,CA2BP"}
|
|
@@ -4,6 +4,7 @@ exports.bytesFrom = exports.bytesTo = exports.bytesConcat = void 0;
|
|
|
4
4
|
const index_js_1 = require("buffer/index.js");
|
|
5
5
|
/**
|
|
6
6
|
* Concatenates multiple byte-like arrays into a single byte array.
|
|
7
|
+
* @public
|
|
7
8
|
*
|
|
8
9
|
* @param args - The byte-like arrays to concatenate.
|
|
9
10
|
* @returns A Uint8Array containing the concatenated bytes.
|
|
@@ -28,6 +29,7 @@ function bytesConcat(...args) {
|
|
|
28
29
|
exports.bytesConcat = bytesConcat;
|
|
29
30
|
/**
|
|
30
31
|
* Converts a byte-like value to a string using the specified encoding.
|
|
32
|
+
* @public
|
|
31
33
|
*
|
|
32
34
|
* @param val - The byte-like value to convert.
|
|
33
35
|
* @param encoding - The encoding to use for the conversion, as defined by the BytesFromEncoding type.
|
|
@@ -48,6 +50,7 @@ function bytesTo(val, encoding) {
|
|
|
48
50
|
exports.bytesTo = bytesTo;
|
|
49
51
|
/**
|
|
50
52
|
* Converts various types of byte-like values to a Uint8Array.
|
|
53
|
+
* @public
|
|
51
54
|
*
|
|
52
55
|
* @param bytes - The byte-like value to convert. It can be a string, Uint8Array, ArrayBuffer, or number array.
|
|
53
56
|
* @param encoding - Optional encoding to use if the input is a string. Defaults to hexadecimal if not specified.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ckb/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ckb/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./script.js"), exports);
|
|
18
18
|
__exportStar(require("./transaction.js"), exports);
|
|
19
|
+
__exportStar(require("./transactionLumos.js"), exports);
|
|
@@ -2,10 +2,17 @@ import { Bytes, BytesLike } from "../bytes/index.js";
|
|
|
2
2
|
import { Client, KnownScript } from "../client/index.js";
|
|
3
3
|
import { Hex, HexLike } from "../hex/index.js";
|
|
4
4
|
import * as mol from "./molecule.advanced/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
5
8
|
export type HashTypeLike = string | number | bigint;
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
6
12
|
export type HashType = "type" | "data" | "data1" | "data2";
|
|
7
13
|
/**
|
|
8
14
|
* Converts a HashTypeLike value to a HashType.
|
|
15
|
+
* @public
|
|
9
16
|
*
|
|
10
17
|
* @param val - The value to convert, which can be a string, number, or bigint.
|
|
11
18
|
* @returns The corresponding HashType.
|
|
@@ -21,6 +28,7 @@ export type HashType = "type" | "data" | "data1" | "data2";
|
|
|
21
28
|
export declare function hashTypeFrom(val: HashTypeLike): HashType;
|
|
22
29
|
/**
|
|
23
30
|
* Converts a HashTypeLike value to its corresponding byte representation.
|
|
31
|
+
* @public
|
|
24
32
|
*
|
|
25
33
|
* @param hashType - The hash type value to convert.
|
|
26
34
|
* @returns A Uint8Array containing the byte representation of the hash type.
|
|
@@ -33,6 +41,7 @@ export declare function hashTypeFrom(val: HashTypeLike): HashType;
|
|
|
33
41
|
export declare function hashTypeToBytes(hashType: HashTypeLike): Bytes;
|
|
34
42
|
/**
|
|
35
43
|
* Converts a byte-like value to a HashType.
|
|
44
|
+
* @public
|
|
36
45
|
*
|
|
37
46
|
* @param bytes - The byte-like value to convert.
|
|
38
47
|
* @returns The corresponding HashType.
|
|
@@ -45,11 +54,17 @@ export declare function hashTypeToBytes(hashType: HashTypeLike): Bytes;
|
|
|
45
54
|
* ```
|
|
46
55
|
*/
|
|
47
56
|
export declare function hashTypeFromBytes(bytes: BytesLike): HashType;
|
|
57
|
+
/**
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
48
60
|
export type ScriptLike = {
|
|
49
61
|
codeHash: BytesLike;
|
|
50
62
|
hashType: HashTypeLike;
|
|
51
63
|
args: BytesLike;
|
|
52
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
53
68
|
export declare class Script {
|
|
54
69
|
codeHash: Hex;
|
|
55
70
|
hashType: HashType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../src/ckb/script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AAOpD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACpD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../src/ckb/script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,S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ACd,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,MAAM,CAAC;IAKlB;;;;OAIG;IAEH,UAAU,IAAI,GAAG,CAAC,UAAU;IAQ5B;;;;;;;;;OASG;IAEH,OAAO,IAAI,KAAK;IAIhB;;;;;;;;;OASG;IACH,IAAI,IAAI,GAAG;IAIX;;;;;;;;;;OAUG;IAEH,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,MAAM,GAAG,MAAM;IAWvD;;;;;;;;;;OAUG;IAEH,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO;CAQ7B"}
|
|
@@ -31,6 +31,7 @@ const mol = __importStar(require("./molecule.advanced/index.js"));
|
|
|
31
31
|
const script_advanced_js_1 = require("./script.advanced.js");
|
|
32
32
|
/**
|
|
33
33
|
* Converts a HashTypeLike value to a HashType.
|
|
34
|
+
* @public
|
|
34
35
|
*
|
|
35
36
|
* @param val - The value to convert, which can be a string, number, or bigint.
|
|
36
37
|
* @returns The corresponding HashType.
|
|
@@ -64,6 +65,7 @@ function hashTypeFrom(val) {
|
|
|
64
65
|
exports.hashTypeFrom = hashTypeFrom;
|
|
65
66
|
/**
|
|
66
67
|
* Converts a HashTypeLike value to its corresponding byte representation.
|
|
68
|
+
* @public
|
|
67
69
|
*
|
|
68
70
|
* @param hashType - The hash type value to convert.
|
|
69
71
|
* @returns A Uint8Array containing the byte representation of the hash type.
|
|
@@ -79,6 +81,7 @@ function hashTypeToBytes(hashType) {
|
|
|
79
81
|
exports.hashTypeToBytes = hashTypeToBytes;
|
|
80
82
|
/**
|
|
81
83
|
* Converts a byte-like value to a HashType.
|
|
84
|
+
* @public
|
|
82
85
|
*
|
|
83
86
|
* @param bytes - The byte-like value to convert.
|
|
84
87
|
* @returns The corresponding HashType.
|
|
@@ -94,6 +97,9 @@ function hashTypeFromBytes(bytes) {
|
|
|
94
97
|
return script_advanced_js_1.NUM_TO_HASH_TYPE[(0, index_js_1.bytesFrom)(bytes)[0]];
|
|
95
98
|
}
|
|
96
99
|
exports.hashTypeFromBytes = hashTypeFromBytes;
|
|
100
|
+
/**
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
97
103
|
class Script {
|
|
98
104
|
/**
|
|
99
105
|
* Creates an instance of Script.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { TransactionSkeletonType } from "@ckb-lumos/helpers";
|
|
2
1
|
import { ClientCollectableSearchKeyFilterLike } from "../advancedBarrel.js";
|
|
3
2
|
import { Bytes, BytesLike } from "../bytes/index.js";
|
|
4
3
|
import { CellDepInfoLike, Client, KnownScript } from "../client/index.js";
|
|
@@ -8,10 +7,18 @@ import { Num, NumLike } from "../num/index.js";
|
|
|
8
7
|
import { Signer } from "../signer/index.js";
|
|
9
8
|
import * as mol from "./molecule.advanced/index.js";
|
|
10
9
|
import { Script, ScriptLike } from "./script.js";
|
|
10
|
+
import { LumosTransactionSkeletonType } from "./transactionLumos.js";
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
11
14
|
export type DepTypeLike = string | number | bigint;
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
12
18
|
export type DepType = "depGroup" | "code";
|
|
13
19
|
/**
|
|
14
20
|
* Converts a DepTypeLike value to a DepType.
|
|
21
|
+
* @public
|
|
15
22
|
*
|
|
16
23
|
* @param val - The value to convert, which can be a string, number, or bigint.
|
|
17
24
|
* @returns The corresponding DepType.
|
|
@@ -27,6 +34,7 @@ export type DepType = "depGroup" | "code";
|
|
|
27
34
|
export declare function depTypeFrom(val: DepTypeLike): DepType;
|
|
28
35
|
/**
|
|
29
36
|
* Converts a DepTypeLike value to its corresponding byte representation.
|
|
37
|
+
* @public
|
|
30
38
|
*
|
|
31
39
|
* @param depType - The dep type value to convert.
|
|
32
40
|
* @returns A Uint8Array containing the byte representation of the dep type.
|
|
@@ -39,6 +47,7 @@ export declare function depTypeFrom(val: DepTypeLike): DepType;
|
|
|
39
47
|
export declare function depTypeToBytes(depType: DepTypeLike): Bytes;
|
|
40
48
|
/**
|
|
41
49
|
* Converts a byte-like value to a DepType.
|
|
50
|
+
* @public
|
|
42
51
|
*
|
|
43
52
|
* @param bytes - The byte-like value to convert.
|
|
44
53
|
* @returns The corresponding DepType.
|
|
@@ -51,10 +60,16 @@ export declare function depTypeToBytes(depType: DepTypeLike): Bytes;
|
|
|
51
60
|
* ```
|
|
52
61
|
*/
|
|
53
62
|
export declare function depTypeFromBytes(bytes: BytesLike): DepType;
|
|
63
|
+
/**
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
54
66
|
export type OutPointLike = {
|
|
55
67
|
txHash: HexLike;
|
|
56
68
|
index: NumLike;
|
|
57
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
58
73
|
export declare class OutPoint {
|
|
59
74
|
txHash: Hex;
|
|
60
75
|
index: Num;
|
|
@@ -130,11 +145,17 @@ export declare class OutPoint {
|
|
|
130
145
|
*/
|
|
131
146
|
eq(val: OutPointLike): boolean;
|
|
132
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
133
151
|
export type CellOutputLike = {
|
|
134
152
|
capacity: NumLike;
|
|
135
153
|
lock: ScriptLike;
|
|
136
154
|
type?: ScriptLike | null;
|
|
137
155
|
};
|
|
156
|
+
/**
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
138
159
|
export declare class CellOutput {
|
|
139
160
|
capacity: Num;
|
|
140
161
|
lock: Script;
|
|
@@ -205,11 +226,17 @@ export declare class CellOutput {
|
|
|
205
226
|
*/
|
|
206
227
|
static fromBytes(bytes: BytesLike | mol.CellOutput): CellOutput;
|
|
207
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* @public
|
|
231
|
+
*/
|
|
208
232
|
export type CellLike = {
|
|
209
233
|
outPoint: OutPointLike;
|
|
210
234
|
cellOutput: CellOutputLike;
|
|
211
235
|
outputData: HexLike;
|
|
212
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* @public
|
|
239
|
+
*/
|
|
213
240
|
export declare class Cell {
|
|
214
241
|
outPoint: OutPoint;
|
|
215
242
|
cellOutput: CellOutput;
|
|
@@ -241,12 +268,18 @@ export declare class Cell {
|
|
|
241
268
|
*/
|
|
242
269
|
clone(): Cell;
|
|
243
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* @public
|
|
273
|
+
*/
|
|
244
274
|
export type CellInputLike = {
|
|
245
275
|
previousOutput: OutPointLike;
|
|
246
276
|
since?: NumLike | null;
|
|
247
277
|
cellOutput?: CellOutputLike | null;
|
|
248
278
|
outputData?: HexLike | null;
|
|
249
279
|
};
|
|
280
|
+
/**
|
|
281
|
+
* @public
|
|
282
|
+
*/
|
|
250
283
|
export declare class CellInput {
|
|
251
284
|
previousOutput: OutPoint;
|
|
252
285
|
since: Num;
|
|
@@ -328,10 +361,16 @@ export declare class CellInput {
|
|
|
328
361
|
*/
|
|
329
362
|
static fromBytes(bytes: BytesLike | mol.CellInput): CellInput;
|
|
330
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* @public
|
|
366
|
+
*/
|
|
331
367
|
export type CellDepLike = {
|
|
332
368
|
outPoint: OutPointLike;
|
|
333
369
|
depType: DepTypeLike;
|
|
334
370
|
};
|
|
371
|
+
/**
|
|
372
|
+
* @public
|
|
373
|
+
*/
|
|
335
374
|
export declare class CellDep {
|
|
336
375
|
outPoint: OutPoint;
|
|
337
376
|
depType: DepType;
|
|
@@ -410,11 +449,17 @@ export declare class CellDep {
|
|
|
410
449
|
*/
|
|
411
450
|
eq(val: CellDepLike): boolean;
|
|
412
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* @public
|
|
454
|
+
*/
|
|
413
455
|
export type WitnessArgsLike = {
|
|
414
456
|
lock?: HexLike | null;
|
|
415
457
|
inputType?: HexLike | null;
|
|
416
458
|
outputType?: HexLike | null;
|
|
417
459
|
};
|
|
460
|
+
/**
|
|
461
|
+
* @public
|
|
462
|
+
*/
|
|
418
463
|
export declare class WitnessArgs {
|
|
419
464
|
lock?: `0x${string}` | undefined;
|
|
420
465
|
inputType?: `0x${string}` | undefined;
|
|
@@ -473,7 +518,13 @@ export declare class WitnessArgs {
|
|
|
473
518
|
*/
|
|
474
519
|
static fromBytes(bytes: BytesLike | mol.WitnessArgs): WitnessArgs;
|
|
475
520
|
}
|
|
521
|
+
/**
|
|
522
|
+
* @public
|
|
523
|
+
*/
|
|
476
524
|
export declare function udtBalanceFrom(dataLike: BytesLike): Num;
|
|
525
|
+
/**
|
|
526
|
+
* @public
|
|
527
|
+
*/
|
|
477
528
|
export type TransactionLike = {
|
|
478
529
|
version?: NumLike | null;
|
|
479
530
|
cellDeps?: CellDepLike[] | null;
|
|
@@ -483,6 +534,9 @@ export type TransactionLike = {
|
|
|
483
534
|
outputsData?: HexLike[] | null;
|
|
484
535
|
witnesses?: HexLike[] | null;
|
|
485
536
|
};
|
|
537
|
+
/**
|
|
538
|
+
* @public
|
|
539
|
+
*/
|
|
486
540
|
export declare class Transaction {
|
|
487
541
|
version: Num;
|
|
488
542
|
cellDeps: CellDep[];
|
|
@@ -567,7 +621,7 @@ export declare class Transaction {
|
|
|
567
621
|
* const transaction = Transaction.fromLumosSkeleton(skeleton);
|
|
568
622
|
* ```
|
|
569
623
|
*/
|
|
570
|
-
static fromLumosSkeleton(skeleton:
|
|
624
|
+
static fromLumosSkeleton(skeleton: LumosTransactionSkeletonType): Transaction;
|
|
571
625
|
stringify(): string;
|
|
572
626
|
/**
|
|
573
627
|
* Converts the raw transaction data to bytes.
|
|
@@ -647,7 +701,7 @@ export declare class Transaction {
|
|
|
647
701
|
* const index = await tx.findInputIndexByLockId(scriptIdLike, client);
|
|
648
702
|
* ```
|
|
649
703
|
*/
|
|
650
|
-
findInputIndexByLockId(
|
|
704
|
+
findInputIndexByLockId(scriptIdLike: Pick<ScriptLike, "codeHash" | "hashType">, client: Client): Promise<number | undefined>;
|
|
651
705
|
/**
|
|
652
706
|
* Find the first occurrence of a input with the specified lock
|
|
653
707
|
*
|
|
@@ -684,7 +738,7 @@ export declare class Transaction {
|
|
|
684
738
|
* tx.addCellDeps(cellDep);
|
|
685
739
|
* ```
|
|
686
740
|
*/
|
|
687
|
-
addCellDeps(...
|
|
741
|
+
addCellDeps(...cellDepLikes: (CellDepLike | CellDepLike[])[]): void;
|
|
688
742
|
/**
|
|
689
743
|
* Add cell deps at the start if they are not existed
|
|
690
744
|
*
|
|
@@ -695,19 +749,19 @@ export declare class Transaction {
|
|
|
695
749
|
* tx.addCellDepsAtBegin(cellDep);
|
|
696
750
|
* ```
|
|
697
751
|
*/
|
|
698
|
-
addCellDepsAtStart(...
|
|
752
|
+
addCellDepsAtStart(...cellDepLikes: (CellDepLike | CellDepLike[])[]): void;
|
|
699
753
|
/**
|
|
700
754
|
* Add cell dep from infos if they are not existed
|
|
701
755
|
*
|
|
702
756
|
* @param client - A client for searching cell deps
|
|
703
|
-
* @param
|
|
757
|
+
* @param cellDepInfoLikes - The cell dep infos to add
|
|
704
758
|
*
|
|
705
759
|
* @example
|
|
706
760
|
* ```typescript
|
|
707
761
|
* tx.addCellDepInfos(client, cellDepInfos);
|
|
708
762
|
* ```
|
|
709
763
|
*/
|
|
710
|
-
addCellDepInfos(client: Client, ...
|
|
764
|
+
addCellDepInfos(client: Client, ...cellDepInfoLikes: (CellDepInfoLike | CellDepInfoLike[])[]): Promise<void>;
|
|
711
765
|
/**
|
|
712
766
|
* Add cell deps from known script
|
|
713
767
|
*
|
|
@@ -728,15 +782,15 @@ export declare class Transaction {
|
|
|
728
782
|
*
|
|
729
783
|
* @example
|
|
730
784
|
* ```typescript
|
|
731
|
-
* await tx.
|
|
785
|
+
* await tx.setOutputDataAt(0, "0x00");
|
|
732
786
|
* ```
|
|
733
787
|
*/
|
|
734
|
-
setOutputDataAt(index: number,
|
|
788
|
+
setOutputDataAt(index: number, witness: HexLike): void;
|
|
735
789
|
/**
|
|
736
790
|
* Add output
|
|
737
791
|
*
|
|
738
|
-
* @param
|
|
739
|
-
* @param
|
|
792
|
+
* @param outputLike - The cell output to add
|
|
793
|
+
* @param outputData - optional output data
|
|
740
794
|
*
|
|
741
795
|
* @example
|
|
742
796
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/ckb/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/ckb/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAM1E,OAAO,EAAE,MAAM,EAAsB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,GAAG,EACH,OAAO,EAKR,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAE1C;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAgBrD;AAED;;;;;;;;;;;GAWG;AAEH,wBAAgB,c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AC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IA8B1E,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG;IAK5B,WAAW,CACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,EACtE,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,oCAAoC,GAC5C,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAyE7B,uBAAuB,CACrB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,oCAAoC,GAC5C,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoBvB,aAAa,CACjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,oCAAoC,GAC5C,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAM7B,yBAAyB,CACvB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,oCAAoC,GAC5C,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAe9B"}
|
|
@@ -35,6 +35,7 @@ const script_js_1 = require("./script.js");
|
|
|
35
35
|
const transaction_advanced_js_1 = require("./transaction.advanced.js");
|
|
36
36
|
/**
|
|
37
37
|
* Converts a DepTypeLike value to a DepType.
|
|
38
|
+
* @public
|
|
38
39
|
*
|
|
39
40
|
* @param val - The value to convert, which can be a string, number, or bigint.
|
|
40
41
|
* @returns The corresponding DepType.
|
|
@@ -65,6 +66,7 @@ function depTypeFrom(val) {
|
|
|
65
66
|
exports.depTypeFrom = depTypeFrom;
|
|
66
67
|
/**
|
|
67
68
|
* Converts a DepTypeLike value to its corresponding byte representation.
|
|
69
|
+
* @public
|
|
68
70
|
*
|
|
69
71
|
* @param depType - The dep type value to convert.
|
|
70
72
|
* @returns A Uint8Array containing the byte representation of the dep type.
|
|
@@ -80,6 +82,7 @@ function depTypeToBytes(depType) {
|
|
|
80
82
|
exports.depTypeToBytes = depTypeToBytes;
|
|
81
83
|
/**
|
|
82
84
|
* Converts a byte-like value to a DepType.
|
|
85
|
+
* @public
|
|
83
86
|
*
|
|
84
87
|
* @param bytes - The byte-like value to convert.
|
|
85
88
|
* @returns The corresponding DepType.
|
|
@@ -95,6 +98,9 @@ function depTypeFromBytes(bytes) {
|
|
|
95
98
|
return transaction_advanced_js_1.NUM_TO_DEP_TYPE[(0, index_js_1.bytesFrom)(bytes)[0]];
|
|
96
99
|
}
|
|
97
100
|
exports.depTypeFromBytes = depTypeFromBytes;
|
|
101
|
+
/**
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
98
104
|
class OutPoint {
|
|
99
105
|
/**
|
|
100
106
|
* Creates an instance of OutPoint.
|
|
@@ -194,6 +200,9 @@ class OutPoint {
|
|
|
194
200
|
}
|
|
195
201
|
}
|
|
196
202
|
exports.OutPoint = OutPoint;
|
|
203
|
+
/**
|
|
204
|
+
* @public
|
|
205
|
+
*/
|
|
197
206
|
class CellOutput {
|
|
198
207
|
/**
|
|
199
208
|
* Creates an instance of CellOutput.
|
|
@@ -288,6 +297,9 @@ class CellOutput {
|
|
|
288
297
|
}
|
|
289
298
|
}
|
|
290
299
|
exports.CellOutput = CellOutput;
|
|
300
|
+
/**
|
|
301
|
+
* @public
|
|
302
|
+
*/
|
|
291
303
|
class Cell {
|
|
292
304
|
/**
|
|
293
305
|
* Creates an instance of Cell.
|
|
@@ -328,6 +340,9 @@ class Cell {
|
|
|
328
340
|
}
|
|
329
341
|
}
|
|
330
342
|
exports.Cell = Cell;
|
|
343
|
+
/**
|
|
344
|
+
* @public
|
|
345
|
+
*/
|
|
331
346
|
class CellInput {
|
|
332
347
|
/**
|
|
333
348
|
* Creates an instance of CellInput.
|
|
@@ -440,6 +455,9 @@ class CellInput {
|
|
|
440
455
|
}
|
|
441
456
|
}
|
|
442
457
|
exports.CellInput = CellInput;
|
|
458
|
+
/**
|
|
459
|
+
* @public
|
|
460
|
+
*/
|
|
443
461
|
class CellDep {
|
|
444
462
|
/**
|
|
445
463
|
* Creates an instance of CellDep.
|
|
@@ -540,6 +558,9 @@ class CellDep {
|
|
|
540
558
|
}
|
|
541
559
|
}
|
|
542
560
|
exports.CellDep = CellDep;
|
|
561
|
+
/**
|
|
562
|
+
* @public
|
|
563
|
+
*/
|
|
543
564
|
class WitnessArgs {
|
|
544
565
|
/**
|
|
545
566
|
* Creates an instance of WitnessArgs.
|
|
@@ -618,6 +639,9 @@ class WitnessArgs {
|
|
|
618
639
|
}
|
|
619
640
|
}
|
|
620
641
|
exports.WitnessArgs = WitnessArgs;
|
|
642
|
+
/**
|
|
643
|
+
* @public
|
|
644
|
+
*/
|
|
621
645
|
function udtBalanceFrom(dataLike) {
|
|
622
646
|
const data = (0, index_js_1.bytesFrom)(dataLike).slice(0, 16);
|
|
623
647
|
if (data.length !== 16) {
|
|
@@ -626,6 +650,9 @@ function udtBalanceFrom(dataLike) {
|
|
|
626
650
|
return (0, index_js_5.numFromBytes)(data);
|
|
627
651
|
}
|
|
628
652
|
exports.udtBalanceFrom = udtBalanceFrom;
|
|
653
|
+
/**
|
|
654
|
+
* @public
|
|
655
|
+
*/
|
|
629
656
|
class Transaction {
|
|
630
657
|
/**
|
|
631
658
|
* Creates an instance of Transaction.
|
|
@@ -905,8 +932,8 @@ class Transaction {
|
|
|
905
932
|
* const index = await tx.findInputIndexByLockId(scriptIdLike, client);
|
|
906
933
|
* ```
|
|
907
934
|
*/
|
|
908
|
-
async findInputIndexByLockId(
|
|
909
|
-
const script = script_js_1.Script.from({ ...
|
|
935
|
+
async findInputIndexByLockId(scriptIdLike, client) {
|
|
936
|
+
const script = script_js_1.Script.from({ ...scriptIdLike, args: "0x" });
|
|
910
937
|
for (let i = 0; i < this.inputs.length; i += 1) {
|
|
911
938
|
const input = this.inputs[i];
|
|
912
939
|
await input.completeExtraInfos(client);
|
|
@@ -979,8 +1006,8 @@ class Transaction {
|
|
|
979
1006
|
* tx.addCellDeps(cellDep);
|
|
980
1007
|
* ```
|
|
981
1008
|
*/
|
|
982
|
-
addCellDeps(...
|
|
983
|
-
|
|
1009
|
+
addCellDeps(...cellDepLikes) {
|
|
1010
|
+
cellDepLikes.flat().forEach((cellDepLike) => {
|
|
984
1011
|
const cellDep = CellDep.from(cellDepLike);
|
|
985
1012
|
if (this.cellDeps.some((c) => c.eq(cellDep))) {
|
|
986
1013
|
return;
|
|
@@ -998,8 +1025,8 @@ class Transaction {
|
|
|
998
1025
|
* tx.addCellDepsAtBegin(cellDep);
|
|
999
1026
|
* ```
|
|
1000
1027
|
*/
|
|
1001
|
-
addCellDepsAtStart(...
|
|
1002
|
-
|
|
1028
|
+
addCellDepsAtStart(...cellDepLikes) {
|
|
1029
|
+
cellDepLikes.flat().forEach((cellDepLike) => {
|
|
1003
1030
|
const cellDep = CellDep.from(cellDepLike);
|
|
1004
1031
|
if (this.cellDeps.some((c) => c.eq(cellDep))) {
|
|
1005
1032
|
return;
|
|
@@ -1011,15 +1038,15 @@ class Transaction {
|
|
|
1011
1038
|
* Add cell dep from infos if they are not existed
|
|
1012
1039
|
*
|
|
1013
1040
|
* @param client - A client for searching cell deps
|
|
1014
|
-
* @param
|
|
1041
|
+
* @param cellDepInfoLikes - The cell dep infos to add
|
|
1015
1042
|
*
|
|
1016
1043
|
* @example
|
|
1017
1044
|
* ```typescript
|
|
1018
1045
|
* tx.addCellDepInfos(client, cellDepInfos);
|
|
1019
1046
|
* ```
|
|
1020
1047
|
*/
|
|
1021
|
-
async addCellDepInfos(client, ...
|
|
1022
|
-
this.addCellDeps(await client.getCellDeps(...
|
|
1048
|
+
async addCellDepInfos(client, ...cellDepInfoLikes) {
|
|
1049
|
+
this.addCellDeps(await client.getCellDeps(...cellDepInfoLikes));
|
|
1023
1050
|
}
|
|
1024
1051
|
/**
|
|
1025
1052
|
* Add cell deps from known script
|
|
@@ -1045,20 +1072,20 @@ class Transaction {
|
|
|
1045
1072
|
*
|
|
1046
1073
|
* @example
|
|
1047
1074
|
* ```typescript
|
|
1048
|
-
* await tx.
|
|
1075
|
+
* await tx.setOutputDataAt(0, "0x00");
|
|
1049
1076
|
* ```
|
|
1050
1077
|
*/
|
|
1051
|
-
setOutputDataAt(index,
|
|
1078
|
+
setOutputDataAt(index, witness) {
|
|
1052
1079
|
if (this.outputsData.length < index) {
|
|
1053
1080
|
this.outputsData.push(...Array.from(new Array(index - this.outputsData.length), () => "0x"));
|
|
1054
1081
|
}
|
|
1055
|
-
this.outputsData[index] = (0, index_js_4.hexFrom)(
|
|
1082
|
+
this.outputsData[index] = (0, index_js_4.hexFrom)(witness);
|
|
1056
1083
|
}
|
|
1057
1084
|
/**
|
|
1058
1085
|
* Add output
|
|
1059
1086
|
*
|
|
1060
|
-
* @param
|
|
1061
|
-
* @param
|
|
1087
|
+
* @param outputLike - The cell output to add
|
|
1088
|
+
* @param outputData - optional output data
|
|
1062
1089
|
*
|
|
1063
1090
|
* @example
|
|
1064
1091
|
* ```typescript
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CellDepLike, CellOutputLike, HexLike, OutPointLike } from "../barrel";
|
|
2
|
+
export interface LumosTransactionSkeletonType {
|
|
3
|
+
cellDeps: {
|
|
4
|
+
toArray(): CellDepLike[];
|
|
5
|
+
};
|
|
6
|
+
headerDeps: {
|
|
7
|
+
toArray(): HexLike[];
|
|
8
|
+
};
|
|
9
|
+
inputs: {
|
|
10
|
+
toArray(): {
|
|
11
|
+
outPoint?: OutPointLike;
|
|
12
|
+
cellOutput: CellOutputLike;
|
|
13
|
+
data: HexLike;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
inputSinces: {
|
|
17
|
+
get(i: number, defaultVal: string): HexLike;
|
|
18
|
+
};
|
|
19
|
+
outputs: {
|
|
20
|
+
toArray(): {
|
|
21
|
+
cellOutput: CellOutputLike;
|
|
22
|
+
data: HexLike;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
witnesses: {
|
|
26
|
+
toArray(): HexLike[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=transactionLumos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactionLumos.d.ts","sourceRoot":"","sources":["../../src/ckb/transactionLumos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE/E,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE;QACR,OAAO,IAAI,WAAW,EAAE,CAAC;KAC1B,CAAC;IACF,UAAU,EAAE;QACV,OAAO,IAAI,OAAO,EAAE,CAAC;KACtB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,IAAI;YACT,QAAQ,CAAC,EAAE,YAAY,CAAC;YACxB,UAAU,EAAE,cAAc,CAAC;YAC3B,IAAI,EAAE,OAAO,CAAC;SACf,EAAE,CAAC;KACL,CAAC;IACF,WAAW,EAAE;QACX,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;KAC7C,CAAC;IACF,OAAO,EAAE;QACP,OAAO,IAAI;YAAE,UAAU,EAAE,cAAc,CAAC;YAAC,IAAI,EAAE,OAAO,CAAA;SAAE,EAAE,CAAC;KAC5D,CAAC;IACF,SAAS,EAAE;QACT,OAAO,IAAI,OAAO,EAAE,CAAC;KACtB,CAAC;CACH"}
|