@ckb-ccc/joy-id 0.0.6-alpha.0 → 0.0.7-alpha.1
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/index.d.ts +2 -3
- package/dist/ckb/index.d.ts.map +1 -1
- package/dist/ckb/index.js +21 -10
- 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 +63 -56
- package/dist.commonjs/btc/index.js +140 -114
- package/dist.commonjs/ckb/index.d.ts +121 -115
- package/dist.commonjs/ckb/index.d.ts.map +1 -1
- package/dist.commonjs/ckb/index.js +307 -239
- 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 +47 -44
- package/dist.commonjs/evm/index.d.ts +67 -61
- package/dist.commonjs/evm/index.js +135 -113
- package/dist.commonjs/index.d.ts +1 -1
- package/dist.commonjs/index.js +40 -19
- package/dist.commonjs/nostr/index.d.ts +48 -42
- package/dist.commonjs/nostr/index.js +110 -91
- package/dist.commonjs/signerFactory/index.d.ts +6 -2
- package/dist.commonjs/signerFactory/index.js +42 -31
- package/package.json +5 -5
- package/src/ckb/index.ts +30 -13
package/dist/ckb/index.d.ts
CHANGED
|
@@ -90,9 +90,8 @@ export declare class CkbSigner extends ccc.Signer {
|
|
|
90
90
|
/**
|
|
91
91
|
* Prepares a transaction for a sub key.
|
|
92
92
|
* @private
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
95
|
-
* @returns {Promise<void>}
|
|
93
|
+
* @param tx - The transaction object.
|
|
94
|
+
* @param witness - The witness arguments.
|
|
96
95
|
* @throws Will throw an error if no COTA cells are found for the sub key wallet.
|
|
97
96
|
*/
|
|
98
97
|
private prepareTransactionForSubKey;
|
package/dist/ckb/index.d.ts.map
CHANGED
|
@@ -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,oBAAQ,EAChB,cAAc,CAAC,oBAAQ,EACvB,eAAe,GAAE,eAAmD;IAKvF;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAYjB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB9B;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQrC;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAQpC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAO3C;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAI9C;;;;OAIG;IACG,kBAAkB,CACtB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;
|
|
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,oBAAQ,EAChB,cAAc,CAAC,oBAAQ,EACvB,eAAe,GAAE,eAAmD;IAKvF;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAYjB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB9B;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQrC;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAQpC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAO3C;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAI9C;;;;OAIG;IACG,kBAAkB,CACtB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IAmB3B;;;;;;OAMG;YACW,2BAA2B;IAuCzC;;;;OAIG;IACG,mBAAmB,CACvB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IA8C3B;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IA2BtE;;;;OAIG;YACW,cAAc;IAU5B;;;;OAIG;YACW,iBAAiB;CAMhC"}
|
package/dist/ckb/index.js
CHANGED
|
@@ -147,12 +147,13 @@ export class CkbSigner extends ccc.Signer {
|
|
|
147
147
|
*/
|
|
148
148
|
async prepareTransaction(txLike) {
|
|
149
149
|
const tx = ccc.Transaction.from(txLike);
|
|
150
|
+
await tx.addCellDepsOfKnownScripts(this.client, ccc.KnownScript.JoyId);
|
|
150
151
|
const position = await tx.findInputIndexByLock((await this.getAddressObj()).script, this.client);
|
|
151
152
|
if (position === undefined) {
|
|
152
153
|
return tx;
|
|
153
154
|
}
|
|
154
155
|
const witness = tx.getWitnessArgsAt(position) ?? ccc.WitnessArgs.from({});
|
|
155
|
-
witness.lock = "
|
|
156
|
+
witness.lock = ccc.hexFrom("00".repeat(1000));
|
|
156
157
|
await this.prepareTransactionForSubKey(tx, witness);
|
|
157
158
|
tx.setWitnessArgsAt(position, witness);
|
|
158
159
|
return tx;
|
|
@@ -160,9 +161,8 @@ export class CkbSigner extends ccc.Signer {
|
|
|
160
161
|
/**
|
|
161
162
|
* Prepares a transaction for a sub key.
|
|
162
163
|
* @private
|
|
163
|
-
* @param
|
|
164
|
-
* @param
|
|
165
|
-
* @returns {Promise<void>}
|
|
164
|
+
* @param tx - The transaction object.
|
|
165
|
+
* @param witness - The witness arguments.
|
|
166
166
|
* @throws Will throw an error if no COTA cells are found for the sub key wallet.
|
|
167
167
|
*/
|
|
168
168
|
async prepareTransactionForSubKey(tx, witness) {
|
|
@@ -179,10 +179,7 @@ export class CkbSigner extends ccc.Signer {
|
|
|
179
179
|
});
|
|
180
180
|
witness.outputType = ccc.hexFrom(unlockEntry);
|
|
181
181
|
const cotaDeps = [];
|
|
182
|
-
for await (const cell of this.client.findCellsByLockAndType(lock, {
|
|
183
|
-
...(await this.client.getKnownScript(ccc.KnownScript.COTA)),
|
|
184
|
-
args: "0x",
|
|
185
|
-
})) {
|
|
182
|
+
for await (const cell of this.client.findCellsByLockAndType(lock, await ccc.Script.fromKnownScript(this.client, ccc.KnownScript.COTA, "0x"))) {
|
|
186
183
|
cotaDeps.push(ccc.CellDep.from({
|
|
187
184
|
depType: "code",
|
|
188
185
|
outPoint: cell.outPoint,
|
|
@@ -201,13 +198,27 @@ export class CkbSigner extends ccc.Signer {
|
|
|
201
198
|
async signOnlyTransaction(txLike) {
|
|
202
199
|
const tx = ccc.Transaction.from(txLike);
|
|
203
200
|
const { script } = await this.getAddressObj();
|
|
201
|
+
const witnessIndexes = await ccc.reduceAsync(tx.inputs, async (acc, input, i) => {
|
|
202
|
+
await input.completeExtraInfos(this.client);
|
|
203
|
+
if (!input.cellOutput) {
|
|
204
|
+
throw new Error("Unable to complete input");
|
|
205
|
+
}
|
|
206
|
+
if (input.cellOutput.lock.eq(script)) {
|
|
207
|
+
acc.push(i);
|
|
208
|
+
}
|
|
209
|
+
}, []);
|
|
210
|
+
// Trim unnecessary fields to reduce tx size
|
|
211
|
+
await tx.prepareSighashAllWitness(script, 0, this.client);
|
|
212
|
+
tx.inputs.forEach((i) => {
|
|
213
|
+
i.cellOutput = undefined;
|
|
214
|
+
i.outputData = undefined;
|
|
215
|
+
});
|
|
204
216
|
const config = this.getConfig();
|
|
205
217
|
const res = await createPopup(buildJoyIDURL({
|
|
206
218
|
...config,
|
|
207
219
|
tx: JSON.parse(tx.stringify()),
|
|
208
220
|
signerAddress: (await this.assertConnection()).address,
|
|
209
|
-
|
|
210
|
-
witnessLastIndex: await tx.findLastInputIndexByLock(script, this.client),
|
|
221
|
+
witnessIndexes,
|
|
211
222
|
}, "popup", "/sign-ckb-raw-tx"), {
|
|
212
223
|
...config,
|
|
213
224
|
type: DappRequestType.SignCkbRawTx,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * as JoyIdA from "./advancedBarrel";
|
|
2
|
-
//# sourceMappingURL=advanced.d.ts.map
|
|
2
|
+
//# sourceMappingURL=advanced.d.ts.map
|
|
@@ -1,27 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (
|
|
9
|
+
!desc ||
|
|
10
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
11
|
+
) {
|
|
12
|
+
desc = {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return m[k];
|
|
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 __setModuleDefault =
|
|
26
|
+
(this && this.__setModuleDefault) ||
|
|
27
|
+
(Object.create
|
|
28
|
+
? function (o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}
|
|
31
|
+
: function (o, v) {
|
|
32
|
+
o["default"] = v;
|
|
33
|
+
});
|
|
34
|
+
var __importStar =
|
|
35
|
+
(this && this.__importStar) ||
|
|
36
|
+
function (mod) {
|
|
19
37
|
if (mod && mod.__esModule) return mod;
|
|
20
38
|
var result = {};
|
|
21
|
-
if (mod != null)
|
|
39
|
+
if (mod != null)
|
|
40
|
+
for (var k in mod)
|
|
41
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
42
|
+
__createBinding(result, mod, k);
|
|
22
43
|
__setModuleDefault(result, mod);
|
|
23
44
|
return result;
|
|
24
|
-
};
|
|
45
|
+
};
|
|
25
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
47
|
exports.JoyIdA = void 0;
|
|
27
48
|
exports.JoyIdA = __importStar(require("./advancedBarrel"));
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (
|
|
9
|
+
!desc ||
|
|
10
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
11
|
+
) {
|
|
12
|
+
desc = {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return m[k];
|
|
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
|
+
};
|
|
16
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
33
|
__exportStar(require("./common"), exports);
|
|
18
34
|
__exportStar(require("./connectionsStorage"), exports);
|
package/dist.commonjs/barrel.js
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (
|
|
9
|
+
!desc ||
|
|
10
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
11
|
+
) {
|
|
12
|
+
desc = {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return m[k];
|
|
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
|
+
};
|
|
16
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
33
|
__exportStar(require("./btc"), exports);
|
|
18
34
|
__exportStar(require("./ckb"), exports);
|
|
@@ -6,60 +6,67 @@ import { ConnectionsRepo } from "../connectionsStorage";
|
|
|
6
6
|
* @extends {ccc.SignerBtc}
|
|
7
7
|
*/
|
|
8
8
|
export declare class BitcoinSigner extends ccc.SignerBtc {
|
|
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
|
-
|
|
9
|
+
private readonly name;
|
|
10
|
+
private readonly icon;
|
|
11
|
+
private readonly addressType;
|
|
12
|
+
private readonly appUri;
|
|
13
|
+
private readonly connectionsRepo;
|
|
14
|
+
private connection?;
|
|
15
|
+
/**
|
|
16
|
+
* Ensures that the signer is connected and returns the connection.
|
|
17
|
+
* @private
|
|
18
|
+
* @throws Will throw an error if not connected.
|
|
19
|
+
* @returns {Connection} The current connection.
|
|
20
|
+
*/
|
|
21
|
+
private assertConnection;
|
|
22
|
+
/**
|
|
23
|
+
* Creates an instance of BitcoinSigner.
|
|
24
|
+
* @param {ccc.Client} client - The client instance.
|
|
25
|
+
* @param {string} name - The name of the signer.
|
|
26
|
+
* @param {string} icon - The icon URL of the signer.
|
|
27
|
+
* @param {"auto" | "p2wpkh" | "p2tr"} [addressType="auto"] - The address type.
|
|
28
|
+
* @param {string} [appUri="https://app.joy.id"] - The application URI.
|
|
29
|
+
* @param {ConnectionsRepo} [connectionsRepo=new ConnectionsRepoLocalStorage()] - The connections repository.
|
|
30
|
+
*/
|
|
31
|
+
constructor(
|
|
32
|
+
client: ccc.Client,
|
|
33
|
+
name: string,
|
|
34
|
+
icon: string,
|
|
35
|
+
addressType?: "auto" | "p2wpkh" | "p2tr",
|
|
36
|
+
appUri?: string,
|
|
37
|
+
connectionsRepo?: ConnectionsRepo,
|
|
38
|
+
);
|
|
39
|
+
/**
|
|
40
|
+
* Gets the configuration for JoyID.
|
|
41
|
+
* @private
|
|
42
|
+
* @returns {object} The configuration object.
|
|
43
|
+
*/
|
|
44
|
+
private getConfig;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the Bitcoin account address.
|
|
47
|
+
* @returns {Promise<string>} A promise that resolves to the Bitcoin account address.
|
|
48
|
+
*/
|
|
49
|
+
getBtcAccount(): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Gets the Bitcoin public key.
|
|
52
|
+
* @returns {Promise<ccc.Hex>} A promise that resolves to the Bitcoin public key.
|
|
53
|
+
*/
|
|
54
|
+
getBtcPublicKey(): Promise<ccc.Hex>;
|
|
55
|
+
/**
|
|
56
|
+
* Connects to the provider by requesting authentication.
|
|
57
|
+
* @returns {Promise<void>} A promise that resolves when the connection is established.
|
|
58
|
+
*/
|
|
59
|
+
connect(): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if the signer is connected.
|
|
62
|
+
* @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
|
|
63
|
+
*/
|
|
64
|
+
isConnected(): Promise<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Signs a raw message with the Bitcoin account.
|
|
67
|
+
* @param {string | ccc.BytesLike} message - The message to sign.
|
|
68
|
+
* @returns {Promise<string>} A promise that resolves to the signed message.
|
|
69
|
+
*/
|
|
70
|
+
signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
|
|
64
71
|
}
|
|
65
|
-
//# sourceMappingURL=index.d.ts.map
|
|
72
|
+
//# sourceMappingURL=index.d.ts.map
|