@ickb/sdk 1000.0.81 → 9000.0.1
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/README.md +81 -32
- package/dist/constants.d.ts +13 -22
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +80 -76
- package/dist/constants.js.map +1 -1
- package/dist/conversion/estimate.d.ts +39 -0
- package/dist/conversion/estimate.d.ts.map +1 -0
- package/dist/conversion/estimate.js +117 -0
- package/dist/conversion/estimate.js.map +1 -0
- package/dist/conversion/maturity.d.ts +15 -0
- package/dist/conversion/maturity.d.ts.map +1 -0
- package/dist/conversion/maturity.js +112 -0
- package/dist/conversion/maturity.js.map +1 -0
- package/dist/conversion/plans.d.ts +20 -0
- package/dist/conversion/plans.d.ts.map +1 -0
- package/dist/conversion/plans.js +106 -0
- package/dist/conversion/plans.js.map +1 -0
- package/dist/conversion/projection.d.ts +22 -0
- package/dist/conversion/projection.d.ts.map +1 -0
- package/dist/conversion/projection.js +91 -0
- package/dist/conversion/projection.js.map +1 -0
- package/dist/conversion/types.d.ts +252 -0
- package/dist/conversion/types.d.ts.map +1 -0
- package/dist/conversion/types.js +2 -0
- package/dist/conversion/types.js.map +1 -0
- package/dist/conversion/withdrawal_ring.d.ts +36 -0
- package/dist/conversion/withdrawal_ring.d.ts.map +1 -0
- package/dist/conversion/withdrawal_ring.js +87 -0
- package/dist/conversion/withdrawal_ring.js.map +1 -0
- package/dist/dao.d.ts +86 -0
- package/dist/dao.d.ts.map +1 -0
- package/dist/dao.js +113 -0
- package/dist/dao.js.map +1 -0
- package/dist/index.d.ts +51 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/logic.d.ts +85 -0
- package/dist/logic.d.ts.map +1 -0
- package/dist/logic.js +184 -0
- package/dist/logic.js.map +1 -0
- package/dist/order/cells.d.ts +207 -0
- package/dist/order/cells.d.ts.map +1 -0
- package/dist/order/cells.js +427 -0
- package/dist/order/cells.js.map +1 -0
- package/dist/order/conversion.d.ts +43 -0
- package/dist/order/conversion.d.ts.map +1 -0
- package/dist/order/conversion.js +123 -0
- package/dist/order/conversion.js.map +1 -0
- package/dist/order/fee.d.ts +9 -0
- package/dist/order/fee.d.ts.map +1 -0
- package/dist/order/fee.js +24 -0
- package/dist/order/fee.js.map +1 -0
- package/dist/order/fill.d.ts +36 -0
- package/dist/order/fill.d.ts.map +1 -0
- package/dist/order/fill.js +53 -0
- package/dist/order/fill.js.map +1 -0
- package/dist/order/info.d.ts +62 -0
- package/dist/order/info.d.ts.map +1 -0
- package/dist/order/info.js +99 -0
- package/dist/order/info.js.map +1 -0
- package/dist/order/master.d.ts +49 -0
- package/dist/order/master.d.ts.map +1 -0
- package/dist/order/master.js +27 -0
- package/dist/order/master.js.map +1 -0
- package/dist/order/matcher.d.ts +43 -0
- package/dist/order/matcher.d.ts.map +1 -0
- package/dist/order/matcher.js +123 -0
- package/dist/order/matcher.js.map +1 -0
- package/dist/order/order.d.ts +59 -0
- package/dist/order/order.d.ts.map +1 -0
- package/dist/order/order.js +239 -0
- package/dist/order/order.js.map +1 -0
- package/dist/order/order_data.d.ts +51 -0
- package/dist/order/order_data.d.ts.map +1 -0
- package/dist/order/order_data.js +64 -0
- package/dist/order/order_data.js.map +1 -0
- package/dist/order/ratio.d.ts +42 -0
- package/dist/order/ratio.d.ts.map +1 -0
- package/dist/order/ratio.js +82 -0
- package/dist/order/ratio.js.map +1 -0
- package/dist/order/relative.d.ts +43 -0
- package/dist/order/relative.d.ts.map +1 -0
- package/dist/order/relative.js +54 -0
- package/dist/order/relative.js.map +1 -0
- package/dist/owned_owner.d.ts +113 -0
- package/dist/owned_owner.d.ts.map +1 -0
- package/dist/owned_owner.js +280 -0
- package/dist/owned_owner.js.map +1 -0
- package/dist/sdk.d.ts +71 -42
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +388 -209
- package/dist/sdk.js.map +1 -1
- package/dist/send/sign_and_send_transaction.d.ts +46 -0
- package/dist/send/sign_and_send_transaction.d.ts.map +1 -0
- package/dist/send/sign_and_send_transaction.js +101 -0
- package/dist/send/sign_and_send_transaction.js.map +1 -0
- package/dist/send/wait_transaction.d.ts +41 -0
- package/dist/send/wait_transaction.d.ts.map +1 -0
- package/dist/send/wait_transaction.js +204 -0
- package/dist/send/wait_transaction.js.map +1 -0
- package/dist/udt.d.ts +123 -0
- package/dist/udt.d.ts.map +1 -0
- package/dist/udt.js +244 -0
- package/dist/udt.js.map +1 -0
- package/dist/utils/chain.d.ts +38 -0
- package/dist/utils/chain.d.ts.map +1 -0
- package/dist/utils/chain.js +20 -0
- package/dist/utils/chain.js.map +1 -0
- package/dist/utils/codec.d.ts +19 -0
- package/dist/utils/codec.d.ts.map +1 -0
- package/dist/utils/codec.js +66 -0
- package/dist/utils/codec.js.map +1 -0
- package/dist/utils/transaction_header.d.ts +17 -0
- package/dist/utils/transaction_header.d.ts.map +1 -0
- package/dist/utils/transaction_header.js +44 -0
- package/dist/utils/transaction_header.js.map +1 -0
- package/dist/utils/utils.d.ts +126 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +151 -0
- package/dist/utils/utils.js.map +1 -0
- package/package.json +19 -26
- package/src/constants.ts +84 -181
- package/src/conversion/estimate.ts +157 -0
- package/src/conversion/maturity.ts +159 -0
- package/src/conversion/plans.ts +144 -0
- package/src/conversion/projection.ts +128 -0
- package/src/conversion/types.ts +287 -0
- package/src/conversion/withdrawal_ring.ts +126 -0
- package/src/dao.ts +172 -0
- package/src/index.ts +89 -3
- package/src/logic.ts +295 -0
- package/src/order/cells.ts +520 -0
- package/src/order/conversion.ts +173 -0
- package/src/order/fee.ts +30 -0
- package/src/order/fill.ts +83 -0
- package/src/order/info.ts +178 -0
- package/src/order/master.ts +42 -0
- package/src/order/matcher.ts +191 -0
- package/src/order/order.ts +302 -0
- package/src/order/order_data.ts +128 -0
- package/src/order/ratio.ts +144 -0
- package/src/order/relative.ts +106 -0
- package/src/owned_owner.ts +394 -0
- package/src/sdk.ts +555 -440
- package/src/send/sign_and_send_transaction.ts +120 -0
- package/src/send/wait_transaction.ts +271 -0
- package/src/udt.ts +317 -0
- package/src/utils/chain.ts +43 -0
- package/src/utils/codec.ts +74 -0
- package/src/utils/transaction_header.ts +66 -0
- package/src/utils/utils.ts +237 -0
- package/dist/codec.d.ts +0 -3
- package/dist/codec.d.ts.map +0 -1
- package/dist/codec.js +0 -58
- package/dist/codec.js.map +0 -1
- package/src/codec.ts +0 -138
package/dist/logic.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { ccc } from "@ckb-ccc/core";
|
|
2
|
+
import { assertDaoOutputLimit, DaoOutputLimitError, depositData, depositMaturity, isDaoDeposit, pushHeaderDep, } from "./dao.js";
|
|
3
|
+
import { decodeReceiptData, encodeReceiptData, IckbUdt, ickbValue, receiptDataBytes, } from "./udt.js";
|
|
4
|
+
import { transactionHeaders } from "./utils/transaction_header.js";
|
|
5
|
+
import { findCells, } from "./utils/utils.js";
|
|
6
|
+
const maxDepositQuantity = 63;
|
|
7
|
+
// Receipts must carry enough capacity for phase 2 when the wallet has no other
|
|
8
|
+
// CKB: one iCKB xUDT cell, one plain capacity cell, and the fee reserve.
|
|
9
|
+
const phase2TxFeeReserve = ccc.One;
|
|
10
|
+
/**
|
|
11
|
+
* Manages logic related to deposits and receipts in the blockchain.
|
|
12
|
+
*/
|
|
13
|
+
export class LogicManager {
|
|
14
|
+
/** The iCKB Logic script used as receipt type and DAO deposit lock. */
|
|
15
|
+
script;
|
|
16
|
+
/** Cell dependencies required to execute the iCKB Logic script. */
|
|
17
|
+
cellDeps;
|
|
18
|
+
/** The Nervos DAO script the deposits carry, with its cell deps. */
|
|
19
|
+
dao;
|
|
20
|
+
/** Creates the manager for one iCKB Logic deployment over one DAO deployment. */
|
|
21
|
+
constructor(script, cellDeps, dao) {
|
|
22
|
+
this.script = script;
|
|
23
|
+
this.cellDeps = cellDeps;
|
|
24
|
+
this.dao = dao;
|
|
25
|
+
}
|
|
26
|
+
/** Whether the cell is an iCKB receipt: typed by the logic script with a decodable prefix. */
|
|
27
|
+
isReceipt(cell) {
|
|
28
|
+
return (cell.cellOutput.type?.eq(this.script) === true &&
|
|
29
|
+
ccc.bytesFrom(cell.outputData).length >= receiptDataBytes);
|
|
30
|
+
}
|
|
31
|
+
/** Whether the cell is a DAO deposit locked by the logic script. */
|
|
32
|
+
isDeposit(cell) {
|
|
33
|
+
return isDaoDeposit(cell, this.dao.script) && cell.cellOutput.lock.eq(this.script);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Adds `depositQuantity` DAO deposits of `depositCapacity` locked by the logic script,
|
|
37
|
+
* then the receipt that mints their iCKB in phase 2, locked by `lock`.
|
|
38
|
+
*
|
|
39
|
+
* @remarks Caller must ensure UDT cellDeps are added to the transaction
|
|
40
|
+
* (e.g., via ickbUdt.addCellDeps(tx)).
|
|
41
|
+
*/
|
|
42
|
+
deposit(txLike, depositQuantity, depositCapacity, lock) {
|
|
43
|
+
const tx = ccc.Transaction.from(txLike);
|
|
44
|
+
if (depositQuantity <= 0) {
|
|
45
|
+
return tx;
|
|
46
|
+
}
|
|
47
|
+
if (!Number.isSafeInteger(depositQuantity)) {
|
|
48
|
+
throw new TypeError("iCKB deposit quantity must be a safe integer");
|
|
49
|
+
}
|
|
50
|
+
if (depositQuantity > maxDepositQuantity) {
|
|
51
|
+
// The completion walk steps a plan down on this error.
|
|
52
|
+
throw new DaoOutputLimitError(tx.outputs.length + depositQuantity + 1);
|
|
53
|
+
}
|
|
54
|
+
const depositCell = ccc.Cell.from({
|
|
55
|
+
previousOutput: { txHash: `0x${"00".repeat(32)}`, index: 0 },
|
|
56
|
+
cellOutput: { capacity: depositCapacity, lock: this.script, type: this.dao.script },
|
|
57
|
+
outputData: depositData(),
|
|
58
|
+
});
|
|
59
|
+
const depositAmount = depositCell.capacityFree;
|
|
60
|
+
if (depositAmount < ccc.fixedPointFrom(1000)) {
|
|
61
|
+
throw new Error("iCKB deposit minimum is 1000 CKB free capacity (1082 CKB total capacity)");
|
|
62
|
+
}
|
|
63
|
+
if (depositAmount > ccc.fixedPointFrom(1000000)) {
|
|
64
|
+
throw new Error("iCKB deposit maximum is 1000000 CKB free capacity (1000082 CKB total capacity)");
|
|
65
|
+
}
|
|
66
|
+
tx.addCellDeps(this.cellDeps);
|
|
67
|
+
tx.addCellDeps(this.dao.cellDeps);
|
|
68
|
+
for (let i = 0; i < depositQuantity; i += 1) {
|
|
69
|
+
tx.addOutput(depositCell.cellOutput, depositCell.outputData);
|
|
70
|
+
}
|
|
71
|
+
// Receipts track the deposit's free capacity, not the full DAO cell capacity.
|
|
72
|
+
tx.addOutput({ capacity: receiptPhase2Capacity(lock), lock, type: this.script }, encodeReceiptData({ depositQuantity: BigInt(depositQuantity), depositAmount }));
|
|
73
|
+
assertDaoOutputLimit(tx, this.dao.script);
|
|
74
|
+
return tx;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Adds receipt inputs and their deposit header deps for iCKB deposit completion.
|
|
78
|
+
*
|
|
79
|
+
* @remarks This prepares the phase-2 inputs; the iCKB they mint is completed by
|
|
80
|
+
* `IckbSdk.completeTransaction`.
|
|
81
|
+
*/
|
|
82
|
+
completeDeposit(txLike, receipts) {
|
|
83
|
+
const tx = ccc.Transaction.from(txLike);
|
|
84
|
+
if (receipts.length === 0) {
|
|
85
|
+
return tx;
|
|
86
|
+
}
|
|
87
|
+
for (const receipt of receipts) {
|
|
88
|
+
const outPoint = receipt.cell.outPoint.toHex();
|
|
89
|
+
if (!this.isReceipt(receipt.cell)) {
|
|
90
|
+
throw new Error(`Receipt ${outPoint} is not an iCKB receipt for this logic script`);
|
|
91
|
+
}
|
|
92
|
+
if (receipt.header.txHash !== receipt.cell.outPoint.txHash) {
|
|
93
|
+
throw new Error(`Receipt ${outPoint} header txHash ${String(receipt.header.txHash)} does not match cell txHash ${receipt.cell.outPoint.txHash}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
tx.addCellDeps(this.cellDeps);
|
|
97
|
+
for (const receipt of receipts) {
|
|
98
|
+
pushHeaderDep(tx, receipt.header.header.hash);
|
|
99
|
+
tx.addInput(receipt.cell);
|
|
100
|
+
}
|
|
101
|
+
return tx;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The receipts among `cells`, valued at their deposit headers, each header read once.
|
|
105
|
+
*/
|
|
106
|
+
async receiptsFrom(client, cells) {
|
|
107
|
+
const receipts = cells.filter((cell) => this.isReceipt(cell));
|
|
108
|
+
const headers = await transactionHeaders(client, receipts.map((cell) => cell.outPoint.txHash));
|
|
109
|
+
return receipts.map((cell) => {
|
|
110
|
+
const { txHash } = cell.outPoint;
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- every receipt's hash was read above.
|
|
112
|
+
return receiptCell(cell, { header: headers.get(txHash), txHash });
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Every live iCKB deposit, valued at its deposit header, with its claim epoch at the tip;
|
|
117
|
+
* each deposit transaction's header is read once.
|
|
118
|
+
*/
|
|
119
|
+
async findDeposits(client, tip) {
|
|
120
|
+
const cells = (await findCells(client, {
|
|
121
|
+
script: this.script,
|
|
122
|
+
scriptType: "lock",
|
|
123
|
+
filter: {
|
|
124
|
+
script: this.dao.script,
|
|
125
|
+
outputData: depositData(),
|
|
126
|
+
outputDataSearchMode: "exact",
|
|
127
|
+
},
|
|
128
|
+
scriptSearchMode: "exact",
|
|
129
|
+
withData: true,
|
|
130
|
+
})).filter((cell) => this.isDeposit(cell));
|
|
131
|
+
const headers = await transactionHeaders(client, cells.map((cell) => cell.outPoint.txHash));
|
|
132
|
+
return cells.map((cell) => {
|
|
133
|
+
const { txHash } = cell.outPoint;
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- every deposit's hash was read above.
|
|
135
|
+
return ickbDepositCell(cell, { header: headers.get(txHash), txHash }, tip);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/** Values a DAO deposit cell at its deposit header and samples its claim epoch at the tip. */
|
|
140
|
+
export function ickbDepositCell(cell, depositHeader, tip) {
|
|
141
|
+
const interests = ccc.calcDaoProfit(cell.capacityFree, depositHeader.header, tip);
|
|
142
|
+
return {
|
|
143
|
+
cell,
|
|
144
|
+
headers: [depositHeader, { header: tip }],
|
|
145
|
+
interests,
|
|
146
|
+
claimEpoch: ccc.calcDaoClaimEpoch(depositHeader.header, tip),
|
|
147
|
+
ckbValue: cell.cellOutput.capacity + interests,
|
|
148
|
+
udtValue: ickbValue(cell.capacityFree, depositHeader.header),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/** The deposits a withdrawal request made now may claim at their sampled dates under the policy. */
|
|
152
|
+
export function readyDeposits(deposits, tip, policy) {
|
|
153
|
+
return deposits.filter((deposit) => depositMaturity(deposit.claimEpoch, tip, policy).isReady);
|
|
154
|
+
}
|
|
155
|
+
/** Decodes a receipt cell and values it at its deposit header. */
|
|
156
|
+
export function receiptCell(cell, header) {
|
|
157
|
+
let receipt;
|
|
158
|
+
try {
|
|
159
|
+
receipt = decodeReceiptData(cell.outputData);
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
throw new Error(`Invalid iCKB receipt payload at ${cell.outPoint.toHex()}: ${cell.outputData}`, { cause: error });
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
cell,
|
|
166
|
+
header,
|
|
167
|
+
ckbValue: cell.cellOutput.capacity,
|
|
168
|
+
udtValue: ickbValue(receipt.depositAmount, header.header) * receipt.depositQuantity,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Returns the CKB needed for the two phase-2 outputs created by one receipt.
|
|
173
|
+
*
|
|
174
|
+
* @remarks The value is sized with the actual user lock because lock args affect
|
|
175
|
+
* occupied capacity. It includes one plain output, one xUDT output, and the
|
|
176
|
+
* phase-2 fee reserve.
|
|
177
|
+
*/
|
|
178
|
+
export function receiptPhase2Capacity(lock) {
|
|
179
|
+
// Capacity is measured with the actual user lock. Lock args are wallet-specific
|
|
180
|
+
// and can make both phase-2 outputs larger than protocol-only examples.
|
|
181
|
+
const plainCellCapacity = BigInt(8 + lock.occupiedSize) * ccc.One;
|
|
182
|
+
return plainCellCapacity + IckbUdt.minimumXudtCellCapacity(lock) + phase2TxFeeReserve;
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=logic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../src/logic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,aAAa,GAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,GAEjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EACL,SAAS,GAIV,MAAM,kBAAkB,CAAC;AAE1B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,+EAA+E;AAC/E,yEAAyE;AACzE,MAAM,kBAAkB,GAAG,GAAG,CAAC,GAAG,CAAC;AA8BnC;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB,uEAAuE;IACvD,MAAM,CAAa;IAEnC,mEAAmE;IACnD,QAAQ,CAAgB;IAExC,oEAAoE;IACpD,GAAG,CAAa;IAEhC,iFAAiF;IACjF,YAAY,MAAkB,EAAE,QAAuB,EAAE,GAAe;QACtE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,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AAK,EAAE,KAAK,IAAI,CAAC,UAAU,EAAE,EAC9E,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI;QACJ,MAAM;QACN,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ;QAClC,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,eAAe;KACpF,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAgB;IACpD,gFAAgF;IAChF,wEAAwE;IACxE,MAAM,iBAAiB,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC;IAClE,OAAO,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { ccc } from "@ckb-ccc/core";
|
|
2
|
+
import type { ValueComponents } from "../utils/utils.js";
|
|
3
|
+
import { OrderData } from "./order_data.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a parsed order cell on the blockchain.
|
|
6
|
+
*
|
|
7
|
+
* Implements `ValueComponents` to expose the cell's raw data and its
|
|
8
|
+
* value breakdown (CKB and UDT).
|
|
9
|
+
*/
|
|
10
|
+
export declare class OrderCell implements ValueComponents {
|
|
11
|
+
/** Raw live cell that carries the order lock and UDT type. */
|
|
12
|
+
readonly cell: ccc.Cell;
|
|
13
|
+
/** Decoded order payload from `cell.outputData`. */
|
|
14
|
+
readonly data: OrderData;
|
|
15
|
+
/** CKB capacity available for matching after occupied capacity is reserved. */
|
|
16
|
+
readonly ckbUnoccupied: ccc.FixedPoint;
|
|
17
|
+
/** Absolute total order value in the order's comparison units. */
|
|
18
|
+
readonly absTotal: ccc.Num;
|
|
19
|
+
/** Absolute matched progress in the order's comparison units. */
|
|
20
|
+
readonly absProgress: ccc.Num;
|
|
21
|
+
constructor({ cell, data, ckbUnoccupied, absTotal, absProgress, }: {
|
|
22
|
+
cell: ccc.Cell;
|
|
23
|
+
data: OrderData;
|
|
24
|
+
ckbUnoccupied: ccc.FixedPoint;
|
|
25
|
+
absTotal: ccc.Num;
|
|
26
|
+
absProgress: ccc.Num;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Gets the order CKB amount.
|
|
30
|
+
*
|
|
31
|
+
* @returns The CKB amount as a `ccc.FixedPoint`.
|
|
32
|
+
*/
|
|
33
|
+
get ckbValue(): ccc.FixedPoint;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the order UDT amount.
|
|
36
|
+
*
|
|
37
|
+
* @returns The UDT amount as a `ccc.FixedPoint`.
|
|
38
|
+
*/
|
|
39
|
+
get udtValue(): ccc.FixedPoint;
|
|
40
|
+
/**
|
|
41
|
+
* Attempts to parse an OrderCell from a raw cell.
|
|
42
|
+
*
|
|
43
|
+
* Returns `undefined` if parsing or validation fails.
|
|
44
|
+
*
|
|
45
|
+
* @param cell - The raw chain cell to convert.
|
|
46
|
+
* @returns An `OrderCell` instance or `undefined`.
|
|
47
|
+
*/
|
|
48
|
+
static tryFrom(cell: ccc.Cell): OrderCell | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Parses and validates a raw cell as OrderCell.
|
|
51
|
+
*
|
|
52
|
+
* Throws if the cell is invalid or data validation fails.
|
|
53
|
+
*
|
|
54
|
+
* @param cell - The raw chain cell to convert.
|
|
55
|
+
* @returns A new `OrderCell` instance.
|
|
56
|
+
* @throws When decoding or validation fails.
|
|
57
|
+
*/
|
|
58
|
+
static mustFrom(cell: ccc.Cell): OrderCell;
|
|
59
|
+
/**
|
|
60
|
+
* Checks whether the CKB-to-UDT side is enabled and has nonzero inventory.
|
|
61
|
+
*
|
|
62
|
+
* @remarks Executable-match checks for fee, minimum output, and ratio bounds happen during matching.
|
|
63
|
+
*/
|
|
64
|
+
isCkb2UdtMatchable(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Checks whether the UDT-to-CKB side is enabled and has nonzero inventory.
|
|
67
|
+
*
|
|
68
|
+
* @remarks Executable-match checks for fee, minimum output, and ratio bounds happen during matching.
|
|
69
|
+
*/
|
|
70
|
+
isUdt2CkbMatchable(): boolean;
|
|
71
|
+
/** Returns true when either side is enabled and has nonzero inventory. */
|
|
72
|
+
isMatchable(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Checks if the order is fulfilled.
|
|
75
|
+
*
|
|
76
|
+
* @returns True if the order is fulfilled (not matchable), otherwise false.
|
|
77
|
+
*/
|
|
78
|
+
isFulfilled(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Retrieves the master out point of the order.
|
|
81
|
+
* @returns The master out point associated with the order.
|
|
82
|
+
*/
|
|
83
|
+
getMaster(): ccc.OutPoint;
|
|
84
|
+
/**
|
|
85
|
+
* Validates a descendant order against this origin order.
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* This confusion-attack guard requires the same order script, UDT type,
|
|
89
|
+
* master, and info, while forbidding lower total value or lower progress.
|
|
90
|
+
* See {@link https://github.com/ickb/whitepaper/issues/19}.
|
|
91
|
+
*/
|
|
92
|
+
validate(descendant: OrderCell): void;
|
|
93
|
+
/**
|
|
94
|
+
* Checks if the descendant order is valid against this order.
|
|
95
|
+
* @param descendant - The descendant order to validate.
|
|
96
|
+
* @returns True if the descendant is valid, otherwise false.
|
|
97
|
+
*/
|
|
98
|
+
isValid(descendant: OrderCell): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Resolves the best valid descendant order.
|
|
101
|
+
*
|
|
102
|
+
* @remarks
|
|
103
|
+
* The genuine mint origin is the immutable validation baseline. Resolution
|
|
104
|
+
* prefers greater progress and then greater total value; candidate identity is
|
|
105
|
+
* irrelevant. Equal-score non-mint candidates are ambiguous, while the mint
|
|
106
|
+
* origin wins an equal-score tie when it is still live.
|
|
107
|
+
*/
|
|
108
|
+
resolve(descendants: OrderCell[]): OrderCell | undefined;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Represents a master cell
|
|
112
|
+
*/
|
|
113
|
+
export declare class MasterCell implements ValueComponents {
|
|
114
|
+
/** Raw live master cell that anchors an order group. */
|
|
115
|
+
readonly cell: ccc.Cell;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the UDT value of the cell.
|
|
118
|
+
*
|
|
119
|
+
* For a Master Cell, the UDT amount is always zero.
|
|
120
|
+
*
|
|
121
|
+
* @returns The UDT amount as a `ccc.FixedPoint` (0n).
|
|
122
|
+
*/
|
|
123
|
+
readonly udtValue = 0n;
|
|
124
|
+
/**
|
|
125
|
+
* Creates an instance of MasterCell.
|
|
126
|
+
* @param cell - The ccc.Cell instance to be wrapped by the MasterCell.
|
|
127
|
+
*/
|
|
128
|
+
constructor(cell: ccc.Cell);
|
|
129
|
+
/**
|
|
130
|
+
* Gets the CKB value of the cell.
|
|
131
|
+
*
|
|
132
|
+
* @returns The total CKB amount as a `ccc.FixedPoint`.
|
|
133
|
+
*/
|
|
134
|
+
get ckbValue(): ccc.FixedPoint;
|
|
135
|
+
/**
|
|
136
|
+
* Validates the MasterCell against an OrderCell.
|
|
137
|
+
* @param order - The OrderCell to validate against.
|
|
138
|
+
* @throws Error if the order script is different or if the master is different.
|
|
139
|
+
*/
|
|
140
|
+
validate(order: OrderCell): void;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Represents a group of orders associated with a master cell.
|
|
144
|
+
*/
|
|
145
|
+
export declare class OrderGroup implements ValueComponents {
|
|
146
|
+
/** Master cell that authorizes and anchors the current order. */
|
|
147
|
+
readonly master: MasterCell;
|
|
148
|
+
/** Current resolved order cell. */
|
|
149
|
+
readonly order: OrderCell;
|
|
150
|
+
/** Origin order used to validate descendant progress and identity. */
|
|
151
|
+
readonly origin: OrderCell;
|
|
152
|
+
/** The block that committed the origin, when known: how long the order has been on the book. */
|
|
153
|
+
readonly blockNumber: ccc.Num | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* Creates an instance of OrderGroup.
|
|
156
|
+
* @param master - The master cell associated with the order group.
|
|
157
|
+
* @param order - The order within the group.
|
|
158
|
+
* @param origin - The original order associated with the group.
|
|
159
|
+
* @param blockNumber - The block that committed the origin, if committed.
|
|
160
|
+
*/
|
|
161
|
+
constructor(master: MasterCell, order: OrderCell, origin: OrderCell, blockNumber?: ccc.Num);
|
|
162
|
+
/**
|
|
163
|
+
* Gets the CKB value of the group.
|
|
164
|
+
*
|
|
165
|
+
* @returns The total CKB amount as a `ccc.FixedPoint`, which is the sum of the CKB values of the order cell and the master cell.
|
|
166
|
+
*/
|
|
167
|
+
get ckbValue(): ccc.FixedPoint;
|
|
168
|
+
/**
|
|
169
|
+
* Gets the UDT value of the group.
|
|
170
|
+
*
|
|
171
|
+
* @returns The UDT amount as a `ccc.FixedPoint`, derived from the order cell.
|
|
172
|
+
*/
|
|
173
|
+
get udtValue(): ccc.FixedPoint;
|
|
174
|
+
/**
|
|
175
|
+
* Tries to create an OrderGroup from the provided parameters.
|
|
176
|
+
* @param master - The master cell.
|
|
177
|
+
* @param order - The order within the group.
|
|
178
|
+
* @param origin - The original order.
|
|
179
|
+
* @returns An OrderGroup instance or undefined if creation fails.
|
|
180
|
+
*/
|
|
181
|
+
static tryFrom(master: MasterCell, order: OrderCell, origin: OrderCell, blockNumber?: ccc.Num): OrderGroup | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* Validates the order group against its master and origin orders.
|
|
184
|
+
* @throws Will throw an error if validation fails.
|
|
185
|
+
*/
|
|
186
|
+
validate(): void;
|
|
187
|
+
/**
|
|
188
|
+
* Checks if the order group is valid.
|
|
189
|
+
* @returns True if the order group is valid, otherwise false.
|
|
190
|
+
*/
|
|
191
|
+
isValid(): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Checks if the specified lock is the owner of the master cell.
|
|
194
|
+
*
|
|
195
|
+
* @param locks - The locks to check ownership against.
|
|
196
|
+
* @returns True if the lock is the owner, otherwise false.
|
|
197
|
+
*/
|
|
198
|
+
isOwner(...locks: ccc.Script[]): boolean;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Records canonical resolver output without exposing forgeable provenance data. The
|
|
202
|
+
* group and its parsed parts are frozen, since matching and transactions build on them.
|
|
203
|
+
*/
|
|
204
|
+
export declare function attestResolvedOrderGroup(group: OrderGroup): OrderGroup;
|
|
205
|
+
/** Returns the resolver's group at a matching or transaction boundary. */
|
|
206
|
+
export declare function validatedOrderGroup(group: OrderGroup): OrderGroup;
|
|
207
|
+
//# sourceMappingURL=cells.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cells.d.ts","sourceRoot":"","sources":["../../src/order/cells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM5C;;;;;GAKG;AACH,qBAAa,SAAU,YAAW,eAAe;IAC/C,8DAA8D;IAC9D,SAAgB,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;IAC/B,oDAAoD;IACpD,SAAgB,IAAI,EAAE,SAAS,CAAC;IAChC,+EAA+E;IAC/E,SAAgB,aAAa,EAAE,GAAG,CAAC,UAAU,CAAC;IAC9C,kEAAkE;IAClE,SAAgB,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC;IAClC,iEAAiE;IACjE,SAAgB,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC;IAErC,YAAY,EACV,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE;QACD,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,SAAS,CAAC;QAChB,aAAa,EAAE,GAAG,CAAC,UAAU,C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