@dynamic-labs/wallet-connector-core 0.17.0-RC.8 → 0.17.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +338 -0
  2. package/package.json +5 -3
  3. package/src/index.cjs +30 -0
  4. package/src/index.d.ts +1 -3
  5. package/src/index.js +14 -0
  6. package/src/lib/WalletConnector.d.ts +3 -0
  7. package/src/lib/index.d.ts +4 -0
  8. package/src/lib/types.d.ts +7 -0
  9. package/src/utils/PhantomLedgerWalletName.cjs +11 -0
  10. package/src/utils/PhantomLedgerWalletName.d.ts +5 -0
  11. package/src/utils/PhantomLedgerWalletName.js +7 -0
  12. package/src/utils/ProviderLookup/ProviderLookup.cjs +18 -0
  13. package/src/utils/ProviderLookup/ProviderLookup.d.ts +5 -0
  14. package/src/utils/ProviderLookup/ProviderLookup.js +14 -0
  15. package/src/utils/ProviderLookup/index.d.ts +1 -0
  16. package/src/utils/encoding.cjs +18 -0
  17. package/src/utils/encoding.d.ts +4 -0
  18. package/src/utils/encoding.js +12 -0
  19. package/src/utils/getChainInfo/getChainInfo.cjs +59 -0
  20. package/src/utils/getChainInfo/getChainInfo.d.ts +2 -0
  21. package/src/utils/getChainInfo/getChainInfo.js +55 -0
  22. package/src/utils/getChainInfo/index.d.ts +1 -0
  23. package/src/utils/getWalletConnectorByName.cjs +19 -0
  24. package/src/utils/getWalletConnectorByName.d.ts +2 -0
  25. package/src/utils/getWalletConnectorByName.js +15 -0
  26. package/src/utils/index.d.ts +13 -0
  27. package/src/utils/isEmailOTPWalletConnector/index.d.ts +1 -0
  28. package/src/utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.cjs +7 -0
  29. package/src/utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.d.ts +2 -0
  30. package/src/utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.js +3 -0
  31. package/src/utils/isEmailWalletConnector/index.d.ts +1 -0
  32. package/src/utils/isEmailWalletConnector/isEmailWalletConnector.cjs +7 -0
  33. package/src/utils/isEmailWalletConnector/isEmailWalletConnector.d.ts +2 -0
  34. package/src/utils/isEmailWalletConnector/isEmailWalletConnector.js +3 -0
  35. package/src/utils/isEmbeddedConnector/index.d.ts +1 -0
  36. package/src/utils/isEmbeddedConnector/isEmbeddedConnector.cjs +10 -0
  37. package/src/utils/isEmbeddedConnector/isEmbeddedConnector.d.ts +2 -0
  38. package/src/utils/isEmbeddedConnector/isEmbeddedConnector.js +6 -0
  39. package/src/utils/isSameAddress/index.d.ts +1 -0
  40. package/src/utils/isSameAddress/isSameAddress.cjs +9 -0
  41. package/src/utils/isSameAddress/isSameAddress.d.ts +1 -0
  42. package/src/utils/isSameAddress/isSameAddress.js +5 -0
  43. package/src/utils/isSameAddress/utils/index.d.ts +1 -0
  44. package/src/utils/isSameAddress/utils/normalizeAddress/index.d.ts +1 -0
  45. package/src/utils/isSameAddress/utils/normalizeAddress/normalizeAddress.cjs +17 -0
  46. package/src/utils/isSameAddress/utils/normalizeAddress/normalizeAddress.d.ts +1 -0
  47. package/src/utils/isSameAddress/utils/normalizeAddress/normalizeAddress.js +13 -0
  48. package/src/utils/isSocialWalletConnector/index.d.ts +1 -0
  49. package/src/utils/isSocialWalletConnector/isSocialWalletConnector.cjs +7 -0
  50. package/src/utils/isSocialWalletConnector/isSocialWalletConnector.d.ts +2 -0
  51. package/src/utils/isSocialWalletConnector/isSocialWalletConnector.js +3 -0
  52. package/src/utils/normalizeWalletName/index.d.ts +1 -0
  53. package/src/utils/normalizeWalletName/normalizeWalletName.cjs +7 -0
  54. package/src/utils/normalizeWalletName/normalizeWalletName.d.ts +1 -0
  55. package/src/utils/normalizeWalletName/normalizeWalletName.js +3 -0
  56. package/src/utils/shouldLowercaseAddress.cjs +11 -0
  57. package/src/utils/shouldLowercaseAddress.d.ts +1 -0
  58. package/src/utils/shouldLowercaseAddress.js +7 -0
  59. package/src/utils/walletConnectDeepLinks/index.d.ts +2 -0
  60. package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.cjs +22 -0
  61. package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.d.ts +3 -0
  62. package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.js +18 -0
  63. package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.cjs +36 -0
  64. package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.d.ts +8 -0
  65. package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.js +32 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,342 @@
1
1
 
