@ckb-ccc/core 0.0.5-alpha.10 → 0.0.5-alpha.13
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 +15 -4
- package/dist/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +37 -12
- package/dist/client/client.js +1 -1
- package/dist.commonjs/address/address.advanced.d.ts +24 -29
- package/dist.commonjs/address/address.advanced.js +92 -114
- 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 +68 -87
- 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 +76 -76
- package/dist.commonjs/ckb/script.js +126 -166
- 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 +543 -570
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +747 -839
- package/dist.commonjs/client/advanced.d.ts +1 -1
- package/dist.commonjs/client/advanced.js +14 -30
- package/dist.commonjs/client/client.d.ts +21 -52
- package/dist.commonjs/client/client.js +57 -66
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts +2 -5
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +24 -30
- package/dist.commonjs/client/clientPublicMainnet.d.ts +4 -6
- package/dist.commonjs/client/clientPublicMainnet.js +9 -9
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts +2 -5
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +24 -30
- package/dist.commonjs/client/clientPublicTestnet.d.ts +4 -6
- package/dist.commonjs/client/clientPublicTestnet.js +9 -9
- package/dist.commonjs/client/clientTypes.d.ts +36 -51
- package/dist.commonjs/client/clientTypes.js +19 -34
- 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 -92
- package/dist.commonjs/client/jsonRpc/index.js +108 -135
- package/dist.commonjs/client/jsonRpc/transformers.d.ts +38 -78
- package/dist.commonjs/client/jsonRpc/transformers.js +150 -175
- 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 +45 -52
- 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 +19 -30
- 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 +65 -85
- 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 +2 -5
- 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 +68 -100
- 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/signer/index.d.ts +153 -159
- package/dist.commonjs/signer/signer/index.js +181 -204
- package/dist.commonjs/utils/index.d.ts +8 -36
- package/dist.commonjs/utils/index.js +12 -18
- package/package.json +2 -2
- package/src/ckb/transaction.ts +46 -13
|
@@ -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("./clientPublicMainnet.advanced"), exports);
|
|
34
18
|
__exportStar(require("./clientPublicTestnet.advanced"), exports);
|
|
@@ -1,58 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Cell,
|
|
3
|
-
OutPointLike,
|
|
4
|
-
Script,
|
|
5
|
-
ScriptLike,
|
|
6
|
-
TransactionLike,
|
|
7
|
-
} from "../ckb";
|
|
1
|
+
import { Cell, OutPointLike, Script, ScriptLike, TransactionLike } from "../ckb";
|
|
8
2
|
import { Hex, HexLike } from "../hex";
|
|
9
3
|
import { Num, NumLike } from "../num";
|
|
10
|
-
import {
|
|
11
|
-
ClientFindCellsResponse,
|
|
12
|
-
ClientIndexerSearchKeyLike,
|
|
13
|
-
ClientTransactionResponse,
|
|
14
|
-
OutputsValidator,
|
|
15
|
-
} from "./clientTypes";
|
|
4
|
+
import { ClientFindCellsResponse, ClientIndexerSearchKeyLike, ClientTransactionResponse, OutputsValidator } from "./clientTypes";
|
|
16
5
|
export declare enum KnownScript {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
Secp256k1Blake160 = 0,
|
|
7
|
+
Secp256k1Multisig = 1,
|
|
8
|
+
AnyoneCanPay = 2,
|
|
9
|
+
JoyId = 3,
|
|
10
|
+
COTA = 4,
|
|
11
|
+
OmniLock = 5
|
|
23
12
|
}
|
|
24
13
|
export declare abstract class Client {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
getCell(outPoint: OutPointLike): Promise<Cell | null>;
|
|
38
|
-
abstract findCellsPaged(
|
|
39
|
-
key: ClientIndexerSearchKeyLike,
|
|
40
|
-
order?: "asc" | "desc",
|
|
41
|
-
limit?: NumLike,
|
|
42
|
-
after?: string,
|
|
43
|
-
): Promise<ClientFindCellsResponse>;
|
|
44
|
-
findCells(
|
|
45
|
-
key: ClientIndexerSearchKeyLike,
|
|
46
|
-
order?: "asc" | "desc",
|
|
47
|
-
limit?: number,
|
|
48
|
-
): AsyncGenerator<Cell>;
|
|
49
|
-
findCellsByLockAndType(
|
|
50
|
-
lock: ScriptLike,
|
|
51
|
-
type: ScriptLike,
|
|
52
|
-
withData?: boolean,
|
|
53
|
-
): AsyncGenerator<Cell>;
|
|
54
|
-
abstract getCellsCapacity(key: ClientIndexerSearchKeyLike): Promise<Num>;
|
|
55
|
-
getBalanceSingle(lock: ScriptLike): Promise<Num>;
|
|
56
|
-
getBalance(locks: ScriptLike[]): Promise<Num>;
|
|
14
|
+
abstract get url(): string;
|
|
15
|
+
abstract get addressPrefix(): string;
|
|
16
|
+
abstract getKnownScript(script: KnownScript): Promise<Pick<Script, "codeHash" | "hashType">>;
|
|
17
|
+
abstract sendTransaction(transaction: TransactionLike, validator?: OutputsValidator): Promise<Hex>;
|
|
18
|
+
abstract getTransaction(txHash: HexLike): Promise<ClientTransactionResponse | null>;
|
|
19
|
+
getCell(outPoint: OutPointLike): Promise<Cell | null>;
|
|
20
|
+
abstract findCellsPaged(key: ClientIndexerSearchKeyLike, order?: "asc" | "desc", limit?: NumLike, after?: string): Promise<ClientFindCellsResponse>;
|
|
21
|
+
findCells(key: ClientIndexerSearchKeyLike, order?: "asc" | "desc", limit?: number): AsyncGenerator<Cell>;
|
|
22
|
+
findCellsByLockAndType(lock: ScriptLike, type: ScriptLike, withData?: boolean): AsyncGenerator<Cell>;
|
|
23
|
+
abstract getCellsCapacity(key: ClientIndexerSearchKeyLike): Promise<Num>;
|
|
24
|
+
getBalanceSingle(lock: ScriptLike): Promise<Num>;
|
|
25
|
+
getBalance(locks: ScriptLike[]): Promise<Num>;
|
|
57
26
|
}
|
|
58
|
-
//# sourceMappingURL=client.d.ts.map
|
|
27
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -7,76 +7,67 @@ const num_1 = require("../num");
|
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
var KnownScript;
|
|
9
9
|
(function (KnownScript) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
KnownScript[KnownScript["Secp256k1Blake160"] = 0] = "Secp256k1Blake160";
|
|
11
|
+
KnownScript[KnownScript["Secp256k1Multisig"] = 1] = "Secp256k1Multisig";
|
|
12
|
+
KnownScript[KnownScript["AnyoneCanPay"] = 2] = "AnyoneCanPay";
|
|
13
|
+
KnownScript[KnownScript["JoyId"] = 3] = "JoyId";
|
|
14
|
+
KnownScript[KnownScript["COTA"] = 4] = "COTA";
|
|
15
|
+
KnownScript[KnownScript["OmniLock"] = 5] = "OmniLock";
|
|
16
16
|
})(KnownScript || (exports.KnownScript = KnownScript = {}));
|
|
17
17
|
class Client {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
async getCell(outPoint) {
|
|
19
|
+
const transaction = await this.getTransaction(outPoint.txHash);
|
|
20
|
+
if (!transaction) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const index = Number((0, num_1.numFrom)(outPoint.index));
|
|
24
|
+
if (index >= transaction.transaction.outputs.length) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return ckb_1.Cell.from({
|
|
28
|
+
outPoint,
|
|
29
|
+
cellOutput: transaction.transaction.outputs[index],
|
|
30
|
+
outputData: transaction.transaction.outputsData[index] ?? "0x",
|
|
31
|
+
blockNumber: transaction.blockNumber,
|
|
32
|
+
});
|
|
22
33
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
async *findCells(key, order, limit = 10) {
|
|
35
|
+
let last = undefined;
|
|
36
|
+
while (true) {
|
|
37
|
+
const { cells, lastCursor } = await this.findCellsPaged(key, order, limit, last);
|
|
38
|
+
for (const cell of cells) {
|
|
39
|
+
yield cell;
|
|
40
|
+
}
|
|
41
|
+
if (cells.length === 0 || cells.length < limit) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
last = lastCursor;
|
|
45
|
+
}
|
|
26
46
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
findCellsByLockAndType(lock, type, withData = true) {
|
|
48
|
+
return this.findCells({
|
|
49
|
+
script: lock,
|
|
50
|
+
scriptType: "lock",
|
|
51
|
+
scriptSearchMode: "exact",
|
|
52
|
+
filter: {
|
|
53
|
+
script: type,
|
|
54
|
+
},
|
|
55
|
+
withData,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async getBalanceSingle(lock) {
|
|
59
|
+
return this.getCellsCapacity({
|
|
60
|
+
script: lock,
|
|
61
|
+
scriptType: "lock",
|
|
62
|
+
scriptSearchMode: "exact",
|
|
63
|
+
filter: {
|
|
64
|
+
scriptLenRange: [0, 1],
|
|
65
|
+
outputDataLenRange: [0, 1],
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async getBalance(locks) {
|
|
70
|
+
return (0, utils_1.reduceAsync)(locks, async (acc, lock) => acc + (await this.getBalanceSingle(lock)), fixedPoint_1.Zero);
|
|
50
71
|
}
|
|
51
|
-
}
|
|
52
|
-
findCellsByLockAndType(lock, type, withData = true) {
|
|
53
|
-
return this.findCells({
|
|
54
|
-
script: lock,
|
|
55
|
-
scriptType: "lock",
|
|
56
|
-
scriptSearchMode: "exact",
|
|
57
|
-
filter: {
|
|
58
|
-
script: type,
|
|
59
|
-
},
|
|
60
|
-
withData,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
async getBalanceSingle(lock) {
|
|
64
|
-
return this.getCellsCapacity({
|
|
65
|
-
script: lock,
|
|
66
|
-
scriptType: "lock",
|
|
67
|
-
scriptSearchMode: "exact",
|
|
68
|
-
filter: {
|
|
69
|
-
scriptLenRange: [0, 1],
|
|
70
|
-
outputDataLenRange: [0, 1],
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
async getBalance(locks) {
|
|
75
|
-
return (0, utils_1.reduceAsync)(
|
|
76
|
-
locks,
|
|
77
|
-
async (acc, lock) => acc + (await this.getBalanceSingle(lock)),
|
|
78
|
-
fixedPoint_1.Zero,
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
72
|
}
|
|
82
73
|
exports.Client = Client;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Script } from "../ckb";
|
|
2
2
|
import { KnownScript } from "./client";
|
|
3
|
-
export declare const MAINNET_SCRIPTS: Record<
|
|
4
|
-
|
|
5
|
-
Pick<Script, "codeHash" | "hashType">
|
|
6
|
-
>;
|
|
7
|
-
//# sourceMappingURL=clientPublicMainnet.advanced.d.ts.map
|
|
3
|
+
export declare const MAINNET_SCRIPTS: Record<KnownScript, Pick<Script, "codeHash" | "hashType">>;
|
|
4
|
+
//# sourceMappingURL=clientPublicMainnet.advanced.d.ts.map
|
|
@@ -3,34 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MAINNET_SCRIPTS = void 0;
|
|
4
4
|
const client_1 = require("./client");
|
|
5
5
|
exports.MAINNET_SCRIPTS = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
[client_1.KnownScript.OmniLock]: {
|
|
32
|
-
codeHash:
|
|
33
|
-
"0x9b819793a64463aed77c615d6cb226eea5487ccfc0783043a587254cda2b6f26",
|
|
34
|
-
hashType: "type",
|
|
35
|
-
},
|
|
6
|
+
[client_1.KnownScript.Secp256k1Blake160]: {
|
|
7
|
+
codeHash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
|
|
8
|
+
hashType: "type",
|
|
9
|
+
},
|
|
10
|
+
[client_1.KnownScript.Secp256k1Multisig]: {
|
|
11
|
+
codeHash: "0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8",
|
|
12
|
+
hashType: "type",
|
|
13
|
+
},
|
|
14
|
+
[client_1.KnownScript.AnyoneCanPay]: {
|
|
15
|
+
codeHash: "0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354",
|
|
16
|
+
hashType: "type",
|
|
17
|
+
},
|
|
18
|
+
[client_1.KnownScript.JoyId]: {
|
|
19
|
+
codeHash: "0xd00c84f0ec8fd441c38bc3f87a371f547190f2fcff88e642bc5bf54b9e318323",
|
|
20
|
+
hashType: "type",
|
|
21
|
+
},
|
|
22
|
+
[client_1.KnownScript.COTA]: {
|
|
23
|
+
codeHash: "0x1122a4fb54697cf2e6e3a96c9d80fd398a936559b90954c6e88eb7ba0cf652df",
|
|
24
|
+
hashType: "type",
|
|
25
|
+
},
|
|
26
|
+
[client_1.KnownScript.OmniLock]: {
|
|
27
|
+
codeHash: "0x9b819793a64463aed77c615d6cb226eea5487ccfc0783043a587254cda2b6f26",
|
|
28
|
+
hashType: "type",
|
|
29
|
+
},
|
|
36
30
|
};
|
|
@@ -2,10 +2,8 @@ import { Script } from "../ckb";
|
|
|
2
2
|
import { KnownScript } from "./client";
|
|
3
3
|
import { ClientJsonRpc } from "./jsonRpc";
|
|
4
4
|
export declare class ClientPublicMainnet extends ClientJsonRpc {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
script: KnownScript,
|
|
9
|
-
): Promise<Pick<Script, "codeHash" | "hashType">>;
|
|
5
|
+
constructor(url?: string, timeout?: number);
|
|
6
|
+
get addressPrefix(): string;
|
|
7
|
+
getKnownScript(script: KnownScript): Promise<Pick<Script, "codeHash" | "hashType">>;
|
|
10
8
|
}
|
|
11
|
-
//# sourceMappingURL=clientPublicMainnet.d.ts.map
|
|
9
|
+
//# sourceMappingURL=clientPublicMainnet.d.ts.map
|
|
@@ -4,14 +4,14 @@ exports.ClientPublicMainnet = void 0;
|
|
|
4
4
|
const clientPublicMainnet_advanced_1 = require("./clientPublicMainnet.advanced");
|
|
5
5
|
const jsonRpc_1 = require("./jsonRpc");
|
|
6
6
|
class ClientPublicMainnet extends jsonRpc_1.ClientJsonRpc {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
constructor(url = "https://mainnet.ckbapp.dev/", timeout) {
|
|
8
|
+
super(url, timeout);
|
|
9
|
+
}
|
|
10
|
+
get addressPrefix() {
|
|
11
|
+
return "ckb";
|
|
12
|
+
}
|
|
13
|
+
async getKnownScript(script) {
|
|
14
|
+
return { ...clientPublicMainnet_advanced_1.MAINNET_SCRIPTS[script] };
|
|
15
|
+
}
|
|
16
16
|
}
|
|
17
17
|
exports.ClientPublicMainnet = ClientPublicMainnet;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Script } from "../ckb";
|
|
2
2
|
import { KnownScript } from "./client";
|
|
3
|
-
export declare const TESTNET_SCRIPTS: Record<
|
|
4
|
-
|
|
5
|
-
Pick<Script, "codeHash" | "hashType">
|
|
6
|
-
>;
|
|
7
|
-
//# sourceMappingURL=clientPublicTestnet.advanced.d.ts.map
|
|
3
|
+
export declare const TESTNET_SCRIPTS: Record<KnownScript, Pick<Script, "codeHash" | "hashType">>;
|
|
4
|
+
//# sourceMappingURL=clientPublicTestnet.advanced.d.ts.map
|
|
@@ -3,34 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TESTNET_SCRIPTS = void 0;
|
|
4
4
|
const client_1 = require("./client");
|
|
5
5
|
exports.TESTNET_SCRIPTS = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
[client_1.KnownScript.OmniLock]: {
|
|
32
|
-
codeHash:
|
|
33
|
-
"0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb",
|
|
34
|
-
hashType: "type",
|
|
35
|
-
},
|
|
6
|
+
[client_1.KnownScript.Secp256k1Blake160]: {
|
|
7
|
+
codeHash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
|
|
8
|
+
hashType: "type",
|
|
9
|
+
},
|
|
10
|
+
[client_1.KnownScript.Secp256k1Multisig]: {
|
|
11
|
+
codeHash: "0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8",
|
|
12
|
+
hashType: "type",
|
|
13
|
+
},
|
|
14
|
+
[client_1.KnownScript.AnyoneCanPay]: {
|
|
15
|
+
codeHash: "0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356",
|
|
16
|
+
hashType: "type",
|
|
17
|
+
},
|
|
18
|
+
[client_1.KnownScript.JoyId]: {
|
|
19
|
+
codeHash: "0xd23761b364210735c19c60561d213fb3beae2fd6172743719eff6920e020baac",
|
|
20
|
+
hashType: "type",
|
|
21
|
+
},
|
|
22
|
+
[client_1.KnownScript.COTA]: {
|
|
23
|
+
codeHash: "0x89cd8003a0eaf8e65e0c31525b7d1d5c1becefd2ea75bb4cff87810ae37764d8",
|
|
24
|
+
hashType: "type",
|
|
25
|
+
},
|
|
26
|
+
[client_1.KnownScript.OmniLock]: {
|
|
27
|
+
codeHash: "0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb",
|
|
28
|
+
hashType: "type",
|
|
29
|
+
},
|
|
36
30
|
};
|
|
@@ -2,10 +2,8 @@ import { Script } from "../ckb";
|
|
|
2
2
|
import { KnownScript } from "./client";
|
|
3
3
|
import { ClientJsonRpc } from "./jsonRpc";
|
|
4
4
|
export declare class ClientPublicTestnet extends ClientJsonRpc {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
script: KnownScript,
|
|
9
|
-
): Promise<Pick<Script, "codeHash" | "hashType">>;
|
|
5
|
+
constructor(url?: string, timeout?: number);
|
|
6
|
+
get addressPrefix(): string;
|
|
7
|
+
getKnownScript(script: KnownScript): Promise<Pick<Script, "codeHash" | "hashType">>;
|
|
10
8
|
}
|
|
11
|
-
//# sourceMappingURL=clientPublicTestnet.d.ts.map
|
|
9
|
+
//# sourceMappingURL=clientPublicTestnet.d.ts.map
|
|
@@ -4,14 +4,14 @@ exports.ClientPublicTestnet = void 0;
|
|
|
4
4
|
const clientPublicTestnet_advanced_1 = require("./clientPublicTestnet.advanced");
|
|
5
5
|
const jsonRpc_1 = require("./jsonRpc");
|
|
6
6
|
class ClientPublicTestnet extends jsonRpc_1.ClientJsonRpc {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
constructor(url = "https://testnet.ckbapp.dev/", timeout) {
|
|
8
|
+
super(url, timeout);
|
|
9
|
+
}
|
|
10
|
+
get addressPrefix() {
|
|
11
|
+
return "ckt";
|
|
12
|
+
}
|
|
13
|
+
async getKnownScript(script) {
|
|
14
|
+
return { ...clientPublicTestnet_advanced_1.TESTNET_SCRIPTS[script] };
|
|
15
|
+
}
|
|
16
16
|
}
|
|
17
17
|
exports.ClientPublicTestnet = ClientPublicTestnet;
|
|
@@ -2,38 +2,42 @@ import { Cell, Script, ScriptLike, Transaction } from "../ckb";
|
|
|
2
2
|
import { Hex, HexLike } from "../hex";
|
|
3
3
|
import { Num, NumLike } from "../num";
|
|
4
4
|
export type OutputsValidator = "passthrough" | "well_known_scripts_only";
|
|
5
|
-
export type TransactionStatus =
|
|
6
|
-
| "pending"
|
|
7
|
-
| "proposed"
|
|
8
|
-
| "committed"
|
|
9
|
-
| "unknown"
|
|
10
|
-
| "rejected";
|
|
5
|
+
export type TransactionStatus = "pending" | "proposed" | "committed" | "unknown" | "rejected";
|
|
11
6
|
export type ClientTransactionResponse = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
transaction: Transaction;
|
|
8
|
+
status: TransactionStatus;
|
|
9
|
+
blockNumber: Num;
|
|
15
10
|
};
|
|
16
11
|
export type ClientIndexerSearchKeyLike = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
script: ScriptLike;
|
|
13
|
+
scriptType: "lock" | "type";
|
|
14
|
+
scriptSearchMode?: "prefix" | "exact" | "partial";
|
|
15
|
+
filter?: {
|
|
16
|
+
script?: ScriptLike;
|
|
17
|
+
scriptLenRange?: [NumLike, NumLike];
|
|
18
|
+
outputData?: HexLike;
|
|
19
|
+
outputDataSearchMode?: "prefix" | "exact" | "partial";
|
|
20
|
+
outputDataLenRange?: [NumLike, NumLike];
|
|
21
|
+
outputCapacityRange?: [NumLike, NumLike];
|
|
22
|
+
blockRange?: [NumLike, NumLike];
|
|
23
|
+
};
|
|
24
|
+
withData?: boolean;
|
|
30
25
|
};
|
|
31
26
|
export declare class ClientIndexerSearchKey {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
script: Script;
|
|
28
|
+
scriptType: "lock" | "type";
|
|
29
|
+
scriptSearchMode: "prefix" | "exact" | "partial" | undefined;
|
|
30
|
+
filter: {
|
|
31
|
+
script?: Script;
|
|
32
|
+
scriptLenRange?: [Num, Num];
|
|
33
|
+
outputData?: Hex;
|
|
34
|
+
outputDataSearchMode?: "prefix" | "exact" | "partial";
|
|
35
|
+
outputDataLenRange?: [Num, Num];
|
|
36
|
+
outputCapacityRange?: [Num, Num];
|
|
37
|
+
blockRange?: [Num, Num];
|
|
38
|
+
} | undefined;
|
|
39
|
+
withData: boolean | undefined;
|
|
40
|
+
constructor(script: Script, scriptType: "lock" | "type", scriptSearchMode: "prefix" | "exact" | "partial" | undefined, filter: {
|
|
37
41
|
script?: Script;
|
|
38
42
|
scriptLenRange?: [Num, Num];
|
|
39
43
|
outputData?: Hex;
|
|
@@ -41,30 +45,11 @@ export declare class ClientIndexerSearchKey {
|
|
|
41
45
|
outputDataLenRange?: [Num, Num];
|
|
42
46
|
outputCapacityRange?: [Num, Num];
|
|
43
47
|
blockRange?: [Num, Num];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
withData: boolean | undefined;
|
|
47
|
-
constructor(
|
|
48
|
-
script: Script,
|
|
49
|
-
scriptType: "lock" | "type",
|
|
50
|
-
scriptSearchMode: "prefix" | "exact" | "partial" | undefined,
|
|
51
|
-
filter:
|
|
52
|
-
| {
|
|
53
|
-
script?: Script;
|
|
54
|
-
scriptLenRange?: [Num, Num];
|
|
55
|
-
outputData?: Hex;
|
|
56
|
-
outputDataSearchMode?: "prefix" | "exact" | "partial";
|
|
57
|
-
outputDataLenRange?: [Num, Num];
|
|
58
|
-
outputCapacityRange?: [Num, Num];
|
|
59
|
-
blockRange?: [Num, Num];
|
|
60
|
-
}
|
|
61
|
-
| undefined,
|
|
62
|
-
withData: boolean | undefined,
|
|
63
|
-
);
|
|
64
|
-
static from(keyLike: ClientIndexerSearchKeyLike): ClientIndexerSearchKey;
|
|
48
|
+
} | undefined, withData: boolean | undefined);
|
|
49
|
+
static from(keyLike: ClientIndexerSearchKeyLike): ClientIndexerSearchKey;
|
|
65
50
|
}
|
|
66
51
|
export type ClientFindCellsResponse = {
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
lastCursor: string;
|
|
53
|
+
cells: Cell[];
|
|
69
54
|
};
|
|
70
|
-
//# sourceMappingURL=clientTypes.d.ts.map
|
|
55
|
+
//# sourceMappingURL=clientTypes.d.ts.map
|