@ickb/sdk 1000.0.52 → 1000.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/codec.d.ts +14 -0
- package/dist/cjs/codec.d.ts.map +1 -0
- package/dist/cjs/codec.js +125 -0
- package/dist/cjs/codec.js.map +1 -0
- package/dist/cjs/constants.d.ts +49 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +156 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/index.d.ts +3 -189
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +17 -338
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sdk.d.ts +178 -0
- package/dist/cjs/sdk.d.ts.map +1 -0
- package/dist/cjs/sdk.js +362 -0
- package/dist/cjs/sdk.js.map +1 -0
- package/dist/esm/codec.d.ts +14 -0
- package/dist/esm/codec.d.ts.map +1 -0
- package/dist/esm/codec.js +122 -0
- package/dist/esm/codec.js.map +1 -0
- package/dist/esm/constants.d.ts +49 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +152 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/index.d.ts +3 -189
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -336
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/sdk.d.ts +178 -0
- package/dist/esm/sdk.d.ts.map +1 -0
- package/dist/esm/sdk.js +358 -0
- package/dist/esm/sdk.js.map +1 -0
- package/package.json +8 -8
- package/src/codec.ts +138 -0
- package/src/constants.ts +200 -0
- package/src/index.ts +3 -573
- package/src/sdk.ts +513 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { mol } from "@ckb-ccc/core";
|
|
2
|
+
/**
|
|
3
|
+
* Codec for encoding and decoding a pool snapshot.
|
|
4
|
+
*
|
|
5
|
+
* The PoolSnapshotCodec encodes an array of 1024 numbers representing event counts for bins,
|
|
6
|
+
* where the number of bits used per bin is dynamically computed as the ceiling of log2(max + 1)
|
|
7
|
+
* across all bins. The codec provides methods to encode the array into a Uint8Array and decode
|
|
8
|
+
* a Uint8Array back to the original array of numbers.
|
|
9
|
+
*
|
|
10
|
+
* @remarks The total number of bits for encoding all the bins is computed as bitsPerBin * 1024. The codec
|
|
11
|
+
* does not have a fixed byteLength since it depends on the data.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PoolSnapshot: mol.Codec<number[], number[]>;
|
|
14
|
+
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,GAAG,EAAE,MAAM,eAAe,CAAC;AAKzC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,+BAkDvB,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PoolSnapshot = void 0;
|
|
4
|
+
const core_1 = require("@ckb-ccc/core");
|
|
5
|
+
const utils_1 = require("@ickb/utils");
|
|
6
|
+
const N = 1024;
|
|
7
|
+
/**
|
|
8
|
+
* Codec for encoding and decoding a pool snapshot.
|
|
9
|
+
*
|
|
10
|
+
* The PoolSnapshotCodec encodes an array of 1024 numbers representing event counts for bins,
|
|
11
|
+
* where the number of bits used per bin is dynamically computed as the ceiling of log2(max + 1)
|
|
12
|
+
* across all bins. The codec provides methods to encode the array into a Uint8Array and decode
|
|
13
|
+
* a Uint8Array back to the original array of numbers.
|
|
14
|
+
*
|
|
15
|
+
* @remarks The total number of bits for encoding all the bins is computed as bitsPerBin * 1024. The codec
|
|
16
|
+
* does not have a fixed byteLength since it depends on the data.
|
|
17
|
+
*/
|
|
18
|
+
exports.PoolSnapshot = core_1.mol.Codec.from({
|
|
19
|
+
/**
|
|
20
|
+
* Encodes an array of 1024 bin counts into a Uint8Array.
|
|
21
|
+
*
|
|
22
|
+
* @param bins - An array of 1024 numbers. Each number represents the event count for a bin.
|
|
23
|
+
* @returns A Uint8Array containing the packed bit representation of the bin counts.
|
|
24
|
+
* @throws Error if the input array does not contain exactly 1024 elements.
|
|
25
|
+
*/
|
|
26
|
+
encode: (bins) => {
|
|
27
|
+
if (bins.length !== N) {
|
|
28
|
+
throw new Error("Expected 1024 bins");
|
|
29
|
+
}
|
|
30
|
+
const bitsPerBin = computeBits(bins);
|
|
31
|
+
const buffer = new Uint8Array((bitsPerBin * N) >> 3);
|
|
32
|
+
let bitOffset = 0;
|
|
33
|
+
for (const count of bins) {
|
|
34
|
+
packBits(buffer, bitOffset, bitsPerBin, count);
|
|
35
|
+
bitOffset += bitsPerBin;
|
|
36
|
+
}
|
|
37
|
+
return buffer;
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Decodes a buffer into an array of 1024 bin counts.
|
|
41
|
+
*
|
|
42
|
+
* The function automatically computes the number of bits per bin from the buffer length,
|
|
43
|
+
* expecting that the total number of bits in the buffer is a multiple of 1024.
|
|
44
|
+
*
|
|
45
|
+
* @param bufferLike - The input that can be converted into a Uint8Array.
|
|
46
|
+
* @returns An array of 1024 numbers representing the decoded bin counts.
|
|
47
|
+
* @throws Error if the buffer length is invalid (i.e., its total bit count is not divisible by 1024).
|
|
48
|
+
*/
|
|
49
|
+
decode: (bufferLike) => {
|
|
50
|
+
const buffer = core_1.ccc.bytesFrom(bufferLike);
|
|
51
|
+
// Determine bitsPerBin from the fixed structure (totalBits divided by N).
|
|
52
|
+
const bitsPerBin = (buffer.byteLength * 8) / N;
|
|
53
|
+
if (!Number.isInteger(bitsPerBin)) {
|
|
54
|
+
throw new Error("Invalid buffer length for 1024 bins");
|
|
55
|
+
}
|
|
56
|
+
const bins = new Array(N);
|
|
57
|
+
let bitOffset = 0;
|
|
58
|
+
for (let i = 0; i < N; i++) {
|
|
59
|
+
bins[i] = unpackBits(buffer, bitOffset, bitsPerBin);
|
|
60
|
+
bitOffset += bitsPerBin;
|
|
61
|
+
}
|
|
62
|
+
return bins;
|
|
63
|
+
},
|
|
64
|
+
// Note: The byteLength is not fixed as it depends on the data (i.e., the maximum bin count).
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Computes the minimal number of bits required to represent the maximum number in the bins.
|
|
68
|
+
*
|
|
69
|
+
* Given an array of numbers that represent counts for each bin, this function calculates
|
|
70
|
+
* the number of bits required to represent the maximum bin count. A minimum of 1 bit is
|
|
71
|
+
* always returned.
|
|
72
|
+
*
|
|
73
|
+
* @param bins - An array of numbers, each representing a bin's value.
|
|
74
|
+
* @returns The minimal number of bits required to represent the highest value among the bins.
|
|
75
|
+
*/
|
|
76
|
+
function computeBits(bins) {
|
|
77
|
+
return Math.ceil(Math.log2(1 + (0, utils_1.max)(1, ...bins)));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Packs a given numeric value into a Uint8Array (bit array) at the specified bit offset and width.
|
|
81
|
+
*
|
|
82
|
+
* The function encodes the given number into the provided buffer, using the specified number of bits (width)
|
|
83
|
+
* starting from the specified bit offset. Each bit of the value is written into the buffer.
|
|
84
|
+
*
|
|
85
|
+
* @param buffer - The Uint8Array into which the value will be packed.
|
|
86
|
+
* @param bitOffset - The starting bit index in the array where the value should be packed.
|
|
87
|
+
* @param width - The number of bits to use for packing the value.
|
|
88
|
+
* @param value - The numeric value to pack.
|
|
89
|
+
*/
|
|
90
|
+
function packBits(buffer, bitOffset, width, value) {
|
|
91
|
+
let offset = bitOffset;
|
|
92
|
+
for (let i = 0; i < width; i++) {
|
|
93
|
+
const byteIndex = offset >> 3;
|
|
94
|
+
const bitInByte = offset % 8;
|
|
95
|
+
const bit = (value >> i) & 1;
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
97
|
+
buffer[byteIndex] |= bit << bitInByte;
|
|
98
|
+
offset++;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Unpacks a numeric value from a Uint8Array (bit array) starting at a given bit offset with a specified width.
|
|
103
|
+
*
|
|
104
|
+
* The function reads bits from the buffer starting at the bit offset and reconstructs a numeric value
|
|
105
|
+
* using the specified number of bits (width).
|
|
106
|
+
*
|
|
107
|
+
* @param buffer - The Uint8Array from which the value will be unpacked.
|
|
108
|
+
* @param bitOffset - The starting bit index in the buffer.
|
|
109
|
+
* @param width - The number of bits to read for unpacking the value.
|
|
110
|
+
* @returns The numeric value resulting from decoding the specified bits.
|
|
111
|
+
*/
|
|
112
|
+
function unpackBits(buffer, bitOffset, width) {
|
|
113
|
+
let value = 0;
|
|
114
|
+
let offset = bitOffset;
|
|
115
|
+
for (let i = 0; i < width; i++) {
|
|
116
|
+
const byteIndex = offset >> 3;
|
|
117
|
+
const bitInByte = offset % 8;
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
119
|
+
const bit = (buffer[byteIndex] >> bitInByte) & 1;
|
|
120
|
+
value |= bit << i;
|
|
121
|
+
offset++;
|
|
122
|
+
}
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=codec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/codec.ts"],"names":[],"mappings":";;;AAAA,wCAAyC;AACzC,uCAAkC;AAElC,MAAM,CAAC,GAAG,IAAI,CAAC;AAEf;;;;;;;;;;GAUG;AACU,QAAA,YAAY,GAAG,UAAG,CAAC,KAAK,CAAC,IAAI,CAAW;IACnD;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACf,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACxC,CAAC;QAED,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,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
import { DaoManager } from "@ickb/dao";
|
|
4
|
+
import { OrderManager } from "@ickb/order";
|
|
5
|
+
import { CapacityManager, type ScriptDeps } from "@ickb/utils";
|
|
6
|
+
/**
|
|
7
|
+
* The iCKB UDT name.
|
|
8
|
+
*/
|
|
9
|
+
export declare const UDT_NAME = "iCKB";
|
|
10
|
+
/**
|
|
11
|
+
* The iCKB UDT symbol.
|
|
12
|
+
*/
|
|
13
|
+
export declare const UDT_SYMBOL = "iCKB";
|
|
14
|
+
/**
|
|
15
|
+
* The iCKB UDT number of decimals.
|
|
16
|
+
*/
|
|
17
|
+
export declare const UDT_DECIMALS = 8;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves the configuration for the given deployment environment.
|
|
20
|
+
*
|
|
21
|
+
* Accepts either a string identifier ("mainnet" or "testnet") or a custom configuration
|
|
22
|
+
* object containing script dependencies for a devnet.
|
|
23
|
+
*
|
|
24
|
+
* It sets up various managers (UDT, Logic, OwnedOwner, Order, Dao, Capacity) and also
|
|
25
|
+
* aggregates a unique list of known bot scripts.
|
|
26
|
+
*
|
|
27
|
+
* @param deps - Either a network identifier ("mainnet"/"testnet") or an object containing
|
|
28
|
+
* explicit script dependencies for devnet.
|
|
29
|
+
* @param bots - An optional array of bot script-like objects to augment the list of known bots.
|
|
30
|
+
* @returns An object containing the instantiated managers and bots.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getConfig(deps: "mainnet" | "testnet" | {
|
|
33
|
+
udt: ScriptDeps;
|
|
34
|
+
ickbLogic: ScriptDeps;
|
|
35
|
+
ownedOwner: ScriptDeps;
|
|
36
|
+
order: ScriptDeps;
|
|
37
|
+
dao: ScriptDeps;
|
|
38
|
+
}, bots?: ccc.ScriptLike[]): {
|
|
39
|
+
managers: {
|
|
40
|
+
udt: IckbUdtManager;
|
|
41
|
+
ickbLogic: LogicManager;
|
|
42
|
+
ownedOwner: OwnedOwnerManager;
|
|
43
|
+
order: OrderManager;
|
|
44
|
+
dao: DaoManager;
|
|
45
|
+
capacity: CapacityManager;
|
|
46
|
+
};
|
|
47
|
+
bots: ccc.Script[];
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAU,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,QAAQ,SAAS,CAAC;AAE/B;;GAEG;AACH,eAAO,MAAM,UAAU,SAAS,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACvB,IAAI,EACA,SAAS,GACT,SAAS,GACT;IAEE,GAAG,EAAE,UAAU,CAAC;IAChB,SAAS,EAAE,UAAU,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,UAAU,CAAC;IAClB,GAAG,EAAE,UAAU,CAAC;CACjB,EACL,IAAI,GAAE,GAAG,CAAC,UAAU,EAAO,GAC1B;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,cAAc,CAAC;QACpB,SAAS,EAAE,YAAY,CAAC;QACxB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,KAAK,EAAE,YAAY,CAAC;QACpB,GAAG,EAAE,UAAU,CAAC;QAChB,QAAQ,EAAE,eAAe,CAAC;KAC3B,CAAC;IACF,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;CACpB,CA6BA"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UDT_DECIMALS = exports.UDT_SYMBOL = exports.UDT_NAME = void 0;
|
|
4
|
+
exports.getConfig = getConfig;
|
|
5
|
+
const core_1 = require("@ckb-ccc/core");
|
|
6
|
+
const core_2 = require("@ickb/core");
|
|
7
|
+
const dao_1 = require("@ickb/dao");
|
|
8
|
+
const order_1 = require("@ickb/order");
|
|
9
|
+
const utils_1 = require("@ickb/utils");
|
|
10
|
+
/**
|
|
11
|
+
* The iCKB UDT name.
|
|
12
|
+
*/
|
|
13
|
+
exports.UDT_NAME = "iCKB";
|
|
14
|
+
/**
|
|
15
|
+
* The iCKB UDT symbol.
|
|
16
|
+
*/
|
|
17
|
+
exports.UDT_SYMBOL = "iCKB";
|
|
18
|
+
/**
|
|
19
|
+
* The iCKB UDT number of decimals.
|
|
20
|
+
*/
|
|
21
|
+
exports.UDT_DECIMALS = 8;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the configuration for the given deployment environment.
|
|
24
|
+
*
|
|
25
|
+
* Accepts either a string identifier ("mainnet" or "testnet") or a custom configuration
|
|
26
|
+
* object containing script dependencies for a devnet.
|
|
27
|
+
*
|
|
28
|
+
* It sets up various managers (UDT, Logic, OwnedOwner, Order, Dao, Capacity) and also
|
|
29
|
+
* aggregates a unique list of known bot scripts.
|
|
30
|
+
*
|
|
31
|
+
* @param deps - Either a network identifier ("mainnet"/"testnet") or an object containing
|
|
32
|
+
* explicit script dependencies for devnet.
|
|
33
|
+
* @param bots - An optional array of bot script-like objects to augment the list of known bots.
|
|
34
|
+
* @returns An object containing the instantiated managers and bots.
|
|
35
|
+
*/
|
|
36
|
+
function getConfig(deps, bots = []) {
|
|
37
|
+
// If deps is provided as a network string, use the pre-defined constants.
|
|
38
|
+
if (deps === "mainnet" || deps === "testnet") {
|
|
39
|
+
bots = bots.concat(deps === "mainnet" ? MAINNET_KNOWN_BOTS : TESTNET_KNOWN_BOTS);
|
|
40
|
+
const depGroup = deps === "mainnet" ? MAINNET_DEP_GROUP : TESTNET_DEP_GROUP;
|
|
41
|
+
deps = {
|
|
42
|
+
udt: from(UDT, depGroup),
|
|
43
|
+
ickbLogic: from(ICKB_LOGIC, depGroup),
|
|
44
|
+
ownedOwner: from(OWNED_OWNER, depGroup),
|
|
45
|
+
order: from(ORDER, depGroup),
|
|
46
|
+
dao: from(DAO, depGroup),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const daoManager = dao_1.DaoManager.fromDeps(deps);
|
|
50
|
+
const ickbUdtManager = core_2.IckbUdtManager.fromDeps(deps, daoManager);
|
|
51
|
+
return {
|
|
52
|
+
managers: {
|
|
53
|
+
udt: ickbUdtManager,
|
|
54
|
+
ickbLogic: core_2.LogicManager.fromDeps(deps, daoManager, ickbUdtManager),
|
|
55
|
+
ownedOwner: core_2.OwnedOwnerManager.fromDeps(deps, daoManager, ickbUdtManager),
|
|
56
|
+
order: order_1.OrderManager.fromDeps(deps, ickbUdtManager),
|
|
57
|
+
dao: daoManager,
|
|
58
|
+
capacity: utils_1.CapacityManager.withAnyData(),
|
|
59
|
+
},
|
|
60
|
+
bots: [...(0, utils_1.unique)(bots.map((b) => core_1.ccc.Script.from(b)))],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Wraps a script-like object into a ScriptDeps structure.
|
|
65
|
+
*
|
|
66
|
+
* @param script - The script or script-like object.
|
|
67
|
+
* @param cellDeps - Additional cell dependencies that the script may require.
|
|
68
|
+
* @returns An object containing the script and its associated cell dependencies.
|
|
69
|
+
*/
|
|
70
|
+
function from(script, ...cellDeps) {
|
|
71
|
+
return {
|
|
72
|
+
script: core_1.ccc.Script.from(script),
|
|
73
|
+
cellDeps,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* UDT (User Defined Token) lock script information used for onchain validation.
|
|
78
|
+
*/
|
|
79
|
+
const UDT = {
|
|
80
|
+
codeHash: "0x50bd8d6680b8b9cf98b73f3c08faf8b2a21914311954118ad6609be6e78a1b95",
|
|
81
|
+
hashType: "data1",
|
|
82
|
+
args: "0xb73b6ab39d79390c6de90a09c96b290c331baf1798ed6f97aed02590929734e800000080",
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* DAO (Decentralized Autonomous Organization) lock script information.
|
|
86
|
+
*/
|
|
87
|
+
const DAO = {
|
|
88
|
+
codeHash: "0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e",
|
|
89
|
+
hashType: "type",
|
|
90
|
+
args: "0x",
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Logic script information for the iCKB logic contract.
|
|
94
|
+
*/
|
|
95
|
+
const ICKB_LOGIC = {
|
|
96
|
+
codeHash: "0x2a8100ab5990fa055ab1b50891702e1e895c7bd1df6322cd725c1a6115873bd3",
|
|
97
|
+
hashType: "data1",
|
|
98
|
+
args: "0x",
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* OwnedOwner lock script information.
|
|
102
|
+
*/
|
|
103
|
+
const OWNED_OWNER = {
|
|
104
|
+
codeHash: "0xacc79e07d107831feef4c70c9e683dac5644d5993b9cb106dca6e74baa381bd0",
|
|
105
|
+
hashType: "data1",
|
|
106
|
+
args: "0x",
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Order lock script information.
|
|
110
|
+
*/
|
|
111
|
+
const ORDER = {
|
|
112
|
+
codeHash: "0x49dfb6afee5cc8ac4225aeea8cb8928b150caf3cd92fea33750683c74b13254a",
|
|
113
|
+
hashType: "data1",
|
|
114
|
+
args: "0x",
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Mainnet dependency group cell dep.
|
|
118
|
+
*/
|
|
119
|
+
const MAINNET_DEP_GROUP = core_1.ccc.CellDep.from({
|
|
120
|
+
outPoint: {
|
|
121
|
+
txHash: "0x621a6f38de3b9f453016780edac3b26bfcbfa3e2ecb47c2da275471a5d3ed165",
|
|
122
|
+
index: "0x0",
|
|
123
|
+
},
|
|
124
|
+
depType: "depGroup",
|
|
125
|
+
});
|
|
126
|
+
/**
|
|
127
|
+
* Testnet dependency group cell dep.
|
|
128
|
+
*/
|
|
129
|
+
const TESTNET_DEP_GROUP = core_1.ccc.CellDep.from({
|
|
130
|
+
outPoint: {
|
|
131
|
+
txHash: "0xf7ece4fb33d8378344cab11fcd6a4c6f382fd4207ac921cf5821f30712dcd311",
|
|
132
|
+
index: "0x0",
|
|
133
|
+
},
|
|
134
|
+
depType: "depGroup",
|
|
135
|
+
});
|
|
136
|
+
/**
|
|
137
|
+
* Array of known bot scripts on the mainnet.
|
|
138
|
+
*/
|
|
139
|
+
const MAINNET_KNOWN_BOTS = [
|
|
140
|
+
{
|
|
141
|
+
codeHash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
|
|
142
|
+
hashType: "type",
|
|
143
|
+
args: "0xd096cb29e2f68a85a46bd6bf6cbee6327959ba64",
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
/**
|
|
147
|
+
* Array of known bot scripts on the testnet.
|
|
148
|
+
*/
|
|
149
|
+
const TESTNET_KNOWN_BOTS = [
|
|
150
|
+
{
|
|
151
|
+
codeHash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
|
|
152
|
+
hashType: "type",
|
|
153
|
+
args: "0xb4380110f7679ac31cefe4925485645d82bf619f",
|
|
154
|
+
},
|
|
155
|
+
];
|
|
156
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAmCA,8BAoDC;AAvFD,wCAAoC;AACpC,qCAA6E;AAC7E,mCAAuC;AACvC,uCAA2C;AAC3C,uCAAuE;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AoE;QACtE,KAAK,EAAE,KAAK;KACb;IACD,OAAO,EAAE,UAAU;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,iBAAiB,GAAG,UAAG,CAAC,OAAO,CAAC,IAAI,CAAC;IACzC,QAAQ,EAAE;QACR,MAAM,EACJ,oEAAoE;QACtE,KAAK,EAAE,KAAK;KACb;IACD,OAAO,EAAE,UAAU;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB;QACE,QAAQ,EACN,oEAAoE;QACtE,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,4CAA4C;KACnD;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB;QACE,QAAQ,EACN,oEAAoE;QACtE,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,4CAA4C;KACnD;CACF,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,190 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { DaoManager, type DaoCell } from "@ickb/dao";
|
|
5
|
-
import { OrderManager, type OrderCell, type OrderGroup } from "@ickb/order";
|
|
6
|
-
/**
|
|
7
|
-
* Controller for managing iCKB operations.
|
|
8
|
-
*/
|
|
9
|
-
export declare class IckbController {
|
|
10
|
-
readonly ickbUdtManager: IckbUdtManager;
|
|
11
|
-
readonly logicManager: LogicManager;
|
|
12
|
-
readonly ownedOwnerManager: OwnedOwnerManager;
|
|
13
|
-
readonly orderManager: OrderManager;
|
|
14
|
-
readonly daoManager: DaoManager;
|
|
15
|
-
readonly bots: ccc.Script[];
|
|
16
|
-
/**
|
|
17
|
-
* Creates an instance of IckbController.
|
|
18
|
-
* @param ickbUdtManager - The manager for iCKB UDT operations.
|
|
19
|
-
* @param logicManager - The logic manager for handling business logic.
|
|
20
|
-
* @param ownedOwnerManager - The manager for owned owner operations.
|
|
21
|
-
* @param orderManager - The manager for order operations.
|
|
22
|
-
* @param daoManager - The manager for DAO operations.
|
|
23
|
-
*/
|
|
24
|
-
constructor(ickbUdtManager: IckbUdtManager, logicManager: LogicManager, ownedOwnerManager: OwnedOwnerManager, orderManager: OrderManager, daoManager: DaoManager, bots: ccc.Script[]);
|
|
25
|
-
/**
|
|
26
|
-
* Creates an instance of IckbController from script dependencies.
|
|
27
|
-
* @param deps - The script dependencies.
|
|
28
|
-
* @param deps.udt - The script dependencies for UDT.
|
|
29
|
-
* @param deps.dao - The script dependencies for DAO.
|
|
30
|
-
* @param deps.ickbLogic - The script dependencies for iCKB logic.
|
|
31
|
-
* @param deps.ownedOwner - The script dependencies for owned owner.
|
|
32
|
-
* @param deps.order - The script dependencies for order.
|
|
33
|
-
* @returns An instance of IckbController.
|
|
34
|
-
*/
|
|
35
|
-
static fromDeps(deps: {
|
|
36
|
-
udt: ScriptDeps;
|
|
37
|
-
dao: ScriptDeps;
|
|
38
|
-
ickbLogic: ScriptDeps;
|
|
39
|
-
ownedOwner: ScriptDeps;
|
|
40
|
-
order: ScriptDeps;
|
|
41
|
-
}, bots: ccc.Script[]): IckbController;
|
|
42
|
-
/**
|
|
43
|
-
* Previews the conversion between CKB and UDT.
|
|
44
|
-
* @param conversion - The conversion parameters.
|
|
45
|
-
* @param conversion.isCkb2Udt - Indicates if the conversion is from CKB to UDT.
|
|
46
|
-
* @param conversion.amount - The amount to convert.
|
|
47
|
-
* @param conversion.rate - The exchange rate for conversion.
|
|
48
|
-
* @param conversion.fee - The fee for the conversion.
|
|
49
|
-
* @returns The rate and converted amount.
|
|
50
|
-
*
|
|
51
|
-
* Fee meaning examples:
|
|
52
|
-
* - 100000n => 0.001%
|
|
53
|
-
* - 10000n => 0.01%
|
|
54
|
-
* - 1000n => 0.1%
|
|
55
|
-
* - 100n => 1%
|
|
56
|
-
* - 10n => 10%
|
|
57
|
-
* - 1n => 100%
|
|
58
|
-
* - less than 1n => 0%
|
|
59
|
-
*/
|
|
60
|
-
static previewConversion(conversion: {
|
|
61
|
-
isCkb2Udt: boolean;
|
|
62
|
-
amount: ccc.FixedPoint;
|
|
63
|
-
rate: ExchangeRatio | ccc.ClientBlockHeader;
|
|
64
|
-
fee: ccc.Num;
|
|
65
|
-
}): {
|
|
66
|
-
rate: ExchangeRatio;
|
|
67
|
-
convertedAmount: ccc.FixedPoint;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Converts between CKB and UDT based on the provided options.
|
|
71
|
-
* @param options - The conversion options.
|
|
72
|
-
* @param options.conversion - The conversion parameters.
|
|
73
|
-
* @param options.conversion.isCkb2Udt - Indicates if the conversion is from CKB to UDT.
|
|
74
|
-
* @param options.conversion.amount - The amount to convert.
|
|
75
|
-
* @param options.conversion.rate - The exchange rate for conversion.
|
|
76
|
-
* @param options.conversion.ckbMinMatchLog - Minimum CKB match log (optional).
|
|
77
|
-
* @param options.conversion.ckbMinFee - Minimum CKB fee (optional).
|
|
78
|
-
* @param options.signer - The signer for the transaction.
|
|
79
|
-
* @param options.userCells - The user's cells.
|
|
80
|
-
* @param options.system - The current system state.
|
|
81
|
-
* @param options.filters - The filters for the conversion.
|
|
82
|
-
* @param options.filters.isReadyOnly - Indicates if only ready conversions should be considered.
|
|
83
|
-
* @param options.filters.isFulfilledOnly - Indicates if only fulfilled conversions should be considered.
|
|
84
|
-
* @returns A promise that resolves to the conversion result or undefined.
|
|
85
|
-
*/
|
|
86
|
-
convert(options: {
|
|
87
|
-
conversion: Parameters<typeof IckbController.previewConversion>[0] & {
|
|
88
|
-
ckbMinMatchLog?: number;
|
|
89
|
-
ckbMinFee?: ccc.Num;
|
|
90
|
-
};
|
|
91
|
-
signer: ccc.Signer;
|
|
92
|
-
userCells: UserCells;
|
|
93
|
-
system: SystemState;
|
|
94
|
-
filters: {
|
|
95
|
-
isReadyOnly: boolean;
|
|
96
|
-
isFulfilledOnly: boolean;
|
|
97
|
-
};
|
|
98
|
-
}): Promise<Conversion | undefined>;
|
|
99
|
-
/**
|
|
100
|
-
* Attempts to perform a conversion based on the provided parameters.
|
|
101
|
-
* @param n - The size of deposit to make or withdraw from.
|
|
102
|
-
* @param conversion - The conversion parameters.
|
|
103
|
-
* @param conversion.isCkb2Udt - Indicates if the conversion is from CKB to UDT.
|
|
104
|
-
* @param conversion.amount - The amount to convert.
|
|
105
|
-
* @param conversion.rate - The exchange rate for conversion.
|
|
106
|
-
* @param conversion.info - Additional information for the conversion.
|
|
107
|
-
* @param conversion.ckbMinFee - Minimum CKB fee.
|
|
108
|
-
* @param conversion.lock - The script lock for the transaction.
|
|
109
|
-
* @param options - Additional options for the conversion.
|
|
110
|
-
* @returns A promise that resolves to the conversion result or undefined.
|
|
111
|
-
*/
|
|
112
|
-
private attempt;
|
|
113
|
-
/**
|
|
114
|
-
* Retrieves the L1 state based on the provided parameters.
|
|
115
|
-
* @param client - The client to interact with the blockchain.
|
|
116
|
-
* @param filter - The set of filters to apply.
|
|
117
|
-
* @param locks - The script locks to filter the user cells.
|
|
118
|
-
* @param options - Optional parameters for the state retrieval.
|
|
119
|
-
* @param options.minLockUp - The minimum lock-up period (optional).
|
|
120
|
-
* @param options.maxLockUp - The maximum lock-up period (optional).
|
|
121
|
-
* @returns A promise that resolves to an object containing the system state and user cells.
|
|
122
|
-
*/
|
|
123
|
-
getL1State(client: ccc.Client, filter: Set<keyof UserCells | "depositPool" | "ckbBots">, locks: ccc.Script[], options?: {
|
|
124
|
-
minLockUp?: ccc.Epoch;
|
|
125
|
-
maxLockUp?: ccc.Epoch;
|
|
126
|
-
}): Promise<{
|
|
127
|
-
system: SystemState;
|
|
128
|
-
user: UserCells;
|
|
129
|
-
}>;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Represents the state of the system.
|
|
133
|
-
*/
|
|
134
|
-
export interface SystemState {
|
|
135
|
-
/** The fee rate for transactions. */
|
|
136
|
-
feeRate: ccc.Num;
|
|
137
|
-
/** The tip for the current block header. */
|
|
138
|
-
tip: ccc.ClientBlockHeader;
|
|
139
|
-
/** The exchange ratio between CKB and UDT. */
|
|
140
|
-
exchangeRatio: ExchangeRatio;
|
|
141
|
-
/** The deposit cap expressed in CKB. */
|
|
142
|
-
ckbDepositCap: ccc.FixedPoint;
|
|
143
|
-
/** The deposit cap expressed in iCKB. */
|
|
144
|
-
udtDepositCap: ccc.FixedPoint;
|
|
145
|
-
/**
|
|
146
|
-
* The deposit pool containing iCKB deposit cells with cumulative iCKB amounts.
|
|
147
|
-
*/
|
|
148
|
-
depositPool: (IckbDepositCell & {
|
|
149
|
-
udtCumulative: bigint;
|
|
150
|
-
})[];
|
|
151
|
-
/**
|
|
152
|
-
* The order pool containing non-user order cells.
|
|
153
|
-
*/
|
|
154
|
-
orderPool: OrderCell[];
|
|
155
|
-
/**
|
|
156
|
-
* The ckb held by bots ready to match incoming iCKB to CKB conversions.
|
|
157
|
-
*/
|
|
158
|
-
ckbBots: ccc.FixedPoint;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Represents the user cells in the system.
|
|
162
|
-
*/
|
|
163
|
-
export interface UserCells {
|
|
164
|
-
/** The capacities owned by the user. */
|
|
165
|
-
capacities: CapacityCell[];
|
|
166
|
-
/** The UDTs owned by the user. */
|
|
167
|
-
udts: UdtCell[];
|
|
168
|
-
/** The receipts associated with the user's transactions. */
|
|
169
|
-
receipts: ReceiptCell[];
|
|
170
|
-
/** The withdrawal groups for the user. */
|
|
171
|
-
withdrawalGroups: WithdrawalGroup[];
|
|
172
|
-
/** The orders placed by the user. */
|
|
173
|
-
orders: OrderGroup[];
|
|
174
|
-
/** The classical/non-iCKB deposits made by the user. */
|
|
175
|
-
deposits: DaoCell[];
|
|
176
|
-
/** The classical/non-iCKB withdrawal requests made by the user. */
|
|
177
|
-
withdrawalRequests: DaoCell[];
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Represents a conversion transaction.
|
|
181
|
-
*/
|
|
182
|
-
export interface Conversion {
|
|
183
|
-
/** The smart transaction associated with the conversion. */
|
|
184
|
-
tx: SmartTransaction;
|
|
185
|
-
/** The fee in CKB for the order created by the conversion. */
|
|
186
|
-
ckbFee: ccc.FixedPoint;
|
|
187
|
-
/** The estimated maturity epoch for conversion. */
|
|
188
|
-
maturity: ccc.Epoch;
|
|
189
|
-
}
|
|
1
|
+
export * from "./sdk.js";
|
|
2
|
+
export * from "./codec.js";
|
|
3
|
+
export * from "./constants.js";
|
|
190
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|