@ckb-ccc/uni-sat 0.0.4-alpha.1 → 0.0.4-alpha.12

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/README.md CHANGED
@@ -1,12 +1,17 @@
1
- <h1 align="center" style="font-size: 64px;">
2
- CCC
1
+ <h1 align="center" style="font-size: 48px;">
2
+ CCC's support for UniSat
3
3
  </h1>
4
4
 
5
5
  <p align="center">
6
- <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/ckb-ecofund/ccc">
7
- <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/ckb-ecofund/ccc/master">
8
- <img alt="GitHub deployments" src="https://img.shields.io/github/deployments/ckb-ecofund/ccc/production">
9
- <img alt="Demo" src="https://img.shields.io/website?url=https%3A%2F%2Fckbccc-demo.vercel.app%2F&label=Demo">
6
+ <a href="https://www.npmjs.com/package/@ckb-ccc/uni-sat"><img
7
+ alt="NPM Version" src="https://img.shields.io/npm/v/%40ckb-ccc%2uni-sat"
8
+ /></a>
9
+ <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/ckb-ecofund/ccc" />
10
+ <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/ckb-ecofund/ccc/master" />
11
+ <img alt="GitHub deployments" src="https://img.shields.io/github/deployments/ckb-ecofund/ccc/production" />
12
+ <a href="https://ckbccc-demo.vercel.app/"><img
13
+ alt="Demo" src="https://img.shields.io/website?url=https%3A%2F%2Fckbccc-demo.vercel.app%2F&label=Demo"
14
+ /></a>
10
15
  </p>
11
16
 
12
17
  <p align="center">
@@ -29,4 +34,4 @@ This project is still under active development, and we are looking forward to yo
29
34
 
30
35
  <h3 align="center">
31
36
  Read more about CCC on its <a href="https://github.com/ckb-ecofund/ccc">GitHub Repo</a>.
32
- </h3>
37
+ </h3>
package/dist/signer.d.ts CHANGED
@@ -3,9 +3,11 @@ import { Provider } from "./uni-sat.advanced";
3
3
  export declare class Signer extends ccc.SignerBtc {
4
4
  readonly provider: Provider;
5
5
  constructor(client: ccc.Client, provider: Provider);
6
+ replaceClient(client: ccc.Client): Promise<Signer>;
6
7
  getBtcAccount(): Promise<string>;
7
8
  getBtcPublicKey(): Promise<ccc.Hex>;
8
9
  connect(): Promise<void>;
10
+ isConnected(): Promise<boolean>;
9
11
  signMessage(message: string | ccc.BytesLike): Promise<string>;
10
12
  }
11
13
  //# sourceMappingURL=signer.d.ts.map
@@ -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,oBAAoB,CAAC;AAE9C,qBAAa,MAAO,SAAQ,GAAG,CAAC,SAAS;aAGrB,QAAQ,EAAE,QAAQ;gBADlC,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ;IAK9B,aAAa;IAIb,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAInC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAMpE"}
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,oBAAoB,CAAC;AAE9C,qBAAa,MAAO,SAAQ,GAAG,CAAC,SAAS;aAGrB,QAAQ,EAAE,QAAQ;gBADlC,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ;IAK9B,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIlD,aAAa;IAIb,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAInC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAMpE"}
package/dist/signer.js CHANGED
@@ -4,6 +4,9 @@ export class Signer extends ccc.SignerBtc {
4
4
  super(client);
5
5
  this.provider = provider;
6
6
  }
7
+ async replaceClient(client) {
8
+ return new Signer(client, this.provider);
9
+ }
7
10
  async getBtcAccount() {
8
11
  return (await this.provider.getAccounts())[0];
9
12
  }
@@ -13,6 +16,9 @@ export class Signer extends ccc.SignerBtc {
13
16
  async connect() {
14
17
  await this.provider.requestAccounts();
15
18
  }
19
+ async isConnected() {
20
+ return (await this.provider.getAccounts()).length !== 0;
21
+ }
16
22
  async signMessage(message) {
17
23
  const challenge = typeof message === "string" ? message : ccc.hexFrom(message).slice(2);
18
24
  return this.provider.signMessage(challenge, "ecdsa");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckb-ccc/uni-sat",
3
- "version": "0.0.4-alpha.1",
3
+ "version": "0.0.4-alpha.12",
4
4
  "description": "Common Chains Connector's support for UniSat",
5
5
  "author": "Hanssen0 <hanssen0@hanssen0.com>",
6
6
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@ckb-ccc/core": "0.0.4-alpha.1"
38
+ "@ckb-ccc/core": "0.0.4-alpha.12"
39
39
  },
40
- "gitHead": "7dab1a1d6e3e380b26f43d0d0308bd4da1617029"
40
+ "gitHead": "270afe883a672affe1d9058a843c21255e870e3c"
41
41
  }
package/src/signer.ts CHANGED
@@ -9,6 +9,10 @@ export class Signer extends ccc.SignerBtc {
9
9
  super(client);
10
10
  }
11
11
 
12
+ async replaceClient(client: ccc.Client): Promise<Signer> {
13
+ return new Signer(client, this.provider);
14
+ }
15
+
12
16
  async getBtcAccount() {
13
17
  return (await this.provider.getAccounts())[0];
14
18
  }
@@ -21,6 +25,10 @@ export class Signer extends ccc.SignerBtc {
21
25
  await this.provider.requestAccounts();
22
26
  }
23
27
 
28
+ async isConnected(): Promise<boolean> {
29
+ return (await this.provider.getAccounts()).length !== 0;
30
+ }
31
+
24
32
  async signMessage(message: string | ccc.BytesLike): Promise<string> {
25
33
  const challenge =
26
34
  typeof message === "string" ? message : ccc.hexFrom(message).slice(2);