@ckb-ccc/core 0.0.10-alpha.4 → 0.0.10-alpha.5

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.
Files changed (123) hide show
  1. package/dist/ckb/transaction.d.ts.map +1 -1
  2. package/dist/ckb/transaction.js +1 -2
  3. package/dist.commonjs/address/address.advanced.d.ts +24 -29
  4. package/dist.commonjs/address/address.advanced.js +89 -115
  5. package/dist.commonjs/address/advanced.d.ts +1 -1
  6. package/dist.commonjs/address/advanced.js +14 -30
  7. package/dist.commonjs/address/index.d.ts +44 -51
  8. package/dist.commonjs/address/index.js +65 -84
  9. package/dist.commonjs/advanced.d.ts +1 -1
  10. package/dist.commonjs/advanced.js +22 -47
  11. package/dist.commonjs/advancedBarrel.d.ts +1 -1
  12. package/dist.commonjs/advancedBarrel.js +14 -30
  13. package/dist.commonjs/barrel.d.ts +1 -1
  14. package/dist.commonjs/barrel.js +14 -30
  15. package/dist.commonjs/bytes/advanced.d.ts +2 -11
  16. package/dist.commonjs/bytes/index.d.ts +3 -9
  17. package/dist.commonjs/bytes/index.js +26 -28
  18. package/dist.commonjs/ckb/advanced.d.ts +1 -1
  19. package/dist.commonjs/ckb/advanced.js +22 -47
  20. package/dist.commonjs/ckb/index.d.ts +1 -1
  21. package/dist.commonjs/ckb/index.js +14 -30
  22. package/dist.commonjs/ckb/molecule.advanced/generated.d.ts +260 -420
  23. package/dist.commonjs/ckb/molecule.advanced/generated.js +1332 -1536
  24. package/dist.commonjs/ckb/molecule.advanced/index.d.ts +3 -3
  25. package/dist.commonjs/ckb/molecule.advanced/index.js +18 -34
  26. package/dist.commonjs/ckb/script.advanced.d.ts +1 -1
  27. package/dist.commonjs/ckb/script.advanced.js +9 -12
  28. package/dist.commonjs/ckb/script.d.ts +117 -121
  29. package/dist.commonjs/ckb/script.js +176 -220
  30. package/dist.commonjs/ckb/transaction.advanced.d.ts +1 -1
  31. package/dist.commonjs/ckb/transaction.advanced.js +4 -4
  32. package/dist.commonjs/ckb/transaction.d.ts +722 -806
  33. package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
  34. package/dist.commonjs/ckb/transaction.js +1190 -1424
  35. package/dist.commonjs/client/advanced.d.ts +1 -1
  36. package/dist.commonjs/client/advanced.js +14 -30
  37. package/dist.commonjs/client/client.advanced.d.ts +6 -23
  38. package/dist.commonjs/client/client.advanced.js +61 -89
  39. package/dist.commonjs/client/client.d.ts +54 -114
  40. package/dist.commonjs/client/client.js +182 -215
  41. package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts +4 -8
  42. package/dist.commonjs/client/clientPublicMainnet.advanced.js +189 -215
  43. package/dist.commonjs/client/clientPublicMainnet.d.ts +6 -8
  44. package/dist.commonjs/client/clientPublicMainnet.js +15 -17
  45. package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts +3 -6
  46. package/dist.commonjs/client/clientPublicTestnet.advanced.js +199 -227
  47. package/dist.commonjs/client/clientPublicTestnet.d.ts +6 -8
  48. package/dist.commonjs/client/clientPublicTestnet.js +13 -13
  49. package/dist.commonjs/client/clientTypes.advanced.d.ts +14 -14
  50. package/dist.commonjs/client/clientTypes.advanced.js +1 -1
  51. package/dist.commonjs/client/clientTypes.d.ts +26 -51
  52. package/dist.commonjs/client/clientTypes.js +22 -56
  53. package/dist.commonjs/client/index.d.ts +1 -1
  54. package/dist.commonjs/client/index.js +14 -30
  55. package/dist.commonjs/client/jsonRpc/advanced.d.ts +1 -1
  56. package/dist.commonjs/client/jsonRpc/advanced.js +14 -30
  57. package/dist.commonjs/client/jsonRpc/index.d.ts +75 -94
  58. package/dist.commonjs/client/jsonRpc/index.js +108 -135
  59. package/dist.commonjs/client/jsonRpc/transformers.d.ts +36 -76
  60. package/dist.commonjs/client/jsonRpc/transformers.js +152 -174
  61. package/dist.commonjs/client/jsonRpc/types.d.ts +38 -38
  62. package/dist.commonjs/fixedPoint/index.d.ts +3 -9
  63. package/dist.commonjs/fixedPoint/index.js +20 -26
  64. package/dist.commonjs/fixedPoint/index.test.d.ts +1 -1
  65. package/dist.commonjs/fixedPoint/index.test.js +36 -42
  66. package/dist.commonjs/hasher/advanced.d.ts +1 -1
  67. package/dist.commonjs/hasher/index.d.ts +37 -40
  68. package/dist.commonjs/hasher/index.js +48 -58
  69. package/dist.commonjs/hex/index.d.ts +1 -1
  70. package/dist.commonjs/hex/index.js +1 -1
  71. package/dist.commonjs/index.d.ts +1 -1
  72. package/dist.commonjs/index.js +22 -47
  73. package/dist.commonjs/num/index.d.ts +1 -1
  74. package/dist.commonjs/num/index.js +27 -39
  75. package/dist.commonjs/signer/btc/index.d.ts +1 -1
  76. package/dist.commonjs/signer/btc/index.js +14 -30
  77. package/dist.commonjs/signer/btc/signerBtc.d.ts +47 -47
  78. package/dist.commonjs/signer/btc/signerBtc.js +66 -89
  79. package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +45 -45
  80. package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +52 -52
  81. package/dist.commonjs/signer/btc/verify.d.ts +2 -6
  82. package/dist.commonjs/signer/btc/verify.js +3 -10
  83. package/dist.commonjs/signer/ckb/index.d.ts +1 -1
  84. package/dist.commonjs/signer/ckb/index.js +14 -30
  85. package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts +5 -5
  86. package/dist.commonjs/signer/ckb/signerCkbPrivateKey.js +27 -41
  87. package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts +11 -11
  88. package/dist.commonjs/signer/ckb/signerCkbPublicKey.js +35 -45
  89. package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +45 -45
  90. package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +56 -56
  91. package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts +3 -9
  92. package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.js +5 -13
  93. package/dist.commonjs/signer/ckb/verifyJoyId.d.ts +2 -6
  94. package/dist.commonjs/signer/ckb/verifyJoyId.js +8 -11
  95. package/dist.commonjs/signer/dummy/alwaysError.d.ts +4 -4
  96. package/dist.commonjs/signer/dummy/alwaysError.js +7 -7
  97. package/dist.commonjs/signer/dummy/dummy.d.ts +7 -7
  98. package/dist.commonjs/signer/dummy/dummy.js +16 -16
  99. package/dist.commonjs/signer/dummy/index.d.ts +1 -1
  100. package/dist.commonjs/signer/dummy/index.js +14 -30
  101. package/dist.commonjs/signer/dummy/openLink.d.ts +4 -4
  102. package/dist.commonjs/signer/dummy/openLink.js +7 -7
  103. package/dist.commonjs/signer/evm/index.d.ts +1 -1
  104. package/dist.commonjs/signer/evm/index.js +14 -30
  105. package/dist.commonjs/signer/evm/signerEvm.d.ts +38 -42
  106. package/dist.commonjs/signer/evm/signerEvm.js +70 -105
  107. package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +37 -37
  108. package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +42 -42
  109. package/dist.commonjs/signer/evm/verify.d.ts +2 -6
  110. package/dist.commonjs/signer/evm/verify.js +2 -7
  111. package/dist.commonjs/signer/index.d.ts +1 -1
  112. package/dist.commonjs/signer/index.js +14 -30
  113. package/dist.commonjs/signer/nostr/index.d.ts +1 -1
  114. package/dist.commonjs/signer/nostr/index.js +14 -30
  115. package/dist.commonjs/signer/nostr/signerNostr.d.ts +57 -57
  116. package/dist.commonjs/signer/nostr/signerNostr.js +71 -100
  117. package/dist.commonjs/signer/nostr/verify.d.ts +3 -9
  118. package/dist.commonjs/signer/nostr/verify.js +39 -50
  119. package/dist.commonjs/signer/signer/index.d.ts +162 -171
  120. package/dist.commonjs/signer/signer/index.js +198 -234
  121. package/dist.commonjs/utils/index.d.ts +9 -42
  122. package/dist.commonjs/utils/index.js +12 -18
  123. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  export * from "./generated";
