@ckb-ccc/joy-id 0.0.5-alpha.7 → 0.0.6-alpha.0

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.
Files changed (50) hide show
  1. package/dist/btc/index.d.ts +46 -1
  2. package/dist/btc/index.d.ts.map +1 -1
  3. package/dist/btc/index.js +46 -3
  4. package/dist/ckb/index.d.ts +95 -2
  5. package/dist/ckb/index.d.ts.map +1 -1
  6. package/dist/ckb/index.js +98 -8
  7. package/dist/common/index.d.ts +13 -0
  8. package/dist/common/index.d.ts.map +1 -1
  9. package/dist/common/index.js +9 -0
  10. package/dist/connectionsStorage/index.d.ts +58 -0
  11. package/dist/connectionsStorage/index.d.ts.map +1 -1
  12. package/dist/connectionsStorage/index.js +30 -0
  13. package/dist/evm/index.d.ts +51 -1
  14. package/dist/evm/index.d.ts.map +1 -1
  15. package/dist/evm/index.js +52 -4
  16. package/dist/nostr/index.d.ts +51 -0
  17. package/dist/nostr/index.d.ts.map +1 -0
  18. package/dist/nostr/index.js +106 -0
  19. package/dist/signerFactory/index.d.ts +9 -0
  20. package/dist/signerFactory/index.d.ts.map +1 -1
  21. package/dist/signerFactory/index.js +20 -2
  22. package/dist.commonjs/btc/index.d.ts +46 -1
  23. package/dist.commonjs/btc/index.d.ts.map +1 -1
  24. package/dist.commonjs/btc/index.js +46 -3
  25. package/dist.commonjs/ckb/index.d.ts +95 -2
  26. package/dist.commonjs/ckb/index.d.ts.map +1 -1
  27. package/dist.commonjs/ckb/index.js +98 -8
  28. package/dist.commonjs/common/index.d.ts +13 -0
  29. package/dist.commonjs/common/index.d.ts.map +1 -1
  30. package/dist.commonjs/common/index.js +9 -0
  31. package/dist.commonjs/connectionsStorage/index.d.ts +58 -0
  32. package/dist.commonjs/connectionsStorage/index.d.ts.map +1 -1
  33. package/dist.commonjs/connectionsStorage/index.js +30 -0
  34. package/dist.commonjs/evm/index.d.ts +51 -1
  35. package/dist.commonjs/evm/index.d.ts.map +1 -1
  36. package/dist.commonjs/evm/index.js +52 -4
  37. package/dist.commonjs/nostr/index.d.ts +51 -0
  38. package/dist.commonjs/nostr/index.d.ts.map +1 -0
  39. package/dist.commonjs/nostr/index.js +110 -0
  40. package/dist.commonjs/signerFactory/index.d.ts +9 -0
  41. package/dist.commonjs/signerFactory/index.d.ts.map +1 -1
  42. package/dist.commonjs/signerFactory/index.js +20 -2
  43. package/package.json +3 -3
  44. package/src/btc/index.ts +47 -12
  45. package/src/ckb/index.ts +104 -19
  46. package/src/common/index.ts +13 -0
  47. package/src/connectionsStorage/index.ts +64 -2
  48. package/src/evm/index.ts +56 -15
  49. package/src/nostr/index.ts +135 -0
  50. package/src/signerFactory/index.ts +25 -2
