@dynamic-labs/wagmi-connector 1.0.0-alpha.0 → 1.0.0-alpha.10

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,4 +1,180 @@
1
1
 
2
+ ## [1.0.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2023-12-08)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * allow transaction error to read from viem error ([#4101](https://github.com/dynamic-labs/DynamicAuth/issues/4101)) ([0f46cbe](https://github.com/dynamic-labs/DynamicAuth/commit/0f46cbea1eb260c2efdeee9b62f669fb3cf4ab93))
8
+ * trigger claim flow for unclaimed embedded smart contract wallet signer ([#4108](https://github.com/dynamic-labs/DynamicAuth/issues/4108)) ([37c9013](https://github.com/dynamic-labs/DynamicAuth/commit/37c9013109f2d6a37bde041da9072c5f5fa2df67))
9
+ * WalletConnect v2 connector with non active chains ([#4085](https://github.com/dynamic-labs/DynamicAuth/issues/4085)) ([f69cbe9](https://github.com/dynamic-labs/DynamicAuth/commit/f69cbe96012563f71e89939c96f2a46926e7b394))
10
+
11
+ ## [1.0.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2023-12-07)
12
+
13
+
14
+ ### ⚠ BREAKING CHANGES
15
+
16
+ * how to migrate
17
+ Whenever you would use the property wallets from the object returned by useDynamicContext, you must now rename it to walletConnectorOptions.
18
+
19
+ ### Features
20
+
21
+ * add support for eip6963 ([#4064](https://github.com/dynamic-labs/DynamicAuth/issues/4064)) ([3f8cf0e](https://github.com/dynamic-labs/DynamicAuth/commit/3f8cf0e4250945f3a331f701d491a308fab5f7b8))
22
+ * allow AA wallets to access owner features ([#4079](https://github.com/dynamic-labs/DynamicAuth/issues/4079)) ([9efc2be](https://github.com/dynamic-labs/DynamicAuth/commit/9efc2bee87ec9193c3682863d72024b3586de724))
23
+ * introduce UserWalletsContext ([#4083](https://github.com/dynamic-labs/DynamicAuth/issues/4083)) ([b9ca7f6](https://github.com/dynamic-labs/DynamicAuth/commit/b9ca7f6b0aff4b3992325b70cc9a903ece445c7f))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * ensure zero dev provider will receive a signer ([#4084](https://github.com/dynamic-labs/DynamicAuth/issues/4084)) ([f02a540](https://github.com/dynamic-labs/DynamicAuth/commit/f02a54036d39bfc5fb0c262f292acf914e4bd653))
29
+ * render recovery section only when turnkey provider is enabled ([#4093](https://github.com/dynamic-labs/DynamicAuth/issues/4093)) ([5f29bd2](https://github.com/dynamic-labs/DynamicAuth/commit/5f29bd23ccca2e307822377be28396edc7ab1fda))
30
+ * reset selected social provider on logout ([#4078](https://github.com/dynamic-labs/DynamicAuth/issues/4078)) ([85dc611](https://github.com/dynamic-labs/DynamicAuth/commit/85dc611d9c0e733bdb9d316b008bdaa35bcc2a91))
31
+
32
+
33
+ * rename wallets > walletConnectorOptions ([#4086](https://github.com/dynamic-labs/DynamicAuth/issues/4086)) ([10a7795](https://github.com/dynamic-labs/DynamicAuth/commit/10a779567e751469a667095726da52d78facbd57))
34
+
35
+ ## [1.0.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2023-12-05)
36
+
37
+
38
+ ### ⚠ BREAKING CHANGES
39
+
40
+ * rename EthereumSmartWalletConnectors to ZeroDevSmartWalletConnectors (#4067)
41
+
42
+
43
+ ### Features
44
+
45
+ * add support for pregenerated wallets + securing them ([#3968](https://github.com/dynamic-labs/DynamicAuth/issues/3968)) ([8212b76](https://github.com/dynamic-labs/DynamicAuth/commit/8212b760ba199bd989e0ba2ad3caf97590db4861))
46
+
47
+ ## [1.0.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2023-12-05)
48
+
49
+
50
+ ### Features
51
+
52
+ * add support for Turnkey HD wallets and backwards compatiblity for private key wallets ([#4011](https://github.com/dynamic-labs/DynamicAuth/issues/4011)) ([75c5258](https://github.com/dynamic-labs/DynamicAuth/commit/75c5258da494d5d4dfa8b96655303dd9645f2269))
53
+
54
+
55
+ ### Bug Fixes
56
+
57
+ * add close button to wallets list ([#4036](https://github.com/dynamic-labs/DynamicAuth/issues/4036)) ([a2b988b](https://github.com/dynamic-labs/DynamicAuth/commit/a2b988bdfc662af6f85d37a79ed6666c483aa447))
58
+ * add support for embedded wallets in connect-only ([#4041](https://github.com/dynamic-labs/DynamicAuth/issues/4041)) ([ceea635](https://github.com/dynamic-labs/DynamicAuth/commit/ceea635b69e2a0c2636b47fbd30639d69dba7a1c))
59
+ * embedded wallet invalid stored chain breaking network picker ([#4050](https://github.com/dynamic-labs/DynamicAuth/issues/4050)) ([2e2384b](https://github.com/dynamic-labs/DynamicAuth/commit/2e2384ba37407d9164cce47e23f5d5f469f7e062))
60
+ * handle insufficient funds from AA provider ([#4027](https://github.com/dynamic-labs/DynamicAuth/issues/4027)) ([6b9cc88](https://github.com/dynamic-labs/DynamicAuth/commit/6b9cc886f4f2590094bd50aba195c07a5532dfa4))
61
+ * prevent double logout caused by wagmi sync ([#4048](https://github.com/dynamic-labs/DynamicAuth/issues/4048)) ([c66c81c](https://github.com/dynamic-labs/DynamicAuth/commit/c66c81c80839aa9ce1cfae76f4afce12e34f3513))
62
+ * properly detect network switch for secondary wallets ([#4038](https://github.com/dynamic-labs/DynamicAuth/issues/4038)) ([f87174d](https://github.com/dynamic-labs/DynamicAuth/commit/f87174de0892dd057401eaf3c0bc68d974add0fc))
63
+ * **use-wallets-connected-state:** update state on wallet id change ([#4045](https://github.com/dynamic-labs/DynamicAuth/issues/4045)) ([ca3a835](https://github.com/dynamic-labs/DynamicAuth/commit/ca3a8359eae386bffa758ed646ac14af8360a7f8))
64
+ * user should be able to see the full passkey name on management view ([#4043](https://github.com/dynamic-labs/DynamicAuth/issues/4043)) ([7bc1b70](https://github.com/dynamic-labs/DynamicAuth/commit/7bc1b7043cbc9f0e21df78a57efc3e6938a99db2))
65
+ * users should be able to easily find passkey recovery ([#4058](https://github.com/dynamic-labs/DynamicAuth/issues/4058)) ([0202ae9](https://github.com/dynamic-labs/DynamicAuth/commit/0202ae98c96544dec5ac357dc77000996e32ad33))
66
+
67
+ ## [1.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2023-11-29)
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * transaction layout show alert ([#4024](https://github.com/dynamic-labs/DynamicAuth/issues/4024)) ([52057f5](https://github.com/dynamic-labs/DynamicAuth/commit/52057f54ebc32464b2486a2328cb6310caf85208)), closes [#4020](https://github.com/dynamic-labs/DynamicAuth/issues/4020)
73
+
74
+ ## [1.0.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2023-11-29)
75
+
76
+
77
+ ### Features
78
+
79
+ * gracefully handle uknown wallet ([#3997](https://github.com/dynamic-labs/DynamicAuth/issues/3997)) ([ce7ff6a](https://github.com/dynamic-labs/DynamicAuth/commit/ce7ff6a50a8e8947050734b61587c8cadd041dbe))
80
+
81
+
82
+ ### Bug Fixes
83
+
84
+ * remove total on sponsored transactions ([#4019](https://github.com/dynamic-labs/DynamicAuth/issues/4019)) ([d976678](https://github.com/dynamic-labs/DynamicAuth/commit/d9766787b29665fbcd7983c5d61c31a4d97c8257))
85
+ * send balance align information ([#4020](https://github.com/dynamic-labs/DynamicAuth/issues/4020)) ([508dccf](https://github.com/dynamic-labs/DynamicAuth/commit/508dccfa2c6aeaed30616b6a41b30002cccb3b40))
86
+
87
+ ## [1.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2023-11-28)
88
+
89
+
90
+ ### Bug Fixes
91
+
92
+ * update zerodev provider initialization ([#4015](https://github.com/dynamic-labs/DynamicAuth/issues/4015)) ([8faca00](https://github.com/dynamic-labs/DynamicAuth/commit/8faca00d414677adc5fecde451ca01da53fe9641))
93
+
94
+ ## [1.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2023-11-28)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * fix solflare mobile wallet deep linking ([#3998](https://github.com/dynamic-labs/DynamicAuth/issues/3998)) ([10069ae](https://github.com/dynamic-labs/DynamicAuth/commit/10069ae9ed5d8e1978131f57c3e90680e85d2efb))
100
+ * passkey error message when reaching limit of accounts ([#4010](https://github.com/dynamic-labs/DynamicAuth/issues/4010)) ([dabce3b](https://github.com/dynamic-labs/DynamicAuth/commit/dabce3b6ada4bac75903b43d5cb125cfd5619d18))
101
+
102
+ ## [1.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2023-11-28)
103
+
104
+
105
+ ### ⚠ BREAKING CHANGES
106
+
107
+ * rename walletsByChain to bridgeChains (#3954)
108
+
109
+ ### Features
110
+
111
+ * passkey management and recovery ([#3911](https://github.com/dynamic-labs/DynamicAuth/issues/3911)) ([b692b3a](https://github.com/dynamic-labs/DynamicAuth/commit/b692b3a8697d0ffb441faae97e609b144965695d))
112
+
113
+
114
+ ### Bug Fixes
115
+
116
+ * ensure all chain rpc providers are always assigned correctly ([#3981](https://github.com/dynamic-labs/DynamicAuth/issues/3981)) ([cd2e25c](https://github.com/dynamic-labs/DynamicAuth/commit/cd2e25c4eb39791866c1ea283d61fff388cce5df))
117
+ * initialize selected chain with first evm network if no value in ls ([#3999](https://github.com/dynamic-labs/DynamicAuth/issues/3999)) ([bc9e43b](https://github.com/dynamic-labs/DynamicAuth/commit/bc9e43be9d33c75bb1236756589f63f17b230ab1))
118
+ * nextjs issues to show transaction modals ([#3964](https://github.com/dynamic-labs/DynamicAuth/issues/3964)) ([9326ac4](https://github.com/dynamic-labs/DynamicAuth/commit/9326ac49394e067ce38b17faff08b4fabf91bb3f))
119
+ * onEmbeddedWalletCreated not being called ([#3975](https://github.com/dynamic-labs/DynamicAuth/issues/3975)) ([035cebe](https://github.com/dynamic-labs/DynamicAuth/commit/035cebe02891048e62c66a7277ed7f43c27e559d))
120
+ * return linked wallets even when there's no primary wallet ([#3965](https://github.com/dynamic-labs/DynamicAuth/issues/3965)) ([27705de](https://github.com/dynamic-labs/DynamicAuth/commit/27705de4ac7e1584efd1245bb9c6a818b1c20742))
121
+ * transaction modal not throwing viem compatible exception ([#3971](https://github.com/dynamic-labs/DynamicAuth/issues/3971)) ([bedab0c](https://github.com/dynamic-labs/DynamicAuth/commit/bedab0c4448bcca5c3e696ceb276867ce55bbd85))
122
+ * **zero-dev:** ensure the sign typed data is parsed for zero dev to handle ([#3974](https://github.com/dynamic-labs/DynamicAuth/issues/3974)) ([f517738](https://github.com/dynamic-labs/DynamicAuth/commit/f517738e1abc138f882525c128cd1ee5e88b9050))
123
+ * zerodev sign message with ethers ([#3972](https://github.com/dynamic-labs/DynamicAuth/issues/3972)) ([5de3873](https://github.com/dynamic-labs/DynamicAuth/commit/5de3873daa9cbfeef6dd9123b7a319d8e6b412d5))
124
+ * **zerodev:** ensure ECDSAProvider supports sendUserOperation ([#4003](https://github.com/dynamic-labs/DynamicAuth/issues/4003)) ([c8f5886](https://github.com/dynamic-labs/DynamicAuth/commit/c8f58868fcf6912fd11a92940369faf37e3fcdde))
125
+ * **zerodev:** ensure transaction is sponsored before submission ([#3932](https://github.com/dynamic-labs/DynamicAuth/issues/3932)) ([74becb7](https://github.com/dynamic-labs/DynamicAuth/commit/74becb7ec2fd55f8b905a9c9f0bbba44a9d22513))
126
+
127
+
128
+ * rename walletsByChain to bridgeChains ([#3954](https://github.com/dynamic-labs/DynamicAuth/issues/3954)) ([a91e8fe](https://github.com/dynamic-labs/DynamicAuth/commit/a91e8fe605694ccd8a00b71aa194c0c5191f156c))
129
+
130
+ ## [1.0.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2023-11-22)
131
+
132
+
133
+ ### Features
134
+
135
+ * add basic zerodev connector ([#3782](https://github.com/dynamic-labs/DynamicAuth/issues/3782)) ([3f8debd](https://github.com/dynamic-labs/DynamicAuth/commit/3f8debddb1bff325389193e0348128ebb9ba59b9))
136
+ * add hcaptcha to dynamic signin methods ([#3853](https://github.com/dynamic-labs/DynamicAuth/issues/3853)) ([a4a9ad3](https://github.com/dynamic-labs/DynamicAuth/commit/a4a9ad3b048e33acc5b885cd797697ca4f41995e))
137
+ * add hcaptcha to magic login methods ([#3894](https://github.com/dynamic-labs/DynamicAuth/issues/3894)) ([c76b750](https://github.com/dynamic-labs/DynamicAuth/commit/c76b750351557ad9cf5bbcc39bd7fd0970b66312))
138
+ * add need help section to sign message modal ([#3847](https://github.com/dynamic-labs/DynamicAuth/issues/3847)) ([4f90617](https://github.com/dynamic-labs/DynamicAuth/commit/4f90617bcf400a7171062435c731d95c6bbf41c7))
139
+ * add perawallet to wallet book ([#3868](https://github.com/dynamic-labs/DynamicAuth/issues/3868)) ([5f4e79d](https://github.com/dynamic-labs/DynamicAuth/commit/5f4e79df202b02088b15c5dfab7feee5789e9ece))
140
+ * add serialization to allow sending events callbacks and wallet connectors used by customers ([0077eb0](https://github.com/dynamic-labs/DynamicAuth/commit/0077eb0af05feb765d0c61911a48d5e98554760a))
141
+ * add support for dynamic domains for starknet signatures ([#3927](https://github.com/dynamic-labs/DynamicAuth/issues/3927)) ([52797ce](https://github.com/dynamic-labs/DynamicAuth/commit/52797ce867c956049bfa5021cf5b1c562e771a2e))
142
+ * add support for Pera Wallet ([#3866](https://github.com/dynamic-labs/DynamicAuth/issues/3866)) ([cb99ae7](https://github.com/dynamic-labs/DynamicAuth/commit/cb99ae77605d913932a77bf2ea565b7e7baf781a))
143
+ * add support for private starknet rpc providers ([#3881](https://github.com/dynamic-labs/DynamicAuth/issues/3881)) ([8fd5ef9](https://github.com/dynamic-labs/DynamicAuth/commit/8fd5ef902d48ef828b1cb89d0e462ea5b54f4e42))
144
+ * add zerodev to wallet book and render generic wallet icon ([#3822](https://github.com/dynamic-labs/DynamicAuth/issues/3822)) ([9c5768d](https://github.com/dynamic-labs/DynamicAuth/commit/9c5768d0fc1169c62927926c0e436b6a448d5656))
145
+ * allow updating evmNetworks in real time ([#3877](https://github.com/dynamic-labs/DynamicAuth/issues/3877)) ([b4a2521](https://github.com/dynamic-labs/DynamicAuth/commit/b4a2521830b859a129d70bad2ae1213db075550d))
146
+ * editable copies as typed data ([#3784](https://github.com/dynamic-labs/DynamicAuth/issues/3784)) ([d6c6d74](https://github.com/dynamic-labs/DynamicAuth/commit/d6c6d74e60c9c9d459414c452fbd780d3f6bc2f9))
147
+ * email inputs now use email keyboard ([#3843](https://github.com/dynamic-labs/DynamicAuth/issues/3843)) ([76926e2](https://github.com/dynamic-labs/DynamicAuth/commit/76926e26b6a188d9d8e3bba2512340610e218e9f))
148
+ * hide unlink if disabled in dashboard ([#3825](https://github.com/dynamic-labs/DynamicAuth/issues/3825)) ([a0625e6](https://github.com/dynamic-labs/DynamicAuth/commit/a0625e6fd01aa5b57e6b8542efe04e280e0c6830))
149
+ * initialize smart wallet from verified credentials ([#3790](https://github.com/dynamic-labs/DynamicAuth/issues/3790)) ([1fc5890](https://github.com/dynamic-labs/DynamicAuth/commit/1fc5890f2e0ef458bfb59d38d536c41d183bc2a2))
150
+ * set smart wallet as primary when owner is an embedded wallet ([#3898](https://github.com/dynamic-labs/DynamicAuth/issues/3898)) ([ec40172](https://github.com/dynamic-labs/DynamicAuth/commit/ec401729f38d946d5431bbbb15c5c1cdc66acb73))
151
+ * support forced network validation via DynamicContext setting ([#3879](https://github.com/dynamic-labs/DynamicAuth/issues/3879)) ([a7993b9](https://github.com/dynamic-labs/DynamicAuth/commit/a7993b9b6bdd739bcb4e66e46d14e7f8623bed66))
152
+ * **transaction:** add sponsored gas transaction ([#3869](https://github.com/dynamic-labs/DynamicAuth/issues/3869)) ([ccceb24](https://github.com/dynamic-labs/DynamicAuth/commit/ccceb2421e029dc60e53912e404b574324d6772f))
153
+
154
+
155
+ ### Bug Fixes
156
+
157
+ * **account-abstraction:** set verified credentials before setting EOA to wallet connector ([#3941](https://github.com/dynamic-labs/DynamicAuth/issues/3941)) ([7475c46](https://github.com/dynamic-labs/DynamicAuth/commit/7475c465f5ddf9e27d0b05d23e58d9b474fa8fd4))
158
+ * add brand to zerodev object ([#3828](https://github.com/dynamic-labs/DynamicAuth/issues/3828)) ([81cb237](https://github.com/dynamic-labs/DynamicAuth/commit/81cb237df4def8e1c53b4ae145afafccf3b04683))
159
+ * add spriteId to zerodev ([#3829](https://github.com/dynamic-labs/DynamicAuth/issues/3829)) ([6b87c5c](https://github.com/dynamic-labs/DynamicAuth/commit/6b87c5c3d5869f6cd15a7534fb0260932845fbb1))
160
+ * allow metadata to be updated in updateUser hook ([#3928](https://github.com/dynamic-labs/DynamicAuth/issues/3928)) ([4f39fbd](https://github.com/dynamic-labs/DynamicAuth/commit/4f39fbd757b4e816dd60651252575c1f7e4d80aa))
161
+ * blocto flow connect only infinite recursion ([#3883](https://github.com/dynamic-labs/DynamicAuth/issues/3883)) ([6c6f5ba](https://github.com/dynamic-labs/DynamicAuth/commit/6c6f5ba5dc0657cc7ffdc82a4ea7935f65686088))
162
+ * clear project settings on page refresh ([#3826](https://github.com/dynamic-labs/DynamicAuth/issues/3826)) ([da5b8f0](https://github.com/dynamic-labs/DynamicAuth/commit/da5b8f0a99bf913ea11314954e5f08c2b019f50f))
163
+ * don't call computeConnectedStateForWallets too often to avoid infinite loops ([#3946](https://github.com/dynamic-labs/DynamicAuth/issues/3946)) ([de4e61a](https://github.com/dynamic-labs/DynamicAuth/commit/de4e61a3fcdc9c25cbe030c3c25cbc2c04929a93))
164
+ * don't call disconnect multiple times ([#3940](https://github.com/dynamic-labs/DynamicAuth/issues/3940)) ([3ea8623](https://github.com/dynamic-labs/DynamicAuth/commit/3ea86233d8d07dfb3c751a5fec45d5df84e9e143))
165
+ * **embedded wallet:** stop overriding primary wallet selection ([#3796](https://github.com/dynamic-labs/DynamicAuth/issues/3796)) ([75b81e7](https://github.com/dynamic-labs/DynamicAuth/commit/75b81e74d472ce8cc493646b441d2b4fe3962373))
166
+ * exodusevm wallet connect and mobile deep linking ([#3855](https://github.com/dynamic-labs/DynamicAuth/issues/3855)) ([cf0b3f0](https://github.com/dynamic-labs/DynamicAuth/commit/cf0b3f077f935eab32ce45947f62e73342d6c169))
167
+ * handle errors properly when engaging captcha ([#3896](https://github.com/dynamic-labs/DynamicAuth/issues/3896)) ([2596315](https://github.com/dynamic-labs/DynamicAuth/commit/25963153d699b26c6e04ea38b267446d3a3af13b))
168
+ * null safe check to window object ([#3882](https://github.com/dynamic-labs/DynamicAuth/issues/3882)) ([8856b5a](https://github.com/dynamic-labs/DynamicAuth/commit/8856b5ae40d43285eac667401387971b9e3f077d))
169
+ * pass correct wallet connector onLinkSuccess ([#3904](https://github.com/dynamic-labs/DynamicAuth/issues/3904)) ([79cca69](https://github.com/dynamic-labs/DynamicAuth/commit/79cca69ed53a5ef2c4e4d712ce0934e1a4c11459))
170
+ * remove extra captcha context provider instantiation causing unecessary rerenderings ([#3914](https://github.com/dynamic-labs/DynamicAuth/issues/3914)) ([14120a6](https://github.com/dynamic-labs/DynamicAuth/commit/14120a6ac0415f9a59608b376e88de6c729d4e5d))
171
+ * remove the coming soon label ([#3860](https://github.com/dynamic-labs/DynamicAuth/issues/3860)) ([1effb7f](https://github.com/dynamic-labs/DynamicAuth/commit/1effb7f124bda66aae3e8991b5386a1cee28fd99))
172
+ * Revert "chore: fix vite build ([#3849](https://github.com/dynamic-labs/DynamicAuth/issues/3849))" ([#3870](https://github.com/dynamic-labs/DynamicAuth/issues/3870)) ([13bc424](https://github.com/dynamic-labs/DynamicAuth/commit/13bc42483bcb9338babd46eae00988acada83578))
173
+ * **single-wallet:** prompt user to select correct wallet ([#3742](https://github.com/dynamic-labs/DynamicAuth/issues/3742)) ([ccfdd3c](https://github.com/dynamic-labs/DynamicAuth/commit/ccfdd3cc6a4ac7f3b1ea13be92e58982ecfb1c59))
174
+ * update walletconnect.json and walletconnect source schema ([#3854](https://github.com/dynamic-labs/DynamicAuth/issues/3854)) ([88ee546](https://github.com/dynamic-labs/DynamicAuth/commit/88ee5468db0130b19c6637a5632e64e0bb5197ba))
175
+ * useEmailProvider not checking for enabled providers properly ([7c16edc](https://github.com/dynamic-labs/DynamicAuth/commit/7c16edc3785ba10d69762b174f054b0d10b8a072))
176
+ * **wagmi:** ensure chain is defined on wallet client ([#3888](https://github.com/dynamic-labs/DynamicAuth/issues/3888)) ([0e145f6](https://github.com/dynamic-labs/DynamicAuth/commit/0e145f6ac42f55df7a020716d4ddc023554d72f9))
177
+
2
178
  ## [1.0.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0...v1.0.0-alpha.0) (2023-10-31)
3
179
 
4
180
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wagmi-connector",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.0-alpha.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -11,8 +11,11 @@
11
11
  "react": "^17.0.2 || ^18.0.0",
12
12
  "viem": "^1.1.0",
13
13
  "wagmi": "^1.2.0",
14
- "@dynamic-labs/sdk-react-core": "1.0.0-alpha.0",
15
- "@dynamic-labs/types": "1.0.0-alpha.0"
14
+ "@dynamic-labs/rpc-providers": "1.0.0-alpha.10",
15
+ "@dynamic-labs/sdk-react-core": "1.0.0-alpha.10",
16
+ "@dynamic-labs/types": "1.0.0-alpha.10",
17
+ "@dynamic-labs/wallet-connector-core": "1.0.0-alpha.10",
18
+ "eventemitter3": "5.0.1"
16
19
  },
17
20
  "license": "MIT",
18
21
  "main": "./src/index.cjs",
@@ -1,16 +1,20 @@
1
+ import { MutableRefObject } from 'react';
1
2
  import { Address, Connector as BaseWagmiConnector, ConnectorData, Chain } from 'wagmi';
2
- import { WalletClient } from 'viem';
3
+ import { Account, Transport, WalletClient } from 'viem';
3
4
  import { WalletConnector } from '@dynamic-labs/sdk-react-core';
4
- export declare class Connector extends BaseWagmiConnector<WalletClient, undefined> {
5
+ export declare class Connector extends BaseWagmiConnector<WalletClient<Transport, Chain, Account>, undefined> {
5
6
  handleLogOut: () => Promise<void>;
6
7
  walletConnector: WalletConnector;
7
8
  id: string;
8
9
  name: string;
9
10
  ready: boolean;
10
- constructor({ chains, handleLogOut, walletConnector, }: {
11
+ /** See this variable's reason in it's definition in DynamicContext */
12
+ preventWagmiSyncFromCallingLogout: MutableRefObject<boolean>;
13
+ constructor({ chains, handleLogOut, walletConnector, preventWagmiSyncFromCallingLogout, }: {
11
14
  chains: Chain[];
12
15
  handleLogOut: () => Promise<void>;
13
16
  walletConnector: WalletConnector;
17
+ preventWagmiSyncFromCallingLogout: MutableRefObject<boolean>;
14
18
  });
15
19
  _onAccountsChanged({ accounts }: {
16
20
  accounts: string[];
@@ -28,10 +32,560 @@ export declare class Connector extends BaseWagmiConnector<WalletClient, undefine
28
32
  getChainId(): Promise<number>;
29
33
  getProvider(config?: {
30
34
  chainId?: number;
31
- } | undefined): Promise<WalletClient>;
35
+ } | undefined): Promise<WalletClient<Transport, Chain, Account>>;
32
36
  getWalletClient(config?: {
33
37
  chainId?: number;
34
- } | undefined): Promise<any>;
38
+ } | undefined): Promise<{
39
+ account: Account;
40
+ batch?: {
41
+ multicall?: boolean | {
42
+ batchSize?: number | undefined;
43
+ wait?: number | undefined;
44
+ } | undefined;
45
+ } | undefined;
46
+ cacheTime: number;
47
+ chain: Chain;
48
+ key: string;
49
+ name: string;
50
+ pollingInterval: number;
51
+ request: import("viem").EIP1193RequestFn<import("viem").WalletRpcSchema>;
52
+ transport: import("viem").TransportConfig<string, import("viem").EIP1193RequestFn> & Record<string, any>;
53
+ type: string;
54
+ uid: string;
55
+ addChain: (args: import("viem").AddChainParameters) => Promise<void>;
56
+ deployContract: <const TAbi extends import("viem").Abi | readonly unknown[], TChainOverride extends Chain | undefined = undefined>(args: import("viem").DeployContractParameters<TAbi, Chain, Account, TChainOverride>) => Promise<`0x${string}`>;
57
+ getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
58
+ getChainId: () => Promise<number>;
59
+ getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
60
+ prepareTransactionRequest: <TChainOverride_1 extends Chain | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<Chain, Account, TChainOverride_1>) => Promise<import("viem").PrepareTransactionRequestReturnType>;
61
+ requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
62
+ requestPermissions: (args: {
63
+ [x: string]: Record<string, any>;
64
+ eth_accounts: Record<string, any>;
65
+ }) => Promise<import("viem").RequestPermissionsReturnType>;
66
+ sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
67
+ sendTransaction: <TChainOverride_2 extends Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<Chain, Account, TChainOverride_2>) => Promise<`0x${string}`>;
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}`>;
70
+ signTypedData: <const TTypedData extends {
71
+ [x: string]: readonly import("viem").TypedDataParameter[];
72
+ [x: `string[${string}]`]: undefined;
73
+ [x: `function[${string}]`]: undefined;
74
+ [x: `address[${string}]`]: undefined;
75
+ [x: `bool[${string}]`]: undefined;
76
+ [x: `bytes[${string}]`]: undefined;
77
+ [x: `bytes16[${string}]`]: undefined;
78
+ [x: `bytes1[${string}]`]: undefined;
79
+ [x: `bytes2[${string}]`]: undefined;
80
+ [x: `bytes3[${string}]`]: undefined;
81
+ [x: `bytes4[${string}]`]: undefined;
82
+ [x: `bytes5[${string}]`]: undefined;
83
+ [x: `bytes6[${string}]`]: undefined;
84
+ [x: `bytes7[${string}]`]: undefined;
85
+ [x: `bytes8[${string}]`]: undefined;
86
+ [x: `bytes9[${string}]`]: undefined;
87
+ [x: `bytes10[${string}]`]: undefined;
88
+ [x: `bytes11[${string}]`]: undefined;
89
+ [x: `bytes12[${string}]`]: undefined;
90
+ [x: `bytes13[${string}]`]: undefined;
91
+ [x: `bytes14[${string}]`]: undefined;
92
+ [x: `bytes15[${string}]`]: undefined;
93
+ [x: `bytes17[${string}]`]: undefined;
94
+ [x: `bytes18[${string}]`]: undefined;
95
+ [x: `bytes19[${string}]`]: undefined;
96
+ [x: `bytes20[${string}]`]: undefined;
97
+ [x: `bytes21[${string}]`]: undefined;
98
+ [x: `bytes22[${string}]`]: undefined;
99
+ [x: `bytes23[${string}]`]: undefined;
100
+ [x: `bytes24[${string}]`]: undefined;
101
+ [x: `bytes25[${string}]`]: undefined;
102
+ [x: `bytes26[${string}]`]: undefined;
103
+ [x: `bytes27[${string}]`]: undefined;
104
+ [x: `bytes28[${string}]`]: undefined;
105
+ [x: `bytes29[${string}]`]: undefined;
106
+ [x: `bytes30[${string}]`]: undefined;
107
+ [x: `bytes31[${string}]`]: undefined;
108
+ [x: `bytes32[${string}]`]: undefined;
109
+ [x: `int[${string}]`]: undefined;
110
+ [x: `int16[${string}]`]: undefined;
111
+ [x: `int8[${string}]`]: undefined;
112
+ [x: `int24[${string}]`]: undefined;
113
+ [x: `int32[${string}]`]: undefined;
114
+ [x: `int40[${string}]`]: undefined;
115
+ [x: `int48[${string}]`]: undefined;
116
+ [x: `int56[${string}]`]: undefined;
117
+ [x: `int64[${string}]`]: undefined;
118
+ [x: `int72[${string}]`]: undefined;
119
+ [x: `int80[${string}]`]: undefined;
120
+ [x: `int88[${string}]`]: undefined;
121
+ [x: `int96[${string}]`]: undefined;
122
+ [x: `int104[${string}]`]: undefined;
123
+ [x: `int112[${string}]`]: undefined;
124
+ [x: `int120[${string}]`]: undefined;
125
+ [x: `int128[${string}]`]: undefined;
126
+ [x: `int136[${string}]`]: undefined;
127
+ [x: `int144[${string}]`]: undefined;
128
+ [x: `int152[${string}]`]: undefined;
129
+ [x: `int160[${string}]`]: undefined;
130
+ [x: `int168[${string}]`]: undefined;
131
+ [x: `int176[${string}]`]: undefined;
132
+ [x: `int184[${string}]`]: undefined;
133
+ [x: `int192[${string}]`]: undefined;
134
+ [x: `int200[${string}]`]: undefined;
135
+ [x: `int208[${string}]`]: undefined;
136
+ [x: `int216[${string}]`]: undefined;
137
+ [x: `int224[${string}]`]: undefined;
138
+ [x: `int232[${string}]`]: undefined;
139
+ [x: `int240[${string}]`]: undefined;
140
+ [x: `int248[${string}]`]: undefined;
141
+ [x: `int256[${string}]`]: undefined;
142
+ [x: `uint[${string}]`]: undefined;
143
+ [x: `uint16[${string}]`]: undefined;
144
+ [x: `uint8[${string}]`]: undefined;
145
+ [x: `uint24[${string}]`]: undefined;
146
+ [x: `uint32[${string}]`]: undefined;
147
+ [x: `uint40[${string}]`]: undefined;
148
+ [x: `uint48[${string}]`]: undefined;
149
+ [x: `uint56[${string}]`]: undefined;
150
+ [x: `uint64[${string}]`]: undefined;
151
+ [x: `uint72[${string}]`]: undefined;
152
+ [x: `uint80[${string}]`]: undefined;
153
+ [x: `uint88[${string}]`]: undefined;
154
+ [x: `uint96[${string}]`]: undefined;
155
+ [x: `uint104[${string}]`]: undefined;
156
+ [x: `uint112[${string}]`]: undefined;
157
+ [x: `uint120[${string}]`]: undefined;
158
+ [x: `uint128[${string}]`]: undefined;
159
+ [x: `uint136[${string}]`]: undefined;
160
+ [x: `uint144[${string}]`]: undefined;
161
+ [x: `uint152[${string}]`]: undefined;
162
+ [x: `uint160[${string}]`]: undefined;
163
+ [x: `uint168[${string}]`]: undefined;
164
+ [x: `uint176[${string}]`]: undefined;
165
+ [x: `uint184[${string}]`]: undefined;
166
+ [x: `uint192[${string}]`]: undefined;
167
+ [x: `uint200[${string}]`]: undefined;
168
+ [x: `uint208[${string}]`]: undefined;
169
+ [x: `uint216[${string}]`]: undefined;
170
+ [x: `uint224[${string}]`]: undefined;
171
+ [x: `uint232[${string}]`]: undefined;
172
+ [x: `uint240[${string}]`]: undefined;
173
+ [x: `uint248[${string}]`]: undefined;
174
+ [x: `uint256[${string}]`]: undefined;
175
+ string?: undefined;
176
+ address?: undefined;
177
+ bool?: undefined;
178
+ bytes?: undefined;
179
+ bytes16?: undefined;
180
+ bytes1?: undefined;
181
+ bytes2?: undefined;
182
+ bytes3?: undefined;
183
+ bytes4?: undefined;
184
+ bytes5?: undefined;
185
+ bytes6?: undefined;
186
+ bytes7?: undefined;
187
+ bytes8?: undefined;
188
+ bytes9?: undefined;
189
+ bytes10?: undefined;
190
+ bytes11?: undefined;
191
+ bytes12?: undefined;
192
+ bytes13?: undefined;
193
+ bytes14?: undefined;
194
+ bytes15?: undefined;
195
+ bytes17?: undefined;
196
+ bytes18?: undefined;
197
+ bytes19?: undefined;
198
+ bytes20?: undefined;
199
+ bytes21?: undefined;
200
+ bytes22?: undefined;
201
+ bytes23?: undefined;
202
+ bytes24?: undefined;
203
+ bytes25?: undefined;
204
+ bytes26?: undefined;
205
+ bytes27?: undefined;
206
+ bytes28?: undefined;
207
+ bytes29?: undefined;
208
+ bytes30?: undefined;
209
+ bytes31?: undefined;
210
+ bytes32?: undefined;
211
+ int16?: undefined;
212
+ int8?: undefined;
213
+ int24?: undefined;
214
+ int32?: undefined;
215
+ int40?: undefined;
216
+ int48?: undefined;
217
+ int56?: undefined;
218
+ int64?: undefined;
219
+ int72?: undefined;
220
+ int80?: undefined;
221
+ int88?: undefined;
222
+ int96?: undefined;
223
+ int104?: undefined;
224
+ int112?: undefined;
225
+ int120?: undefined;
226
+ int128?: undefined;
227
+ int136?: undefined;
228
+ int144?: undefined;
229
+ int152?: undefined;
230
+ int160?: undefined;
231
+ int168?: undefined;
232
+ int176?: undefined;
233
+ int184?: undefined;
234
+ int192?: undefined;
235
+ int200?: undefined;
236
+ int208?: undefined;
237
+ int216?: undefined;
238
+ int224?: undefined;
239
+ int232?: undefined;
240
+ int240?: undefined;
241
+ int248?: undefined;
242
+ int256?: undefined;
243
+ uint16?: undefined;
244
+ uint8?: undefined;
245
+ uint24?: undefined;
246
+ uint32?: undefined;
247
+ uint40?: undefined;
248
+ uint48?: undefined;
249
+ uint56?: undefined;
250
+ uint64?: undefined;
251
+ uint72?: undefined;
252
+ uint80?: undefined;
253
+ uint88?: undefined;
254
+ uint96?: undefined;
255
+ uint104?: undefined;
256
+ uint112?: undefined;
257
+ uint120?: undefined;
258
+ uint128?: undefined;
259
+ uint136?: undefined;
260
+ uint144?: undefined;
261
+ uint152?: undefined;
262
+ uint160?: undefined;
263
+ uint168?: undefined;
264
+ uint176?: undefined;
265
+ uint184?: undefined;
266
+ uint192?: undefined;
267
+ uint200?: undefined;
268
+ uint208?: undefined;
269
+ uint216?: undefined;
270
+ uint224?: undefined;
271
+ uint232?: undefined;
272
+ uint240?: undefined;
273
+ uint248?: undefined;
274
+ uint256?: undefined;
275
+ } | {
276
+ [key: string]: unknown;
277
+ }, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, Account>) => Promise<`0x${string}`>;
278
+ switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
279
+ watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
280
+ writeContract: <const TAbi_1 extends import("viem").Abi | readonly unknown[], TFunctionName extends string, TChainOverride_4 extends Chain | undefined = undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, Chain, Account, TChainOverride_4>) => Promise<`0x${string}`>;
281
+ extend: <const client extends {
282
+ [x: string]: unknown;
283
+ account?: undefined;
284
+ batch?: undefined;
285
+ cacheTime?: undefined;
286
+ chain?: undefined;
287
+ key?: undefined;
288
+ name?: undefined;
289
+ pollingInterval?: undefined;
290
+ request?: undefined;
291
+ transport?: undefined;
292
+ type?: undefined;
293
+ uid?: undefined;
294
+ } & Partial<Pick<import("viem").PublicActions, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<Transport, Chain, Account, import("viem").WalletRpcSchema, import("viem").WalletActions<Chain, Account>>) => client) => import("viem").Client<Transport, Chain, Account, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<Chain, Account>>;
295
+ } | {
296
+ account: {
297
+ address: `0x${string}`;
298
+ type: "json-rpc";
299
+ };
300
+ batch?: {
301
+ multicall?: boolean | {
302
+ batchSize?: number | undefined;
303
+ wait?: number | undefined;
304
+ } | undefined;
305
+ } | undefined;
306
+ cacheTime: number;
307
+ chain: Chain;
308
+ key: string;
309
+ name: string;
310
+ pollingInterval: number;
311
+ request: import("viem").EIP1193RequestFn<import("viem").WalletRpcSchema>;
312
+ transport: import("viem").TransportConfig<"custom", import("viem").EIP1193RequestFn>;
313
+ type: string;
314
+ uid: string;
315
+ addChain: (args: import("viem").AddChainParameters) => Promise<void>;
316
+ deployContract: <const TAbi_2 extends import("viem").Abi | readonly unknown[], TChainOverride_5 extends Chain | undefined = undefined>(args: import("viem").DeployContractParameters<TAbi_2, Chain, {
317
+ address: `0x${string}`;
318
+ type: "json-rpc";
319
+ }, TChainOverride_5>) => Promise<`0x${string}`>;
320
+ getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
321
+ getChainId: () => Promise<number>;
322
+ getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
323
+ prepareTransactionRequest: <TChainOverride_6 extends Chain | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<Chain, {
324
+ address: `0x${string}`;
325
+ type: "json-rpc";
326
+ }, TChainOverride_6>) => Promise<import("viem").PrepareTransactionRequestReturnType>;
327
+ requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
328
+ requestPermissions: (args: {
329
+ [x: string]: Record<string, any>;
330
+ eth_accounts: Record<string, any>;
331
+ }) => Promise<import("viem").RequestPermissionsReturnType>;
332
+ sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
333
+ sendTransaction: <TChainOverride_7 extends Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<Chain, {
334
+ address: `0x${string}`;
335
+ type: "json-rpc";
336
+ }, TChainOverride_7>) => Promise<`0x${string}`>;
337
+ signMessage: (args: import("viem").SignMessageParameters<{
338
+ address: `0x${string}`;
339
+ type: "json-rpc";
340
+ }>) => Promise<`0x${string}`>;
341
+ signTransaction: <TChainOverride_8 extends Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<Chain, {
342
+ address: `0x${string}`;
343
+ type: "json-rpc";
344
+ }, TChainOverride_8>) => Promise<`0x${string}`>;
345
+ signTypedData: <const TTypedData_1 extends {
346
+ [x: string]: readonly import("viem").TypedDataParameter[];
347
+ [x: `string[${string}]`]: undefined;
348
+ [x: `function[${string}]`]: undefined;
349
+ [x: `address[${string}]`]: undefined;
350
+ [x: `bool[${string}]`]: undefined;
351
+ [x: `bytes[${string}]`]: undefined;
352
+ [x: `bytes16[${string}]`]: undefined;
353
+ [x: `bytes1[${string}]`]: undefined;
354
+ [x: `bytes2[${string}]`]: undefined;
355
+ [x: `bytes3[${string}]`]: undefined;
356
+ [x: `bytes4[${string}]`]: undefined;
357
+ [x: `bytes5[${string}]`]: undefined;
358
+ [x: `bytes6[${string}]`]: undefined;
359
+ [x: `bytes7[${string}]`]: undefined;
360
+ [x: `bytes8[${string}]`]: undefined;
361
+ [x: `bytes9[${string}]`]: undefined;
362
+ [x: `bytes10[${string}]`]: undefined;
363
+ [x: `bytes11[${string}]`]: undefined;
364
+ [x: `bytes12[${string}]`]: undefined;
365
+ [x: `bytes13[${string}]`]: undefined;
366
+ [x: `bytes14[${string}]`]: undefined;
367
+ [x: `bytes15[${string}]`]: undefined;
368
+ [x: `bytes17[${string}]`]: undefined;
369
+ [x: `bytes18[${string}]`]: undefined;
370
+ [x: `bytes19[${string}]`]: undefined;
371
+ [x: `bytes20[${string}]`]: undefined;
372
+ [x: `bytes21[${string}]`]: undefined;
373
+ [x: `bytes22[${string}]`]: undefined;
374
+ [x: `bytes23[${string}]`]: undefined;
375
+ [x: `bytes24[${string}]`]: undefined;
376
+ [x: `bytes25[${string}]`]: undefined;
377
+ [x: `bytes26[${string}]`]: undefined;
378
+ [x: `bytes27[${string}]`]: undefined;
379
+ [x: `bytes28[${string}]`]: undefined;
380
+ [x: `bytes29[${string}]`]: undefined;
381
+ [x: `bytes30[${string}]`]: undefined;
382
+ [x: `bytes31[${string}]`]: undefined;
383
+ [x: `bytes32[${string}]`]: undefined;
384
+ [x: `int[${string}]`]: undefined;
385
+ [x: `int16[${string}]`]: undefined;
386
+ [x: `int8[${string}]`]: undefined;
387
+ [x: `int24[${string}]`]: undefined;
388
+ [x: `int32[${string}]`]: undefined;
389
+ [x: `int40[${string}]`]: undefined;
390
+ [x: `int48[${string}]`]: undefined;
391
+ [x: `int56[${string}]`]: undefined;
392
+ [x: `int64[${string}]`]: undefined;
393
+ [x: `int72[${string}]`]: undefined;
394
+ [x: `int80[${string}]`]: undefined;
395
+ [x: `int88[${string}]`]: undefined;
396
+ [x: `int96[${string}]`]: undefined;
397
+ [x: `int104[${string}]`]: undefined;
398
+ [x: `int112[${string}]`]: undefined;
399
+ [x: `int120[${string}]`]: undefined;
400
+ [x: `int128[${string}]`]: undefined;
401
+ [x: `int136[${string}]`]: undefined;
402
+ [x: `int144[${string}]`]: undefined;
403
+ [x: `int152[${string}]`]: undefined;
404
+ [x: `int160[${string}]`]: undefined;
405
+ [x: `int168[${string}]`]: undefined;
406
+ [x: `int176[${string}]`]: undefined;
407
+ [x: `int184[${string}]`]: undefined;
408
+ [x: `int192[${string}]`]: undefined;
409
+ [x: `int200[${string}]`]: undefined;
410
+ [x: `int208[${string}]`]: undefined;
411
+ [x: `int216[${string}]`]: undefined;
412
+ [x: `int224[${string}]`]: undefined;
413
+ [x: `int232[${string}]`]: undefined;
414
+ [x: `int240[${string}]`]: undefined;
415
+ [x: `int248[${string}]`]: undefined;
416
+ [x: `int256[${string}]`]: undefined;
417
+ [x: `uint[${string}]`]: undefined;
418
+ [x: `uint16[${string}]`]: undefined;
419
+ [x: `uint8[${string}]`]: undefined;
420
+ [x: `uint24[${string}]`]: undefined;
421
+ [x: `uint32[${string}]`]: undefined;
422
+ [x: `uint40[${string}]`]: undefined;
423
+ [x: `uint48[${string}]`]: undefined;
424
+ [x: `uint56[${string}]`]: undefined;
425
+ [x: `uint64[${string}]`]: undefined;
426
+ [x: `uint72[${string}]`]: undefined;
427
+ [x: `uint80[${string}]`]: undefined;
428
+ [x: `uint88[${string}]`]: undefined;
429
+ [x: `uint96[${string}]`]: undefined;
430
+ [x: `uint104[${string}]`]: undefined;
431
+ [x: `uint112[${string}]`]: undefined;
432
+ [x: `uint120[${string}]`]: undefined;
433
+ [x: `uint128[${string}]`]: undefined;
434
+ [x: `uint136[${string}]`]: undefined;
435
+ [x: `uint144[${string}]`]: undefined;
436
+ [x: `uint152[${string}]`]: undefined;
437
+ [x: `uint160[${string}]`]: undefined;
438
+ [x: `uint168[${string}]`]: undefined;
439
+ [x: `uint176[${string}]`]: undefined;
440
+ [x: `uint184[${string}]`]: undefined;
441
+ [x: `uint192[${string}]`]: undefined;
442
+ [x: `uint200[${string}]`]: undefined;
443
+ [x: `uint208[${string}]`]: undefined;
444
+ [x: `uint216[${string}]`]: undefined;
445
+ [x: `uint224[${string}]`]: undefined;
446
+ [x: `uint232[${string}]`]: undefined;
447
+ [x: `uint240[${string}]`]: undefined;
448
+ [x: `uint248[${string}]`]: undefined;
449
+ [x: `uint256[${string}]`]: undefined;
450
+ string?: undefined;
451
+ address?: undefined;
452
+ bool?: undefined;
453
+ bytes?: undefined;
454
+ bytes16?: undefined;
455
+ bytes1?: undefined;
456
+ bytes2?: undefined;
457
+ bytes3?: undefined;
458
+ bytes4?: undefined;
459
+ bytes5?: undefined;
460
+ bytes6?: undefined;
461
+ bytes7?: undefined;
462
+ bytes8?: undefined;
463
+ bytes9?: undefined;
464
+ bytes10?: undefined;
465
+ bytes11?: undefined;
466
+ bytes12?: undefined;
467
+ bytes13?: undefined;
468
+ bytes14?: undefined;
469
+ bytes15?: undefined;
470
+ bytes17?: undefined;
471
+ bytes18?: undefined;
472
+ bytes19?: undefined;
473
+ bytes20?: undefined;
474
+ bytes21?: undefined;
475
+ bytes22?: undefined;
476
+ bytes23?: undefined;
477
+ bytes24?: undefined;
478
+ bytes25?: undefined;
479
+ bytes26?: undefined;
480
+ bytes27?: undefined;
481
+ bytes28?: undefined;
482
+ bytes29?: undefined;
483
+ bytes30?: undefined;
484
+ bytes31?: undefined;
485
+ bytes32?: undefined;
486
+ int16?: undefined;
487
+ int8?: undefined;
488
+ int24?: undefined;
489
+ int32?: undefined;
490
+ int40?: undefined;
491
+ int48?: undefined;
492
+ int56?: undefined;
493
+ int64?: undefined;
494
+ int72?: undefined;
495
+ int80?: undefined;
496
+ int88?: undefined;
497
+ int96?: undefined;
498
+ int104?: undefined;
499
+ int112?: undefined;
500
+ int120?: undefined;
501
+ int128?: undefined;
502
+ int136?: undefined;
503
+ int144?: undefined;
504
+ int152?: undefined;
505
+ int160?: undefined;
506
+ int168?: undefined;
507
+ int176?: undefined;
508
+ int184?: undefined;
509
+ int192?: undefined;
510
+ int200?: undefined;
511
+ int208?: undefined;
512
+ int216?: undefined;
513
+ int224?: undefined;
514
+ int232?: undefined;
515
+ int240?: undefined;
516
+ int248?: undefined;
517
+ int256?: undefined;
518
+ uint16?: undefined;
519
+ uint8?: undefined;
520
+ uint24?: undefined;
521
+ uint32?: undefined;
522
+ uint40?: undefined;
523
+ uint48?: undefined;
524
+ uint56?: undefined;
525
+ uint64?: undefined;
526
+ uint72?: undefined;
527
+ uint80?: undefined;
528
+ uint88?: undefined;
529
+ uint96?: undefined;
530
+ uint104?: undefined;
531
+ uint112?: undefined;
532
+ uint120?: undefined;
533
+ uint128?: undefined;
534
+ uint136?: undefined;
535
+ uint144?: undefined;
536
+ uint152?: undefined;
537
+ uint160?: undefined;
538
+ uint168?: undefined;
539
+ uint176?: undefined;
540
+ uint184?: undefined;
541
+ uint192?: undefined;
542
+ uint200?: undefined;
543
+ uint208?: undefined;
544
+ uint216?: undefined;
545
+ uint224?: undefined;
546
+ uint232?: undefined;
547
+ uint240?: undefined;
548
+ uint248?: undefined;
549
+ uint256?: undefined;
550
+ } | {
551
+ [key: string]: unknown;
552
+ }, TPrimaryType_1 extends string>(args: import("viem").SignTypedDataParameters<TTypedData_1, TPrimaryType_1, {
553
+ address: `0x${string}`;
554
+ type: "json-rpc";
555
+ }>) => Promise<`0x${string}`>;
556
+ switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
557
+ watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
558
+ writeContract: <const TAbi_3 extends import("viem").Abi | readonly unknown[], TFunctionName_1 extends string, TChainOverride_9 extends Chain | undefined = undefined>(args: import("viem").WriteContractParameters<TAbi_3, TFunctionName_1, Chain, {
559
+ address: `0x${string}`;
560
+ type: "json-rpc";
561
+ }, TChainOverride_9>) => Promise<`0x${string}`>;
562
+ extend: <const client_1 extends {
563
+ [x: string]: unknown;
564
+ account?: undefined;
565
+ batch?: undefined;
566
+ cacheTime?: undefined;
567
+ chain?: undefined;
568
+ key?: undefined;
569
+ name?: undefined;
570
+ pollingInterval?: undefined;
571
+ request?: undefined;
572
+ transport?: undefined;
573
+ type?: undefined;
574
+ uid?: undefined;
575
+ } & Partial<Pick<import("viem").PublicActions, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").CustomTransport, Chain, {
576
+ address: `0x${string}`;
577
+ type: "json-rpc";
578
+ }, import("viem").WalletRpcSchema, import("viem").WalletActions<Chain, {
579
+ address: `0x${string}`;
580
+ type: "json-rpc";
581
+ }>>) => client_1) => import("viem").Client<import("viem").CustomTransport, Chain, {
582
+ address: `0x${string}`;
583
+ type: "json-rpc";
584
+ }, import("viem").WalletRpcSchema, { [K_1 in keyof client_1]: client_1[K_1]; } & import("viem").WalletActions<Chain, {
585
+ address: `0x${string}`;
586
+ type: "json-rpc";
587
+ }>>;
588
+ }>;
35
589
  isAuthorized(): Promise<boolean>;
36
590
  switchChain?(chainId: number): Promise<Chain>;
37
591
  watchAsset?(asset: {
@@ -3,7 +3,7 @@ import { Connector as Connector$1 } from 'wagmi';
3
3
  import { getAddress, createWalletClient, custom, toHex } from 'viem';
4
4
 
5
5
  class Connector extends Connector$1 {
6
- constructor({ chains, handleLogOut, walletConnector, }) {
6
+ constructor({ chains, handleLogOut, walletConnector, preventWagmiSyncFromCallingLogout, }) {
7
7
  super({ chains, options: undefined });
8
8
  // wagmi properties
9
9
  this.id = 'dynamic';
@@ -26,6 +26,7 @@ class Connector extends Connector$1 {
26
26
  this.handleLogOut = handleLogOut;
27
27
  this.walletConnector = walletConnector;
28
28
  this.id = `dynamic-${walletConnector.key}`;
29
+ this.preventWagmiSyncFromCallingLogout = preventWagmiSyncFromCallingLogout;
29
30
  }
30
31
  _onAccountsChanged({ accounts }) {
31
32
  this.onAccountsChanged(accounts);
@@ -56,13 +57,21 @@ class Connector extends Connector$1 {
56
57
  });
57
58
  }
58
59
  disconnect() {
59
- var _a, _b;
60
60
  return __awaiter(this, void 0, void 0, function* () {
61
61
  this.walletConnector.removeListener('accountChange', this._onAccountsChanged, this);
62
62
  this.walletConnector.removeListener('chainChange', this._onChainChanged, this);
63
63
  this.walletConnector.removeListener('disconnect', this._onDisconnect, this);
64
- yield ((_a = this.walletConnector) === null || _a === void 0 ? void 0 : _a.endSession());
65
- yield ((_b = this.handleLogOut) === null || _b === void 0 ? void 0 : _b.call(this));
64
+ if (!this.preventWagmiSyncFromCallingLogout.current) {
65
+ yield this.walletConnector.endSession();
66
+ yield this.handleLogOut();
67
+ }
68
+ /**
69
+ * In our own Dynamic Wagmi sync component, we will flip the flag to true before calling disconnect,
70
+ * and here it automatically flips back to false afterwards. This will prevent the Connector from
71
+ * calling handleLogOut when we are the ones calling disconnect, but will preserve the existing behavior
72
+ * for customers who use useDisconnect directly.
73
+ */
74
+ this.preventWagmiSyncFromCallingLogout.current = false;
66
75
  });
67
76
  }
68
77
  getAccount() {
@@ -96,14 +105,16 @@ class Connector extends Connector$1 {
96
105
  getWalletClient(config) {
97
106
  var _a;
98
107
  return __awaiter(this, void 0, void 0, function* () {
99
- const signer = yield ((_a = this.walletConnector) === null || _a === void 0 ? void 0 : _a.getSigner());
100
- if (signer === null || signer === void 0 ? void 0 : signer.account) {
108
+ const signer = yield this.walletConnector.getSigner();
109
+ if (signer.account && signer.chain) {
101
110
  return signer;
102
111
  }
103
- return createWalletClient({
112
+ const walletClient = createWalletClient({
104
113
  account: yield this.getAccount(),
114
+ chain: (_a = this.chains.find((chain) => chain.id === (config === null || config === void 0 ? void 0 : config.chainId))) !== null && _a !== void 0 ? _a : this.chains[0],
105
115
  transport: custom(signer),
106
116
  });
117
+ return walletClient;
107
118
  });
108
119
  }
109
120
  isAuthorized() {
@@ -1,12 +1,12 @@
1
- import React, { useEffect, useMemo } from 'react';
1
+ import React, { useRef, useEffect, useMemo } from 'react';
2
2
  import { configureChains, mainnet, createConfig, WagmiConfig } from 'wagmi';
3
3
  import { publicProvider } from 'wagmi/providers/public';
4
4
  import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
5
5
  import { Connector } from './Connector.js';
6
- import { SyncDynamicWagmi } from './SyncDynamicWagmi.js';
6
+ import { getConnector } from './getConnector.js';
7
7
  import { getWagmiChainsFromDynamicChains } from './getWagmiChainsFromDynamicChains.js';
8
8
  import { getWagmiProvidersFromDynamicChains } from './getWagmiProvidersFromDynamicChains.js';
9
- import { getConnector } from './getConnector.js';
9
+ import { SyncDynamicWagmi } from './SyncDynamicWagmi.js';
10
10
 
11
11
  const { publicClient } = configureChains([mainnet], [publicProvider()]);
12
12
  const config = createConfig({
@@ -15,6 +15,11 @@ const config = createConfig({
15
15
  });
16
16
  const DynamicWagmiConnector = ({ evmNetworks: customerSuppliedEvmNetworks, children, }) => {
17
17
  const { networkConfigurations, handleLogOut, connectedWallets, linkedWallets, authMode, sendWagmiSettings, } = useDynamicContext();
18
+ /**
19
+ * This will prevent the wagmi Connector from calling handleLogOut when we are the ones calling disconnect
20
+ * as a result of a handleLogOut call (see SyncDynamicWagmi), but will preserve the existing behavior for customers.
21
+ */
22
+ const preventWagmiSyncFromCallingLogout = useRef(false);
18
23
  /**
19
24
  * Linked wallets are only available on connect-and-sign mode and the connected wallets
20
25
  * are only available on connect-only mode, the wallet const represents the current available
@@ -41,8 +46,9 @@ const DynamicWagmiConnector = ({ evmNetworks: customerSuppliedEvmNetworks, child
41
46
  const connector = useMemo(() => getConnector(wallets, (wallet) => new Connector({
42
47
  chains,
43
48
  handleLogOut,
49
+ preventWagmiSyncFromCallingLogout,
44
50
  walletConnector: wallet.connector,
45
- })), [wallets, chains, handleLogOut]);
51
+ })), [wallets, chains, handleLogOut, preventWagmiSyncFromCallingLogout]);
46
52
  /**
47
53
  * Updating the wagmi config must be done in a useEffect because
48
54
  * when setting the public client and connectors, wagmi will fire
@@ -57,7 +63,7 @@ const DynamicWagmiConnector = ({ evmNetworks: customerSuppliedEvmNetworks, child
57
63
  }, [connector, publicClient, webSocketPublicClient]);
58
64
  // use React.createElement to prevent bunding react/jsx-runtime,
59
65
  // which is not compatible when bundling apps using React 17
60
- return React.createElement(WagmiConfig, { config: config }, React.createElement(SyncDynamicWagmi, { connector, wallets }, children));
66
+ return React.createElement(WagmiConfig, { config: config }, React.createElement(SyncDynamicWagmi, { connector, preventWagmiSyncFromCallingLogout, wallets }, children));
61
67
  };
62
68
 
63
69
  export { DynamicWagmiConnector };
@@ -1,10 +1,11 @@
1
- import React from 'react';
1
+ import React, { MutableRefObject } from 'react';
2
2
  import { Wallet } from '@dynamic-labs/sdk-react-core';
3
3
  import { Connector } from './Connector';
4
4
  export type SyncDynamicWagmiProps = React.PropsWithChildren<{
5
5
  connector: Connector | undefined;
6
6
  wallets: Wallet[];
7
+ preventWagmiSyncFromCallingLogout: MutableRefObject<boolean>;
7
8
  }>;
8
- export declare const SyncDynamicWagmi: ({ children, connector, wallets, }: SyncDynamicWagmiProps) => React.FunctionComponentElement<{
9
+ export declare const SyncDynamicWagmi: ({ children, connector, wallets, preventWagmiSyncFromCallingLogout, }: SyncDynamicWagmiProps) => React.FunctionComponentElement<{
9
10
  children?: React.ReactNode;
10
11
  }>;
@@ -2,7 +2,7 @@ import React, { useRef, useEffect } from 'react';
2
2
  import { useConfig, useConnect, useDisconnect } from 'wagmi';
3
3
  import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
4
4
 
5
- const SyncDynamicWagmi = ({ children, connector, wallets, }) => {
5
+ const SyncDynamicWagmi = ({ children, connector, wallets, preventWagmiSyncFromCallingLogout, }) => {
6
6
  const { status: clientStatus } = useConfig();
7
7
  const { connect } = useConnect();
8
8
  const { disconnect } = useDisconnect();
@@ -21,6 +21,11 @@ const SyncDynamicWagmi = ({ children, connector, wallets, }) => {
21
21
  * layouts
22
22
  */
23
23
  if (isConnected) {
24
+ /**
25
+ * This will prevent the Connector from calling handleLogOut when we are the ones calling disconnect,
26
+ * but will preserve the existing behavior for customers who use useDisconnect directly.
27
+ */
28
+ preventWagmiSyncFromCallingLogout.current = true;
24
29
  disconnect();
25
30
  lastConnectedConnectorId.current = undefined;
26
31
  }
@@ -42,6 +47,7 @@ const SyncDynamicWagmi = ({ children, connector, wallets, }) => {
42
47
  connector,
43
48
  disconnect,
44
49
  lastConnectedConnectorId,
50
+ preventWagmiSyncFromCallingLogout,
45
51
  walletConnector,
46
52
  wallets,
47
53
  ]);