@ckb-ccc/connector 0.0.12-alpha.0 → 0.0.12-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/advancedBarrel.d.ts +0 -1
- package/dist/advancedBarrel.d.ts.map +1 -1
- package/dist/advancedBarrel.js +0 -1
- package/dist/scenes/connected.d.ts.map +1 -1
- package/dist/scenes/connected.js +5 -1
- package/dist/scenes/selecting/connecting.d.ts +1 -2
- package/dist/scenes/selecting/connecting.d.ts.map +1 -1
- package/dist/scenes/selecting/index.d.ts +2 -2
- package/dist/scenes/selecting/index.d.ts.map +1 -1
- package/dist/scenes/selecting/signers.d.ts +1 -2
- package/dist/scenes/selecting/signers.d.ts.map +1 -1
- package/dist/scenes/selecting/wallets.d.ts +1 -2
- package/dist/scenes/selecting/wallets.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/advancedBarrel.ts +0 -1
- package/src/scenes/connected.ts +7 -1
- package/src/scenes/selecting/connecting.ts +2 -3
- package/src/scenes/selecting/index.ts +3 -4
- package/src/scenes/selecting/signers.ts +2 -3
- package/src/scenes/selecting/wallets.ts +3 -4
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -1
- package/src/types/index.ts +0 -11
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
|
|
1
|
+
{"version":3,"file":"advancedBarrel.d.ts","sourceRoot":"","sources":["../src/advancedBarrel.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,UAAU,CAAC"}
|
package/dist/advancedBarrel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected.d.ts","sourceRoot":"","sources":["../../src/scenes/connected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAa,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAM5D,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,CAAC,SAAI,EACL,CAAC,SAAI,GACJ,MAAM,GAAG,SAAS,CAKpB;AAED,qBACa,cAAe,SAAQ,UAAU;IAErC,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAG3B,OAAO,CAAC,kBAAkB,CAAC,CAAS;IAEpC,OAAO,CAAC,eAAe,CAAC,CAAS;IAEjC,OAAO,CAAC,OAAO,CAAC,CAAU;IAE1B,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"connected.d.ts","sourceRoot":"","sources":["../../src/scenes/connected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAa,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAM5D,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,CAAC,SAAI,EACL,CAAC,SAAI,GACJ,MAAM,GAAG,SAAS,CAKpB;AAED,qBACa,cAAe,SAAQ,UAAU;IAErC,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAG3B,OAAO,CAAC,kBAAkB,CAAC,CAAS;IAEpC,OAAO,CAAC,eAAe,CAAC,CAAS;IAEjC,OAAO,CAAC,OAAO,CAAC,CAAU;IAE1B,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAgBzD,MAAM;IAkEN,MAAM,CAAC,MAAM,0BAmGX;IAEF,OAAO;CAGR"}
|
package/dist/scenes/connected.js
CHANGED
|
@@ -18,7 +18,11 @@ export function formatString(str, l = 9, r = 6) {
|
|
|
18
18
|
}
|
|
19
19
|
let ConnectedScene = class ConnectedScene extends LitElement {
|
|
20
20
|
willUpdate(changedProperties) {
|
|
21
|
-
if (
|
|
21
|
+
if ((!this.recommendedAddress ||
|
|
22
|
+
!this.internalAddress ||
|
|
23
|
+
!this.balance ||
|
|
24
|
+
changedProperties.has("signer")) &&
|
|
25
|
+
this.signer) {
|
|
22
26
|
this.signer
|
|
23
27
|
.getRecommendedAddress()
|
|
24
28
|
.then((v) => (this.recommendedAddress = v));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/ccc";
|
|
2
|
-
|
|
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>)[];
|
|
2
|
+
export declare function generateConnectingScene(wallet: ccc.WalletWithSigners, signer: ccc.SignerInfo, error: string | undefined, onSignerSelected: (wallet: ccc.WalletWithSigners, signer: ccc.SignerInfo) => unknown): (string | import("lit").TemplateResult<1>)[];
|
|
4
3
|
//# sourceMappingURL=connecting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connecting.d.ts","sourceRoot":"","sources":["../../../src/scenes/selecting/connecting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"connecting.d.ts","sourceRoot":"","sources":["../../../src/scenes/selecting/connecting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAInC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,GAAG,CAAC,iBAAiB,EAC7B,MAAM,EAAE,GAAG,CAAC,UAAU,EACtB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,gBAAgB,EAAE,CAChB,MAAM,EAAE,GAAG,CAAC,iBAAiB,EAC7B,MAAM,EAAE,GAAG,CAAC,UAAU,KACnB,OAAO,gDA2Bb"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { ccc } from "@ckb-ccc/ccc";
|
|
1
2
|
import { LitElement } from "lit";
|
|
2
|
-
import { WalletWithSigners } from "../../types";
|
|
3
3
|
export declare class ConnectedEvent extends Event {
|
|
4
4
|
readonly walletName: string;
|
|
5
5
|
readonly signerName: string;
|
|
6
6
|
constructor(walletName: string, signerName: string);
|
|
7
7
|
}
|
|
8
8
|
export declare class SelectingScene extends LitElement {
|
|
9
|
-
wallets?: WalletWithSigners[];
|
|
9
|
+
wallets?: ccc.WalletWithSigners[];
|
|
10
10
|
private selectedWallet?;
|
|
11
11
|
private selectedSigner?;
|
|
12
12
|
private connectingError?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scenes/selecting/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scenes/selecting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAM5C,qBAAa,cAAe,SAAQ,KAAK;aAErB,UAAU,EAAE,MAAM;aAClB,UAAU,EAAE,MAAM;gBADlB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM;CAIrC;AAED,qBACa,cAAe,SAAQ,UAAU;IAErC,OAAO,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;IAGzC,OAAO,CAAC,cAAc,CAAC,CAAwB;IAE/C,OAAO,CAAC,cAAc,CAAC,CAAiB;IAExC,OAAO,CAAC,eAAe,CAAC,CAAS;IAEjC,MAAM;IA+CC,OAAO;IAMd,OAAO,CAAC,qBAAqB,CAqC3B;IAEF,MAAM,CAAC,MAAM,0BAsDX;IAEF,OAAO;CAGR"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/ccc";
|
|
2
|
-
import { WalletWithSigners } from "../../types";
|
|
3
2
|
export declare function signerTypeToIcon(type: ccc.SignerType): string;
|
|
4
|
-
export declare function generateSignersScene(wallet: WalletWithSigners, onSignerSelected: (wallet: WalletWithSigners, signer: ccc.SignerInfo) => unknown): (string | import("lit").TemplateResult<1>)[];
|
|
3
|
+
export declare function generateSignersScene(wallet: ccc.WalletWithSigners, onSignerSelected: (wallet: ccc.WalletWithSigners, signer: ccc.SignerInfo) => unknown): (string | import("lit").TemplateResult<1>)[];
|
|
5
4
|
//# sourceMappingURL=signers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signers.d.ts","sourceRoot":"","sources":["../../../src/scenes/selecting/signers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"signers.d.ts","sourceRoot":"","sources":["../../../src/scenes/selecting/signers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAKnC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,GAAG,MAAM,CAO7D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,GAAG,CAAC,iBAAiB,EAC7B,gBAAgB,EAAE,CAChB,MAAM,EAAE,GAAG,CAAC,iBAAiB,EAC7B,MAAM,EAAE,GAAG,CAAC,UAAU,KACnB,OAAO,gDA4Bb"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/ccc";
|
|
2
|
-
|
|
3
|
-
export declare function generateWalletsScene(wallets: WalletWithSigners[], onWalletSelected: (wallet: WalletWithSigners) => unknown, onSignerSelected: (wallet: WalletWithSigners, signer: ccc.SignerInfo) => unknown): unknown[];
|
|
2
|
+
export declare function generateWalletsScene(wallets: ccc.WalletWithSigners[], onWalletSelected: (wallet: ccc.WalletWithSigners) => unknown, onSignerSelected: (wallet: ccc.WalletWithSigners, signer: ccc.SignerInfo) => unknown): unknown[];
|
|
4
3
|
//# sourceMappingURL=wallets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../../src/scenes/selecting/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../../src/scenes/selecting/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAInC,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,GAAG,CAAC,iBAAiB,EAAE,EAChC,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,iBAAiB,KAAK,OAAO,EAC5D,gBAAgB,EAAE,CAChB,MAAM,EAAE,GAAG,CAAC,iBAAiB,EAC7B,MAAM,EAAE,GAAG,CAAC,UAAU,KACnB,OAAO,aAwBb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/connector",
|
|
3
|
-
"version": "0.0.12-alpha.
|
|
3
|
+
"version": "0.0.12-alpha.1",
|
|
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.12-alpha.
|
|
41
|
+
"@ckb-ccc/ccc": "0.0.12-alpha.1",
|
|
42
42
|
"lit": "^3.1.3"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "22b1e1e4c7e56c8a6e9f699f54193cbec7d30a8b"
|
|
45
45
|
}
|
package/src/advancedBarrel.ts
CHANGED
package/src/scenes/connected.ts
CHANGED
|
@@ -31,7 +31,13 @@ export class ConnectedScene extends LitElement {
|
|
|
31
31
|
private balance?: ccc.Num;
|
|
32
32
|
|
|
33
33
|
willUpdate(changedProperties: PropertyValues<this>): void {
|
|
34
|
-
if (
|
|
34
|
+
if (
|
|
35
|
+
(!this.recommendedAddress ||
|
|
36
|
+
!this.internalAddress ||
|
|
37
|
+
!this.balance ||
|
|
38
|
+
changedProperties.has("signer")) &&
|
|
39
|
+
this.signer
|
|
40
|
+
) {
|
|
35
41
|
this.signer
|
|
36
42
|
.getRecommendedAddress()
|
|
37
43
|
.then((v) => (this.recommendedAddress = v));
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/ccc";
|
|
2
2
|
import { html } from "lit";
|
|
3
3
|
import { RETRY_SVG } from "../../assets/retry.svg";
|
|
4
|
-
import { WalletWithSigners } from "../../types";
|
|
5
4
|
|
|
6
5
|
export function generateConnectingScene(
|
|
7
|
-
wallet: WalletWithSigners,
|
|
6
|
+
wallet: ccc.WalletWithSigners,
|
|
8
7
|
signer: ccc.SignerInfo,
|
|
9
8
|
error: string | undefined,
|
|
10
9
|
onSignerSelected: (
|
|
11
|
-
wallet: WalletWithSigners,
|
|
10
|
+
wallet: ccc.WalletWithSigners,
|
|
12
11
|
signer: ccc.SignerInfo,
|
|
13
12
|
) => unknown,
|
|
14
13
|
) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/ccc";
|
|
2
2
|
import { css, html, LitElement } from "lit";
|
|
3
3
|
import { customElement, property, state } from "lit/decorators.js";
|
|
4
|
-
import { WalletWithSigners } from "../../types";
|
|
5
4
|
import { generateConnectingScene } from "./connecting";
|
|
6
5
|
import { generateSignersScene } from "./signers";
|
|
7
6
|
import { generateWalletsScene } from "./wallets";
|
|
@@ -18,10 +17,10 @@ export class ConnectedEvent extends Event {
|
|
|
18
17
|
@customElement("ccc-selecting-scene")
|
|
19
18
|
export class SelectingScene extends LitElement {
|
|
20
19
|
@property()
|
|
21
|
-
public wallets?: WalletWithSigners[];
|
|
20
|
+
public wallets?: ccc.WalletWithSigners[];
|
|
22
21
|
|
|
23
22
|
@state()
|
|
24
|
-
private selectedWallet?: WalletWithSigners;
|
|
23
|
+
private selectedWallet?: ccc.WalletWithSigners;
|
|
25
24
|
@state()
|
|
26
25
|
private selectedSigner?: ccc.SignerInfo;
|
|
27
26
|
@state()
|
|
@@ -81,7 +80,7 @@ export class SelectingScene extends LitElement {
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
private signerSelectedHandler = (
|
|
84
|
-
wallet: WalletWithSigners,
|
|
83
|
+
wallet: ccc.WalletWithSigners,
|
|
85
84
|
signerInfo: ccc.SignerInfo,
|
|
86
85
|
) => {
|
|
87
86
|
this.connectingError = undefined;
|
|
@@ -2,7 +2,6 @@ import { ccc } from "@ckb-ccc/ccc";
|
|
|
2
2
|
import { html } from "lit";
|
|
3
3
|
import { repeat } from "lit/directives/repeat.js";
|
|
4
4
|
import { BTC_SVG, CKB_SVG, ETH_SVG, NOSTR_SVG } from "../../assets/chains";
|
|
5
|
-
import { WalletWithSigners } from "../../types";
|
|
6
5
|
|
|
7
6
|
export function signerTypeToIcon(type: ccc.SignerType): string {
|
|
8
7
|
return {
|
|
@@ -14,9 +13,9 @@ export function signerTypeToIcon(type: ccc.SignerType): string {
|
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export function generateSignersScene(
|
|
17
|
-
wallet: WalletWithSigners,
|
|
16
|
+
wallet: ccc.WalletWithSigners,
|
|
18
17
|
onSignerSelected: (
|
|
19
|
-
wallet: WalletWithSigners,
|
|
18
|
+
wallet: ccc.WalletWithSigners,
|
|
20
19
|
signer: ccc.SignerInfo,
|
|
21
20
|
) => unknown,
|
|
22
21
|
) {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/ccc";
|
|
2
2
|
import { html } from "lit";
|
|
3
3
|
import { repeat } from "lit/directives/repeat.js";
|
|
4
|
-
import { WalletWithSigners } from "../../types";
|
|
5
4
|
|
|
6
5
|
export function generateWalletsScene(
|
|
7
|
-
wallets: WalletWithSigners[],
|
|
8
|
-
onWalletSelected: (wallet: WalletWithSigners) => unknown,
|
|
6
|
+
wallets: ccc.WalletWithSigners[],
|
|
7
|
+
onWalletSelected: (wallet: ccc.WalletWithSigners) => unknown,
|
|
9
8
|
onSignerSelected: (
|
|
10
|
-
wallet: WalletWithSigners,
|
|
9
|
+
wallet: ccc.WalletWithSigners,
|
|
11
10
|
signer: ccc.SignerInfo,
|
|
12
11
|
) => unknown,
|
|
13
12
|
) {
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,GAAG;IAC3C,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/types/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|