@@ -1,31 +1,124 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  import { ConnectionsRepo } from "../connectionsStorage";
3
+ /**
4
+ * Class representing a CKB signer that extends Signer from @ckb-ccc/core.
5
+ * @class
6
+ * @extends {ccc.Signer}
7
+ */
3
8
  export declare class CkbSigner extends ccc.Signer {
4
9
  private readonly name;
5
10
  private readonly icon;
6
11
  private readonly _appUri?;
7
12
  private readonly _aggregatorUri?;
8
13
  private readonly connectionsRepo;
14
+ /**
15
+ * Gets the signer type.
16
+ * @returns {ccc.SignerType} The type of the signer.
17
+ */
9
18
  get type(): ccc.SignerType;
19
+ /**
20
+ * Gets the sign type.
21
+ * @returns {ccc.SignerSignType} The sign type.
22
+ */
10
23
  get signType(): ccc.SignerSignType;
11
24
  private connection?;
25
+ /**
26
+ * Ensures that the signer is connected and returns the connection.
27
+ * @private
28
+ * @throws Will throw an error if not connected.
29
+ * @returns {Promise<Connection>} A promise that resolves to the current connection.
30
+ */
12
31
  private assertConnection;
32
+ /**
33
+ * Creates an instance of CkbSigner.
34
+ * @param {ccc.Client} client - The client instance.
35
+ * @param {string} name - The name of the signer.
36
+ * @param {string} icon - The icon URL of the signer.
37
+ * @param {string} [_appUri] - The application URI.
38
+ * @param {string} [_aggregatorUri] - The aggregator URI.
39
+ * @param {ConnectionsRepo} [connectionsRepo=new ConnectionsRepoLocalStorage()] - The connections repository.
40
+ */
13
41
  constructor(client: ccc.Client, name: string, icon: string, _appUri?: string | undefined, _aggregatorUri?: string | undefined, connectionsRepo?: ConnectionsRepo);
14
- replaceClient(client: ccc.Client): Promise<CkbSigner>;
42
+ /**
43
+ * Gets the configuration for JoyID.
44
+ * @private
45
+ * @returns {object} The configuration object.
46
+ */
15
47
  private getConfig;
48
+ /**
49
+ * Gets the aggregator URI.
50
+ * @private
51
+ * @returns {string} The aggregator URI.
52
+ */
16
53
  private getAggregatorUri;
54
+ /**
55
+ * Connects to the provider by requesting authentication.
56
+ * @returns {Promise<void>} A promise that resolves when the connection is established.
57
+ */
17
58
  connect(): Promise<void>;
18
- disconnect(): Promise<void>;
59
+ /**
60
+ * Checks if the signer is connected.
61
+ * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
62
+ */
19
63
  isConnected(): Promise<boolean>;
64
+ /**
65
+ * Gets the internal address.
66
+ * @returns {Promise<string>} A promise that resolves to the internal address.
67
+ */
20
68
  getInternalAddress(): Promise<string>;
69
+ /**
70
+ * Gets the identity of the signer.
71
+ * @returns {Promise<string>} A promise that resolves to the identity.
72
+ */
21
73
  getIdentity(): Promise<string>;
74
+ /**
75
+ * Gets the address object.
76
+ * @returns {Promise<ccc.Address>} A promise that resolves to the address object.
77
+ */
22
78
  getAddressObj(): Promise<ccc.Address>;
79
+ /**
80
+ * Gets the address objects.
81
+ * @returns {Promise<ccc.Address[]>} A promise that resolves to an array of address objects.
82
+ */
23
83
  getAddressObjs(): Promise<ccc.Address[]>;
84
+ /**
85
+ * Prepares a transaction.
86
+ * @param {ccc.TransactionLike} txLike - The transaction-like object.
87
+ * @returns {Promise<ccc.Transaction>} A promise that resolves to the prepared transaction.
88
+ */
24
89
  prepareTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
90
+ /**
91
+ * Prepares a transaction for a sub key.
92
+ * @private
93
+ * @param {ccc.Transaction} tx - The transaction object.
94
+ * @param {ccc.WitnessArgs} witness - The witness arguments.
95
+ * @returns {Promise<void>}
96
+ * @throws Will throw an error if no COTA cells are found for the sub key wallet.
97
+ */
25
98
  private prepareTransactionForSubKey;
99
+ /**
100
+ * Signs a transaction.
101
+ * @param {ccc.TransactionLike} txLike - The transaction-like object.
102
+ * @returns {Promise<ccc.Transaction>} A promise that resolves to the signed transaction.
103
+ */
26
104
  signOnlyTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
105
+ /**
106
+ * Signs a raw message with the account.
107
+ * @param {string | ccc.BytesLike} message - The message to sign.
108
+ * @returns {Promise<string>} A promise that resolves to the signed message.
109
+ */
27
110
  signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
111
+ /**
112
+ * Saves the current connection.
113
+ * @private
114
+ * @returns {Promise<void>}
115
+ */
28
116
  private saveConnection;
117
+ /**
118
+ * Restores the previous connection.
119
+ * @private
120
+ * @returns {Promise<void>}
121
+ */
29
122
  private restoreConnection;
30
123
  }
