@ckb-ccc/joy-id 0.0.8-alpha.2 → 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.
@@ -6,118 +6,125 @@ import { ConnectionsRepo } from "../connectionsStorage";
6
6
  * @extends {ccc.Signer}
7
7
  */
8
8
  export declare class CkbSigner extends ccc.Signer {
9
- private readonly name;
10
- private readonly icon;
11
- private readonly _appUri?;
12
- private readonly _aggregatorUri?;
13
- private readonly connectionsRepo;
14
- /**
15
- * Gets the signer type.
16
- * @returns {ccc.SignerType} The type of the signer.
17
- */
18
- get type(): ccc.SignerType;
19
- /**
20
- * Gets the sign type.
21
- * @returns {ccc.SignerSignType} The sign type.
22
- */
23
- get signType(): ccc.SignerSignType;
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
- */
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
- */
41
- constructor(client: ccc.Client, name: string, icon: string, _appUri?: string | undefined, _aggregatorUri?: string | undefined, connectionsRepo?: ConnectionsRepo);
42
- /**
43
- * Gets the configuration for JoyID.
44
- * @private
45
- * @returns {object} The configuration object.
46
- */
47
- private getConfig;
48
- /**
49
- * Gets the aggregator URI.
50
- * @private
51
- * @returns {string} The aggregator URI.
52
- */
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
- */
58
- connect(): 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
- */
63
- isConnected(): Promise<boolean>;
64
- /**
65
- * Gets the internal address.
66
- * @returns {Promise<string>} A promise that resolves to the internal address.
67
- */
68
- getInternalAddress(): Promise<string>;
69
- /**
70
- * Gets the identity of the signer.
71
- * @returns {Promise<string>} A promise that resolves to the identity.
72
- */
73
- getIdentity(): Promise<string>;
74
- /**
75
- * Gets the address object.
76
- * @returns {Promise<ccc.Address>} A promise that resolves to the address object.
77
- */
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
- */
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
- */
89
- prepareTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
90
- /**
91
- * Prepares a transaction for a sub key.
92
- * @private
93
- * @param tx - The transaction object.
94
- * @param witness - The witness arguments.
95
- * @throws Will throw an error if no COTA cells are found for the sub key wallet.
96
- */
97
- private prepareTransactionForSubKey;
98
- /**
99
- * Signs a transaction.
100
- * @param {ccc.TransactionLike} txLike - The transaction-like object.
101
- * @returns {Promise<ccc.Transaction>} A promise that resolves to the signed transaction.
102
- */
103
- signOnlyTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
104
- /**
105
- * Signs a raw message with the account.
106
- * @param {string | ccc.BytesLike} message - The message to sign.
107
- * @returns {Promise<string>} A promise that resolves to the signed message.
108
- */
109
- signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
110
- /**
111
- * Saves the current connection.
112
- * @private
113
- * @returns {Promise<void>}
114
- */
115
- private saveConnection;
116
- /**
117
- * Restores the previous connection.
118
- * @private
119
- * @returns {Promise<void>}
120
- */
121
- private restoreConnection;
9
+ private readonly name;
10
+ private readonly icon;
11
+ private readonly _appUri?;
12
+ private readonly _aggregatorUri?;
13
+ private readonly connectionsRepo;
14
+ /**
15
+ * Gets the signer type.
16
+ * @returns {ccc.SignerType} The type of the signer.
17
+ */
18
+ get type(): ccc.SignerType;
19
+ /**
20
+ * Gets the sign type.
21
+ * @returns {ccc.SignerSignType} The sign type.
22
+ */
23
+ get signType(): ccc.SignerSignType;
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
+ */
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
+ */
41
+ constructor(
42
+ client: ccc.Client,
43
+ name: string,
44
+ icon: string,
45
+ _appUri?: string | undefined,
46
+ _aggregatorUri?: string | undefined,
47
+ connectionsRepo?: ConnectionsRepo,
48
+ );
49
+ /**
50
+ * Gets the configuration for JoyID.
51
+ * @private
52
+ * @returns {object} The configuration object.
53
+ */
54
+ private getConfig;
55
+ /**
56
+ * Gets the aggregator URI.
57
+ * @private
58
+ * @returns {string} The aggregator URI.
59
+ */
60
+ private getAggregatorUri;
61
+ /**
62
+ * Connects to the provider by requesting authentication.
63
+ * @returns {Promise<void>} A promise that resolves when the connection is established.
64
+ */
65
+ connect(): Promise<void>;
66
+ /**
67
+ * Checks if the signer is connected.
68
+ * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
69
+ */
70
+ isConnected(): Promise<boolean>;
71
+ /**
72
+ * Gets the internal address.
73
+ * @returns {Promise<string>} A promise that resolves to the internal address.
74
+ */
75
+ getInternalAddress(): Promise<string>;
76
+ /**
77
+ * Gets the identity of the signer.
78
+ * @returns {Promise<string>} A promise that resolves to the identity.
79
+ */
80
+ getIdentity(): Promise<string>;
81
+ /**
82
+ * Gets the address object.
83
+ * @returns {Promise<ccc.Address>} A promise that resolves to the address object.
84
+ */
85
+ getAddressObj(): Promise<ccc.Address>;
86
+ /**
87
+ * Gets the address objects.
88
+ * @returns {Promise<ccc.Address[]>} A promise that resolves to an array of address objects.
89
+ */
90
+ getAddressObjs(): Promise<ccc.Address[]>;
91
+ /**
92
+ * Prepares a transaction.
93
+ * @param {ccc.TransactionLike} txLike - The transaction-like object.
94
+ * @returns {Promise<ccc.Transaction>} A promise that resolves to the prepared transaction.
95
+ */
96
+ prepareTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
97
+ /**
98
+ * Prepares a transaction for a sub key.
99
+ * @private
100
+ * @param tx - The transaction object.
101
+ * @param witness - The witness arguments.
102
+ * @throws Will throw an error if no COTA cells are found for the sub key wallet.
103
+ */
104
+ private prepareTransactionForSubKey;
105
+ /**
106
+ * Signs a transaction.
107
+ * @param {ccc.TransactionLike} txLike - The transaction-like object.
108
+ * @returns {Promise<ccc.Transaction>} A promise that resolves to the signed transaction.
109
+ */
110
+ signOnlyTransaction(txLike: ccc.TransactionLike): Promise<ccc.Transaction>;
111
+ /**
112
+ * Signs a raw message with the account.
113
+ * @param {string | ccc.BytesLike} message - The message to sign.
114
+ * @returns {Promise<string>} A promise that resolves to the signed message.
115
+ */
116
+ signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
117
+ /**
118
+ * Saves the current connection.
119
+ * @private
120
+ * @returns {Promise<void>}
121
+ */
122
+ private saveConnection;
123
+ /**
124
+ * Restores the previous connection.
125
+ * @private
126
+ * @returns {Promise<void>}
127
+ */
128
+ private restoreConnection;
122
129
  }
123
- //# sourceMappingURL=index.d.ts.map
130
+ //# sourceMappingURL=index.d.ts.map