2
+ ## [0.17.0](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.33...v0.17.0) (2023-06-13)
3
+
4
+ Dynamic is excited to announce our most amazing SDK update yet (at least since 0.16.0 :-))!
5
+ We have some great things in this version, here are the highlights:
6
+
7
+ ### Breaking Changes
8
+ - In favor of supporting MagicLink Wallets we removed the support for Fortmatic.
9
+
10
+ ### Deprecations
11
+ - `chainName` on EvmNetwork is deprecated in favor of `name`. If you're passing `evmNetworks` to `DynamicContextProvider` or `DynamicWagmiConnector`, you should update your code like so:
12
+ ```ts
13
+ <DynamicContextProvider
14
+ settings={{
15
+ environmentId: 'YOUR_ENV_ID',
16
+ evmNetworks: [
17
+ {
18
+ blockExplorerUrls: [],
19
+ chainId: 1,
20
+ iconUrls: [],
21
+ - chainName: 'Ethereum',
22
+ + name: 'Ethereum',
23
+ nativeCurrency: {
24
+ decimals: 18,
25
+ name: 'Ether',
26
+ symbol: 'ETH',
27
+ },
28
+ networkId: 1,
29
+ rpcUrls: [],
30
+ },
31
+ ],
32
+ }}
33
+ >
34
+ <HomePage />
35
+ </DynamicContextProvider>
36
+ ```
37
+ - the `multiWallet` prop on DynamicContextProvider is deprecated in favor of the Dashboard settings. See [here](https://docs.dynamic.xyz/docs/multi-wallet#setup) for more info
38
+
39
+ ### Highlighted Features
40
+ - Package splitting. You asked for it, and here it is!
41
+ If you want to reduce your package size to include only the chains and the wallets that your app needs, you now have the option to customize your build [See instructions](https://docs.dynamic.xyz/docs/reduce-bundle-size-with-modular-sdk)
42
+
43
+ - Two cool features for Magic Wallets:
44
+ - Support for [social login](https://docs.dynamic.xyz/docs/magic#enable-social-sign-in)
45
+ - Modal for supporting [send balance](https://docs.dynamic.xyz/docs/send-balance-ui).
46
+
47
+
48
+ - Generic types on various connector methods. For example, if you know you are working with an EVM network, you can typecast with `walletConnector.getNetwork<number>()` to work nicely in typescript.
49
+
50
+ - [onRamp with Banxa](https://docs.dynamic.xyz/docs/onramps) (please reach out to us to enable the feature)
51
+
52
+ - Ability to support multiple RPCs with fallbacks when providing the URL to network prop.
53
+
54
+ - Added suffix to the local storage key, in case you are testing multiple local environments locally at the same time.
55
+
56
+ - We have a new global loading state that you can now easily use to tell when the SDK completed loading (`sdkHasLoaded`)
57
+
58
+ And many other minor improvements and bug fixes.
59
+
60
+ Enjoy!
61
+
62
+ ### Features
63
+
64
+ * Add suffix to local storage ([#2227](https://github.com/dynamic-labs/DynamicAuth/issues/2227)) ([b901b9b](https://github.com/dynamic-labs/DynamicAuth/commit/b901b9b43a3eaa80706b9ec0679f668a7b8b2507))
65
+ * Block Self Service so users have to schedule a demo ([#2286](https://github.com/dynamic-labs/DynamicAuth/issues/2286)) ([8a2f19a](https://github.com/dynamic-labs/DynamicAuth/commit/8a2f19a13a91ef0d9b860ff5164d61f6f7664426))
66
+ * dyn 2486 Add support for superb ([#2271](https://github.com/dynamic-labs/DynamicAuth/issues/2271)) ([8ea51e9](https://github.com/dynamic-labs/DynamicAuth/commit/8ea51e93c5d74d02efd47877042d7af05ca55f5c))
67
+ * pass icon theme variant to usages of SocialIcon ([#2303](https://github.com/dynamic-labs/DynamicAuth/issues/2303)) ([da59d6f](https://github.com/dynamic-labs/DynamicAuth/commit/da59d6f22e7ec49cb8cff757baada3cb1e737b99))
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * brief red error message as the KYC screen loads ([#2240](https://github.com/dynamic-labs/DynamicAuth/issues/2240)) ([1155e8b](https://github.com/dynamic-labs/DynamicAuth/commit/1155e8bd66ffdc96ae3f9d88f027793217c120a8))
73
+ * account controls hover does not fill the container ([#2300](https://github.com/dynamic-labs/DynamicAuth/issues/2300)) ([fdc984e](https://github.com/dynamic-labs/DynamicAuth/commit/fdc984e2d0b11d9d38dcd9e877c228fbc41c5855))
74
+ * refresh session in walletconnectv2 ([#2294](https://github.com/dynamic-labs/DynamicAuth/issues/2294)) ([d54263e](https://github.com/dynamic-labs/DynamicAuth/commit/d54263ea04c58f842b60b0c13f964fde25be786b))
75
+
76
+ ## [0.17.0-RC.33](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.32...v0.17.0-RC.33) (2023-06-09)
77
+
78
+
79
+ ### Bug Fixes
80
+
81
+ * display chain name in smaller format ([#2292](https://github.com/dynamic-labs/DynamicAuth/issues/2292)) ([95ff444](https://github.com/dynamic-labs/DynamicAuth/commit/95ff44412fcc192ecc2e9a2c1a5f090708c2da9c))
82
+
83
+ ## [0.17.0-RC.32](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.31...v0.17.0-RC.32) (2023-06-09)
84
+
85
+
86
+ ### Bug Fixes
87
+
88
+ * missing walletlist when filter finds no wallets ([#2289](https://github.com/dynamic-labs/DynamicAuth/issues/2289)) ([a7708d3](https://github.com/dynamic-labs/DynamicAuth/commit/a7708d3eab9609daa4c860555f5804f280958da5))
89
+
90
+ ## [0.17.0-RC.31](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.30...v0.17.0-RC.31) (2023-06-09)
91
+
92
+
93
+ ### Features
94
+
95
+ * add fake dapper mobile metadata so that it appears on mobile ([#2288](https://github.com/dynamic-labs/DynamicAuth/issues/2288)) ([ea98462](https://github.com/dynamic-labs/DynamicAuth/commit/ea98462e762d3fa032e2e40f17d2e3679146b3ae))
96
+ * pass variant to social icon getter ([#2277](https://github.com/dynamic-labs/DynamicAuth/issues/2277)) ([b1492ed](https://github.com/dynamic-labs/DynamicAuth/commit/b1492eda50eb80fbfee1aa968771f338694ef7e6))
97
+
98
+
99
+ ### Bug Fixes
100
+
101
+ * don't remove network config from ls if there's a connected wallet ([#2280](https://github.com/dynamic-labs/DynamicAuth/issues/2280)) ([0703dfc](https://github.com/dynamic-labs/DynamicAuth/commit/0703dfc099f86a0802e83a27849b6953e1ddca31))
102
+ * **use-wallets-connection-state:** load connected state when wallets are present ([#2285](https://github.com/dynamic-labs/DynamicAuth/issues/2285)) ([7fb72dc](https://github.com/dynamic-labs/DynamicAuth/commit/7fb72dc8fe1404cd76e68bb3f0de9efa78634525))
103
+
104
+ ## [0.17.0-RC.30](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.29...v0.17.0-RC.30) (2023-06-08)
105
+
106
+
107
+ ### Bug Fixes
108
+
109
+ * **view-context:** refactor view context to have initial view ([#2268](https://github.com/dynamic-labs/DynamicAuth/issues/2268)) ([0afe6ae](https://github.com/dynamic-labs/DynamicAuth/commit/0afe6ae469f62fd16fd8471322f9295957f607f6))
110
+ * **wcv2:** upgrade universal provider and refactor wcv2 ([#2163](https://github.com/dynamic-labs/DynamicAuth/issues/2163)) ([e69c67c](https://github.com/dynamic-labs/DynamicAuth/commit/e69c67c95dca0f694c4a554702be96c3f7d3d77e))
111
+
112
+ ## [0.17.0-RC.29](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.28...v0.17.0-RC.29) (2023-06-07)
113
+
114
+
115
+ ### Bug Fixes
116
+
117
+ * de-duplicate authSuccess call ([#2269](https://github.com/dynamic-labs/DynamicAuth/issues/2269)) ([00268d0](https://github.com/dynamic-labs/DynamicAuth/commit/00268d001355946c98d285d71d7f7acc96d4c9f7))
118
+ * hide search when filtered wallets equal to number of shown wallets ([#2221](https://github.com/dynamic-labs/DynamicAuth/issues/2221)) ([fb0f629](https://github.com/dynamic-labs/DynamicAuth/commit/fb0f629ae76240fe681db91b485139934026054e))
119
+
120
+ ## [0.17.0-RC.28](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.27...v0.17.0-RC.28) (2023-06-06)
121
+
122
+
123
+ ### Features
124
+
125
+ * lower username minimum length requirement ([#2265](https://github.com/dynamic-labs/DynamicAuth/issues/2265)) ([ed891ca](https://github.com/dynamic-labs/DynamicAuth/commit/ed891cac8cceaf9e0556b679eda7a3575725805d))
126
+
127
+
128
+ ### Bug Fixes
129
+
130
+ * **send_balance:** add amount validation to form ([#2261](https://github.com/dynamic-labs/DynamicAuth/issues/2261)) ([9a57cfe](https://github.com/dynamic-labs/DynamicAuth/commit/9a57cfe0dd7f97aa16351b091ab385b2b5c7c5e4))
131
+ * shrink dynamic widget in smaller containers ([#2260](https://github.com/dynamic-labs/DynamicAuth/issues/2260)) ([353f447](https://github.com/dynamic-labs/DynamicAuth/commit/353f44724db83e9f1500c606fdea7d50a8067711))
132
+
133
+ ## [0.17.0-RC.27](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.26...v0.17.0-RC.27) (2023-06-06)
134
+
135
+
136
+ ### Features
137
+
138
+ * sync wagmi to first connected eth wallet ([#2253](https://github.com/dynamic-labs/DynamicAuth/issues/2253)) ([c00aed7](https://github.com/dynamic-labs/DynamicAuth/commit/c00aed73a1014c668311c8cb59e5a466b5ee6779))
139
+
140
+
141
+ ### Bug Fixes
142
+
143
+ * include username in userFieldsSchema ([#2257](https://github.com/dynamic-labs/DynamicAuth/issues/2257)) ([6e5431d](https://github.com/dynamic-labs/DynamicAuth/commit/6e5431d08323d718b11accf3790ef56fc7325b5c))
144
+
145
+ ## [0.17.0-RC.26](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.25...v0.17.0-RC.26) (2023-06-05)
146
+
147
+
148
+ ### Features
149
+
150
+ * disable button on social unlink ([#2234](https://github.com/dynamic-labs/DynamicAuth/issues/2234)) ([7f148de](https://github.com/dynamic-labs/DynamicAuth/commit/7f148de76b0fca632e1b4d6ff71c18eb0207c02b))
151
+ * update magic + email icon in auth flow views ([#2224](https://github.com/dynamic-labs/DynamicAuth/issues/2224)) ([93f1ed6](https://github.com/dynamic-labs/DynamicAuth/commit/93f1ed644428701c2747565033d0ad113fa8eeb2))
152
+
153
+
154
+ ### Bug Fixes
155
+
156
+ * **wallets:** keep magic social wallet connector on mobile ([#2242](https://github.com/dynamic-labs/DynamicAuth/issues/2242)) ([35c092d](https://github.com/dynamic-labs/DynamicAuth/commit/35c092da3b8a76c74ae25558489d663ce963d72f))
157
+ * wrong logger instance in UserProfileSocialAccount ([#2248](https://github.com/dynamic-labs/DynamicAuth/issues/2248)) ([814108d](https://github.com/dynamic-labs/DynamicAuth/commit/814108d416d9d730bed8976956bc7974c7fde2a8))
158
+
159
+ ## [0.17.0-RC.25](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.24...v0.17.0-RC.25) (2023-06-05)
160
+
161
+
162
+ ### Bug Fixes
163
+
164
+ * **EmailOTPMagicWalletConnector:** allow user to reconnect with email wallet ([#2230](https://github.com/dynamic-labs/DynamicAuth/issues/2230)) ([6059886](https://github.com/dynamic-labs/DynamicAuth/commit/605988650a783ae824bb8c45edc5533fecf8726a))
165
+ * only set wagmi connector if connected chain is evm ([#2237](https://github.com/dynamic-labs/DynamicAuth/issues/2237)) ([a7be7d3](https://github.com/dynamic-labs/DynamicAuth/commit/a7be7d302d1e74088b0aa2b6848c879079e6f963))
166
+ * Revert "fix(ViewContext): only set view when on wallet list" ([#2235](https://github.com/dynamic-labs/DynamicAuth/issues/2235)) ([e790315](https://github.com/dynamic-labs/DynamicAuth/commit/e79031577f640161cc5f0b9b2e695e22d9a98901)), closes [#2226](https://github.com/dynamic-labs/DynamicAuth/issues/2226)
167
+ * set view to social-redirect-view while waiting to process magic redirect ([#2229](https://github.com/dynamic-labs/DynamicAuth/issues/2229)) ([f50a29c](https://github.com/dynamic-labs/DynamicAuth/commit/f50a29c0b9623c703f1577c7a41fcc5aee58abb8))
168
+ * user profile does not extend on mobile ([#2236](https://github.com/dynamic-labs/DynamicAuth/issues/2236)) ([5bb7912](https://github.com/dynamic-labs/DynamicAuth/commit/5bb7912a865338fdf6eca1a19ff4b74a3fb18eeb))
169
+ * **ViewContext:** only set view when on wallet list ([#2226](https://github.com/dynamic-labs/DynamicAuth/issues/2226)) ([85e8fc1](https://github.com/dynamic-labs/DynamicAuth/commit/85e8fc140069cabff41f4067ac93ea0c5cfaa161))
170
+
171
+ ## [0.17.0-RC.24](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.23...v0.17.0-RC.24) (2023-06-02)
172
+
173
+ ## [0.17.0-RC.23](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.22...v0.17.0-RC.23) (2023-06-02)
174
+
175
+
176
+ ### Bug Fixes
177
+
178
+ * flow connection status improvements ([#2212](https://github.com/dynamic-labs/DynamicAuth/issues/2212)) ([5225e9f](https://github.com/dynamic-labs/DynamicAuth/commit/5225e9f3f19705cdde3c1d860ddf4e69689a839b))
179
+ * **useSyncPrimaryWallet:** disables the hook while connect state is loaded ([#2193](https://github.com/dynamic-labs/DynamicAuth/issues/2193)) ([d2a69c8](https://github.com/dynamic-labs/DynamicAuth/commit/d2a69c8edfbb2a19305b0fd322e24d909bbf9b4f)), closes [#2155](https://github.com/dynamic-labs/DynamicAuth/issues/2155)
180
+
181
+ ## [0.17.0-RC.22](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.21...v0.17.0-RC.22) (2023-06-02)
182
+
183
+
184
+ ### Features
185
+
186
+ * social copy update ([#2215](https://github.com/dynamic-labs/DynamicAuth/issues/2215)) ([1fe7316](https://github.com/dynamic-labs/DynamicAuth/commit/1fe7316a94284db7227d5ab09026354269559752))
187
+
188
+ ## [0.17.0-RC.21](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.20...v0.17.0-RC.21) (2023-06-02)
189
+
190
+
191
+ ### Bug Fixes
192
+
193
+ * social icon is missing on some views ([#2211](https://github.com/dynamic-labs/DynamicAuth/issues/2211)) ([bddd255](https://github.com/dynamic-labs/DynamicAuth/commit/bddd255f0aa61aed4b767145c51624ac1eb9b963))
194
+
195
+ ## [0.17.0-RC.20](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.19...v0.17.0-RC.20) (2023-06-01)
196
+
197
+
198
+ ### Features
199
+
200
+ * add AccessDeniedContext to lift denied wallet state up ([#2180](https://github.com/dynamic-labs/DynamicAuth/issues/2180)) ([509519d](https://github.com/dynamic-labs/DynamicAuth/commit/509519d08496248545f1548f676b13e140473e41))
201
+ * **DYN-2338:** update magic icons to social icons ([#2176](https://github.com/dynamic-labs/DynamicAuth/issues/2176)) ([42a4f63](https://github.com/dynamic-labs/DynamicAuth/commit/42a4f6367e6fa4ad8736f9ac42f535c8a9c1d377))
202
+ * **DynamicWidget:** add send balance button ([#2183](https://github.com/dynamic-labs/DynamicAuth/issues/2183)) ([d76355e](https://github.com/dynamic-labs/DynamicAuth/commit/d76355e1f9c3a7b05cbb5b7b3144dad379586689))
203
+ * handle magic redirect error ([#2203](https://github.com/dynamic-labs/DynamicAuth/issues/2203)) ([9a088c6](https://github.com/dynamic-labs/DynamicAuth/commit/9a088c6aad2eb2c1045f544a784083d2732df440))
204
+ * **SendBalanceModal:** adds openSendBalanceModal in dynamic context ([#2159](https://github.com/dynamic-labs/DynamicAuth/issues/2159)) ([f89b21b](https://github.com/dynamic-labs/DynamicAuth/commit/f89b21bfcd65bb61ef33b17b460140404574b235))
205
+ * social error handling improvements ([#2146](https://github.com/dynamic-labs/DynamicAuth/issues/2146)) ([a64a26a](https://github.com/dynamic-labs/DynamicAuth/commit/a64a26aa42c228654cb135cd6c4778e8bd2bd0e6))
206
+
207
+
208
+ ### Bug Fixes
209
+
210
+ * amendments to user profile ([#2201](https://github.com/dynamic-labs/DynamicAuth/issues/2201)) ([5d12c17](https://github.com/dynamic-labs/DynamicAuth/commit/5d12c1716cdcd8d843ef3ff941e163bad28573b1))
211
+ * **formatBigNumber:** display the ceil value when value is too low ([#2165](https://github.com/dynamic-labs/DynamicAuth/issues/2165)) ([ad56fe1](https://github.com/dynamic-labs/DynamicAuth/commit/ad56fe11d55ee038e08ef77dfa2bd6155fee7fe3))
212
+ * use wcv2 only if wallet supports it ([#2198](https://github.com/dynamic-labs/DynamicAuth/issues/2198)) ([3d5fea7](https://github.com/dynamic-labs/DynamicAuth/commit/3d5fea7743a18b47f33ef371ecc2652003accb4d))
213
+
214
+ ## [0.17.0-RC.19](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.18...v0.17.0-RC.19) (2023-05-30)
215
+
216
+
217
+ ### Features
218
+
219
+ * add SocialWrongAccountView ([#2153](https://github.com/dynamic-labs/DynamicAuth/issues/2153)) ([531a29d](https://github.com/dynamic-labs/DynamicAuth/commit/531a29d7d87739d974ecc35c57ef0d333a5e7451))
220
+ * do not show unlink button for embedded wallets ([#2169](https://github.com/dynamic-labs/DynamicAuth/issues/2169)) ([f813058](https://github.com/dynamic-labs/DynamicAuth/commit/f8130585c82c7ae73d1e32e107f67ec86b4edb89))
221
+ * **DYN-2402:** coinbase issues after disconnecting ([#2149](https://github.com/dynamic-labs/DynamicAuth/issues/2149)) ([91d49fb](https://github.com/dynamic-labs/DynamicAuth/commit/91d49fb7f8c6fca3ab03098f3fba53d277c836ad))
222
+ * handle user reconnecting with wrong social account ([#2157](https://github.com/dynamic-labs/DynamicAuth/issues/2157)) ([4f7c6df](https://github.com/dynamic-labs/DynamicAuth/commit/4f7c6dff7df9a7966a644bf2510cb3825b2c6408))
223
+ * **social:** handle reconnect ([#2131](https://github.com/dynamic-labs/DynamicAuth/issues/2131)) ([2b3e5fb](https://github.com/dynamic-labs/DynamicAuth/commit/2b3e5fbb72bb7dafee3bd0bbfa73fae444055410))
224
+
225
+ ## [0.17.0-RC.18](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.17...v0.17.0-RC.18) (2023-05-19)
226
+
227
+
228
+ ### Features
229
+
230
+ * add getReferencedAccount ([#2141](https://github.com/dynamic-labs/DynamicAuth/issues/2141)) ([ac170a6](https://github.com/dynamic-labs/DynamicAuth/commit/ac170a6dfac25ff9911feb390495974aa5dbede6))
231
+ * add reconnectSocialWallet ([#2142](https://github.com/dynamic-labs/DynamicAuth/issues/2142)) ([fefd759](https://github.com/dynamic-labs/DynamicAuth/commit/fefd759b816b286dd8a7673cf6c839fee59768ac))
232
+ * **DYN-2220:** add Transaction Successfully Sent view ([#2134](https://github.com/dynamic-labs/DynamicAuth/issues/2134)) ([7db96ad](https://github.com/dynamic-labs/DynamicAuth/commit/7db96adcd3b84aef29fbabe40a1e048ea629d2bb))
233
+ * **MagicSocialWalletConnector:** store public address from redirect result in local storage ([#2139](https://github.com/dynamic-labs/DynamicAuth/issues/2139)) ([90b60e4](https://github.com/dynamic-labs/DynamicAuth/commit/90b60e485a53ff29a0e52ef27a58383771490974))
234
+
235
+
236
+ ### Bug Fixes
237
+
238
+ * issue when linking from detect_new_wallet ([#2148](https://github.com/dynamic-labs/DynamicAuth/issues/2148)) ([98feb7b](https://github.com/dynamic-labs/DynamicAuth/commit/98feb7bde081a8107577ac7ec70d0f9c4b611a2b))
239
+ * multi-wallet flows ([#2150](https://github.com/dynamic-labs/DynamicAuth/issues/2150)) ([c82ef4a](https://github.com/dynamic-labs/DynamicAuth/commit/c82ef4a5cc75c9f8edb30620e32dd64bbdb0eb7f))
240
+ * starknet getConnectedAccounts should return an empty array if there's no address to return ([#2140](https://github.com/dynamic-labs/DynamicAuth/issues/2140)) ([ce39641](https://github.com/dynamic-labs/DynamicAuth/commit/ce39641a6dbec1d05d8d5cc611a02de8bd756351))
241
+
242
+ ## [0.17.0-RC.17](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.16...v0.17.0-RC.17) (2023-05-17)
243
+
244
+
245
+ ### Features
246
+
247
+ * distinguish walletconnect deeplink types ([#2093](https://github.com/dynamic-labs/DynamicAuth/issues/2093)) ([dcd29f7](https://github.com/dynamic-labs/DynamicAuth/commit/dcd29f7cfc5e6481aaaae502b3fc4e4d225f1fc1))
248
+ * **social:** pass did token to verify request ([#2124](https://github.com/dynamic-labs/DynamicAuth/issues/2124)) ([60d73a5](https://github.com/dynamic-labs/DynamicAuth/commit/60d73a5f432d488979f33fe29666d1afa8fc0e8e))
249
+ * support optional priority and stalltimeout for customer provided rpc urls ([#2091](https://github.com/dynamic-labs/DynamicAuth/issues/2091)) ([eebacda](https://github.com/dynamic-labs/DynamicAuth/commit/eebacda6a9d6ba583eff4e4e5a38eb9945c4825e))
250
+
251
+
252
+ ### Bug Fixes
253
+
254
+ * add and remove event listeners for Solflare ([#2127](https://github.com/dynamic-labs/DynamicAuth/issues/2127)) ([978c7ba](https://github.com/dynamic-labs/DynamicAuth/commit/978c7ba0e3745e26d9dfc9b7c46a24adc913f02f))
255
+ * get publicKey from provider if no address and publicKey are returned on connect ([#2126](https://github.com/dynamic-labs/DynamicAuth/issues/2126)) ([c9c9b2a](https://github.com/dynamic-labs/DynamicAuth/commit/c9c9b2af81f660aa651fc4b0e01cd3c823bb0229))
256
+ * remove detect known secondary wallet modal ([#2117](https://github.com/dynamic-labs/DynamicAuth/issues/2117)) ([0e8bbd8](https://github.com/dynamic-labs/DynamicAuth/commit/0e8bbd8c385fe528a7af3ccc037812df9d6e0c84))
257
+ * revert changes for select wallet to work with solflare ([#2120](https://github.com/dynamic-labs/DynamicAuth/issues/2120)) ([76cf228](https://github.com/dynamic-labs/DynamicAuth/commit/76cf228c495d6592da4c88b8a0d5a5fc480861ae))
258
+ * setIsVerifying to false when selecting a connector ([#2133](https://github.com/dynamic-labs/DynamicAuth/issues/2133)) ([8ddeba3](https://github.com/dynamic-labs/DynamicAuth/commit/8ddeba377f35dfb4a104cd6bd7ee6315d574710f))
259
+ * setPrimaryWallet and useSyncPrimaryWallet updates ([#2128](https://github.com/dynamic-labs/DynamicAuth/issues/2128)) ([fb47b17](https://github.com/dynamic-labs/DynamicAuth/commit/fb47b17ddc7f41c29f140a1a85a1e47dbf017fff))
260
+ * update text color and add close button on extension not installed prompt ([#2122](https://github.com/dynamic-labs/DynamicAuth/issues/2122)) ([b4848a0](https://github.com/dynamic-labs/DynamicAuth/commit/b4848a0a8094b4ceac67e2667d277a9aa5e2e137))
261
+
262
+ ## [0.17.0-RC.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.15...v0.17.0-RC.16) (2023-05-15)
263
+
264
+
265
+ ### Features
266
+
267
+ * add social oauth result to verify request ([#2081](https://github.com/dynamic-labs/DynamicAuth/issues/2081)) ([4da650a](https://github.com/dynamic-labs/DynamicAuth/commit/4da650affe9c96e0ab9e446f58c91b9b13db3651))
268
+
269
+
270
+ ### Bug Fixes
271
+
272
+ * **DYN-2327:** user profile is not loaded properly on the first load ([#2113](https://github.com/dynamic-labs/DynamicAuth/issues/2113)) ([c05834e](https://github.com/dynamic-labs/DynamicAuth/commit/c05834ed89ecc12d586baa97bcaf2bd3c1919f59))
273
+
274
+ ## [0.17.0-RC.15](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.14...v0.17.0-RC.15) (2023-05-15)
275
+
276
+
277
+ ### Bug Fixes
278
+
279
+ * pass network to link request ([#2114](https://github.com/dynamic-labs/DynamicAuth/issues/2114)) ([0f7d20d](https://github.com/dynamic-labs/DynamicAuth/commit/0f7d20d948b737b98d4a8db8aaa7648033e25922))
280
+
281
+ ## [0.17.0-RC.14](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.13...v0.17.0-RC.14) (2023-05-12)
282
+
283
+
284
+ ### Features
285
+
286
+ * add local flowNetwork prop to toggle between mainnet and testnet ([#2094](https://github.com/dynamic-labs/DynamicAuth/issues/2094)) ([43c3f20](https://github.com/dynamic-labs/DynamicAuth/commit/43c3f20abf2d6c83e88e48f885749b978cec078a))
287
+ * deprecate multiWallet sdk setting and fetch it from projectSettings ([#2079](https://github.com/dynamic-labs/DynamicAuth/issues/2079)) ([8b7f11d](https://github.com/dynamic-labs/DynamicAuth/commit/8b7f11d9eb71a17056be05cc8006d15dc149e3ff))
288
+
289
+
290
+ ### Bug Fixes
291
+
292
+ * **balance:** correctly compare AVAX address when fetching balance ([#2064](https://github.com/dynamic-labs/DynamicAuth/issues/2064)) ([c5942d1](https://github.com/dynamic-labs/DynamicAuth/commit/c5942d112804f3a935bca396221fb33a3c7cc42a))
293
+ * **DYN-2231:** restore User Profile display when social is the only enabled flag in information capture ([#2070](https://github.com/dynamic-labs/DynamicAuth/issues/2070)) ([6790bc7](https://github.com/dynamic-labs/DynamicAuth/commit/6790bc7e54afb1807be9996dc47129932441bbae))
294
+
295
+ ## [0.17.0-RC.13](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.12...v0.17.0-RC.13) (2023-05-10)
296
+
297
+
298
+ ### Features
299
+
300
+ * discriminate magic connectors ([#2069](https://github.com/dynamic-labs/DynamicAuth/issues/2069)) ([e9f6fd1](https://github.com/dynamic-labs/DynamicAuth/commit/e9f6fd15082364612a86d6d2a091cb8bd4eccc1f))
301
+
302
+
303
+ ### Bug Fixes
304
+
305
+ * add popper to fix dots menu positioning ([#2075](https://github.com/dynamic-labs/DynamicAuth/issues/2075)) ([fe945bd](https://github.com/dynamic-labs/DynamicAuth/commit/fe945bd3bcc5edeecfa0a2e7e53e30dc507c6118))
306
+ * polyfill process if not defined in global ([#2088](https://github.com/dynamic-labs/DynamicAuth/issues/2088)) ([a5d8194](https://github.com/dynamic-labs/DynamicAuth/commit/a5d81942440a6fe290c15b58b942012afe42aa00))
307
+
308
+ ## [0.17.0-RC.12](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.11...v0.17.0-RC.12) (2023-05-09)
309
+
310
+
311
+ ### Bug Fixes
312
+
313
+ * allow opening network picker when unsupported network and only one network enabled ([#2061](https://github.com/dynamic-labs/DynamicAuth/issues/2061)) ([486607f](https://github.com/dynamic-labs/DynamicAuth/commit/486607f8bb2666749ce39f18cf2368c86a78f74f))
314
+ * **DynamicWagmiConnector:** prevent disconnect when WC is not present ([#2063](https://github.com/dynamic-labs/DynamicAuth/issues/2063)) ([ef93623](https://github.com/dynamic-labs/DynamicAuth/commit/ef93623fb68b63a9e89a5958eb87bbddedd15fb6))
315
+
316
+ ## [0.17.0-RC.11](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.10...v0.17.0-RC.11) (2023-05-08)
317
+
318
+
319
+ ### Features
320
+
321
+ * add walletConnectors setting for supplying array of wallet connectors ([#2059](https://github.com/dynamic-labs/DynamicAuth/issues/2059)) ([ae65218](https://github.com/dynamic-labs/DynamicAuth/commit/ae652180b17a870f7bbf5f99c876f386e0de1af5))
322
+
323
+ ## [0.17.0-RC.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.9...v0.17.0-RC.10) (2023-05-05)
324
+
325
+ ## [0.17.0-RC.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.8...v0.17.0-RC.9) (2023-05-05)
326
+
327
+
328
+ ### Features
329
+
330
+ * **DYN-2231:** show in the user profile all existing fields ([#1988](https://github.com/dynamic-labs/DynamicAuth/issues/1988)) ([1f8cee2](https://github.com/dynamic-labs/DynamicAuth/commit/1f8cee22cf8338bd518961288c570c40e807cd52))
331
+ * **TransactionModal:** add insufficient funds warning ([#2031](https://github.com/dynamic-labs/DynamicAuth/issues/2031)) ([bf868e2](https://github.com/dynamic-labs/DynamicAuth/commit/bf868e239e74f4cd0ceda5e09b7538d97d4e431d))
332
+
333
+
334
+ ### Bug Fixes
335
+
336
+ * **DYN-1820:** use missing_from_list error code ([#2040](https://github.com/dynamic-labs/DynamicAuth/issues/2040)) ([92c7ad5](https://github.com/dynamic-labs/DynamicAuth/commit/92c7ad565376573d963c65fa821c97a2102ec8d7))
337
+ * **MagicClientNetworkHandler:** save last used network id ([#2045](https://github.com/dynamic-labs/DynamicAuth/issues/2045)) ([6e1c571](https://github.com/dynamic-labs/DynamicAuth/commit/6e1c57127a824cd02d4b785fb8a387e4f221f044))
338
+ * **TransactionModal:** ensure alchemy will not fail when estimating for gas ([#2034](https://github.com/dynamic-labs/DynamicAuth/issues/2034)) ([86c0d7c](https://github.com/dynamic-labs/DynamicAuth/commit/86c0d7cc7b20ff12bc9fc2e33961e177d9decf2a))
339
+
2
340
  ## [0.17.0-RC.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.7...v0.17.0-RC.8) (2023-05-03)
3
341
 
4
342
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-connector-core",
3
- "version": "0.17.0-RC.8",
3
+ "version": "0.17.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -27,7 +27,9 @@
27
27
  },
28
28
  "dependencies": {},
29
29
  "peerDependencies": {
30
- "@dynamic-labs/logger": "0.17.0-RC.8",
31
- "@dynamic-labs/rpc-providers": "0.17.0-RC.8"
30
+ "@dynamic-labs/logger": "0.17.0",
31
+ "@dynamic-labs/rpc-providers": "0.17.0",
32
+ "@dynamic-labs/utils": "0.17.0",
33
+ "@dynamic-labs/wallet-book": "0.17.0"
32
34
  }
33
35
  }
package/src/index.cjs CHANGED
@@ -4,6 +4,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var WalletConnector = require('./lib/WalletConnector.cjs');
6
6
  var logger = require('./utils/logger.cjs');
7
+ var ProviderLookup = require('./utils/ProviderLookup/ProviderLookup.cjs');
8
+ var getChainInfo = require('./utils/getChainInfo/getChainInfo.cjs');
9
+ var isEmailOTPWalletConnector = require('./utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.cjs');
10
+ var isEmailWalletConnector = require('./utils/isEmailWalletConnector/isEmailWalletConnector.cjs');
11
+ var isSameAddress = require('./utils/isSameAddress/isSameAddress.cjs');
12
+ var isSocialWalletConnector = require('./utils/isSocialWalletConnector/isSocialWalletConnector.cjs');
13
+ var encoding = require('./utils/encoding.cjs');
14
+ var getWalletConnectorByName = require('./utils/getWalletConnectorByName.cjs');
15
+ var shouldLowercaseAddress = require('./utils/shouldLowercaseAddress.cjs');
16
+ var normalizeWalletName = require('./utils/normalizeWalletName/normalizeWalletName.cjs');
17
+ var PhantomLedgerWalletName = require('./utils/PhantomLedgerWalletName.cjs');
18
+ var walletConnectDeepLinks = require('./utils/walletConnectDeepLinks/walletConnectDeepLinks.cjs');
19
+ var performPlatformSpecificConnectionMethod = require('./utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.cjs');
20
+ var isEmbeddedConnector = require('./utils/isEmbeddedConnector/isEmbeddedConnector.cjs');
7
21
 
8
22
 
9
23
 
@@ -11,3 +25,19 @@ exports.Chains = WalletConnector.Chains;
11
25
  exports.WalletConnectorBase = WalletConnector.WalletConnectorBase;
12
26
  exports.socialProviders = WalletConnector.socialProviders;
13
27
  exports.logger = logger.logger;
28
+ exports.ProviderLookup = ProviderLookup.ProviderLookup;
29
+ exports.getChainInfo = getChainInfo.getChainInfo;
30
+ exports.isEmailOTPWalletConnector = isEmailOTPWalletConnector.isEmailOTPWalletConnector;
31
+ exports.isEmailWalletConnector = isEmailWalletConnector.isEmailWalletConnector;
32
+ exports.isSameAddress = isSameAddress.isSameAddress;
33
+ exports.isSocialWalletConnector = isSocialWalletConnector.isSocialWalletConnector;
34
+ exports.addHexPrefix = encoding.addHexPrefix;
35
+ exports.bufferToHex = encoding.bufferToHex;
36
+ exports.utf8ToHex = encoding.utf8ToHex;
37
+ exports.getWalletConnectorByName = getWalletConnectorByName.getWalletConnectorByName;
38
+ exports.shouldLowercaseAddress = shouldLowercaseAddress.shouldLowercaseAddress;
39
+ exports.normalizeWalletName = normalizeWalletName.normalizeWalletName;
40
+ exports.PhantomLedgerWalletName = PhantomLedgerWalletName.PhantomLedgerWalletName;
41
+ exports.getDeepLink = walletConnectDeepLinks.getDeepLink;
42
+ exports.performPlatformSpecificConnectionMethod = performPlatformSpecificConnectionMethod.performPlatformSpecificConnectionMethod;
43
+ exports.isEmbeddedConnector = isEmbeddedConnector.isEmbeddedConnector;
package/src/index.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- export * from './lib/WalletConnector';
2
- export * from './lib/IEmailWalletConnector';
3
- export * from './lib/IEmailOTPWalletConnector';
1
+ export * from './lib';
4
2
  export * from './utils';
package/src/index.js CHANGED
@@ -1,2 +1,16 @@
1
1
  export { Chains, WalletConnectorBase, socialProviders } from './lib/WalletConnector.js';
2
2
  export { logger } from './utils/logger.js';
3
+ export { ProviderLookup } from './utils/ProviderLookup/ProviderLookup.js';
4
+ export { getChainInfo } from './utils/getChainInfo/getChainInfo.js';
5
+ export { isEmailOTPWalletConnector } from './utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.js';
6
+ export { isEmailWalletConnector } from './utils/isEmailWalletConnector/isEmailWalletConnector.js';
7
+ export { isSameAddress } from './utils/isSameAddress/isSameAddress.js';
8
+ export { isSocialWalletConnector } from './utils/isSocialWalletConnector/isSocialWalletConnector.js';
9
+ export { addHexPrefix, bufferToHex, utf8ToHex } from './utils/encoding.js';
10
+ export { getWalletConnectorByName } from './utils/getWalletConnectorByName.js';
11
+ export { shouldLowercaseAddress } from './utils/shouldLowercaseAddress.js';
12
+ export { normalizeWalletName } from './utils/normalizeWalletName/normalizeWalletName.js';
13
+ export { PhantomLedgerWalletName } from './utils/PhantomLedgerWalletName.js';
14
+ export { getDeepLink } from './utils/walletConnectDeepLinks/walletConnectDeepLinks.js';
15
+ export { performPlatformSpecificConnectionMethod } from './utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.js';
16
+ export { isEmbeddedConnector } from './utils/isEmbeddedConnector/isEmbeddedConnector.js';
@@ -30,6 +30,9 @@ export interface WalletConnector extends WalletConnectorBase {
30
30
  export interface WalletConnectorConstructor {
31
31
  new (props?: any): WalletConnector;
32
32
  }
33
+ export type WalletConnectorsMethod = (props: {
34
+ isWalletConnectV2Enabled: boolean;
35
+ }) => WalletConnectorConstructor[];
33
36
  export declare abstract class WalletConnectorBase {
34
37
  chainRpcProviders: typeof ChainRpcProviders | undefined;
35
38
  protected constructorProps: any;
@@ -0,0 +1,4 @@
1
+ export * from './IEmailOTPWalletConnector';
2
+ export * from './IEmailWalletConnector';
3
+ export * from './WalletConnector';
4
+ export * from './types';
@@ -0,0 +1,7 @@
1
+ import { Chain } from './WalletConnector';
2
+ export type ChainInfo = {
3
+ blockchainName: string;
4
+ displayName: string;
5
+ name: string;
6
+ symbol: Chain;
7
+ };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ /**
6
+ * I'm exporting the walletName to use it for DYN-1447. As we only need the wallet name,
7
+ * exporting it in this way, we avoid to instantiate the whole PhantomLedger class every time.
8
+ */
9
+ const PhantomLedgerWalletName = 'Phantom Ledger';
10
+
11
+ exports.PhantomLedgerWalletName = PhantomLedgerWalletName;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * I'm exporting the walletName to use it for DYN-1447. As we only need the wallet name,
3
+ * exporting it in this way, we avoid to instantiate the whole PhantomLedger class every time.
4
+ */
5
+ export declare const PhantomLedgerWalletName = "Phantom Ledger";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * I'm exporting the walletName to use it for DYN-1447. As we only need the wallet name,
3
+ * exporting it in this way, we avoid to instantiate the whole PhantomLedger class every time.
4
+ */
5
+ const PhantomLedgerWalletName = 'Phantom Ledger';
6
+
7
+ export { PhantomLedgerWalletName };
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const ProviderLookup = (installedProviders, providerFlags) => {
6
+ if (providerFlags.length === 0) {
7
+ return undefined;
8
+ }
9
+ return installedProviders.find((provider) => {
10
+ const providerFlagMatch = providerFlags.every((condition) => {
11
+ const flagValue = (provider === null || provider === void 0 ? void 0 : provider[condition.flag]) || false;
12
+ return flagValue === condition.value;
13
+ });
14
+ return providerFlagMatch === true;
15
+ });
16
+ };
17
+
18
+ exports.ProviderLookup = ProviderLookup;
@@ -0,0 +1,5 @@
1
+ export type ProviderCondition<T = unknown> = {
2
+ flag: T;
3
+ value: boolean;
4
+ };
5
+ export declare const ProviderLookup: <T extends { [key in Flag]: boolean; }, Flag extends string>(installedProviders: T[], providerFlags: ProviderCondition<Flag>[]) => T | undefined;
@@ -0,0 +1,14 @@
1
+ const ProviderLookup = (installedProviders, providerFlags) => {
2
+ if (providerFlags.length === 0) {
3
+ return undefined;
4
+ }
5
+ return installedProviders.find((provider) => {
6
+ const providerFlagMatch = providerFlags.every((condition) => {
7
+ const flagValue = (provider === null || provider === void 0 ? void 0 : provider[condition.flag]) || false;
8
+ return flagValue === condition.value;
9
+ });
10
+ return providerFlagMatch === true;
11
+ });
12
+ };
13
+
14
+ export { ProviderLookup };
@@ -0,0 +1 @@
1
+ export * from './ProviderLookup';
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ // taken from https://github.com/WalletConnect/walletconnect-utils/blob/master/misc/encoding/src/index.ts
6
+ const ENC_HEX = 'hex';
7
+ const ENC_UTF8 = 'utf8';
8
+ const utf8ToBuffer = (utf8) => Buffer.from(utf8, ENC_UTF8);
9
+ const addHexPrefix = (hex) => hex.startsWith('0x') ? hex : `0x${hex}`;
10
+ const bufferToHex = (buf, prefixed = false) => {
11
+ const hex = buf.toString(ENC_HEX);
12
+ return prefixed ? addHexPrefix(hex) : hex;
13
+ };
14
+ const utf8ToHex = (utf8, prefixed = false) => bufferToHex(utf8ToBuffer(utf8), prefixed);
15
+
16
+ exports.addHexPrefix = addHexPrefix;
17
+ exports.bufferToHex = bufferToHex;
18
+ exports.utf8ToHex = utf8ToHex;
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ export declare const addHexPrefix: (hex: string) => string;
3
+ export declare const bufferToHex: (buf: Buffer, prefixed?: boolean) => string;
4
+ export declare const utf8ToHex: (utf8: string, prefixed?: boolean) => string;
@@ -0,0 +1,12 @@
1
+ // taken from https://github.com/WalletConnect/walletconnect-utils/blob/master/misc/encoding/src/index.ts
2
+ const ENC_HEX = 'hex';
3
+ const ENC_UTF8 = 'utf8';
4
+ const utf8ToBuffer = (utf8) => Buffer.from(utf8, ENC_UTF8);
5
+ const addHexPrefix = (hex) => hex.startsWith('0x') ? hex : `0x${hex}`;
6
+ const bufferToHex = (buf, prefixed = false) => {
7
+ const hex = buf.toString(ENC_HEX);
8
+ return prefixed ? addHexPrefix(hex) : hex;
9
+ };
10
+ const utf8ToHex = (utf8, prefixed = false) => bufferToHex(utf8ToBuffer(utf8), prefixed);
11
+
12
+ export { addHexPrefix, bufferToHex, utf8ToHex };
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const chainsInfo = [
6
+ {
7
+ blockchainName: 'Algorand',
8
+ displayName: 'Algorand',
9
+ name: 'algorand',
10
+ symbol: 'ALGO',
11
+ },
12
+ {
13
+ blockchainName: 'Ethereum',
14
+ displayName: 'EVM',
15
+ name: 'evm',
16
+ symbol: 'ETH',
17
+ },
18
+ {
19
+ blockchainName: 'Flow',
20
+ displayName: 'Flow',
21
+ name: 'flow',
22
+ symbol: 'FLOW',
23
+ },
24
+ {
25
+ blockchainName: 'Solana',
26
+ displayName: 'Solana',
27
+ name: 'solana',
28
+ symbol: 'SOL',
29
+ },
30
+ {
31
+ blockchainName: 'Starknet',
32
+ displayName: 'Starknet',
33
+ name: 'starknet',
34
+ symbol: 'STARK',
35
+ },
36
+ {
37
+ blockchainName: 'Cosmos',
38
+ displayName: 'Cosmos',
39
+ name: 'cosmos',
40
+ symbol: 'COSMOS',
41
+ },
42
+ ];
43
+ const chainOverrides = {
44
+ eip155: 'evm',
45
+ eth: 'evm',
46
+ };
47
+ const getChainInfo = (chain) => {
48
+ var _a;
49
+ const lowerCasedChain = chain.toLowerCase();
50
+ const normalizedChain = (_a = chainOverrides[lowerCasedChain]) !== null && _a !== void 0 ? _a : lowerCasedChain;
51
+ const chainInfo = chainsInfo.find((info) => info.name === normalizedChain ||
52
+ info.symbol.toLocaleLowerCase() === normalizedChain);
53
+ if (!chainInfo) {
54
+ return;
55
+ }
56
+ return chainInfo;
57
+ };
58
+
59
+ exports.getChainInfo = getChainInfo;
@@ -0,0 +1,2 @@
1
+ import { ChainInfo } from '../../lib';
2
+ export declare const getChainInfo: (chain: string) => ChainInfo | undefined;
@@ -0,0 +1,55 @@
1
+ const chainsInfo = [
2
+ {
3
+ blockchainName: 'Algorand',
4
+ displayName: 'Algorand',
5
+ name: 'algorand',
6
+ symbol: 'ALGO',
7
+ },
8
+ {
9
+ blockchainName: 'Ethereum',
10
+ displayName: 'EVM',
11
+ name: 'evm',
12
+ symbol: 'ETH',
13
+ },
14
+ {
15
+ blockchainName: 'Flow',
16
+ displayName: 'Flow',
17
+ name: 'flow',
18
+ symbol: 'FLOW',
19
+ },
20
+ {
21
+ blockchainName: 'Solana',
22
+ displayName: 'Solana',
23
+ name: 'solana',
24
+ symbol: 'SOL',
25
+ },
26
+ {
27
+ blockchainName: 'Starknet',
28
+ displayName: 'Starknet',
29
+ name: 'starknet',
30
+ symbol: 'STARK',
31
+ },
32
+ {
33
+ blockchainName: 'Cosmos',
34
+ displayName: 'Cosmos',
35
+ name: 'cosmos',
36
+ symbol: 'COSMOS',
37
+ },
38
+ ];
39
+ const chainOverrides = {
40
+ eip155: 'evm',
41
+ eth: 'evm',
42
+ };
43
+ const getChainInfo = (chain) => {
44
+ var _a;
45
+ const lowerCasedChain = chain.toLowerCase();
46
+ const normalizedChain = (_a = chainOverrides[lowerCasedChain]) !== null && _a !== void 0 ? _a : lowerCasedChain;
47
+ const chainInfo = chainsInfo.find((info) => info.name === normalizedChain ||
48
+ info.symbol.toLocaleLowerCase() === normalizedChain);
49
+ if (!chainInfo) {
50
+ return;
51
+ }
52
+ return chainInfo;
53
+ };
54
+
55
+ export { getChainInfo };
@@ -0,0 +1 @@
1
+ export { getChainInfo } from './getChainInfo';
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var normalizeWalletName = require('./normalizeWalletName/normalizeWalletName.cjs');
6
+
7
+ const filterWalletsByName = (wallets, names) => names
8
+ .flatMap((name) => wallets.find((w) => walletHasName(w, name)))
9
+ .filter(isWalletConnector);
10
+ const walletHasName = (wallet, name) => normalizeWalletName.normalizeWalletName(wallet.name) === name;
11
+ const isWalletConnector = (item) => Boolean(item);
12
+ const getWalletConnectorByName = (wallets, name) => {
13
+ const normalizedWalletname = normalizeWalletName.normalizeWalletName(name);
14
+ return filterWalletsByName(wallets, [normalizedWalletname]).length > 0
15
+ ? filterWalletsByName(wallets, [normalizedWalletname])[0]
16
+ : null;
17
+ };
18
+
19
+ exports.getWalletConnectorByName = getWalletConnectorByName;
@@ -0,0 +1,2 @@
1
+ import { WalletConnector } from '../lib';
2
+ export declare const getWalletConnectorByName: (wallets: WalletConnector[], name: string) => WalletConnector | null;
@@ -0,0 +1,15 @@
1
+ import { normalizeWalletName } from './normalizeWalletName/normalizeWalletName.js';
2
+
3
+ const filterWalletsByName = (wallets, names) => names
4
+ .flatMap((name) => wallets.find((w) => walletHasName(w, name)))
5
+ .filter(isWalletConnector);
6
+ const walletHasName = (wallet, name) => normalizeWalletName(wallet.name) === name;
7
+ const isWalletConnector = (item) => Boolean(item);
8
+ const getWalletConnectorByName = (wallets, name) => {
9
+ const normalizedWalletname = normalizeWalletName(name);
10
+ return filterWalletsByName(wallets, [normalizedWalletname]).length > 0
11
+ ? filterWalletsByName(wallets, [normalizedWalletname])[0]
12
+ : null;
13
+ };
14
+
15
+ export { getWalletConnectorByName };
@@ -1 +1,14 @@
1
1
  export * from './logger';
2
+ export * from './ProviderLookup';
3
+ export * from './getChainInfo';
4
+ export * from './isEmailOTPWalletConnector';
5
+ export * from './isEmailWalletConnector';
6
+ export * from './isSameAddress';
7
+ export * from './isSocialWalletConnector';
8
+ export * from './encoding';
9
+ export * from './getWalletConnectorByName';
10
+ export * from './shouldLowercaseAddress';
11
+ export * from './normalizeWalletName';
12
+ export * from './PhantomLedgerWalletName';
13
+ export * from './walletConnectDeepLinks';
14
+ export * from './isEmbeddedConnector';
@@ -0,0 +1 @@
1
+ export { isEmailOTPWalletConnector } from './isEmailOTPWalletConnector';
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const isEmailOTPWalletConnector = (walletConnector) => Boolean(walletConnector.verifyOneTimePassword);
6
+
7
+ exports.isEmailOTPWalletConnector = isEmailOTPWalletConnector;
@@ -0,0 +1,2 @@
1
+ import { IEmailOTPWalletConnector, WalletConnector } from '../../lib';
2
+ export declare const isEmailOTPWalletConnector: (walletConnector: WalletConnector | IEmailOTPWalletConnector) => walletConnector is IEmailOTPWalletConnector;
@@ -0,0 +1,3 @@
1
+ const isEmailOTPWalletConnector = (walletConnector) => Boolean(walletConnector.verifyOneTimePassword);
2
+
3
+ export { isEmailOTPWalletConnector };
@@ -0,0 +1 @@
1
+ export { isEmailWalletConnector } from './isEmailWalletConnector';
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const isEmailWalletConnector = (walletConnector) => Boolean(walletConnector.canConnectViaEmail);
6
+
7
+ exports.isEmailWalletConnector = isEmailWalletConnector;
@@ -0,0 +1,2 @@
1
+ import { WalletConnector, IEmailWalletConnector } from '../../lib';
2
+ export declare const isEmailWalletConnector: (walletConnector: WalletConnector | IEmailWalletConnector) => walletConnector is IEmailWalletConnector;
@@ -0,0 +1,3 @@
1
+ const isEmailWalletConnector = (walletConnector) => Boolean(walletConnector.canConnectViaEmail);
2
+
3
+ export { isEmailWalletConnector };
@@ -0,0 +1 @@
1
+ export { isEmbeddedConnector } from './isEmbeddedConnector';
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var isEmailOTPWalletConnector = require('../isEmailOTPWalletConnector/isEmailOTPWalletConnector.cjs');
6
+ var isSocialWalletConnector = require('../isSocialWalletConnector/isSocialWalletConnector.cjs');
7
+
8
+ const isEmbeddedConnector = (connector) => isSocialWalletConnector.isSocialWalletConnector(connector) || isEmailOTPWalletConnector.isEmailOTPWalletConnector(connector);
9
+
10
+ exports.isEmbeddedConnector = isEmbeddedConnector;
@@ -0,0 +1,2 @@
1
+ import { WalletConnector } from '../../lib';
2
+ export declare const isEmbeddedConnector: (connector: WalletConnector) => boolean;
@@ -0,0 +1,6 @@
1
+ import { isEmailOTPWalletConnector } from '../isEmailOTPWalletConnector/isEmailOTPWalletConnector.js';
2
+ import { isSocialWalletConnector } from '../isSocialWalletConnector/isSocialWalletConnector.js';
3
+
4
+ const isEmbeddedConnector = (connector) => isSocialWalletConnector(connector) || isEmailOTPWalletConnector(connector);
5
+
6
+ export { isEmbeddedConnector };
@@ -0,0 +1 @@
1
+ export { isSameAddress } from './isSameAddress';
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var normalizeAddress = require('./utils/normalizeAddress/normalizeAddress.cjs');
6
+
7
+ const isSameAddress = (left, right, chain) => normalizeAddress.normalizeAddress(left, chain) === normalizeAddress.normalizeAddress(right, chain);
8
+
9
+ exports.isSameAddress = isSameAddress;
@@ -0,0 +1 @@
1
+ export declare const isSameAddress: (left: string, right: string, chain: string) => boolean;
@@ -0,0 +1,5 @@
1
+ import { normalizeAddress } from './utils/normalizeAddress/normalizeAddress.js';
2
+
3
+ const isSameAddress = (left, right, chain) => normalizeAddress(left, chain) === normalizeAddress(right, chain);
4
+
5
+ export { isSameAddress };
@@ -0,0 +1 @@
1
+ export * from './normalizeAddress';
@@ -0,0 +1 @@
1
+ export { normalizeAddress } from './normalizeAddress';
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var shouldLowercaseAddress = require('../../../shouldLowercaseAddress.cjs');
6
+
7
+ const normalizeAddress = (rawAddress, chain) => {
8
+ if (rawAddress.startsWith('0x')) {
9
+ rawAddress = rawAddress.slice(2);
10
+ }
11
+ const address = shouldLowercaseAddress.shouldLowercaseAddress(chain)
12
+ ? rawAddress.toLowerCase()
13
+ : rawAddress;
14
+ return address;
15
+ };
16
+
17
+ exports.normalizeAddress = normalizeAddress;
@@ -0,0 +1 @@
1
+ export declare const normalizeAddress: (rawAddress: string, chain: string) => string;
@@ -0,0 +1,13 @@
1
+ import { shouldLowercaseAddress } from '../../../shouldLowercaseAddress.js';
2
+
3
+ const normalizeAddress = (rawAddress, chain) => {
4
+ if (rawAddress.startsWith('0x')) {
5
+ rawAddress = rawAddress.slice(2);
6
+ }
7
+ const address = shouldLowercaseAddress(chain)
8
+ ? rawAddress.toLowerCase()
9
+ : rawAddress;
10
+ return address;
11
+ };
12
+
13
+ export { normalizeAddress };
@@ -0,0 +1 @@
1
+ export { isSocialWalletConnector } from './isSocialWalletConnector';
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const isSocialWalletConnector = (walletConnector) => Boolean(walletConnector.canConnectViaSocial);
6
+
7
+ exports.isSocialWalletConnector = isSocialWalletConnector;
@@ -0,0 +1,2 @@
1
+ import { WalletConnector } from '../../lib';
2
+ export declare const isSocialWalletConnector: (walletConnector: WalletConnector) => boolean;
@@ -0,0 +1,3 @@
1
+ const isSocialWalletConnector = (walletConnector) => Boolean(walletConnector.canConnectViaSocial);
2
+
3
+ export { isSocialWalletConnector };
@@ -0,0 +1 @@
1
+ export { normalizeWalletName } from './normalizeWalletName';
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const normalizeWalletName = (name) => name.replace(/\W/g, '').toLowerCase();
6
+
7
+ exports.normalizeWalletName = normalizeWalletName;
@@ -0,0 +1 @@
1
+ export declare const normalizeWalletName: (name: string) => string;
@@ -0,0 +1,3 @@
1
+ const normalizeWalletName = (name) => name.replace(/\W/g, '').toLowerCase();
2
+
3
+ export { normalizeWalletName };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const shouldLowercaseAddress = (chain) =>
6
+ // these are standard from CAIP-2: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md
7
+ // see also: https://github.com/ChainAgnostic/namespaces
8
+ // note: no standard namespace currently exists for flow
9
+ ['eip155', 'flow', 'evm', 'eth', 'avax'].includes(chain.toLowerCase());
10
+
11
+ exports.shouldLowercaseAddress = shouldLowercaseAddress;
@@ -0,0 +1 @@
1
+ export declare const shouldLowercaseAddress: (chain: string) => boolean;
@@ -0,0 +1,7 @@
1
+ const shouldLowercaseAddress = (chain) =>
2
+ // these are standard from CAIP-2: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md
3
+ // see also: https://github.com/ChainAgnostic/namespaces
4
+ // note: no standard namespace currently exists for flow
5
+ ['eip155', 'flow', 'evm', 'eth', 'avax'].includes(chain.toLowerCase());
6
+
7
+ export { shouldLowercaseAddress };
@@ -0,0 +1,2 @@
1
+ export * from './walletConnectDeepLinks';
2
+ export * from './performPlatformSpecificConnectionMethod';
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var utils = require('@dynamic-labs/utils');
6
+ var walletConnectDeepLinks = require('./walletConnectDeepLinks.cjs');
7
+
8
+ const performPlatformSpecificConnectionMethod = (uri, metadata, opts) => {
9
+ var _a, _b, _c;
10
+ const deepLink = walletConnectDeepLinks.getDeepLink({ metadata, mode: 'connection', uri });
11
+ if (utils.isMobile()) {
12
+ window.location.href = deepLink;
13
+ }
14
+ else {
15
+ if ((_a = metadata.desktop) === null || _a === void 0 ? void 0 : _a.native) {
16
+ (_b = opts.onDesktopUri) === null || _b === void 0 ? void 0 : _b.call(opts, deepLink);
17
+ }
18
+ (_c = opts.onDisplayUri) === null || _c === void 0 ? void 0 : _c.call(opts, uri);
19
+ }
20
+ };
21
+
22
+ exports.performPlatformSpecificConnectionMethod = performPlatformSpecificConnectionMethod;
@@ -0,0 +1,3 @@
1
+ import type { WalletSchema } from '@dynamic-labs/wallet-book';
2
+ import type { FetchPublicAddressOpts } from '../../lib';
3
+ export declare const performPlatformSpecificConnectionMethod: (uri: string, metadata: WalletSchema, opts: Pick<FetchPublicAddressOpts, 'onDesktopUri' | 'onDisplayUri'>) => void;
@@ -0,0 +1,18 @@
1
+ import { isMobile } from '@dynamic-labs/utils';
2
+ import { getDeepLink } from './walletConnectDeepLinks.js';
3
+
4
+ const performPlatformSpecificConnectionMethod = (uri, metadata, opts) => {
5
+ var _a, _b, _c;
6
+ const deepLink = getDeepLink({ metadata, mode: 'connection', uri });
7
+ if (isMobile()) {
8
+ window.location.href = deepLink;
9
+ }
10
+ else {
11
+ if ((_a = metadata.desktop) === null || _a === void 0 ? void 0 : _a.native) {
12
+ (_b = opts.onDesktopUri) === null || _b === void 0 ? void 0 : _b.call(opts, deepLink);
13
+ }
14
+ (_c = opts.onDisplayUri) === null || _c === void 0 ? void 0 : _c.call(opts, uri);
15
+ }
16
+ };
17
+
18
+ export { performPlatformSpecificConnectionMethod };
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var utils = require('@dynamic-labs/utils');
6
+
7
+ const getConnectionDeepLink = (uri, metadata) => {
8
+ // on android, the connection deeplink is simply the uri
9
+ // see: https://docs.walletconnect.com/mobile-linking#for-android
10
+ if (utils.isAndroid()) {
11
+ return uri;
12
+ }
13
+ const deepLink = getRegularDeepLink(uri, metadata);
14
+ return `${deepLink}?uri=${encodeURIComponent(uri)}`;
15
+ };
16
+ const getRegularDeepLink = (uri, metadata) => {
17
+ var _a, _b;
18
+ if (utils.isAndroid()) {
19
+ // on android, the deeplink is simply the uri, without the query params
20
+ // see: https://docs.walletconnect.com/mobile-linking#for-android
21
+ return uri.split('?')[0];
22
+ }
23
+ const index = utils.isMobile() ? 'mobile' : 'desktop';
24
+ const origin = ((_a = metadata[index]) === null || _a === void 0 ? void 0 : _a.universal) || ((_b = metadata[index]) === null || _b === void 0 ? void 0 : _b.native);
25
+ return origin || '';
26
+ };
27
+ const getDeepLink = ({ mode, uri = '', metadata, }) => {
28
+ switch (mode) {
29
+ case 'connection':
30
+ return getConnectionDeepLink(uri, metadata);
31
+ case 'regular':
32
+ return getRegularDeepLink(uri, metadata);
33
+ }
34
+ };
35
+
36
+ exports.getDeepLink = getDeepLink;
@@ -0,0 +1,8 @@
1
+ import type { WalletSchema } from '@dynamic-labs/wallet-book';
2
+ type GetDeepLinkArgs = {
3
+ metadata: WalletSchema;
4
+ mode: 'connection' | 'regular';
5
+ uri?: string;
6
+ };
7
+ export declare const getDeepLink: ({ mode, uri, metadata, }: GetDeepLinkArgs) => string;
8
+ export {};
@@ -0,0 +1,32 @@
1
+ import { isAndroid, isMobile } from '@dynamic-labs/utils';
2
+
3
+ const getConnectionDeepLink = (uri, metadata) => {
4
+ // on android, the connection deeplink is simply the uri
5
+ // see: https://docs.walletconnect.com/mobile-linking#for-android
6
+ if (isAndroid()) {
7
+ return uri;
8
+ }
9
+ const deepLink = getRegularDeepLink(uri, metadata);
10
+ return `${deepLink}?uri=${encodeURIComponent(uri)}`;
11
+ };
12
+ const getRegularDeepLink = (uri, metadata) => {
13
+ var _a, _b;
14
+ if (isAndroid()) {
15
+ // on android, the deeplink is simply the uri, without the query params
16
+ // see: https://docs.walletconnect.com/mobile-linking#for-android
17
+ return uri.split('?')[0];
18
+ }
19
+ const index = isMobile() ? 'mobile' : 'desktop';
20
+ const origin = ((_a = metadata[index]) === null || _a === void 0 ? void 0 : _a.universal) || ((_b = metadata[index]) === null || _b === void 0 ? void 0 : _b.native);
21
+ return origin || '';
22
+ };
23
+ const getDeepLink = ({ mode, uri = '', metadata, }) => {
24
+ switch (mode) {
25
+ case 'connection':
26
+ return getConnectionDeepLink(uri, metadata);
27
+ case 'regular':
28
+ return getRegularDeepLink(uri, metadata);
29
+ }
30
+ };
31
+
32
+ export { getDeepLink };