31
124
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ckb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,SAAU,SAAQ,GAAG,CAAC,MAAM;IAqBrC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAxBlC,IAAI,IAAI,IAAI,GAAG,CAAC,UAAU,CAEzB;IAED,IAAI,QAAQ,IAAI,GAAG,CAAC,cAAc,CAEjC;IAED,OAAO,CAAC,UAA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AG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IA6B3B;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IA2BtE;;;;OAIG;YACW,cAAc;IAU5B;;;;OAIG;YACW,iBAAiB;CAMhC"}
@@ -6,19 +6,47 @@ const ckb_1 = require("@joyid/ckb");
6
6
  const common_1 = require("@joyid/common");
7
7
  const common_2 = require("../common");
8
8
  const connectionsStorage_1 = require("../connectionsStorage");
9
+ /**
10
+ * Class representing a CKB signer that extends Signer from @ckb-ccc/core.
11
+ * @class
12
+ * @extends {ccc.Signer}
13
+ */
9
14
  class CkbSigner extends core_1.ccc.Signer {
15
+ /**
16
+ * Gets the signer type.
17
+ * @returns {ccc.SignerType} The type of the signer.
18
+ */
10
19
  get type() {
11
20
  return core_1.ccc.SignerType.CKB;
12
21
  }
22
+ /**
23
+ * Gets the sign type.
24
+ * @returns {ccc.SignerSignType} The sign type.
25
+ */
13
26
  get signType() {
14
27
  return core_1.ccc.SignerSignType.JoyId;
15
28
  }
29
+ /**
30
+ * Ensures that the signer is connected and returns the connection.
31
+ * @private
32
+ * @throws Will throw an error if not connected.
33
+ * @returns {Promise<Connection>} A promise that resolves to the current connection.
34
+ */
16
35
  async assertConnection() {
17
36
  if (!(await this.isConnected()) || !this.connection) {
18
37
  throw new Error("Not connected");
19
38
  }
20
39
  return this.connection;
21
40
  }
41
+ /**
42
+ * Creates an instance of CkbSigner.
43
+ * @param {ccc.Client} client - The client instance.
44
+ * @param {string} name - The name of the signer.
45
+ * @param {string} icon - The icon URL of the signer.
46
+ * @param {string} [_appUri] - The application URI.
47
+ * @param {string} [_aggregatorUri] - The aggregator URI.
48
+ * @param {ConnectionsRepo} [connectionsRepo=new ConnectionsRepoLocalStorage()] - The connections repository.
49
+ */
22
50
  constructor(client, name, icon, _appUri, _aggregatorUri, connectionsRepo = new connectionsStorage_1.ConnectionsRepoLocalStorage()) {
23
51
  super(client);
24
52
  this.name = name;
@@ -27,9 +55,11 @@ class CkbSigner extends core_1.ccc.Signer {
27
55
  this._aggregatorUri = _aggregatorUri;
28
56
  this.connectionsRepo = connectionsRepo;
29
57
  }
30
- async replaceClient(client) {
31
- return new CkbSigner(client, this.name, this.icon, this._appUri, this._aggregatorUri, this.connectionsRepo);
32
- }
58
+ /**
59
+ * Gets the configuration for JoyID.
60
+ * @private
61
+ * @returns {object} The configuration object.
62
+ */
33
63
  getConfig() {
34
64
  return {
35
65
  redirectURL: location.href,
@@ -40,6 +70,11 @@ class CkbSigner extends core_1.ccc.Signer {
40
70
  logo: this.icon,
41
71
  };
42
72
  }
73
+ /**
74
+ * Gets the aggregator URI.
75
+ * @private
76
+ * @returns {string} The aggregator URI.
77
+ */
43
78
  getAggregatorUri() {
44
79
  if (this._aggregatorUri) {
45
80
  return this._aggregatorUri;
@@ -48,6 +83,10 @@ class CkbSigner extends core_1.ccc.Signer {
48
83
  ? "https://cota.nervina.dev/mainnet-aggregator"
49
84
  : "https://cota.nervina.dev/aggregator";
50
85
  }
86
+ /**
87
+ * Connects to the provider by requesting authentication.
88
+ * @returns {Promise<void>} A promise that resolves when the connection is established.
89
+ */
51
90
  async connect() {
52
91
  const config = this.getConfig();
53
92
  const res = await (0, common_2.createPopup)((0, common_1.buildJoyIDURL)(config, "popup", "/auth"), {
@@ -61,10 +100,10 @@ class CkbSigner extends core_1.ccc.Signer {
61
100
  };
62
101
  await this.saveConnection();
63
102
  }
64
- async disconnect() {
65
- this.connection = undefined;
66
- await this.saveConnection();
67
- }
103
+ /**
104
+ * Checks if the signer is connected.
105
+ * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
106
+ */
68
107
  async isConnected() {
69
108
  if (this.connection) {
70
109
  return true;
@@ -72,9 +111,17 @@ class CkbSigner extends core_1.ccc.Signer {
72
111
  await this.restoreConnection();
73
112
  return this.connection !== undefined;
74
113
  }
114
+ /**
115
+ * Gets the internal address.
116
+ * @returns {Promise<string>} A promise that resolves to the internal address.
117
+ */
75
118
  async getInternalAddress() {
76
119
  return (await this.assertConnection()).address;
77
120
  }
121
+ /**
122
+ * Gets the identity of the signer.
123
+ * @returns {Promise<string>} A promise that resolves to the identity.
124
+ */
78
125
  async getIdentity() {
79
126
  const connection = await this.assertConnection();
80
127
  return JSON.stringify({
@@ -82,12 +129,25 @@ class CkbSigner extends core_1.ccc.Signer {
82
129
  publicKey: connection.publicKey.slice(2),
83
130
  });
84
131
  }
132
+ /**
133
+ * Gets the address object.
134
+ * @returns {Promise<ccc.Address>} A promise that resolves to the address object.
135
+ */
85
136
  async getAddressObj() {
86
137
  return await core_1.ccc.Address.fromString(await this.getInternalAddress(), this.client);
87
138
  }
139
+ /**
140
+ * Gets the address objects.
141
+ * @returns {Promise<ccc.Address[]>} A promise that resolves to an array of address objects.
142
+ */
88
143
  async getAddressObjs() {
89
144
  return [await this.getAddressObj()];
90
145
  }
146
+ /**
147
+ * Prepares a transaction.
148
+ * @param {ccc.TransactionLike} txLike - The transaction-like object.
149
+ * @returns {Promise<ccc.Transaction>} A promise that resolves to the prepared transaction.
150
+ */
91
151
  async prepareTransaction(txLike) {
92
152
  const tx = core_1.ccc.Transaction.from(txLike);
93
153
  const position = await tx.findInputIndexByLock((await this.getAddressObj()).script, this.client);
@@ -97,8 +157,17 @@ class CkbSigner extends core_1.ccc.Signer {
97
157
  const witness = tx.getWitnessArgsAt(position) ?? core_1.ccc.WitnessArgs.from({});
98
158
  witness.lock = "0x";
99
159
  await this.prepareTransactionForSubKey(tx, witness);
100
- return tx.setWitnessArgsAt(position, witness);
160
+ tx.setWitnessArgsAt(position, witness);
161
+ return tx;
101
162
  }
163
+ /**
164
+ * Prepares a transaction for a sub key.
165
+ * @private
166
+ * @param {ccc.Transaction} tx - The transaction object.
167
+ * @param {ccc.WitnessArgs} witness - The witness arguments.
168
+ * @returns {Promise<void>}
169
+ * @throws Will throw an error if no COTA cells are found for the sub key wallet.
170
+ */
102
171
  async prepareTransactionForSubKey(tx, witness) {
103
172
  if (this.connection?.keyType !== "sub_key") {
104
173
  return [];
@@ -127,6 +196,11 @@ class CkbSigner extends core_1.ccc.Signer {
127
196
  }
128
197
  tx.cellDeps.unshift(...cotaDeps);
129
198
  }
199
+ /**
200
+ * Signs a transaction.
201
+ * @param {ccc.TransactionLike} txLike - The transaction-like object.
202
+ * @returns {Promise<ccc.Transaction>} A promise that resolves to the signed transaction.
203
+ */
130
204
  async signOnlyTransaction(txLike) {
131
205
  const tx = core_1.ccc.Transaction.from(txLike);
132
206
  const { script } = await this.getAddressObj();
@@ -136,12 +210,18 @@ class CkbSigner extends core_1.ccc.Signer {
136
210
  tx: JSON.parse(tx.stringify()),
137
211
  signerAddress: (await this.assertConnection()).address,
138
212
  witnessIndex: await tx.findInputIndexByLock(script, this.client),
213
+ witnessLastIndex: await tx.findLastInputIndexByLock(script, this.client),
139
214
  }, "popup", "/sign-ckb-raw-tx"), {
140
215
  ...config,
141
216
  type: common_1.DappRequestType.SignCkbRawTx,
142
217
  });
143
218
  return core_1.ccc.Transaction.from(res.tx);
144
219
  }
220
+ /**
221
+ * Signs a raw message with the account.
222
+ * @param {string | ccc.BytesLike} message - The message to sign.
223
+ * @returns {Promise<string>} A promise that resolves to the signed message.
224
+ */
145
225
  async signMessageRaw(message) {
146
226
  const { address } = await this.assertConnection();
147
227
  const challenge = typeof message === "string" ? message : core_1.ccc.hexFrom(message).slice(2);
@@ -158,12 +238,22 @@ class CkbSigner extends core_1.ccc.Signer {
158
238
  message: res.message,
159
239
  });
160
240
  }
241
+ /**
242
+ * Saves the current connection.
243
+ * @private
244
+ * @returns {Promise<void>}
245
+ */
161
246
  async saveConnection() {
162
247
  return this.connectionsRepo.set({
163
248
  uri: this.getConfig().joyidAppURL,
164
249
  addressType: "ckb",
165
250
  }, this.connection);
166
251
  }
252
+ /**
253
+ * Restores the previous connection.
254
+ * @private
255
+ * @returns {Promise<void>}
256
+ */
167
257
  async restoreConnection() {
168
258
  this.connection = await this.connectionsRepo.get({
169
259
  uri: this.getConfig().joyidAppURL,
@@ -1,4 +1,8 @@
1
1
  import { AuthResponseData, DappRequestType, EvmWeb2LoginResponse, PopupConfigOptions, SignCkbTxResponseData, SignCotaNFTResponseData, SignEvmTxResponseData, SignMessageResponseData, SignNostrEventData } from "@joyid/common";
2
+ /**
3
+ * Interface representing the return type for various Dapp request types.
4
+ * @interface
5
+ */
2
6
  export interface PopupReturnType {
3
7
  [DappRequestType.Auth]: AuthResponseData;
4
8
  [DappRequestType.SignMessage]: SignMessageResponseData;
@@ -18,6 +22,15 @@ export interface PopupReturnType {
18
22
  [DappRequestType.SignMiniAppMessage]: any;
19
23
  [DappRequestType.EvmWeb2Login]: EvmWeb2LoginResponse;
20
24
  }
25
+ /**
26
+ * Creates a popup window for JoyID Dapp requests.
27
+ * @param {string} url - The URL to open in the popup.
28
+ * @param {PopupConfigOptions<T> & { joyidAppURL: string }} config - The popup configuration options.
29
+ * @returns {Promise<PopupReturnType[T]>} A promise that resolves to the response data of the requested type.
30
+ * @throws {PopupNotSupportedError} If popups are not supported in the current browser.
31
+ * @throws {PopupCancelledError} If the popup is closed by the user.
32
+ * @throws {PopupTimeoutError} If the popup operation times out.
33
+ */
21
34
  export declare function createPopup<T extends DappRequestType>(url: string, config: PopupConfigOptions<T> & {
22
35
  joyidAppURL: string;
23
36
  }): Promise<PopupReturnType[T]>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EAEpB,kBAAkB,EAGlB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAInB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,eAAe;IAC9B,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACzC,CAAC,eAAe,CAA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});
3
3
  exports.createPopup = void 0;
4
4
  const common_1 = require("@joyid/common");
5
+ /**
6
+ * Creates a popup window for JoyID Dapp requests.
7
+ * @param {string} url - The URL to open in the popup.
8
+ * @param {PopupConfigOptions<T> & { joyidAppURL: string }} config - The popup configuration options.
9
+ * @returns {Promise<PopupReturnType[T]>} A promise that resolves to the response data of the requested type.
10
+ * @throws {PopupNotSupportedError} If popups are not supported in the current browser.
11
+ * @throws {PopupCancelledError} If the popup is closed by the user.
12
+ * @throws {PopupTimeoutError} If the popup operation times out.
13
+ */
5
14
  async function createPopup(url, config) {
6
15
  if (config.popup == null) {
7
16
  config.popup = (0, common_1.openPopup)("");
@@ -1,23 +1,81 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
+ /**
3
+ * Type representing an account selector with a URI and address type.
4
+ * @typedef {Object} AccountSelector
5
+ * @property {string} uri - The URI of the account.
6
+ * @property {string} addressType - The address type of the account.
7
+ */
2
8
  export type AccountSelector = {
3
9
  uri: string;
4
10
  addressType: string;
5
11
  };
12
+ /**
13
+ * Checks if two AccountSelectors are equal.
14
+ * @param {AccountSelector} a - The first account selector.
15
+ * @param {AccountSelector} b - The second account selector.
16
+ * @returns {boolean} True if the selectors are equal, false otherwise.
17
+ */
6
18
  export declare function isSelectorEq(a: AccountSelector, b: AccountSelector): boolean;
19
+ /**
20
+ * Type representing a connection with an address, public key, and key type.
21
+ * @typedef {Object} Connection
22
+ * @property {string} address - The address of the connection.
23
+ * @property {ccc.Hex} publicKey - The public key of the connection.
24
+ * @property {string} keyType - The key type of the connection.
25
+ */
7
26
  export type Connection = {
8
27
  readonly address: string;
9
28
  readonly publicKey: ccc.Hex;
10
29
  readonly keyType: string;
11
30
  };
31
+ /**
32
+ * Interface representing a repository for managing connections.
33
+ * @interface
34
+ */
12
35
  export interface ConnectionsRepo {
36
+ /**
37
+ * Gets a connection for the given selector.
38
+ * @param {AccountSelector} selector - The account selector.
39
+ * @returns {Promise<Connection | undefined>} A promise that resolves to the connection, if found.
40
+ */
13
41
  get(selector: AccountSelector): Promise<Connection | undefined>;
42
+ /**
43
+ * Sets a connection for the given selector.
44
+ * @param {AccountSelector} selector - The account selector.
45
+ * @param {Connection | undefined} connection - The connection to set.
46
+ * @returns {Promise<void>} A promise that resolves when the connection is set.
47
+ */
14
48
  set(selector: AccountSelector, connection: Connection | undefined): Promise<void>;
15
49
  }
50
+ /**
51
+ * Class representing a local storage-based repository for managing connections.
52
+ * @class
53
+ * @implements {ConnectionsRepo}
54
+ */
16
55
  export declare class ConnectionsRepoLocalStorage implements ConnectionsRepo {
17
56
  private readonly storageKey;
57
+ /**
58
+ * Creates an instance of ConnectionsRepoLocalStorage.
59
+ * @param {string} [storageKey="ccc-joy-id-signer"] - The local storage key.
60
+ */
18
61
  constructor(storageKey?: string);
62
+ /**
63
+ * Reads all connections from local storage.
64
+ * @returns {Promise<[AccountSelector, Connection][]>} A promise that resolves to an array of selectors and connections.
65
+ */
19
66
  readConnections(): Promise<[AccountSelector, Connection][]>;
67
+ /**
68
+ * Gets a connection for the given selector.
69
+ * @param {AccountSelector} selector - The account selector.
70
+ * @returns {Promise<Connection | undefined>} A promise that resolves to the connection, if found.
71
+ */
20
72
  get(selector: AccountSelector): Promise<Connection | undefined>;
73
+ /**
74
+ * Sets a connection for the given selector.
75
+ * @param {AccountSelector} selector - The account selector.
76
+ * @param {Connection | undefined} connection - The connection to set.
77
+ * @returns {Promise<void>}
78
+ */
21
79
  set(selector: AccountSelector, connection: Connection | undefined): Promise<void>;
22
80
  }
23
81
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connectionsStorage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CA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B,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAEhE;;;;;OAKG;IACH,GAAG,CACD,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAED;;;;GAIG;AACH,qBAAa,2BAA4B,YAAW,eAAe;IAKrD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJvC;;;OAGG;gBAC0B,UAAU,SAAsB;IAE7D;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,CAAC,eAAe,EAAE,UAAU,CAAC,EAAE,CAAC;IAIjE;;;;OAIG;IACG,GAAG,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAMrE;;;;;OAKG;IACG,GAAG,CACP,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,OAAO,CAAC,IAAI,CAAC;CAkBjB"}
@@ -1,20 +1,50 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConnectionsRepoLocalStorage = exports.isSelectorEq = void 0;
4
+ /**
5
+ * Checks if two AccountSelectors are equal.
6
+ * @param {AccountSelector} a - The first account selector.
7
+ * @param {AccountSelector} b - The second account selector.
8
+ * @returns {boolean} True if the selectors are equal, false otherwise.
9
+ */
4
10
  function isSelectorEq(a, b) {
5
11
  return a.uri === b.uri && a.addressType === b.addressType;
6
12
  }
7
13
  exports.isSelectorEq = isSelectorEq;
14
+ /**
15
+ * Class representing a local storage-based repository for managing connections.
16
+ * @class
17
+ * @implements {ConnectionsRepo}
18
+ */
8
19
  class ConnectionsRepoLocalStorage {
20
+ /**
21
+ * Creates an instance of ConnectionsRepoLocalStorage.
22
+ * @param {string} [storageKey="ccc-joy-id-signer"] - The local storage key.
23
+ */
9
24
  constructor(storageKey = "ccc-joy-id-signer") {
10
25
  this.storageKey = storageKey;
11
26
  }
27
+ /**
28
+ * Reads all connections from local storage.
29
+ * @returns {Promise<[AccountSelector, Connection][]>} A promise that resolves to an array of selectors and connections.
30
+ */
12
31
  async readConnections() {
13
32
  return JSON.parse(window.localStorage.getItem(this.storageKey) ?? "[]");
14
33
  }
34
+ /**
35
+ * Gets a connection for the given selector.
36
+ * @param {AccountSelector} selector - The account selector.
37
+ * @returns {Promise<Connection | undefined>} A promise that resolves to the connection, if found.
38
+ */
15
39
  async get(selector) {
16
40
  return (await this.readConnections()).find(([s]) => isSelectorEq(selector, s))?.[1];
17
41
  }
42
+ /**
43
+ * Sets a connection for the given selector.
44
+ * @param {AccountSelector} selector - The account selector.
45
+ * @param {Connection | undefined} connection - The connection to set.
46
+ * @returns {Promise<void>}
47
+ */
18
48
  async set(selector, connection) {
19
49
  const connections = await this.readConnections();
20
50
  if (connection) {
@@ -1,20 +1,70 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  import { ConnectionsRepo } from "../connectionsStorage";
3
+ /**
4
+ * Class representing an EVM signer that extends SignerEvm from @ckb-ccc/core.
5
+ * @class
6
+ * @extends {ccc.SignerEvm}
7
+ */
3
8
  export declare class EvmSigner extends ccc.SignerEvm {
4
9
  private readonly name;
5
10
  private readonly icon;
6
11
  private readonly appUri;
7
12
  private readonly connectionsRepo;
8
13
  private connection?;
14
+ /**
15
+ * Ensures that the signer is connected and returns the connection.
16
+ * @private
17
+ * @throws Will throw an error if not connected.
18
+ * @returns {Connection} The current connection.
19
+ */
9
20
  private assertConnection;
21
+ /**
22
+ * Creates an instance of EvmSigner.
23
+ * @param {ccc.Client} client - The client instance.
24
+ * @param {string} name - The name of the signer.
25
+ * @param {string} icon - The icon URL of the signer.
26
+ * @param {string} [appUri="https://app.joy.id"] - The application URI.
27
+ * @param {ConnectionsRepo} [connectionsRepo=new ConnectionsRepoLocalStorage()] - The connections repository.
28
+ */
10
29
  constructor(client: ccc.Client, name: string, icon: string, appUri?: string, connectionsRepo?: ConnectionsRepo);
11
- replaceClient(client: ccc.Client): Promise<EvmSigner>;
30
+ /**
31
+ * Gets the configuration for JoyID.
32
+ * @private
33
+ * @returns {object} The configuration object.
34
+ */
12
35
  private getConfig;
36
+ /**
37
+ * Gets the EVM account address.
38
+ * @returns {Promise<string>} A promise that resolves to the EVM account address.
39
+ */
13
40
  getEvmAccount(): Promise<string>;
41
+ /**
42
+ * Connects to the provider by requesting authentication.
43
+ * @returns {Promise<void>} A promise that resolves when the connection is established.
44
+ */
14
45
  connect(): Promise<void>;
46
+ /**
47
+ * Checks if the signer is connected.
48
+ * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
49
+ */
15
50
  isConnected(): Promise<boolean>;
51
+ /**
52
+ * Signs a raw message with the EVM account.
53
+ * @param {string | ccc.BytesLike} message - The message to sign.
54
+ * @returns {Promise<ccc.Hex>} A promise that resolves to the signed message.
55
+ */
16
56
  signMessageRaw(message: string | ccc.BytesLike): Promise<ccc.Hex>;
57
+ /**
58
+ * Saves the current connection.
59
+ * @private
60
+ * @returns {Promise<void>}
61
+ */
17
62
  private saveConnection;
63
+ /**
64
+ * Restores the previous connection.
65
+ * @private
66
+ * @returns {Promise<void>}
67
+ */
18
68
  private restoreConnection;
19
69
  }
20
70
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;IAaxC,OAAO,CAAC,QAA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