@ckb-ccc/core 0.0.7-alpha.0 → 0.0.7-alpha.2
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/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +6 -3
- package/dist.commonjs/address/address.advanced.d.ts +24 -29
- package/dist.commonjs/address/address.advanced.js +89 -115
- package/dist.commonjs/address/advanced.d.ts +1 -1
- package/dist.commonjs/address/advanced.js +14 -30
- package/dist.commonjs/address/index.d.ts +44 -51
- package/dist.commonjs/address/index.js +65 -84
- package/dist.commonjs/advanced.d.ts +1 -1
- package/dist.commonjs/advanced.js +22 -47
- package/dist.commonjs/advancedBarrel.d.ts +1 -1
- package/dist.commonjs/advancedBarrel.js +14 -30
- package/dist.commonjs/barrel.d.ts +1 -1
- package/dist.commonjs/barrel.js +14 -30
- package/dist.commonjs/bytes/advanced.d.ts +2 -11
- package/dist.commonjs/bytes/index.d.ts +3 -9
- package/dist.commonjs/bytes/index.js +26 -28
- package/dist.commonjs/ckb/advanced.d.ts +1 -1
- package/dist.commonjs/ckb/advanced.js +22 -47
- package/dist.commonjs/ckb/index.d.ts +1 -1
- package/dist.commonjs/ckb/index.js +14 -30
- package/dist.commonjs/ckb/molecule.advanced/generated.d.ts +260 -420
- package/dist.commonjs/ckb/molecule.advanced/generated.js +1332 -1536
- package/dist.commonjs/ckb/molecule.advanced/index.d.ts +3 -3
- package/dist.commonjs/ckb/molecule.advanced/index.js +18 -34
- package/dist.commonjs/ckb/script.advanced.d.ts +1 -1
- package/dist.commonjs/ckb/script.advanced.js +9 -12
- package/dist.commonjs/ckb/script.d.ts +117 -121
- package/dist.commonjs/ckb/script.js +176 -220
- package/dist.commonjs/ckb/transaction.advanced.d.ts +1 -1
- package/dist.commonjs/ckb/transaction.advanced.js +4 -4
- package/dist.commonjs/ckb/transaction.d.ts +717 -792
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +1156 -1382
- package/dist.commonjs/client/advanced.d.ts +1 -1
- package/dist.commonjs/client/advanced.js +14 -30
- package/dist.commonjs/client/client.advanced.d.ts +6 -23
- package/dist.commonjs/client/client.advanced.js +61 -89
- package/dist.commonjs/client/client.d.ts +53 -113
- package/dist.commonjs/client/client.js +181 -214
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts +4 -8
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +127 -144
- package/dist.commonjs/client/clientPublicMainnet.d.ts +6 -8
- package/dist.commonjs/client/clientPublicMainnet.js +15 -17
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts +3 -6
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +179 -204
- package/dist.commonjs/client/clientPublicTestnet.d.ts +6 -8
- package/dist.commonjs/client/clientPublicTestnet.js +13 -13
- package/dist.commonjs/client/clientTypes.advanced.d.ts +14 -14
- package/dist.commonjs/client/clientTypes.advanced.js +1 -1
- package/dist.commonjs/client/clientTypes.d.ts +26 -51
- package/dist.commonjs/client/clientTypes.js +22 -56
- package/dist.commonjs/client/index.d.ts +1 -1
- package/dist.commonjs/client/index.js +14 -30
- package/dist.commonjs/client/jsonRpc/advanced.d.ts +1 -1
- package/dist.commonjs/client/jsonRpc/advanced.js +14 -30
- package/dist.commonjs/client/jsonRpc/index.d.ts +75 -94
- package/dist.commonjs/client/jsonRpc/index.js +108 -135
- package/dist.commonjs/client/jsonRpc/transformers.d.ts +36 -76
- package/dist.commonjs/client/jsonRpc/transformers.js +152 -174
- package/dist.commonjs/client/jsonRpc/types.d.ts +38 -38
- package/dist.commonjs/fixedPoint/index.d.ts +3 -9
- package/dist.commonjs/fixedPoint/index.js +20 -26
- package/dist.commonjs/fixedPoint/index.test.d.ts +1 -1
- package/dist.commonjs/fixedPoint/index.test.js +36 -42
- package/dist.commonjs/hasher/advanced.d.ts +1 -1
- package/dist.commonjs/hasher/index.d.ts +36 -36
- package/dist.commonjs/hasher/index.js +47 -54
- package/dist.commonjs/hex/index.d.ts +1 -1
- package/dist.commonjs/hex/index.js +1 -1
- package/dist.commonjs/index.d.ts +1 -1
- package/dist.commonjs/index.js +22 -47
- package/dist.commonjs/num/index.d.ts +1 -1
- package/dist.commonjs/num/index.js +27 -39
- package/dist.commonjs/signer/btc/index.d.ts +1 -1
- package/dist.commonjs/signer/btc/index.js +14 -30
- package/dist.commonjs/signer/btc/signerBtc.d.ts +47 -47
- package/dist.commonjs/signer/btc/signerBtc.js +66 -89
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +45 -45
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +52 -52
- package/dist.commonjs/signer/btc/verify.d.ts +2 -6
- package/dist.commonjs/signer/btc/verify.js +3 -10
- package/dist.commonjs/signer/ckb/index.d.ts +1 -1
- package/dist.commonjs/signer/ckb/index.js +14 -30
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +45 -45
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +56 -56
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts +2 -6
- package/dist.commonjs/signer/ckb/verifyJoyId.js +8 -11
- package/dist.commonjs/signer/dummy/alwaysError.d.ts +4 -4
- package/dist.commonjs/signer/dummy/alwaysError.js +7 -7
- package/dist.commonjs/signer/dummy/dummy.d.ts +7 -7
- package/dist.commonjs/signer/dummy/dummy.js +16 -16
- package/dist.commonjs/signer/dummy/index.d.ts +1 -1
- package/dist.commonjs/signer/dummy/index.js +14 -30
- package/dist.commonjs/signer/dummy/openLink.d.ts +4 -4
- package/dist.commonjs/signer/dummy/openLink.js +7 -7
- package/dist.commonjs/signer/evm/index.d.ts +1 -1
- package/dist.commonjs/signer/evm/index.js +14 -30
- package/dist.commonjs/signer/evm/signerEvm.d.ts +38 -42
- package/dist.commonjs/signer/evm/signerEvm.js +70 -105
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +37 -37
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +42 -42
- package/dist.commonjs/signer/evm/verify.d.ts +2 -6
- package/dist.commonjs/signer/evm/verify.js +2 -7
- package/dist.commonjs/signer/index.d.ts +1 -1
- package/dist.commonjs/signer/index.js +14 -30
- package/dist.commonjs/signer/nostr/index.d.ts +1 -1
- package/dist.commonjs/signer/nostr/index.js +14 -30
- package/dist.commonjs/signer/nostr/signerNostr.d.ts +57 -57
- package/dist.commonjs/signer/nostr/signerNostr.js +71 -100
- package/dist.commonjs/signer/nostr/verify.d.ts +3 -9
- package/dist.commonjs/signer/nostr/verify.js +39 -50
- package/dist.commonjs/signer/signer/index.d.ts +150 -156
- package/dist.commonjs/signer/signer/index.js +181 -208
- package/dist.commonjs/utils/index.d.ts +8 -38
- package/dist.commonjs/utils/index.js +12 -18
- package/package.json +2 -2
- package/src/ckb/transaction.ts +9 -5
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}
|
|
21
|
-
: function (o, m, k, k2) {
|
|
22
|
-
if (k2 === undefined) k2 = k;
|
|
23
|
-
o[k2] = m[k];
|
|
24
|
-
});
|
|
25
|
-
var __exportStar =
|
|
26
|
-
(this && this.__exportStar) ||
|
|
27
|
-
function (m, exports) {
|
|
28
|
-
for (var p in m)
|
|
29
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
30
|
-
__createBinding(exports, m, p);
|
|
31
|
-
};
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
32
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
17
|
__exportStar(require("./client.advanced"), exports);
|
|
34
18
|
__exportStar(require("./clientPublicMainnet.advanced"), exports);
|
|
@@ -2,26 +2,9 @@ import { CellLike, ScriptLike } from "../ckb";
|
|
|
2
2
|
import { HexLike } from "../hex";
|
|
3
3
|
import { NumLike } from "../num";
|
|
4
4
|
import { ClientCollectableSearchKeyLike } from "./clientTypes.advanced";
|
|
5
|
-
export declare function filterData(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
): boolean;
|
|
10
|
-
|
|
11
|
-
valueLike: ScriptLike | undefined,
|
|
12
|
-
filterLike: ScriptLike | undefined,
|
|
13
|
-
filterMode: "prefix" | "exact" | "partial",
|
|
14
|
-
): boolean;
|
|
15
|
-
export declare function filterNumByRange(
|
|
16
|
-
lengthLike: NumLike,
|
|
17
|
-
range: [NumLike, NumLike] | undefined,
|
|
18
|
-
): boolean;
|
|
19
|
-
export declare function filterScriptByLenRange(
|
|
20
|
-
valueLike?: ScriptLike,
|
|
21
|
-
scriptLenRange?: [NumLike, NumLike],
|
|
22
|
-
): boolean;
|
|
23
|
-
export declare function filterCell(
|
|
24
|
-
searchKeyLike: ClientCollectableSearchKeyLike,
|
|
25
|
-
cellLike: CellLike,
|
|
26
|
-
): boolean;
|
|
27
|
-
//# sourceMappingURL=client.advanced.d.ts.map
|
|
5
|
+
export declare function filterData(dataLike: HexLike, filterLike: HexLike | undefined, filterMode: "exact" | "prefix" | "partial"): boolean;
|
|
6
|
+
export declare function filterScript(valueLike: ScriptLike | undefined, filterLike: ScriptLike | undefined, filterMode: "prefix" | "exact" | "partial"): boolean;
|
|
7
|
+
export declare function filterNumByRange(lengthLike: NumLike, range: [NumLike, NumLike] | undefined): boolean;
|
|
8
|
+
export declare function filterScriptByLenRange(valueLike?: ScriptLike, scriptLenRange?: [NumLike, NumLike]): boolean;
|
|
9
|
+
export declare function filterCell(searchKeyLike: ClientCollectableSearchKeyLike, cellLike: CellLike): boolean;
|
|
10
|
+
//# sourceMappingURL=client.advanced.d.ts.map
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filterCell =
|
|
4
|
-
exports.filterScriptByLenRange =
|
|
5
|
-
exports.filterNumByRange =
|
|
6
|
-
exports.filterScript =
|
|
7
|
-
exports.filterData =
|
|
8
|
-
void 0;
|
|
3
|
+
exports.filterCell = exports.filterScriptByLenRange = exports.filterNumByRange = exports.filterScript = exports.filterData = void 0;
|
|
9
4
|
const bytes_1 = require("../bytes");
|
|
10
5
|
const ckb_1 = require("../ckb");
|
|
11
6
|
const hex_1 = require("../hex");
|
|
@@ -13,104 +8,81 @@ const num_1 = require("../num");
|
|
|
13
8
|
const clientTypes_1 = require("./clientTypes");
|
|
14
9
|
const clientTypes_advanced_1 = require("./clientTypes.advanced");
|
|
15
10
|
function filterData(dataLike, filterLike, filterMode) {
|
|
16
|
-
|
|
11
|
+
if (!filterLike) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
const data = (0, hex_1.hexFrom)(dataLike);
|
|
15
|
+
const filter = (0, hex_1.hexFrom)(filterLike);
|
|
16
|
+
if ((filterMode === "exact" && data !== filter) ||
|
|
17
|
+
(filterMode === "prefix" && !data.startsWith(filter)) ||
|
|
18
|
+
(filterMode === "partial" && data.search(filter) === -1)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
17
21
|
return true;
|
|
18
|
-
}
|
|
19
|
-
const data = (0, hex_1.hexFrom)(dataLike);
|
|
20
|
-
const filter = (0, hex_1.hexFrom)(filterLike);
|
|
21
|
-
if (
|
|
22
|
-
(filterMode === "exact" && data !== filter) ||
|
|
23
|
-
(filterMode === "prefix" && !data.startsWith(filter)) ||
|
|
24
|
-
(filterMode === "partial" && data.search(filter) === -1)
|
|
25
|
-
) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
22
|
}
|
|
30
23
|
exports.filterData = filterData;
|
|
31
24
|
function filterScript(valueLike, filterLike, filterMode) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return
|
|
45
|
-
}
|
|
46
|
-
return filterData(value.args, filter?.args, filterMode);
|
|
25
|
+
if (!filterLike) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
if (!valueLike) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
const value = ckb_1.Script.from(valueLike);
|
|
32
|
+
const filter = ckb_1.Script.from(filterLike);
|
|
33
|
+
if (value.codeHash !== filter.codeHash ||
|
|
34
|
+
value.hashType !== filter.hashType) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return filterData(value.args, filter?.args, filterMode);
|
|
47
38
|
}
|
|
48
39
|
exports.filterScript = filterScript;
|
|
49
40
|
function filterNumByRange(lengthLike, range) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
);
|
|
57
|
-
return lower <= length && length < upper;
|
|
41
|
+
if (!range) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
const length = (0, num_1.numFrom)(lengthLike);
|
|
45
|
+
const [lower, upper] = (0, clientTypes_advanced_1.clientSearchKeyRangeFrom)(range);
|
|
46
|
+
return lower <= length && length < upper;
|
|
58
47
|
}
|
|
59
48
|
exports.filterNumByRange = filterNumByRange;
|
|
60
49
|
function filterScriptByLenRange(valueLike, scriptLenRange) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
const len = (() => {
|
|
65
|
-
if (!valueLike) {
|
|
66
|
-
return 0;
|
|
50
|
+
if (!scriptLenRange) {
|
|
51
|
+
return true;
|
|
67
52
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
53
|
+
const len = (() => {
|
|
54
|
+
if (!valueLike) {
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
return (0, bytes_1.bytesFrom)(ckb_1.Script.from(valueLike).args).length + 33;
|
|
58
|
+
})();
|
|
59
|
+
return filterNumByRange(len, scriptLenRange);
|
|
73
60
|
}
|
|
74
61
|
exports.filterScriptByLenRange = filterScriptByLenRange;
|
|
75
62
|
function filterCell(searchKeyLike, cellLike) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return false;
|
|
63
|
+
const key = clientTypes_1.ClientIndexerSearchKey.from(searchKeyLike);
|
|
64
|
+
const cell = ckb_1.Cell.from(cellLike);
|
|
65
|
+
if (key.scriptType === "lock") {
|
|
66
|
+
if (!filterScript(cell.cellOutput.lock, key.script, key.scriptSearchMode) ||
|
|
67
|
+
!filterScript(cell.cellOutput.type, key.filter?.script, "prefix") ||
|
|
68
|
+
!filterScriptByLenRange(cell.cellOutput.type, key.filter?.scriptLenRange)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
85
71
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
) {
|
|
93
|
-
return false;
|
|
72
|
+
if (key.scriptType === "type") {
|
|
73
|
+
if (!filterScript(cell.cellOutput.type, key.script, key.scriptSearchMode) ||
|
|
74
|
+
!filterScript(cell.cellOutput.lock, key.filter?.script, "prefix") ||
|
|
75
|
+
!filterScriptByLenRange(cell.cellOutput.lock, key.filter?.scriptLenRange)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
94
78
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
(0, bytes_1.bytesFrom)(cell.outputData).length,
|
|
104
|
-
key.filter?.outputDataLenRange,
|
|
105
|
-
)
|
|
106
|
-
) {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
if (
|
|
110
|
-
!filterNumByRange(cell.cellOutput.capacity, key.filter?.outputCapacityRange)
|
|
111
|
-
) {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
return true;
|
|
79
|
+
if (!filterData(cell.outputData, key.filter?.outputData, key.filter?.outputDataSearchMode ?? "prefix") ||
|
|
80
|
+
!filterNumByRange((0, bytes_1.bytesFrom)(cell.outputData).length, key.filter?.outputDataLenRange)) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (!filterNumByRange(cell.cellOutput.capacity, key.filter?.outputCapacityRange)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
115
87
|
}
|
|
116
88
|
exports.filterCell = filterCell;
|
|
@@ -1,124 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Cell,
|
|
3
|
-
CellDep,
|
|
4
|
-
CellDepLike,
|
|
5
|
-
CellLike,
|
|
6
|
-
OutPointLike,
|
|
7
|
-
Script,
|
|
8
|
-
ScriptLike,
|
|
9
|
-
TransactionLike,
|
|
10
|
-
} from "../ckb";
|
|
1
|
+
import { Cell, CellDep, CellDepLike, CellLike, OutPointLike, Script, ScriptLike, TransactionLike } from "../ckb";
|
|
11
2
|
import { Hex, HexLike } from "../hex";
|
|
12
3
|
import { Num, NumLike } from "../num";
|
|
13
|
-
import {
|
|
14
|
-
ClientFindCellsResponse,
|
|
15
|
-
ClientIndexerSearchKeyLike,
|
|
16
|
-
ClientTransactionResponse,
|
|
17
|
-
OutputsValidator,
|
|
18
|
-
} from "./clientTypes";
|
|
4
|
+
import { ClientFindCellsResponse, ClientIndexerSearchKeyLike, ClientTransactionResponse, OutputsValidator } from "./clientTypes";
|
|
19
5
|
import { ClientCollectableSearchKeyLike } from "./clientTypes.advanced";
|
|
20
6
|
export declare enum KnownScript {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
Secp256k1Blake160 = "Secp256k1Blake160",
|
|
8
|
+
Secp256k1Multisig = "Secp256k1Multisig",
|
|
9
|
+
AnyoneCanPay = "AnyoneCanPay",
|
|
10
|
+
TypeId = "TypeId",
|
|
11
|
+
XUdt = "XUdt",
|
|
12
|
+
JoyId = "JoyId",
|
|
13
|
+
COTA = "COTA",
|
|
14
|
+
OmniLock = "OmniLock",
|
|
15
|
+
NostrLock = "NostrLock",
|
|
16
|
+
SingleUseLock = "SingleUseLock",
|
|
17
|
+
OutputTypeProxyLock = "OutputTypeProxyLock"
|
|
32
18
|
}
|
|
33
19
|
export type CellDepInfoLike = {
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
cellDep: CellDepLike;
|
|
21
|
+
type?: ScriptLike;
|
|
36
22
|
};
|
|
37
23
|
export declare class CellDepInfo {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
cellDep: CellDep;
|
|
25
|
+
type?: Script | undefined;
|
|
26
|
+
constructor(cellDep: CellDep, type?: Script | undefined);
|
|
27
|
+
static from(cellDepInfoLike: CellDepInfoLike): CellDepInfo;
|
|
42
28
|
}
|
|
43
29
|
export declare abstract class Client {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
order?: "asc" | "desc",
|
|
68
|
-
limit?:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
key: ClientIndexerSearchKeyLike
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
findCells(
|
|
78
|
-
key: ClientIndexerSearchKeyLike,
|
|
79
|
-
order?: "asc" | "desc",
|
|
80
|
-
limit?: number,
|
|
81
|
-
): AsyncGenerator<Cell>;
|
|
82
|
-
/**
|
|
83
|
-
* Find cells by search key designed for collectable cells.
|
|
84
|
-
*
|
|
85
|
-
* @param key - The search key.
|
|
86
|
-
* @returns A async generator for yielding cells.
|
|
87
|
-
*/
|
|
88
|
-
findCellsByCollectableSearchKey(
|
|
89
|
-
keyLike: ClientCollectableSearchKeyLike,
|
|
90
|
-
order?: "asc" | "desc",
|
|
91
|
-
limit?: number,
|
|
92
|
-
): AsyncGenerator<Cell>;
|
|
93
|
-
findCellsByLockAndType(
|
|
94
|
-
lock: ScriptLike,
|
|
95
|
-
type: ScriptLike,
|
|
96
|
-
withData?: boolean,
|
|
97
|
-
order?: "asc" | "desc",
|
|
98
|
-
limit?: number,
|
|
99
|
-
): AsyncGenerator<Cell>;
|
|
100
|
-
findCellsByType(
|
|
101
|
-
type: ScriptLike,
|
|
102
|
-
withData?: boolean,
|
|
103
|
-
order?: "asc" | "desc",
|
|
104
|
-
limit?: number,
|
|
105
|
-
): AsyncGenerator<Cell>;
|
|
106
|
-
findSingletonCellByType(
|
|
107
|
-
type: ScriptLike,
|
|
108
|
-
withData?: boolean,
|
|
109
|
-
): Promise<Cell | undefined>;
|
|
110
|
-
getCellDeps(
|
|
111
|
-
...cellDepsInfoLike: (CellDepInfoLike | CellDepInfoLike[])[]
|
|
112
|
-
): Promise<CellDep[]>;
|
|
113
|
-
abstract getCellsCapacity(key: ClientIndexerSearchKeyLike): Promise<Num>;
|
|
114
|
-
getBalanceSingle(lock: ScriptLike): Promise<Num>;
|
|
115
|
-
getBalance(locks: ScriptLike[]): Promise<Num>;
|
|
116
|
-
sendTransaction(
|
|
117
|
-
transaction: TransactionLike,
|
|
118
|
-
validator?: OutputsValidator,
|
|
119
|
-
): Promise<Hex>;
|
|
120
|
-
getTransaction(
|
|
121
|
-
txHashLike: HexLike,
|
|
122
|
-
): Promise<ClientTransactionResponse | null>;
|
|
30
|
+
private readonly cachedTransactions;
|
|
31
|
+
private readonly unusableOutPoints;
|
|
32
|
+
private readonly usableCells;
|
|
33
|
+
private readonly knownCells;
|
|
34
|
+
abstract get url(): string;
|
|
35
|
+
abstract get addressPrefix(): string;
|
|
36
|
+
abstract getKnownScript(script: KnownScript): Promise<Pick<Script, "codeHash" | "hashType"> & {
|
|
37
|
+
cellDeps: CellDepInfo[];
|
|
38
|
+
}>;
|
|
39
|
+
markUsable(cellLike: CellLike): Promise<void>;
|
|
40
|
+
markUnusable(outPointLike: OutPointLike): Promise<void>;
|
|
41
|
+
abstract sendTransactionNoCache(transaction: TransactionLike, validator?: OutputsValidator): Promise<Hex>;
|
|
42
|
+
abstract getTransactionNoCache(txHash: HexLike): Promise<ClientTransactionResponse | null>;
|
|
43
|
+
getCell(outPointLike: OutPointLike): Promise<Cell | null>;
|
|
44
|
+
abstract findCellsPagedNoCache(key: ClientIndexerSearchKeyLike, order?: "asc" | "desc", limit?: NumLike, after?: string): Promise<ClientFindCellsResponse>;
|
|
45
|
+
findCellsPaged(key: ClientIndexerSearchKeyLike, order?: "asc" | "desc", limit?: NumLike, after?: string): Promise<ClientFindCellsResponse>;
|
|
46
|
+
findCells(key: ClientIndexerSearchKeyLike, order?: "asc" | "desc", limit?: number): AsyncGenerator<Cell>;
|
|
47
|
+
/**
|
|
48
|
+
* Find cells by search key designed for collectable cells.
|
|
49
|
+
*
|
|
50
|
+
* @param key - The search key.
|
|
51
|
+
* @returns A async generator for yielding cells.
|
|
52
|
+
*/
|
|
53
|
+
findCellsByCollectableSearchKey(keyLike: ClientCollectableSearchKeyLike, order?: "asc" | "desc", limit?: number): AsyncGenerator<Cell>;
|
|
54
|
+
findCellsByLockAndType(lock: ScriptLike, type: ScriptLike, withData?: boolean, order?: "asc" | "desc", limit?: number): AsyncGenerator<Cell>;
|
|
55
|
+
findCellsByType(type: ScriptLike, withData?: boolean, order?: "asc" | "desc", limit?: number): AsyncGenerator<Cell>;
|
|
56
|
+
findSingletonCellByType(type: ScriptLike, withData?: boolean): Promise<Cell | undefined>;
|
|
57
|
+
getCellDeps(...cellDepsInfoLike: (CellDepInfoLike | CellDepInfoLike[])[]): Promise<CellDep[]>;
|
|
58
|
+
abstract getCellsCapacity(key: ClientIndexerSearchKeyLike): Promise<Num>;
|
|
59
|
+
getBalanceSingle(lock: ScriptLike): Promise<Num>;
|
|
60
|
+
getBalance(locks: ScriptLike[]): Promise<Num>;
|
|
61
|
+
sendTransaction(transaction: TransactionLike, validator?: OutputsValidator): Promise<Hex>;
|
|
62
|
+
getTransaction(txHashLike: HexLike): Promise<ClientTransactionResponse | null>;
|
|
123
63
|
}
|
|
124
|
-
//# sourceMappingURL=client.d.ts.map
|
|
64
|
+
//# sourceMappingURL=client.d.ts.map
|