@dynamic-labs/wagmi-connector 1.1.0-phantom.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,18 +1,159 @@
1
1
 
2
- ## [1.1.0-phantom.0](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.12...v1.1.0-phantom.0) (2024-01-22)
2
+ ## [1.1.0](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.25...v1.1.0) (2024-02-07)
3
+
4
+ Check out our changelog here: https://docs.dynamic.xyz/changelog/v1-1
5
+
6
+
7
+ ### Features
8
+
9
+ * add retry when using magic ([#4579](https://github.com/dynamic-labs/DynamicAuth/issues/4579)) ([183561c](https://github.com/dynamic-labs/DynamicAuth/commit/183561cc64f083fd1489c38a8cc8b1c4c51d2924))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * bug where deprecated fields were still being used in the SDK ([#4604](https://github.com/dynamic-labs/DynamicAuth/issues/4604)) ([4fd15fc](https://github.com/dynamic-labs/DynamicAuth/commit/4fd15fc4daa9c5b7bbc81ce05a3b046c80a6d5b4))
15
+ * log magic RPC error and update magic network error ([#4606](https://github.com/dynamic-labs/DynamicAuth/issues/4606)) ([2206961](https://github.com/dynamic-labs/DynamicAuth/commit/22069618a317bc40b1a17fd521eadf0956983de4))
16
+ * onConnect is properly called for additional connected wallets ([#4607](https://github.com/dynamic-labs/DynamicAuth/issues/4607)) ([23241f4](https://github.com/dynamic-labs/DynamicAuth/commit/23241f4d5dc91ac9ca1251710161efbfce42dc40))
17
+
18
+ ## [1.1.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.24...v1.1.0-alpha.25) (2024-02-05)
19
+
20
+
21
+ ### Features
22
+
23
+ * add signin with coinbase to sdk ([#4581](https://github.com/dynamic-labs/DynamicAuth/issues/4581)) ([08a31ed](https://github.com/dynamic-labs/DynamicAuth/commit/08a31ed3552c48645b398881f184440800af21ec))
24
+ * exposing hook for creating either one-time code or passkeys authenticators ([#4591](https://github.com/dynamic-labs/DynamicAuth/issues/4591)) ([864d755](https://github.com/dynamic-labs/DynamicAuth/commit/864d75576152a10f73f5901bc06e2d66892b63ab))
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * solana wallet sign message with one-time code session ([#4588](https://github.com/dynamic-labs/DynamicAuth/issues/4588)) ([a738d10](https://github.com/dynamic-labs/DynamicAuth/commit/a738d10814dc5058158b9c0c59a399a375c69c10))
30
+
31
+ ## [1.1.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.23...v1.1.0-alpha.24) (2024-02-02)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * remove isFullyConnected when unable to restore wallet ([#4575](https://github.com/dynamic-labs/DynamicAuth/issues/4575)) ([4504ff0](https://github.com/dynamic-labs/DynamicAuth/commit/4504ff03f594cd9a60055e6f52b7ea8001542bbe))
37
+
38
+ ## [1.1.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.22...v1.1.0-alpha.23) (2024-02-01)
39
+
40
+
41
+ ### Features
42
+
43
+ * bitcoin signPsbt ([3c964de](https://github.com/dynamic-labs/DynamicAuth/commit/3c964dea8a55debaf184c5a94f0f5fabdda3c877))
44
+ * embedded wallet email auth flow ([#4353](https://github.com/dynamic-labs/DynamicAuth/issues/4353)) ([4875da3](https://github.com/dynamic-labs/DynamicAuth/commit/4875da32c47c27facef1b1cdbdc214566bbfd171))
45
+
46
+ ## [1.1.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.21...v1.1.0-alpha.22) (2024-02-01)
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * onAuthFlowClose not being called ([#4563](https://github.com/dynamic-labs/DynamicAuth/issues/4563)) ([c4b2648](https://github.com/dynamic-labs/DynamicAuth/commit/c4b264885b7dba6e204ef49bf642d25c7d287b04))
52
+
53
+ ## [1.1.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.20...v1.1.0-alpha.21) (2024-02-01)
54
+
55
+
56
+ ### Features
57
+
58
+ * add phantom redirect handling context ([#4479](https://github.com/dynamic-labs/DynamicAuth/issues/4479)) ([e0218ee](https://github.com/dynamic-labs/DynamicAuth/commit/e0218eec1a67787f5c0e7483d542a5f773e911ef))
59
+ * add signPsbt method to bitcoin wallet connectors ([dfdc0fe](https://github.com/dynamic-labs/DynamicAuth/commit/dfdc0fe0e6894c1307b286e89b43a4c58a8808f3))
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * relax passkey feature detection check in sdk to avoid false nega… ([#4556](https://github.com/dynamic-labs/DynamicAuth/issues/4556)) ([4554f7d](https://github.com/dynamic-labs/DynamicAuth/commit/4554f7d7c5339859481cdecca95a9c07fae4ba5c))
65
+ * workaround braavos undefined selectedWallet on chainChange event ([#4552](https://github.com/dynamic-labs/DynamicAuth/issues/4552)) ([aa35df0](https://github.com/dynamic-labs/DynamicAuth/commit/aa35df0e894feafa0606aa1c87bd3d3879ebc594))
66
+
67
+ ## [1.1.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.19...v1.1.0-alpha.20) (2024-01-31)
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * return all enabled chains in getSupportedNetworks instead of undefined ([#4547](https://github.com/dynamic-labs/DynamicAuth/issues/4547)) ([08e7889](https://github.com/dynamic-labs/DynamicAuth/commit/08e78896e045f24bbd96e39416a7f58006929da0))
73
+ * show modal for existing social account from other signin provider ([#4535](https://github.com/dynamic-labs/DynamicAuth/issues/4535)) ([282914a](https://github.com/dynamic-labs/DynamicAuth/commit/282914ac94b3ef5bd66e0b2265d9e414203a7406))
74
+
75
+ ## [1.1.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.18...v1.1.0-alpha.19) (2024-01-31)
76
+
77
+
78
+ ### Features
79
+
80
+ * add PhantomRedirect connector ([#4467](https://github.com/dynamic-labs/DynamicAuth/issues/4467)) ([75d6c95](https://github.com/dynamic-labs/DynamicAuth/commit/75d6c95940fcec185a699c2100b3e2d21a8233d5))
81
+
82
+
83
+ ### Bug Fixes
84
+
85
+ * lock starknet to 5.25.0 since 5.27.0 breaks the build ([#4541](https://github.com/dynamic-labs/DynamicAuth/issues/4541)) ([00b4799](https://github.com/dynamic-labs/DynamicAuth/commit/00b479977f768cb067480e2e565eabf45e1000a2))
86
+
87
+ ## [1.1.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.17...v1.1.0-alpha.18) (2024-01-30)
88
+
89
+
90
+ ### Bug Fixes
91
+
92
+ * catch email_associated_with_different_provider from response ([#4532](https://github.com/dynamic-labs/DynamicAuth/issues/4532)) ([52be1b4](https://github.com/dynamic-labs/DynamicAuth/commit/52be1b45af46c2b70972b99d73387eb4d7161ec6))
93
+
94
+ ## [1.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.16...v1.1.0-alpha.17) (2024-01-30)
95
+
96
+
97
+ ### Features
98
+
99
+ * add sendRawTransaction to BitcoinWalletConnector ([2e86c5a](https://github.com/dynamic-labs/DynamicAuth/commit/2e86c5a5245bd0fc29162ef1f7fe2fbd65245fe1))
100
+
101
+
102
+ ### Bug Fixes
103
+
104
+ * properly handle AccountExistsError for signInOAuth ([#4529](https://github.com/dynamic-labs/DynamicAuth/issues/4529)) ([d37fdc3](https://github.com/dynamic-labs/DynamicAuth/commit/d37fdc310fe4b70f8948fd5ed3d058342afbe08f))
105
+
106
+ ## [1.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.15...v1.1.0-alpha.16) (2024-01-30)
107
+
108
+
109
+ ### Bug Fixes
110
+
111
+ * add fallback to getWalletBookWallet for customers still passing in name, add deprecation warn ([#4518](https://github.com/dynamic-labs/DynamicAuth/issues/4518)) ([b233ea1](https://github.com/dynamic-labs/DynamicAuth/commit/b233ea1cd640d8d9d94c52ab230787f3d869151a))
112
+ * handle braavos network change to account which doesn not exist ([#4519](https://github.com/dynamic-labs/DynamicAuth/issues/4519)) ([486020f](https://github.com/dynamic-labs/DynamicAuth/commit/486020fb09a274388ba34c8d1b37ac3a1ff3dba6))
113
+
114
+ ## [1.1.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.14...v1.1.0-alpha.15) (2024-01-28)
115
+
116
+
117
+ ### Features
118
+
119
+ * add wallet group override to wallet book ([#4488](https://github.com/dynamic-labs/DynamicAuth/issues/4488)) ([cb19ad3](https://github.com/dynamic-labs/DynamicAuth/commit/cb19ad3ea82de488752ceceeaf0e1458a388df6e))
120
+ * enable solana embedded wallets ([#4457](https://github.com/dynamic-labs/DynamicAuth/issues/4457)) ([b0c47f4](https://github.com/dynamic-labs/DynamicAuth/commit/b0c47f4475baa12f52076da46ef993c13bd2c243))
121
+ * group ArgentX wallets ([#4495](https://github.com/dynamic-labs/DynamicAuth/issues/4495)) ([b10d79a](https://github.com/dynamic-labs/DynamicAuth/commit/b10d79a668efecedca37ddb358e6adf95319650d))
122
+
123
+
124
+ ### Bug Fixes
125
+
126
+ * add support for newest backpack extension ([#4468](https://github.com/dynamic-labs/DynamicAuth/issues/4468)) ([a219f32](https://github.com/dynamic-labs/DynamicAuth/commit/a219f325be672599e50b07f6751234a7fc98286e))
127
+ * bump timeout for slower connections ([#4475](https://github.com/dynamic-labs/DynamicAuth/issues/4475)) ([7a07ff5](https://github.com/dynamic-labs/DynamicAuth/commit/7a07ff589eaaf3b28a94d277df3eedabbca60702))
128
+ * change out getWalletBookWallet for findWalletBookWallet to avoid throwing during lookup ([#4477](https://github.com/dynamic-labs/DynamicAuth/issues/4477)) ([4648040](https://github.com/dynamic-labs/DynamicAuth/commit/4648040c166e73dd2c31b0e27897713339436c2f))
129
+ * connect to wallet with wallet connect even if network is not supported ([#4465](https://github.com/dynamic-labs/DynamicAuth/issues/4465)) ([9dbca3e](https://github.com/dynamic-labs/DynamicAuth/commit/9dbca3eb4d4990ee4be642677c1604170b425dc3))
130
+ * pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([2bf2f04](https://github.com/dynamic-labs/DynamicAuth/commit/2bf2f0487f5b1be936dd279107c11fe5d2b42666))
131
+ * switching wallet in extension caused connected flag to be false temporarily ([#4454](https://github.com/dynamic-labs/DynamicAuth/issues/4454)) ([3650f6e](https://github.com/dynamic-labs/DynamicAuth/commit/3650f6ec471a7c779f4d304ab94c9350dd55055b))
132
+
133
+ ## [1.1.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.13...v1.1.0-alpha.14) (2024-01-23)
134
+
135
+
136
+ ### Features
137
+
138
+ * add wallet-book retryable ([#4462](https://github.com/dynamic-labs/DynamicAuth/issues/4462)) ([513b1a6](https://github.com/dynamic-labs/DynamicAuth/commit/513b1a67d6c49624398ad4b0cdca4f5618c9583f))
139
+
140
+ ## [1.1.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.12...v1.1.0-alpha.13) (2024-01-23)
3
141
 
4
142
 
5
143
  ### Features
6
144
 
7
145
  * add createWalletClientFromWallet helper function ([#4416](https://github.com/dynamic-labs/DynamicAuth/issues/4416)) ([b384898](https://github.com/dynamic-labs/DynamicAuth/commit/b384898061bb3f9b38b2ed670b6650cfc1d4b429))
8
146
  * add hardware wallets to wallet book ([#4445](https://github.com/dynamic-labs/DynamicAuth/issues/4445)) ([66c0f5b](https://github.com/dynamic-labs/DynamicAuth/commit/66c0f5b29a6a700099bb95a6f7622f6178e0bccf))
9
- * add redirect based phantom deeplinking ([c40dfd2](https://github.com/dynamic-labs/DynamicAuth/commit/c40dfd21d0692b9d33593d564ae6879ab15547e2))
147
+ * add support for Argent Web and Mobile ([#4328](https://github.com/dynamic-labs/DynamicAuth/issues/4328)) ([bce20b8](https://github.com/dynamic-labs/DynamicAuth/commit/bce20b8f35a8630f2621f53a541a1acb06a38fc0))
148
+ * enable ledger for glow, solflare and backpack ([#4392](https://github.com/dynamic-labs/DynamicAuth/issues/4392)) ([fa7b992](https://github.com/dynamic-labs/DynamicAuth/commit/fa7b992f87ebc43560f87b43ac56f2cd9909b306))
10
149
 
11
150
 
12
151
  ### Bug Fixes
13
152
 
14
153
  * breaking changes script ([#4440](https://github.com/dynamic-labs/DynamicAuth/issues/4440)) ([446173d](https://github.com/dynamic-labs/DynamicAuth/commit/446173d074d652d81856c6412e304b46b1565320))
15
154
  * broken help icon in create passkey view ([#4428](https://github.com/dynamic-labs/DynamicAuth/issues/4428)) ([e0ffc02](https://github.com/dynamic-labs/DynamicAuth/commit/e0ffc02ffea34b7ac3198ff6e1baf7f9907acddd))
155
+ * infinite loop when connecting with trust wallet ([#4448](https://github.com/dynamic-labs/DynamicAuth/issues/4448)) ([4e20edf](https://github.com/dynamic-labs/DynamicAuth/commit/4e20edf9abaabf20e5e9f9167b44d7f691e844f1))
156
+ * render wagmi elements based on react version ([#4453](https://github.com/dynamic-labs/DynamicAuth/issues/4453)) ([43c624c](https://github.com/dynamic-labs/DynamicAuth/commit/43c624ca996b0c51de1454910f19fdf908149938))
16
157
 
17
158
  ## [1.1.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.11...v1.1.0-alpha.12) (2024-01-18)
18
159
 
@@ -21,6 +21,11 @@ function __awaiter(thisArg, _arguments, P, generator) {
21
21
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
22
  step((generator = generator.apply(thisArg, _arguments || [])).next());
23
23
  });
24
- }
24
+ }
25
+
26
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
27
+ var e = new Error(message);
28
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
29
+ };
25
30
 
26
31
  export { __awaiter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wagmi-connector",
3
- "version": "1.1.0-phantom.0",
3
+ "version": "1.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -10,10 +10,10 @@
10
10
  "react": "^17.0.2 || ^18.0.0",
11
11
  "viem": "^1.19.13 || ^2.2.0",
12
12
  "wagmi": "^1.4.12",
13
- "@dynamic-labs/rpc-providers": "1.1.0-phantom.0",
14
- "@dynamic-labs/sdk-react-core": "1.1.0-phantom.0",
15
- "@dynamic-labs/types": "1.1.0-phantom.0",
16
- "@dynamic-labs/wallet-connector-core": "1.1.0-phantom.0",
13
+ "@dynamic-labs/rpc-providers": "1.1.0",
14
+ "@dynamic-labs/sdk-react-core": "1.1.0",
15
+ "@dynamic-labs/types": "1.1.0",
16
+ "@dynamic-labs/wallet-connector-core": "1.1.0",
17
17
  "eventemitter3": "5.0.1"
18
18
  },
19
19
  "license": "MIT",
@@ -63,10 +63,10 @@ export declare class Connector extends BaseWagmiConnector<WalletClient<Transport
63
63
  [x: string]: Record<string, any>;
64
64
  eth_accounts: Record<string, any>;
65
65
  }) => Promise<import("viem").RequestPermissionsReturnType>;
66
- sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
66
+ sendRawTransaction: (args: import("node_modules/viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
67
67
  sendTransaction: <TChainOverride_2 extends Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<Chain, Account, TChainOverride_2>) => Promise<`0x${string}`>;
68
68
  signMessage: (args: import("viem").SignMessageParameters<Account>) => Promise<`0x${string}`>;
69
- signTransaction: <TChainOverride_3 extends Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<Chain, Account, TChainOverride_3>) => Promise<`0x${string}`>;
69
+ signTransaction: <TChainOverride_3 extends Chain | undefined = undefined>(args: import("node_modules/viem/_types/actions/wallet/signTransaction").SignTransactionParameters<Chain, Account, TChainOverride_3>) => Promise<`0x${string}`>;
70
70
  signTypedData: <const TTypedData extends {
71
71
  [x: string]: readonly import("viem").TypedDataParameter[];
72
72
  [x: `string[${string}]`]: undefined;
@@ -329,7 +329,7 @@ export declare class Connector extends BaseWagmiConnector<WalletClient<Transport
329
329
  [x: string]: Record<string, any>;
330
330
  eth_accounts: Record<string, any>;
331
331
  }) => Promise<import("viem").RequestPermissionsReturnType>;
332
- sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
332
+ sendRawTransaction: (args: import("node_modules/viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
333
333
  sendTransaction: <TChainOverride_7 extends Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<Chain, {
334
334
  address: `0x${string}`;
335
335
  type: "json-rpc";
@@ -338,7 +338,7 @@ export declare class Connector extends BaseWagmiConnector<WalletClient<Transport
338
338
  address: `0x${string}`;
339
339
  type: "json-rpc";
340
340
  }>) => Promise<`0x${string}`>;
341
- signTransaction: <TChainOverride_8 extends Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<Chain, {
341
+ signTransaction: <TChainOverride_8 extends Chain | undefined = undefined>(args: import("node_modules/viem/_types/actions/wallet/signTransaction").SignTransactionParameters<Chain, {
342
342
  address: `0x${string}`;
343
343
  type: "json-rpc";
344
344
  }, TChainOverride_8>) => Promise<`0x${string}`>;
@@ -1,8 +1,8 @@
1
- import React, { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { WagmiEvmNetworks } from './types';
3
3
  type DynamicWagmiConnectorProps = {
4
4
  children: ReactNode;
5
5
  evmNetworks?: WagmiEvmNetworks[];
6
6
  };
7
- export declare const DynamicWagmiConnector: ({ evmNetworks: customerSuppliedEvmNetworks, children, }: DynamicWagmiConnectorProps) => React.FunctionComponentElement<React.PropsWithChildren<import("wagmi").WagmiConfigProps<import("@wagmi/core/dist/index-e744bbc2").P, import("@wagmi/core/dist/index-e744bbc2").W>>>;
7
+ export declare const DynamicWagmiConnector: ({ evmNetworks: customerSuppliedEvmNetworks, children, }: DynamicWagmiConnectorProps) => JSX.Element;
8
8
  export {};
@@ -1,3 +1,4 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import React, { useRef, useMemo, useEffect } from 'react';
2
3
  import { configureChains, mainnet, createConfig, WagmiConfig } from 'wagmi';
3
4
  import { publicProvider } from 'wagmi/providers/public';
@@ -59,6 +60,9 @@ const DynamicWagmiConnector = ({ evmNetworks: customerSuppliedEvmNetworks, child
59
60
  config.setWebSocketPublicClient(webSocketPublicClient);
60
61
  config.setConnectors(connector ? [connector] : []);
61
62
  }, [connector, publicClient, webSocketPublicClient]);
63
+ if (React.version.startsWith('18')) {
64
+ return (jsx(WagmiConfig, { config: config, children: jsx(SyncDynamicWagmi, { connector: connector, preventWagmiSyncFromCallingLogout: preventWagmiSyncFromCallingLogout, wallets: wallets, children: children }) }));
65
+ }
62
66
  // use React.createElement to prevent bunding react/jsx-runtime,
63
67
  // which is not compatible when bundling apps using React 17
64
68
  return React.createElement(WagmiConfig, { config: config }, React.createElement(SyncDynamicWagmi, { connector, preventWagmiSyncFromCallingLogout, wallets }, children));
@@ -6,6 +6,4 @@ export type SyncDynamicWagmiProps = React.PropsWithChildren<{
6
6
  wallets: Wallet[];
7
7
  preventWagmiSyncFromCallingLogout: MutableRefObject<boolean>;
8
8
  }>;
9
- export declare const SyncDynamicWagmi: ({ children, connector, wallets, preventWagmiSyncFromCallingLogout, }: SyncDynamicWagmiProps) => React.FunctionComponentElement<{
10
- children?: React.ReactNode;
11
- }>;
9
+ export declare const SyncDynamicWagmi: ({ children, connector, wallets, preventWagmiSyncFromCallingLogout, }: SyncDynamicWagmiProps) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
1
2
  import React, { useRef, useEffect } from 'react';
2
3
  import { useConfig, useConnect, useDisconnect } from 'wagmi';
3
4
  import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
@@ -51,6 +52,10 @@ const SyncDynamicWagmi = ({ children, connector, wallets, preventWagmiSyncFromCa
51
52
  walletConnector,
52
53
  wallets,
53
54
  ]);
55
+ if (React.version.startsWith('18')) {
56
+ // eslint-disable-next-line react/jsx-no-useless-fragment
57
+ return jsx(Fragment, { children: children });
58
+ }
54
59
  // use React.createElement to prevent bunding react/jsx-runtime,
55
60
  // which is not compatible when bundling apps using React 17
56
61
  return React.createElement(React.Fragment, null, children);
@@ -1,4 +1,4 @@
1
1
  import { Chain } from 'wagmi';
2
2
  import { WagmiEvmNetworks } from '../types';
3
3
  export declare const mapDynamicChainToWagmi: (dynamicChain: WagmiEvmNetworks) => Chain;
4
- export declare const overrideWagmiChainWithDynamicSettings: (wagmiChain: Chain, dynamicChain: WagmiEvmNetworks) => Chain;
4
+ export declare const overrideWagmiChainWithDynamicSettings: (wagmiChain: Chain | undefined, dynamicChain: WagmiEvmNetworks) => Chain;
@@ -22,11 +22,10 @@ const updateRpcProvider = (rpcUrls, privateCustomerRpcUrls, name) => {
22
22
  }
23
23
  };
24
24
  const mapDynamicChainToWagmi = (dynamicChain) => {
25
- var _a;
26
25
  /**
27
26
  * Find the chain in Wagmi that matches the chainId of the dynamic chain.
28
27
  */
29
- const wagmiChain = ((_a = Object.values(allChains).find((chain) => chain.id === dynamicChain.chainId)) !== null && _a !== void 0 ? _a : {});
28
+ const wagmiChain = Object.values(allChains).find((chain) => chain.id === dynamicChain.chainId);
30
29
  return overrideWagmiChainWithDynamicSettings(wagmiChain, dynamicChain);
31
30
  };
32
31
  const generateRpcUrls = (dynamicChain) => {
@@ -44,8 +43,8 @@ const generateRpcUrls = (dynamicChain) => {
44
43
  return rpcUrls;
45
44
  };
46
45
  const overrideWagmiChainWithDynamicSettings = (wagmiChain, dynamicChain) => {
47
- var _a, _b, _c, _d, _e, _f, _g;
48
- return (Object.assign(Object.assign({}, wagmiChain), { blockExplorers: Object.assign(Object.assign({}, wagmiChain === null || wagmiChain === void 0 ? void 0 : wagmiChain.blockExplorers), { default: Object.assign(Object.assign({}, (_a = wagmiChain.blockExplorers) === null || _a === void 0 ? void 0 : _a.default), { name: '', url: (_c = (_b = dynamicChain.blockExplorerUrls) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : '' }) }), contracts: (_d = dynamicChain.contracts) !== null && _d !== void 0 ? _d : wagmiChain.contracts, name: (_f = (_e = dynamicChain.vanityName) !== null && _e !== void 0 ? _e : dynamicChain.name) !== null && _f !== void 0 ? _f : wagmiChain.name, nativeCurrency: (_g = dynamicChain.nativeCurrency) !== null && _g !== void 0 ? _g : wagmiChain.nativeCurrency, rpcUrls: generateRpcUrls(dynamicChain) }));
46
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
47
+ return (Object.assign(Object.assign({}, wagmiChain), { blockExplorers: Object.assign(Object.assign({}, wagmiChain === null || wagmiChain === void 0 ? void 0 : wagmiChain.blockExplorers), { default: Object.assign(Object.assign({}, (_a = wagmiChain === null || wagmiChain === void 0 ? void 0 : wagmiChain.blockExplorers) === null || _a === void 0 ? void 0 : _a.default), { name: '', url: (_c = (_b = dynamicChain.blockExplorerUrls) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : '' }) }), contracts: (_d = dynamicChain.contracts) !== null && _d !== void 0 ? _d : wagmiChain === null || wagmiChain === void 0 ? void 0 : wagmiChain.contracts, id: (_e = wagmiChain === null || wagmiChain === void 0 ? void 0 : wagmiChain.id) !== null && _e !== void 0 ? _e : dynamicChain.chainId, name: (_g = (_f = dynamicChain.vanityName) !== null && _f !== void 0 ? _f : dynamicChain.name) !== null && _g !== void 0 ? _g : wagmiChain === null || wagmiChain === void 0 ? void 0 : wagmiChain.name, nativeCurrency: (_h = dynamicChain.nativeCurrency) !== null && _h !== void 0 ? _h : wagmiChain === null || wagmiChain === void 0 ? void 0 : wagmiChain.nativeCurrency, network: (_k = (_j = wagmiChain === null || wagmiChain === void 0 ? void 0 : wagmiChain.network) !== null && _j !== void 0 ? _j : dynamicChain.chainName) !== null && _k !== void 0 ? _k : '', rpcUrls: generateRpcUrls(dynamicChain) }));
49
48
  };
50
49
 
51
50
  export { mapDynamicChainToWagmi, overrideWagmiChainWithDynamicSettings };