@ckb-ccc/joy-id 0.0.9-alpha.2 → 0.0.10-alpha.4
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/btc/index.d.ts +0 -1
- package/dist/btc/index.d.ts.map +1 -1
- package/dist/btc/index.js +0 -7
- package/dist/ckb/index.d.ts +0 -1
- package/dist/ckb/index.d.ts.map +1 -1
- package/dist/ckb/index.js +0 -7
- package/dist/evm/index.d.ts +2 -3
- package/dist/evm/index.d.ts.map +1 -1
- package/dist/evm/index.js +1 -8
- package/dist/nostr/index.d.ts +0 -1
- package/dist/nostr/index.d.ts.map +1 -1
- package/dist/nostr/index.js +0 -7
- package/dist.commonjs/advanced.d.ts +1 -1
- package/dist.commonjs/advanced.js +40 -19
- package/dist.commonjs/advancedBarrel.d.ts +1 -1
- package/dist.commonjs/advancedBarrel.js +30 -14
- package/dist.commonjs/barrel.d.ts +1 -1
- package/dist.commonjs/barrel.js +30 -14
- package/dist.commonjs/btc/index.d.ts +67 -60
- package/dist.commonjs/btc/index.d.ts.map +1 -1
- package/dist.commonjs/btc/index.js +176 -148
- package/dist.commonjs/ckb/index.d.ts +122 -116
- package/dist.commonjs/ckb/index.d.ts.map +1 -1
- package/dist.commonjs/ckb/index.js +312 -262
- package/dist.commonjs/common/index.d.ts +34 -21
- package/dist.commonjs/common/index.js +50 -45
- package/dist.commonjs/connectionsStorage/index.d.ts +53 -44
- package/dist.commonjs/connectionsStorage/index.js +49 -44
- package/dist.commonjs/evm/index.d.ts +68 -63
- package/dist.commonjs/evm/index.d.ts.map +1 -1
- package/dist.commonjs/evm/index.js +143 -127
- package/dist.commonjs/index.d.ts +1 -1
- package/dist.commonjs/index.js +40 -19
- package/dist.commonjs/nostr/index.d.ts +59 -54
- package/dist.commonjs/nostr/index.d.ts.map +1 -1
- package/dist.commonjs/nostr/index.js +127 -114
- package/dist.commonjs/signerFactory/index.d.ts +7 -2
- package/dist.commonjs/signerFactory/index.js +54 -31
- package/package.json +3 -3
- package/src/btc/index.ts +0 -8
- package/src/ckb/index.ts +0 -8
- package/src/evm/index.ts +3 -11
- package/src/nostr/index.ts +0 -8
|
@@ -11,157 +11,185 @@ const connectionsStorage_1 = require("../connectionsStorage");
|
|
|
11
11
|
* @extends {ccc.SignerBtc}
|
|
12
12
|
*/
|
|
13
13
|
class BitcoinSigner extends core_1.ccc.SignerBtc {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return this.connection;
|
|
14
|
+
/**
|
|
15
|
+
* Ensures that the signer is connected and returns the connection.
|
|
16
|
+
* @private
|
|
17
|
+
* @throws Will throw an error if not connected.
|
|
18
|
+
* @returns {Connection} The current connection.
|
|
19
|
+
*/
|
|
20
|
+
assertConnection() {
|
|
21
|
+
if (!this.isConnected() || !this.connection) {
|
|
22
|
+
throw new Error("Not connected");
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
if (!url) {
|
|
79
|
-
throw new Error(`JoyID wallet doesn't support the requested chain ${this.network}`);
|
|
80
|
-
}
|
|
81
|
-
return {
|
|
82
|
-
redirectURL: location.href,
|
|
83
|
-
joyidAppURL: this._appUri ?? url,
|
|
84
|
-
requestNetwork: `btc-${this.addressType}`,
|
|
85
|
-
name: this.name,
|
|
86
|
-
logo: this.icon,
|
|
87
|
-
};
|
|
24
|
+
return this.connection;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates an instance of BitcoinSigner.
|
|
28
|
+
* @param client - The client instance.
|
|
29
|
+
* @param name - The name of the signer.
|
|
30
|
+
* @param icon - The icon URL of the signer.
|
|
31
|
+
* @param addressType - The address type.
|
|
32
|
+
* @param _appUri - The application URI.
|
|
33
|
+
* @param connectionsRepo - The connections repository.
|
|
34
|
+
*/
|
|
35
|
+
constructor(
|
|
36
|
+
client,
|
|
37
|
+
name,
|
|
38
|
+
icon,
|
|
39
|
+
preferredNetworks = [
|
|
40
|
+
{
|
|
41
|
+
addressPrefix: "ckb",
|
|
42
|
+
signerType: core_1.ccc.SignerType.BTC,
|
|
43
|
+
network: "btc",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
addressPrefix: "ckt",
|
|
47
|
+
signerType: core_1.ccc.SignerType.BTC,
|
|
48
|
+
network: "btcTestnet",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
addressType = "auto",
|
|
52
|
+
_appUri,
|
|
53
|
+
connectionsRepo = new connectionsStorage_1.ConnectionsRepoLocalStorage(),
|
|
54
|
+
) {
|
|
55
|
+
super(client);
|
|
56
|
+
this.name = name;
|
|
57
|
+
this.icon = icon;
|
|
58
|
+
this.preferredNetworks = preferredNetworks;
|
|
59
|
+
this.addressType = addressType;
|
|
60
|
+
this._appUri = _appUri;
|
|
61
|
+
this.connectionsRepo = connectionsRepo;
|
|
62
|
+
this.network = "btcTestnet";
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Gets the configuration for JoyID.
|
|
66
|
+
* @private
|
|
67
|
+
* @returns The configuration object.
|
|
68
|
+
*/
|
|
69
|
+
getConfig() {
|
|
70
|
+
const { network } = this.matchNetworkPreference(
|
|
71
|
+
this.preferredNetworks,
|
|
72
|
+
this.network,
|
|
73
|
+
) ?? { network: this.network };
|
|
74
|
+
if (this.network !== network) {
|
|
75
|
+
this.connection = undefined;
|
|
88
76
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
77
|
+
this.network = network;
|
|
78
|
+
const url = {
|
|
79
|
+
btc: "https://app.joy.id",
|
|
80
|
+
btcTestnet: "https://testnet.joyid.dev",
|
|
81
|
+
}[network];
|
|
82
|
+
if (!url) {
|
|
83
|
+
throw new Error(
|
|
84
|
+
`JoyID wallet doesn't support the requested chain ${this.network}`,
|
|
85
|
+
);
|
|
92
86
|
}
|
|
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
|
-
|
|
87
|
+
return {
|
|
88
|
+
redirectURL: location.href,
|
|
89
|
+
joyidAppURL: this._appUri ?? url,
|
|
90
|
+
requestNetwork: `btc-${this.addressType}`,
|
|
91
|
+
name: this.name,
|
|
92
|
+
logo: this.icon,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
async disconnect() {
|
|
96
|
+
await super.disconnect();
|
|
97
|
+
await this.connectionsRepo.set(
|
|
98
|
+
{ uri: this.getConfig().joyidAppURL, addressType: "btc" },
|
|
99
|
+
undefined,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Gets the Bitcoin account address.
|
|
104
|
+
* @returns {Promise<string>} A promise that resolves to the Bitcoin account address.
|
|
105
|
+
*/
|
|
106
|
+
async getBtcAccount() {
|
|
107
|
+
const { address } = this.assertConnection();
|
|
108
|
+
return address;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Gets the Bitcoin public key.
|
|
112
|
+
* @returns {Promise<ccc.Hex>} A promise that resolves to the Bitcoin public key.
|
|
113
|
+
*/
|
|
114
|
+
async getBtcPublicKey() {
|
|
115
|
+
const { publicKey } = this.assertConnection();
|
|
116
|
+
return publicKey;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Connects to the provider by requesting authentication.
|
|
120
|
+
* @returns {Promise<void>} A promise that resolves when the connection is established.
|
|
121
|
+
*/
|
|
122
|
+
async connect() {
|
|
123
|
+
const config = this.getConfig();
|
|
124
|
+
const res = await (0, common_2.createPopup)(
|
|
125
|
+
(0, common_1.buildJoyIDURL)(config, "popup", "/auth"),
|
|
126
|
+
{
|
|
127
|
+
...config,
|
|
128
|
+
type: common_1.DappRequestType.Auth,
|
|
129
|
+
},
|
|
130
|
+
);
|
|
131
|
+
const { address, pubkey } = (() => {
|
|
132
|
+
if (this.addressType === "auto") {
|
|
133
|
+
return res.btcAddressType === "p2wpkh" ? res.nativeSegwit : res.taproot;
|
|
134
|
+
}
|
|
135
|
+
return res.btcAddressType === "p2wpkh" ? res.nativeSegwit : res.taproot;
|
|
136
|
+
})();
|
|
137
|
+
this.connection = {
|
|
138
|
+
address,
|
|
139
|
+
publicKey: core_1.ccc.hexFrom(pubkey),
|
|
140
|
+
keyType: res.keyType,
|
|
141
|
+
};
|
|
142
|
+
await Promise.all([
|
|
143
|
+
this.connectionsRepo.set(
|
|
144
|
+
{ uri: config.joyidAppURL, addressType: `btc-${res.btcAddressType}` },
|
|
145
|
+
this.connection,
|
|
146
|
+
),
|
|
147
|
+
this.connectionsRepo.set(
|
|
148
|
+
{ uri: config.joyidAppURL, addressType: "btc-auto" },
|
|
149
|
+
this.connection,
|
|
150
|
+
),
|
|
151
|
+
]);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Checks if the signer is connected.
|
|
155
|
+
* @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
|
|
156
|
+
*/
|
|
157
|
+
async isConnected() {
|
|
158
|
+
if (this.connection) {
|
|
159
|
+
return true;
|
|
165
160
|
}
|
|
161
|
+
this.connection = await this.connectionsRepo.get({
|
|
162
|
+
uri: this.getConfig().joyidAppURL,
|
|
163
|
+
addressType: `btc-${this.addressType}`,
|
|
164
|
+
});
|
|
165
|
+
return this.connection !== undefined;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Signs a raw message with the Bitcoin account.
|
|
169
|
+
* @param {string | ccc.BytesLike} message - The message to sign.
|
|
170
|
+
* @returns {Promise<string>} A promise that resolves to the signed message.
|
|
171
|
+
*/
|
|
172
|
+
async signMessageRaw(message) {
|
|
173
|
+
const { address } = this.assertConnection();
|
|
174
|
+
const challenge =
|
|
175
|
+
typeof message === "string"
|
|
176
|
+
? message
|
|
177
|
+
: core_1.ccc.hexFrom(message).slice(2);
|
|
178
|
+
const config = this.getConfig();
|
|
179
|
+
const { signature } = await (0, common_2.createPopup)(
|
|
180
|
+
(0, common_1.buildJoyIDURL)(
|
|
181
|
+
{
|
|
182
|
+
...config,
|
|
183
|
+
challenge,
|
|
184
|
+
address,
|
|
185
|
+
signMessageType: "ecdsa",
|
|
186
|
+
},
|
|
187
|
+
"popup",
|
|
188
|
+
"/sign-message",
|
|
189
|
+
),
|
|
190
|
+
{ ...config, type: common_1.DappRequestType.SignMessage },
|
|
191
|
+
);
|
|
192
|
+
return signature;
|
|
193
|
+
}
|
|
166
194
|
}
|
|
167
195
|
exports.BitcoinSigner = BitcoinSigner;
|
|
@@ -6,120 +6,126 @@ import { ConnectionsRepo } from "../connectionsStorage";
|
|
|
6
6
|
* @extends {ccc.Signer}
|
|
7
7
|
*/
|
|
8
8
|
export declare class CkbSigner extends ccc.Signer {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
9
|
+
private readonly name;
|
|
10
|
+
private readonly icon;
|
|
11
|
+
private readonly _appUri?;
|
|
12
|
+
private readonly _aggregatorUri?;
|
|
13
|
+
private readonly connectionsRepo;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the signer type.
|
|
16
|
+
* @returns {ccc.SignerType} The type of the signer.
|
|
17
|
+
*/
|
|
18
|
+
get type(): ccc.SignerType;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the sign type.
|
|
21
|
+
* @returns {ccc.SignerSignType} The sign type.
|
|
22
|
+
*/
|
|
23
|
+
get signType(): ccc.SignerSignType;
|
|
24
|
+
private connection?;
|
|
25
|
+
/**
|
|
26
|
+
* Ensures that the signer is connected and returns the connection.
|
|
27
|
+
* @private
|
|
28
|
+
* @throws Will throw an error if not connected.
|
|
29
|
+
* @returns {Promise<Connection>} A promise that resolves to the current connection.
|
|
30
|
+
*/
|
|
31
|
+
private assertConnection;
|
|
32
|
+
/**
|
|
33
|
+
* Creates an instance of CkbSigner.
|
|
34
|
+
* @param {ccc.Client} client - The client instance.
|
|
35
|
+
* @param {string} name - The name of the signer.
|
|
36
|
+
* @param {string} icon - The icon URL of the signer.
|
|
37
|
+
* @param {string} [_appUri] - The application URI.
|
|
38
|
+
* @param {string} [_aggregatorUri] - The aggregator URI.
|
|
39
|
+
* @param {ConnectionsRepo} [connectionsRepo=new ConnectionsRepoLocalStorage()] - The connections repository.
|
|
40
|
+
*/
|
|
41
|
+
constructor(
|
|
42
|
+
client: ccc.Client,
|
|
43
|
+
name: string,
|
|
44
|
+
icon: string,
|
|
45
|
+
_appUri?: string | undefined,
|
|
46
|
+
_aggregatorUri?: string | undefined,
|
|
47
|
+
connectionsRepo?: ConnectionsRepo,
|
|
48
|
+
);
|
|
49
|
+
/**
|
|
50
|
+
* Gets the configuration for JoyID.
|
|
51
|
+
* @private
|
|
52
|
+
* @returns The configuration object.
|
|
53
|
+
*/
|
|
54
|
+
private getConfig;
|
|
55
|
+
/**
|
|
56
|
+
* Gets the aggregator URI.
|
|
57
|
+
* @private
|
|
58
|
+
* @returns {string} The aggregator URI.
|
|
59
|
+
*/
|
|
60
|
+
private getAggregatorUri;
|
|
61
|
+
/**
|
|
62
|
+
* Connects to the provider by requesting authentication.
|
|
63
|
+
* @returns {Promise<void>} A promise that resolves when the connection is established.
|
|
64
|
+
*/
|
|
65
|
+
connect(): Promise<void>;
|
|
66
|
+
disconnect(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Checks if the signer is connected.
|
|
69
|
+
* @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
|
|
70
|
+
*/
|
|
71
|
+
isConnected(): Promise<boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* Gets the internal address.
|
|
74
|
+
* @returns {Promise<string>} A promise that resolves to the internal address.
|
|
75
|
+
*/
|
|
76
|
+
getInternalAddress(): Promise<string>;
|
|
77
|
+
/**
|
|
78
|
+
* Gets the identity of the signer.
|
|
79
|
+
* @returns {Promise<string>} A promise that resolves to the identity.
|
|
80
|
+
*/
|
|
81
|
+
getIdentity(): Promise<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Gets the address object.
|
|
84
|
+
* @returns {Promise<ccc.Address>} A promise that resolves to the address object.
|
|
85
|
+
*/
|
|
86
|
+
getAddressObj(): Promise<ccc.Address>;
|
|
87
|
+
/**
|
|
88
|
+
* Gets the address objects.
|
|
89
|
+
* @returns {Promise<ccc.Address[]>} A promise that resolves to an array of address objects.
|
|
90
|
+
*/
|
|
91
|
+
getAddressObjs(): Promise<ccc.Address[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Prepares a transaction.
|
|
94
|
+
* @param {ccc.TransactionLike} txLike - The transaction-like object.
|
|
95
|
+
* @returns {Promise<ccc.Transaction>} A promise that resolves to the prepared transaction.
|
|
96
|
+
*/
|
|
97
|
+
prepareTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
|
|
98
|
+
/**
|
|
99
|
+
* Prepares a transaction for a sub key.
|
|
100
|
+
* @private
|
|
101
|
+
* @param tx - The transaction object.
|
|
102
|
+
* @param witness - The witness arguments.
|
|
103
|
+
* @throws Will throw an error if no COTA cells are found for the sub key wallet.
|
|
104
|
+
*/
|
|
105
|
+
private prepareTransactionForSubKey;
|
|
106
|
+
/**
|
|
107
|
+
* Signs a transaction.
|
|
108
|
+
* @param {ccc.TransactionLike} txLike - The transaction-like object.
|
|
109
|
+
* @returns {Promise<ccc.Transaction>} A promise that resolves to the signed transaction.
|
|
110
|
+
*/
|
|
111
|
+
signOnlyTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
|
|
112
|
+
/**
|
|
113
|
+
* Signs a raw message with the account.
|
|
114
|
+
* @param {string | ccc.BytesLike} message - The message to sign.
|
|
115
|
+
* @returns {Promise<string>} A promise that resolves to the signed message.
|
|
116
|
+
*/
|
|
117
|
+
signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
|
|
118
|
+
/**
|
|
119
|
+
* Saves the current connection.
|
|
120
|
+
* @private
|
|
121
|
+
* @returns {Promise<void>}
|
|
122
|
+
*/
|
|
123
|
+
private saveConnection;
|
|
124
|
+
/**
|
|
125
|
+
* Restores the previous connection.
|
|
126
|
+
* @private
|
|
127
|
+
* @returns {Promise<void>}
|
|
128
|
+
*/
|
|
129
|
+
private restoreConnection;
|
|
124
130
|
}
|
|
125
|
-
//# sourceMappingURL=index.d.ts.map
|
|
131
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ckb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,MAAM;IA4CrC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IA/ClC;;;OAGG;IACH,IAAI,IAAI,IAAI,GAAG,CAAC,UAAU,CAEzB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,GAAG,CAAC,cAAc,CAEjC;IAED,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;;OAKG;YACW,gBAAgB;IAQ9B;;;;;;;;OAQG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,o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