@ckb-ccc/core 1.10.0 → 1.11.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.
- package/CHANGELOG.md +36 -4
- package/dist/ckb/hash.d.ts +18 -0
- package/dist/ckb/hash.d.ts.map +1 -0
- package/dist/ckb/hash.js +19 -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/transaction.d.ts +179 -11
- package/dist/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +197 -59
- package/dist/client/clientPublicMainnet.advanced.d.ts.map +1 -1
- package/dist/client/clientPublicMainnet.advanced.js +0 -60
- package/dist/client/clientPublicTestnet.advanced.d.ts +0 -23
- package/dist/client/clientPublicTestnet.advanced.d.ts.map +1 -1
- package/dist/client/clientPublicTestnet.advanced.js +0 -144
- package/dist/client/knownScript.d.ts +1 -3
- package/dist/client/knownScript.d.ts.map +1 -1
- package/dist/client/knownScript.js +0 -4
- package/dist/hasher/hasherCkb.d.ts +0 -16
- package/dist/hasher/hasherCkb.d.ts.map +1 -1
- package/dist/hasher/hasherCkb.js +0 -18
- package/dist/molecule/codec.d.ts +30 -10
- package/dist/molecule/codec.d.ts.map +1 -1
- package/dist/molecule/codec.js +46 -13
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts +18 -6
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbScriptReadonly.js +18 -6
- package/dist/signer/signer/index.d.ts +11 -1
- package/dist/signer/signer/index.d.ts.map +1 -1
- package/dist/signer/signer/index.js +23 -0
- package/dist.commonjs/ckb/hash.d.ts +18 -0
- package/dist.commonjs/ckb/hash.d.ts.map +1 -0
- package/dist.commonjs/ckb/hash.js +22 -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/transaction.d.ts +179 -11
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +197 -59
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +0 -60
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts +0 -23
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +1 -145
- package/dist.commonjs/client/knownScript.d.ts +1 -3
- package/dist.commonjs/client/knownScript.d.ts.map +1 -1
- package/dist.commonjs/client/knownScript.js +0 -4
- package/dist.commonjs/hasher/hasherCkb.d.ts +0 -16
- package/dist.commonjs/hasher/hasherCkb.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherCkb.js +2 -21
- package/dist.commonjs/molecule/codec.d.ts +30 -10
- package/dist.commonjs/molecule/codec.d.ts.map +1 -1
- package/dist.commonjs/molecule/codec.js +46 -13
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +18 -6
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +18 -6
- package/dist.commonjs/signer/signer/index.d.ts +11 -1
- package/dist.commonjs/signer/signer/index.d.ts.map +1 -1
- package/dist.commonjs/signer/signer/index.js +23 -0
- package/package.json +1 -1
- package/prettier.config.mjs +1 -1
- package/src/ckb/hash.ts +28 -0
- package/src/ckb/index.ts +1 -0
- package/src/ckb/transaction.ts +231 -52
- package/src/client/clientPublicMainnet.advanced.ts +0 -68
- package/src/client/clientPublicTestnet.advanced.ts +0 -163
- package/src/client/knownScript.ts +0 -5
- package/src/hasher/hasherCkb.ts +0 -26
- package/src/molecule/codec.ts +50 -13
- package/src/signer/ckb/signerCkbScriptReadonly.ts +24 -8
- package/src/signer/signer/index.ts +34 -0
|
@@ -184,26 +184,15 @@ 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
|
-
*
|
|
190
|
-
* @param cellOutput - A CellOutputLike object or an instance of CellOutput.
|
|
191
|
-
* @returns A CellOutput instance.
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* ```typescript
|
|
195
|
-
* const cellOutput = CellOutput.from({
|
|
196
|
-
* capacity: 1000n,
|
|
197
|
-
* lock: { codeHash: "0x...", hashType: "type", args: "0x..." },
|
|
198
|
-
* type: { codeHash: "0x...", hashType: "type", args: "0x..." }
|
|
199
|
-
* });
|
|
200
|
-
* ```
|
|
201
|
-
*/
|
|
202
|
-
static from(cellOutput) {
|
|
187
|
+
static from(cellOutput, outputData) {
|
|
203
188
|
if (cellOutput instanceof CellOutput_1) {
|
|
204
189
|
return cellOutput;
|
|
205
190
|
}
|
|
206
|
-
|
|
191
|
+
const output = new CellOutput_1((0, index_js_7.numFrom)(cellOutput.capacity ?? 0), script_js_1.Script.from(cellOutput.lock), (0, index_js_8.apply)(script_js_1.Script.from, cellOutput.type));
|
|
192
|
+
if (output.capacity === index_js_3.Zero) {
|
|
193
|
+
output.capacity = (0, index_js_3.fixedPointFrom)(output.occupiedSize + (0, index_js_1.bytesFrom)(outputData ?? "0x").length);
|
|
194
|
+
}
|
|
195
|
+
return output;
|
|
207
196
|
}
|
|
208
197
|
/**
|
|
209
198
|
* Clone a CellOutput.
|
|
@@ -246,15 +235,43 @@ class Cell {
|
|
|
246
235
|
}
|
|
247
236
|
/**
|
|
248
237
|
* Creates a Cell instance from a CellLike object.
|
|
238
|
+
* This method accepts either `outPoint` or `previousOutput` to specify the cell's location,
|
|
239
|
+
* and supports automatic capacity calculation for the cell output.
|
|
249
240
|
*
|
|
250
|
-
* @param cell - A CellLike object or an instance of Cell.
|
|
241
|
+
* @param cell - A CellLike object or an instance of Cell. The object can use either:
|
|
242
|
+
* - `outPoint`: For referencing a cell output
|
|
243
|
+
* - `previousOutput`: For referencing a cell input (alternative name for outPoint)
|
|
244
|
+
* The cellOutput can omit capacity for automatic calculation.
|
|
251
245
|
* @returns A Cell instance.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* // Using outPoint with explicit capacity
|
|
250
|
+
* const cell1 = Cell.from({
|
|
251
|
+
* outPoint: { txHash: "0x...", index: 0 },
|
|
252
|
+
* cellOutput: {
|
|
253
|
+
* capacity: 1000n,
|
|
254
|
+
* lock: { codeHash: "0x...", hashType: "type", args: "0x..." }
|
|
255
|
+
* },
|
|
256
|
+
* outputData: "0x"
|
|
257
|
+
* });
|
|
258
|
+
*
|
|
259
|
+
* // Using previousOutput with automatic capacity calculation
|
|
260
|
+
* const cell2 = Cell.from({
|
|
261
|
+
* previousOutput: { txHash: "0x...", index: 0 },
|
|
262
|
+
* cellOutput: {
|
|
263
|
+
* lock: { codeHash: "0x...", hashType: "type", args: "0x..." }
|
|
264
|
+
* // capacity will be calculated automatically
|
|
265
|
+
* },
|
|
266
|
+
* outputData: "0x1234"
|
|
267
|
+
* });
|
|
268
|
+
* ```
|
|
252
269
|
*/
|
|
253
270
|
static from(cell) {
|
|
254
271
|
if (cell instanceof Cell) {
|
|
255
272
|
return cell;
|
|
256
273
|
}
|
|
257
|
-
return new Cell(OutPoint.from("outPoint" in cell ? cell.outPoint : cell.previousOutput), CellOutput.from(cell.cellOutput), (0, index_js_5.hexFrom)(cell.outputData));
|
|
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));
|
|
258
275
|
}
|
|
259
276
|
get capacityFree() {
|
|
260
277
|
const occupiedSize = (0, index_js_3.fixedPointFrom)(this.cellOutput.occupiedSize + (0, index_js_1.bytesFrom)(this.outputData).length);
|
|
@@ -733,6 +750,9 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
733
750
|
}
|
|
734
751
|
/**
|
|
735
752
|
* Copy every properties from another transaction.
|
|
753
|
+
* This method replaces all properties of the current transaction with those from the provided transaction.
|
|
754
|
+
*
|
|
755
|
+
* @param txLike - The transaction-like object to copy properties from.
|
|
736
756
|
*
|
|
737
757
|
* @example
|
|
738
758
|
* ```typescript
|
|
@@ -812,17 +832,7 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
812
832
|
if (tx instanceof Transaction_1) {
|
|
813
833
|
return tx;
|
|
814
834
|
}
|
|
815
|
-
const outputs = tx.outputs?.map((output, i) =>
|
|
816
|
-
const o = CellOutput.from({
|
|
817
|
-
...output,
|
|
818
|
-
capacity: output.capacity ?? 0,
|
|
819
|
-
});
|
|
820
|
-
if (o.capacity === index_js_3.Zero) {
|
|
821
|
-
o.capacity = (0, index_js_3.fixedPointFrom)(o.occupiedSize +
|
|
822
|
-
((0, index_js_8.apply)(index_js_1.bytesFrom, tx.outputsData?.[i])?.length ?? 0));
|
|
823
|
-
}
|
|
824
|
-
return o;
|
|
825
|
-
}) ?? [];
|
|
835
|
+
const outputs = tx.outputs?.map((output, i) => CellOutput.from(output, tx.outputsData?.[i] ?? [])) ?? [];
|
|
826
836
|
const outputsData = outputs.map((_, i) => (0, index_js_5.hexFrom)(tx.outputsData?.[i] ?? "0x"));
|
|
827
837
|
if (tx.outputsData != null && outputsData.length < tx.outputsData.length) {
|
|
828
838
|
outputsData.push(...tx.outputsData.slice(outputsData.length).map((d) => (0, index_js_5.hexFrom)(d)));
|
|
@@ -1005,7 +1015,7 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
1005
1015
|
*
|
|
1006
1016
|
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
1007
1017
|
* @param client - The client for complete extra infos in the transaction.
|
|
1008
|
-
* @returns A promise that resolves to the
|
|
1018
|
+
* @returns A promise that resolves to the found index, or undefined if no matching input is found.
|
|
1009
1019
|
*
|
|
1010
1020
|
* @example
|
|
1011
1021
|
* ```typescript
|
|
@@ -1026,7 +1036,7 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
1026
1036
|
*
|
|
1027
1037
|
* @param scriptLike - The script associated with the transaction, represented as a ScriptLike object.
|
|
1028
1038
|
* @param client - The client for complete extra infos in the transaction.
|
|
1029
|
-
* @returns A promise that resolves to the
|
|
1039
|
+
* @returns A promise that resolves to the found index, or undefined if no matching input is found.
|
|
1030
1040
|
*
|
|
1031
1041
|
* @example
|
|
1032
1042
|
* ```typescript
|
|
@@ -1114,18 +1124,18 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
1114
1124
|
* Set output data at index.
|
|
1115
1125
|
*
|
|
1116
1126
|
* @param index - The index of the output data.
|
|
1117
|
-
* @param
|
|
1127
|
+
* @param data - The data to set.
|
|
1118
1128
|
*
|
|
1119
1129
|
* @example
|
|
1120
1130
|
* ```typescript
|
|
1121
|
-
*
|
|
1131
|
+
* tx.setOutputDataAt(0, "0x00");
|
|
1122
1132
|
* ```
|
|
1123
1133
|
*/
|
|
1124
|
-
setOutputDataAt(index,
|
|
1134
|
+
setOutputDataAt(index, data) {
|
|
1125
1135
|
if (this.outputsData.length < index) {
|
|
1126
1136
|
this.outputsData.push(...Array.from(new Array(index - this.outputsData.length), () => "0x"));
|
|
1127
1137
|
}
|
|
1128
|
-
this.outputsData[index] = (0, index_js_5.hexFrom)(
|
|
1138
|
+
this.outputsData[index] = (0, index_js_5.hexFrom)(data);
|
|
1129
1139
|
}
|
|
1130
1140
|
/**
|
|
1131
1141
|
* get input
|
|
@@ -1188,14 +1198,7 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
1188
1198
|
* ```
|
|
1189
1199
|
*/
|
|
1190
1200
|
addOutput(outputLike, outputData = "0x") {
|
|
1191
|
-
const
|
|
1192
|
-
...outputLike,
|
|
1193
|
-
capacity: outputLike.capacity ?? 0,
|
|
1194
|
-
});
|
|
1195
|
-
if (output.capacity === index_js_3.Zero) {
|
|
1196
|
-
output.capacity = (0, index_js_3.fixedPointFrom)(output.occupiedSize + (0, index_js_1.bytesFrom)(outputData).length);
|
|
1197
|
-
}
|
|
1198
|
-
const len = this.outputs.push(output);
|
|
1201
|
+
const len = this.outputs.push(CellOutput.from(outputLike, outputData));
|
|
1199
1202
|
this.setOutputDataAt(len - 1, outputData);
|
|
1200
1203
|
return len;
|
|
1201
1204
|
}
|
|
@@ -1467,18 +1470,20 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
1467
1470
|
await this.getInputsCapacity(from.client);
|
|
1468
1471
|
let leastFee = index_js_3.Zero;
|
|
1469
1472
|
let leastExtraCapacity = index_js_3.Zero;
|
|
1473
|
+
let collected = 0;
|
|
1474
|
+
// ===
|
|
1475
|
+
// Usually, for the worst situation, three iterations are needed
|
|
1476
|
+
// 1. First attempt to complete the transaction.
|
|
1477
|
+
// 2. Not enough capacity for the change cell.
|
|
1478
|
+
// 3. Fee increased by the change cell.
|
|
1479
|
+
// ===
|
|
1470
1480
|
while (true) {
|
|
1471
|
-
|
|
1472
|
-
const collected = await (async () => {
|
|
1481
|
+
collected += await (async () => {
|
|
1473
1482
|
if (!(options?.shouldAddInputs ?? true)) {
|
|
1474
|
-
const fee = (await tx.getFee(from.client)) - leastFee - leastExtraCapacity;
|
|
1475
|
-
if (fee < index_js_3.Zero) {
|
|
1476
|
-
throw new transactionErrors_js_1.ErrorTransactionInsufficientCapacity(-fee);
|
|
1477
|
-
}
|
|
1478
1483
|
return 0;
|
|
1479
1484
|
}
|
|
1480
1485
|
try {
|
|
1481
|
-
return await
|
|
1486
|
+
return await this.completeInputsByCapacity(from, leastFee + leastExtraCapacity, filter);
|
|
1482
1487
|
}
|
|
1483
1488
|
catch (err) {
|
|
1484
1489
|
if (err instanceof transactionErrors_js_1.ErrorTransactionInsufficientCapacity &&
|
|
@@ -1490,20 +1495,28 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
1490
1495
|
throw err;
|
|
1491
1496
|
}
|
|
1492
1497
|
})();
|
|
1493
|
-
await from.
|
|
1498
|
+
const fee = await this.getFee(from.client);
|
|
1499
|
+
if (fee < leastFee + leastExtraCapacity) {
|
|
1500
|
+
// Not enough capacity are collected, it should only happens when shouldAddInputs is false
|
|
1501
|
+
throw new transactionErrors_js_1.ErrorTransactionInsufficientCapacity(leastFee + leastExtraCapacity - fee, { isForChange: leastExtraCapacity !== index_js_3.Zero });
|
|
1502
|
+
}
|
|
1503
|
+
await from.prepareTransaction(this);
|
|
1494
1504
|
if (leastFee === index_js_3.Zero) {
|
|
1495
1505
|
// The initial fee is calculated based on prepared transaction
|
|
1496
|
-
|
|
1506
|
+
// This should only happens during the first iteration
|
|
1507
|
+
leastFee = this.estimateFee(feeRate);
|
|
1497
1508
|
}
|
|
1498
|
-
const fee = await tx.getFee(from.client);
|
|
1499
1509
|
// The extra capacity paid the fee without a change
|
|
1510
|
+
// leastExtraCapacity should be 0 here, otherwise we should failed in the previous check
|
|
1511
|
+
// So this only happens in the first iteration
|
|
1500
1512
|
if (fee === leastFee) {
|
|
1501
|
-
this.copy(tx);
|
|
1502
1513
|
return [collected, false];
|
|
1503
1514
|
}
|
|
1515
|
+
// Invoke the change function on a transaction multiple times may cause problems, so we clone it
|
|
1516
|
+
const tx = this.clone();
|
|
1504
1517
|
const needed = (0, index_js_7.numFrom)(await Promise.resolve(change(tx, fee - leastFee)));
|
|
1505
|
-
// No enough extra capacity to create new cells for change
|
|
1506
1518
|
if (needed > index_js_3.Zero) {
|
|
1519
|
+
// No enough extra capacity to create new cells for change, collect inputs again
|
|
1507
1520
|
leastExtraCapacity = needed;
|
|
1508
1521
|
continue;
|
|
1509
1522
|
}
|
|
@@ -1525,6 +1538,38 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
1525
1538
|
leastFee = changedFee;
|
|
1526
1539
|
}
|
|
1527
1540
|
}
|
|
1541
|
+
/**
|
|
1542
|
+
* Completes the transaction fee by adding inputs and creating a change output with the specified lock script.
|
|
1543
|
+
* This is a convenience method that automatically creates a change cell with the provided lock script
|
|
1544
|
+
* when there's excess capacity after paying the transaction fee.
|
|
1545
|
+
*
|
|
1546
|
+
* @param from - The signer to complete inputs from and prepare the transaction.
|
|
1547
|
+
* @param change - The lock script for the change output cell.
|
|
1548
|
+
* @param feeRate - Optional fee rate in shannons per 1000 bytes. If not provided, it will be fetched from the client.
|
|
1549
|
+
* @param filter - Optional filter for selecting cells when adding inputs.
|
|
1550
|
+
* @param options - Optional configuration object.
|
|
1551
|
+
* @param options.feeRateBlockRange - Block range for fee rate calculation when feeRate is not provided.
|
|
1552
|
+
* @param options.maxFeeRate - Maximum allowed fee rate.
|
|
1553
|
+
* @param options.shouldAddInputs - Whether to add inputs automatically. Defaults to true.
|
|
1554
|
+
* @returns A promise that resolves to a tuple containing:
|
|
1555
|
+
* - The number of inputs added during the process
|
|
1556
|
+
* - A boolean indicating whether change outputs were created (true) or fee was paid without change (false)
|
|
1557
|
+
*
|
|
1558
|
+
* @example
|
|
1559
|
+
* ```typescript
|
|
1560
|
+
* const changeScript = Script.from({
|
|
1561
|
+
* codeHash: "0x...",
|
|
1562
|
+
* hashType: "type",
|
|
1563
|
+
* args: "0x..."
|
|
1564
|
+
* });
|
|
1565
|
+
*
|
|
1566
|
+
* const [addedInputs, hasChange] = await tx.completeFeeChangeToLock(
|
|
1567
|
+
* signer,
|
|
1568
|
+
* changeScript,
|
|
1569
|
+
* 1000n // 1000 shannons per 1000 bytes
|
|
1570
|
+
* );
|
|
1571
|
+
* ```
|
|
1572
|
+
*/
|
|
1528
1573
|
completeFeeChangeToLock(from, change, feeRate, filter, options) {
|
|
1529
1574
|
const script = script_js_1.Script.from(change);
|
|
1530
1575
|
return this.completeFee(from, (tx, capacity) => {
|
|
@@ -1538,10 +1583,66 @@ let Transaction = Transaction_1 = class Transaction extends index_js_6.mol.Entit
|
|
|
1538
1583
|
return 0;
|
|
1539
1584
|
}, feeRate, filter, options);
|
|
1540
1585
|
}
|
|
1586
|
+
/**
|
|
1587
|
+
* Completes the transaction fee using the signer's recommended address for change.
|
|
1588
|
+
* This is a convenience method that automatically uses the signer's recommended
|
|
1589
|
+
* address as the change destination, making it easier to complete transactions
|
|
1590
|
+
* without manually specifying a change address.
|
|
1591
|
+
*
|
|
1592
|
+
* @param from - The signer to complete inputs from and prepare the transaction.
|
|
1593
|
+
* @param feeRate - Optional fee rate in shannons per 1000 bytes. If not provided, it will be fetched from the client.
|
|
1594
|
+
* @param filter - Optional filter for selecting cells when adding inputs.
|
|
1595
|
+
* @param options - Optional configuration object.
|
|
1596
|
+
* @param options.feeRateBlockRange - Block range for fee rate calculation when feeRate is not provided.
|
|
1597
|
+
* @param options.maxFeeRate - Maximum allowed fee rate.
|
|
1598
|
+
* @param options.shouldAddInputs - Whether to add inputs automatically. Defaults to true.
|
|
1599
|
+
* @returns A promise that resolves to a tuple containing:
|
|
1600
|
+
* - The number of inputs added during the process
|
|
1601
|
+
* - A boolean indicating whether change outputs were created (true) or fee was paid without change (false)
|
|
1602
|
+
*
|
|
1603
|
+
* @example
|
|
1604
|
+
* ```typescript
|
|
1605
|
+
* const [addedInputs, hasChange] = await tx.completeFeeBy(
|
|
1606
|
+
* signer,
|
|
1607
|
+
* 1000n // 1000 shannons per 1000 bytes
|
|
1608
|
+
* );
|
|
1609
|
+
*
|
|
1610
|
+
* // Change will automatically go to signer's recommended address
|
|
1611
|
+
* ```
|
|
1612
|
+
*/
|
|
1541
1613
|
async completeFeeBy(from, feeRate, filter, options) {
|
|
1542
1614
|
const { script } = await from.getRecommendedAddressObj();
|
|
1543
1615
|
return this.completeFeeChangeToLock(from, script, feeRate, filter, options);
|
|
1544
1616
|
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Completes the transaction fee by adding excess capacity to an existing output.
|
|
1619
|
+
* Instead of creating a new change output, this method adds any excess capacity
|
|
1620
|
+
* to the specified existing output in the transaction.
|
|
1621
|
+
*
|
|
1622
|
+
* @param from - The signer to complete inputs from and prepare the transaction.
|
|
1623
|
+
* @param index - The index of the existing output to add excess capacity to.
|
|
1624
|
+
* @param feeRate - Optional fee rate in shannons per 1000 bytes. If not provided, it will be fetched from the client.
|
|
1625
|
+
* @param filter - Optional filter for selecting cells when adding inputs.
|
|
1626
|
+
* @param options - Optional configuration object.
|
|
1627
|
+
* @param options.feeRateBlockRange - Block range for fee rate calculation when feeRate is not provided.
|
|
1628
|
+
* @param options.maxFeeRate - Maximum allowed fee rate.
|
|
1629
|
+
* @param options.shouldAddInputs - Whether to add inputs automatically. Defaults to true.
|
|
1630
|
+
* @returns A promise that resolves to a tuple containing:
|
|
1631
|
+
* - The number of inputs added during the process
|
|
1632
|
+
* - A boolean indicating whether change was applied (true) or fee was paid without change (false)
|
|
1633
|
+
*
|
|
1634
|
+
* @throws {Error} When the specified output index doesn't exist.
|
|
1635
|
+
*
|
|
1636
|
+
* @example
|
|
1637
|
+
* ```typescript
|
|
1638
|
+
* // Add excess capacity to the first output (index 0)
|
|
1639
|
+
* const [addedInputs, hasChange] = await tx.completeFeeChangeToOutput(
|
|
1640
|
+
* signer,
|
|
1641
|
+
* 0, // Output index
|
|
1642
|
+
* 1000n // 1000 shannons per 1000 bytes
|
|
1643
|
+
* );
|
|
1644
|
+
* ```
|
|
1645
|
+
*/
|
|
1545
1646
|
completeFeeChangeToOutput(from, index, feeRate, filter, options) {
|
|
1546
1647
|
const change = Number((0, index_js_7.numFrom)(index));
|
|
1547
1648
|
if (!this.outputs[change]) {
|
|
@@ -1570,7 +1671,26 @@ exports.Transaction = Transaction = Transaction_1 = __decorate([
|
|
|
1570
1671
|
.mapOut((tx) => Transaction.from({ ...tx.raw, witnesses: tx.witnesses })))
|
|
1571
1672
|
], Transaction);
|
|
1572
1673
|
/**
|
|
1573
|
-
* Calculate Nervos DAO profit between two blocks
|
|
1674
|
+
* Calculate Nervos DAO profit between two blocks.
|
|
1675
|
+
* This function computes the profit earned from a Nervos DAO deposit
|
|
1676
|
+
* based on the capacity and the time period between deposit and withdrawal.
|
|
1677
|
+
*
|
|
1678
|
+
* @param profitableCapacity - The capacity that earns profit (total capacity minus occupied capacity).
|
|
1679
|
+
* @param depositHeaderLike - The block header when the DAO deposit was made.
|
|
1680
|
+
* @param withdrawHeaderLike - The block header when the DAO withdrawal is made.
|
|
1681
|
+
* @returns The profit amount in CKB (capacity units).
|
|
1682
|
+
*
|
|
1683
|
+
* @example
|
|
1684
|
+
* ```typescript
|
|
1685
|
+
* const profit = calcDaoProfit(
|
|
1686
|
+
* ccc.fixedPointFrom(100), // 100 CKB profitable capacity
|
|
1687
|
+
* depositHeader,
|
|
1688
|
+
* withdrawHeader
|
|
1689
|
+
* );
|
|
1690
|
+
* console.log(`Profit: ${profit} shannons`);
|
|
1691
|
+
* ```
|
|
1692
|
+
*
|
|
1693
|
+
* @see {@link https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0023-dao-deposit-withdraw/0023-dao-deposit-withdraw.md | Nervos DAO RFC}
|
|
1574
1694
|
*/
|
|
1575
1695
|
function calcDaoProfit(profitableCapacity, depositHeaderLike, withdrawHeaderLike) {
|
|
1576
1696
|
const depositHeader = index_js_2.ClientBlockHeader.from(depositHeaderLike);
|
|
@@ -1580,8 +1700,26 @@ function calcDaoProfit(profitableCapacity, depositHeaderLike, withdrawHeaderLike
|
|
|
1580
1700
|
profitableSize);
|
|
1581
1701
|
}
|
|
1582
1702
|
/**
|
|
1583
|
-
* Calculate claimable epoch for Nervos DAO withdrawal
|
|
1584
|
-
*
|
|
1703
|
+
* Calculate claimable epoch for Nervos DAO withdrawal.
|
|
1704
|
+
* This function determines the earliest epoch when a Nervos DAO withdrawal
|
|
1705
|
+
* can be claimed based on the deposit and withdrawal epochs.
|
|
1706
|
+
*
|
|
1707
|
+
* @param depositHeader - The block header when the DAO deposit was made.
|
|
1708
|
+
* @param withdrawHeader - The block header when the DAO withdrawal was initiated.
|
|
1709
|
+
* @returns The epoch when the withdrawal can be claimed, represented as [number, index, length].
|
|
1710
|
+
*
|
|
1711
|
+
* @example
|
|
1712
|
+
* ```typescript
|
|
1713
|
+
* const claimEpoch = calcDaoClaimEpoch(depositHeader, withdrawHeader);
|
|
1714
|
+
* console.log(`Can claim at epoch: ${claimEpoch[0]}, index: ${claimEpoch[1]}, length: ${claimEpoch[2]}`);
|
|
1715
|
+
* ```
|
|
1716
|
+
*
|
|
1717
|
+
* @remarks
|
|
1718
|
+
* The Nervos DAO has a minimum lock period of 180 epochs (~30 days).
|
|
1719
|
+
* This function calculates the exact epoch when the withdrawal becomes claimable
|
|
1720
|
+
* based on the deposit epoch and withdrawal epoch timing.
|
|
1721
|
+
*
|
|
1722
|
+
* @see {@link https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0023-dao-deposit-withdraw/0023-dao-deposit-withdraw.md | Nervos DAO RFC}
|
|
1585
1723
|
*/
|
|
1586
1724
|
function calcDaoClaimEpoch(depositHeader, withdrawHeader) {
|
|
1587
1725
|
const depositEpoch = index_js_2.ClientBlockHeader.from(depositHeader).epoch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientPublicMainnet.advanced.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicMainnet.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"clientPublicMainnet.advanced.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicMainnet.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,GAAG,SAAS,CAkYxE,CAAC"}
|
|
@@ -341,64 +341,4 @@ exports.MAINNET_SCRIPTS = Object.freeze({
|
|
|
341
341
|
},
|
|
342
342
|
],
|
|
343
343
|
},
|
|
344
|
-
[knownScript_js_1.KnownScript.RgbppLock]: {
|
|
345
|
-
codeHash: "0xbc6c568a1a0d0a09f6844dc9d74ddb4343c32143ff25f727c59edf4fb72d6936",
|
|
346
|
-
hashType: "type",
|
|
347
|
-
cellDeps: [
|
|
348
|
-
{
|
|
349
|
-
cellDep: {
|
|
350
|
-
outPoint: {
|
|
351
|
-
txHash: "0x04c5c3e69f1aa6ee27fb9de3d15a81704e387ab3b453965adbe0b6ca343c6f41",
|
|
352
|
-
index: 0,
|
|
353
|
-
},
|
|
354
|
-
depType: "code",
|
|
355
|
-
},
|
|
356
|
-
type: {
|
|
357
|
-
codeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944",
|
|
358
|
-
hashType: "type",
|
|
359
|
-
args: "0x68ad3d9e0bb9ea841a5d1fcd600137bd3f45401e759e353121f26cd0d981452f",
|
|
360
|
-
},
|
|
361
|
-
},
|
|
362
|
-
// Rgbpp lock config cell dep
|
|
363
|
-
{
|
|
364
|
-
cellDep: {
|
|
365
|
-
outPoint: {
|
|
366
|
-
txHash: "0x04c5c3e69f1aa6ee27fb9de3d15a81704e387ab3b453965adbe0b6ca343c6f41",
|
|
367
|
-
index: 1,
|
|
368
|
-
},
|
|
369
|
-
depType: "code",
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
],
|
|
373
|
-
},
|
|
374
|
-
[knownScript_js_1.KnownScript.BtcTimeLock]: {
|
|
375
|
-
codeHash: "0x70d64497a075bd651e98ac030455ea200637ee325a12ad08aff03f1a117e5a62",
|
|
376
|
-
hashType: "type",
|
|
377
|
-
cellDeps: [
|
|
378
|
-
{
|
|
379
|
-
cellDep: {
|
|
380
|
-
outPoint: {
|
|
381
|
-
txHash: "0x6257bf4297ee75fcebe2654d8c5f8d93bc9fc1b3dc62b8cef54ffe166162e996",
|
|
382
|
-
index: 0,
|
|
383
|
-
},
|
|
384
|
-
depType: "code",
|
|
385
|
-
},
|
|
386
|
-
type: {
|
|
387
|
-
codeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944",
|
|
388
|
-
hashType: "type",
|
|
389
|
-
args: "0x44b8253ae18e913a2845b0d548eaf6b3ba1099ed26835888932a754194028a8a",
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
|
-
// btc time lock config cell dep
|
|
393
|
-
{
|
|
394
|
-
cellDep: {
|
|
395
|
-
outPoint: {
|
|
396
|
-
txHash: "0x6257bf4297ee75fcebe2654d8c5f8d93bc9fc1b3dc62b8cef54ffe166162e996",
|
|
397
|
-
index: 1,
|
|
398
|
-
},
|
|
399
|
-
depType: "code",
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
],
|
|
403
|
-
},
|
|
404
344
|
});
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
import { ScriptInfoLike } from "./clientTypes.js";
|
|
2
2
|
import { KnownScript } from "./knownScript.js";
|
|
3
3
|
export declare const TESTNET_SCRIPTS: Record<KnownScript, ScriptInfoLike>;
|
|
4
|
-
/**
|
|
5
|
-
* Bitcoin Signet specific script overrides for testnet
|
|
6
|
-
*
|
|
7
|
-
* Contains script configurations that differ when using Bitcoin Signet
|
|
8
|
-
* instead of Bitcoin Testnet3. Only RgbppLock and BtcTimeLock are affected.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import { ClientPublicTestnet } from "@ckb-ccc/core";
|
|
13
|
-
* import { TESTNET_SCRIPTS, TESTNET_SCRIPTS_BTC_SIGNET_OVERRIDES } from "@ckb-ccc/core/advanced";
|
|
14
|
-
*
|
|
15
|
-
* // Use Bitcoin Testnet3 scripts (default)
|
|
16
|
-
* const testnet3Client = new ClientPublicTestnet();
|
|
17
|
-
*
|
|
18
|
-
* // Use Bitcoin Signet scripts by merging overrides
|
|
19
|
-
* const signetClient = new ClientPublicTestnet({
|
|
20
|
-
* scripts: {
|
|
21
|
-
* ...TESTNET_SCRIPTS,
|
|
22
|
-
* ...TESTNET_SCRIPTS_BTC_SIGNET_OVERRIDES
|
|
23
|
-
* }
|
|
24
|
-
* });
|
|
25
|
-
*/
|
|
26
|
-
export declare const TESTNET_SCRIPTS_BTC_SIGNET_OVERRIDES: Partial<Record<KnownScript, ScriptInfoLike>>;
|
|
27
4
|
//# sourceMappingURL=clientPublicTestnet.advanced.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientPublicTestnet.advanced.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicTestnet.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"clientPublicTestnet.advanced.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicTestnet.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,CA8Y5D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TESTNET_SCRIPTS = void 0;
|
|
4
4
|
const knownScript_js_1 = require("./knownScript.js");
|
|
5
5
|
exports.TESTNET_SCRIPTS = Object.freeze({
|
|
6
6
|
[knownScript_js_1.KnownScript.NervosDao]: {
|
|
@@ -351,148 +351,4 @@ exports.TESTNET_SCRIPTS = Object.freeze({
|
|
|
351
351
|
},
|
|
352
352
|
],
|
|
353
353
|
},
|
|
354
|
-
[knownScript_js_1.KnownScript.RgbppLock]: {
|
|
355
|
-
codeHash: "0x61ca7a4796a4eb19ca4f0d065cb9b10ddcf002f10f7cbb810c706cb6bb5c3248",
|
|
356
|
-
hashType: "type",
|
|
357
|
-
cellDeps: [
|
|
358
|
-
{
|
|
359
|
-
cellDep: {
|
|
360
|
-
outPoint: {
|
|
361
|
-
txHash: "0xf1de59e973b85791ec32debbba08dff80c63197e895eb95d67fc1e9f6b413e00",
|
|
362
|
-
index: 0,
|
|
363
|
-
},
|
|
364
|
-
depType: "code",
|
|
365
|
-
},
|
|
366
|
-
type: {
|
|
367
|
-
codeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944",
|
|
368
|
-
hashType: "type",
|
|
369
|
-
args: "0xa3bc8441df149def76cfe15fec7b1e51d949548bc27fb7a75e9d4b3ef1c12c7f",
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
// Rgbpp lock config cell dep for Bitcoin Testnet3
|
|
373
|
-
{
|
|
374
|
-
cellDep: {
|
|
375
|
-
outPoint: {
|
|
376
|
-
txHash: "0xf1de59e973b85791ec32debbba08dff80c63197e895eb95d67fc1e9f6b413e00",
|
|
377
|
-
index: 1,
|
|
378
|
-
},
|
|
379
|
-
depType: "code",
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
],
|
|
383
|
-
},
|
|
384
|
-
[knownScript_js_1.KnownScript.BtcTimeLock]: {
|
|
385
|
-
codeHash: "0x00cdf8fab0f8ac638758ebf5ea5e4052b1d71e8a77b9f43139718621f6849326",
|
|
386
|
-
hashType: "type",
|
|
387
|
-
cellDeps: [
|
|
388
|
-
{
|
|
389
|
-
cellDep: {
|
|
390
|
-
outPoint: {
|
|
391
|
-
txHash: "0xde0f87878a97500f549418e5d46d2f7704c565a262aa17036c9c1c13ad638529",
|
|
392
|
-
index: 0,
|
|
393
|
-
},
|
|
394
|
-
depType: "code",
|
|
395
|
-
},
|
|
396
|
-
type: {
|
|
397
|
-
codeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944",
|
|
398
|
-
hashType: "type",
|
|
399
|
-
args: "0xc9828585e6dd2afacb9e6e8ca7deb0975121aabee5c7983178a45509ffaec984",
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
// btc time lock config cell dep for Bitcoin Testnet3
|
|
403
|
-
{
|
|
404
|
-
cellDep: {
|
|
405
|
-
outPoint: {
|
|
406
|
-
txHash: "0xde0f87878a97500f549418e5d46d2f7704c565a262aa17036c9c1c13ad638529",
|
|
407
|
-
index: 1,
|
|
408
|
-
},
|
|
409
|
-
depType: "code",
|
|
410
|
-
},
|
|
411
|
-
},
|
|
412
|
-
],
|
|
413
|
-
},
|
|
414
|
-
});
|
|
415
|
-
/**
|
|
416
|
-
* Bitcoin Signet specific script overrides for testnet
|
|
417
|
-
*
|
|
418
|
-
* Contains script configurations that differ when using Bitcoin Signet
|
|
419
|
-
* instead of Bitcoin Testnet3. Only RgbppLock and BtcTimeLock are affected.
|
|
420
|
-
*
|
|
421
|
-
* @example
|
|
422
|
-
* ```typescript
|
|
423
|
-
* import { ClientPublicTestnet } from "@ckb-ccc/core";
|
|
424
|
-
* import { TESTNET_SCRIPTS, TESTNET_SCRIPTS_BTC_SIGNET_OVERRIDES } from "@ckb-ccc/core/advanced";
|
|
425
|
-
*
|
|
426
|
-
* // Use Bitcoin Testnet3 scripts (default)
|
|
427
|
-
* const testnet3Client = new ClientPublicTestnet();
|
|
428
|
-
*
|
|
429
|
-
* // Use Bitcoin Signet scripts by merging overrides
|
|
430
|
-
* const signetClient = new ClientPublicTestnet({
|
|
431
|
-
* scripts: {
|
|
432
|
-
* ...TESTNET_SCRIPTS,
|
|
433
|
-
* ...TESTNET_SCRIPTS_BTC_SIGNET_OVERRIDES
|
|
434
|
-
* }
|
|
435
|
-
* });
|
|
436
|
-
*/
|
|
437
|
-
exports.TESTNET_SCRIPTS_BTC_SIGNET_OVERRIDES = Object.freeze({
|
|
438
|
-
[knownScript_js_1.KnownScript.RgbppLock]: {
|
|
439
|
-
codeHash: "0xd07598deec7ce7b5665310386b4abd06a6d48843e953c5cc2112ad0d5a220364",
|
|
440
|
-
hashType: "type",
|
|
441
|
-
cellDeps: [
|
|
442
|
-
{
|
|
443
|
-
cellDep: {
|
|
444
|
-
outPoint: {
|
|
445
|
-
txHash: "0x61efdeddbaa0bb4132c0eb174b3e8002ff5ec430f61ba46f30768d683c516eec",
|
|
446
|
-
index: 0,
|
|
447
|
-
},
|
|
448
|
-
depType: "code",
|
|
449
|
-
},
|
|
450
|
-
type: {
|
|
451
|
-
codeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944",
|
|
452
|
-
hashType: "type",
|
|
453
|
-
args: "0xb69fe766ce3b7014a2a78ad1fe688d82f1679325805371d2856c3b8d18ebfa5a",
|
|
454
|
-
},
|
|
455
|
-
},
|
|
456
|
-
// Rgbpp lock config cell dep for Bitcoin Signet
|
|
457
|
-
{
|
|
458
|
-
cellDep: {
|
|
459
|
-
outPoint: {
|
|
460
|
-
txHash: "0x61efdeddbaa0bb4132c0eb174b3e8002ff5ec430f61ba46f30768d683c516eec",
|
|
461
|
-
index: 1,
|
|
462
|
-
},
|
|
463
|
-
depType: "code",
|
|
464
|
-
},
|
|
465
|
-
},
|
|
466
|
-
],
|
|
467
|
-
},
|
|
468
|
-
[knownScript_js_1.KnownScript.BtcTimeLock]: {
|
|
469
|
-
codeHash: "0x80a09eca26d77cea1f5a69471c59481be7404febf40ee90f886c36a948385b55",
|
|
470
|
-
hashType: "type",
|
|
471
|
-
cellDeps: [
|
|
472
|
-
{
|
|
473
|
-
cellDep: {
|
|
474
|
-
outPoint: {
|
|
475
|
-
txHash: "0x5364b3535965e9eac9a35dd7af8e9e45a61d30a16e115923c032f80b28783e21",
|
|
476
|
-
index: 0,
|
|
477
|
-
},
|
|
478
|
-
depType: "code",
|
|
479
|
-
},
|
|
480
|
-
type: {
|
|
481
|
-
codeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944",
|
|
482
|
-
hashType: "type",
|
|
483
|
-
args: "0x32fc8c70a6451a1439fd91e214bba093f9cdd9276bc4ab223430dab5940aff92",
|
|
484
|
-
},
|
|
485
|
-
},
|
|
486
|
-
// btc time lock config cell dep for Bitcoin Signet
|
|
487
|
-
{
|
|
488
|
-
cellDep: {
|
|
489
|
-
outPoint: {
|
|
490
|
-
txHash: "0x5364b3535965e9eac9a35dd7af8e9e45a61d30a16e115923c032f80b28783e21",
|
|
491
|
-
index: 1,
|
|
492
|
-
},
|
|
493
|
-
depType: "code",
|
|
494
|
-
},
|
|
495
|
-
},
|
|
496
|
-
],
|
|
497
|
-
},
|
|
498
354
|
});
|
|
@@ -22,8 +22,6 @@ export declare enum KnownScript {
|
|
|
22
22
|
SingleUseLock = "SingleUseLock",
|
|
23
23
|
TypeBurnLock = "TypeBurnLock",
|
|
24
24
|
EasyToDiscoverType = "EasyToDiscoverType",
|
|
25
|
-
TimeLock = "TimeLock"
|
|
26
|
-
RgbppLock = "RgbppLock",
|
|
27
|
-
BtcTimeLock = "BtcTimeLock"
|
|
25
|
+
TimeLock = "TimeLock"
|
|
28
26
|
}
|
|
29
27
|
//# sourceMappingURL=knownScript.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knownScript.d.ts","sourceRoot":"","sources":["../../src/client/knownScript.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACrB,SAAS,cAAc;IACvB,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB,CAAE,wFAAwF;IACrI,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,UAAU,eAAe;IAGzB,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,kBAAkB,uBAAuB;IACzC,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"knownScript.d.ts","sourceRoot":"","sources":["../../src/client/knownScript.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACrB,SAAS,cAAc;IACvB,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB,CAAE,wFAAwF;IACrI,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,UAAU,eAAe;IAGzB,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,kBAAkB,uBAAuB;IACzC,QAAQ,aAAa;CACtB"}
|
|
@@ -28,8 +28,4 @@ var KnownScript;
|
|
|
28
28
|
KnownScript["TypeBurnLock"] = "TypeBurnLock";
|
|
29
29
|
KnownScript["EasyToDiscoverType"] = "EasyToDiscoverType";
|
|
30
30
|
KnownScript["TimeLock"] = "TimeLock";
|
|
31
|
-
// RGB++ related scripts (default using Bitcoin Testnet3)
|
|
32
|
-
// For Bitcoin Signet, use TESTNET_SCRIPTS_BTC_SIGNET_OVERRIDES from @ckb-ccc/core/advanced
|
|
33
|
-
KnownScript["RgbppLock"] = "RgbppLock";
|
|
34
|
-
KnownScript["BtcTimeLock"] = "BtcTimeLock";
|
|
35
31
|
})(KnownScript || (exports.KnownScript = KnownScript = {}));
|