@ckb-ccc/joy-id 0.0.8-alpha.0 → 0.0.8-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.
@@ -17,37 +17,48 @@ const nostr_1 = require("../nostr");
17
17
  * @returns {ccc.SignerInfo[]} An array of signer information objects.
18
18
  */
19
19
  function getJoyIdSigners(client, name, icon) {
20
- if ((0, common_1.isStandaloneBrowser)() || core_1.ccc.isWebview(window.navigator.userAgent)) {
21
- return [core_1.ccc.SignerType.CKB, core_1.ccc.SignerType.EVM, core_1.ccc.SignerType.BTC].map((type) => ({
22
- name: type,
23
- signer: new core_1.ccc.SignerAlwaysError(client, type, "JoyID can only be used with standard browsers"),
24
- }));
25
- }
20
+ if (
21
+ (0, common_1.isStandaloneBrowser)() ||
22
+ core_1.ccc.isWebview(window.navigator.userAgent)
23
+ ) {
26
24
  return [
27
- {
28
- name: "CKB",
29
- signer: new ckb_1.CkbSigner(client, name, icon),
30
- },
31
- {
32
- name: "BTC",
33
- signer: new btc_1.BitcoinSigner(client, name, icon),
34
- },
35
- {
36
- name: "Nostr",
37
- signer: new nostr_1.NostrSigner(client, name, icon),
38
- },
39
- {
40
- name: "EVM",
41
- signer: new evm_1.EvmSigner(client, name, icon),
42
- },
43
- {
44
- name: "BTC (P2WPKH)",
45
- signer: new btc_1.BitcoinSigner(client, name, icon, "p2wpkh"),
46
- },
47
- {
48
- name: "BTC (P2TR)",
49
- signer: new btc_1.BitcoinSigner(client, name, icon, "p2tr"),
50
- },
51
- ];
25
+ core_1.ccc.SignerType.CKB,
26
+ core_1.ccc.SignerType.EVM,
27
+ core_1.ccc.SignerType.BTC,
28
+ ].map((type) => ({
29
+ name: type,
30
+ signer: new core_1.ccc.SignerAlwaysError(
31
+ client,
32
+ type,
33
+ "JoyID can only be used with standard browsers",
34
+ ),
35
+ }));
36
+ }
37
+ return [
38
+ {
39
+ name: "CKB",
40
+ signer: new ckb_1.CkbSigner(client, name, icon),
41
+ },
42
+ {
43
+ name: "BTC",
44
+ signer: new btc_1.BitcoinSigner(client, name, icon),
45
+ },
46
+ {
47
+ name: "Nostr",
48
+ signer: new nostr_1.NostrSigner(client, name, icon),
49
+ },
50
+ {
51
+ name: "EVM",
52
+ signer: new evm_1.EvmSigner(client, name, icon),
53
+ },
54
+ {
55
+ name: "BTC (P2WPKH)",
56
+ signer: new btc_1.BitcoinSigner(client, name, icon, "p2wpkh"),
57
+ },
58
+ {
59
+ name: "BTC (P2TR)",
60
+ signer: new btc_1.BitcoinSigner(client, name, icon, "p2tr"),
61
+ },
62
+ ];
52
63
  }
53
64
  exports.getJoyIdSigners = getJoyIdSigners;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckb-ccc/joy-id",
3
- "version": "0.0.8-alpha.0",
3
+ "version": "0.0.8-alpha.3",
4
4
  "description": "Connector's support for JoyID",
5
5
  "author": "Hanssen0 <hanssen0@hanssen0.com>",
6
6
  "license": "MIT",
@@ -38,9 +38,9 @@
38
38
  "access": "public"
39
39
  },
40
40
  "dependencies": {
41
- "@ckb-ccc/core": "0.0.7-alpha.2",
41
+ "@ckb-ccc/core": "0.0.8-alpha.3",
42
42
  "@joyid/ckb": "^1.0.0",
43
43
  "@joyid/common": "^0.2.0"
44
44
  },
45
- "gitHead": "2eed569c6d0f0b683b9c4eda2b5b542b60260449"
45
+ "gitHead": "bddfa3e5631252194dfde32b79ee589703f18afb"
46
46
  }
@@ -112,11 +112,7 @@ export class NostrSigner extends ccc.SignerNostr {
112
112
  }
113
113
 
114
114
  async getNostrPublicKey(): Promise<ccc.Hex> {
115
- if (!this.connection) {
116
- throw new Error("Not connected");
117
- }
118
-
119
- return this.connection.publicKey;
115
+ return this.assertConnection().publicKey;
120
116
  }
121
117
 
122
118
  async signNostrEvent(