@reef-knot/wallet-adapter-imtoken 1.2.0 → 2.0.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 CHANGED
@@ -1,6 +1,4 @@
1
1
  import { WalletAdapterType } from '@reef-knot/types';
2
- import { InjectedConnector } from 'wagmi/connectors/injected';
3
- import { Chain } from '@wagmi/core';
4
2
  declare module '@wagmi/core' {
5
3
  interface Ethereum {
6
4
  isImToken?: true;
@@ -8,10 +6,5 @@ declare module '@wagmi/core' {
8
6
  }
9
7
  export declare const id = "imToken";
10
8
  export declare const name = "imToken";
11
- export declare class ImTokenConnector extends InjectedConnector {
12
- readonly id = "imToken";
13
- readonly name = "imToken";
14
- constructor(chains: Chain[]);
15
- }
16
9
  export declare const ImToken: WalletAdapterType;
17
10
  //# 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;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAU,QAAQ;QAChB,SAAS,CAAC,EAAE,IAAI,CAAC;KAClB;CACF;AAED,eAAO,MAAM,EAAE,YAAY,CAAC;AAC5B,eAAO,MAAM,IAAI,YAAY,CAAC;AAK9B,qBAAa,gBAAiB,SAAQ,iBAAiB;IACrD,QAAQ,CAAC,EAAE,aAAM;IACjB,QAAQ,CAAC,IAAI,aAAQ;gBACT,MAAM,EAAE,KAAK,EAAE;CAQ5B;AAED,eAAO,MAAM,OAAO,EAAE,iBAUpB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAU,QAAQ;QAChB,SAAS,CAAC,EAAE,IAAI,CAAC;KAClB;CACF;AAED,eAAO,MAAM,EAAE,YAAY,CAAC;AAC5B,eAAO,MAAM,IAAI,YAAY,CAAC;AAc9B,eAAO,MAAM,OAAO,EAAE,iBAWpB,CAAC"}
package/dist/index.js CHANGED
@@ -1,29 +1,23 @@
1
1
  import Memo from './icons/imtoken.svg.js';
2
- import { InjectedConnector } from 'wagmi/connectors/injected';
2
+ import { injected } from 'wagmi/connectors';
3
3
 
4
4
  const id = 'imToken';
5
5
  const name = 'imToken';
6
6
  const currentHref = globalThis.window ? encodeURIComponent(globalThis.window.location.href) : '';
7
- class ImTokenConnector extends InjectedConnector {
8
- constructor(chains) {
9
- super({
10
- chains,
11
- options: {
12
- getProvider: () => {
13
- var _a;
14
- return (_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.ethereum;
15
- }
16
- }
17
- });
18
- this.id = id;
19
- this.name = name;
20
- }
21
- }
22
- const ImToken = ({
23
- chains
24
- }) => ({
7
+ const getImTokenConnector = () => injected({
8
+ target: () => ({
9
+ id,
10
+ name,
11
+ provider: () => {
12
+ var _a;
13
+ return (_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.ethereum;
14
+ }
15
+ })
16
+ });
17
+ const ImToken = () => ({
25
18
  walletName: name,
26
19
  walletId: id,
20
+ type: injected.type,
27
21
  icon: Memo,
28
22
  detector: () => {
29
23
  var _a, _b;
@@ -33,7 +27,7 @@ const ImToken = ({
33
27
  downloadURLs: {
34
28
  default: 'https://token.im/download'
35
29
  },
36
- connector: new ImTokenConnector(chains)
30
+ createConnectorFn: getImTokenConnector()
37
31
  });
38
32
 
39
- export { ImToken, ImTokenConnector, id, name };
33
+ export { ImToken, id, name };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reef-knot/wallet-adapter-imtoken",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
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.0",
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.10.4",
41
+ "@reef-knot/types": "^2.0.0",
42
+ "@tanstack/react-query": "^5.29.0"
42
43
  }
43
44
  }