@ckb-ccc/uni-sat 0.0.12-alpha.1 → 0.0.13-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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # @ckb-ccc/uni-sat
2
+
3
+ ## 0.0.13-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`600cc13`](https://github.com/ckb-ecofund/ccc/commit/600cc137ac6eb7c5b2533670de6df29d82f1b9e1)]:
8
+ - @ckb-ccc/core@0.0.13-alpha.0
9
+
10
+ ## 0.0.12
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies []:
15
+ - @ckb-ccc/core@0.0.12
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <a href="https://ckbccc-demo.vercel.app/">
2
+ <a href="https://app.ckbccc.com/">
3
3
  <img alt="Logo" src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/logo.svg" width="20%" />
4
4
  </a>
5
5
  </p>
@@ -14,9 +14,12 @@
14
14
  /></a>
15
15
  <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/ckb-ecofund/ccc" />
16
16
  <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/ckb-ecofund/ccc/master" />
17
- <img alt="GitHub deployments" src="https://img.shields.io/github/deployments/ckb-ecofund/ccc/production" />
18
- <a href="https://ckbccc-demo.vercel.app/"><img
19
- alt="Demo" src="https://img.shields.io/website?url=https%3A%2F%2Fckbccc-demo.vercel.app%2F&label=Demo"
17
+ <img alt="GitHub branch check runs" src="https://img.shields.io/github/check-runs/ckb-ecofund/ccc/master" />
18
+ <a href="https://app.ckbccc.com/"><img
19
+ alt="App" src="https://img.shields.io/website?url=https%3A%2F%2Fapp.ckbccc.com%2F&label=App"
20
+ /></a>
21
+ <a href="https://docs.ckbccc.com/"><img
22
+ alt="Docs" src="https://img.shields.io/website?url=https%3A%2F%2Fdocs.ckbccc.com%2F&label=Docs"
20
23
  /></a>
21
24
  </p>
22
25
 
@@ -33,13 +36,13 @@
33
36
  ## Preview
34
37
 
35
38
  <p align="center">
36
- <a href="https://ckbccc-demo.vercel.app/">
39
+ <a href="https://app.ckbccc.com/">
37
40
  <img src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/preview.png" width="30%" />
38
41
  </a>
39
42
  </p>
40
43
 
