@ckb-ccc/core 1.11.5 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/ckb/transaction.d.ts +160 -29
  3. package/dist/ckb/transaction.d.ts.map +1 -1
  4. package/dist/ckb/transaction.js +185 -39
  5. package/dist/client/jsonRpc/client.d.ts +1 -1
  6. package/dist/client/jsonRpc/client.d.ts.map +1 -1
  7. package/dist/client/jsonRpc/client.js +4 -1
  8. package/dist/client/jsonRpc/transformers.d.ts +1 -1
  9. package/dist/client/jsonRpc/transformers.d.ts.map +1 -1
  10. package/dist/client/jsonRpc/transformers.js +2 -1
  11. package/dist/jsonRpc/requestor.js +1 -1
  12. package/dist/signer/btc/verify.d.ts +21 -0
  13. package/dist/signer/btc/verify.d.ts.map +1 -1
  14. package/dist/signer/btc/verify.js +38 -2
  15. package/dist/signer/doge/signerDogePrivateKey.d.ts.map +1 -1
  16. package/dist/signer/doge/signerDogePrivateKey.js +2 -2
  17. package/dist/signer/doge/verify.d.ts +12 -1
  18. package/dist/signer/doge/verify.d.ts.map +1 -1
  19. package/dist/signer/doge/verify.js +15 -5
  20. package/dist/signer/signer/index.d.ts +14 -5
  21. package/dist/signer/signer/index.d.ts.map +1 -1
  22. package/dist/signer/signer/index.js +19 -11
  23. package/dist.commonjs/ckb/transaction.d.ts +160 -29
  24. package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
  25. package/dist.commonjs/ckb/transaction.js +187 -40
  26. package/dist.commonjs/client/jsonRpc/client.d.ts +1 -1
  27. package/dist.commonjs/client/jsonRpc/client.d.ts.map +1 -1
  28. package/dist.commonjs/client/jsonRpc/client.js +4 -1
  29. package/dist.commonjs/client/jsonRpc/transformers.d.ts +1 -1
  30. package/dist.commonjs/client/jsonRpc/transformers.d.ts.map +1 -1
  31. package/dist.commonjs/client/jsonRpc/transformers.js +2 -1
  32. package/dist.commonjs/jsonRpc/requestor.js +1 -1
  33. package/dist.commonjs/signer/btc/verify.d.ts +21 -0
  34. package/dist.commonjs/signer/btc/verify.d.ts.map +1 -1
  35. package/dist.commonjs/signer/btc/verify.js +40 -2
  36. package/dist.commonjs/signer/doge/signerDogePrivateKey.d.ts.map +1 -1
  37. package/dist.commonjs/signer/doge/signerDogePrivateKey.js +2 -2
  38. package/dist.commonjs/signer/doge/verify.d.ts +12 -1
  39. package/dist.commonjs/signer/doge/verify.d.ts.map +1 -1
  40. package/dist.commonjs/signer/doge/verify.js +15 -4
  41. package/dist.commonjs/signer/signer/index.d.ts +14 -5
  42. package/dist.commonjs/signer/signer/index.d.ts.map +1 -1
  43. package/dist.commonjs/signer/signer/index.js +21 -13
  44. package/package.json +3 -4
  45. package/{prettier.config.mjs → prettier.config.cjs} +2 -4
  46. package/src/ckb/transaction.ts +254 -80
  47. package/src/client/jsonRpc/client.ts +5 -2
  48. package/src/client/jsonRpc/transformers.ts +6 -1
  49. package/src/jsonRpc/requestor.ts +2 -2
  50. package/src/signer/btc/verify.ts +52 -3
  51. package/src/signer/doge/signerDogePrivateKey.ts +2 -2
  52. package/src/signer/doge/verify.ts +23 -7
  53. package/src/signer/signer/index.ts +20 -10
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  };
8
8
  var OutPoint_1, CellOutput_1, Since_1, CellInput_1, CellDep_1, WitnessArgs_1, Transaction_1;
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.Transaction = exports.RawTransaction = exports.WitnessArgs = exports.CellDepVec = exports.CellDep = exports.CellInputVec = exports.CellInput = exports.Since = exports.Cell = exports.CellOutputVec = exports.CellOutput = exports.OutPoint = exports.DepTypeCodec = void 0;
10
+ exports.Transaction = exports.RawTransaction = exports.WitnessArgs = exports.CellDepVec = exports.CellDep = exports.CellInputVec = exports.CellInput = exports.Since = exports.Cell = exports.CellAny = exports.CellOutputVec = exports.CellOutput = exports.OutPoint = exports.DepTypeCodec = void 0;
11
11
  exports.depTypeFrom = depTypeFrom;
