@reef-knot/wallet-adapter-okx 1.3.0 → 1.3.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/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,10 @@ declare global {
10
11
  okxwallet?: EthereumTypeWagmi;
11
12
  }
12
13
  }
14
+ export declare class OkxConnector extends InjectedConnector {
15
+ readonly id = "okx";
16
+ readonly name = "OKX Wallet";
17
+ constructor(chains: Chain[]);
18
+ }
13
19
  export declare const Okx: WalletAdapterType;
14
20
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAK5D,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,GAAG,EAAE,iBAqBhB,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,qBAAa,YAAa,SAAQ,iBAAiB;IACjD,QAAQ,CAAC,EAAE,SAAS;IACpB,QAAQ,CAAC,IAAI,gBAAgB;gBACjB,MAAM,EAAE,KAAK,EAAE;CAS5B;AAED,eAAO,MAAM,GAAG,EAAE,iBAchB,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,21 @@ 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
+ class OkxConnector extends InjectedConnector {
6
+ constructor(chains) {
7
+ super({
8
+ chains,
9
+ options: {
10
+ getProvider: () => {
11
+ var _a, _b;
12
+ return ((_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.okxwallet) || ((_b = globalThis.window) === null || _b === void 0 ? void 0 : _b.ethereum);
13
+ }
14
+ }
15
+ });
16
+ this.id = 'okx';
17
+ this.name = 'OKX Wallet';
18
+ }
19
+ }
5
20
  const Okx = ({
6
21
  chains
7
22
  }) => ({
@@ -18,16 +33,7 @@ const Okx = ({
18
33
  downloadURLs: {
19
34
  default: 'https://www.okx.com/download'
20
35
  },
21
- connector: new InjectedConnector({
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
- })
36
+ connector: new OkxConnector(chains)
31
37
  });
32
38
 
33
- export { Okx };
39
+ export { Okx, OkxConnector };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reef-knot/wallet-adapter-okx",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
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
35
  "@reef-knot/types": "^1.3.0",
36
- "@svgr/rollup": "^6.5.1"
36
+ "@svgr/rollup": "^6.5.1",
37
+ "eslint-config-custom": "*"
37
38
  },
38
39
  "peerDependencies": {
39
40
  "wagmi": "^0.12.19",