2
2
  export declare function molOptional<T>(mol: {
3
- hasValue: () => boolean;
4
- value: () => T;
3
+ hasValue: () => boolean;
4
+ value: () => T;
5
5
  }): T | undefined;
6
- //# sourceMappingURL=index.d.ts.map
6
+ //# sourceMappingURL=index.d.ts.map
@@ -1,41 +1,25 @@
1
1
  "use strict";
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (
9
- !desc ||
10
- ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
- ) {
12
- desc = {
13
- enumerable: true,
14
- get: function () {
15
- return m[k];
16
- },
17
- };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }
21
- : function (o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- });
25
- var __exportStar =
26
- (this && this.__exportStar) ||
27
- function (m, exports) {
28
- for (var p in m)
29
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
30
- __createBinding(exports, m, p);
31
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
32
16
  Object.defineProperty(exports, "__esModule", { value: true });
33
17
  exports.molOptional = void 0;
34
18
  __exportStar(require("./generated"), exports);
35
19
  function molOptional(mol) {
36
- if (mol.hasValue()) {
37
- return mol.value();
38
- }
39
- return;
20
+ if (mol.hasValue()) {
21
+ return mol.value();
22
+ }
23
+ return;
40
24
  }
41
25
  exports.molOptional = molOptional;
@@ -2,4 +2,4 @@ import { type HashType } from "./script";
2
2
  export declare const HASH_TYPE_TO_NUM: Record<HashType, number>;
3
3
  export declare const NUM_TO_HASH_TYPE: Record<number, HashType>;
4
4
  export declare const HASH_TYPES: string[];
5
- //# sourceMappingURL=script.advanced.d.ts.map
5
+ //# sourceMappingURL=script.advanced.d.ts.map
@@ -1,19 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HASH_TYPES =
4
- exports.NUM_TO_HASH_TYPE =
5
- exports.HASH_TYPE_TO_NUM =
6
- void 0;
3
+ exports.HASH_TYPES = exports.NUM_TO_HASH_TYPE = exports.HASH_TYPE_TO_NUM = void 0;
7
4
  exports.HASH_TYPE_TO_NUM = {
8
- type: 0x01,
9
- data: 0x00,
10
- data1: 0x02,
11
- data2: 0x04,
5
+ type: 0x01,
6
+ data: 0x00,
7
+ data1: 0x02,
8
+ data2: 0x04,
12
9
  };
13
10
  exports.NUM_TO_HASH_TYPE = {
14
- 0x01: "type",
15
- 0x00: "data",
16
- 0x02: "data1",
17
- 0x04: "data2",
11
+ 0x01: "type",
12
+ 0x00: "data",
13
+ 0x02: "data1",
14
+ 0x04: "data2",
18
15
  };
19
16
  exports.HASH_TYPES = Object.keys(exports.HASH_TYPE_TO_NUM);
@@ -46,127 +46,123 @@ export declare function hashTypeToBytes(hashType: HashTypeLike): Bytes;
46
46
  */
47
47
  export declare function hashTypeFromBytes(bytes: BytesLike): HashType;
48
48
  export type ScriptLike = {
49
- codeHash: BytesLike;
50
- hashType: HashTypeLike;
51
- args: BytesLike;
49
+ codeHash: BytesLike;
50
+ hashType: HashTypeLike;
51
+ args: BytesLike;
52
52
  };
53
53
  export declare class Script {
54
- codeHash: Hex;
55
- hashType: HashType;
56
- args: Hex;
57
- /**
58
- * Creates an instance of Script.
59
- *
60
- * @param codeHash - The code hash of the script.
61
- * @param hashType - The hash type of the script.
62
- * @param args - The arguments for the script.
63
- */
64
- constructor(codeHash: Hex, hashType: HashType, args: Hex);
65
- get occupiedSize(): number;
66
- /**
67
- * Clone a script.
68
- *
69
- * @returns A cloned Script instance.
70
- *
71
- * @example
72
- * ```typescript
73
- * const script1 = script0.clone();
74
- * ```
75
- */
76
- clone(): Script;
77
- /**
78
- * Creates a Script instance from a ScriptLike object.
79
- *
80
- * @param script - A ScriptLike object or an instance of Script.
81
- * @returns A Script instance.
82
- *
83
- * @example
84
- * ```typescript
85
- * const script = Script.from({
86
- * codeHash: "0x1234...",
87
- * hashType: "type",
88
- * args: "0xabcd..."
89
- * });
90
- * ```
91
- */
92
- static from(script: ScriptLike): Script;
93
- /**
94
- * Creates a Script instance from client and known script.
95
- *
96
- * @param knownScript - A KnownScript enum.
97
- * @param args - Args for the script.
98
- * @param client - A ScriptLike object or an instance of Script.
99
- * @returns A promise that resolves to the script instance.
100
- *
101
- * @example
102
- * ```typescript
103
- * const script = await Script.fromKnownScript(
104
- * client,
105
- * KnownScript.XUdt,
106
- * args: "0xabcd..."
107
- * );
108
- * ```
109
- */
110
- static fromKnownScript(
111
- client: Client,
112
- knownScript: KnownScript,
113
- args: HexLike,
114
- ): Promise<Script>;
115
- /**
116
- * Converts the Script instance to molecule data format.
117
- *
118
- * @returns An object representing the script in molecule data format.
119
- */
120
- _toMolData(): {
121
- codeHash: Uint8Array;
122
- hashType: Uint8Array;
123
- args: Uint8Array;
124
- };
125
- /**
126
- * Converts the Script instance to bytes.
127
- *
128
- * @returns A Uint8Array containing the script bytes.
129
- *
130
- * @example
131
- * ```typescript
132
- * const scriptBytes = script.toBytes();
133
- * ```
134
- */
135
- toBytes(): Bytes;
136
- /**
137
- * Get hash of a script
138
- *
139
- * @returns Hash of this script
140
- *
141
- * @example
142
- * ```typescript
143
- * const hash = script.hash();
144
- * ```
145
- */
146
- hash(): Hex;
147
- /**
148
- * Creates a Script instance from a byte-like value or molecule Script.
149
- *
150
- * @param bytes - The byte-like value or molecule Script to convert.
151
- * @returns A Script instance.
152
- *
153
- * @example
154
- * ```typescript
155
- * const script = Script.fromBytes(new Uint8Array([/* script bytes *\/]));
156
- * ```
157
- */
158
- static fromBytes(bytes: BytesLike | mol.Script): Script;
159
- /**
160
- * Compares the current Script instance with another ScriptLike object for equality.
161
- *
162
- * @param val - The ScriptLike object to compare with.
163
- * @returns True if the scripts are equal, otherwise false.
164
- *
165
- * @example
166
- * ```typescript
167
- * const isEqual = script.eq(anotherScript);
168
- * ```
169
- */
170
- eq(val: ScriptLike): boolean;
54
+ codeHash: Hex;
55
+ hashType: HashType;
56
+ args: Hex;
57
+ /**
58
+ * Creates an instance of Script.
59
+ *
60
+ * @param codeHash - The code hash of the script.
61
+ * @param hashType - The hash type of the script.
62
+ * @param args - The arguments for the script.
63
+ */
64
+ constructor(codeHash: Hex, hashType: HashType, args: Hex);
65
+ get occupiedSize(): number;
66
+ /**
67
+ * Clone a script.
68
+ *
69
+ * @returns A cloned Script instance.
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * const script1 = script0.clone();
74
+ * ```
75
+ */
76
+ clone(): Script;
77
+ /**
78
+ * Creates a Script instance from a ScriptLike object.
79
+ *
80
+ * @param script - A ScriptLike object or an instance of Script.
81
+ * @returns A Script instance.
82
+ *
83
+ * @example
84
+ * ```typescript
85
+ * const script = Script.from({
86
+ * codeHash: "0x1234...",
87
+ * hashType: "type",
88
+ * args: "0xabcd..."
89
+ * });
90
+ * ```
91
+ */
92
+ static from(script: ScriptLike): Script;
93
+ /**
94
+ * Creates a Script instance from client and known script.
95
+ *
96
+ * @param knownScript - A KnownScript enum.
97
+ * @param args - Args for the script.
98
+ * @param client - A ScriptLike object or an instance of Script.
99
+ * @returns A promise that resolves to the script instance.
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * const script = await Script.fromKnownScript(
104
+ * client,
105
+ * KnownScript.XUdt,
106
+ * args: "0xabcd..."
107
+ * );
108
+ * ```
109
+ */
110
+ static fromKnownScript(client: Client, knownScript: KnownScript, args: HexLike): Promise<Script>;
111
+ /**
112
+ * Converts the Script instance to molecule data format.
113
+ *
114
+ * @returns An object representing the script in molecule data format.
115
+ */
116
+ _toMolData(): {
117
+ codeHash: Uint8Array;
118
+ hashType: Uint8Array;
119
+ args: Uint8Array;
120
+ };
121
+ /**
122
+ * Converts the Script instance to bytes.
123
+ *
124
+ * @returns A Uint8Array containing the script bytes.
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * const scriptBytes = script.toBytes();
129
+ * ```
130
+ */
131
+ toBytes(): Bytes;
132
+ /**
133
+ * Get hash of a script
134
+ *
135
+ * @returns Hash of this script
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * const hash = script.hash();
140
+ * ```
141
+ */
142
+ hash(): Hex;
143
+ /**
144
+ * Creates a Script instance from a byte-like value or molecule Script.
145
+ *
146
+ * @param bytes - The byte-like value or molecule Script to convert.
147
+ * @returns A Script instance.
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * const script = Script.fromBytes(new Uint8Array([/* script bytes *\/]));
152
+ * ```
153
+ */
154
+ static fromBytes(bytes: BytesLike | mol.Script): Script;
155
+ /**
156
+ * Compares the current Script instance with another ScriptLike object for equality.
157
+ *
158
+ * @param val - The ScriptLike object to compare with.
159
+ * @returns True if the scripts are equal, otherwise false.
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * const isEqual = script.eq(anotherScript);
164
+ * ```
165
+ */
166
+ eq(val: ScriptLike): boolean;
171
167
  }
172
- //# sourceMappingURL=script.d.ts.map
168
+ //# sourceMappingURL=script.d.ts.map