12
12
  exports.depTypeToBytes = depTypeToBytes;
13
13
  exports.depTypeFromBytes = depTypeFromBytes;
@@ -184,6 +184,31 @@ let CellOutput = CellOutput_1 = class CellOutput extends index_js_6.mol.Entity.B
184
184
  get occupiedSize() {
185
185
  return 8 + this.lock.occupiedSize + (this.type?.occupiedSize ?? 0);
186
186
  }
187
+ /**
188
+ * Creates a CellOutput instance from a CellOutputLike object.
189
+ * This method supports automatic capacity calculation when capacity is 0 or omitted.
190
+ *
191
+ * @param cellOutput - A CellOutputLike object or an instance of CellOutput.
192
+ * @param outputData - Optional output data used for automatic capacity calculation.
193
+ * When provided and capacity is 0, the capacity will be calculated
194
+ * as occupiedSize + outputData.length.
195
+ * @returns A CellOutput instance.
196
+ *
197
+ * @example
198
+ * ```typescript
199
+ * // Basic usage with explicit capacity
200
+ * const cellOutput1 = CellOutput.from({
201
+ * capacity: 1000n,
202
+ * lock: { codeHash: "0x...", hashType: "type", args: "0x..." },
203
+ * type: { codeHash: "0x...", hashType: "type", args: "0x..." }
204
+ * });
205
+ *
206
+ * // Automatic capacity calculation
207
+ * const cellOutput2 = CellOutput.from({
208
+ * lock: { codeHash: "0x...", hashType: "type", args: "0x..." }
209
+ * }, "0x1234"); // Capacity will be calculated automatically
210
+ * ```
211
+ */
187
212
  static from(cellOutput, outputData) {
188
213
  if (cellOutput instanceof CellOutput_1) {
189
214
  return cellOutput;
@@ -218,20 +243,126 @@ exports.CellOutput = CellOutput = CellOutput_1 = __decorate([
218
243
  ], CellOutput);
219
244
  exports.CellOutputVec = index_js_6.mol.vector(CellOutput);
220
245
  /**
246
+ * Represents a CKB cell that can be either on-chain (with an `outPoint`) or off-chain (without an `outPoint`).
247
+ * This class provides a unified interface for handling cells before they are included in a transaction,
248
+ * or for cells that are already part of the blockchain state.
249
+ *
221
250
  * @public
222
251
  */
223
- class Cell {
252
+ class CellAny {
253
+ /**
254
+ * Creates an instance of CellAny.
255
+ *
256
+ * @param cellOutput - The cell output of the cell.
257
+ * @param outputData - The output data of the cell.
258
+ * @param outPoint - The optional output point of the cell. If provided, the cell is considered on-chain.
259
+ */
260
+ constructor(cellOutput, outputData, outPoint) {
261
+ this.cellOutput = cellOutput;
262
+ this.outputData = outputData;
263
+ this.outPoint = outPoint;
264
+ }
224
265
  /**
225
- * Creates an instance of Cell.
266
+ * Creates a `CellAny` instance from a `CellAnyLike` object.
267
+ * This factory method provides a convenient way to create `CellAny` instances
268
+ * from plain objects, automatically handling the optional `outPoint` or `previousOutput`.
269
+ *
270
+ * @param cell - A `CellAnyLike` object.
271
+ * @returns A new `CellAny` instance.
272
+ *
273
+ * @example
274
+ * ```typescript
275
+ * // Create an off-chain cell (e.g., a new output)
276
+ * const offChainCell = CellAny.from({
277
+ * cellOutput: { capacity: 1000n, lock: lockScript },
278
+ * outputData: "0x"
279
+ * });
280
+ *
281
+ * // Create an on-chain cell from an input
282
+ * const onChainCell = CellAny.from({
283
+ * outPoint: { txHash: "0x...", index: 0 },
284
+ * cellOutput: { capacity: 2000n, lock: lockScript },
285
+ * outputData: "0x1234"
286
+ * });
287
+ * ```
288
+ */
289
+ static from(cell) {
290
+ if (cell instanceof CellAny) {
291
+ return cell;
292
+ }
293
+ return new CellAny(CellOutput.from(cell.cellOutput, cell.outputData), (0, index_js_5.hexFrom)(cell.outputData ?? "0x"), (0, index_js_8.apply)(OutPoint.from, cell.outPoint ?? cell.previousOutput));
294
+ }
295
+ /**
296
+ * Calculates the total occupied size of the cell in bytes.
297
+ * This includes the size of the `CellOutput` structure plus the size of the `outputData`.
298
+ *
299
+ * @returns The total occupied size in bytes.
300
+ */
301
+ get occupiedSize() {
302
+ return this.cellOutput.occupiedSize + (0, index_js_1.bytesFrom)(this.outputData).byteLength;
303
+ }
304
+ /**
305
+ * Calculates the free capacity of the cell.
306
+ * Free capacity is the total capacity minus the capacity occupied by the cell's structure and data.
307
+ *
308
+ * @returns The free capacity in shannons as a `Num`.
309
+ */
310
+ get capacityFree() {
311
+ return this.cellOutput.capacity - (0, index_js_3.fixedPointFrom)(this.occupiedSize);
312
+ }
313
+ /**
314
+ * Checks if the cell is a Nervos DAO cell and optionally checks its phase.
315
+ *
316
+ * @param client - A CKB client instance to fetch known script information.
317
+ * @param phase - Optional phase to check: "deposited" or "withdrew".
318
+ * If omitted, it checks if the cell is a DAO cell regardless of phase.
319
+ * @returns A promise that resolves to `true` if the cell is a matching Nervos DAO cell, `false` otherwise.
320
+ */
321
+ async isNervosDao(client, phase) {
322
+ const { type } = this.cellOutput;
323
+ const daoType = await client.getKnownScript(knownScript_js_1.KnownScript.NervosDao);
324
+ if (!type ||
325
+ type.codeHash !== daoType.codeHash ||
326
+ type.hashType !== daoType.hashType) {
327
+ // Non Nervos DAO cell
328
+ return false;
329
+ }
330
+ const hasWithdrew = (0, index_js_7.numFrom)(this.outputData) !== index_js_3.Zero;
331
+ return (!phase ||
332
+ (phase === "deposited" && !hasWithdrew) ||
333
+ (phase === "withdrew" && hasWithdrew));
334
+ }
335
+ /**
336
+ * Clones the `CellAny` instance.
337
+ *
338
+ * @returns A new `CellAny` instance that is a deep copy of the current one.
339
+ *
340
+ * @example
341
+ * ```typescript
342
+ * const clonedCell = cellAny.clone();
343
+ * ```
344
+ */
345
+ clone() {
346
+ return new CellAny(this.cellOutput.clone(), this.outputData, this.outPoint?.clone());
347
+ }
348
+ }
349
+ exports.CellAny = CellAny;
350
+ /**
351
+ * Represents an on-chain CKB cell, which is a `CellAny` that is guaranteed to have an `outPoint`.
352
+ * This class is typically used for cells that are already part of the blockchain state, such as transaction inputs.
353
+ * @public
354
+ */
355
+ class Cell extends CellAny {
356
+ /**
357
+ * Creates an instance of an on-chain Cell.
226
358
  *
227
359
  * @param outPoint - The output point of the cell.
228
360
  * @param cellOutput - The cell output of the cell.
229
361
  * @param outputData - The output data of the cell.
230
362
  */
231
363
  constructor(outPoint, cellOutput, outputData) {
364
+ super(cellOutput, outputData, outPoint);
232
365
  this.outPoint = outPoint;
233
- this.cellOutput = cellOutput;
234
- this.outputData = outputData;
235
366
  }
236
367
  /**
237
368
  * Creates a Cell instance from a CellLike object.
@@ -271,18 +402,7 @@ class Cell {
271
402
  if (cell instanceof Cell) {
272
403
  return cell;
273
404
  }
274
- return new Cell(OutPoint.from("outPoint" in cell ? cell.outPoint : cell.previousOutput), CellOutput.from(cell.cellOutput, cell.outputData), (0, index_js_5.hexFrom)(cell.outputData));
275
- }
276
- get capacityFree() {
277
- const occupiedSize = (0, index_js_3.fixedPointFrom)(this.cellOutput.occupiedSize + (0, index_js_1.bytesFrom)(this.outputData).length);
278
- return this.cellOutput.capacity - occupiedSize;
279
- }
280
- /**
281
- * Occupied bytes of a cell on chain
282
- * It's CellOutput.occupiedSize + bytesFrom(outputData).byteLength
283
- */
284
- get occupiedSize() {
285
- return this.cellOutput.occupiedSize + (0, index_js_1.bytesFrom)(this.outputData).byteLength;
405
+ return new Cell(OutPoint.from(cell.outPoint ?? cell.previousOutput), CellOutput.from(cell.cellOutput, cell.outputData), (0, index_js_5.hexFrom)(cell.outputData ?? "0x"));
286
406
  }
287
407
  /**
288
408
  * Gets confirmed Nervos DAO profit of a Cell
@@ -307,20 +427,22 @@ class Cell {
307
427
  }
308
428
  return calcDaoProfit(this.capacityFree, depositHeader, withdrawHeader);
309
429
  }
310
- async isNervosDao(client, phase) {
311
- const { type } = this.cellOutput;
312
- const daoType = await client.getKnownScript(knownScript_js_1.KnownScript.NervosDao);
313
- if (!type ||
314
- type.codeHash !== daoType.codeHash ||
315
- type.hashType !== daoType.hashType) {
316
- // Non Nervos DAO cell
317
- return false;
318
- }
319
- const hasWithdrew = (0, index_js_7.numFrom)(this.outputData) !== index_js_3.Zero;
320
- return (!phase ||
321
- (phase === "deposited" && !hasWithdrew) ||
322
- (phase === "withdrew" && hasWithdrew));
323
- }
430
+ /**
431
+ * Retrieves detailed information about a Nervos DAO cell, including its deposit and withdrawal headers.
432
+ *
433
+ * @param client - A CKB client instance to fetch cell and header data.
434
+ * @returns A promise that resolves to an object containing header information.
435
+ * - If not a DAO cell, returns `{}`.
436
+ * - If a deposited DAO cell, returns `{ depositHeader }`.
437
+ * - If a withdrawn DAO cell, returns `{ depositHeader, withdrawHeader }`.
438
+ *
439
+ * @throws If the cell is a DAO cell but its corresponding headers cannot be fetched.
440
+ *
441
+ * @example
442
+ * ```typescript
443
+ * const daoInfo = await cell.getNervosDaoInfo(client);
444
+ * ```
445
+ */
324
446
  async getNervosDaoInfo(client) {
325
447
  if (!(await this.isNervosDao(client))) {
326
448
  // Non Nervos DAO cell
@@ -1181,25 +1303,50 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
1181
1303
  if (i >= this.outputs.length) {
1182
1304
  return;
1183
1305
  }
1184
- return {
1306
+ return CellAny.from({
1185
1307
  cellOutput: this.outputs[i],
1186
1308
  outputData: this.outputsData[i] ?? "0x",
1187
- };
1309
+ });
1188
1310
  }
1189
1311
  /**
1190
- * Add output
1312
+ * Provides an iterable over the transaction's output cells.
1313
+ *
1314
+ * This getter is a convenient way to iterate through all the output cells (`CellAny`)
1315
+ * of the transaction, combining the `outputs` and `outputsData` arrays.
1316
+ * It can be used with `for...of` loops or other iterable-consuming patterns.
1191
1317
  *
1192
- * @param outputLike - The cell output to add
1193
- * @param outputData - optional output data
1318
+ * @public
1319
+ * @category Getter
1320
+ * @returns An `Iterable<CellAny>` that yields each output cell of the transaction.
1194
1321
  *
1195
1322
  * @example
1196
1323
  * ```typescript
1197
- * await tx.addOutput(cellOutput, "0xabcd");
1324
+ * for (const cell of tx.outputCells) {
1325
+ * console.log(`Output cell capacity: ${cell.cellOutput.capacity}`);
1326
+ * }
1198
1327
  * ```
1199
1328
  */
1200
- addOutput(outputLike, outputData = "0x") {
1201
- const len = this.outputs.push(CellOutput.from(outputLike, outputData));
1202
- this.setOutputDataAt(len - 1, outputData);
1329
+ get outputCells() {
1330
+ const { outputs, outputsData } = this;
1331
+ function* generator() {
1332
+ for (let i = 0; i < outputs.length; i++) {
1333
+ yield CellAny.from({
1334
+ cellOutput: outputs[i],
1335
+ outputData: outputsData[i] ?? "0x",
1336
+ });
1337
+ }
1338
+ }
1339
+ return generator();
1340
+ }
1341
+ addOutput(cellOrOutputLike, outputDataLike) {
1342
+ const cell = "cellOutput" in cellOrOutputLike
1343
+ ? CellAny.from(cellOrOutputLike)
1344
+ : CellAny.from({
1345
+ cellOutput: cellOrOutputLike,
1346
+ outputData: outputDataLike,
1347
+ });
1348
+ const len = this.outputs.push(cell.cellOutput);
1349
+ this.setOutputDataAt(len - 1, cell.outputData);
1203
1350
  return len;
1204
1351
  }
1205
1352
  /**
@@ -103,7 +103,7 @@ export declare abstract class ClientJsonRpc extends Client {
103
103
  * @param validator - "passthrough": Disable validation. "well_known_scripts_only": Only accept well known scripts in the transaction.
104
104
  * @returns Transaction hash.
105
105
  */
106
- sendTransactionNoCache: (transaction: TransactionLike, validator?: OutputsValidator | undefined) => Promise<Hex>;
106
+ sendTransactionNoCache: (transaction: TransactionLike, validator?: OutputsValidator | null) => Promise<Hex>;
107
107
  /**
108
108
  * Get a transaction from node.
109
109
  *
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client/jsonRpc/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEJ,YAAY,EACZ,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAqB,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EAOzB,gBAAgB,EACjB,MAAM,m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122,10 @@ class ClientJsonRpc extends client_js_1.Client {
122
122
  * @param validator - "passthrough": Disable validation. "well_known_scripts_only": Only accept well known scripts in the transaction.
123
123
  * @returns Transaction hash.
124
124
  */
125
- this.sendTransactionNoCache = this.buildSender("send_transaction", [advanced_js_1.JsonRpcTransformers.transactionFrom], index_js_2.hexFrom);
125
+ this.sendTransactionNoCache = this.buildSender("send_transaction", [
126
+ advanced_js_1.JsonRpcTransformers.transactionFrom,
127
+ (validator) => validator ?? undefined,
128
+ ], index_js_2.hexFrom);
126
129
  /**
127
130
  * Get a transaction from node.
128
131
  *
@@ -14,7 +14,7 @@ export declare class JsonRpcTransformers {
14
14
  static outPointTo(outPoint: JsonRpcOutPoint): OutPoint;
15
15
  static cellInputFrom(cellInputLike: CellInputLike): JsonRpcCellInput;
16
16
  static cellInputTo(cellInput: JsonRpcCellInput): CellInput;
17
- static cellOutputFrom(cellOutput: CellOutputLike): JsonRpcCellOutput;
17
+ static cellOutputFrom(cellOutputLike: CellOutputLike, outputData?: HexLike | null): JsonRpcCellOutput;
18
18
  static cellOutputTo(cellOutput: JsonRpcCellOutput): CellOutput;
19
19
  static cellDepFrom(cellDep: CellDepLike): JsonRpcCellDep;
20
20
  static cellDepTo(cellDep: JsonRpcCellDep): CellDep;
@@ -1 +1 @@
1
- {"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../src/client/jsonRpc/transformers.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,cAAc,EACd,OAAO,EACP,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAqC,MAAM,oBAAoB,CAAC;AAEhF,OAAO,E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;QACD,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE;YACP,SAAS,EAAE,eAAe,CAAC;YAC3B,MAAM,EAAE,iBAAiB,CAAC;YAC1B,WAAW,CAAC,EAAE,GAAG,CAAC;SACnB,EAAE,CAAC;KACL,GAAG,uBAAuB;IAY3B,MAAM,CAAC,+BAA+B,CACpC,OAAO,EAAE,qCAAqC,GAC7C,kCAAkC;IAUrC,MAAM,CAAC,0BAA0B,CAAC,EAChC,WAAW,EACX,OAAO,GACR,EACG,sCAAsC,GACtC,6CAA6C,GAC7C,8BAA8B,GAC9B,qCAAqC;CAqC1C"}
1
+ {"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../src/client/jsonRpc/transformers.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,cAAc,EACd,OAAO,EACP,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAqC,MAAM,oBAAoB,CAAC;AAEhF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,qCAAqC,EACrC,8BAA8B,EAE9B,4BAA4B,EAC5B,0BAA0B,EAE1B,qCAAqC,EACrC,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,6CAA6C,EAC7C,sCAAsC,EACtC,uBAAuB,EACvB,6BAA6B,EAC7B,kCAAkC,EAClC,eAAe,EACf,aAAa,EACb,kBAAkB,EACnB,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AqC;CAqC1C"}
@@ -71,7 +71,8 @@ class JsonRpcTransformers {
71
71
  since: cellInput.since,
72
72
  });
73
73
  }
74
- static cellOutputFrom(cellOutput) {
74
+ static cellOutputFrom(cellOutputLike, outputData) {
75
+ const cellOutput = index_js_2.CellOutput.from(cellOutputLike, outputData);
75
76
  return {
76
77
  capacity: (0, index_js_4.numToHex)(cellOutput.capacity),
77
78
  lock: JsonRpcTransformers.scriptFrom(cellOutput.lock),
@@ -89,7 +89,7 @@ class RequestorJsonRpc {
89
89
  if (res.id !== payload.id) {
90
90
  throw new Error(`Id mismatched, got ${res.id}, expected ${payload.id}`);
91
91
  }
92
- if (res.error) {
92
+ if (res.error != null) {
93
93
  throw res.error;
94
94
  }
95
95
  return res.result;
@@ -1,5 +1,26 @@
1
1
  import { Bytes, BytesLike } from "../../bytes/index.js";
2
2
  import { Hex } from "../../hex/index.js";
3
+ import { NumLike } from "../../num/index.js";
4
+ /**
5
+ * Encodes a number into a variable-length byte array according to the Bitcoin protocol.
6
+ * This format is used for encoding lengths of data, such as script lengths.
7
+ *
8
+ * @param len - The number to encode. Can be a NumLike.
9
+ * @returns The encoded length as a Bytes.
10
+ * @public
11
+ */
12
+ export declare function btcVarLengthBytesFrom(len: NumLike): Bytes;
13
+ /**
14
+ * Computes the message hash for Bitcoin ECDSA signatures.
15
+ * This function follows the Bitcoin message signing standard, which involves
16
+ * prefixing the message with a magic string and its length, then double SHA256 hashing the result.
17
+ *
18
+ * @param message - The message to be hashed. Can be a string or BytesLike.
19
+ * @param messagePrefix - Optional. A custom prefix to use instead of the default "\u0018Bitcoin Signed Message:\n".
20
+ * @returns The Bitcoin hash of the prefixed message as Bytes.
21
+ * @public
22
+ */
23
+ export declare function messageHashBtcEcdsa(message: string | BytesLike, messagePrefix?: string | BytesLike): Bytes;
3
24
  /**
4
25
  * @public
5
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/verify.ts"],"names":[],"m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E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAWT"}
@@ -3,6 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.btcVarLengthBytesFrom = btcVarLengthBytesFrom;
7
+ exports.messageHashBtcEcdsa = messageHashBtcEcdsa;
6
8
  exports.btcEcdsaPublicKeyHash = btcEcdsaPublicKeyHash;
7
9
  exports.btcP2pkhAddressFromPublicKey = btcP2pkhAddressFromPublicKey;
8
10
  exports.btcPublicKeyFromP2pkhAddress = btcPublicKeyFromP2pkhAddress;
@@ -10,10 +12,46 @@ exports.verifyMessageBtcEcdsa = verifyMessageBtcEcdsa;
10
12
  const secp256k1_1 = require("@noble/curves/secp256k1");
11
13
  const legacy_js_1 = require("@noble/hashes/legacy.js");
12
14
  const sha2_js_1 = require("@noble/hashes/sha2.js");
13
- const bitcoinjs_message_1 = require("bitcoinjs-message");
14
15
  const bs58check_1 = __importDefault(require("bs58check"));
15
16
  const index_js_1 = require("../../bytes/index.js");
16
17
  const index_js_2 = require("../../hex/index.js");
18
+ const index_js_3 = require("../../num/index.js");
19
+ /**
20
+ * Encodes a number into a variable-length byte array according to the Bitcoin protocol.
21
+ * This format is used for encoding lengths of data, such as script lengths.
22
+ *
23
+ * @param len - The number to encode. Can be a NumLike.
24
+ * @returns The encoded length as a Bytes.
25
+ * @public
26
+ */
27
+ function btcVarLengthBytesFrom(len) {
28
+ const num = (0, index_js_3.numFrom)(len);
29
+ return num < 0xfd
30
+ ? (0, index_js_3.numLeToBytes)(num, 1)
31
+ : num <= 0xffff
32
+ ? (0, index_js_1.bytesConcat)([0xfd], (0, index_js_3.numLeToBytes)(num, 2))
33
+ : num <= 0xffffffff
34
+ ? (0, index_js_1.bytesConcat)([0xfe], (0, index_js_3.numLeToBytes)(num, 4))
35
+ : (0, index_js_1.bytesConcat)([0xff], (0, index_js_3.numLeToBytes)(num, 8));
36
+ }
37
+ /**
38
+ * Computes the message hash for Bitcoin ECDSA signatures.
39
+ * This function follows the Bitcoin message signing standard, which involves
40
+ * prefixing the message with a magic string and its length, then double SHA256 hashing the result.
41
+ *
42
+ * @param message - The message to be hashed. Can be a string or BytesLike.
43
+ * @param messagePrefix - Optional. A custom prefix to use instead of the default "\u0018Bitcoin Signed Message:\n".
44
+ * @returns The Bitcoin hash of the prefixed message as Bytes.
45
+ * @public
46
+ */
47
+ function messageHashBtcEcdsa(message, messagePrefix) {
48
+ const prefix = messagePrefix ?? "\u0018Bitcoin Signed Message:\n";
49
+ const rawPrefix = typeof prefix === "string" ? (0, index_js_1.bytesFrom)(prefix, "utf8") : (0, index_js_1.bytesFrom)(prefix);
50
+ const rawMsg = typeof message === "string"
51
+ ? (0, index_js_1.bytesFrom)(message, "utf8")
52
+ : (0, index_js_1.bytesFrom)(message);
53
+ return (0, sha2_js_1.sha256)((0, sha2_js_1.sha256)((0, index_js_1.bytesConcat)(rawPrefix, btcVarLengthBytesFrom(rawMsg.length), rawMsg)));
54
+ }
17
55
  /**
18
56
  * @public
19
57
  */
@@ -38,5 +76,5 @@ function btcPublicKeyFromP2pkhAddress(address) {
38
76
  function verifyMessageBtcEcdsa(message, signature, publicKey) {
39
77
  const challenge = typeof message === "string" ? message : (0, index_js_2.hexFrom)(message).slice(2);
40
78
  const rawSign = (0, index_js_1.bytesFrom)(signature, "base64").slice(1);
41
- return secp256k1_1.secp256k1.verify((0, index_js_1.bytesFrom)(rawSign), (0, bitcoinjs_message_1.magicHash)(challenge), (0, index_js_1.bytesFrom)(publicKey));
79
+ return secp256k1_1.secp256k1.verify((0, index_js_1.bytesFrom)(rawSign), messageHashBtcEcdsa(challenge), (0, index_js_1.bytesFrom)(publicKey));
42
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signerDogePrivateKey.d.ts","sourceRoot":"","sources":["../../../src/signer/doge/signerDogePrivateKey.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,SAAS,EAEV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAW,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;aAYhC,WAAW;IAX7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IAEnC;;;;;OAKG;gBAED,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,SAAS,EACL,WAAW,SAAO;IASpC;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC;IAItC;;;;;;;;;OASG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAOvC;;;;;;OAMG;IACG,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAa/D"}
1
+ {"version":3,"file":"signerDogePrivateKey.d.ts","sourceRoot":"","sources":["../../../src/signer/doge/signerDogePrivateKey.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,SAAS,EAEV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAW,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;aAYhC,WAAW;IAX7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IAEnC;;;;;OAKG;gBAED,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,SAAS,EACL,WAAW,SAAO;IASpC;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC;IAItC;;;;;;;;;OASG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAOvC;;;;;;OAMG;IACG,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAa/D"}
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SignerDogePrivateKey = void 0;
4
4
  const secp256k1_1 = require("@noble/curves/secp256k1");
5
- const bitcoinjs_message_1 = require("bitcoinjs-message");
6
5
  const index_js_1 = require("../../bytes/index.js");
7
6
  const index_js_2 = require("../../hex/index.js");
8
7
  const verify_js_1 = require("../btc/verify.js");
9
8
  const signerDoge_js_1 = require("./signerDoge.js");
9
+ const verify_js_2 = require("./verify.js");
10
10
  /**
11
11
  * A class extending SignerDoge that provides access to a Doge address.
12
12
  * @public
@@ -65,7 +65,7 @@ class SignerDogePrivateKey extends signerDoge_js_1.SignerDoge {
65
65
  */
66
66
  async signMessageRaw(msg) {
67
67
  const challenge = typeof msg === "string" ? msg : (0, index_js_2.hexFrom)(msg).slice(2);
68
- const signature = secp256k1_1.secp256k1.sign((0, bitcoinjs_message_1.magicHash)(challenge, "\x19Dogecoin Signed Message:\n"), this.privateKey);
68
+ const signature = secp256k1_1.secp256k1.sign((0, verify_js_2.messageHashDogeEcdsa)(challenge), this.privateKey);
69
69
  return (0, index_js_1.bytesTo)((0, index_js_1.bytesConcat)([31 + signature.recovery], signature.toCompactRawBytes()), "base64");
70
70
  }
71
71
  }
@@ -1,4 +1,15 @@
1
- import { BytesLike } from "../../bytes/index.js";
1
+ import { Bytes, BytesLike } from "../../bytes/index.js";
2
+ /**
3
+ * Computes the message hash for Dogecoin ECDSA signatures.
4
+ * This function follows the Dogecoin message signing standard, which involves
5
+ * prefixing the message with a magic string and its length, then double SHA256 hashing the result.
6
+ *
7
+ * @param message - The message to be hashed. Can be a string or BytesLike.
8
+ * @param messagePrefix - Optional. A custom prefix to use instead of the default "\x19Dogecoin Signed Message:\n".
9
+ * @returns The Dogecoin hash of the prefixed message as Bytes.
10
+ * @public
11
+ */
12
+ export declare function messageHashDogeEcdsa(message: string | BytesLike, messagePrefix?: string | BytesLike): Bytes;
2
13
  /**
3
14
  * @public
4
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/doge/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAO5D;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAuBT"}
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/doge/verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAa,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAQnE;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,GACjC,KAAK,CAKP;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAmBT"}
@@ -1,11 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.messageHashDogeEcdsa = messageHashDogeEcdsa;
3
4
  exports.verifyMessageDogeEcdsa = verifyMessageDogeEcdsa;
4
5
  const secp256k1_1 = require("@noble/curves/secp256k1");
5
- const bitcoinjs_message_1 = require("bitcoinjs-message");
6
6
  const index_js_1 = require("../../bytes/index.js");
7
7
  const index_js_2 = require("../../hex/index.js");
8
8
  const verify_js_1 = require("../btc/verify.js");
9
+ /**
10
+ * Computes the message hash for Dogecoin ECDSA signatures.
11
+ * This function follows the Dogecoin message signing standard, which involves
12
+ * prefixing the message with a magic string and its length, then double SHA256 hashing the result.
13
+ *
14
+ * @param message - The message to be hashed. Can be a string or BytesLike.
15
+ * @param messagePrefix - Optional. A custom prefix to use instead of the default "\x19Dogecoin Signed Message:\n".
16
+ * @returns The Dogecoin hash of the prefixed message as Bytes.
17
+ * @public
18
+ */
19
+ function messageHashDogeEcdsa(message, messagePrefix) {
20
+ return (0, verify_js_1.messageHashBtcEcdsa)(message, messagePrefix ?? "\x19Dogecoin Signed Message:\n");
21
+ }
9
22
  /**
10
23
  * @public
11
24
  */
@@ -16,7 +29,5 @@ function verifyMessageDogeEcdsa(message, signature, address) {
16
29
  const rawSign = signatureBytes.slice(1);
17
30
  const sig = secp256k1_1.secp256k1.Signature.fromCompact((0, index_js_2.hexFrom)(rawSign).slice(2)).addRecoveryBit(recoveryBit - 31);
18
31
  return ((0, verify_js_1.btcPublicKeyFromP2pkhAddress)(address) ===
19
- (0, index_js_2.hexFrom)((0, verify_js_1.btcEcdsaPublicKeyHash)(sig
20
- .recoverPublicKey((0, bitcoinjs_message_1.magicHash)(challenge, "\x19Dogecoin Signed Message:\n"))
21
- .toHex())));
32
+ (0, index_js_2.hexFrom)((0, verify_js_1.btcEcdsaPublicKeyHash)(sig.recoverPublicKey(messageHashDogeEcdsa(challenge)).toHex())));
22
33
  }
@@ -211,13 +211,22 @@ export declare abstract class Signer {
211
211
  */
212
212
  signTransaction(tx: TransactionLike): Promise<Transaction>;
213
213
  /**
214
- * prepare a transaction before signing. This method is not implemented and should be overridden by subclasses.
214
+ * Prepares a transaction before signing.
215
+ * This method can be overridden by subclasses to perform any necessary steps,
216
+ * such as adding cell dependencies or witnesses, before the transaction is signed.
217
+ * The default implementation converts the {@link TransactionLike} object to a {@link Transaction} object
218
+ * without modification.
215
219
  *
216
- * @param _ - The transaction to prepare, represented as a TransactionLike object.
217
- * @returns A promise that resolves to the prepared Transaction object.
218
- * @throws Will throw an error if not implemented.
220
+ * @remarks
221
+ * Note that this default implementation does not add any cell dependencies or dummy witnesses.
222
+ * This may lead to an underestimation of transaction size and fees if used with methods
223
+ * like `Transaction.completeFee`. Subclasses for signers that are intended to sign
224
+ * transactions should override this method to perform necessary preparations.
225
+ *
226
+ * @param tx - The transaction to prepare.
227
+ * @returns A promise that resolves to the prepared {@link Transaction} object.
219
228
  */
220
- prepareTransaction(_: TransactionLike): Promise<Transaction>;
229
+ prepareTransaction(tx: TransactionLike): Promise<Transaction>;
221
230
  /**
222
231
  * Signs a transaction without preparing information for it. This method is not implemented and should be overridden by subclasses.
223
232
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/signer/signer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EACL,MAAM,EACN,qCAAqC,EACrC,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAQzC;;GAEG;AACH,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,UAAU,eAAe;IAC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