@ckb-ccc/core 0.0.5-alpha.10 → 0.0.5-alpha.11
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/dist/ckb/transaction.d.ts +2 -4
- package/dist/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +12 -12
- package/dist/client/client.js +1 -1
- package/dist.commonjs/address/address.advanced.d.ts +24 -29
- package/dist.commonjs/address/address.advanced.js +92 -114
- package/dist.commonjs/address/advanced.d.ts +1 -1
- package/dist.commonjs/address/advanced.js +14 -30
- package/dist.commonjs/address/index.d.ts +44 -51
- package/dist.commonjs/address/index.js +68 -87
- package/dist.commonjs/advanced.d.ts +1 -1
- package/dist.commonjs/advanced.js +22 -47
- package/dist.commonjs/advancedBarrel.d.ts +1 -1
- package/dist.commonjs/advancedBarrel.js +14 -30
- package/dist.commonjs/barrel.d.ts +1 -1
- package/dist.commonjs/barrel.js +14 -30
- package/dist.commonjs/bytes/advanced.d.ts +2 -11
- package/dist.commonjs/bytes/index.d.ts +3 -9
- package/dist.commonjs/bytes/index.js +26 -28
- package/dist.commonjs/ckb/advanced.d.ts +1 -1
- package/dist.commonjs/ckb/advanced.js +22 -47
- package/dist.commonjs/ckb/index.d.ts +1 -1
- package/dist.commonjs/ckb/index.js +14 -30
- package/dist.commonjs/ckb/molecule.advanced/generated.d.ts +260 -420
- package/dist.commonjs/ckb/molecule.advanced/generated.js +1332 -1536
- package/dist.commonjs/ckb/molecule.advanced/index.d.ts +3 -3
- package/dist.commonjs/ckb/molecule.advanced/index.js +18 -34
- package/dist.commonjs/ckb/script.advanced.d.ts +1 -1
- package/dist.commonjs/ckb/script.advanced.js +9 -12
- package/dist.commonjs/ckb/script.d.ts +76 -76
- package/dist.commonjs/ckb/script.js +126 -166
- package/dist.commonjs/ckb/transaction.advanced.d.ts +1 -1
- package/dist.commonjs/ckb/transaction.advanced.js +4 -4
- package/dist.commonjs/ckb/transaction.d.ts +530 -570
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +722 -839
- package/dist.commonjs/client/advanced.d.ts +1 -1
- package/dist.commonjs/client/advanced.js +14 -30
- package/dist.commonjs/client/client.d.ts +21 -52
- package/dist.commonjs/client/client.js +57 -66
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts +2 -5
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +24 -30
- package/dist.commonjs/client/clientPublicMainnet.d.ts +4 -6
- package/dist.commonjs/client/clientPublicMainnet.js +9 -9
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts +2 -5
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +24 -30
- package/dist.commonjs/client/clientPublicTestnet.d.ts +4 -6
- package/dist.commonjs/client/clientPublicTestnet.js +9 -9
- package/dist.commonjs/client/clientTypes.d.ts +36 -51
- package/dist.commonjs/client/clientTypes.js +19 -34
- package/dist.commonjs/client/index.d.ts +1 -1
- package/dist.commonjs/client/index.js +14 -30
- package/dist.commonjs/client/jsonRpc/advanced.d.ts +1 -1
- package/dist.commonjs/client/jsonRpc/advanced.js +14 -30
- package/dist.commonjs/client/jsonRpc/index.d.ts +75 -92
- package/dist.commonjs/client/jsonRpc/index.js +108 -135
- package/dist.commonjs/client/jsonRpc/transformers.d.ts +38 -78
- package/dist.commonjs/client/jsonRpc/transformers.js +150 -175
- package/dist.commonjs/client/jsonRpc/types.d.ts +38 -38
- package/dist.commonjs/fixedPoint/index.d.ts +3 -9
- package/dist.commonjs/fixedPoint/index.js +20 -26
- package/dist.commonjs/fixedPoint/index.test.d.ts +1 -1
- package/dist.commonjs/fixedPoint/index.test.js +36 -42
- package/dist.commonjs/hasher/advanced.d.ts +1 -1
- package/dist.commonjs/hasher/index.d.ts +36 -36
- package/dist.commonjs/hasher/index.js +45 -52
- package/dist.commonjs/hex/index.d.ts +1 -1
- package/dist.commonjs/hex/index.js +1 -1
- package/dist.commonjs/index.d.ts +1 -1
- package/dist.commonjs/index.js +22 -47
- package/dist.commonjs/num/index.d.ts +1 -1
- package/dist.commonjs/num/index.js +19 -30
- package/dist.commonjs/signer/btc/index.d.ts +1 -1
- package/dist.commonjs/signer/btc/index.js +14 -30
- package/dist.commonjs/signer/btc/signerBtc.d.ts +47 -47
- package/dist.commonjs/signer/btc/signerBtc.js +65 -85
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +45 -45
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +52 -52
- package/dist.commonjs/signer/btc/verify.d.ts +2 -6
- package/dist.commonjs/signer/btc/verify.js +2 -5
- package/dist.commonjs/signer/ckb/index.d.ts +1 -1
- package/dist.commonjs/signer/ckb/index.js +14 -30
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +45 -45
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +56 -56
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts +2 -6
- package/dist.commonjs/signer/ckb/verifyJoyId.js +8 -11
- package/dist.commonjs/signer/dummy/alwaysError.d.ts +4 -4
- package/dist.commonjs/signer/dummy/alwaysError.js +7 -7
- package/dist.commonjs/signer/dummy/dummy.d.ts +7 -7
- package/dist.commonjs/signer/dummy/dummy.js +16 -16
- package/dist.commonjs/signer/dummy/index.d.ts +1 -1
- package/dist.commonjs/signer/dummy/index.js +14 -30
- package/dist.commonjs/signer/dummy/openLink.d.ts +4 -4
- package/dist.commonjs/signer/dummy/openLink.js +7 -7
- package/dist.commonjs/signer/evm/index.d.ts +1 -1
- package/dist.commonjs/signer/evm/index.js +14 -30
- package/dist.commonjs/signer/evm/signerEvm.d.ts +38 -42
- package/dist.commonjs/signer/evm/signerEvm.js +68 -100
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +37 -37
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +42 -42
- package/dist.commonjs/signer/evm/verify.d.ts +2 -6
- package/dist.commonjs/signer/evm/verify.js +2 -7
- package/dist.commonjs/signer/index.d.ts +1 -1
- package/dist.commonjs/signer/index.js +14 -30
- package/dist.commonjs/signer/signer/index.d.ts +153 -159
- package/dist.commonjs/signer/signer/index.js +181 -204
- package/dist.commonjs/utils/index.d.ts +8 -36
- package/dist.commonjs/utils/index.js +12 -18
- package/package.json +2 -2
- package/src/ckb/transaction.ts +14 -13
|
@@ -50,605 +50,565 @@ export declare function depTypeToBytes(depType: DepTypeLike): Bytes;
|
|
|
50
50
|
*/
|
|
51
51
|
export declare function depTypeFromBytes(bytes: BytesLike): DepType;
|
|
52
52
|
export type OutPointLike = {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
txHash: HexLike;
|
|
54
|
+
index: NumLike;
|
|
55
55
|
};
|
|
56
56
|
export declare class OutPoint {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
57
|
+
txHash: Hex;
|
|
58
|
+
index: Num;
|
|
59
|
+
/**
|
|
60
|
+
* Creates an instance of OutPoint.
|
|
61
|
+
*
|
|
62
|
+
* @param txHash - The transaction hash.
|
|
63
|
+
* @param index - The index of the output in the transaction.
|
|
64
|
+
*/
|
|
65
|
+
constructor(txHash: Hex, index: Num);
|
|
66
|
+
/**
|
|
67
|
+
* Creates an OutPoint instance from an OutPointLike object.
|
|
68
|
+
*
|
|
69
|
+
* @param outPoint - An OutPointLike object or an instance of OutPoint.
|
|
70
|
+
* @returns An OutPoint instance.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const outPoint = OutPoint.from({ txHash: "0x...", index: 0 });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
static from(outPoint: OutPointLike): OutPoint;
|
|
78
|
+
/**
|
|
79
|
+
* Converts the OutPoint instance to molecule data format.
|
|
80
|
+
*
|
|
81
|
+
* @returns An object representing the outpoint in molecule data format.
|
|
82
|
+
*/
|
|
83
|
+
_toMolData(): {
|
|
84
|
+
txHash: Uint8Array;
|
|
85
|
+
index: Uint8Array;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Converts the OutPoint instance to bytes.
|
|
89
|
+
*
|
|
90
|
+
* @returns A Uint8Array containing the outpoint bytes.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* const outPointBytes = outPoint.encode();
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
encode(): Bytes;
|
|
98
|
+
/**
|
|
99
|
+
* Creates an OutPoint instance from a byte-like value or molecule OutPoint.
|
|
100
|
+
*
|
|
101
|
+
* @param bytes - The byte-like value or molecule OutPoint to convert.
|
|
102
|
+
* @returns An OutPoint instance.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* const outPoint = OutPoint.fromBytes(new Uint8Array([/* outpoint bytes *\/]));
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
static fromBytes(bytes: BytesLike | mol.OutPoint): OutPoint;
|
|
110
110
|
}
|
|
111
111
|
export type CellOutputLike = {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
capacity: NumLike;
|
|
113
|
+
lock: ScriptLike;
|
|
114
|
+
type?: ScriptLike;
|
|
115
115
|
};
|
|
116
116
|
export declare class CellOutput {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
117
|
+
capacity: Num;
|
|
118
|
+
lock: Script;
|
|
119
|
+
type?: Script | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Creates an instance of CellOutput.
|
|
122
|
+
*
|
|
123
|
+
* @param capacity - The capacity of the cell.
|
|
124
|
+
* @param lock - The lock script of the cell.
|
|
125
|
+
* @param type - The optional type script of the cell.
|
|
126
|
+
*/
|
|
127
|
+
constructor(capacity: Num, lock: Script, type?: Script | undefined);
|
|
128
|
+
/**
|
|
129
|
+
* Creates a CellOutput instance from a CellOutputLike object.
|
|
130
|
+
*
|
|
131
|
+
* @param cellOutput - A CellOutputLike object or an instance of CellOutput.
|
|
132
|
+
* @returns A CellOutput instance.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* const cellOutput = CellOutput.from({
|
|
137
|
+
* capacity: 1000n,
|
|
138
|
+
* lock: { codeHash: "0x...", hashType: "type", args: "0x..." },
|
|
139
|
+
* type: { codeHash: "0x...", hashType: "type", args: "0x..." }
|
|
140
|
+
* });
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
static from(cellOutput: CellOutputLike): CellOutput;
|
|
144
|
+
/**
|
|
145
|
+
* Converts the CellOutput instance to molecule data format.
|
|
146
|
+
*
|
|
147
|
+
* @returns An object representing the cell output in molecule data format.
|
|
148
|
+
*/
|
|
149
|
+
_toMolData(): {
|
|
150
|
+
capacity: Uint8Array;
|
|
151
|
+
lock: {
|
|
152
|
+
codeHash: Uint8Array;
|
|
153
|
+
hashType: Uint8Array;
|
|
154
|
+
args: Uint8Array;
|
|
155
|
+
};
|
|
156
|
+
type: {
|
|
157
|
+
codeHash: Uint8Array;
|
|
158
|
+
hashType: Uint8Array;
|
|
159
|
+
args: Uint8Array;
|
|
160
|
+
} | undefined;
|
|
155
161
|
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
* @returns A CellOutput instance.
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* ```typescript
|
|
183
|
-
* const cellOutput = CellOutput.fromBytes(new Uint8Array([/* cell output bytes *\/]));
|
|
184
|
-
* ```
|
|
185
|
-
*/
|
|
186
|
-
static fromBytes(bytes: BytesLike | mol.CellOutput): CellOutput;
|
|
162
|
+
/**
|
|
163
|
+
* Converts the CellOutput instance to bytes.
|
|
164
|
+
*
|
|
165
|
+
* @returns A Uint8Array containing the cell output bytes.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* const cellOutputBytes = cellOutput.toBytes();
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
toBytes(): Bytes;
|
|
173
|
+
/**
|
|
174
|
+
* Creates a CellOutput instance from a byte-like value or molecule CellOutput.
|
|
175
|
+
*
|
|
176
|
+
* @param bytes - The byte-like value or molecule CellOutput to convert.
|
|
177
|
+
* @returns A CellOutput instance.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```typescript
|
|
181
|
+
* const cellOutput = CellOutput.fromBytes(new Uint8Array([/* cell output bytes *\/]));
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
static fromBytes(bytes: BytesLike | mol.CellOutput): CellOutput;
|
|
187
185
|
}
|
|
188
186
|
export type CellLike = {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
outPoint: OutPointLike;
|
|
188
|
+
cellOutput: CellOutputLike;
|
|
189
|
+
outputData: HexLike;
|
|
190
|
+
blockNumber: NumLike;
|
|
193
191
|
};
|
|
194
192
|
export declare class Cell {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*
|
|
216
|
-
* @param cell - A CellLike object or an instance of Cell.
|
|
217
|
-
* @returns A Cell instance.
|
|
218
|
-
*/
|
|
219
|
-
static from(cell: CellLike): Cell;
|
|
193
|
+
outPoint: OutPoint;
|
|
194
|
+
cellOutput: CellOutput;
|
|
195
|
+
outputData: Hex;
|
|
196
|
+
blockNumber: Num;
|
|
197
|
+
/**
|
|
198
|
+
* Creates an instance of Cell.
|
|
199
|
+
*
|
|
200
|
+
* @param outPoint - The output point of the cell.
|
|
201
|
+
* @param cellOutput - The cell output of the cell.
|
|
202
|
+
* @param outputData - The output data of the cell.
|
|
203
|
+
* @param blockNumber - The block number of the cell.
|
|
204
|
+
*/
|
|
205
|
+
constructor(outPoint: OutPoint, cellOutput: CellOutput, outputData: Hex, blockNumber: Num);
|
|
206
|
+
/**
|
|
207
|
+
* Creates a Cell instance from a CellLike object.
|
|
208
|
+
*
|
|
209
|
+
* @param cell - A CellLike object or an instance of Cell.
|
|
210
|
+
* @returns A Cell instance.
|
|
211
|
+
*/
|
|
212
|
+
static from(cell: CellLike): Cell;
|
|
220
213
|
}
|
|
221
214
|
export type CellInputLike = {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
215
|
+
previousOutput: OutPointLike;
|
|
216
|
+
since: NumLike;
|
|
217
|
+
cellOutput?: CellOutputLike;
|
|
218
|
+
outputData?: HexLike;
|
|
219
|
+
blockNumber?: NumLike;
|
|
227
220
|
};
|
|
228
221
|
export declare class CellInput {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
* @returns An object representing the cell input in molecule data format.
|
|
282
|
-
*/
|
|
283
|
-
_toMolData(): {
|
|
284
|
-
previousOutput: {
|
|
285
|
-
txHash: Uint8Array;
|
|
286
|
-
index: Uint8Array;
|
|
222
|
+
previousOutput: OutPoint;
|
|
223
|
+
since: Num;
|
|
224
|
+
cellOutput?: CellOutput | undefined;
|
|
225
|
+
outputData?: `0x${string}` | undefined;
|
|
226
|
+
blockNumber?: bigint | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* Creates an instance of CellInput.
|
|
229
|
+
*
|
|
230
|
+
* @param previousOutput - The previous outpoint of the cell.
|
|
231
|
+
* @param since - The since value of the cell input.
|
|
232
|
+
* @param cellOutput - The optional cell output associated with the cell input.
|
|
233
|
+
* @param outputData - The optional output data associated with the cell input.
|
|
234
|
+
* @param blockNumber - The optional block number associated with the cell input.
|
|
235
|
+
*/
|
|
236
|
+
constructor(previousOutput: OutPoint, since: Num, cellOutput?: CellOutput | undefined, outputData?: `0x${string}` | undefined, blockNumber?: bigint | undefined);
|
|
237
|
+
/**
|
|
238
|
+
* Creates a CellInput instance from a CellInputLike object.
|
|
239
|
+
*
|
|
240
|
+
* @param cellInput - A CellInputLike object or an instance of CellInput.
|
|
241
|
+
* @returns A CellInput instance.
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const cellInput = CellInput.from({
|
|
246
|
+
* previousOutput: { txHash: "0x...", index: 0 },
|
|
247
|
+
* since: 0n
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
static from(cellInput: CellInputLike): CellInput;
|
|
252
|
+
/**
|
|
253
|
+
* Complete extra infos in the input. Like the output of the out point.
|
|
254
|
+
* The instance will be modified.
|
|
255
|
+
*
|
|
256
|
+
* @returns The completed instance.
|
|
257
|
+
* @example
|
|
258
|
+
* ```typescript
|
|
259
|
+
* await cellInput.completeExtraInfos();
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
completeExtraInfos(client: Client): Promise<void>;
|
|
263
|
+
/**
|
|
264
|
+
* Converts the CellInput instance to molecule data format.
|
|
265
|
+
*
|
|
266
|
+
* @returns An object representing the cell input in molecule data format.
|
|
267
|
+
*/
|
|
268
|
+
_toMolData(): {
|
|
269
|
+
previousOutput: {
|
|
270
|
+
txHash: Uint8Array;
|
|
271
|
+
index: Uint8Array;
|
|
272
|
+
};
|
|
273
|
+
since: Uint8Array;
|
|
287
274
|
};
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
*/
|
|
312
|
-
static fromBytes(bytes: BytesLike | mol.CellInput): CellInput;
|
|
275
|
+
/**
|
|
276
|
+
* Converts the CellInput instance to bytes.
|
|
277
|
+
*
|
|
278
|
+
* @returns A Uint8Array containing the cell input bytes.
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* const cellInputBytes = cellInput.toBytes();
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
toBytes(): Bytes;
|
|
286
|
+
/**
|
|
287
|
+
* Creates a CellInput instance from a byte-like value or molecule CellInput.
|
|
288
|
+
*
|
|
289
|
+
* @param bytes - The byte-like value or molecule CellInput to convert.
|
|
290
|
+
* @returns A CellInput instance.
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```typescript
|
|
294
|
+
* const cellInput = CellInput.fromBytes(new Uint8Array([/* cell input bytes *\/]));
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
static fromBytes(bytes: BytesLike | mol.CellInput): CellInput;
|
|
313
298
|
}
|
|
314
299
|
export type CellDepLike = {
|
|
315
|
-
|
|
316
|
-
|
|
300
|
+
outPoint: OutPointLike;
|
|
301
|
+
depType: DepTypeLike;
|
|
317
302
|
};
|
|
318
303
|
export declare class CellDep {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
304
|
+
outPoint: OutPoint;
|
|
305
|
+
depType: DepType;
|
|
306
|
+
/**
|
|
307
|
+
* Creates an instance of CellDep.
|
|
308
|
+
*
|
|
309
|
+
* @param outPoint - The outpoint of the cell dependency.
|
|
310
|
+
* @param depType - The dependency type.
|
|
311
|
+
*/
|
|
312
|
+
constructor(outPoint: OutPoint, depType: DepType);
|
|
313
|
+
/**
|
|
314
|
+
* Creates a CellDep instance from a CellDepLike object.
|
|
315
|
+
*
|
|
316
|
+
* @param cellDep - A CellDepLike object or an instance of CellDep.
|
|
317
|
+
* @returns A CellDep instance.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```typescript
|
|
321
|
+
* const cellDep = CellDep.from({
|
|
322
|
+
* outPoint: { txHash: "0x...", index: 0 },
|
|
323
|
+
* depType: "depGroup"
|
|
324
|
+
* });
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
static from(cellDep: CellDepLike): CellDep;
|
|
328
|
+
/**
|
|
329
|
+
* Converts the CellDep instance to molecule data format.
|
|
330
|
+
*
|
|
331
|
+
* @returns An object representing the cell dependency in molecule data format.
|
|
332
|
+
*/
|
|
333
|
+
_toMolData(): {
|
|
334
|
+
outPoint: {
|
|
335
|
+
txHash: Uint8Array;
|
|
336
|
+
index: Uint8Array;
|
|
337
|
+
};
|
|
338
|
+
depType: Uint8Array;
|
|
352
339
|
};
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
*/
|
|
377
|
-
fromBytes(bytes: BytesLike | mol.CellDep): CellDep;
|
|
340
|
+
/**
|
|
341
|
+
* Converts the CellDep instance to bytes.
|
|
342
|
+
*
|
|
343
|
+
* @returns A Uint8Array containing the cell dependency bytes.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```typescript
|
|
347
|
+
* const cellDepBytes = cellDep.toBytes();
|
|
348
|
+
* ```
|
|
349
|
+
*/
|
|
350
|
+
toBytes(): Bytes;
|
|
351
|
+
/**
|
|
352
|
+
* Creates a CellDep instance from a byte-like value or molecule CellDep.
|
|
353
|
+
*
|
|
354
|
+
* @param bytes - The byte-like value or molecule CellDep to convert.
|
|
355
|
+
* @returns A CellDep instance.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```typescript
|
|
359
|
+
* const cellDep = CellDep.fromBytes(new Uint8Array([/* cell dep bytes *\/]));
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
fromBytes(bytes: BytesLike | mol.CellDep): CellDep;
|
|
378
363
|
}
|
|
379
364
|
export type WitnessArgsLike = {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
365
|
+
lock?: HexLike;
|
|
366
|
+
inputType?: HexLike;
|
|
367
|
+
outputType?: HexLike;
|
|
383
368
|
};
|
|
384
369
|
export declare class WitnessArgs {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
* const witnessArgs = WitnessArgs.fromBytes(new Uint8Array([/* witness args bytes *\/]));
|
|
446
|
-
* ```
|
|
447
|
-
*/
|
|
448
|
-
static fromBytes(bytes: BytesLike | mol.WitnessArgs): WitnessArgs;
|
|
370
|
+
lock?: `0x${string}` | undefined;
|
|
371
|
+
inputType?: `0x${string}` | undefined;
|
|
372
|
+
outputType?: `0x${string}` | undefined;
|
|
373
|
+
/**
|
|
374
|
+
* Creates an instance of WitnessArgs.
|
|
375
|
+
*
|
|
376
|
+
* @param lock - The optional lock field of the witness.
|
|
377
|
+
* @param inputType - The optional input type field of the witness.
|
|
378
|
+
* @param outputType - The optional output type field of the witness.
|
|
379
|
+
*/
|
|
380
|
+
constructor(lock?: `0x${string}` | undefined, inputType?: `0x${string}` | undefined, outputType?: `0x${string}` | undefined);
|
|
381
|
+
/**
|
|
382
|
+
* Creates a WitnessArgs instance from a WitnessArgsLike object.
|
|
383
|
+
*
|
|
384
|
+
* @param witnessArgs - A WitnessArgsLike object or an instance of WitnessArgs.
|
|
385
|
+
* @returns A WitnessArgs instance.
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
* ```typescript
|
|
389
|
+
* const witnessArgs = WitnessArgs.from({
|
|
390
|
+
* lock: "0x...",
|
|
391
|
+
* inputType: "0x...",
|
|
392
|
+
* outputType: "0x..."
|
|
393
|
+
* });
|
|
394
|
+
* ```
|
|
395
|
+
*/
|
|
396
|
+
static from(witnessArgs: WitnessArgsLike): WitnessArgs;
|
|
397
|
+
/**
|
|
398
|
+
* Converts the WitnessArgs instance to molecule data format.
|
|
399
|
+
*
|
|
400
|
+
* @returns An object representing the witness arguments in molecule data format.
|
|
401
|
+
*/
|
|
402
|
+
_toMolData(): {
|
|
403
|
+
lock: Uint8Array | undefined;
|
|
404
|
+
inputType: Uint8Array | undefined;
|
|
405
|
+
outputType: Uint8Array | undefined;
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* Converts the WitnessArgs instance to bytes.
|
|
409
|
+
*
|
|
410
|
+
* @returns A Uint8Array containing the witness arguments bytes.
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* ```typescript
|
|
414
|
+
* const witnessArgsBytes = witnessArgs.toBytes();
|
|
415
|
+
* ```
|
|
416
|
+
*/
|
|
417
|
+
toBytes(): Bytes;
|
|
418
|
+
/**
|
|
419
|
+
* Creates a WitnessArgs instance from a byte-like value or molecule WitnessArgs.
|
|
420
|
+
*
|
|
421
|
+
* @param bytes - The byte-like value or molecule WitnessArgs to convert.
|
|
422
|
+
* @returns A WitnessArgs instance.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```typescript
|
|
426
|
+
* const witnessArgs = WitnessArgs.fromBytes(new Uint8Array([/* witness args bytes *\/]));
|
|
427
|
+
* ```
|
|
428
|
+
*/
|
|
429
|
+
static fromBytes(bytes: BytesLike | mol.WitnessArgs): WitnessArgs;
|
|
449
430
|
}
|
|
450
431
|
export type TransactionLike = {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
432
|
+
version: NumLike;
|
|
433
|
+
cellDeps: CellDepLike[];
|
|
434
|
+
headerDeps: HexLike[];
|
|
435
|
+
inputs: CellInputLike[];
|
|
436
|
+
outputs: CellOutputLike[];
|
|
437
|
+
outputsData: HexLike[];
|
|
438
|
+
witnesses: HexLike[];
|
|
458
439
|
};
|
|
459
440
|
export declare class Transaction {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
* const signHashInfo = await tx.getSignHashInfo(scriptLike, client);
|
|
578
|
-
* if (signHashInfo) {
|
|
579
|
-
* console.log(signHashInfo.message); // Outputs the signing message
|
|
580
|
-
* console.log(signHashInfo.position); // Outputs the witness position
|
|
581
|
-
* }
|
|
582
|
-
* ```
|
|
583
|
-
*/
|
|
584
|
-
getSignHashInfo(
|
|
585
|
-
scriptLike: ScriptLike,
|
|
586
|
-
client: Client,
|
|
587
|
-
): Promise<
|
|
588
|
-
| {
|
|
441
|
+
version: Num;
|
|
442
|
+
cellDeps: CellDep[];
|
|
443
|
+
headerDeps: Hex[];
|
|
444
|
+
inputs: CellInput[];
|
|
445
|
+
outputs: CellOutput[];
|
|
446
|
+
outputsData: Hex[];
|
|
447
|
+
witnesses: Hex[];
|
|
448
|
+
/**
|
|
449
|
+
* Creates an instance of Transaction.
|
|
450
|
+
*
|
|
451
|
+
* @param version - The version of the transaction.
|
|
452
|
+
* @param cellDeps - The cell dependencies of the transaction.
|
|
453
|
+
* @param headerDeps - The header dependencies of the transaction.
|
|
454
|
+
* @param inputs - The inputs of the transaction.
|
|
455
|
+
* @param outputs - The outputs of the transaction.
|
|
456
|
+
* @param outputsData - The data associated with the outputs.
|
|
457
|
+
* @param witnesses - The witnesses of the transaction.
|
|
458
|
+
*/
|
|
459
|
+
constructor(version: Num, cellDeps: CellDep[], headerDeps: Hex[], inputs: CellInput[], outputs: CellOutput[], outputsData: Hex[], witnesses: Hex[]);
|
|
460
|
+
/**
|
|
461
|
+
* Creates a default Transaction instance with empty fields.
|
|
462
|
+
*
|
|
463
|
+
* @returns A default Transaction instance.
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* ```typescript
|
|
467
|
+
* const defaultTx = Transaction.default();
|
|
468
|
+
* ```
|
|
469
|
+
*/
|
|
470
|
+
static default(): Transaction;
|
|
471
|
+
/**
|
|
472
|
+
* Creates a Transaction instance from a TransactionLike object.
|
|
473
|
+
*
|
|
474
|
+
* @param tx - A TransactionLike object or an instance of Transaction.
|
|
475
|
+
* @returns A Transaction instance.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* ```typescript
|
|
479
|
+
* const transaction = Transaction.from({
|
|
480
|
+
* version: 0,
|
|
481
|
+
* cellDeps: [],
|
|
482
|
+
* headerDeps: [],
|
|
483
|
+
* inputs: [],
|
|
484
|
+
* outputs: [],
|
|
485
|
+
* outputsData: [],
|
|
486
|
+
* witnesses: []
|
|
487
|
+
* });
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
static from(tx: TransactionLike): Transaction;
|
|
491
|
+
/**
|
|
492
|
+
* Creates a Transaction instance from a Lumos skeleton.
|
|
493
|
+
*
|
|
494
|
+
* @param skeleton - The Lumos transaction skeleton.
|
|
495
|
+
* @returns A Transaction instance.
|
|
496
|
+
*
|
|
497
|
+
* @throws Will throw an error if an input's outPoint is missing.
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* ```typescript
|
|
501
|
+
* const transaction = Transaction.fromLumosSkeleton(skeleton);
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
504
|
+
static fromLumosSkeleton(skeleton: TransactionSkeletonType): Transaction;
|
|
505
|
+
stringify(): string;
|
|
506
|
+
/**
|
|
507
|
+
* Converts the raw transaction data to bytes.
|
|
508
|
+
*
|
|
509
|
+
* @returns A Uint8Array containing the raw transaction bytes.
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
* ```typescript
|
|
513
|
+
* const rawTxBytes = transaction.rawToBytes();
|
|
514
|
+
* ```
|
|
515
|
+
*/
|
|
516
|
+
rawToBytes(): Bytes;
|
|
517
|
+
/**
|
|
518
|
+
* Calculates the hash of the transaction.
|
|
519
|
+
*
|
|
520
|
+
* @returns The hash of the transaction.
|
|
521
|
+
*
|
|
522
|
+
* @example
|
|
523
|
+
* ```typescript
|
|
524
|
+
* const txHash = transaction.hash();
|
|
525
|
+
* ```
|
|
526
|
+
*/
|
|
527
|
+
hash(): `0x${string}`;
|
|
528
|
+
/**
|
|
529
|
+
* Hashes a witness and updates the hasher.
|
|
530
|
+
*
|
|
531
|
+
* @param witness - The witness to hash.
|
|
532
|
+
* @param hasher - The hasher instance to update.
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
* ```typescript
|
|
536
|
+
* Transaction.hashWitnessToHasher("0x...", hasher);
|
|
537
|
+
* ```
|
|
538
|
+
*/
|
|
539
|
+
static hashWitnessToHasher(witness: HexLike, hasher: Hasher): void;
|
|
540
|
+
/**
|
|
541
|
+
* Computes the signing hash information for a given script.
|
|
542
|
+
*
|
|
543
|
+
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
544
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
545
|
+
* @returns A promise that resolves to an object containing the signing message and the witness position,
|
|
546
|
+
* or undefined if no matching input is found.
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
* ```typescript
|
|
550
|
+
* const signHashInfo = await tx.getSignHashInfo(scriptLike, client);
|
|
551
|
+
* if (signHashInfo) {
|
|
552
|
+
* console.log(signHashInfo.message); // Outputs the signing message
|
|
553
|
+
* console.log(signHashInfo.position); // Outputs the witness position
|
|
554
|
+
* }
|
|
555
|
+
* ```
|
|
556
|
+
*/
|
|
557
|
+
getSignHashInfo(scriptLike: ScriptLike, client: Client): Promise<{
|
|
589
558
|
message: Hex;
|
|
590
559
|
position: number;
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
* ```typescript
|
|
645
|
-
* await tx.prepareSighashAllWitness(scriptLike, 85, client);
|
|
646
|
-
* ```
|
|
647
|
-
*/
|
|
648
|
-
prepareSighashAllWitness(
|
|
649
|
-
scriptLike: ScriptLike,
|
|
650
|
-
lockLen: number,
|
|
651
|
-
client: Client,
|
|
652
|
-
): Promise<void>;
|
|
560
|
+
} | undefined>;
|
|
561
|
+
/**
|
|
562
|
+
* Find the first occurrence of a input with the specified lock
|
|
563
|
+
*
|
|
564
|
+
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
565
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
566
|
+
* @returns A promise that resolves to the prepared transaction
|
|
567
|
+
*
|
|
568
|
+
* @example
|
|
569
|
+
* ```typescript
|
|
570
|
+
* const index = await tx.findInputIndexByLock(scriptLike, client);
|
|
571
|
+
* ```
|
|
572
|
+
*/
|
|
573
|
+
findInputIndexByLock(scriptLike: ScriptLike, client: Client): Promise<number | undefined>;
|
|
574
|
+
/**
|
|
575
|
+
* Get witness at index as WitnessArgs
|
|
576
|
+
*
|
|
577
|
+
* @param index - The index of the witness.
|
|
578
|
+
* @returns The witness parsed as WitnessArgs.
|
|
579
|
+
*
|
|
580
|
+
* @example
|
|
581
|
+
* ```typescript
|
|
582
|
+
* const witnessArgs = await tx.getWitnessArgsAt(0);
|
|
583
|
+
* ```
|
|
584
|
+
*/
|
|
585
|
+
getWitnessArgsAt(index: number): WitnessArgs | undefined;
|
|
586
|
+
/**
|
|
587
|
+
* Set witness at index by WitnessArgs
|
|
588
|
+
*
|
|
589
|
+
* @param index - The index of the witness.
|
|
590
|
+
* @param witness - The WitnessArgs to set.
|
|
591
|
+
* @returns The transaction itself.
|
|
592
|
+
*
|
|
593
|
+
* @example
|
|
594
|
+
* ```typescript
|
|
595
|
+
* await tx.setWitnessArgsAt(0, witnessArgs);
|
|
596
|
+
* ```
|
|
597
|
+
*/
|
|
598
|
+
setWitnessArgsAt(index: number, witness: WitnessArgs): void;
|
|
599
|
+
/**
|
|
600
|
+
* Prepare dummy witness for sighash all method
|
|
601
|
+
*
|
|
602
|
+
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
603
|
+
* @param lockLen - The length of dummy lock bytes.
|
|
604
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
605
|
+
* @returns A promise that resolves to the prepared transaction
|
|
606
|
+
*
|
|
607
|
+
* @example
|
|
608
|
+
* ```typescript
|
|
609
|
+
* await tx.prepareSighashAllWitness(scriptLike, 85, client);
|
|
610
|
+
* ```
|
|
611
|
+
*/
|
|
612
|
+
prepareSighashAllWitness(scriptLike: ScriptLike, lockLen: number, client: Client): Promise<void>;
|
|
653
613
|
}
|
|
654
|
-
//# sourceMappingURL=transaction.d.ts.map
|
|
614
|
+
//# sourceMappingURL=transaction.d.ts.map
|