@ckb-ccc/okx 0.0.11-alpha.3 → 0.0.12-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/dist/signersFactory.d.ts +1 -1
- package/dist/signersFactory.d.ts.map +1 -1
- package/dist/signersFactory.js +9 -3
- package/dist.commonjs/signersFactory.d.ts +1 -1
- package/dist.commonjs/signersFactory.d.ts.map +1 -1
- package/dist.commonjs/signersFactory.js +11 -5
- package/package.json +5 -5
- package/src/signersFactory.ts +11 -5
package/dist/signersFactory.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ import { ccc } from "@ckb-ccc/core";
|
|
|
4
4
|
* @param {ccc.Client} client - The client instance.
|
|
5
5
|
* @returns {BitcoinSigner | undefined} The BitcoinSigner instance if the OKX wallet is available, otherwise undefined.
|
|
6
6
|
*/
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function getOKXSigners(client: ccc.Client, preferredNetworks?: ccc.NetworkPreference[]): ccc.SignerInfo[];
|
|
8
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;AAKpC;;;;GAIG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAKpC;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,GAC1C,GAAG,CAAC,UAAU,EAAE,CAmBlB"}
|
package/dist/signersFactory.js
CHANGED
|
@@ -5,13 +5,19 @@ import { NostrSigner } from "./nostr/index.js";
|
|
|
5
5
|
* @param {ccc.Client} client - The client instance.
|
|
6
6
|
* @returns {BitcoinSigner | undefined} The BitcoinSigner instance if the OKX wallet is available, otherwise undefined.
|
|
7
7
|
*/
|
|
8
|
-
export function
|
|
8
|
+
export function getOKXSigners(client, preferredNetworks) {
|
|
9
9
|
const windowRef = window;
|
|
10
10
|
if (typeof windowRef.okxwallet === "undefined") {
|
|
11
11
|
return [];
|
|
12
12
|
}
|
|
13
13
|
return [
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
{
|
|
15
|
+
signer: new BitcoinSigner(client, windowRef.okxwallet, preferredNetworks),
|
|
16
|
+
name: "BTC",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
signer: new NostrSigner(client, windowRef.okxwallet.nostr),
|
|
20
|
+
name: "Nostr",
|
|
21
|
+
},
|
|
16
22
|
];
|
|
17
23
|
}
|
|
@@ -4,5 +4,5 @@ import { ccc } from "@ckb-ccc/core";
|
|
|
4
4
|
* @param {ccc.Client} client - The client instance.
|
|
5
5
|
* @returns {BitcoinSigner | undefined} The BitcoinSigner instance if the OKX wallet is available, otherwise undefined.
|
|
6
6
|
*/
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function getOKXSigners(client: ccc.Client, preferredNetworks?: ccc.NetworkPreference[]): ccc.SignerInfo[];
|
|
8
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;AAKpC;;;;GAIG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAKpC;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,EAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,GAC1C,GAAG,CAAC,UAAU,EAAE,CAmBlB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getOKXSigners = void 0;
|
|
4
4
|
const index_js_1 = require("./btc/index.js");
|
|
5
5
|
const index_js_2 = require("./nostr/index.js");
|
|
6
6
|
/**
|
|
@@ -8,14 +8,20 @@ const index_js_2 = require("./nostr/index.js");
|
|
|
8
8
|
* @param {ccc.Client} client - The client instance.
|
|
9
9
|
* @returns {BitcoinSigner | undefined} The BitcoinSigner instance if the OKX wallet is available, otherwise undefined.
|
|
10
10
|
*/
|
|
11
|
-
function
|
|
11
|
+
function getOKXSigners(client, preferredNetworks) {
|
|
12
12
|
const windowRef = window;
|
|
13
13
|
if (typeof windowRef.okxwallet === "undefined") {
|
|
14
14
|
return [];
|
|
15
15
|
}
|
|
16
16
|
return [
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
{
|
|
18
|
+
signer: new index_js_1.BitcoinSigner(client, windowRef.okxwallet, preferredNetworks),
|
|
19
|
+
name: "BTC",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
signer: new index_js_2.NostrSigner(client, windowRef.okxwallet.nostr),
|
|
23
|
+
name: "Nostr",
|
|
24
|
+
},
|
|
19
25
|
];
|
|
20
26
|
}
|
|
21
|
-
exports.
|
|
27
|
+
exports.getOKXSigners = getOKXSigners;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/okx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12-alpha.0",
|
|
4
4
|
"description": "CCC - CKBer's Codebase. Common Chains Connector's support for OKX",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@ckb-ccc/core": "0.0.
|
|
47
|
-
"@ckb-ccc/nip07": "0.0.
|
|
48
|
-
"@ckb-ccc/uni-sat": "0.0.
|
|
46
|
+
"@ckb-ccc/core": "0.0.12-alpha.0",
|
|
47
|
+
"@ckb-ccc/nip07": "0.0.12-alpha.0",
|
|
48
|
+
"@ckb-ccc/uni-sat": "0.0.12-alpha.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "171a9941a56575dd5db2e3fad21d04bff8ec3fc5"
|
|
51
51
|
}
|
package/src/signersFactory.ts
CHANGED
|
@@ -8,10 +8,10 @@ import { NostrSigner } from "./nostr/index.js";
|
|
|
8
8
|
* @param {ccc.Client} client - The client instance.
|
|
9
9
|
* @returns {BitcoinSigner | undefined} The BitcoinSigner instance if the OKX wallet is available, otherwise undefined.
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
11
|
+
export function getOKXSigners(
|
|
12
12
|
client: ccc.Client,
|
|
13
|
-
preferredNetworks
|
|
14
|
-
): ccc.
|
|
13
|
+
preferredNetworks?: ccc.NetworkPreference[],
|
|
14
|
+
): ccc.SignerInfo[] {
|
|
15
15
|
const windowRef = window as {
|
|
16
16
|
okxwallet?: Record<string, BitcoinProvider> & { nostr: NostrProvider };
|
|
17
17
|
};
|
|
@@ -21,7 +21,13 @@ export function getOKXBitcoinSigner(
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
return [
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
{
|
|
25
|
+
signer: new BitcoinSigner(client, windowRef.okxwallet, preferredNetworks),
|
|
26
|
+
name: "BTC",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
signer: new NostrSigner(client, windowRef.okxwallet.nostr),
|
|
30
|
+
name: "Nostr",
|
|
31
|
+
},
|
|
26
32
|
];
|
|
27
33
|
}
|