@reef-knot/core-react 1.7.0 → 1.8.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.
@@ -1,11 +1,11 @@
1
1
  import { WalletAdapterData } from '@reef-knot/types';
2
2
  import type { Chain } from 'wagmi/chains';
3
3
  export interface GetConnectorsArgs {
4
- rpc?: Record<number, string>;
5
- walletconnectProjectId?: string;
4
+ rpc: Record<number, string>;
6
5
  chains: Chain[];
7
- defaultChain?: Chain;
6
+ defaultChain: Chain;
7
+ walletconnectProjectId?: string;
8
8
  }
9
- export declare const getWalletDataList: ({ rpc, walletconnectProjectId, chains, defaultChain, }: GetConnectorsArgs) => WalletAdapterData[];
9
+ export declare const getWalletDataList: ({ rpc, chains, defaultChain, walletconnectProjectId, }: GetConnectorsArgs) => WalletAdapterData[];
10
10
  export declare const getConnectors: (args: GetConnectorsArgs) => import("@wagmi/connectors/dist/base-84a689bb").C<any, any, any>[];
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/walletData/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAI1C,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,2DAK3B,iBAAiB,wBAenB,CAAC;AAEF,eAAO,MAAM,aAAa,SAAU,iBAAiB,sEAEpD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/walletData/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAI1C,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,EAAE,KAAK,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,iBAAiB,2DAK3B,iBAAiB,wBAwBnB,CAAC;AAEF,eAAO,MAAM,aAAa,SAAU,iBAAiB,sEAEpD,CAAC"}
@@ -3,9 +3,9 @@ import { WalletsListEthereum } from '@reef-knot/wallets-list';
3
3
  let walletDataList;
4
4
  const getWalletDataList = ({
5
5
  rpc,
6
- walletconnectProjectId,
7
6
  chains,
8
- defaultChain
7
+ defaultChain,
8
+ walletconnectProjectId
9
9
  }) => {
10
10
  const walletAdapters = Object.values(WalletsListEthereum);
11
11
  if (!walletDataList) {
@@ -13,10 +13,14 @@ const getWalletDataList = ({
13
13
  // Have to do this because WalletConnect v2 via wagmi always tries to connect
14
14
  // to the first chain in the chains array
15
15
  const sortedChains = defaultChain ? chains.sort(chain => chain.id === defaultChain.id ? -1 : 1) : chains;
16
+ if (!rpc[defaultChain.id]) {
17
+ throw 'RPC for default chain must be provided';
18
+ }
16
19
  walletDataList = walletAdapters.map(walletAdapter => walletAdapter({
17
20
  rpc,
18
- walletconnectProjectId,
19
- chains: sortedChains
21
+ chains: sortedChains,
22
+ defaultChain,
23
+ walletconnectProjectId
20
24
  }));
21
25
  }
22
26
  return walletDataList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reef-knot/core-react",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -37,18 +37,18 @@
37
37
  "lint": "eslint --ext ts,tsx,js,mjs ."
38
38
  },
39
39
  "devDependencies": {
40
- "@reef-knot/wallets-list": "^1.4.4",
41
- "@reef-knot/types": "^1.3.0",
40
+ "@reef-knot/wallets-list": "^1.10.0",
41
+ "@reef-knot/types": "^1.4.0",
42
42
  "@reef-knot/ui-react": "^1.0.7",
43
43
  "eslint-config-custom": "*",
44
- "react": "17.0.2",
44
+ "react": "18.2.0",
45
45
  "wagmi": "^0.12.19"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@reef-knot/wallets-list": "^1.4.1",
49
49
  "@reef-knot/types": "^1.2.1",
50
50
  "@reef-knot/ui-react": "^1.0.4",
51
- "react": ">=17",
51
+ "react": ">=18",
52
52
  "wagmi": "^0.12.19"
53
53
  }
54
54
  }