@reef-knot/wallet-adapter-okx 1.3.0 → 1.4.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/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -13
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WalletAdapterType } from '@reef-knot/types';
|
|
2
|
-
import { Ethereum as EthereumTypeWagmi } from '@wagmi/core';
|
|
2
|
+
import { Ethereum as EthereumTypeWagmi, Chain } from '@wagmi/core';
|
|
3
|
+
import { InjectedConnector } from 'wagmi/connectors/injected';
|
|
3
4
|
declare module '@wagmi/core' {
|
|
4
5
|
interface Ethereum {
|
|
5
6
|
isOkxWallet?: true;
|
|
@@ -10,5 +11,12 @@ declare global {
|
|
|
10
11
|
okxwallet?: EthereumTypeWagmi;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
14
|
+
export declare const id = "okx";
|
|
15
|
+
export declare const name = "OKX Wallet";
|
|
16
|
+
export declare class OkxConnector extends InjectedConnector {
|
|
17
|
+
readonly id = "okx";
|
|
18
|
+
readonly name = "OKX Wallet";
|
|
19
|
+
constructor(chains: Chain[]);
|
|
20
|
+
}
|
|
13
21
|
export declare const Okx: WalletAdapterType;
|
|
14
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAI9D,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAU,QAAQ;QAChB,WAAW,CAAC,EAAE,IAAI,CAAC;KACpB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,CAAC,EAAE,iBAAiB,CAAC;KAC/B;CACF;AAED,eAAO,MAAM,EAAE,QAAQ,CAAC;AACxB,eAAO,MAAM,IAAI,eAAe,CAAC;AAEjC,qBAAa,YAAa,SAAQ,iBAAiB;IACjD,QAAQ,CAAC,EAAE,SAAM;IACjB,QAAQ,CAAC,IAAI,gBAAQ;gBACT,MAAM,EAAE,KAAK,EAAE;CAS5B;AAED,eAAO,MAAM,GAAG,EAAE,iBAchB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,28 @@ import { InjectedConnector } from 'wagmi/connectors/injected';
|
|
|
2
2
|
import Memo from './icons/okx.svg.js';
|
|
3
3
|
import Memo$1 from './icons/okx-inverted.svg.js';
|
|
4
4
|
|
|
5
|
+
const id = 'okx';
|
|
6
|
+
const name = 'OKX Wallet';
|
|
7
|
+
class OkxConnector extends InjectedConnector {
|
|
8
|
+
constructor(chains) {
|
|
9
|
+
super({
|
|
10
|
+
chains,
|
|
11
|
+
options: {
|
|
12
|
+
getProvider: () => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return ((_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.okxwallet) || ((_b = globalThis.window) === null || _b === void 0 ? void 0 : _b.ethereum);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
this.id = id;
|
|
19
|
+
this.name = name;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
5
22
|
const Okx = ({
|
|
6
23
|
chains
|
|
7
24
|
}) => ({
|
|
8
|
-
walletName:
|
|
9
|
-
walletId:
|
|
25
|
+
walletName: name,
|
|
26
|
+
walletId: id,
|
|
10
27
|
icon: {
|
|
11
28
|
light: Memo,
|
|
12
29
|
dark: Memo$1
|
|
@@ -18,16 +35,7 @@ const Okx = ({
|
|
|
18
35
|
downloadURLs: {
|
|
19
36
|
default: 'https://www.okx.com/download'
|
|
20
37
|
},
|
|
21
|
-
connector: new
|
|
22
|
-
chains,
|
|
23
|
-
options: {
|
|
24
|
-
name: 'OKX Wallet',
|
|
25
|
-
getProvider: () => {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
return ((_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.okxwallet) || ((_b = globalThis.window) === null || _b === void 0 ? void 0 : _b.ethereum);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
})
|
|
38
|
+
connector: new OkxConnector(chains)
|
|
31
39
|
});
|
|
32
40
|
|
|
33
|
-
export { Okx };
|
|
41
|
+
export { Okx, OkxConnector, id, name };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reef-knot/wallet-adapter-okx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -29,11 +29,12 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "rollup -c",
|
|
31
31
|
"dev": "dev=on rollup -c -w",
|
|
32
|
-
"lint": "eslint"
|
|
32
|
+
"lint": "eslint --ext ts,tsx,js,mjs ."
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@reef-knot/types": "^1.
|
|
36
|
-
"@svgr/rollup": "^6.5.1"
|
|
35
|
+
"@reef-knot/types": "^1.6.0",
|
|
36
|
+
"@svgr/rollup": "^6.5.1",
|
|
37
|
+
"eslint-config-custom": "*"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"wagmi": "^0.12.19",
|