@ckb-ccc/uni-sat 0.0.11-alpha.3 → 0.0.12-alpha.1
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/dist/signersFactory.d.ts +1 -2
- package/dist/signersFactory.d.ts.map +1 -1
- package/dist/signersFactory.js +8 -3
- package/dist.commonjs/signersFactory.d.ts +1 -2
- package/dist.commonjs/signersFactory.d.ts.map +1 -1
- package/dist.commonjs/signersFactory.js +10 -5
- package/package.json +3 -3
- package/src/signersFactory.ts +10 -5
package/dist/signersFactory.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/core";
|
|
2
|
-
import { Signer } from "./signer.js";
|
|
3
2
|
/**
|
|
4
3
|
* Retrieves the UniSat signer if available.
|
|
5
4
|
* @param {ccc.Client} client - The client instance.
|
|
6
5
|
* @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
|
|
7
6
|
*/
|
|
8
|
-
export declare function
|
|
7
|
+
export declare function getUniSatSigners(client: ccc.Client, preferredNetworks?: ccc.NetworkPreference[]): ccc.SignerInfo[];
|
|
9
8
|
//# 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;
|
|
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"}
|
package/dist/signersFactory.js
CHANGED
|
@@ -4,10 +4,15 @@ import { Signer } from "./signer.js";
|
|
|
4
4
|
* @param {ccc.Client} client - The client instance.
|
|
5
5
|
* @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function getUniSatSigners(client, preferredNetworks) {
|
|
8
8
|
const windowRef = window;
|
|
9
9
|
if (typeof windowRef.unisat === "undefined") {
|
|
10
|
-
return
|
|
10
|
+
return [];
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
signer: new Signer(client, windowRef.unisat, preferredNetworks),
|
|
15
|
+
name: "BTC",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
13
18
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ccc } from "@ckb-ccc/core";
|
|
2
|
-
import { Signer } from "./signer.js";
|
|
3
2
|
/**
|
|
4
3
|
* Retrieves the UniSat signer if available.
|
|
5
4
|
* @param {ccc.Client} client - The client instance.
|
|
6
5
|
* @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
|
|
7
6
|
*/
|
|
8
|
-
export declare function
|
|
7
|
+
export declare function getUniSatSigners(client: ccc.Client, preferredNetworks?: ccc.NetworkPreference[]): ccc.SignerInfo[];
|
|
9
8
|
//# 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;
|
|
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,17 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getUniSatSigners = void 0;
|
|
4
4
|
const signer_js_1 = require("./signer.js");
|
|
5
5
|
/**
|
|
6
6
|
* Retrieves the UniSat signer if available.
|
|
7
7
|
* @param {ccc.Client} client - The client instance.
|
|
8
8
|
* @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
|
|
9
9
|
*/
|
|
10
|
-
function
|
|
10
|
+
function getUniSatSigners(client, preferredNetworks) {
|
|
11
11
|
const windowRef = window;
|
|
12
12
|
if (typeof windowRef.unisat === "undefined") {
|
|
13
|
-
return
|
|
13
|
+
return [];
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
signer: new signer_js_1.Signer(client, windowRef.unisat, preferredNetworks),
|
|
18
|
+
name: "BTC",
|
|
19
|
+
},
|
|
20
|
+
];
|
|
16
21
|
}
|
|
17
|
-
exports.
|
|
22
|
+
exports.getUniSatSigners = getUniSatSigners;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/uni-sat",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12-alpha.1",
|
|
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",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@ckb-ccc/core": "0.0.
|
|
54
|
+
"@ckb-ccc/core": "0.0.12-alpha.1"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "22b1e1e4c7e56c8a6e9f699f54193cbec7d30a8b"
|
|
57
57
|
}
|
package/src/signersFactory.ts
CHANGED
|
@@ -7,15 +7,20 @@ import { Signer } from "./signer.js";
|
|
|
7
7
|
* @param {ccc.Client} client - The client instance.
|
|
8
8
|
* @returns {Signer | undefined} The Signer instance if the UniSat provider is available, otherwise undefined.
|
|
9
9
|
*/
|
|
10
|
-
export function
|
|
10
|
+
export function getUniSatSigners(
|
|
11
11
|
client: ccc.Client,
|
|
12
|
-
preferredNetworks
|
|
13
|
-
):
|
|
12
|
+
preferredNetworks?: ccc.NetworkPreference[],
|
|
13
|
+
): ccc.SignerInfo[] {
|
|
14
14
|
const windowRef = window as { unisat?: Provider };
|
|
15
15
|
|
|
16
16
|
if (typeof windowRef.unisat === "undefined") {
|
|
17
|
-
return
|
|
17
|
+
return [];
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
return
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
signer: new Signer(client, windowRef.unisat, preferredNetworks),
|
|
23
|
+
name: "BTC",
|
|
24
|
+
},
|
|
25
|
+
];
|
|
21
26
|
}
|