@ckb-ccc/connector 0.0.5-alpha.7 → 0.0.5-alpha.8
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/advancedBarrel.d.ts +0 -1
- package/dist/advancedBarrel.d.ts.map +1 -1
- package/dist/advancedBarrel.js +0 -1
- package/dist/connector/index.d.ts +1 -0
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +26 -8
- package/dist/scenes/connecting.d.ts +1 -1
- package/dist/scenes/connecting.d.ts.map +1 -1
- package/dist/scenes/connecting.js +9 -3
- package/package.json +3 -3
- package/src/advancedBarrel.ts +0 -1
- package/src/connector/index.ts +26 -9
- package/src/scenes/connecting.ts +9 -2
- package/dist/signerOpenLink/index.d.ts +0 -13
- package/dist/signerOpenLink/index.d.ts.map +0 -1
- package/dist/signerOpenLink/index.js +0 -26
- package/src/signerOpenLink/index.ts +0 -35
package/dist/advancedBarrel.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advancedBarrel.d.ts","sourceRoot":"","sources":["../src/advancedBarrel.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"advancedBarrel.d.ts","sourceRoot":"","sources":["../src/advancedBarrel.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/dist/advancedBarrel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAkB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAkB,MAAM,uBAAuB,CAAC;AAyB5D,qBACa,qBAAsB,SAAQ,UAAU;IAEnD,OAAO,CAAC,OAAO,CAA2B;IAEnC,YAAY,CAAC,EAAE,CACpB,UAAU,EAAE,GAAG,CAAC,UAAU,EAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,KACf,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtB,OAAO,CAAC,cAAc,CAAsB;IAGrC,MAAM,EAAE,OAAO,CAAS;IACxB,SAAS,CAAC,MAAM,EAAE,OAAO;IAKzB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,GAAG,CAAC,MAAM,CAAiC;IACnD,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM;IAKnC,OAAO,CAAC,KAAK,CAAiC;IAE9C,OAAO,CAAC,cAAc,CAAC,CAAoB;IAE3C,OAAO,CAAC,cAAc,CAAC,CAAiB;IAExC,OAAO,CAAC,eAAe,CAAC,CAAS;IAGjC,OAAO,CAAC,UAAU,CAAC,CAAS;IAE5B,OAAO,CAAC,UAAU,CAAC,CAAS;IAErB,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC;IAG/B,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAElC,OAAO,CAAC,eAAe,CAAC,CAAS;IAEjC,OAAO,CAAC,OAAO,CAAC,CAAU;YAEZ,gBAAgB;YAUhB,aAAa;IAYpB,UAAU;IAQjB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,cAAc;IAUtB,iBAAiB,IAAI,IAAI;IAMzB,UAAU,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;IAoCnD,OAAO,CAAC,aAAa;YA2FP,SAAS;IAyCvB,OAAO,EAAE,GAAG,CAAC,cAAc,CAAC,CAAe;IAC3C,SAAS,EAAE,GAAG,CAAC,cAAc,CAAC,CAAe;IAC7C,OAAO,EAAE,GAAG,CAAC,cAAc,CAAC,CAAe;IAE3C,MAAM;IA4GN,OAAO;IAUP,OAAO,CAAC,aAAa,CAgBnB;IAEF,OAAO,CAAC,qBAAqB,CAqC3B;IAEF,MAAM,CAAC,MAAM,0BAsPX;CACH"}
|
package/dist/connector/index.js
CHANGED
|
@@ -18,7 +18,6 @@ import { WillUpdateEvent } from "../events";
|
|
|
18
18
|
import { generateConnectingScene, generateSignersScene, generateWalletsScene, } from "../scenes";
|
|
19
19
|
import { generateConnectedScene } from "../scenes/connected";
|
|
20
20
|
import { generateNetworksScene } from "../scenes/networks";
|
|
21
|
-
import { SignerOpenLink } from "../signerOpenLink";
|
|
22
21
|
var Scene;
|
|
23
22
|
(function (Scene) {
|
|
24
23
|
Scene["SelectingWallets"] = "SelectingWallets";
|
|
@@ -55,11 +54,27 @@ let WebComponentConnector = class WebComponentConnector extends LitElement {
|
|
|
55
54
|
};
|
|
56
55
|
this.signerSelectedHandler = (wallet, signerInfo) => {
|
|
57
56
|
this.scene = Scene.Connecting;
|
|
57
|
+
this.connectingError = undefined;
|
|
58
58
|
this.selectedWallet = wallet;
|
|
59
59
|
this.selectedSigner = signerInfo;
|
|
60
60
|
(async () => {
|
|
61
61
|
const { signer } = signerInfo;
|
|
62
|
-
|
|
62
|
+
try {
|
|
63
|
+
await signer.connect();
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (typeof error === "object") {
|
|
67
|
+
const message = error?.message;
|
|
68
|
+
if (typeof message === "string") {
|
|
69
|
+
this.connectingError = message;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.connectingError = JSON.stringify(message);
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.connectingError = JSON.stringify(error);
|
|
77
|
+
}
|
|
63
78
|
if (!(await signer.isConnected())) {
|
|
64
79
|
return;
|
|
65
80
|
}
|
|
@@ -182,13 +197,13 @@ let WebComponentConnector = class WebComponentConnector extends LitElement {
|
|
|
182
197
|
this.addSigner(`${signer.detail.info.name}`, "EVM", signer.detail.info.icon, signer);
|
|
183
198
|
}));
|
|
184
199
|
// === Dummy signers ===
|
|
185
|
-
this.addSigner("MetaMask", "EVM", METAMASK_SVG, new SignerOpenLink(this.client, `https://metamask.app.link/dapp/${window.location.href}
|
|
200
|
+
this.addSigner("MetaMask", "EVM", METAMASK_SVG, new ccc.SignerOpenLink(this.client, ccc.SignerType.EVM, `https://metamask.app.link/dapp/${window.location.href}`));
|
|
186
201
|
[ccc.SignerType.EVM, ccc.SignerType.BTC].forEach((type) => {
|
|
187
|
-
this.addSigner("OKX Wallet", type, OKX_SVG, new SignerOpenLink(this.client, "https://www.okx.com/download?deeplink=" +
|
|
202
|
+
this.addSigner("OKX Wallet", type, OKX_SVG, new ccc.SignerOpenLink(this.client, type, "https://www.okx.com/download?deeplink=" +
|
|
188
203
|
encodeURIComponent("okx://wallet/dapp/url?dappUrl=" +
|
|
189
|
-
encodeURIComponent(window.location.href))
|
|
204
|
+
encodeURIComponent(window.location.href))));
|
|
190
205
|
});
|
|
191
|
-
this.addSigner("UniSat", ccc.SignerType.BTC, UNI_SAT_SVG, new SignerOpenLink(this.client, "https://unisat.io/download"
|
|
206
|
+
this.addSigner("UniSat", ccc.SignerType.BTC, UNI_SAT_SVG, new ccc.SignerOpenLink(this.client, ccc.SignerType.BTC, "https://unisat.io/download"));
|
|
192
207
|
// ===
|
|
193
208
|
}
|
|
194
209
|
async addSigner(walletName, signerName, icon, signer) {
|
|
@@ -204,7 +219,7 @@ let WebComponentConnector = class WebComponentConnector extends LitElement {
|
|
|
204
219
|
}
|
|
205
220
|
updated = true;
|
|
206
221
|
const allSigners = [...wallet.signers, signerInfo];
|
|
207
|
-
const signers = allSigners.filter(({ signer }) => !(signer instanceof
|
|
222
|
+
const signers = allSigners.filter(({ signer }) => !(signer instanceof ccc.SignerDummy));
|
|
208
223
|
return {
|
|
209
224
|
...wallet,
|
|
210
225
|
signers: signers.length !== 0 ? signers : [signerInfo],
|
|
@@ -241,7 +256,7 @@ let WebComponentConnector = class WebComponentConnector extends LitElement {
|
|
|
241
256
|
if (this.scene === Scene.SelectingSigners || !this.selectedSigner) {
|
|
242
257
|
return generateSignersScene(this.selectedWallet, this.signerSelectedHandler);
|
|
243
258
|
}
|
|
244
|
-
return generateConnectingScene(this.selectedWallet, this.selectedSigner, this.signerSelectedHandler);
|
|
259
|
+
return generateConnectingScene(this.selectedWallet, this.selectedSigner, this.connectingError, this.signerSelectedHandler);
|
|
245
260
|
})();
|
|
246
261
|
const canBack = [
|
|
247
262
|
Scene.SelectingSigners,
|
|
@@ -589,6 +604,9 @@ __decorate([
|
|
|
589
604
|
__decorate([
|
|
590
605
|
state()
|
|
591
606
|
], WebComponentConnector.prototype, "selectedSigner", void 0);
|
|
607
|
+
__decorate([
|
|
608
|
+
state()
|
|
609
|
+
], WebComponentConnector.prototype, "connectingError", void 0);
|
|
592
610
|
__decorate([
|
|
593
611
|
state()
|
|
594
612
|
], WebComponentConnector.prototype, "walletName", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/ccc";
|
|
2
2
|
import { WalletWithSigners } from "../types";
|
|
3
|
-
export declare function generateConnectingScene(wallet: WalletWithSigners, signer: ccc.SignerInfo, onSignerSelected: (wallet: WalletWithSigners, signer: ccc.SignerInfo) => unknown): (string | import("lit").TemplateResult<1>)[];
|
|
3
|
+
export declare function generateConnectingScene(wallet: WalletWithSigners, signer: ccc.SignerInfo, error: string | undefined, onSignerSelected: (wallet: WalletWithSigners, signer: ccc.SignerInfo) => unknown): (string | import("lit").TemplateResult<1>)[];
|
|
4
4
|
//# sourceMappingURL=connecting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connecting.d.ts","sourceRoot":"","sources":["../../src/scenes/connecting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,GAAG,CAAC,UAAU,EACtB,gBAAgB,EAAE,CAChB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,GAAG,CAAC,UAAU,KACnB,OAAO,
|
|
1
|
+
{"version":3,"file":"connecting.d.ts","sourceRoot":"","sources":["../../src/scenes/connecting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,GAAG,CAAC,UAAU,EACtB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,gBAAgB,EAAE,CAChB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,GAAG,CAAC,UAAU,KACnB,OAAO,gDA2Bb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import { RETRY_SVG } from "../assets/retry.svg";
|
|
3
|
-
export function generateConnectingScene(wallet, signer, onSignerSelected) {
|
|
3
|
+
export function generateConnectingScene(wallet, signer, error, onSignerSelected) {
|
|
4
4
|
return [
|
|
5
5
|
wallet.name,
|
|
6
6
|
html `
|
|
@@ -9,8 +9,14 @@ export function generateConnectingScene(wallet, signer, onSignerSelected) {
|
|
|
9
9
|
src=${wallet.icon}
|
|
10
10
|
alt=${wallet.name}
|
|
11
11
|
/>
|
|
12
|
-
<span class="text-bold"
|
|
13
|
-
|
|
12
|
+
<span class="text-bold"
|
|
13
|
+
>${error
|
|
14
|
+
? `Failed to open ${wallet.name}`
|
|
15
|
+
: `Opening ${wallet.name}...`}</span
|
|
16
|
+
>
|
|
17
|
+
<span class="text-tip text-center"
|
|
18
|
+
>${error ?? "Confirm connection in the wallet"}</span
|
|
19
|
+
>
|
|
14
20
|
<button
|
|
15
21
|
class="btn-secondary mt-2 mb-2"
|
|
16
22
|
@click=${() => onSignerSelected(wallet, signer)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/connector",
|
|
3
|
-
"version": "0.0.5-alpha.
|
|
3
|
+
"version": "0.0.5-alpha.8",
|
|
4
4
|
"description": "Common Chains Connector UI",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@ckb-ccc/ccc": "0.0.5-alpha.
|
|
40
|
+
"@ckb-ccc/ccc": "0.0.5-alpha.8",
|
|
41
41
|
"lit": "^3.1.3"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "f12b8758d8581bfae0c9a00abbb5f7d2c6d03147"
|
|
44
44
|
}
|
package/src/advancedBarrel.ts
CHANGED
package/src/connector/index.ts
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
} from "../scenes";
|
|
17
17
|
import { generateConnectedScene } from "../scenes/connected";
|
|
18
18
|
import { generateNetworksScene } from "../scenes/networks";
|
|
19
|
-
import { SignerOpenLink } from "../signerOpenLink";
|
|
20
19
|
import { WalletWithSigners } from "../types";
|
|
21
20
|
|
|
22
21
|
enum Scene {
|
|
@@ -62,6 +61,8 @@ export class WebComponentConnector extends LitElement {
|
|
|
62
61
|
private selectedWallet?: WalletWithSigners;
|
|
63
62
|
@state()
|
|
64
63
|
private selectedSigner?: ccc.SignerInfo;
|
|
64
|
+
@state()
|
|
65
|
+
private connectingError?: string;
|
|
65
66
|
|
|
66
67
|
@state()
|
|
67
68
|
private walletName?: string;
|
|
@@ -229,10 +230,10 @@ export class WebComponentConnector extends LitElement {
|
|
|
229
230
|
"MetaMask",
|
|
230
231
|
"EVM",
|
|
231
232
|
METAMASK_SVG,
|
|
232
|
-
new SignerOpenLink(
|
|
233
|
+
new ccc.SignerOpenLink(
|
|
233
234
|
this.client,
|
|
234
|
-
`https://metamask.app.link/dapp/${window.location.href}`,
|
|
235
235
|
ccc.SignerType.EVM,
|
|
236
|
+
`https://metamask.app.link/dapp/${window.location.href}`,
|
|
236
237
|
),
|
|
237
238
|
);
|
|
238
239
|
[ccc.SignerType.EVM, ccc.SignerType.BTC].forEach((type) => {
|
|
@@ -240,14 +241,14 @@ export class WebComponentConnector extends LitElement {
|
|
|
240
241
|
"OKX Wallet",
|
|
241
242
|
type,
|
|
242
243
|
OKX_SVG,
|
|
243
|
-
new SignerOpenLink(
|
|
244
|
+
new ccc.SignerOpenLink(
|
|
244
245
|
this.client,
|
|
246
|
+
type,
|
|
245
247
|
"https://www.okx.com/download?deeplink=" +
|
|
246
248
|
encodeURIComponent(
|
|
247
249
|
"okx://wallet/dapp/url?dappUrl=" +
|
|
248
250
|
encodeURIComponent(window.location.href),
|
|
249
251
|
),
|
|
250
|
-
type,
|
|
251
252
|
),
|
|
252
253
|
);
|
|
253
254
|
});
|
|
@@ -255,10 +256,10 @@ export class WebComponentConnector extends LitElement {
|
|
|
255
256
|
"UniSat",
|
|
256
257
|
ccc.SignerType.BTC,
|
|
257
258
|
UNI_SAT_SVG,
|
|
258
|
-
new SignerOpenLink(
|
|
259
|
+
new ccc.SignerOpenLink(
|
|
259
260
|
this.client,
|
|
260
|
-
"https://unisat.io/download",
|
|
261
261
|
ccc.SignerType.BTC,
|
|
262
|
+
"https://unisat.io/download",
|
|
262
263
|
),
|
|
263
264
|
);
|
|
264
265
|
// ===
|
|
@@ -286,7 +287,7 @@ export class WebComponentConnector extends LitElement {
|
|
|
286
287
|
updated = true;
|
|
287
288
|
const allSigners = [...wallet.signers, signerInfo];
|
|
288
289
|
const signers = allSigners.filter(
|
|
289
|
-
({ signer }) => !(signer instanceof
|
|
290
|
+
({ signer }) => !(signer instanceof ccc.SignerDummy),
|
|
290
291
|
);
|
|
291
292
|
return {
|
|
292
293
|
...wallet,
|
|
@@ -349,6 +350,7 @@ export class WebComponentConnector extends LitElement {
|
|
|
349
350
|
return generateConnectingScene(
|
|
350
351
|
this.selectedWallet,
|
|
351
352
|
this.selectedSigner,
|
|
353
|
+
this.connectingError,
|
|
352
354
|
this.signerSelectedHandler,
|
|
353
355
|
);
|
|
354
356
|
})();
|
|
@@ -449,11 +451,26 @@ export class WebComponentConnector extends LitElement {
|
|
|
449
451
|
signerInfo: ccc.SignerInfo,
|
|
450
452
|
) => {
|
|
451
453
|
this.scene = Scene.Connecting;
|
|
454
|
+
this.connectingError = undefined;
|
|
452
455
|
this.selectedWallet = wallet;
|
|
453
456
|
this.selectedSigner = signerInfo;
|
|
454
457
|
(async () => {
|
|
455
458
|
const { signer } = signerInfo;
|
|
456
|
-
|
|
459
|
+
try {
|
|
460
|
+
await signer.connect();
|
|
461
|
+
} catch (error) {
|
|
462
|
+
if (typeof error === "object") {
|
|
463
|
+
const message = (error as { message: unknown })?.message;
|
|
464
|
+
if (typeof message === "string") {
|
|
465
|
+
this.connectingError = message;
|
|
466
|
+
} else {
|
|
467
|
+
this.connectingError = JSON.stringify(message);
|
|
468
|
+
}
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
this.connectingError = JSON.stringify(error);
|
|
473
|
+
}
|
|
457
474
|
if (!(await signer.isConnected())) {
|
|
458
475
|
return;
|
|
459
476
|
}
|
package/src/scenes/connecting.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { WalletWithSigners } from "../types";
|
|
|
6
6
|
export function generateConnectingScene(
|
|
7
7
|
wallet: WalletWithSigners,
|
|
8
8
|
signer: ccc.SignerInfo,
|
|
9
|
+
error: string | undefined,
|
|
9
10
|
onSignerSelected: (
|
|
10
11
|
wallet: WalletWithSigners,
|
|
11
12
|
signer: ccc.SignerInfo,
|
|
@@ -19,8 +20,14 @@ export function generateConnectingScene(
|
|
|
19
20
|
src=${wallet.icon}
|
|
20
21
|
alt=${wallet.name}
|
|
21
22
|
/>
|
|
22
|
-
<span class="text-bold"
|
|
23
|
-
|
|
23
|
+
<span class="text-bold"
|
|
24
|
+
>${error
|
|
25
|
+
? `Failed to open ${wallet.name}`
|
|
26
|
+
: `Opening ${wallet.name}...`}</span
|
|
27
|
+
>
|
|
28
|
+
<span class="text-tip text-center"
|
|
29
|
+
>${error ?? "Confirm connection in the wallet"}</span
|
|
30
|
+
>
|
|
24
31
|
<button
|
|
25
32
|
class="btn-secondary mt-2 mb-2"
|
|
26
33
|
@click=${() => onSignerSelected(wallet, signer)}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ccc } from "@ckb-ccc/ccc";
|
|
2
|
-
export declare class SignerOpenLink extends ccc.Signer {
|
|
3
|
-
private readonly link;
|
|
4
|
-
readonly type: ccc.SignerType;
|
|
5
|
-
get signType(): ccc.SignerSignType;
|
|
6
|
-
constructor(client: ccc.Client, link: string, type: ccc.SignerType);
|
|
7
|
-
replaceClient(client: ccc.Client): Promise<SignerOpenLink>;
|
|
8
|
-
isConnected(): Promise<boolean>;
|
|
9
|
-
connect(): Promise<void>;
|
|
10
|
-
getInternalAddress(): Promise<string>;
|
|
11
|
-
getAddressObjs(): Promise<ccc.Address[]>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signerOpenLink/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,qBAAa,cAAe,SAAQ,GAAG,CAAC,MAAM;IAO1C,OAAO,CAAC,QAAQ,CAAC,IAAI;aACL,IAAI,EAAE,GAAG,CAAC,UAAU;IAPtC,IAAI,QAAQ,IAAI,GAAG,CAAC,cAAc,CAEjC;gBAGC,MAAM,EAAE,GAAG,CAAC,MAAM,EACD,IAAI,EAAE,MAAM,EACb,IAAI,EAAE,GAAG,CAAC,UAAU;IAKhC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAI1D,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIrC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;CAG/C"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ccc } from "@ckb-ccc/ccc";
|
|
2
|
-
export class SignerOpenLink extends ccc.Signer {
|
|
3
|
-
get signType() {
|
|
4
|
-
return ccc.SignerSignType.Unknown;
|
|
5
|
-
}
|
|
6
|
-
constructor(client, link, type) {
|
|
7
|
-
super(client);
|
|
8
|
-
this.link = link;
|
|
9
|
-
this.type = type;
|
|
10
|
-
}
|
|
11
|
-
async replaceClient(client) {
|
|
12
|
-
return new SignerOpenLink(client, this.link, this.type);
|
|
13
|
-
}
|
|
14
|
-
async isConnected() {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
async connect() {
|
|
18
|
-
window.open(this.link, "_blank")?.focus();
|
|
19
|
-
}
|
|
20
|
-
async getInternalAddress() {
|
|
21
|
-
throw new Error("Can't get address from SignerOpenLink");
|
|
22
|
-
}
|
|
23
|
-
async getAddressObjs() {
|
|
24
|
-
throw new Error("Can't get addresses from SignerOpenLink");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ccc } from "@ckb-ccc/ccc";
|
|
2
|
-
|
|
3
|
-
export class SignerOpenLink extends ccc.Signer {
|
|
4
|
-
get signType(): ccc.SignerSignType {
|
|
5
|
-
return ccc.SignerSignType.Unknown;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
constructor(
|
|
9
|
-
client: ccc.Client,
|
|
10
|
-
private readonly link: string,
|
|
11
|
-
public readonly type: ccc.SignerType,
|
|
12
|
-
) {
|
|
13
|
-
super(client);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async replaceClient(client: ccc.Client): Promise<SignerOpenLink> {
|
|
17
|
-
return new SignerOpenLink(client, this.link, this.type);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async isConnected(): Promise<boolean> {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async connect(): Promise<void> {
|
|
25
|
-
window.open(this.link, "_blank")?.focus();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async getInternalAddress(): Promise<string> {
|
|
29
|
-
throw new Error("Can't get address from SignerOpenLink");
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async getAddressObjs(): Promise<ccc.Address[]> {
|
|
33
|
-
throw new Error("Can't get addresses from SignerOpenLink");
|
|
34
|
-
}
|
|
35
|
-
}
|