41
- This project is still under active development, and we are looking forward to your feedback. [Try its demo now here](https://ckbccc-demo.vercel.app/). It showcases how to use CCC for some basic scenarios in CKB.
44
+ This project is still under active development, and we are looking forward to your feedback. [Try its demo now here](https://app.ckbccc.com/). It showcases how to use CCC for some basic scenarios in CKB.
42
45
 
43
46
  <h3 align="center">
44
- Read more about CCC on its <a href="https://github.com/ckb-ecofund/ccc">GitHub Repo</a>.
47
+ Read more about CCC on <a href="https://docs.ckbccc.com">our website</a> or <a href="https://github.com/ckb-ecofund/ccc">GitHub Repo</a>.
45
48
  </h3>
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Interface representing a provider for interacting with accounts and signing messages.
3
- * @interface
4
3
  */
5
4
  export interface Provider {
6
5
  /**
7
6
  * Requests user accounts.
8
- * @returns {Promise<string[]>} A promise that resolves to an array of account addresses.
7
+ * @returns A promise that resolves to an array of account addresses.
9
8
  */
10
9
  requestAccounts(): Promise<string[]>;
11
10
  /**
@@ -36,44 +35,42 @@ export interface Provider {
36
35
  }>;
37
36
  /**
38
37
  * Gets the current accounts.
39
- * @returns {Promise<string[]>} A promise that resolves to an array of account addresses.
38
+ * @returns A promise that resolves to an array of account addresses.
40
39
  */
41
40
  getAccounts(): Promise<string[]>;
42
41
  /**
43
42
  * Gets the public key of the account.
44
- * @returns {Promise<string>} A promise that resolves to the public key.
43
+ * @returns A promise that resolves to the public key.
45
44
  */
46
45
  getPublicKey(): Promise<string>;
47
46
  /**
48
47
  * Signs a message with the specified type.
49
- * @param {string} msg - The message to sign.
50
- * @param {"ecdsa" | "bip322-simple"} type - The type of signature.
51
- * @returns {Promise<string>} A promise that resolves to the signed message.
48
+ * @param msg - The message to sign.
49
+ * @param type - The type of signature.
50
+ * @returns A promise that resolves to the signed message.
52
51
  */
53
52
  signMessage(msg: string, type: "ecdsa" | "bip322-simple"): Promise<string>;
54
53
  /**
55
54
  * Adds an event listener to the provider.
56
- * @type {OnMethod}
57
55
  */
58
56
  on: OnMethod;
59
57
  /**
60
58
  * Removes an event listener from the provider.
61
- * @param {string} eventName - The name of the event to remove the listener from.
62
- * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.
63
- * @returns {Provider} The provider instance.
59
+ * @param eventName - The name of the event to remove the listener from.
60
+ * @param listener - The listener function to remove.
61
+ * @returns The provider instance.
64
62
  */
65
63
  removeListener(eventName: string, listener: (...args: unknown[]) => unknown): Provider;
66
64
  }
67
65
  /**
68
66
  * Interface representing a method to add event listeners to the provider.
69
- * @interface
70
67
  */
71
68
  export interface OnMethod {
72
69
  /**
73
70
  * Adds an event listener to the provider.
74
- * @param {string} eventName - The name of the event.
75
- * @param {(...args: unknown[]) => unknown} listener - The listener function.
76
- * @returns {Provider} The provider instance.
71
+ * @param eventName - The name of the event.
72
+ * @param listener - The listener function.
73
+ * @returns The provider instance.
77
74
  */
78
75
  (eventName: string, listener: (...args: unknown[]) => unknown): Provider;
79
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"advancedBarrel.d.ts","sourceRoot":"","sources":["../src/advancedBarrel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAErC;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAE7C;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D;;;OAGG;IACH,QAAQ,CAAC,IAAI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,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D;;;OAGG;IACH,QAAQ,CAAC,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEtE;;OAEG;IACH,WAAW,CAAC,CACV,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE5D;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEjC;;;OAGG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC;;;;;OAKG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3E;;OAEG;IACH,EAAE,EAAE,QAAQ,CAAC;IAEb;;;;;OAKG;IACH,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GACxC,QAAQ,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;OAKG;IACH,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,QAAQ,CAAC;CAC1E"}
package/dist/signer.d.ts CHANGED
@@ -1,17 +1,16 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  import { Provider } from "./advancedBarrel.js";
3
3
  /**
4
- * Class representing a Bitcoin signer that extends SignerBtc from @ckb-ccc/core.
5
- * @class
6
- * @extends {ccc.SignerBtc}
4
+ * Class representing a Bitcoin signer that extends SignerBtc
5
+ * @public
7
6
  */
8
7
  export declare class Signer extends ccc.SignerBtc {
9
8
  readonly provider: Provider;
10
9
  private readonly preferredNetworks;
11
10
  /**
12
11
  * Creates an instance of Signer.
13
- * @param {ccc.Client} client - The client instance.
14
- * @param {Provider} provider - The provider instance.
12
+ * @param client - The client instance.
13
+ * @param provider - The provider instance.
15
14
  */
16
15
  constructor(client: ccc.Client, provider: Provider, preferredNetworks?: ccc.NetworkPreference[]);
17
16
  _getNetworkToChange(): Promise<string | undefined>;
@@ -21,29 +20,29 @@ export declare class Signer extends ccc.SignerBtc {
21
20
  ensureNetwork(): Promise<void>;
22
21
  /**
23
22
  * Gets the Bitcoin account address.
24
- * @returns {Promise<string>} A promise that resolves to the Bitcoin account address.
23
+ * @returns A promise that resolves to the Bitcoin account address.
25
24
  */
26
25
  getBtcAccount(): Promise<string>;
27
26
  /**
28
27
  * Gets the Bitcoin public key.
29
- * @returns {Promise<ccc.Hex>} A promise that resolves to the Bitcoin public key.
28
+ * @returns A promise that resolves to the Bitcoin public key.
30
29
  */
31
30
  getBtcPublicKey(): Promise<ccc.Hex>;
32
31
  /**
33
32
  * Connects to the provider by requesting accounts.
34
- * @returns {Promise<void>} A promise that resolves when the connection is established.
33
+ * @returns A promise that resolves when the connection is established.
35
34
  */
36
35
  connect(): Promise<void>;
37
36
  onReplaced(listener: () => void): () => void;
38
37
  /**
39
38
  * Checks if the signer is connected.
40
- * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
39
+ * @returns A promise that resolves to true if connected, false otherwise.
41
40
  */
42
41
  isConnected(): Promise<boolean>;
43
42
  /**
44
43
  * Signs a raw message with the Bitcoin account.
45
- * @param {string | ccc.BytesLike} message - The message to sign.
46
- * @returns {Promise<string>} A promise that resolves to the signed message.
44
+ * @param message - The message to sign.
45
+ * @returns A promise that resolves to the signed message.
47
46
  */
48
47
  signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
49
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signer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;;OAIG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ,EACjB,iBAAiB,GAAE,GAAG,CAAC,iBAAiB,EAWxD;IAKG,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IA0BxD;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA2BpC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAIzC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAiB5C;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAOrC;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAMvE"}
package/dist/signer.js CHANGED
@@ -1,14 +1,13 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  /**
3
- * Class representing a Bitcoin signer that extends SignerBtc from @ckb-ccc/core.
4
- * @class
5
- * @extends {ccc.SignerBtc}
3
+ * Class representing a Bitcoin signer that extends SignerBtc
4
+ * @public
6
5
  */
7
6
  export class Signer extends ccc.SignerBtc {
8
7
  /**
9
8
  * Creates an instance of Signer.
10
- * @param {ccc.Client} client - The client instance.
11
- * @param {Provider} provider - The provider instance.
9
+ * @param client - The client instance.
10
+ * @param provider - The provider instance.
12
11
  */
13
12
  constructor(client, provider, preferredNetworks = [
14
13
  {
@@ -72,21 +71,21 @@ export class Signer extends ccc.SignerBtc {
72
71
  }
73
72
  /**
74
73
  * Gets the Bitcoin account address.
75
- * @returns {Promise<string>} A promise that resolves to the Bitcoin account address.
74
+ * @returns A promise that resolves to the Bitcoin account address.
76
75
  */
77
76
  async getBtcAccount() {
78
77
  return (await this.provider.getAccounts())[0];
79
78
  }
80
79
  /**
81
80
  * Gets the Bitcoin public key.
82
- * @returns {Promise<ccc.Hex>} A promise that resolves to the Bitcoin public key.
81
+ * @returns A promise that resolves to the Bitcoin public key.
83
82
  */
84
83
  async getBtcPublicKey() {
85
84
  return ccc.hexFrom(await this.provider.getPublicKey());
86
85
  }
87
86
  /**
88
87
  * Connects to the provider by requesting accounts.
89
- * @returns {Promise<void>} A promise that resolves when the connection is established.
88
+ * @returns A promise that resolves when the connection is established.
90
89
  */
91
90
  async connect() {
92
91
  await this.provider.requestAccounts();
@@ -108,7 +107,7 @@ export class Signer extends ccc.SignerBtc {
108
107
  }
109
108
  /**
110
109
  * Checks if the signer is connected.
111
- * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
110
+ * @returns A promise that resolves to true if connected, false otherwise.
112
111
  */
113
112
  async isConnected() {
114
113
  if (await this._getNetworkToChange()) {
@@ -118,8 +117,8 @@ export class Signer extends ccc.SignerBtc {
118
117
  }
119
118
  /**
120
119
  * Signs a raw message with the Bitcoin account.
121
- * @param {string | ccc.BytesLike} message - The message to sign.
122
- * @returns {Promise<string>} A promise that resolves to the signed message.
120
+ * @param message - The message to sign.
121
+ * @returns A promise that resolves to the signed message.
123
122
  */
124
123
  async signMessageRaw(message) {
125
124
  const challenge = typeof message === "string" ? message : ccc.hexFrom(message).slice(2);
@@ -1,8 +1,10 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  /**
3
3
  * Retrieves the UniSat signer if available.
4
- * @param {ccc.Client} client - The client instance.
5
- * @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
4
+ * @public
5
+ *
6
+ * @param client - The client instance.
7
+ * @returns The Signer instance if the UniSat provider is available, otherwise undefined.
6
8
  */
7
9
  export declare function getUniSatSigners(client: ccc.Client, preferredNetworks?: ccc.NetworkPreference[]): ccc.SignerInfo[];
8
10
  //# sourceMappingURL=signersFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,GAC1C,GAAG,CAAC,UAAU,EAAE,CAalB"}
1
+ {"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,GAC1C,GAAG,CAAC,UAAU,EAAE,CAalB"}
@@ -1,8 +1,10 @@
1
1
  import { Signer } from "./signer.js";
2
2
  /**
3
3
  * Retrieves the UniSat signer if available.
4
- * @param {ccc.Client} client - The client instance.
5
- * @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
4
+ * @public
5
+ *
6
+ * @param client - The client instance.
7
+ * @returns The Signer instance if the UniSat provider is available, otherwise undefined.
6
8
  */
7
9
  export function getUniSatSigners(client, preferredNetworks) {
8
10
  const windowRef = window;
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Interface representing a provider for interacting with accounts and signing messages.
3
- * @interface
4
3
  */
5
4
  export interface Provider {
6
5
  /**
7
6
  * Requests user accounts.
8
- * @returns {Promise<string[]>} A promise that resolves to an array of account addresses.
7
+ * @returns A promise that resolves to an array of account addresses.
9
8
  */
10
9
  requestAccounts(): Promise<string[]>;
11
10
  /**
@@ -36,44 +35,42 @@ export interface Provider {
36
35
  }>;
37
36
  /**
38
37
  * Gets the current accounts.
39
- * @returns {Promise<string[]>} A promise that resolves to an array of account addresses.
38
+ * @returns A promise that resolves to an array of account addresses.
40
39
  */
41
40
  getAccounts(): Promise<string[]>;
42
41
  /**
43
42
  * Gets the public key of the account.
44
- * @returns {Promise<string>} A promise that resolves to the public key.
43
+ * @returns A promise that resolves to the public key.
45
44
  */
46
45
  getPublicKey(): Promise<string>;
47
46
  /**
48
47
  * Signs a message with the specified type.
49
- * @param {string} msg - The message to sign.
50
- * @param {"ecdsa" | "bip322-simple"} type - The type of signature.
51
- * @returns {Promise<string>} A promise that resolves to the signed message.
48
+ * @param msg - The message to sign.
49
+ * @param type - The type of signature.
50
+ * @returns A promise that resolves to the signed message.
52
51
  */
53
52
  signMessage(msg: string, type: "ecdsa" | "bip322-simple"): Promise<string>;
54
53
  /**
55
54
  * Adds an event listener to the provider.
56
- * @type {OnMethod}
57
55
  */
58
56
  on: OnMethod;
59
57
  /**
60
58
  * Removes an event listener from the provider.
61
- * @param {string} eventName - The name of the event to remove the listener from.
62
- * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.
63
- * @returns {Provider} The provider instance.
59
+ * @param eventName - The name of the event to remove the listener from.
60
+ * @param listener - The listener function to remove.
61
+ * @returns The provider instance.
64
62
  */
65
63
  removeListener(eventName: string, listener: (...args: unknown[]) => unknown): Provider;
66
64
  }
67
65
  /**
68
66
  * Interface representing a method to add event listeners to the provider.
69
- * @interface
70
67
  */
71
68
  export interface OnMethod {
72
69
  /**
73
70
  * Adds an event listener to the provider.
74
- * @param {string} eventName - The name of the event.
75
- * @param {(...args: unknown[]) => unknown} listener - The listener function.
76
- * @returns {Provider} The provider instance.
71
+ * @param eventName - The name of the event.
72
+ * @param listener - The listener function.
73
+ * @returns The provider instance.
77
74
  */
78
75
  (eventName: string, listener: (...args: unknown[]) => unknown): Provider;
79
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"advancedBarrel.d.ts","sourceRoot":"","sources":["../src/advancedBarrel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;;O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EAAE,KAAK,OAAO,GAAG,QAAQ,CAAC;CAC1E"}
@@ -1,17 +1,16 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  import { Provider } from "./advancedBarrel.js";
3
3
  /**
4
- * Class representing a Bitcoin signer that extends SignerBtc from @ckb-ccc/core.
5
- * @class
6
- * @extends {ccc.SignerBtc}
4
+ * Class representing a Bitcoin signer that extends SignerBtc
5
+ * @public
7
6
  */
8
7
  export declare class Signer extends ccc.SignerBtc {
9
8
  readonly provider: Provider;
10
9
  private readonly preferredNetworks;
11
10
  /**
12
11
  * Creates an instance of Signer.
13
- * @param {ccc.Client} client - The client instance.
14
- * @param {Provider} provider - The provider instance.
12
+ * @param client - The client instance.
13
+ * @param provider - The provider instance.
15
14
  */
16
15
  constructor(client: ccc.Client, provider: Provider, preferredNetworks?: ccc.NetworkPreference[]);
17
16
  _getNetworkToChange(): Promise<string | undefined>;
@@ -21,29 +20,29 @@ export declare class Signer extends ccc.SignerBtc {
21
20
  ensureNetwork(): Promise<void>;
22
21
  /**
23
22
  * Gets the Bitcoin account address.
24
- * @returns {Promise<string>} A promise that resolves to the Bitcoin account address.
23
+ * @returns A promise that resolves to the Bitcoin account address.
25
24
  */
26
25
  getBtcAccount(): Promise<string>;
27
26
  /**
28
27
  * Gets the Bitcoin public key.
29
- * @returns {Promise<ccc.Hex>} A promise that resolves to the Bitcoin public key.
28
+ * @returns A promise that resolves to the Bitcoin public key.
30
29
  */
31
30
  getBtcPublicKey(): Promise<ccc.Hex>;
32
31
  /**
33
32
  * Connects to the provider by requesting accounts.
34
- * @returns {Promise<void>} A promise that resolves when the connection is established.
33
+ * @returns A promise that resolves when the connection is established.
35
34
  */
36
35
  connect(): Promise<void>;
37
36
  onReplaced(listener: () => void): () => void;
38
37
  /**
39
38
  * Checks if the signer is connected.
40
- * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
39
+ * @returns A promise that resolves to true if connected, false otherwise.
41
40
  */
42
41
  isConnected(): Promise<boolean>;
43
42
  /**
44
43
  * Signs a raw message with the Bitcoin account.
45
- * @param {string | ccc.BytesLike} message - The message to sign.
46
- * @returns {Promise<string>} A promise that resolves to the signed message.
44
+ * @param message - The message to sign.
45
+ * @returns A promise that resolves to the signed message.
47
46
  */
48
47
  signMessageRaw(message: string | ccc.BytesLike): Promise<string>;
49
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,GAAG,CAAC,SAAS;aAQrB,QAAQ,EAAE,QAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IARpC;;;;OAIG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ,EACjB,iBAAiB,GAAE,GAAG,CAAC,iBAAiB,EAWxD;IAKG,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IA0BxD;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA2BpC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAIzC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAiB5C;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAOrC;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAMvE"}
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;GAGG;AACH,qBAAa,MAAO,SAAQ,GAAG,CAAC,SAAS;aAQrB,QAAQ,EAAE,QAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IARpC;;;;OAIG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ,EACjB,iBAAiB,GAAE,GAAG,CAAC,iBAAiB,EAWxD;IAKG,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IA0BxD;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA2BpC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAIzC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAiB5C;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAOrC;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAMvE"}
@@ -3,15 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Signer = void 0;
4
4
  const core_1 = require("@ckb-ccc/core");
5
5
  /**
6
- * Class representing a Bitcoin signer that extends SignerBtc from @ckb-ccc/core.
7
- * @class
8
- * @extends {ccc.SignerBtc}
6
+ * Class representing a Bitcoin signer that extends SignerBtc
7
+ * @public
9
8
  */
10
9
  class Signer extends core_1.ccc.SignerBtc {
11
10
  /**
12
11
  * Creates an instance of Signer.
13
- * @param {ccc.Client} client - The client instance.
14
- * @param {Provider} provider - The provider instance.
12
+ * @param client - The client instance.
13
+ * @param provider - The provider instance.
15
14
  */
16
15
  constructor(client, provider, preferredNetworks = [
17
16
  {
@@ -75,21 +74,21 @@ class Signer extends core_1.ccc.SignerBtc {
75
74
  }
76
75
  /**
77
76
  * Gets the Bitcoin account address.
78
- * @returns {Promise<string>} A promise that resolves to the Bitcoin account address.
77
+ * @returns A promise that resolves to the Bitcoin account address.
79
78
  */
80
79
  async getBtcAccount() {
81
80
  return (await this.provider.getAccounts())[0];
82
81
  }
83
82
  /**
84
83
  * Gets the Bitcoin public key.
85
- * @returns {Promise<ccc.Hex>} A promise that resolves to the Bitcoin public key.
84
+ * @returns A promise that resolves to the Bitcoin public key.
86
85
  */
87
86
  async getBtcPublicKey() {
88
87
  return core_1.ccc.hexFrom(await this.provider.getPublicKey());
89
88
  }
90
89
  /**
91
90
  * Connects to the provider by requesting accounts.
92
- * @returns {Promise<void>} A promise that resolves when the connection is established.
91
+ * @returns A promise that resolves when the connection is established.
93
92
  */
94
93
  async connect() {
95
94
  await this.provider.requestAccounts();
@@ -111,7 +110,7 @@ class Signer extends core_1.ccc.SignerBtc {
111
110
  }
112
111
  /**
113
112
  * Checks if the signer is connected.
114
- * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
113
+ * @returns A promise that resolves to true if connected, false otherwise.
115
114
  */
116
115
  async isConnected() {
117
116
  if (await this._getNetworkToChange()) {
@@ -121,8 +120,8 @@ class Signer extends core_1.ccc.SignerBtc {
121
120
  }
122
121
  /**
123
122
  * Signs a raw message with the Bitcoin account.
124
- * @param {string | ccc.BytesLike} message - The message to sign.
125
- * @returns {Promise<string>} A promise that resolves to the signed message.
123
+ * @param message - The message to sign.
124
+ * @returns A promise that resolves to the signed message.
126
125
  */
127
126
  async signMessageRaw(message) {
128
127
  const challenge = typeof message === "string" ? message : core_1.ccc.hexFrom(message).slice(2);
@@ -1,8 +1,10 @@
1
1
  import { ccc } from "@ckb-ccc/core";
2
2
  /**
3
3
  * Retrieves the UniSat signer if available.
4
- * @param {ccc.Client} client - The client instance.
5
- * @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
4
+ * @public
5
+ *
6
+ * @param client - The client instance.
7
+ * @returns The Signer instance if the UniSat provider is available, otherwise undefined.
6
8
  */
7
9
  export declare function getUniSatSigners(client: ccc.Client, preferredNetworks?: ccc.NetworkPreference[]): ccc.SignerInfo[];
8
10
  //# sourceMappingURL=signersFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,GAC1C,GAAG,CAAC,UAAU,EAAE,CAalB"}
1
+ {"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,GAC1C,GAAG,CAAC,UAAU,EAAE,CAalB"}
@@ -4,8 +4,10 @@ exports.getUniSatSigners = void 0;
4
4
  const signer_js_1 = require("./signer.js");
5
5
  /**
6
6
  * Retrieves the UniSat signer if available.
7
- * @param {ccc.Client} client - The client instance.
8
- * @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
7
+ * @public
8
+ *
9
+ * @param client - The client instance.
10
+ * @returns The Signer instance if the UniSat provider is available, otherwise undefined.
9
11
  */
10
12
  function getUniSatSigners(client, preferredNetworks) {
11
13
  const windowRef = window;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckb-ccc/uni-sat",
3
- "version": "0.0.12-alpha.1",
3
+ "version": "0.0.13-alpha.0",
4
4
  "description": "CCC - CKBer's Codebase. Common Chains Connector's support for UniSat",
5
5
  "author": "Hanssen0 <hanssen0@hanssen0.com>",
6
6
  "license": "MIT",
@@ -30,11 +30,6 @@
30
30
  "default": "./dist.commonjs/advancedBarrel.js"
31
31
  }
32
32
  },
33
- "scripts": {
34
- "build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .",
35
- "lint": "eslint",
36
- "format": "prettier --write . && eslint --fix"
37
- },
38
33
  "devDependencies": {
39
34
  "@eslint/js": "^9.1.1",
40
35
  "copyfiles": "^2.4.1",
@@ -51,7 +46,11 @@
51
46
  "access": "public"
52
47
  },
53
48
  "dependencies": {
54
- "@ckb-ccc/core": "0.0.12-alpha.1"
49
+ "@ckb-ccc/core": "0.0.13-alpha.0"
55
50
  },
56
- "gitHead": "22b1e1e4c7e56c8a6e9f699f54193cbec7d30a8b"
57
- }
51
+ "scripts": {
52
+ "build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .",
53
+ "lint": "eslint",
54
+ "format": "prettier --write . && eslint --fix"
55
+ }
56
+ }
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Interface representing a provider for interacting with accounts and signing messages.
3
- * @interface
4
3
  */
5
4
  export interface Provider {
6
5
  /**
7
6
  * Requests user accounts.
8
- * @returns {Promise<string[]>} A promise that resolves to an array of account addresses.
7
+ * @returns A promise that resolves to an array of account addresses.
9
8
  */
10
9
  requestAccounts(): Promise<string[]>;
11
10
 
@@ -35,35 +34,34 @@ export interface Provider {
35
34
 
36
35
  /**
37
36
  * Gets the current accounts.
38
- * @returns {Promise<string[]>} A promise that resolves to an array of account addresses.
37
+ * @returns A promise that resolves to an array of account addresses.
39
38
  */
40
39
  getAccounts(): Promise<string[]>;
41
40
 
42
41
  /**
43
42
  * Gets the public key of the account.
44
- * @returns {Promise<string>} A promise that resolves to the public key.
43
+ * @returns A promise that resolves to the public key.
45
44
  */
46
45
  getPublicKey(): Promise<string>;
47
46
 
48
47
  /**
49
48
  * Signs a message with the specified type.
50
- * @param {string} msg - The message to sign.
51
- * @param {"ecdsa" | "bip322-simple"} type - The type of signature.
52
- * @returns {Promise<string>} A promise that resolves to the signed message.
49
+ * @param msg - The message to sign.
50
+ * @param type - The type of signature.
51
+ * @returns A promise that resolves to the signed message.
53
52
  */
54
53
  signMessage(msg: string, type: "ecdsa" | "bip322-simple"): Promise<string>;
55
54
 
56
55
  /**
57
56
  * Adds an event listener to the provider.
58
- * @type {OnMethod}
59
57
  */
60
58
  on: OnMethod;
61
59
 
62
60
  /**
63
61
  * Removes an event listener from the provider.
64
- * @param {string} eventName - The name of the event to remove the listener from.
65
- * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.
66
- * @returns {Provider} The provider instance.
62
+ * @param eventName - The name of the event to remove the listener from.
63
+ * @param listener - The listener function to remove.
64
+ * @returns The provider instance.
67
65
  */
68
66
  removeListener(
69
67
  eventName: string,
@@ -73,14 +71,13 @@ export interface Provider {
73
71
 
74
72
  /**
75
73
  * Interface representing a method to add event listeners to the provider.
76
- * @interface
77
74
  */
78
75
  export interface OnMethod {
79
76
  /**
80
77
  * Adds an event listener to the provider.
81
- * @param {string} eventName - The name of the event.
82
- * @param {(...args: unknown[]) => unknown} listener - The listener function.
83
- * @returns {Provider} The provider instance.
78
+ * @param eventName - The name of the event.
79
+ * @param listener - The listener function.
80
+ * @returns The provider instance.
84
81
  */
85
82
  (eventName: string, listener: (...args: unknown[]) => unknown): Provider;
86
83
  }
package/src/signer.ts CHANGED
@@ -2,15 +2,14 @@ import { ccc } from "@ckb-ccc/core";
2
2
  import { Provider } from "./advancedBarrel.js";
3
3
 
4
4
  /**
5
- * Class representing a Bitcoin signer that extends SignerBtc from @ckb-ccc/core.
6
- * @class
7
- * @extends {ccc.SignerBtc}
5
+ * Class representing a Bitcoin signer that extends SignerBtc
6
+ * @public
8
7
  */
9
8
  export class Signer extends ccc.SignerBtc {
10
9
  /**
11
10
  * Creates an instance of Signer.
12
- * @param {ccc.Client} client - The client instance.
13
- * @param {Provider} provider - The provider instance.
11
+ * @param client - The client instance.
12
+ * @param provider - The provider instance.
14
13
  */
15
14
  constructor(
16
15
  client: ccc.Client,
@@ -89,7 +88,7 @@ export class Signer extends ccc.SignerBtc {
89
88
 
90
89
  /**
91
90
  * Gets the Bitcoin account address.
92
- * @returns {Promise<string>} A promise that resolves to the Bitcoin account address.
91
+ * @returns A promise that resolves to the Bitcoin account address.
93
92
  */
94
93
  async getBtcAccount(): Promise<string> {
95
94
  return (await this.provider.getAccounts())[0];
@@ -97,7 +96,7 @@ export class Signer extends ccc.SignerBtc {
97
96
 
98
97
  /**
99
98
  * Gets the Bitcoin public key.
100
- * @returns {Promise<ccc.Hex>} A promise that resolves to the Bitcoin public key.
99
+ * @returns A promise that resolves to the Bitcoin public key.
101
100
  */
102
101
  async getBtcPublicKey(): Promise<ccc.Hex> {
103
102
  return ccc.hexFrom(await this.provider.getPublicKey());
@@ -105,7 +104,7 @@ export class Signer extends ccc.SignerBtc {
105
104
 
106
105
  /**
107
106
  * Connects to the provider by requesting accounts.
108
- * @returns {Promise<void>} A promise that resolves when the connection is established.
107
+ * @returns A promise that resolves when the connection is established.
109
108
  */
110
109
  async connect(): Promise<void> {
111
110
  await this.provider.requestAccounts();
@@ -131,7 +130,7 @@ export class Signer extends ccc.SignerBtc {
131
130
 
132
131
  /**
133
132
  * Checks if the signer is connected.
134
- * @returns {Promise<boolean>} A promise that resolves to true if connected, false otherwise.
133
+ * @returns A promise that resolves to true if connected, false otherwise.
135
134
  */
136
135
  async isConnected(): Promise<boolean> {
137
136
  if (await this._getNetworkToChange()) {
@@ -142,8 +141,8 @@ export class Signer extends ccc.SignerBtc {
142
141
 
143
142
  /**
144
143
  * Signs a raw message with the Bitcoin account.
145
- * @param {string | ccc.BytesLike} message - The message to sign.
146
- * @returns {Promise<string>} A promise that resolves to the signed message.
144
+ * @param message - The message to sign.
145
+ * @returns A promise that resolves to the signed message.
147
146
  */
148
147
  async signMessageRaw(message: string | ccc.BytesLike): Promise<string> {
149
148
  const challenge =
@@ -4,8 +4,10 @@ import { Signer } from "./signer.js";
4
4
 
5
5
  /**
6
6
  * Retrieves the UniSat signer if available.
7
- * @param {ccc.Client} client - The client instance.
8
- * @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
7
+ * @public
8
+ *
9
+ * @param client - The client instance.
10
+ * @returns The Signer instance if the UniSat provider is available, otherwise undefined.
9
11
  */
10
12
  export function getUniSatSigners(
11
13
  client: ccc.Client,
package/typedoc.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://typedoc.org/schema.json",
3
+ "entryPoints": ["./src/index.ts", "./src/advanced.ts"],
4
+ "extends": ["../../typedoc.base.json"],
5
+ "name": "@ckb-ccc uni-sat"
6
+ }