@ckb-ccc/ccc 0.0.12-alpha.4 → 0.0.12-alpha.6
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.commonjs/advanced.d.ts +1 -1
- package/dist.commonjs/advanced.js +47 -22
- package/dist.commonjs/advancedBarrel.d.ts +1 -1
- package/dist.commonjs/advancedBarrel.js +30 -14
- package/dist.commonjs/assets/eth.svg.d.ts +1 -1
- package/dist.commonjs/assets/eth.svg.js +3 -1
- package/dist.commonjs/assets/joy-id.svg.d.ts +1 -1
- package/dist.commonjs/assets/joy-id.svg.js +3 -1
- package/dist.commonjs/assets/metamask.svg.d.ts +1 -1
- package/dist.commonjs/assets/metamask.svg.js +3 -1
- package/dist.commonjs/assets/nostr.svg.d.ts +1 -1
- package/dist.commonjs/assets/nostr.svg.js +3 -1
- package/dist.commonjs/assets/okx.svg.d.ts +1 -1
- package/dist.commonjs/assets/okx.svg.js +3 -1
- package/dist.commonjs/assets/uni-sat.svg.d.ts +1 -1
- package/dist.commonjs/assets/uni-sat.svg.js +3 -1
- package/dist.commonjs/assets/utils.d.ts +1 -1
- package/dist.commonjs/assets/utils.js +1 -1
- package/dist.commonjs/assets/utxo-global.svg.d.ts +1 -1
- package/dist.commonjs/barrel.d.ts +1 -1
- package/dist.commonjs/barrel.js +30 -14
- package/dist.commonjs/index.d.ts +1 -1
- package/dist.commonjs/index.js +47 -22
- package/dist.commonjs/signersController.d.ts +30 -23
- package/dist.commonjs/signersController.js +208 -83
- package/package.json +3 -3
|
@@ -1,30 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
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 __exportStar =
|
|
35
|
+
(this && this.__exportStar) ||
|
|
36
|
+
function (m, exports) {
|
|
37
|
+
for (var p in m)
|
|
38
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
39
|
+
__createBinding(exports, m, p);
|
|
40
|
+
};
|
|
41
|
+
var __importStar =
|
|
42
|
+
(this && this.__importStar) ||
|
|
43
|
+
function (mod) {
|
|
22
44
|
if (mod && mod.__esModule) return mod;
|
|
23
45
|
var result = {};
|
|
24
|
-
if (mod != null)
|
|
46
|
+
if (mod != null)
|
|
47
|
+
for (var k in mod)
|
|
48
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
49
|
+
__createBinding(result, mod, k);
|
|
25
50
|
__setModuleDefault(result, mod);
|
|
26
51
|
return result;
|
|
27
|
-
};
|
|
52
|
+
};
|
|
28
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
54
|
exports.cccA = void 0;
|
|
30
55
|
__exportStar(require("./advancedBarrel.js"), exports);
|
|
@@ -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("@ckb-ccc/core/advancedBarrel"), exports);
|
|
18
34
|
__exportStar(require("@ckb-ccc/eip6963/advanced"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const ETH_SVG: string;
|
|
2
|
-
//# sourceMappingURL=eth.svg.d.ts.map
|
|
2
|
+
//# sourceMappingURL=eth.svg.d.ts.map
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ETH_SVG = void 0;
|
|
4
4
|
const utils_js_1 = require("./utils.js");
|
|
5
|
-
exports.ETH_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
5
|
+
exports.ETH_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
6
|
+
'<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>',
|
|
7
|
+
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const JOY_ID_SVG: string;
|
|
2
|
-
//# sourceMappingURL=joy-id.svg.d.ts.map
|
|
2
|
+
//# sourceMappingURL=joy-id.svg.d.ts.map
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.JOY_ID_SVG = void 0;
|
|
4
4
|
const utils_js_1 = require("./utils.js");
|
|
5
|
-
exports.JOY_ID_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
5
|
+
exports.JOY_ID_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
6
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="420" height="420" viewBox="0 0 420 420" fill="none"><circle cx="210" cy="210" r="210" fill="#333333"/><path d="M271.127 204.419C279.096 204.419 285.555 197.959 285.555 189.991C285.555 182.022 279.096 175.562 271.127 175.562C263.159 175.562 256.699 182.022 256.699 189.991C256.699 197.959 263.159 204.419 271.127 204.419Z" fill="#8CDD00"/><path d="M173.995 175.562C166.773 175.562 160.91 181.425 160.91 188.648C160.91 195.87 166.773 201.733 173.995 201.733C181.218 201.733 187.081 195.87 187.081 188.648C187.064 181.425 181.218 175.562 173.995 175.562Z" fill="#8CDD00"/><path d="M213.43 164.836L198.969 233.586C197.626 240.006 191.878 244.657 185.327 244.657C181.086 244.657 177.139 242.757 174.47 239.465C172.39 236.894 171.342 233.734 171.391 230.491L145.27 237.238C146.383 244.084 149.2 250.618 153.687 256.203C161.434 265.816 172.963 271.335 185.311 271.335C204.407 271.335 221.111 257.775 225.041 239.089L240.665 164.852H213.43V164.836Z" fill="#C1C1C1"/><path d="M335.83 115.983C327.068 105.19 314.065 99 300.161 99H267.981L262.363 125.662H300.161C305.991 125.662 311.445 128.249 315.113 132.786C318.782 137.306 320.207 143.185 319.011 148.884L313.394 175.562H340.645L345.116 154.387C347.965 140.778 344.592 126.775 335.83 115.983Z" fill="#8CDD00"/><path d="M295.216 261.999C291.285 280.669 274.597 294.212 255.518 294.212H226.875L221.258 320.874H255.518C287.126 320.874 314.803 298.421 321.304 267.485L326.021 245.049H298.77L295.216 261.999Z" fill="#8CDD00"/><path d="M98.8061 152.39L93.9258 175.58H121.177L124.894 157.892C128.825 139.223 145.513 125.679 164.592 125.679H192.04L197.657 99.0176H164.592C132.985 99.0012 105.308 121.454 98.8061 152.39Z" fill="#8CDD00"/><path d="M104.998 287.072C101.33 282.552 99.9049 276.673 101.1 270.974L106.079 247.342L77.2555 254.777L74.9956 265.487C72.1296 279.097 75.5196 293.099 84.2813 303.891C93.0429 314.684 106.046 320.874 119.95 320.874H150.935L156.553 294.212H119.95C114.12 294.196 108.666 291.608 104.998 287.072Z" fill="#8CDD00"/></svg>',
|
|
7
|
+
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const METAMASK_SVG: string;
|
|
2
|
-
//# sourceMappingURL=metamask.svg.d.ts.map
|
|
2
|
+
//# sourceMappingURL=metamask.svg.d.ts.map
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.METAMASK_SVG = void 0;
|
|
4
4
|
const utils_js_1 = require("./utils.js");
|
|
5
|
-
exports.METAMASK_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
5
|
+
exports.METAMASK_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
6
|
+
`<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" id="Layer_1" x="0" y="0" version="1.1" viewBox="0 0 318.6 318.6"><style>.st1,.st6{fill:#e4761b;stroke:#e4761b;stroke-linecap:round;stroke-linejoin:round}.st6{fill:#f6851b;stroke:#f6851b}</style><path fill="#e2761b" stroke="#e2761b" stroke-linecap="round" stroke-linejoin="round" d="m274.1 35.5-99.5 73.9L193 65.8z"/><path d="m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z" class="st1"/><path d="m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z" class="st1"/><path fill="#d7c1b3" stroke="#d7c1b3" stroke-linecap="round" stroke-linejoin="round" d="m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"/><path fill="#233447" stroke="#233447" stroke-linecap="round" stroke-linejoin="round" d="m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"/><path fill="#cd6116" stroke="#cd6116" stroke-linecap="round" stroke-linejoin="round" d="m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"/><path fill="#e4751f" stroke="#e4751f" stroke-linecap="round" stroke-linejoin="round" d="m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"/><path d="m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z" class="st6"/><path fill="#c0ad9e" stroke="#c0ad9e" stroke-linecap="round" stroke-linejoin="round" d="m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"/><path fill="#161616" stroke="#161616" stroke-linecap="round" stroke-linejoin="round" d="m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"/><path fill="#763d16" stroke="#763d16" stroke-linecap="round" stroke-linejoin="round" d="m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"/><path d="m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z" class="st6"/><script xmlns=""/></svg>`,
|
|
7
|
+
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const NOSTR_SVG: string;
|
|
2
|
-
//# sourceMappingURL=nostr.svg.d.ts.map
|
|
2
|
+
//# sourceMappingURL=nostr.svg.d.ts.map
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NOSTR_SVG = void 0;
|
|
4
4
|
const utils_js_1 = require("./utils.js");
|
|
5
|
-
exports.NOSTR_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
5
|
+
exports.NOSTR_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
6
|
+
'<svg version="1.1" id="_8" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 256 256" style="enable-background:new 0 0 256 256;" xml:space="preserve"><style type="text/css">.st0{fill:none;} .st1{fill:#FFFFFF;} .st2{fill:#662482;}</style><g><path class="st0" d="M0,0v256h256V0H0z M231.2,159.2c0,20.7,0,31.1-3.5,42.2c-4.4,12.2-14,21.8-26.2,26.2 c-11.1,3.5-21.5,3.5-42.2,3.5H96.8c-20.7,0-31.1,0-42.2-3.5c-12.2-4.4-21.8-14-26.2-26.2c-3.5-11.1-3.5-21.5-3.5-42.2V96.8 c0-20.7,0-31.1,3.5-42.2c4.4-12.2,14-21.8,26.2-26.2c11.2-3.5,21.5-3.5,42.2-3.5h62.5c20.7,0,31.1,0,42.2,3.5 c12.2,4.4,21.8,14,26.2,26.2c3.5,11.1,3.5,21.5,3.5,42.2V159.2z"/> <circle class="st1" cx="137.9" cy="99" r="12.1"/><path class="st1" d="M210.8,115.9c0-47.3-27.7-68.7-64.4-68.7c-16.4,0-31,4.4-42.4,12.5c-3.8,2.7-9,0.1-9-4.5 c0-3.1-2.5-5.7-5.7-5.7H57.7c-3.1,0-5.7,2.5-5.7,5.7v144c0,3.1,2.5,5.7,5.7,5.7h33.7c3.1,0,5.6-2.5,5.6-5.6v-8.4 c0-62.8-33.2-109.8-0.4-116c30-5.7,64.1-3,64.5,20.1c0,2,0.3,8,8.6,11.2c5,2,12.6,2.6,22.6,2.4c0,0,9.1-0.7,9.1,8.5 c0,11.5-20.4,10.7-20.4,10.7c-6.7,0.3-22.6-1.5-31.7,1.2c-4.8,1.5-9,4.2-11.5,9.1c-4.2,8.3-6.2,26.5-6.5,45.5v15.5 c0,3.1,2.5,5.7,5.7,5.7h68c3.1,0,5.7-2.5,5.7-5.7l0,0V115.9z"/><path class="st2" d="M227.6,54.6c-4.4-12.2-14-21.8-26.2-26.2c-11.1-3.5-21.5-3.5-42.2-3.5H96.8c-20.7,0-31.1,0-42.2,3.5 c-12.2,4.4-21.8,14-26.2,26.2c-3.5,11.2-3.5,21.5-3.5,42.2v62.5c0,20.7,0,31.1,3.5,42.2c4.4,12.2,14,21.8,26.2,26.2 c11.2,3.5,21.5,3.5,42.2,3.5h62.5c20.7,0,31.1,0,42.2-3.5c12.2-4.4,21.8-14,26.2-26.2c3.5-11.1,3.5-21.5,3.5-42.2V96.8 C231.2,76.1,231.2,65.7,227.6,54.6z M205.1,204.8h-68c-3.1,0-5.7-2.5-5.7-5.7v-15.5c0.3-19,2.3-37.2,6.5-45.5 c2.5-5,6.7-7.7,11.5-9.1c9-2.7,24.9-0.9,31.7-1.2c0,0,20.4,0.8,20.4-10.7c0-9.3-9.1-8.5-9.1-8.5c-10,0.3-17.7-0.4-22.6-2.4 c-8.3-3.3-8.6-9.2-8.6-11.2c-0.4-23.1-34.5-25.9-64.5-20.1c-32.8,6.2,0.4,53.3,0.4,116v8.4c-0.1,3.1-2.5,5.6-5.6,5.6H57.7 c-3.1,0-5.7-2.5-5.7-5.7v-144c0-3.1,2.5-5.7,5.7-5.7h31.7c3.1,0,5.7,2.5,5.7,5.7c0,4.7,5.2,7.2,9,4.5c11.4-8.2,26-12.5,42.4-12.5 c36.7,0,64.4,21.4,64.4,68.7v83.2l0,0C210.8,202.3,208.3,204.8,205.1,204.8z M125.7,99c0-6.7,5.4-12.1,12.1-12.1S150,92.3,150,99 s-5.4,12.1-12.1,12.1S125.7,105.8,125.7,99z"/></g></svg>',
|
|
7
|
+
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const OKX_SVG: string;
|
|
2
|
-
//# sourceMappingURL=okx.svg.d.ts.map
|
|
2
|
+
//# sourceMappingURL=okx.svg.d.ts.map
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OKX_SVG = void 0;
|
|
4
4
|
const utils_js_1 = require("./utils.js");
|
|
5
|
-
exports.OKX_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
5
|
+
exports.OKX_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
6
|
+
'<svg width="1000" height="1000" viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="1000" height="1000" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M393.949 218.518H231.049C224.129 218.518 218.519 224.128 218.519 231.048V393.948C218.519 400.869 224.129 406.479 231.049 406.479H393.949C400.87 406.479 406.48 400.869 406.48 393.948V231.048C406.48 224.128 400.87 218.518 393.949 218.518ZM581.992 406.479H419.092C412.172 406.479 406.561 412.09 406.561 419.01V581.91C406.561 588.831 412.172 594.441 419.092 594.441H581.992C588.913 594.441 594.523 588.831 594.523 581.91V419.01C594.523 412.09 588.913 406.479 581.992 406.479ZM606.974 218.518H769.874C776.794 218.518 782.405 224.128 782.405 231.048V393.948C782.405 400.869 776.794 406.479 769.874 406.479H606.974C600.053 406.479 594.443 400.869 594.443 393.948V231.048C594.443 224.128 600.053 218.518 606.974 218.518ZM393.95 594.442H231.049C224.129 594.442 218.519 600.052 218.519 606.973V769.873C218.519 776.793 224.129 782.404 231.049 782.404H393.95C400.87 782.404 406.48 776.793 406.48 769.873V606.973C406.48 600.052 400.87 594.442 393.95 594.442ZM606.974 594.442H769.874C776.794 594.442 782.405 600.052 782.405 606.973V769.873C782.405 776.793 776.794 782.404 769.874 782.404H606.974C600.053 782.404 594.443 776.793 594.443 769.873V606.973C594.443 600.052 600.053 594.442 606.974 594.442Z" fill="white"/></svg>',
|
|
7
|
+
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const UNI_SAT_SVG: string;
|
|
2
|
-
//# sourceMappingURL=uni-sat.svg.d.ts.map
|
|
2
|
+
//# sourceMappingURL=uni-sat.svg.d.ts.map
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UNI_SAT_SVG = void 0;
|
|
4
4
|
const utils_js_1 = require("./utils.js");
|
|
5
|
-
exports.UNI_SAT_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
5
|
+
exports.UNI_SAT_SVG = (0, utils_js_1.encodeSvgToImgSrc)(
|
|
6
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 115.77 147.7" xmlns:v="https://vecta.io/nano"><defs><linearGradient id="A" x1="106.985" y1="30.78" x2="13.053" y2="72.524" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#201c1b"/><stop offset=".36" stop-color="#77390d"/><stop offset=".67" stop-color="#ea8101"/><stop offset="1" stop-color="#f4b852"/></linearGradient><linearGradient id="B" x1="11.381" y1="118.167" x2="120.232" y2="85.771" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#1f1d1c"/><stop offset=".37" stop-color="#77390d"/><stop offset=".67" stop-color="#ea8101"/><stop offset="1" stop-color="#f4fb52"/></linearGradient><radialGradient id="C" cx="53.01" cy="45.84" fx="53.01" fy="45.84" r="11.13" gradientTransform="translate(0 0)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f4b852"/><stop offset=".33" stop-color="#ea8101"/><stop offset=".64" stop-color="#77390d"/><stop offset="1" stop-color="#211c1d"/></radialGradient></defs><path d="M81.66 13.29l30.31 30.02c2.58 2.55 3.85 5.13 3.81 7.73s-1.15 4.97-3.32 7.12c-2.27 2.25-4.72 3.39-7.34 3.44-2.62.04-5.22-1.22-7.8-3.77l-31-30.7c-3.52-3.49-6.92-5.96-10.19-7.41s-6.71-1.68-10.31-.68c-3.61.99-7.48 3.54-11.63 7.64-5.72 5.67-8.45 10.99-8.17 15.96s3.12 10.13 8.51 15.46l31.25 30.96c2.61 2.58 3.89 5.16 3.85 7.72-.04 2.57-1.16 4.94-3.37 7.13-2.2 2.18-4.63 3.32-7.27 3.41s-5.27-1.16-7.87-3.74L20.81 73.56c-4.93-4.88-8.49-9.5-10.68-13.86s-3.01-9.29-2.44-14.79c.51-4.71 2.02-9.27 4.54-13.69 2.51-4.42 6.11-8.94 10.78-13.57 5.56-5.51 10.87-9.73 15.93-12.67C43.99 2.04 48.88.41 53.6.07c4.73-.34 9.39.6 14 2.82s9.29 5.68 14.05 10.4z" fill="url(#A)"/><path d="M34.11 134.42L3.81 104.4C1.23 101.84-.04 99.27 0 96.67s1.15-4.97 3.32-7.12c2.27-2.25 4.72-3.39 7.34-3.44 2.62-.04 5.22 1.21 7.8 3.77l30.99 30.7c3.53 3.49 6.92 5.96 10.19 7.41s6.71 1.67 10.32.68 7.48-3.54 11.63-7.65c5.72-5.67 8.45-10.99 8.17-15.96s-3.12-10.13-8.51-15.47L64.6 73.24c-2.61-2.58-3.89-5.16-3.85-7.72.04-2.57 1.16-4.94 3.37-7.13 2.2-2.18 4.63-3.32 7.27-3.41s5.27 1.16 7.87 3.74l15.7 15.41c4.93 4.88 8.49 9.5 10.68 13.86s3.01 9.29 2.44 14.79c-.51 4.71-2.02 9.27-4.54 13.69-2.51 4.42-6.11 8.94-10.78 13.57-5.56 5.51-10.87 9.73-15.93 12.67s-9.95 4.58-14.68 4.92-9.39-.6-14-2.82-9.29-5.68-14.05-10.4z" fill="url(#B)"/><circle cx="53.01" cy="45.83" r="11.13" fill="url(#C)"/></svg>',
|
|
7
|
+
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function encodeSvgToImgSrc(svg: string): string;
|
|
2
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
2
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.encodeSvgToImgSrc = void 0;
|
|
4
4
|
function encodeSvgToImgSrc(svg) {
|
|
5
|
-
|
|
5
|
+
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
6
6
|
}
|
|
7
7
|
exports.encodeSvgToImgSrc = encodeSvgToImgSrc;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const UTXO_GLOBAL_SVG: string;
|
|
2
|
-
//# sourceMappingURL=utxo-global.svg.d.ts.map
|
|
2
|
+
//# sourceMappingURL=utxo-global.svg.d.ts.map
|
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("@ckb-ccc/core/barrel"), exports);
|
|
18
34
|
__exportStar(require("@ckb-ccc/eip6963"), exports);
|
package/dist.commonjs/index.d.ts
CHANGED
package/dist.commonjs/index.js
CHANGED
|
@@ -1,30 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
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 __exportStar =
|
|
35
|
+
(this && this.__exportStar) ||
|
|
36
|
+
function (m, exports) {
|
|
37
|
+
for (var p in m)
|
|
38
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
39
|
+
__createBinding(exports, m, p);
|
|
40
|
+
};
|
|
41
|
+
var __importStar =
|
|
42
|
+
(this && this.__importStar) ||
|
|
43
|
+
function (mod) {
|
|
22
44
|
if (mod && mod.__esModule) return mod;
|
|
23
45
|
var result = {};
|
|
24
|
-
if (mod != null)
|
|
46
|
+
if (mod != null)
|
|
47
|
+
for (var k in mod)
|
|
48
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
49
|
+
__createBinding(result, mod, k);
|
|
25
50
|
__setModuleDefault(result, mod);
|
|
26
51
|
return result;
|
|
27
|
-
};
|
|
52
|
+
};
|
|
28
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
54
|
exports.ccc = void 0;
|
|
30
55
|
__exportStar(require("./barrel.js"), exports);
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/core";
|
|
2
2
|
export type WalletWithSigners = ccc.Wallet & {
|
|
3
|
-
|
|
3
|
+
signers: ccc.SignerInfo[];
|
|
4
4
|
};
|
|
5
5
|
export declare class SignersController {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
private resetListeners;
|
|
7
|
+
constructor();
|
|
8
|
+
getConfig(configs?: {
|
|
9
|
+
preferredNetworks?: ccc.NetworkPreference[];
|
|
10
|
+
name?: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
}): {
|
|
13
|
+
name: string;
|
|
14
|
+
icon: string;
|
|
15
|
+
preferredNetworks: ccc.NetworkPreference[];
|
|
16
|
+
};
|
|
17
|
+
disconnect(): void;
|
|
18
|
+
refresh(
|
|
19
|
+
client: ccc.Client,
|
|
20
|
+
onUpdate: (wallets: WalletWithSigners[]) => void,
|
|
21
|
+
configs?: {
|
|
22
|
+
signerFilter?: (
|
|
23
|
+
signerInfo: ccc.SignerInfo,
|
|
24
|
+
wallet: ccc.Wallet,
|
|
25
|
+
) => Promise<boolean>;
|
|
26
|
+
preferredNetworks?: ccc.NetworkPreference[];
|
|
27
|
+
name?: string;
|
|
28
|
+
icon?: string;
|
|
29
|
+
},
|
|
30
|
+
): Promise<void>;
|
|
31
|
+
private addLinkSigners;
|
|
32
|
+
private addSigners;
|
|
33
|
+
private addSigner;
|
|
27
34
|
}
|
|
28
|
-
//# sourceMappingURL=signersController.d.ts.map
|
|
35
|
+
//# sourceMappingURL=signersController.d.ts.map
|
|
@@ -16,91 +16,216 @@ const okx_svg_js_1 = require("./assets/okx.svg.js");
|
|
|
16
16
|
const uni_sat_svg_js_1 = require("./assets/uni-sat.svg.js");
|
|
17
17
|
const utxo_global_svg_js_1 = require("./assets/utxo-global.svg.js");
|
|
18
18
|
class SignersController {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
constructor() {
|
|
20
|
+
this.resetListeners = [];
|
|
21
|
+
}
|
|
22
|
+
getConfig(configs) {
|
|
23
|
+
const name =
|
|
24
|
+
configs?.name ?? document.querySelector("head title")?.text ?? "Unknown";
|
|
25
|
+
const icon =
|
|
26
|
+
configs?.icon ??
|
|
27
|
+
document.querySelector('link[rel="icon"]')?.href ??
|
|
28
|
+
"https://fav.farm/%E2%9D%93";
|
|
29
|
+
const preferredNetworks = [
|
|
30
|
+
...(configs?.preferredNetworks ?? []),
|
|
31
|
+
{
|
|
32
|
+
addressPrefix: "ckb",
|
|
33
|
+
signerType: core_1.ccc.SignerType.BTC,
|
|
34
|
+
network: "btc",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
addressPrefix: "ckt",
|
|
38
|
+
signerType: core_1.ccc.SignerType.BTC,
|
|
39
|
+
network: "btcTestnet",
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
return {
|
|
43
|
+
name,
|
|
44
|
+
icon,
|
|
45
|
+
preferredNetworks,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
disconnect() {
|
|
49
|
+
this.resetListeners.forEach((listener) => listener());
|
|
50
|
+
this.resetListeners = [];
|
|
51
|
+
}
|
|
52
|
+
async refresh(client, onUpdate, configs) {
|
|
53
|
+
this.disconnect();
|
|
54
|
+
const wallets = [];
|
|
55
|
+
const { name, icon, preferredNetworks } = this.getConfig(configs);
|
|
56
|
+
await this.addSigners(
|
|
57
|
+
wallets,
|
|
58
|
+
"UTXO Global Wallet",
|
|
59
|
+
utxo_global_svg_js_1.UTXO_GLOBAL_SVG,
|
|
60
|
+
utxo_global_1.UtxoGlobal.getUtxoGlobalSigners(client),
|
|
61
|
+
onUpdate,
|
|
62
|
+
configs,
|
|
63
|
+
);
|
|
64
|
+
await this.addSigners(
|
|
65
|
+
wallets,
|
|
66
|
+
"JoyID Passkey",
|
|
67
|
+
joy_id_svg_js_1.JOY_ID_SVG,
|
|
68
|
+
joy_id_1.JoyId.getJoyIdSigners(client, name, icon, preferredNetworks),
|
|
69
|
+
onUpdate,
|
|
70
|
+
configs,
|
|
71
|
+
);
|
|
72
|
+
await this.addSigners(
|
|
73
|
+
wallets,
|
|
74
|
+
"UniSat",
|
|
75
|
+
uni_sat_svg_js_1.UNI_SAT_SVG,
|
|
76
|
+
uni_sat_1.UniSat.getUniSatSigners(client, preferredNetworks),
|
|
77
|
+
onUpdate,
|
|
78
|
+
configs,
|
|
79
|
+
);
|
|
80
|
+
await this.addSigners(
|
|
81
|
+
wallets,
|
|
82
|
+
"OKX Wallet",
|
|
83
|
+
okx_svg_js_1.OKX_SVG,
|
|
84
|
+
okx_1.Okx.getOKXSigners(client, preferredNetworks),
|
|
85
|
+
onUpdate,
|
|
86
|
+
configs,
|
|
87
|
+
);
|
|
88
|
+
await this.addSigner(
|
|
89
|
+
wallets,
|
|
90
|
+
"Nostr",
|
|
91
|
+
nostr_svg_js_1.NOSTR_SVG,
|
|
92
|
+
"Nostr",
|
|
93
|
+
nip07_1.Nip07.getNip07Signer(client),
|
|
94
|
+
onUpdate,
|
|
95
|
+
configs,
|
|
96
|
+
);
|
|
97
|
+
this.resetListeners.push(
|
|
98
|
+
new eip6963_1.Eip6963.SignerFactory(client).subscribeSigners(
|
|
99
|
+
(signer, detail) =>
|
|
100
|
+
this.addSigner(
|
|
101
|
+
wallets,
|
|
102
|
+
detail?.info.name ?? "EVM",
|
|
103
|
+
detail?.info.icon ?? eth_svg_js_1.ETH_SVG,
|
|
104
|
+
"EVM",
|
|
105
|
+
signer,
|
|
106
|
+
onUpdate,
|
|
107
|
+
configs,
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
);
|
|
111
|
+
// === Dummy signers ===
|
|
112
|
+
await this.addLinkSigners(
|
|
113
|
+
wallets,
|
|
114
|
+
"MetaMask",
|
|
115
|
+
metamask_svg_js_1.METAMASK_SVG,
|
|
116
|
+
client,
|
|
117
|
+
[core_1.ccc.SignerType.EVM],
|
|
118
|
+
`https://metamask.app.link/dapp/${window.location.href}`,
|
|
119
|
+
onUpdate,
|
|
120
|
+
configs,
|
|
121
|
+
);
|
|
122
|
+
await this.addLinkSigners(
|
|
123
|
+
wallets,
|
|
124
|
+
"OKX Wallet",
|
|
125
|
+
okx_svg_js_1.OKX_SVG,
|
|
126
|
+
client,
|
|
127
|
+
[core_1.ccc.SignerType.EVM, core_1.ccc.SignerType.BTC],
|
|
128
|
+
"https://www.okx.com/download?deeplink=" +
|
|
129
|
+
encodeURIComponent(
|
|
130
|
+
"okx://wallet/dapp/url?dappUrl=" +
|
|
131
|
+
encodeURIComponent(window.location.href),
|
|
132
|
+
),
|
|
133
|
+
onUpdate,
|
|
134
|
+
configs,
|
|
135
|
+
);
|
|
136
|
+
await this.addLinkSigners(
|
|
137
|
+
wallets,
|
|
138
|
+
"UniSat",
|
|
139
|
+
uni_sat_svg_js_1.UNI_SAT_SVG,
|
|
140
|
+
client,
|
|
141
|
+
[core_1.ccc.SignerType.BTC],
|
|
142
|
+
"https://unisat.io/download",
|
|
143
|
+
onUpdate,
|
|
144
|
+
configs,
|
|
145
|
+
);
|
|
146
|
+
await this.addLinkSigners(
|
|
147
|
+
wallets,
|
|
148
|
+
"UTXO Global Wallet",
|
|
149
|
+
utxo_global_svg_js_1.UTXO_GLOBAL_SVG,
|
|
150
|
+
client,
|
|
151
|
+
[core_1.ccc.SignerType.CKB, core_1.ccc.SignerType.BTC],
|
|
152
|
+
"https://chromewebstore.google.com/detail/lnamkkidoonpeknminiadpgjiofpdmle",
|
|
153
|
+
onUpdate,
|
|
154
|
+
configs,
|
|
155
|
+
);
|
|
156
|
+
// ===
|
|
157
|
+
}
|
|
158
|
+
async addLinkSigners(
|
|
159
|
+
wallets,
|
|
160
|
+
walletName,
|
|
161
|
+
icon,
|
|
162
|
+
client,
|
|
163
|
+
signerTypes,
|
|
164
|
+
link,
|
|
165
|
+
onUpdate,
|
|
166
|
+
configs,
|
|
167
|
+
) {
|
|
168
|
+
return this.addSigners(
|
|
169
|
+
wallets,
|
|
170
|
+
walletName,
|
|
171
|
+
icon,
|
|
172
|
+
signerTypes.map((type) => ({
|
|
173
|
+
name: type,
|
|
174
|
+
signer: new core_1.ccc.SignerOpenLink(client, type, link),
|
|
175
|
+
})),
|
|
176
|
+
onUpdate,
|
|
177
|
+
configs,
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
async addSigners(wallets, walletName, icon, signers, onUpdate, configs) {
|
|
181
|
+
return Promise.all(
|
|
182
|
+
signers.map(({ signer, name }) =>
|
|
183
|
+
this.addSigner(
|
|
184
|
+
wallets,
|
|
185
|
+
walletName,
|
|
186
|
+
icon,
|
|
187
|
+
name,
|
|
188
|
+
signer,
|
|
189
|
+
onUpdate,
|
|
190
|
+
configs,
|
|
191
|
+
),
|
|
192
|
+
),
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
async addSigner(
|
|
196
|
+
wallets,
|
|
197
|
+
walletName,
|
|
198
|
+
icon,
|
|
199
|
+
signerName,
|
|
200
|
+
signer,
|
|
201
|
+
onUpdate,
|
|
202
|
+
configs,
|
|
203
|
+
) {
|
|
204
|
+
if (!signer) {
|
|
205
|
+
return;
|
|
21
206
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"https://fav.farm/%E2%9D%93";
|
|
30
|
-
const preferredNetworks = [
|
|
31
|
-
...(configs?.preferredNetworks ?? []),
|
|
32
|
-
{
|
|
33
|
-
addressPrefix: "ckb",
|
|
34
|
-
signerType: core_1.ccc.SignerType.BTC,
|
|
35
|
-
network: "btc",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
addressPrefix: "ckt",
|
|
39
|
-
signerType: core_1.ccc.SignerType.BTC,
|
|
40
|
-
network: "btcTestnet",
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
return {
|
|
44
|
-
name,
|
|
45
|
-
icon,
|
|
46
|
-
preferredNetworks,
|
|
47
|
-
};
|
|
207
|
+
const signerInfo = { name: signerName, signer };
|
|
208
|
+
const signerFilter = configs?.signerFilter;
|
|
209
|
+
if (
|
|
210
|
+
signerFilter &&
|
|
211
|
+
!(await signerFilter(signerInfo, { name: walletName, icon }))
|
|
212
|
+
) {
|
|
213
|
+
return;
|
|
48
214
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
await this.addSigner(wallets, "Nostr", nostr_svg_js_1.NOSTR_SVG, "Nostr", nip07_1.Nip07.getNip07Signer(client), onUpdate, configs);
|
|
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)));
|
|
63
|
-
// === Dummy signers ===
|
|
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);
|
|
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=" +
|
|
66
|
-
encodeURIComponent("okx://wallet/dapp/url?dappUrl=" +
|
|
67
|
-
encodeURIComponent(window.location.href)), onUpdate, configs);
|
|
68
|
-
await this.addLinkSigners(wallets, "UniSat", uni_sat_svg_js_1.UNI_SAT_SVG, client, [core_1.ccc.SignerType.BTC], "https://unisat.io/download", onUpdate, configs);
|
|
69
|
-
await this.addLinkSigners(wallets, "UTXO Global Wallet", utxo_global_svg_js_1.UTXO_GLOBAL_SVG, client, [core_1.ccc.SignerType.CKB, core_1.ccc.SignerType.BTC], "https://chromewebstore.google.com/detail/lnamkkidoonpeknminiadpgjiofpdmle", onUpdate, configs);
|
|
70
|
-
// ===
|
|
71
|
-
}
|
|
72
|
-
async addLinkSigners(wallets, walletName, icon, client, signerTypes, link, onUpdate, configs) {
|
|
73
|
-
return this.addSigners(wallets, walletName, icon, signerTypes.map((type) => ({
|
|
74
|
-
name: type,
|
|
75
|
-
signer: new core_1.ccc.SignerOpenLink(client, type, link),
|
|
76
|
-
})), onUpdate, configs);
|
|
77
|
-
}
|
|
78
|
-
async addSigners(wallets, walletName, icon, signers, onUpdate, configs) {
|
|
79
|
-
return Promise.all(signers.map(({ signer, name }) => this.addSigner(wallets, walletName, icon, name, signer, onUpdate, configs)));
|
|
80
|
-
}
|
|
81
|
-
async addSigner(wallets, walletName, icon, signerName, signer, onUpdate, configs) {
|
|
82
|
-
if (!signer) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const signerInfo = { name: signerName, signer };
|
|
86
|
-
const signerFilter = configs?.signerFilter;
|
|
87
|
-
if (signerFilter &&
|
|
88
|
-
!(await signerFilter(signerInfo, { name: walletName, icon }))) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const wallet = wallets.find((w) => w.name === walletName);
|
|
92
|
-
if (!wallet) {
|
|
93
|
-
wallets.push({
|
|
94
|
-
name: walletName,
|
|
95
|
-
icon,
|
|
96
|
-
signers: [signerInfo],
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
const signers = [...wallet.signers, signerInfo].filter(({ signer }) => !(signer instanceof core_1.ccc.SignerDummy));
|
|
101
|
-
wallet.signers = signers.length !== 0 ? signers : [signerInfo];
|
|
102
|
-
}
|
|
103
|
-
onUpdate(wallets);
|
|
215
|
+
const wallet = wallets.find((w) => w.name === walletName);
|
|
216
|
+
if (!wallet) {
|
|
217
|
+
wallets.push({
|
|
218
|
+
name: walletName,
|
|
219
|
+
icon,
|
|
220
|
+
signers: [signerInfo],
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
const signers = [...wallet.signers, signerInfo].filter(
|
|
224
|
+
({ signer }) => !(signer instanceof core_1.ccc.SignerDummy),
|
|
225
|
+
);
|
|
226
|
+
wallet.signers = signers.length !== 0 ? signers : [signerInfo];
|
|
104
227
|
}
|
|
228
|
+
onUpdate(wallets);
|
|
229
|
+
}
|
|
105
230
|
}
|
|
106
231
|
exports.SignersController = SignersController;
|
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.6",
|
|
4
4
|
"description": "CCC - CKBer's Codebase. Common Chains Connector.",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"@ckb-ccc/eip6963": "0.0.12-alpha.4",
|
|
56
56
|
"@ckb-ccc/joy-id": "0.0.12-alpha.1",
|
|
57
57
|
"@ckb-ccc/nip07": "0.0.12-alpha.1",
|
|
58
|
-
"@ckb-ccc/okx": "0.0.12-alpha.
|
|
58
|
+
"@ckb-ccc/okx": "0.0.12-alpha.6",
|
|
59
59
|
"@ckb-ccc/uni-sat": "0.0.12-alpha.1",
|
|
60
60
|
"@ckb-ccc/utxo-global": "0.0.12-alpha.1"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "3679eba15c5ec5397c514444594a09b777c3ffe1"
|
|
63
63
|
}
|