@ickb/order
Version:
UDT Limit Order utilities built on top of CCC
46 lines • 1.8 kB
TypeScript
import { ccc } from "@ckb-ccc/core";
import { OrderData } from "./entities.js";
import type { ValueComponents } from "@ickb/utils";
export declare class OrderCell implements ValueComponents {
cell: ccc.Cell;
data: OrderData;
ckbUnoccupied: ccc.FixedPoint;
absTotal: ccc.Num;
absProgress: ccc.Num;
maturity: bigint | undefined;
constructor(cell: ccc.Cell, data: OrderData, ckbUnoccupied: ccc.FixedPoint, absTotal: ccc.Num, absProgress: ccc.Num, maturity: bigint | undefined);
get ckbValue(): ccc.FixedPoint;
get udtValue(): ccc.FixedPoint;
static tryFrom(cell: ccc.Cell): OrderCell | undefined;
static mustFrom(cell: ccc.Cell): OrderCell;
isDualRatio(): boolean;
isCkb2UdtMatchable(): boolean;
isUdt2CkbMatchable(): boolean;
isMatchable(): boolean;
isFulfilled(): boolean;
getMaster(): ccc.OutPoint;
validate(descendant: OrderCell): void;
isValid(descendant: OrderCell): boolean;
resolve(descendants: OrderCell[]): OrderCell | undefined;
}
export declare class MasterCell implements ValueComponents {
cell: ccc.Cell;
constructor(cell: ccc.Cell);
static from(cellLike: ccc.CellLike): MasterCell;
validate(order: OrderCell): void;
get ckbValue(): ccc.FixedPoint;
readonly udtValue = 0n;
}
export declare class OrderGroup implements ValueComponents {
master: MasterCell;
order: OrderCell;
origin: OrderCell;
constructor(master: MasterCell, order: OrderCell, origin: OrderCell);
static tryFrom(master: MasterCell, order: OrderCell, origin: OrderCell): OrderGroup | undefined;
validate(): void;
isValid(): boolean;
isOwner(...locks: ccc.Script[]): boolean;
get ckbValue(): ccc.FixedPoint;
get udtValue(): ccc.FixedPoint;
}
//# sourceMappingURL=cells.d.ts.map