@ckb-ccc/connector 0.0.11-alpha.1 → 0.0.11-alpha.3
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/signers/index.d.ts.map +1 -1
- package/dist/signers/index.js +10 -7
- package/package.json +3 -3
- package/src/signers/index.ts +11 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAOjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,qBAAa,iBAAkB,YAAW,kBAAkB;IAMxD,OAAO,CAAC,QAAQ,CAAC,IAAI;IALhB,OAAO,EAAE,iBAAiB,EAAE,CAAM;IAEzC,OAAO,CAAC,cAAc,CAAsB;gBAGzB,IAAI,EAAE,sBAAsB,GAAG;QAC9C,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,CACb,UAAU,EAAE,GAAG,CAAC,UAAU,EAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,KACf,OAAO,CAAC,OAAO,CAAC,CAAC;QACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,IAAI,CAAC;KAC3B;IAKH,SAAS;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAOjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,qBAAa,iBAAkB,YAAW,kBAAkB;IAMxD,OAAO,CAAC,QAAQ,CAAC,IAAI;IALhB,OAAO,EAAE,iBAAiB,EAAE,CAAM;IAEzC,OAAO,CAAC,cAAc,CAAsB;gBAGzB,IAAI,EAAE,sBAAsB,GAAG;QAC9C,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,CACb,UAAU,EAAE,GAAG,CAAC,UAAU,EAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,KACf,OAAO,CAAC,OAAO,CAAC,CAAC;QACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,IAAI,CAAC;KAC3B;IAKH,SAAS;;;;;;IAgCT,MAAM;IAKN,OAAO;YAkGO,SAAS;IAkCvB,aAAa,IAAI,IAAI;IAKrB,gBAAgB,IAAI,IAAI;CACzB"}
|
package/dist/signers/index.js
CHANGED
|
@@ -14,9 +14,12 @@ export class SignersController {
|
|
|
14
14
|
}
|
|
15
15
|
getConfig() {
|
|
16
16
|
const name = this.host.name ??
|
|
17
|
-
document.querySelector("head title")
|
|
17
|
+
document.querySelector("head title")?.text ??
|
|
18
|
+
"Unknown";
|
|
18
19
|
const icon = this.host.icon ??
|
|
19
|
-
document.querySelector('link[rel="icon"]')
|
|
20
|
+
document.querySelector('link[rel="icon"]')
|
|
21
|
+
?.href ??
|
|
22
|
+
"https://fav.farm/%E2%9D%93";
|
|
20
23
|
const preferredNetworks = [
|
|
21
24
|
...(this.host.preferredNetworks ?? []),
|
|
22
25
|
{
|
|
@@ -46,8 +49,11 @@ export class SignersController {
|
|
|
46
49
|
this.resetListeners = [];
|
|
47
50
|
this.wallets = [];
|
|
48
51
|
const { client, name, icon, preferredNetworks } = this.getConfig();
|
|
52
|
+
ccc.UtxoGlobal.getUtxoGlobalSigners(client).forEach(({ signer, name }) => {
|
|
53
|
+
this.addSigner("UTXO Global Wallet", name, UTXO_GLOBAL_SVG, signer);
|
|
54
|
+
});
|
|
49
55
|
ccc.JoyId.getJoyIdSigners(client, name, icon, preferredNetworks).forEach(({ signer, name }) => {
|
|
50
|
-
this.addSigner("JoyID", name, JOY_ID_SVG, signer);
|
|
56
|
+
this.addSigner("JoyID Passkey", name, JOY_ID_SVG, signer);
|
|
51
57
|
});
|
|
52
58
|
const uniSatSigner = ccc.UniSat.getUniSatSigner(client, preferredNetworks);
|
|
53
59
|
if (uniSatSigner) {
|
|
@@ -60,9 +66,6 @@ export class SignersController {
|
|
|
60
66
|
if (nip07Signer) {
|
|
61
67
|
this.addSigner("Nostr", "Nostr", NOSTR_SVG, nip07Signer);
|
|
62
68
|
}
|
|
63
|
-
ccc.UtxoGlobal.getUtxoGlobalSigners(client).forEach(({ signer, name }) => {
|
|
64
|
-
this.addSigner("UTXO Global Wallet", name, UTXO_GLOBAL_SVG, signer);
|
|
65
|
-
});
|
|
66
69
|
const eip6963Manager = new ccc.Eip6963.SignerFactory(client);
|
|
67
70
|
this.resetListeners.push(eip6963Manager.subscribeSigners((signer) => {
|
|
68
71
|
this.addSigner(`${signer.detail.info.name}`, "EVM", signer.detail.info.icon, signer);
|
|
@@ -105,7 +108,7 @@ export class SignersController {
|
|
|
105
108
|
hostConnected() {
|
|
106
109
|
this.refresh();
|
|
107
110
|
// Wait for plugins to be loaded
|
|
108
|
-
setTimeout(() => this.refresh(),
|
|
111
|
+
setTimeout(() => this.refresh(), 500);
|
|
109
112
|
}
|
|
110
113
|
hostDisconnected() { }
|
|
111
114
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/connector",
|
|
3
|
-
"version": "0.0.11-alpha.
|
|
3
|
+
"version": "0.0.11-alpha.3",
|
|
4
4
|
"description": "CCC - CKBer's Codebase. Common Chains Connector UI",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@ckb-ccc/ccc": "0.0.11-alpha.
|
|
41
|
+
"@ckb-ccc/ccc": "0.0.11-alpha.3",
|
|
42
42
|
"lit": "^3.1.3"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "235ba3c69a0a1098fcd741fafb4b8f32dcfbc2b5"
|
|
45
45
|
}
|
package/src/signers/index.ts
CHANGED
|
@@ -32,10 +32,13 @@ export class SignersController implements ReactiveController {
|
|
|
32
32
|
getConfig() {
|
|
33
33
|
const name =
|
|
34
34
|
this.host.name ??
|
|
35
|
-
(document.querySelector("head title") as HTMLTitleElement)
|
|
35
|
+
(document.querySelector("head title") as HTMLTitleElement | null)?.text ??
|
|
36
|
+
"Unknown";
|
|
36
37
|
const icon =
|
|
37
38
|
this.host.icon ??
|
|
38
|
-
(document.querySelector('link[rel="icon"]') as HTMLLinkElement)
|
|
39
|
+
(document.querySelector('link[rel="icon"]') as HTMLLinkElement | null)
|
|
40
|
+
?.href ??
|
|
41
|
+
"https://fav.farm/%E2%9D%93";
|
|
39
42
|
const preferredNetworks = [
|
|
40
43
|
...(this.host.preferredNetworks ?? []),
|
|
41
44
|
{
|
|
@@ -71,9 +74,13 @@ export class SignersController implements ReactiveController {
|
|
|
71
74
|
|
|
72
75
|
const { client, name, icon, preferredNetworks } = this.getConfig();
|
|
73
76
|
|
|
77
|
+
ccc.UtxoGlobal.getUtxoGlobalSigners(client).forEach(({ signer, name }) => {
|
|
78
|
+
this.addSigner("UTXO Global Wallet", name, UTXO_GLOBAL_SVG, signer);
|
|
79
|
+
});
|
|
80
|
+
|
|
74
81
|
ccc.JoyId.getJoyIdSigners(client, name, icon, preferredNetworks).forEach(
|
|
75
82
|
({ signer, name }) => {
|
|
76
|
-
this.addSigner("JoyID", name, JOY_ID_SVG, signer);
|
|
83
|
+
this.addSigner("JoyID Passkey", name, JOY_ID_SVG, signer);
|
|
77
84
|
},
|
|
78
85
|
);
|
|
79
86
|
|
|
@@ -91,10 +98,6 @@ export class SignersController implements ReactiveController {
|
|
|
91
98
|
this.addSigner("Nostr", "Nostr", NOSTR_SVG, nip07Signer);
|
|
92
99
|
}
|
|
93
100
|
|
|
94
|
-
ccc.UtxoGlobal.getUtxoGlobalSigners(client).forEach(({ signer, name }) => {
|
|
95
|
-
this.addSigner("UTXO Global Wallet", name, UTXO_GLOBAL_SVG, signer);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
101
|
const eip6963Manager = new ccc.Eip6963.SignerFactory(client);
|
|
99
102
|
this.resetListeners.push(
|
|
100
103
|
eip6963Manager.subscribeSigners((signer) => {
|
|
@@ -198,7 +201,7 @@ export class SignersController implements ReactiveController {
|
|
|
198
201
|
hostConnected(): void {
|
|
199
202
|
this.refresh();
|
|
200
203
|
// Wait for plugins to be loaded
|
|
201
|
-
setTimeout(() => this.refresh(),
|
|
204
|
+
setTimeout(() => this.refresh(), 500);
|
|
202
205
|
}
|
|
203
206
|
hostDisconnected(): void {}
|
|
204
207
|
}
|