@ckb-ccc/ccc 0.0.12-alpha.0 → 0.0.12-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/assets/eth.svg.d.ts +2 -0
- package/dist/assets/eth.svg.d.ts.map +1 -0
- package/dist/assets/eth.svg.js +2 -0
- package/dist/signersController.d.ts.map +1 -1
- package/dist/signersController.js +2 -1
- package/dist.commonjs/assets/eth.svg.d.ts +2 -0
- package/dist.commonjs/assets/eth.svg.d.ts.map +1 -0
- package/dist.commonjs/assets/eth.svg.js +5 -0
- package/dist.commonjs/signersController.d.ts.map +1 -1
- package/dist.commonjs/signersController.js +2 -1
- package/package.json +9 -9
- package/src/assets/eth.svg.ts +5 -0
- package/src/signersController.ts +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eth.svg.d.ts","sourceRoot":"","sources":["../../src/assets/eth.svg.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,QAEnB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { encodeSvgToImgSrc } from "./utils.js";
|
|
2
|
+
export const ETH_SVG = encodeSvgToImgSrc('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_46_558)"><circle cx="16" cy="16" r="16" fill="#627EEA"/><path d="M15.9957 20.4203L9.14282 16.3876L15.9957 5.14258V20.4203Z" fill="white"/><path d="M15.9957 26.8573L9.30029 17.396L15.9957 21.3511V26.8573Z" fill="white"/><path d="M16.2319 20.4203L23.0849 16.3876L16.2319 5.14258V20.4203Z" fill="#C1CCF7"/><path d="M16.3107 26.8573L23.0848 17.396L16.3107 21.3511V26.8573Z" fill="#C1CCF7"/></g><defs><clipPath id="clip0_46_558"><rect width="32" height="32" fill="white"/></clipPath></defs></svg>');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signersController.d.ts","sourceRoot":"","sources":["../src/signersController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"signersController.d.ts","sourceRoot":"","sources":["../src/signersController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAepC,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,GAAG;IAC3C,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;CAC3B,CAAC;AAEF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,cAAc,CAAsB;;IAI5C,SAAS,CAAC,OAAO,CAAC,EAAE;QAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;;;;;IAgCD,UAAU;IAKJ,OAAO,CACX,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,QAAQ,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,EAChD,OAAO,CAAC,EAAE;QACR,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;KACf;YAoHW,cAAc;YA4Bd,UAAU;YA4BV,SAAS;CA6CxB"}
|
|
@@ -5,6 +5,7 @@ import { Nip07 } from "@ckb-ccc/nip07";
|
|
|
5
5
|
import { Okx } from "@ckb-ccc/okx";
|
|
6
6
|
import { UniSat } from "@ckb-ccc/uni-sat";
|
|
7
7
|
import { UtxoGlobal } from "@ckb-ccc/utxo-global";
|
|
8
|
+
import { ETH_SVG } from "./assets/eth.svg.js";
|
|
8
9
|
import { JOY_ID_SVG } from "./assets/joy-id.svg.js";
|
|
9
10
|
import { METAMASK_SVG } from "./assets/metamask.svg.js";
|
|
10
11
|
import { NOSTR_SVG } from "./assets/nostr.svg.js";
|
|
@@ -55,7 +56,7 @@ export class SignersController {
|
|
|
55
56
|
await this.addSigners(wallets, "UniSat", UNI_SAT_SVG, UniSat.getUniSatSigners(client, preferredNetworks), onUpdate, configs);
|
|
56
57
|
await this.addSigners(wallets, "OKX Wallet", OKX_SVG, Okx.getOKXSigners(client, preferredNetworks), onUpdate, configs);
|
|
57
58
|
await this.addSigner(wallets, "Nostr", NOSTR_SVG, "Nostr", Nip07.getNip07Signer(client), onUpdate, configs);
|
|
58
|
-
this.resetListeners.push(new Eip6963.SignerFactory(client).subscribeSigners((signer) => this.addSigner(wallets,
|
|
59
|
+
this.resetListeners.push(new Eip6963.SignerFactory(client).subscribeSigners((signer, detail) => this.addSigner(wallets, detail?.info.name ?? "EVM", detail?.info.icon ?? ETH_SVG, "EVM", signer, onUpdate, configs)));
|
|
59
60
|
// === Dummy signers ===
|
|
60
61
|
await this.addLinkSigners(wallets, "MetaMask", METAMASK_SVG, client, [ccc.SignerType.EVM], `https://metamask.app.link/dapp/${window.location.href}`, onUpdate, configs);
|
|
61
62
|
await this.addLinkSigners(wallets, "OKX Wallet", OKX_SVG, client, [ccc.SignerType.EVM, ccc.SignerType.BTC], "https://www.okx.com/download?deeplink=" +
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eth.svg.d.ts","sourceRoot":"","sources":["../../src/assets/eth.svg.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,QAEnB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ETH_SVG = void 0;
|
|
4
|
+
const utils_js_1 = require("./utils.js");
|
|
5
|
+
exports.ETH_SVG = (0, utils_js_1.encodeSvgToImgSrc)('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_46_558)"><circle cx="16" cy="16" r="16" fill="#627EEA"/><path d="M15.9957 20.4203L9.14282 16.3876L15.9957 5.14258V20.4203Z" fill="white"/><path d="M15.9957 26.8573L9.30029 17.396L15.9957 21.3511V26.8573Z" fill="white"/><path d="M16.2319 20.4203L23.0849 16.3876L16.2319 5.14258V20.4203Z" fill="#C1CCF7"/><path d="M16.3107 26.8573L23.0848 17.396L16.3107 21.3511V26.8573Z" fill="#C1CCF7"/></g><defs><clipPath id="clip0_46_558"><rect width="32" height="32" fill="white"/></clipPath></defs></svg>');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signersController.d.ts","sourceRoot":"","sources":["../src/signersController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"signersController.d.ts","sourceRoot":"","sources":["../src/signersController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAepC,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,GAAG;IAC3C,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;CAC3B,CAAC;AAEF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,cAAc,CAAsB;;IAI5C,SAAS,CAAC,OAAO,CAAC,EAAE;QAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;;;;;IAgCD,UAAU;IAKJ,OAAO,CACX,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,QAAQ,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,IAAI,EAChD,OAAO,CAAC,EAAE;QACR,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;KACf;YAoHW,cAAc;YA4Bd,UAAU;YA4BV,SAAS;CA6CxB"}
|
|
@@ -8,6 +8,7 @@ const nip07_1 = require("@ckb-ccc/nip07");
|
|
|
8
8
|
const okx_1 = require("@ckb-ccc/okx");
|
|
9
9
|
const uni_sat_1 = require("@ckb-ccc/uni-sat");
|
|
10
10
|
const utxo_global_1 = require("@ckb-ccc/utxo-global");
|
|
11
|
+
const eth_svg_js_1 = require("./assets/eth.svg.js");
|
|
11
12
|
const joy_id_svg_js_1 = require("./assets/joy-id.svg.js");
|
|
12
13
|
const metamask_svg_js_1 = require("./assets/metamask.svg.js");
|
|
13
14
|
const nostr_svg_js_1 = require("./assets/nostr.svg.js");
|
|
@@ -58,7 +59,7 @@ class SignersController {
|
|
|
58
59
|
await this.addSigners(wallets, "UniSat", uni_sat_svg_js_1.UNI_SAT_SVG, uni_sat_1.UniSat.getUniSatSigners(client, preferredNetworks), onUpdate, configs);
|
|
59
60
|
await this.addSigners(wallets, "OKX Wallet", okx_svg_js_1.OKX_SVG, okx_1.Okx.getOKXSigners(client, preferredNetworks), onUpdate, configs);
|
|
60
61
|
await this.addSigner(wallets, "Nostr", nostr_svg_js_1.NOSTR_SVG, "Nostr", nip07_1.Nip07.getNip07Signer(client), onUpdate, configs);
|
|
61
|
-
this.resetListeners.push(new eip6963_1.Eip6963.SignerFactory(client).subscribeSigners((signer) => this.addSigner(wallets,
|
|
62
|
+
this.resetListeners.push(new eip6963_1.Eip6963.SignerFactory(client).subscribeSigners((signer, detail) => this.addSigner(wallets, detail?.info.name ?? "EVM", detail?.info.icon ?? eth_svg_js_1.ETH_SVG, "EVM", signer, onUpdate, configs)));
|
|
62
63
|
// === Dummy signers ===
|
|
63
64
|
await this.addLinkSigners(wallets, "MetaMask", metamask_svg_js_1.METAMASK_SVG, client, [core_1.ccc.SignerType.EVM], `https://metamask.app.link/dapp/${window.location.href}`, onUpdate, configs);
|
|
64
65
|
await this.addLinkSigners(wallets, "OKX Wallet", okx_svg_js_1.OKX_SVG, client, [core_1.ccc.SignerType.EVM, core_1.ccc.SignerType.BTC], "https://www.okx.com/download?deeplink=" +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/ccc",
|
|
3
|
-
"version": "0.0.12-alpha.
|
|
3
|
+
"version": "0.0.12-alpha.4",
|
|
4
4
|
"description": "CCC - CKBer's Codebase. Common Chains Connector.",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@ckb-ccc/core": "0.0.12-alpha.
|
|
55
|
-
"@ckb-ccc/eip6963": "0.0.12-alpha.
|
|
56
|
-
"@ckb-ccc/joy-id": "0.0.12-alpha.
|
|
57
|
-
"@ckb-ccc/nip07": "0.0.12-alpha.
|
|
58
|
-
"@ckb-ccc/okx": "0.0.12-alpha.
|
|
59
|
-
"@ckb-ccc/uni-sat": "0.0.12-alpha.
|
|
60
|
-
"@ckb-ccc/utxo-global": "0.0.12-alpha.
|
|
54
|
+
"@ckb-ccc/core": "0.0.12-alpha.1",
|
|
55
|
+
"@ckb-ccc/eip6963": "0.0.12-alpha.4",
|
|
56
|
+
"@ckb-ccc/joy-id": "0.0.12-alpha.1",
|
|
57
|
+
"@ckb-ccc/nip07": "0.0.12-alpha.1",
|
|
58
|
+
"@ckb-ccc/okx": "0.0.12-alpha.1",
|
|
59
|
+
"@ckb-ccc/uni-sat": "0.0.12-alpha.1",
|
|
60
|
+
"@ckb-ccc/utxo-global": "0.0.12-alpha.1"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "e40082930923fe770bdb570ae4815edfc70c49a8"
|
|
63
63
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { encodeSvgToImgSrc } from "./utils.js";
|
|
2
|
+
|
|
3
|
+
export const ETH_SVG = encodeSvgToImgSrc(
|
|
4
|
+
'<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_46_558)"><circle cx="16" cy="16" r="16" fill="#627EEA"/><path d="M15.9957 20.4203L9.14282 16.3876L15.9957 5.14258V20.4203Z" fill="white"/><path d="M15.9957 26.8573L9.30029 17.396L15.9957 21.3511V26.8573Z" fill="white"/><path d="M16.2319 20.4203L23.0849 16.3876L16.2319 5.14258V20.4203Z" fill="#C1CCF7"/><path d="M16.3107 26.8573L23.0848 17.396L16.3107 21.3511V26.8573Z" fill="#C1CCF7"/></g><defs><clipPath id="clip0_46_558"><rect width="32" height="32" fill="white"/></clipPath></defs></svg>',
|
|
5
|
+
);
|
package/src/signersController.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Nip07 } from "@ckb-ccc/nip07";
|
|
|
5
5
|
import { Okx } from "@ckb-ccc/okx";
|
|
6
6
|
import { UniSat } from "@ckb-ccc/uni-sat";
|
|
7
7
|
import { UtxoGlobal } from "@ckb-ccc/utxo-global";
|
|
8
|
+
import { ETH_SVG } from "./assets/eth.svg.js";
|
|
8
9
|
import { JOY_ID_SVG } from "./assets/joy-id.svg.js";
|
|
9
10
|
import { METAMASK_SVG } from "./assets/metamask.svg.js";
|
|
10
11
|
import { NOSTR_SVG } from "./assets/nostr.svg.js";
|
|
@@ -128,11 +129,11 @@ export class SignersController {
|
|
|
128
129
|
);
|
|
129
130
|
|
|
130
131
|
this.resetListeners.push(
|
|
131
|
-
new Eip6963.SignerFactory(client).subscribeSigners((signer) =>
|
|
132
|
+
new Eip6963.SignerFactory(client).subscribeSigners((signer, detail) =>
|
|
132
133
|
this.addSigner(
|
|
133
134
|
wallets,
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
detail?.info.name ?? "EVM",
|
|
136
|
+
detail?.info.icon ?? ETH_SVG,
|
|
136
137
|
"EVM",
|
|
137
138
|
signer,
|
|
138
139
|
onUpdate,
|