@ckb-ccc/core 0.0.5-alpha.10 → 0.0.5-alpha.11
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 +2 -4
- package/dist/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +12 -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 +530 -570
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +722 -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 +14 -13
|
@@ -5,186 +5,180 @@ import { Client } from "../../client";
|
|
|
5
5
|
import { Hex } from "../../hex";
|
|
6
6
|
import { Num } from "../../num";
|
|
7
7
|
export declare enum SignerSignType {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
Unknown = "Unknown",
|
|
9
|
+
BtcEcdsa = "BtcEcdsa",
|
|
10
|
+
EvmPersonal = "EvmPersonal",
|
|
11
|
+
JoyId = "JoyId"
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* An enumeration of signer display types in wallet.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum SignerType {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
EVM = "EVM",
|
|
18
|
+
BTC = "BTC",
|
|
19
|
+
CKB = "CKB"
|
|
20
20
|
}
|
|
21
21
|
export declare class Signature {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
signature: string;
|
|
23
|
+
identity: string;
|
|
24
|
+
signType: SignerSignType;
|
|
25
|
+
constructor(signature: string, identity: string, signType: SignerSignType);
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* An abstract class representing a generic signer.
|
|
29
29
|
* This class provides methods to connect, get addresses, and sign transactions.
|
|
30
30
|
*/
|
|
31
31
|
export declare abstract class Signer {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
*
|
|
169
|
-
* @param _ - The transaction to sign, represented as a TransactionLike object.
|
|
170
|
-
* @returns A promise that resolves to the signed Transaction object.
|
|
171
|
-
* @throws Will throw an error if not implemented.
|
|
172
|
-
*/
|
|
173
|
-
signOnlyTransaction(_: TransactionLike): Promise<Transaction>;
|
|
32
|
+
protected client_: Client;
|
|
33
|
+
constructor(client_: Client);
|
|
34
|
+
abstract get type(): SignerType;
|
|
35
|
+
abstract get signType(): SignerSignType;
|
|
36
|
+
get client(): Client;
|
|
37
|
+
static verifyMessage(message: string | BytesLike, signature: Signature): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Replace the current client.
|
|
40
|
+
*/
|
|
41
|
+
replaceClient(client: Client): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Connects to the signer.
|
|
44
|
+
*
|
|
45
|
+
* @returns A promise that resolves when the connection is complete.
|
|
46
|
+
*/
|
|
47
|
+
abstract connect(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Disconnects to the signer.
|
|
50
|
+
*
|
|
51
|
+
* @returns A promise that resolves when disconnected.
|
|
52
|
+
*/
|
|
53
|
+
disconnect(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Check if the signer is connected.
|
|
56
|
+
*
|
|
57
|
+
* @returns A promise that resolves the connection status.
|
|
58
|
+
*/
|
|
59
|
+
abstract isConnected(): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the internal address associated with the signer.
|
|
62
|
+
*
|
|
63
|
+
* @returns A promise that resolves to a string representing the internal address.
|
|
64
|
+
*/
|
|
65
|
+
abstract getInternalAddress(): Promise<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Gets the identity for verifying signature, usually it's address
|
|
68
|
+
*
|
|
69
|
+
* @returns A promise that resolves to a string representing the identity
|
|
70
|
+
*/
|
|
71
|
+
getIdentity(): Promise<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Gets an array of Address objects associated with the signer.
|
|
74
|
+
*
|
|
75
|
+
* @returns A promise that resolves to an array of Address objects.
|
|
76
|
+
*/
|
|
77
|
+
abstract getAddressObjs(): Promise<Address[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Gets the recommended Address object for the signer.
|
|
80
|
+
*
|
|
81
|
+
* @param _preference - Optional preference parameter.
|
|
82
|
+
* @returns A promise that resolves to the recommended Address object.
|
|
83
|
+
*/
|
|
84
|
+
getRecommendedAddressObj(_preference?: unknown): Promise<Address>;
|
|
85
|
+
/**
|
|
86
|
+
* Gets the recommended address for the signer as a string.
|
|
87
|
+
*
|
|
88
|
+
* @param preference - Optional preference parameter.
|
|
89
|
+
* @returns A promise that resolves to the recommended address as a string.
|
|
90
|
+
*/
|
|
91
|
+
getRecommendedAddress(preference?: unknown): Promise<string>;
|
|
92
|
+
/**
|
|
93
|
+
* Gets an array of addresses associated with the signer as strings.
|
|
94
|
+
*
|
|
95
|
+
* @returns A promise that resolves to an array of addresses as strings.
|
|
96
|
+
*/
|
|
97
|
+
getAddresses(): Promise<string[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Gets balance of all addresses
|
|
100
|
+
*
|
|
101
|
+
* @returns A promise that resolves to the balance
|
|
102
|
+
*/
|
|
103
|
+
getBalance(): Promise<Num>;
|
|
104
|
+
/**
|
|
105
|
+
* Signs a message.
|
|
106
|
+
*
|
|
107
|
+
* @param _ - The message to sign, as a string or BytesLike object.
|
|
108
|
+
* @returns A promise that resolves to the signature info.
|
|
109
|
+
* @throws Will throw an error if not implemented.
|
|
110
|
+
*/
|
|
111
|
+
signMessage(message: string | BytesLike): Promise<Signature>;
|
|
112
|
+
/**
|
|
113
|
+
* Signs a message and returns signature only. This method is not implemented and should be overridden by subclasses.
|
|
114
|
+
*
|
|
115
|
+
* @param _ - The message to sign, as a string or BytesLike object.
|
|
116
|
+
* @returns A promise that resolves to the signature as a string.
|
|
117
|
+
* @throws Will throw an error if not implemented.
|
|
118
|
+
*/
|
|
119
|
+
signMessageRaw(_: string | BytesLike): Promise<string>;
|
|
120
|
+
/**
|
|
121
|
+
* Verify a signature.
|
|
122
|
+
*
|
|
123
|
+
* @param _ - The original message.
|
|
124
|
+
* @param _ - The signature to verify.
|
|
125
|
+
* @returns A promise that resolves to the verification result.
|
|
126
|
+
* @throws Will throw an error if not implemented.
|
|
127
|
+
*/
|
|
128
|
+
verifyMessage(message: string | BytesLike, signature: string | Signature): Promise<boolean>;
|
|
129
|
+
/**
|
|
130
|
+
* Verify a string signature. This method is not implemented and should be overridden by subclasses.
|
|
131
|
+
*
|
|
132
|
+
* @param _0 - The original message.
|
|
133
|
+
* @param _1 - The signature to verify.
|
|
134
|
+
* @returns A promise that resolves to the verification result.
|
|
135
|
+
* @throws Will throw an error if not implemented.
|
|
136
|
+
*/
|
|
137
|
+
verifyMessageRaw(_0: string | BytesLike, _1: string): Promise<boolean>;
|
|
138
|
+
/**
|
|
139
|
+
* Sends a transaction after signing it.
|
|
140
|
+
*
|
|
141
|
+
* @param tx - The transaction to send, represented as a TransactionLike object.
|
|
142
|
+
* @returns A promise that resolves to the transaction hash as a Hex string.
|
|
143
|
+
*/
|
|
144
|
+
sendTransaction(tx: TransactionLike): Promise<Hex>;
|
|
145
|
+
/**
|
|
146
|
+
* Signs a transaction.
|
|
147
|
+
*
|
|
148
|
+
* @param tx - The transaction to sign, represented as a TransactionLike object.
|
|
149
|
+
* @returns A promise that resolves to the signed Transaction object.
|
|
150
|
+
*/
|
|
151
|
+
signTransaction(tx: TransactionLike): Promise<Transaction>;
|
|
152
|
+
/**
|
|
153
|
+
* prepare a transaction before signing. This method is not implemented and should be overridden by subclasses.
|
|
154
|
+
*
|
|
155
|
+
* @param _ - The transaction to prepare, represented as a TransactionLike object.
|
|
156
|
+
* @returns A promise that resolves to the prepared Transaction object.
|
|
157
|
+
* @throws Will throw an error if not implemented.
|
|
158
|
+
*/
|
|
159
|
+
prepareTransaction(_: TransactionLike): Promise<Transaction>;
|
|
160
|
+
/**
|
|
161
|
+
* Signs a transaction without preparing information for it. This method is not implemented and should be overridden by subclasses.
|
|
162
|
+
*
|
|
163
|
+
* @param _ - The transaction to sign, represented as a TransactionLike object.
|
|
164
|
+
* @returns A promise that resolves to the signed Transaction object.
|
|
165
|
+
* @throws Will throw an error if not implemented.
|
|
166
|
+
*/
|
|
167
|
+
signOnlyTransaction(_: TransactionLike): Promise<Transaction>;
|
|
174
168
|
}
|
|
175
169
|
/**
|
|
176
170
|
* A class representing information about a signer, including its type and the signer instance.
|
|
177
171
|
*/
|
|
178
172
|
export declare class SignerInfo {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
173
|
+
name: string;
|
|
174
|
+
signer: Signer;
|
|
175
|
+
constructor(name: string, signer: Signer);
|
|
182
176
|
}
|
|
183
177
|
/**
|
|
184
178
|
* Represents a wallet with a name, icon, and an array of signer information.
|
|
185
179
|
*/
|
|
186
180
|
export type Wallet = {
|
|
187
|
-
|
|
188
|
-
|
|
181
|
+
name: string;
|
|
182
|
+
icon: string;
|
|
189
183
|
};
|
|
190
|
-
//# sourceMappingURL=index.d.ts.map
|
|
184
|
+
//# sourceMappingURL=index.d.ts.map
|