@reef-knot/wallet-adapter-okx 1.5.0 → 2.0.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,6 +1,5 @@
1
1
  import { WalletAdapterType } from '@reef-knot/types';
2
- import { Ethereum as EthereumTypeWagmi, Chain } from '@wagmi/core';
3
- import { InjectedConnector } from 'wagmi/connectors/injected';
2
+ import { Ethereum as EthereumTypeWagmi } from '@wagmi/core';
4
3
  declare module '@wagmi/core' {
5
4
  interface Ethereum {
6
5
  isOkxWallet?: true;
@@ -13,10 +12,5 @@ declare global {
13
12
  }
14
13
  export declare const id = "okx";
15
14
  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
- }
21
15
  export declare const Okx: WalletAdapterType;
22
16
  //# 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,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;AAQjC,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,iBAehB,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,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,EAAE,QAAQ,CAAC;AACxB,eAAO,MAAM,IAAI,eAAe,CAAC;AAkBjC,eAAO,MAAM,GAAG,EAAE,iBAgBhB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { InjectedConnector } from 'wagmi/connectors/injected';
1
+ import { injected } from 'wagmi/connectors';
2
2
  import Memo from './icons/okx.svg.js';
3
3
  import Memo$1 from './icons/okx-inverted.svg.js';
4
4
 
@@ -7,26 +7,20 @@ const name = 'OKX Wallet';
7
7
  const deeplinkDAppUrl = globalThis.window ? globalThis.window.location.host + globalThis.window.location.pathname : '';
8
8
  const deeplink = 'okx://wallet/dapp/url?dappUrl=' + deeplinkDAppUrl;
9
9
  const urlWithDeeplink = 'https://www.okx.com/download?deeplink=' + deeplink;
10
- class OkxConnector extends InjectedConnector {
11
- constructor(chains) {
12
- super({
13
- chains,
14
- options: {
15
- getProvider: () => {
16
- var _a, _b;
17
- return ((_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.okxwallet) || ((_b = globalThis.window) === null || _b === void 0 ? void 0 : _b.ethereum);
18
- }
19
- }
20
- });
21
- this.id = id;
22
- this.name = name;
23
- }
24
- }
25
- const Okx = ({
26
- chains
27
- }) => ({
10
+ const getOkxConnector = () => injected({
11
+ target: () => ({
12
+ id,
13
+ name,
14
+ provider: () => {
15
+ var _a, _b;
16
+ return ((_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.okxwallet) || ((_b = globalThis.window) === null || _b === void 0 ? void 0 : _b.ethereum);
17
+ }
18
+ })
19
+ });
20
+ const Okx = () => ({
28
21
  walletName: name,
29
22
  walletId: id,
23
+ type: injected.type,
30
24
  icon: {
31
25
  light: Memo,
32
26
  dark: Memo$1
@@ -39,7 +33,7 @@ const Okx = ({
39
33
  default: 'https://www.okx.com/download'
40
34
  },
41
35
  deeplink: urlWithDeeplink,
42
- connector: new OkxConnector(chains)
36
+ createConnectorFn: getOkxConnector()
43
37
  });
44
38
 
45
- export { Okx, OkxConnector, id, name };
39
+ export { Okx, id, name };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reef-knot/wallet-adapter-okx",
3
- "version": "1.5.0",
3
+ "version": "2.0.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -32,12 +32,13 @@
32
32
  "lint": "eslint --ext ts,tsx,js,mjs ."
33
33
  },
34
34
  "devDependencies": {
35
- "@reef-knot/types": "^1.8.0",
35
+ "@reef-knot/types": "^2.0.1",
36
36
  "@svgr/rollup": "^6.5.1",
37
37
  "eslint-config-custom": "*"
38
38
  },
39
39
  "peerDependencies": {
40
- "wagmi": "^0.12.19",
41
- "@reef-knot/types": "^1.2.1"
40
+ "wagmi": "2.11.2",
41
+ "@reef-knot/types": "^2.0.0",
42
+ "@tanstack/react-query": "^5.29.0"
42
43
  }
43
44
  }