@dynamic-labs/ethereum 2.0.0-alpha.9 → 2.1.0-alpha.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 +316 -0
- package/package.json +10 -9
- package/src/EthWalletConnector.cjs +12 -1
- package/src/EthWalletConnector.d.ts +13 -10
- package/src/EthWalletConnector.js +12 -1
- package/src/coinbase/client/client.cjs +14 -14
- package/src/coinbase/client/client.d.ts +5 -4
- package/src/coinbase/client/client.js +13 -13
- package/src/coinbase/client/types.d.ts +6 -3
- package/src/coinbase/coinbase.cjs +30 -13
- package/src/coinbase/coinbase.d.ts +5 -4
- package/src/coinbase/coinbase.js +31 -14
- package/src/ethProviderHelper.cjs +11 -6
- package/src/ethProviderHelper.d.ts +6 -4
- package/src/ethProviderHelper.js +11 -6
- package/src/index.cjs +3 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -2
- package/src/injected/InjectedWalletBase.cjs +28 -11
- package/src/injected/InjectedWalletBase.d.ts +2 -2
- package/src/injected/InjectedWalletBase.js +28 -11
- package/src/injected/PhantomEvm.cjs +3 -3
- package/src/injected/PhantomEvm.d.ts +1 -1
- package/src/injected/PhantomEvm.js +3 -3
- package/src/injected/Zerion.cjs +38 -0
- package/src/injected/Zerion.d.ts +10 -0
- package/src/injected/Zerion.js +34 -0
- package/src/injected/fetchInjectedWalletConnectors.cjs +25 -0
- package/src/injected/fetchInjectedWalletConnectors.js +25 -0
- package/src/utils/index.d.ts +1 -0
- package/src/utils/isEthWalletConnector/index.d.ts +1 -0
- package/src/utils/isEthWalletConnector/isEthWalletConnector.cjs +7 -0
- package/src/utils/isEthWalletConnector/isEthWalletConnector.d.ts +3 -0
- package/src/utils/isEthWalletConnector/isEthWalletConnector.js +3 -0
- package/src/walletConnect/index.d.ts +1 -1
- package/src/walletConnect/walletConnect.cjs +114 -75
- package/src/walletConnect/walletConnect.d.ts +19 -18
- package/src/walletConnect/walletConnect.js +113 -74
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,320 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.32...v2.1.0-alpha.0) (2024-04-15)
|
|
3
|
+
|
|
4
|
+
## [2.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2024-04-15)
|
|
5
|
+
|
|
6
|
+
## [2.0.0-alpha.31](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.30...v2.0.0-alpha.31) (2024-04-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support adding email for recovery to existing embedded wallet ([#5128](https://github.com/dynamic-labs/DynamicAuth/issues/5128)) ([477fd81](https://github.com/dynamic-labs/DynamicAuth/commit/477fd81ac00864284d9d2183c0b8c078a0a23a2b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* issue where customer also tries to use i18n.init ([#5267](https://github.com/dynamic-labs/DynamicAuth/issues/5267)) ([7f81f1e](https://github.com/dynamic-labs/DynamicAuth/commit/7f81f1e010fbc6408f6a5d6a37608235e947befa))
|
|
17
|
+
* smart wallet not loading correctly upon refresh when using non-embedded eoa wallet ([#5301](https://github.com/dynamic-labs/DynamicAuth/issues/5301)) ([e957317](https://github.com/dynamic-labs/DynamicAuth/commit/e9573173f6209773a0be5f4af37323f2be8d7906))
|
|
18
|
+
|
|
19
|
+
## [2.0.0-alpha.30](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.29...v2.0.0-alpha.30) (2024-04-11)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### ⚠ BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* add headless sms sign-in (#5274)
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* add headless sms sign-in ([#5274](https://github.com/dynamic-labs/DynamicAuth/issues/5274)) ([fffc293](https://github.com/dynamic-labs/DynamicAuth/commit/fffc293f85447a784e8c728d1586f3555ab1fbfa))
|
|
29
|
+
|
|
30
|
+
## [2.0.0-alpha.29](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.28...v2.0.0-alpha.29) (2024-04-10)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### ⚠ BREAKING CHANGES
|
|
34
|
+
|
|
35
|
+
* replace sdk-api with sdk-api-core (#5280)
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* add dynamic client context ([#5250](https://github.com/dynamic-labs/DynamicAuth/issues/5250)) ([778ebe6](https://github.com/dynamic-labs/DynamicAuth/commit/778ebe6313e0bf3c9876feb6eff5bf152c15c55e))
|
|
40
|
+
* **webview-controller:** fetch manifest and render Dynamic SDK ([#5287](https://github.com/dynamic-labs/DynamicAuth/issues/5287)) ([00e84ac](https://github.com/dynamic-labs/DynamicAuth/commit/00e84acc4bdda92bad91108788f8d7882d0790d6))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* don't render modal header component if there's no content ([#5269](https://github.com/dynamic-labs/DynamicAuth/issues/5269)) ([f4d7266](https://github.com/dynamic-labs/DynamicAuth/commit/f4d72668a5243108649774c6581733655f385cab))
|
|
46
|
+
* don't show get extension button when there are no download links ([#5276](https://github.com/dynamic-labs/DynamicAuth/issues/5276)) ([e8cf660](https://github.com/dynamic-labs/DynamicAuth/commit/e8cf66076a9914881a8edda69feb2fb192ac63a3))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
* replace sdk-api with sdk-api-core ([#5280](https://github.com/dynamic-labs/DynamicAuth/issues/5280)) ([da4b695](https://github.com/dynamic-labs/DynamicAuth/commit/da4b6955a81d6bfb5c994cd62e21e9ae11a4f454))
|
|
50
|
+
|
|
51
|
+
## [2.0.0-alpha.28](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.27...v2.0.0-alpha.28) (2024-04-10)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* improve bridge connect experience on mobile ([#5283](https://github.com/dynamic-labs/DynamicAuth/issues/5283)) ([155e4a9](https://github.com/dynamic-labs/DynamicAuth/commit/155e4a99e2cf5f78a1a5e91e774acbf170d6b083))
|
|
57
|
+
|
|
58
|
+
## [2.0.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.26...v2.0.0-alpha.27) (2024-04-09)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
* coinbase improvements ([#5268](https://github.com/dynamic-labs/DynamicAuth/issues/5268)) ([c10a6de](https://github.com/dynamic-labs/DynamicAuth/commit/c10a6debcacff6cd97f2436fbde387f85faa5682))
|
|
64
|
+
* show qr code for metamask on desktop when not installed ([#5262](https://github.com/dynamic-labs/DynamicAuth/issues/5262)) ([1dcb4d9](https://github.com/dynamic-labs/DynamicAuth/commit/1dcb4d98de8a95f6b11d7bad90b9059110087385))
|
|
65
|
+
* update title of hardware wallet select screen ([#5270](https://github.com/dynamic-labs/DynamicAuth/issues/5270)) ([6e8fe17](https://github.com/dynamic-labs/DynamicAuth/commit/6e8fe17306677786ccf528b97ab673b9ae6b57b9))
|
|
66
|
+
|
|
67
|
+
## [2.0.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.25...v2.0.0-alpha.26) (2024-04-08)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### ⚠ BREAKING CHANGES
|
|
71
|
+
|
|
72
|
+
* add onWalletAdded/onWalletRemoved callbacks and removed onConnect/onDisconnect/onLinkSuccess/onUnlinkSuccess (#5194)
|
|
73
|
+
* note:
|
|
74
|
+
- use "events" in favour of "eventsCallbacks"
|
|
75
|
+
- use "handlers.handleConnectedWallet" in favour of "eventsCallbacks.onBeforeConnectSuccessConfirmation"
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
* coinbase wallet settings ([#5233](https://github.com/dynamic-labs/DynamicAuth/issues/5233)) ([1b04411](https://github.com/dynamic-labs/DynamicAuth/commit/1b04411eb90db438f3eacf622d9c28db4c7cf532))
|
|
80
|
+
* remove local storage settings on logout ([#5212](https://github.com/dynamic-labs/DynamicAuth/issues/5212)) ([e686628](https://github.com/dynamic-labs/DynamicAuth/commit/e686628f602a44cd13083e7bb9afb4f50304390e))
|
|
81
|
+
* show app name or logo in sign message modal ([#5225](https://github.com/dynamic-labs/DynamicAuth/issues/5225)) ([a77b6ba](https://github.com/dynamic-labs/DynamicAuth/commit/a77b6ba9b5646b400ebf933949dabe06a35d1c81))
|
|
82
|
+
* user wallets not being cleared immediately when logout is called ([#5211](https://github.com/dynamic-labs/DynamicAuth/issues/5211)) ([a649c46](https://github.com/dynamic-labs/DynamicAuth/commit/a649c462d171cf6f8d67159df9f5f2144f315e5c))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
* add onWalletAdded/onWalletRemoved callbacks and removed onConnect/onDisconnect/onLinkSuccess/onUnlinkSuccess ([#5194](https://github.com/dynamic-labs/DynamicAuth/issues/5194)) ([fdec78c](https://github.com/dynamic-labs/DynamicAuth/commit/fdec78c1c32c58c8f7dc7ffd9b877320aa4d90e0))
|
|
86
|
+
* rename eventsCallbacks to events ([#5196](https://github.com/dynamic-labs/DynamicAuth/issues/5196)) ([5797185](https://github.com/dynamic-labs/DynamicAuth/commit/5797185c18fa091032ef27043b63a1d5201b5e23))
|
|
87
|
+
|
|
88
|
+
## [2.0.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.24...v2.0.0-alpha.25) (2024-04-04)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
### Features
|
|
92
|
+
|
|
93
|
+
* add in-app browser deeplink for metamask ([#5176](https://github.com/dynamic-labs/DynamicAuth/issues/5176)) ([02ce607](https://github.com/dynamic-labs/DynamicAuth/commit/02ce6077ed0deeaefc7a62ee91ff72f5bce2b327)), closes [#5123](https://github.com/dynamic-labs/DynamicAuth/issues/5123)
|
|
94
|
+
|
|
95
|
+
## [2.0.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.23...v2.0.0-alpha.24) (2024-04-03)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### ⚠ BREAKING CHANGES
|
|
99
|
+
|
|
100
|
+
* rename otp verification callbacks (#5180)
|
|
101
|
+
* remove deprecated isVerificationInProgress flag and setter (#5089)
|
|
102
|
+
|
|
103
|
+
### Features
|
|
104
|
+
|
|
105
|
+
* allow creating embedded wallets even if user signs in with a wallet ([#5093](https://github.com/dynamic-labs/DynamicAuth/issues/5093)) ([ba2dd62](https://github.com/dynamic-labs/DynamicAuth/commit/ba2dd625e0a7bf35018cf8aac8e80bd23b4e3b0f))
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Bug Fixes
|
|
109
|
+
|
|
110
|
+
* api unit test by removing api and sdk versions for assertion ([#5168](https://github.com/dynamic-labs/DynamicAuth/issues/5168)) ([6d3b8ad](https://github.com/dynamic-labs/DynamicAuth/commit/6d3b8adebe62a4f2a7878630384348b2c491d779))
|
|
111
|
+
* bug when phone input is empty ([#5139](https://github.com/dynamic-labs/DynamicAuth/issues/5139)) ([7155b63](https://github.com/dynamic-labs/DynamicAuth/commit/7155b63518d00ba807bc321c6740b341d0a8b82f))
|
|
112
|
+
* clear error message on otp resend for sms ([#5182](https://github.com/dynamic-labs/DynamicAuth/issues/5182)) ([f40b48c](https://github.com/dynamic-labs/DynamicAuth/commit/f40b48c7f58c8e3dfe73fb124d642c3b8f193cee))
|
|
113
|
+
* link farcaster account ([#5170](https://github.com/dynamic-labs/DynamicAuth/issues/5170)) ([10fe272](https://github.com/dynamic-labs/DynamicAuth/commit/10fe272247605b5f09385f063231e2c881399cc8))
|
|
114
|
+
* show correct otp message for sms verification failure ([#5177](https://github.com/dynamic-labs/DynamicAuth/issues/5177)) ([b3bcd76](https://github.com/dynamic-labs/DynamicAuth/commit/b3bcd7694047dac55ce37babb71684a418633f95))
|
|
115
|
+
* update wagmi connector id when wallet connector changes ([#5185](https://github.com/dynamic-labs/DynamicAuth/issues/5185)) ([14fb83a](https://github.com/dynamic-labs/DynamicAuth/commit/14fb83a22c8e39095b79cc9951cae3f00f4fca2f))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
* remove deprecated isVerificationInProgress flag and setter ([#5089](https://github.com/dynamic-labs/DynamicAuth/issues/5089)) ([060fef7](https://github.com/dynamic-labs/DynamicAuth/commit/060fef70df0c497e7a9b6e67ad0bfafef52c2bbb))
|
|
119
|
+
* rename otp verification callbacks ([#5180](https://github.com/dynamic-labs/DynamicAuth/issues/5180)) ([a580eec](https://github.com/dynamic-labs/DynamicAuth/commit/a580eec02d15b46a25c01d5473e4db2db89937e2))
|
|
120
|
+
|
|
121
|
+
## [2.0.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.22...v2.0.0-alpha.23) (2024-04-01)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### ⚠ BREAKING CHANGES
|
|
125
|
+
|
|
126
|
+
* implement proper solana embedded wallet signer (#5092)
|
|
127
|
+
* prevent adding temporary wallet connection to userWallets (#5104)
|
|
128
|
+
|
|
129
|
+
### Bug Fixes
|
|
130
|
+
|
|
131
|
+
* Multiple WC bug fixes ([#5142](https://github.com/dynamic-labs/DynamicAuth/issues/5142)) ([92236e6](https://github.com/dynamic-labs/DynamicAuth/commit/92236e6d74c28516403f6df79c539406ece3d6d0)) ([#5132](https://github.com/dynamic-labs/DynamicAuth/issues/5132)) ([99f564a](https://github.com/dynamic-labs/DynamicAuth/commit/99f564a39e35e28af0be2a03617f12aa19cbeb7f))
|
|
132
|
+
|
|
133
|
+
* Better handling of empty callback queue([#5147](https://github.com/dynamic-labs/DynamicAuth/issues/5147)) ([e2d6bf2](https://github.com/dynamic-labs/DynamicAuth/commit/e2d6bf2444ca01199796ead4136f34b81b6c9b61))
|
|
134
|
+
|
|
135
|
+
* multiple improvements to the wallet list ([#5112](https://github.com/dynamic-labs/DynamicAuth/issues/5112)) ([00eec5f](https://github.com/dynamic-labs/DynamicAuth/commit/00eec5fde70548c3d771260f3d86e5365e73878d))
|
|
136
|
+
|
|
137
|
+
* Improved scroll experience on ios ([#5152](https://github.com/dynamic-labs/DynamicAuth/issues/5152)) ([341704f](https://github.com/dynamic-labs/DynamicAuth/commit/341704f99cb6e06f253309f3a8afb1684bb8ae2a))
|
|
138
|
+
|
|
139
|
+
* better handling of multiwallet state([#5146](https://github.com/dynamic-labs/DynamicAuth/issues/5146)) ([403267b](https://github.com/dynamic-labs/DynamicAuth/commit/403267b3c268d648aba155e0b6fea31d7fdc1b56))
|
|
140
|
+
|
|
141
|
+
* show correct OTP error message ([#5135](https://github.com/dynamic-labs/DynamicAuth/issues/5135)) ([e7494ce](https://github.com/dynamic-labs/DynamicAuth/commit/e7494cee4a1b5132af91058cbcb2dae0b7eac44b))
|
|
142
|
+
|
|
143
|
+
* implement proper solana embedded wallet signer ([#5092](https://github.com/dynamic-labs/DynamicAuth/issues/5092)) ([7749b97](https://github.com/dynamic-labs/DynamicAuth/commit/7749b97db49fb9af8ae0668172f478e1f0c29665))
|
|
144
|
+
|
|
145
|
+
* prevent adding temporary wallet connection to userWallets ([#5104](https://github.com/dynamic-labs/DynamicAuth/issues/5104)) ([3c02b78](https://github.com/dynamic-labs/DynamicAuth/commit/3c02b781c997c63ff11a7f1c255b92d10962327f))
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
## [2.0.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.21...v2.0.0-alpha.22) (2024-03-27)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
### ⚠ BREAKING CHANGES
|
|
152
|
+
|
|
153
|
+
* remove isFullyConnected (#5066)
|
|
154
|
+
* remove and deprecated exported methods (#5065)
|
|
155
|
+
* remove emailOnly provider
|
|
156
|
+
|
|
157
|
+
### Features
|
|
158
|
+
|
|
159
|
+
* add method property to track which phantom connector function was called ([#5044](https://github.com/dynamic-labs/DynamicAuth/issues/5044)) ([f820cd4](https://github.com/dynamic-labs/DynamicAuth/commit/f820cd4c7e047fd5181115b4d388e54df682e5c8))
|
|
160
|
+
* add signAndSendTransaction to phantom redirect connector ([#5054](https://github.com/dynamic-labs/DynamicAuth/issues/5054)) ([694a300](https://github.com/dynamic-labs/DynamicAuth/commit/694a3003c8765098878a5c95174be5eba4509fc2))
|
|
161
|
+
* implement remaining signer methods on phantom redirect connector ([#5060](https://github.com/dynamic-labs/DynamicAuth/issues/5060)) ([29db446](https://github.com/dynamic-labs/DynamicAuth/commit/29db4464de6eea11c92a8080fed1eb3e7588b2b8))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### Bug Fixes
|
|
165
|
+
|
|
166
|
+
* add recommended wallet tags to the WalletSimpleSignIn component ([#5041](https://github.com/dynamic-labs/DynamicAuth/issues/5041)) ([aefde4d](https://github.com/dynamic-labs/DynamicAuth/commit/aefde4d927427c131dce4402eb3c705527c64e8f))
|
|
167
|
+
* display invalid phone number error ([#5103](https://github.com/dynamic-labs/DynamicAuth/issues/5103)) ([842c0ba](https://github.com/dynamic-labs/DynamicAuth/commit/842c0ba3cfe1120c166f12410efbc346d8e30ed0))
|
|
168
|
+
* ensure the user field modals uses the base widget context ([#5105](https://github.com/dynamic-labs/DynamicAuth/issues/5105)) ([aa2a545](https://github.com/dynamic-labs/DynamicAuth/commit/aa2a545bdbf6f38f4131ccdde61142389dbf5480))
|
|
169
|
+
* force aspect ratio for social icon pfps ([#5072](https://github.com/dynamic-labs/DynamicAuth/issues/5072)) ([6f611a7](https://github.com/dynamic-labs/DynamicAuth/commit/6f611a7cbe41d66796449b28af919bc93a7bae42))
|
|
170
|
+
* handle too many email verifications error ([#5051](https://github.com/dynamic-labs/DynamicAuth/issues/5051)) ([7af96df](https://github.com/dynamic-labs/DynamicAuth/commit/7af96dfb85cdc68577fdb8cc880e2fd09bcff5af))
|
|
171
|
+
* hardcode zerion provider and update walletbook to prevent showing up as metamask when not installed ([#5071](https://github.com/dynamic-labs/DynamicAuth/issues/5071)) ([3ab6c37](https://github.com/dynamic-labs/DynamicAuth/commit/3ab6c3772efe2c2e3259ca7a9dbb92e924314029))
|
|
172
|
+
* issue where ethereum is tree shaken ([#5028](https://github.com/dynamic-labs/DynamicAuth/issues/5028)) ([fda542d](https://github.com/dynamic-labs/DynamicAuth/commit/fda542db2b65a437004fe809a0ea9f90fde47b13))
|
|
173
|
+
* not clearing the loading when creating an embedded wallet ([323086f](https://github.com/dynamic-labs/DynamicAuth/commit/323086f673fb8a2108b8262181511987d0bc1d09))
|
|
174
|
+
* solflare double connection on page refresh ([#5083](https://github.com/dynamic-labs/DynamicAuth/issues/5083)) ([ef76005](https://github.com/dynamic-labs/DynamicAuth/commit/ef7600564b646cf45396287a0d6b6f1420473b04))
|
|
175
|
+
* swap out findProvider for getSigner on solflare ([#5057](https://github.com/dynamic-labs/DynamicAuth/issues/5057)) ([b78827f](https://github.com/dynamic-labs/DynamicAuth/commit/b78827f8fd87a594114908d890f58b8771123383))
|
|
176
|
+
* validate user session whenever user is connected/authenticated ([#5082](https://github.com/dynamic-labs/DynamicAuth/issues/5082)) ([432faa0](https://github.com/dynamic-labs/DynamicAuth/commit/432faa0a69b43cb7324a252a2450db3cbd3b4b12))
|
|
177
|
+
* walletconnect improvements and fixes ([#5085](https://github.com/dynamic-labs/DynamicAuth/issues/5085)) ([bb42566](https://github.com/dynamic-labs/DynamicAuth/commit/bb425666aef5071b7827ef0aa167a328493f1ae7))
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
* remove and deprecated exported methods ([#5065](https://github.com/dynamic-labs/DynamicAuth/issues/5065)) ([63af7ea](https://github.com/dynamic-labs/DynamicAuth/commit/63af7ea691b2112032de332f2b3558ac6260a38d))
|
|
181
|
+
* remove emailOnly provider ([60a30bc](https://github.com/dynamic-labs/DynamicAuth/commit/60a30bc2f242de19d9c6167279fc44b7f9395ac8))
|
|
182
|
+
* remove isFullyConnected ([#5066](https://github.com/dynamic-labs/DynamicAuth/issues/5066)) ([0a662d9](https://github.com/dynamic-labs/DynamicAuth/commit/0a662d9eda19045f13c21ad1b5238ca11594fde5))
|
|
183
|
+
|
|
184
|
+
## [2.0.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.20...v2.0.0-alpha.21) (2024-03-20)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Features
|
|
188
|
+
|
|
189
|
+
* implement barebones signer in PhantomRedirect connector ([#5043](https://github.com/dynamic-labs/DynamicAuth/issues/5043)) ([4d7ff79](https://github.com/dynamic-labs/DynamicAuth/commit/4d7ff79acfe554d651791139b5e1d23ebafe712c))
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
### Bug Fixes
|
|
193
|
+
|
|
194
|
+
* find embedded wallets when no chain is specified ([#5036](https://github.com/dynamic-labs/DynamicAuth/issues/5036)) ([ac50742](https://github.com/dynamic-labs/DynamicAuth/commit/ac50742c6002f48aae7b60c9ec094eb12df8dcca))
|
|
195
|
+
* ignore walletconnect chainChange event when it's the same chain ([#5029](https://github.com/dynamic-labs/DynamicAuth/issues/5029)) ([115311a](https://github.com/dynamic-labs/DynamicAuth/commit/115311a4a64ae35317b8864f93c38203566714fc))
|
|
196
|
+
|
|
197
|
+
## [2.0.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.19...v2.0.0-alpha.20) (2024-03-19)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
### Bug Fixes
|
|
201
|
+
|
|
202
|
+
* prevent solflare connect popping up on page refresh when connected ([#5032](https://github.com/dynamic-labs/DynamicAuth/issues/5032)) ([28175a9](https://github.com/dynamic-labs/DynamicAuth/commit/28175a9af43f3e7f2cab30148563eaf5573477d1))
|
|
203
|
+
* show correct user identifier in onboarding view ([#5021](https://github.com/dynamic-labs/DynamicAuth/issues/5021)) ([c84747f](https://github.com/dynamic-labs/DynamicAuth/commit/c84747f01eb2a0a827ca48e62f03739d4e6df136))
|
|
204
|
+
* use address as the wallet client account ([#5037](https://github.com/dynamic-labs/DynamicAuth/issues/5037)) ([287631e](https://github.com/dynamic-labs/DynamicAuth/commit/287631e9a027e3a39ee2ad6b45ca404febd03929))
|
|
205
|
+
|
|
206
|
+
## [2.0.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.18...v2.0.0-alpha.19) (2024-03-19)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
### Bug Fixes
|
|
210
|
+
|
|
211
|
+
* add localization to email form ([#5009](https://github.com/dynamic-labs/DynamicAuth/issues/5009)) ([f3c100c](https://github.com/dynamic-labs/DynamicAuth/commit/f3c100cb0b815880d11c6b619d94bfaa7330a115))
|
|
212
|
+
* include domain on signTypedData for ZeroDev connector ([#5017](https://github.com/dynamic-labs/DynamicAuth/issues/5017)) ([71c9131](https://github.com/dynamic-labs/DynamicAuth/commit/71c91311a75309810bc497c8f82981553ddc57fd))
|
|
213
|
+
* Remove Copy Address button if there is no wallet ([#4994](https://github.com/dynamic-labs/DynamicAuth/issues/4994)) ([fe1e641](https://github.com/dynamic-labs/DynamicAuth/commit/fe1e6417be2299e65ba4bcbc3347dfc27f021853))
|
|
214
|
+
|
|
215
|
+
## [2.0.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.17...v2.0.0-alpha.18) (2024-03-15)
|
|
216
|
+
|
|
217
|
+
## [2.0.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.16...v2.0.0-alpha.17) (2024-03-15)
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
### ⚠ BREAKING CHANGES
|
|
221
|
+
|
|
222
|
+
* rename prop canConnectViaEmail to requiresNonDynamicEmailOtp (#4991)
|
|
223
|
+
|
|
224
|
+
### Features
|
|
225
|
+
|
|
226
|
+
* allow creating embedded wallet with phone number without email ([#4953](https://github.com/dynamic-labs/DynamicAuth/issues/4953)) ([39d31cb](https://github.com/dynamic-labs/DynamicAuth/commit/39d31cbc969fff7acf53c0b6c5e5093ff846f3ea))
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
* rename prop canConnectViaEmail to requiresNonDynamicEmailOtp ([#4991](https://github.com/dynamic-labs/DynamicAuth/issues/4991)) ([e83a365](https://github.com/dynamic-labs/DynamicAuth/commit/e83a3658d4f5cf0630fc8f15be66f2d3db84ab98))
|
|
230
|
+
|
|
231
|
+
## [2.0.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.15...v2.0.0-alpha.16) (2024-03-15)
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
### Features
|
|
235
|
+
|
|
236
|
+
* add bundlerProvider prop to allow AA customers to select a provider ([#4975](https://github.com/dynamic-labs/DynamicAuth/issues/4975)) ([1870cef](https://github.com/dynamic-labs/DynamicAuth/commit/1870cef4f50944a86226d10f09ef7bf6595f3c95))
|
|
237
|
+
|
|
238
|
+
## [2.0.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.14...v2.0.0-alpha.15) (2024-03-15)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
### Features
|
|
242
|
+
|
|
243
|
+
* Add support for mobile farcaster signin ([#4973](https://github.com/dynamic-labs/DynamicAuth/issues/4973)) ([98261a4](https://github.com/dynamic-labs/DynamicAuth/commit/98261a47bd319cd93b36f5cdd6a9be0064887686))
|
|
244
|
+
|
|
245
|
+
## [2.0.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.13...v2.0.0-alpha.14) (2024-03-14)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
### Bug Fixes
|
|
249
|
+
|
|
250
|
+
* convert empty value when checking for gas sponsorship ([#4970](https://github.com/dynamic-labs/DynamicAuth/issues/4970)) ([8439a20](https://github.com/dynamic-labs/DynamicAuth/commit/8439a2035729150f33507b22c2678b16ae47976b))
|
|
251
|
+
* omit wallet connect on mobile ([#4954](https://github.com/dynamic-labs/DynamicAuth/issues/4954)) ([6ac29a8](https://github.com/dynamic-labs/DynamicAuth/commit/6ac29a8961dc010688425fb67a4fb621ca9f80b2))
|
|
252
|
+
|
|
253
|
+
## [2.0.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.12...v2.0.0-alpha.13) (2024-03-14)
|
|
254
|
+
|
|
255
|
+
## [2.0.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-03-13)
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
### Features
|
|
259
|
+
|
|
260
|
+
* add sign-in with farcaster ([#4947](https://github.com/dynamic-labs/DynamicAuth/issues/4947)) ([3927d24](https://github.com/dynamic-labs/DynamicAuth/commit/3927d24392a8944997ca05431c6ab54757be62d9))
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
### Bug Fixes
|
|
264
|
+
|
|
265
|
+
* wallet connect links with query params ([#4948](https://github.com/dynamic-labs/DynamicAuth/issues/4948)) ([0738130](https://github.com/dynamic-labs/DynamicAuth/commit/0738130f82473a197e035b8dd74d996bdbb24c11))
|
|
266
|
+
|
|
267
|
+
## [2.0.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.10...v2.0.0-alpha.11) (2024-03-12)
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
### ⚠ BREAKING CHANGES
|
|
271
|
+
|
|
272
|
+
* rename FetchPublicAddressOpts to GetAddressOpts (#4910)
|
|
273
|
+
* remove use effect in useWalletEventListeners (#4843)
|
|
274
|
+
* rename fetchPublicAddress to getAddress (#4851)
|
|
275
|
+
|
|
276
|
+
### Features
|
|
277
|
+
|
|
278
|
+
* Add farcaster to iconic ([#4925](https://github.com/dynamic-labs/DynamicAuth/issues/4925)) ([ab282dc](https://github.com/dynamic-labs/DynamicAuth/commit/ab282dc9cdcc0fe11f014d002b056ef4d3b34234))
|
|
279
|
+
* use transaction confirmation ui on signAndSendTransaction for solana embedded wallets ([#4909](https://github.com/dynamic-labs/DynamicAuth/issues/4909)) ([d77e89e](https://github.com/dynamic-labs/DynamicAuth/commit/d77e89ecff9dfc67ed48537f541a9995b2662e1e))
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
### Bug Fixes
|
|
283
|
+
|
|
284
|
+
* add back connect button css variables ([#4922](https://github.com/dynamic-labs/DynamicAuth/issues/4922)) ([1119d62](https://github.com/dynamic-labs/DynamicAuth/commit/1119d62c2db6504952393060930524c3823e4a00))
|
|
285
|
+
* keep adaptive wallet list height ([#4916](https://github.com/dynamic-labs/DynamicAuth/issues/4916)) ([62aa54e](https://github.com/dynamic-labs/DynamicAuth/commit/62aa54e81d563082f7aa519f2ff2b5132e7dd83d))
|
|
286
|
+
* pass account and chain to walletClient ([#4865](https://github.com/dynamic-labs/DynamicAuth/issues/4865)) ([17a143f](https://github.com/dynamic-labs/DynamicAuth/commit/17a143f87a77e56227b2517038c20cf67f8e08bf))
|
|
287
|
+
* update walletbook to fix zerion in-app browser detection issue ([#4917](https://github.com/dynamic-labs/DynamicAuth/issues/4917)) ([48b05d7](https://github.com/dynamic-labs/DynamicAuth/commit/48b05d78e4f7add09787b64505723d4eca34d3e0))
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
* remove use effect in useWalletEventListeners ([#4843](https://github.com/dynamic-labs/DynamicAuth/issues/4843)) ([2e948bb](https://github.com/dynamic-labs/DynamicAuth/commit/2e948bbca0dbdceab7460a844d0988eacd47f581))
|
|
291
|
+
* rename fetchPublicAddress to getAddress ([#4851](https://github.com/dynamic-labs/DynamicAuth/issues/4851)) ([668e7dd](https://github.com/dynamic-labs/DynamicAuth/commit/668e7dd62e1f323dbe64209b5c59c2cd0ee45d61))
|
|
292
|
+
* rename FetchPublicAddressOpts to GetAddressOpts ([#4910](https://github.com/dynamic-labs/DynamicAuth/issues/4910)) ([e5e4b1b](https://github.com/dynamic-labs/DynamicAuth/commit/e5e4b1b08a4e010afa44f8abb0bf6af7f236a86a))
|
|
293
|
+
|
|
294
|
+
## [2.0.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.9...v2.0.0-alpha.10) (2024-03-08)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
### ⚠ BREAKING CHANGES
|
|
298
|
+
|
|
299
|
+
* rename hideEmbeddedWalletUIs prop to hideEmbeddedWalletTra… (#4892)
|
|
300
|
+
* refactor send transaction for multi chain (#4831)
|
|
301
|
+
|
|
302
|
+
### Features
|
|
303
|
+
|
|
304
|
+
* add sandbox indicator to sdk ([62fd821](https://github.com/dynamic-labs/DynamicAuth/commit/62fd821a895bb54cec4cae3d153aa0056a7e6638))
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
### Bug Fixes
|
|
308
|
+
|
|
309
|
+
* coinbase connector and auth fetcher no being set properly ([#4891](https://github.com/dynamic-labs/DynamicAuth/issues/4891)) ([328566f](https://github.com/dynamic-labs/DynamicAuth/commit/328566ff39c38d5b5761ddc655de3a5d08bb567a))
|
|
310
|
+
* fix server side rendering ([#4811](https://github.com/dynamic-labs/DynamicAuth/issues/4811)) ([063dfae](https://github.com/dynamic-labs/DynamicAuth/commit/063dfae8b6750875d2f35dd9709a1f675495f4fb))
|
|
311
|
+
* hide network ([#4885](https://github.com/dynamic-labs/DynamicAuth/issues/4885)) ([ec10c58](https://github.com/dynamic-labs/DynamicAuth/commit/ec10c588218f067e991d5830fc06ec081e4e1d18))
|
|
312
|
+
* network picker on mobile ([#4887](https://github.com/dynamic-labs/DynamicAuth/issues/4887)) ([6e0ab1b](https://github.com/dynamic-labs/DynamicAuth/commit/6e0ab1bc7d138b73373741960a501ff7cf20e3f9))
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
* refactor send transaction for multi chain ([#4831](https://github.com/dynamic-labs/DynamicAuth/issues/4831)) ([c98444b](https://github.com/dynamic-labs/DynamicAuth/commit/c98444be7935420dda3d8216d03946f5893eb82f))
|
|
316
|
+
* rename hideEmbeddedWalletUIs prop to hideEmbeddedWalletTra… ([#4892](https://github.com/dynamic-labs/DynamicAuth/issues/4892)) ([7cdf519](https://github.com/dynamic-labs/DynamicAuth/commit/7cdf5196b1cd8516de2d456163fe9071956d40d3))
|
|
317
|
+
|
|
2
318
|
## [2.0.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.8...v2.0.0-alpha.9) (2024-03-06)
|
|
3
319
|
|
|
4
320
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0-alpha.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -26,16 +26,17 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@coinbase/wallet-sdk": "3.9.
|
|
30
|
-
"@walletconnect/
|
|
29
|
+
"@coinbase/wallet-sdk": "3.9.3",
|
|
30
|
+
"@walletconnect/ethereum-provider": "2.11.2",
|
|
31
31
|
"eventemitter3": "5.0.1",
|
|
32
32
|
"buffer": "6.0.3",
|
|
33
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.
|
|
34
|
-
"@dynamic-labs/turnkey": "2.
|
|
35
|
-
"@dynamic-labs/types": "2.
|
|
36
|
-
"@dynamic-labs/utils": "2.
|
|
37
|
-
"@dynamic-labs/
|
|
38
|
-
"@dynamic-labs/wallet-
|
|
33
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.0",
|
|
34
|
+
"@dynamic-labs/turnkey": "2.1.0-alpha.0",
|
|
35
|
+
"@dynamic-labs/types": "2.1.0-alpha.0",
|
|
36
|
+
"@dynamic-labs/utils": "2.1.0-alpha.0",
|
|
37
|
+
"@dynamic-labs/viem-utils": "2.1.0-alpha.0",
|
|
38
|
+
"@dynamic-labs/wallet-book": "2.1.0-alpha.0",
|
|
39
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.0",
|
|
39
40
|
"stream": "0.0.2"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../_virtual/_tslib.cjs');
|
|
6
6
|
var viem = require('viem');
|
|
7
|
+
var accounts = require('viem/accounts');
|
|
7
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
9
|
var utils = require('@dynamic-labs/utils');
|
|
9
10
|
var findEvmNetwork = require('./utils/findEvmNetwork.cjs');
|
|
@@ -130,10 +131,14 @@ class EthWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
130
131
|
const provider = this.getWalletClient();
|
|
131
132
|
if (!provider)
|
|
132
133
|
return [];
|
|
133
|
-
|
|
134
|
+
const addresses = yield utils.retryableFn(provider.getAddresses, {
|
|
134
135
|
fallbackValue: [],
|
|
135
136
|
timeoutMs: 300,
|
|
136
137
|
});
|
|
138
|
+
if (addresses.length) {
|
|
139
|
+
this.setActiveAccount(addresses[0]);
|
|
140
|
+
}
|
|
141
|
+
return addresses;
|
|
137
142
|
});
|
|
138
143
|
}
|
|
139
144
|
providerSwitchNetwork({ network, provider, }) {
|
|
@@ -187,6 +192,12 @@ class EthWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
187
192
|
}
|
|
188
193
|
});
|
|
189
194
|
}
|
|
195
|
+
setActiveAccount(account) {
|
|
196
|
+
this.activeAccount = account ? accounts.toAccount(account) : undefined;
|
|
197
|
+
}
|
|
198
|
+
getActiveAccount() {
|
|
199
|
+
return this.activeAccount;
|
|
200
|
+
}
|
|
190
201
|
}
|
|
191
202
|
|
|
192
203
|
exports.EthWalletConnector = EthWalletConnector;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WalletClient, PublicClient } from 'viem';
|
|
1
|
+
import { WalletClient, PublicClient, Account, Hex } from 'viem';
|
|
2
2
|
import { NameServiceData, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { EvmNetwork, GenericNetwork } from '@dynamic-labs/types';
|
|
4
4
|
import { IChainRpcProviders } from '@dynamic-labs/rpc-provider-ethereum';
|
|
@@ -17,13 +17,14 @@ export type EthWalletConnectorOpts = {
|
|
|
17
17
|
};
|
|
18
18
|
export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
19
19
|
evmNetworks: EvmNetwork[];
|
|
20
|
+
private activeAccount;
|
|
20
21
|
abstract getWalletClient(): WalletClient | undefined;
|
|
21
22
|
getPublicClient(): Promise<PublicClient | undefined>;
|
|
22
23
|
constructor(props: EthWalletConnectorOpts);
|
|
23
24
|
getNetwork(): Promise<number | undefined>;
|
|
24
25
|
getNameService(): Promise<NameServiceData | undefined>;
|
|
25
26
|
getSigner(): Promise<{
|
|
26
|
-
account:
|
|
27
|
+
account: Account | undefined;
|
|
27
28
|
batch?: {
|
|
28
29
|
multicall?: boolean | {
|
|
29
30
|
batchSize?: number | undefined;
|
|
@@ -40,20 +41,20 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
40
41
|
type: string;
|
|
41
42
|
uid: string;
|
|
42
43
|
addChain: (args: import("viem").AddChainParameters) => Promise<void>;
|
|
43
|
-
deployContract: <const abi extends import("viem").Abi | readonly unknown[], chainOverride extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<abi, import("viem").Chain | undefined,
|
|
44
|
+
deployContract: <const abi extends import("viem").Abi | readonly unknown[], chainOverride extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<abi, import("viem").Chain | undefined, Account | undefined, chainOverride>) => Promise<`0x${string}`>;
|
|
44
45
|
getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
|
|
45
46
|
getChainId: () => Promise<number>;
|
|
46
47
|
getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
|
|
47
|
-
prepareTransactionRequest: <TParameterType extends import("viem").PrepareTransactionRequestParameterType, TChainOverride extends import("viem").Chain | undefined = undefined, TAccountOverride extends `0x${string}` |
|
|
48
|
+
prepareTransactionRequest: <TParameterType extends import("viem").PrepareTransactionRequestParameterType, TChainOverride extends import("viem").Chain | undefined = undefined, TAccountOverride extends `0x${string}` | Account | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<import("viem").Chain | undefined, Account | undefined, TChainOverride, TAccountOverride, TParameterType>) => Promise<import("viem").PrepareTransactionRequestReturnType<import("viem").Chain, Account | undefined, TChainOverride, TAccountOverride, TParameterType>>;
|
|
48
49
|
requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
|
|
49
50
|
requestPermissions: (args: {
|
|
50
51
|
[x: string]: Record<string, any>;
|
|
51
52
|
eth_accounts: Record<string, any>;
|
|
52
53
|
}) => Promise<import("viem").RequestPermissionsReturnType>;
|
|
53
54
|
sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<`0x${string}`>;
|
|
54
|
-
sendTransaction: <TChainOverride_1 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain | undefined,
|
|
55
|
-
signMessage: (args: import("viem").SignMessageParameters<
|
|
56
|
-
signTransaction: <TChainOverride_2 extends import("viem").Chain | undefined>(args: import("viem").SignTransactionParameters<import("viem").Chain | undefined,
|
|
55
|
+
sendTransaction: <TChainOverride_1 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain | undefined, Account | undefined, TChainOverride_1>) => Promise<`0x${string}`>;
|
|
56
|
+
signMessage: (args: import("viem").SignMessageParameters<Account | undefined>) => Promise<`0x${string}`>;
|
|
57
|
+
signTransaction: <TChainOverride_2 extends import("viem").Chain | undefined>(args: import("viem").SignTransactionParameters<import("viem").Chain | undefined, Account | undefined, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
57
58
|
signTypedData: <const TTypedData extends {
|
|
58
59
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
59
60
|
[x: `string[${string}]`]: undefined;
|
|
@@ -261,10 +262,10 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
261
262
|
uint256?: undefined;
|
|
262
263
|
} | {
|
|
263
264
|
[key: string]: unknown;
|
|
264
|
-
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType,
|
|
265
|
+
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, Account | undefined>) => Promise<`0x${string}`>;
|
|
265
266
|
switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
|
|
266
267
|
watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
|
|
267
|
-
writeContract: <const abi_1 extends import("viem").Abi | readonly unknown[], functionName extends import("viem").ContractFunctionName<abi_1, "nonpayable" | "payable">, args extends import("viem").ContractFunctionArgs<abi_1, "pure" | "view", functionName>, TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<abi_1, functionName, args, import("viem").Chain | undefined,
|
|
268
|
+
writeContract: <const abi_1 extends import("viem").Abi | readonly unknown[], functionName extends import("viem").ContractFunctionName<abi_1, "nonpayable" | "payable">, args extends import("viem").ContractFunctionArgs<abi_1, "pure" | "view", functionName>, TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<abi_1, functionName, args, import("viem").Chain | undefined, Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
268
269
|
extend: <const client extends {
|
|
269
270
|
[x: string]: unknown;
|
|
270
271
|
account?: undefined;
|
|
@@ -278,7 +279,7 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
278
279
|
transport?: undefined;
|
|
279
280
|
type?: undefined;
|
|
280
281
|
uid?: undefined;
|
|
281
|
-
} & Partial<Pick<import("viem").PublicActions<import("viem").Transport, import("viem").Chain | undefined,
|
|
282
|
+
} & Partial<Pick<import("viem").PublicActions<import("viem").Transport, import("viem").Chain | undefined, Account | undefined>, "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getChainId" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "prepareTransactionRequest" | "readContract" | "sendRawTransaction" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions<import("viem").Chain | undefined, Account | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, Account | undefined>>;
|
|
282
283
|
} | undefined>;
|
|
283
284
|
getBalance(): Promise<string | undefined>;
|
|
284
285
|
supportsNetworkSwitching(): boolean;
|
|
@@ -293,5 +294,7 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
293
294
|
provider: WalletClient;
|
|
294
295
|
}): Promise<void>;
|
|
295
296
|
protected evmNetworkRpcMap: () => EvmRpcMap;
|
|
297
|
+
setActiveAccount(account: Hex | undefined): void;
|
|
298
|
+
getActiveAccount(): Account | undefined;
|
|
296
299
|
}
|
|
297
300
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from '../_virtual/_tslib.js';
|
|
2
2
|
import { formatEther } from 'viem';
|
|
3
|
+
import { toAccount } from 'viem/accounts';
|
|
3
4
|
import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
4
5
|
import { parseEvmNetworks, retryableFn, FALLBACK_UNDEFINED, DynamicError, getOrMapViemChain } from '@dynamic-labs/utils';
|
|
5
6
|
import { findEvmNetwork } from './utils/findEvmNetwork.js';
|
|
@@ -126,10 +127,14 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
126
127
|
const provider = this.getWalletClient();
|
|
127
128
|
if (!provider)
|
|
128
129
|
return [];
|
|
129
|
-
|
|
130
|
+
const addresses = yield retryableFn(provider.getAddresses, {
|
|
130
131
|
fallbackValue: [],
|
|
131
132
|
timeoutMs: 300,
|
|
132
133
|
});
|
|
134
|
+
if (addresses.length) {
|
|
135
|
+
this.setActiveAccount(addresses[0]);
|
|
136
|
+
}
|
|
137
|
+
return addresses;
|
|
133
138
|
});
|
|
134
139
|
}
|
|
135
140
|
providerSwitchNetwork({ network, provider, }) {
|
|
@@ -183,6 +188,12 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
183
188
|
}
|
|
184
189
|
});
|
|
185
190
|
}
|
|
191
|
+
setActiveAccount(account) {
|
|
192
|
+
this.activeAccount = account ? toAccount(account) : undefined;
|
|
193
|
+
}
|
|
194
|
+
getActiveAccount() {
|
|
195
|
+
return this.activeAccount;
|
|
196
|
+
}
|
|
186
197
|
}
|
|
187
198
|
|
|
188
199
|
export { EthWalletConnector };
|
|
@@ -10,11 +10,15 @@ var constants = require('../../constants.cjs');
|
|
|
10
10
|
|
|
11
11
|
const jsonRpcUrl = `https://mainnet.infura.io/v3/${constants.INFURA_ID}`;
|
|
12
12
|
const chainId = 1;
|
|
13
|
+
// storing a reference to the coinbase sdk so that we can call getQrUrl on it when we need a fresh qr code
|
|
14
|
+
let coinbaseSdk;
|
|
15
|
+
// storing a reference to the coinbase provider because the provider methods work better when
|
|
16
|
+
// they are called on the same instance
|
|
13
17
|
let coinbaseProvider;
|
|
14
|
-
const
|
|
18
|
+
const getCoinbaseClient = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, }) => {
|
|
15
19
|
var _a, _b;
|
|
16
20
|
if (!coinbaseProvider) {
|
|
17
|
-
|
|
21
|
+
coinbaseSdk = new walletSdk.CoinbaseWalletSDK({
|
|
18
22
|
appLogoUrl,
|
|
19
23
|
appName,
|
|
20
24
|
enableMobileWalletLink: true,
|
|
@@ -25,21 +29,17 @@ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [
|
|
|
25
29
|
const rpcUrl = ((_a = network === null || network === void 0 ? void 0 : network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) ||
|
|
26
30
|
((_b = network === null || network === void 0 ? void 0 : network.rpcUrls) === null || _b === void 0 ? void 0 : _b[0]) ||
|
|
27
31
|
jsonRpcUrl;
|
|
28
|
-
coinbaseProvider =
|
|
32
|
+
coinbaseProvider = coinbaseSdk.makeWeb3Provider(rpcUrl, chainId);
|
|
29
33
|
}
|
|
30
|
-
return coinbaseProvider;
|
|
34
|
+
return { provider: coinbaseProvider, sdk: coinbaseSdk };
|
|
31
35
|
};
|
|
32
36
|
const killCoinbaseSession = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
33
37
|
yield (coinbaseProvider === null || coinbaseProvider === void 0 ? void 0 : coinbaseProvider.close());
|
|
34
|
-
coinbaseProvider === null || coinbaseProvider === void 0 ? void 0 : coinbaseProvider.disconnect();
|
|
35
|
-
// We needed to remove the provider, because after a disconnect the initial settings that
|
|
36
|
-
// were set in the SDK reset, and they need to be initialized again.
|
|
37
|
-
coinbaseProvider = undefined;
|
|
38
38
|
});
|
|
39
|
-
const
|
|
39
|
+
const getAddress = (coinbaseProviderOpts, opts) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
40
|
var _a;
|
|
41
|
-
const provider =
|
|
42
|
-
const
|
|
41
|
+
const { provider, sdk } = getCoinbaseClient({ opts: coinbaseProviderOpts });
|
|
42
|
+
const qrUrl = sdk.getQrUrl();
|
|
43
43
|
if (!qrUrl) {
|
|
44
44
|
throw new utils.DynamicError('no qr url available');
|
|
45
45
|
}
|
|
@@ -50,7 +50,7 @@ const fetchPublicAddress = (coinbaseProviderOpts, opts) => _tslib.__awaiter(void
|
|
|
50
50
|
return address;
|
|
51
51
|
});
|
|
52
52
|
const signMessage = (coinbaseProviderOpts, messageToSign) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
-
const provider =
|
|
53
|
+
const { provider } = getCoinbaseClient({ opts: coinbaseProviderOpts });
|
|
54
54
|
const [address] = yield provider.request({
|
|
55
55
|
method: 'eth_requestAccounts',
|
|
56
56
|
});
|
|
@@ -66,7 +66,7 @@ const signMessage = (coinbaseProviderOpts, messageToSign) => _tslib.__awaiter(vo
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
exports.
|
|
70
|
-
exports.
|
|
69
|
+
exports.getAddress = getAddress;
|
|
70
|
+
exports.getCoinbaseClient = getCoinbaseClient;
|
|
71
71
|
exports.killCoinbaseSession = killCoinbaseSession;
|
|
72
72
|
exports.signMessage = signMessage;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
1
|
+
import { GetAddressOpts } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
import { GetCoinbaseClient, GetCoinbaseProviderOpts } from './types';
|
|
3
|
+
export declare const clearClientVariables: () => void;
|
|
4
|
+
export declare const getCoinbaseClient: GetCoinbaseClient;
|
|
4
5
|
export declare const killCoinbaseSession: () => Promise<void>;
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const getAddress: (coinbaseProviderOpts: GetCoinbaseProviderOpts, opts?: GetAddressOpts) => Promise<string | undefined>;
|
|
6
7
|
export declare const signMessage: (coinbaseProviderOpts: GetCoinbaseProviderOpts, messageToSign: string) => Promise<string | undefined>;
|