@ckb-ccc/okx 0.0.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.
- package/dist/advanced.d.ts +4 -0
- package/dist/advanced.d.ts.map +1 -0
- package/dist/advanced.js +1 -0
- package/dist/barrel.d.ts +3 -0
- package/dist/barrel.d.ts.map +1 -0
- package/dist/barrel.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/signer.d.ts +8 -0
- package/dist/signer.d.ts.map +1 -0
- package/dist/signer.js +7 -0
- package/dist/signersFactory.d.ts +3 -0
- package/dist/signersFactory.d.ts.map +1 -0
- package/dist/signersFactory.js +8 -0
- package/package.json +42 -0
- package/src/advanced.ts +3 -0
- package/src/barrel.ts +2 -0
- package/src/index.ts +1 -0
- package/src/signer.ts +12 -0
- package/src/signersFactory.ts +15 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../src/advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,QAAQ;CAAG"}
|
package/dist/advanced.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/barrel.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"barrel.d.ts","sourceRoot":"","sources":["../src/barrel.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
|
package/dist/barrel.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Okx from "./barrel";
|
package/dist/signer.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ccc } from "@ckb-ccc/core";
|
|
2
|
+
import { UniSat } from "@ckb-ccc/uni-sat";
|
|
3
|
+
import { BitcoinProvider } from "./advanced";
|
|
4
|
+
export declare class BitcoinSigner extends UniSat.Signer {
|
|
5
|
+
readonly provider: BitcoinProvider;
|
|
6
|
+
constructor(client: ccc.Client, provider: BitcoinProvider);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=signer.d.ts.map
|
|
@@ -0,0 +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,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,qBAAa,aAAc,SAAQ,MAAM,CAAC,MAAM;aAG5B,QAAQ,EAAE,eAAe;gBADzC,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,eAAe;CAI5C"}
|
package/dist/signer.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,GAAG,CAAC,MAAM,GACjB,GAAG,CAAC,MAAM,GAAG,SAAS,CAQxB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ckb-ccc/okx",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Common Chains Connector's support for OKX",
|
|
5
|
+
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"private": false,
|
|
8
|
+
"homepage": "https://github.com/Hanssen0/ccc",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git://github.com/Hanssen0/ccc.git"
|
|
12
|
+
},
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./dist/index.js",
|
|
16
|
+
"./advanced": "./dist/advanced.js"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "rimraf ./dist && tsc",
|
|
20
|
+
"lint": "eslint",
|
|
21
|
+
"format": "prettier --write . && eslint --fix"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@eslint/js": "^9.1.1",
|
|
25
|
+
"eslint": "^9.1.0",
|
|
26
|
+
"eslint-config-prettier": "^9.1.0",
|
|
27
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
28
|
+
"prettier": "^3.2.5",
|
|
29
|
+
"prettier-plugin-organize-imports": "^3.2.4",
|
|
30
|
+
"rimraf": "^5.0.5",
|
|
31
|
+
"typescript": "^5.4.5",
|
|
32
|
+
"typescript-eslint": "^7.7.0"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@ckb-ccc/core": "0.0.3",
|
|
39
|
+
"@ckb-ccc/uni-sat": "0.0.3"
|
|
40
|
+
},
|
|
41
|
+
"gitHead": "9df1bbe0007136568914d8a73fe39f898d636a12"
|
|
42
|
+
}
|
package/src/advanced.ts
ADDED
package/src/barrel.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Okx from "./barrel";
|
package/src/signer.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ccc } from "@ckb-ccc/core";
|
|
2
|
+
import { UniSat } from "@ckb-ccc/uni-sat";
|
|
3
|
+
import { BitcoinProvider } from "./advanced";
|
|
4
|
+
|
|
5
|
+
export class BitcoinSigner extends UniSat.Signer {
|
|
6
|
+
constructor(
|
|
7
|
+
client: ccc.Client,
|
|
8
|
+
public readonly provider: BitcoinProvider,
|
|
9
|
+
) {
|
|
10
|
+
super(client, provider);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ccc } from "@ckb-ccc/core";
|
|
2
|
+
import { BitcoinProvider } from "./advanced";
|
|
3
|
+
import { BitcoinSigner } from "./signer";
|
|
4
|
+
|
|
5
|
+
export function getOKXBitcoinSigner(
|
|
6
|
+
client: ccc.Client,
|
|
7
|
+
): ccc.Signer | undefined {
|
|
8
|
+
const windowRef = window as { okxwallet?: { bitcoin: BitcoinProvider } };
|
|
9
|
+
|
|
10
|
+
if (typeof windowRef.okxwallet === "undefined") {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return new BitcoinSigner(client, windowRef.okxwallet.bitcoin);
|
|
15
|
+
}
|