0xtrails 0.4.3 → 0.6.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 (207) hide show
  1. package/dist/analytics.d.ts +8 -3
  2. package/dist/analytics.d.ts.map +1 -1
  3. package/dist/{ccip-C9CA3tIi.js → ccip-Dw5AN7oU.js} +27 -27
  4. package/dist/cctp.d.ts +0 -149
  5. package/dist/cctp.d.ts.map +1 -1
  6. package/dist/chains.d.ts +31 -4
  7. package/dist/chains.d.ts.map +1 -1
  8. package/dist/config.d.ts +28 -52
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/constants.d.ts +1 -7
  11. package/dist/constants.d.ts.map +1 -1
  12. package/dist/contractUtils.d.ts.map +1 -1
  13. package/dist/estimate.d.ts.map +1 -1
  14. package/dist/fees.d.ts.map +1 -1
  15. package/dist/gasless.d.ts +12 -0
  16. package/dist/gasless.d.ts.map +1 -1
  17. package/dist/{index-CNB57v0n.js → index-BtVUTbEZ.js} +32255 -40547
  18. package/dist/index.d.ts +13 -11
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +320 -944
  21. package/dist/indexerClient.d.ts +9 -6
  22. package/dist/indexerClient.d.ts.map +1 -1
  23. package/dist/intents.d.ts +0 -18
  24. package/dist/intents.d.ts.map +1 -1
  25. package/dist/mutations.d.ts.map +1 -1
  26. package/dist/paymasterSend.d.ts.map +1 -1
  27. package/dist/prepareSend.d.ts +1 -1
  28. package/dist/prepareSend.d.ts.map +1 -1
  29. package/dist/sendUserOp.d.ts +0 -18
  30. package/dist/sendUserOp.d.ts.map +1 -1
  31. package/dist/sequenceWallet.d.ts +1 -1
  32. package/dist/sequenceWallet.d.ts.map +1 -1
  33. package/dist/tokenBalances.d.ts.map +1 -1
  34. package/dist/tokens.d.ts +10 -8
  35. package/dist/tokens.d.ts.map +1 -1
  36. package/dist/trailsClient.d.ts +3 -3
  37. package/dist/trailsClient.d.ts.map +1 -1
  38. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +4 -5
  39. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
  40. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +4 -5
  41. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
  42. package/dist/transactionIntent/deposits/standardDeposit.d.ts +2 -2
  43. package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
  44. package/dist/transactionIntent/execution/transactionState.d.ts +2 -2
  45. package/dist/transactionIntent/execution/transactionState.d.ts.map +1 -1
  46. package/dist/transactionIntent/handlers/crossChain.d.ts +6 -4
  47. package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -1
  48. package/dist/transactionIntent/handlers/index.d.ts +0 -1
  49. package/dist/transactionIntent/handlers/index.d.ts.map +1 -1
  50. package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +4 -34
  51. package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -1
  52. package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
  53. package/dist/transactionIntent/quote/quoteHelpers.d.ts +2 -1
  54. package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
  55. package/dist/transactionIntent/types.d.ts +7 -19
  56. package/dist/transactionIntent/types.d.ts.map +1 -1
  57. package/dist/transactionIntent/utils/index.d.ts +0 -1
  58. package/dist/transactionIntent/utils/index.d.ts.map +1 -1
  59. package/dist/transactions.d.ts +6 -18
  60. package/dist/transactions.d.ts.map +1 -1
  61. package/dist/utils.d.ts +8 -2
  62. package/dist/utils.d.ts.map +1 -1
  63. package/dist/walletUtils.d.ts +21 -0
  64. package/dist/walletUtils.d.ts.map +1 -0
  65. package/dist/wallets.d.ts +33 -240
  66. package/dist/wallets.d.ts.map +1 -1
  67. package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
  68. package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
  69. package/dist/widget/components/ConfigDisplay.d.ts.map +1 -1
  70. package/dist/widget/components/FeeOption.d.ts +8 -13
  71. package/dist/widget/components/FeeOption.d.ts.map +1 -1
  72. package/dist/widget/components/FeeOptions.d.ts +11 -5
  73. package/dist/widget/components/FeeOptions.d.ts.map +1 -1
  74. package/dist/widget/components/NativeGasOption.d.ts.map +1 -1
  75. package/dist/widget/components/Pay.d.ts.map +1 -1
  76. package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
  77. package/dist/widget/components/QRCodeDeposit.d.ts +5 -0
  78. package/dist/widget/components/QRCodeDeposit.d.ts.map +1 -1
  79. package/dist/widget/components/QRCodeWalletSelect.d.ts +13 -0
  80. package/dist/widget/components/QRCodeWalletSelect.d.ts.map +1 -0
  81. package/dist/widget/components/QrCode.d.ts.map +1 -1
  82. package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
  83. package/dist/widget/components/Receipt.d.ts.map +1 -1
  84. package/dist/widget/components/ScreenHeader.d.ts +1 -1
  85. package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
  86. package/dist/widget/components/SlippageToleranceSettings.d.ts +1 -0
  87. package/dist/widget/components/SlippageToleranceSettings.d.ts.map +1 -1
  88. package/dist/widget/components/Toast.d.ts.map +1 -1
  89. package/dist/widget/components/TokenImage.d.ts.map +1 -1
  90. package/dist/widget/components/WalletConnect.d.ts.map +1 -1
  91. package/dist/widget/css/compiled.css +1 -1
  92. package/dist/widget/hooks/useCheckout.d.ts +15 -1
  93. package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
  94. package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
  95. package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
  96. package/dist/widget/hooks/useDebugScreens.d.ts +1 -1
  97. package/dist/widget/hooks/useDebugScreens.d.ts.map +1 -1
  98. package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
  99. package/dist/widget/hooks/useIsConnectedWalletSmartContract.d.ts +7 -0
  100. package/dist/widget/hooks/useIsConnectedWalletSmartContract.d.ts.map +1 -0
  101. package/dist/widget/hooks/useIsSequenceWallet.d.ts +6 -0
  102. package/dist/widget/hooks/useIsSequenceWallet.d.ts.map +1 -0
  103. package/dist/widget/hooks/useQuote.d.ts +6 -11
  104. package/dist/widget/hooks/useQuote.d.ts.map +1 -1
  105. package/dist/widget/hooks/useRecentTokens.d.ts.map +1 -1
  106. package/dist/widget/hooks/useSelectedFeeOption.d.ts +30 -0
  107. package/dist/widget/hooks/useSelectedFeeOption.d.ts.map +1 -0
  108. package/dist/widget/hooks/useSendForm.d.ts +6 -15
  109. package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
  110. package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
  111. package/dist/widget/index.d.ts +1 -0
  112. package/dist/widget/index.d.ts.map +1 -1
  113. package/dist/widget/index.js +4 -2
  114. package/dist/widget/providers/TrailsProvider.d.ts +29 -0
  115. package/dist/widget/providers/TrailsProvider.d.ts.map +1 -0
  116. package/dist/widget/widget.d.ts +14 -3
  117. package/dist/widget/widget.d.ts.map +1 -1
  118. package/package.json +9 -8
  119. package/src/analytics.ts +53 -21
  120. package/src/cctp.ts +0 -1016
  121. package/src/chains.ts +155 -68
  122. package/src/config.ts +51 -207
  123. package/src/constants.ts +1 -13
  124. package/src/contractUtils.ts +6 -6
  125. package/src/estimate.ts +3 -6
  126. package/src/fees.ts +5 -10
  127. package/src/gasless.ts +45 -0
  128. package/src/index.ts +18 -40
  129. package/src/indexerClient.ts +39 -48
  130. package/src/intents.ts +51 -226
  131. package/src/mutations.ts +3 -2
  132. package/src/paymasterSend.ts +2 -5
  133. package/src/prepareSend.ts +21 -14
  134. package/src/sendUserOp.ts +3 -64
  135. package/src/sequenceWallet.ts +1 -2
  136. package/src/tokenBalances.ts +2 -1
  137. package/src/tokens.ts +62 -133
  138. package/src/trailsClient.ts +17 -12
  139. package/src/transactionIntent/deposits/depositOrchestrator.ts +14 -15
  140. package/src/transactionIntent/deposits/gaslessDeposit.ts +70 -100
  141. package/src/transactionIntent/deposits/standardDeposit.ts +22 -28
  142. package/src/transactionIntent/execution/transactionState.ts +2 -2
  143. package/src/transactionIntent/handlers/crossChain.ts +179 -381
  144. package/src/transactionIntent/handlers/index.ts +0 -1
  145. package/src/transactionIntent/handlers/sameChainSameToken.ts +228 -94
  146. package/src/transactionIntent/quote/normalizeQuote.ts +4 -6
  147. package/src/transactionIntent/quote/quoteHelpers.ts +35 -3
  148. package/src/transactionIntent/types.ts +7 -27
  149. package/src/transactionIntent/utils/index.ts +0 -1
  150. package/src/transactions.ts +19 -118
  151. package/src/umd.tsx +1 -3
  152. package/src/utils.ts +28 -8
  153. package/src/walletUtils.ts +42 -0
  154. package/src/wallets.ts +365 -208
  155. package/src/widget/compiled.css +1 -1
  156. package/src/widget/components/AccountIntentTransactionHistory.tsx +78 -4
  157. package/src/widget/components/AccountSettings.tsx +17 -17
  158. package/src/widget/components/ChainList.tsx +3 -3
  159. package/src/widget/components/ClassicSwap.tsx +19 -10
  160. package/src/widget/components/ConfigDisplay.tsx +19 -59
  161. package/src/widget/components/FeeOption.tsx +63 -20
  162. package/src/widget/components/FeeOptions.tsx +54 -123
  163. package/src/widget/components/NativeGasOption.tsx +3 -1
  164. package/src/widget/components/Pay.tsx +18 -11
  165. package/src/widget/components/PoolDeposit.tsx +23 -10
  166. package/src/widget/components/QRCodeDeposit.tsx +50 -30
  167. package/src/widget/components/QRCodeWalletSelect.tsx +77 -0
  168. package/src/widget/components/QrCode.tsx +188 -233
  169. package/src/widget/components/QuoteDetails.tsx +48 -2
  170. package/src/widget/components/Receipt.tsx +5 -2
  171. package/src/widget/components/ScreenHeader.tsx +10 -8
  172. package/src/widget/components/SlippageToleranceSettings.tsx +63 -14
  173. package/src/widget/components/Toast.tsx +10 -0
  174. package/src/widget/components/TokenImage.tsx +56 -13
  175. package/src/widget/components/WalletConnect.tsx +37 -99
  176. package/src/widget/hooks/useCheckout.ts +71 -0
  177. package/src/widget/hooks/useCurrentScreen.tsx +1 -0
  178. package/src/widget/hooks/useDebugScreens.ts +5 -0
  179. package/src/widget/hooks/useIntentTransactionHistory.ts +790 -412
  180. package/src/widget/hooks/useIsConnectedWalletSmartContract.ts +43 -0
  181. package/src/widget/hooks/useIsSequenceWallet.ts +17 -0
  182. package/src/widget/hooks/useQuote.ts +27 -34
  183. package/src/widget/hooks/useRecentTokens.ts +2 -1
  184. package/src/widget/hooks/useSelectedFeeOption.tsx +257 -0
  185. package/src/widget/hooks/useSendForm.ts +175 -46
  186. package/src/widget/hooks/useTokenList.ts +15 -2
  187. package/src/widget/index.tsx +8 -0
  188. package/src/widget/providers/TrailsProvider.tsx +123 -0
  189. package/src/widget/widget.tsx +165 -143
  190. package/dist/cctpqueue.d.ts +0 -18
  191. package/dist/cctpqueue.d.ts.map +0 -1
  192. package/dist/preconditions.d.ts +0 -12
  193. package/dist/preconditions.d.ts.map +0 -1
  194. package/dist/trails.d.ts +0 -110
  195. package/dist/trails.d.ts.map +0 -1
  196. package/dist/transactionIntent/handlers/sameChainDifferentToken.d.ts +0 -62
  197. package/dist/transactionIntent/handlers/sameChainDifferentToken.d.ts.map +0 -1
  198. package/dist/transactionIntent/utils/lifiHelpers.d.ts +0 -10
  199. package/dist/transactionIntent/utils/lifiHelpers.d.ts.map +0 -1
  200. package/dist/widget/hooks/useSelectedFeeToken.d.ts +0 -33
  201. package/dist/widget/hooks/useSelectedFeeToken.d.ts.map +0 -1
  202. package/src/cctpqueue.ts +0 -66
  203. package/src/preconditions.ts +0 -47
  204. package/src/trails.ts +0 -1303
  205. package/src/transactionIntent/handlers/sameChainDifferentToken.ts +0 -323
  206. package/src/transactionIntent/utils/lifiHelpers.ts +0 -68
  207. package/src/widget/hooks/useSelectedFeeToken.tsx +0 -288
package/src/wallets.ts CHANGED
@@ -1,7 +1,5 @@
1
- import {
2
- getSequenceProjectAccessKey,
3
- getWalletConnectProjectId,
4
- } from "./config.js"
1
+ import { getConfig } from "./config.js"
2
+ import { DEFAULT_WALLETCONNECT_PROJECT_ID } from "./constants.js"
5
3
  import WalletConnectLogo from "./widget/assets/WalletConnect-logo-blue-bg.svg"
6
4
  import SequenceLogo from "./widget/assets/sequence-logo.svg"
7
5
  import { Wallet as WalletIcon } from "lucide-react"
@@ -15,6 +13,7 @@ import {
15
13
  import { useConnect } from "wagmi"
16
14
  import React from "react"
17
15
  import { sequenceWallet } from "@0xsequence/connect"
16
+ import { useTrails } from "./widget/providers/TrailsProvider.js"
18
17
 
19
18
  type Connector = any
20
19
 
@@ -25,12 +24,20 @@ export interface WalletConfig {
25
24
  connector?: Connector
26
25
  }
27
26
 
27
+ export interface QRCodeWalletOption {
28
+ id: string
29
+ label: string
30
+ usesEip681: boolean
31
+ icon: string
32
+ }
33
+
28
34
  // WalletConnect connector singleton to avoid multiple Core initializations
29
35
  let wcConnectorSingleton: ReturnType<typeof walletConnect> | null = null
30
36
  function getWalletConnectConnectorSingleton() {
31
37
  if (!wcConnectorSingleton) {
32
38
  wcConnectorSingleton = walletConnect({
33
- projectId: getWalletConnectProjectId(),
39
+ projectId:
40
+ getConfig("walletConnectProjectId") || DEFAULT_WALLETCONNECT_PROJECT_ID,
34
41
  showQrModal: false,
35
42
  })
36
43
  }
@@ -40,10 +47,6 @@ function getWalletConnectConnectorSingleton() {
40
47
  export const walletConnectConnector: Connector =
41
48
  getWalletConnectConnectorSingleton()
42
49
 
43
- export const injectedConnector = injected()
44
- export const baseAccountConnector: Connector = baseAccount()
45
- export const geminiConnector: Connector = gemini()
46
-
47
50
  function isInIframe() {
48
51
  // check if we're in an iframe
49
52
  if (window?.parent === window) {
@@ -94,201 +97,321 @@ export function windowProviderOrWalletConnect(
94
97
  return walletConnectConnector
95
98
  }
96
99
 
97
- export const metamaskConnector = injected({
98
- target() {
99
- return {
100
+ /**
101
+ * Hook to get all wallet connectors, creating them lazily with the correct configuration
102
+ */
103
+ export function useConnectors(): Connector[] {
104
+ const { trailsApiKey } = useTrails()
105
+
106
+ return React.useMemo(() => {
107
+ return getConnectorsInternal(trailsApiKey)
108
+ }, [trailsApiKey])
109
+ }
110
+
111
+ /**
112
+ * Internal function to get connectors (for use outside React components)
113
+ * Exported for use in widget.tsx where hooks can't be used in useMemo
114
+ */
115
+ export function getConnectorsInternal(projectAccessKey?: string): Connector[] {
116
+ // Create base connectors
117
+ const injectedConnector = injected()
118
+ const baseAccountConnector: Connector = baseAccount()
119
+ const geminiConnector: Connector = gemini()
120
+ const safeConnector: Connector = safeProviderOrWalletConnect()
121
+
122
+ // Create wallet-specific connectors
123
+ const metamaskConnector = injected({
124
+ target() {
125
+ return {
126
+ id: "metamask",
127
+ name: "metamask",
128
+ provider:
129
+ typeof window !== "undefined" ? (window as any).ethereum : undefined,
130
+ }
131
+ },
132
+ })
133
+
134
+ const rainbowConnector = windowProviderOrWalletConnect(
135
+ "rainbow",
136
+ "rainbow",
137
+ "Rainbow",
138
+ )
139
+ const trustwalletConnector = windowProviderOrWalletConnect(
140
+ "trustwallet",
141
+ "trustwallet",
142
+ "Trust",
143
+ )
144
+ const phantomConnector = windowProviderOrWalletConnect(
145
+ "phantom",
146
+ ["phantom", "ethereum"],
147
+ "Phantom",
148
+ )
149
+ const okxwalletConnector = windowProviderOrWalletConnect(
150
+ "okxwallet",
151
+ "okxwallet",
152
+ "OKX Wallet",
153
+ )
154
+ const zerionConnector = windowProviderOrWalletConnect(
155
+ "zerion",
156
+ "zerionWallet",
157
+ "Zerion",
158
+ )
159
+ const ambireConnector = windowProviderOrWalletConnect(
160
+ "ambire",
161
+ "ambire",
162
+ "Ambire",
163
+ )
164
+ const rabbyConnector = windowProviderOrWalletConnect(
165
+ "rabby",
166
+ "rabby",
167
+ "Rabby",
168
+ )
169
+ const coinbaseWalletConnector = windowProviderOrWalletConnect(
170
+ "coinbase",
171
+ "coinbaseWalletExtension",
172
+ "Coinbase Wallet",
173
+ )
174
+
175
+ // Create sequence connector with projectAccessKey
176
+ const sequenceConnector: any = sequenceWallet({
177
+ connect: {
178
+ app: "Trails",
179
+ projectAccessKey: projectAccessKey || getConfig("trailsApiKey") || "",
180
+ },
181
+ defaultNetwork: 1,
182
+ walletAppURL: "https://sequence.app",
183
+ })
184
+
185
+ return [
186
+ injectedConnector,
187
+ walletConnectConnector,
188
+ safeConnector,
189
+ baseAccountConnector,
190
+ geminiConnector,
191
+ coinbaseWalletConnector,
192
+ metamaskConnector,
193
+ rainbowConnector,
194
+ trustwalletConnector,
195
+ phantomConnector,
196
+ okxwalletConnector,
197
+ zerionConnector,
198
+ ambireConnector,
199
+ rabbyConnector,
200
+ sequenceConnector,
201
+ ]
202
+ }
203
+
204
+ /**
205
+ * Hook to get wallet configurations, creating connectors lazily with the correct configuration
206
+ */
207
+ export function useWalletConfigs(): Record<string, WalletConfig> {
208
+ const { trailsApiKey } = useTrails()
209
+
210
+ return React.useMemo(() => {
211
+ return getWalletConfigsInternal(trailsApiKey)
212
+ }, [trailsApiKey])
213
+ }
214
+
215
+ /**
216
+ * Internal function to get wallet configs (for use outside React components)
217
+ */
218
+ function getWalletConfigsInternal(
219
+ projectAccessKey?: string,
220
+ ): Record<string, WalletConfig> {
221
+ // Get connectors
222
+ const connectors = getConnectorsInternal(projectAccessKey)
223
+ const [
224
+ injectedConnector,
225
+ walletConnectConnector,
226
+ safeConnector,
227
+ baseAccountConnector,
228
+ geminiConnector,
229
+ coinbaseWalletConnector,
230
+ metamaskConnector,
231
+ rainbowConnector,
232
+ trustwalletConnector,
233
+ phantomConnector,
234
+ okxwalletConnector,
235
+ zerionConnector,
236
+ ambireConnector,
237
+ rabbyConnector,
238
+ sequenceConnector,
239
+ ] = connectors
240
+
241
+ return {
242
+ injected: {
243
+ id: "injected",
244
+ name: "Browser Wallet",
245
+ connector: injectedConnector,
246
+ icon: WalletIcon as unknown as string,
247
+ },
248
+ walletconnect: {
249
+ id: "walletconnect",
250
+ name: "WalletConnect",
251
+ connector: walletConnectConnector,
252
+ icon: WalletConnectLogo as string,
253
+ },
254
+ metamask: {
100
255
  id: "metamask",
101
- name: "metamask",
102
- provider:
103
- typeof window !== "undefined" ? (window as any).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dGggZmlsbD0iI0U3RUJGNiIgZD0ibTM5Ljc0IDEyMi42NiAyMyAxMy43NnYtMTIuNDZsLTIuMDUtNy41NHptNjIuMDMgMC0yMyAxMy43NnYtMTIuNDZsMi4wNi03LjU0eiIvPjwvc3ZnPjwvc3ZnPg==",
259
+ },
260
+ baseAccount: {
261
+ id: "baseAccount",
262
+ name: "Base",
263
+ connector: baseAccountConnector,
264
+ icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALZJREFUaEPtmjEOhDAMBNc/O14GvOzys3CAKK6eAlmaVGl2Zc+kTOU685vkc9/bnD2prZK5/TZY24z9P+g4F5hNh7/GdoG37WlAA5CATwgCxHENYISwQAMQII5rACOEBRqAAHFcAxghLNAABIjjGsAIYYEGIEAc1wBGCAs0AAHiuAYwQligAQgQxzWAEcICDUCAOK4BjBAWaAACxHENYISwQAMQII6fBjr+VHkW3+u+tfyxMpJaDgYzYxb/ALZVAAAAAElFTkSuQmCC",
265
+ },
266
+ safe: {
267
+ id: "safe",
268
+ name: "Safe",
269
+ connector: safeConnector,
270
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/3913df81-63c2-4413-d60b-8ff83cbed500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
271
+ },
272
+ rainbow: {
273
+ id: "rainbow",
274
+ name: "Rainbow",
275
+ connector: rainbowConnector,
276
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/7a33d7f1-3d12-4b5c-f3ee-5cd83cb1b500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
277
+ },
278
+ trust: {
279
+ id: "trust",
280
+ name: "Trust",
281
+ connector: trustwalletConnector,
282
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/7677b54f-3486-46e2-4e37-bf8747814f00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
283
+ },
284
+ ambire: {
285
+ id: "ambire",
286
+ name: "Ambire Wallet",
287
+ connector: ambireConnector,
288
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/c39b3a16-1a38-4588-f089-cb7aeb584700?projectId=34357d3c125c2bcf2ce2bc3309d98715",
289
+ },
290
+ argent: {
291
+ id: "argent",
292
+ name: "Argent",
293
+ connector: walletConnectConnector,
294
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/215158d2-614b-49c9-410f-77aa661c3900?projectId=34357d3c125c2bcf2ce2bc3309d98715",
295
+ },
296
+ binance: {
297
+ id: "binance",
298
+ name: "Binance Wallet",
299
+ connector: walletConnectConnector,
300
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/ebac7b39-688c-41e3-7912-a4fefba74600?projectId=34357d3c125c2bcf2ce2bc3309d98715",
301
+ },
302
+ okx: {
303
+ id: "okx",
304
+ name: "OKX Wallet",
305
+ connector: okxwalletConnector,
306
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/c55df831-3c52-49fc-d1d1-97a926dc0c00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
307
+ },
308
+ zerion: {
309
+ id: "zerion",
310
+ name: "Zerion",
311
+ connector: zerionConnector,
312
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/73f6f52f-7862-49e7-bb85-ba93ab72cc00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
313
+ },
314
+ phantom: {
315
+ id: "phantom",
316
+ name: "Phantom",
317
+ connector: phantomConnector,
318
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/b6ec7b81-bb4f-427d-e290-7631e6e50d00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
319
+ },
320
+ coinbase: {
321
+ id: "coinbase",
322
+ name: "Coinbase Wallet",
323
+ connector: coinbaseWalletConnector,
324
+ icon: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",
325
+ },
326
+ rabby: {
327
+ id: "rabby",
328
+ name: "Rabby",
329
+ connector: rabbyConnector,
330
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/255e6ba2-8dfd-43ad-e88e-57cbb98f6800?projectId=34357d3c125c2bcf2ce2bc3309d98715",
331
+ },
332
+ privy: {
333
+ id: "privy",
334
+ name: "Privy",
335
+ icon: "https://avatars.githubusercontent.com/u/81824329?s=200&v=4",
336
+ },
337
+ gemini: {
338
+ id: "gemini",
339
+ name: "Gemini",
340
+ connector: geminiConnector,
341
+ icon: "https://explorer-api.walletconnect.com/v3/logo/sm/56a3fd87-2627-4903-fddd-205224dac500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
342
+ },
343
+ sequence: {
344
+ id: "sequence",
345
+ name: "Sequence",
346
+ connector: sequenceConnector,
347
+ icon: SequenceLogo as string,
348
+ },
349
+ "sequence-waas": {
350
+ id: "sequence-waas",
351
+ name: "Sequence WaaS",
352
+ connector: sequenceConnector,
353
+ icon: SequenceLogo as string,
354
+ },
355
+ }
356
+ }
107
357
 
108
- export const rainbowConnector = windowProviderOrWalletConnect(
109
- "rainbow",
110
- "rainbow",
111
- "Rainbow",
112
- )
113
- export const trustwalletConnector = windowProviderOrWalletConnect(
114
- "trustwallet",
115
- "trustwallet",
116
- "Trust",
117
- )
118
- export const phantomConnector = windowProviderOrWalletConnect(
119
- "phantom",
120
- ["phantom", "ethereum"],
121
- "Phantom",
122
- )
123
- export const okxwalletConnector = windowProviderOrWalletConnect(
124
- "okxwallet",
125
- "okxwallet",
126
- "OKX Wallet",
127
- )
128
- export const zerionConnector = windowProviderOrWalletConnect(
129
- "zerion",
130
- "zerionWallet",
131
- "Zerion",
132
- )
133
- export const ambireConnector = windowProviderOrWalletConnect(
134
- "ambire",
135
- "ambire",
136
- "Ambire",
137
- )
138
- export const rabbyConnector = windowProviderOrWalletConnect(
139
- "rabby",
140
- "rabby",
141
- "Rabby",
142
- )
143
- export const coinbaseWalletConnector = windowProviderOrWalletConnect(
144
- "coinbase",
145
- "coinbaseWalletExtension",
146
- "Coinbase Wallet",
147
- )
148
-
149
- export const sequenceConnector: any = sequenceWallet({
150
- connect: {
151
- app: "Trails",
152
- projectAccessKey: getSequenceProjectAccessKey(),
153
- },
154
- defaultNetwork: 1,
155
- walletAppURL: "https://sequence.app",
156
- })
157
-
158
- export const safeConnector: Connector = safeProviderOrWalletConnect()
159
-
160
- export const connectors = [
161
- injectedConnector,
162
- walletConnectConnector,
163
- safeConnector,
164
- baseAccountConnector,
165
- geminiConnector,
166
- coinbaseWalletConnector,
167
- metamaskConnector,
168
- rainbowConnector,
169
- trustwalletConnector,
170
- phantomConnector,
171
- okxwalletConnector,
172
- zerionConnector,
173
- ambireConnector,
174
- rabbyConnector,
175
- sequenceConnector,
176
- ]
358
+ /**
359
+ * Hook to get QR code wallet options
360
+ */
361
+ export function useQRCodeWallets(): QRCodeWalletOption[] {
362
+ const { trailsApiKey } = useTrails()
177
363
 
178
- export const WALLET_CONFIGS: Record<string, WalletConfig> = {
179
- injected: {
180
- id: "injected",
181
- name: "Browser Wallet",
182
- connector: injectedConnector,
183
- icon: WalletIcon as unknown as string,
184
- },
185
- walletconnect: {
186
- id: "walletconnect",
187
- name: "WalletConnect",
188
- connector: walletConnectConnector,
189
- icon: WalletConnectLogo as string,
190
- },
191
- metamask: {
192
- id: "metamask",
193
- name: "MetaMask",
194
- connector: metamaskConnector,
195
- icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjIzIiBoZWlnaHQ9IjIzIiB4PSIzLjUiIHk9IjMuNSIgdmlld0JveD0iMCAwIDE0MS41MSAxMzYuNDIiPjxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im0xMzIuMjQgMTMxLjc1LTMwLjQ4LTkuMDctMjIuOTkgMTMuNzQtMTYuMDMtLjAxLTIzLTEzLjc0LTMwLjQ3IDkuMDhMMCAxMDAuNDdsOS4yNy0zNC43M0wwIDM2LjQgOS4yNyAwbDQ3LjYgMjguNDRoMjcuNzZMMTMyLjI0IDBsOS4yNyAzNi4zOC05LjI3IDI5LjM2IDkuMjcgMzQuNzItOS4yNyAzMS4zWiIvPjxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im05LjI3IDAgNDcuNjEgMjguNDZMNTQuOTggNDggOS4yOSAwWm0zMC40NyAxMDAuNDggMjAuOTUgMTUuOTUtMjAuOTUgNi4yNHYtMjIuMlpNNTkuMDEgNzQuMSA1NSA0OCAyOS4yMiA2NS43NWgtLjAybC4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45M0w4Ni41MyA0OHpNODguMjcgODEuNjdoOS4wNGw0LjkyIDQuODItMTcuNDkgNC4zNCAzLjUzLTkuMTdabS05LjUgNDIuMyAyLjA2LTcuNTQtNC4xNS00LjYySDY0LjgybC00LjE0IDQuNjIgMi4wNSA3LjU0Ii8+PHBhdGggZmlsbD0iI0MwQzRDRCIgZD0iTTc4Ljc3IDEyMy45N3YxMi40NUg2Mi43NHYtMTIuNDVoMTYuMDJaIi8+PHBhdGggZmlsbD0iI0U3RUJGNiIgZD0ibTM5Ljc0IDEyMi42NiAyMyAxMy43NnYtMTIuNDZsLTIuMDUtNy41NHptNjIuMDMgMC0yMyAxMy43NnYtMTIuNDZsMi4wNi03LjU0eiIvPjwvc3ZnPjwvc3ZnPg==",
196
- },
197
- baseAccount: {
198
- id: "baseAccount",
199
- name: "Base",
200
- connector: baseAccountConnector,
201
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALZJREFUaEPtmjEOhDAMBNc/O14GvOzys3CAKK6eAlmaVGl2Zc+kTOU685vkc9/bnD2prZK5/TZY24z9P+g4F5hNh7/GdoG37WlAA5CATwgCxHENYISwQAMQII5rACOEBRqAAHFcAxghLNAABIjjGsAIYYEGIEAc1wBGCAs0AAHiuAYwQligAQgQxzWAEcICDUCAOK4BjBAWaAACxHENYISwQAMQII6fBjr+VHkW3+u+tfyxMpJaDgYzYxb/ALZVAAAAAElFTkSuQmCC",
202
- },
203
- safe: {
204
- id: "safe",
205
- name: "Safe",
206
- connector: safeConnector,
207
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/3913df81-63c2-4413-d60b-8ff83cbed500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
208
- },
209
- rainbow: {
210
- id: "rainbow",
211
- name: "Rainbow",
212
- connector: rainbowConnector,
213
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/7a33d7f1-3d12-4b5c-f3ee-5cd83cb1b500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
214
- },
215
- trust: {
216
- id: "trust",
217
- name: "Trust",
218
- connector: trustwalletConnector,
219
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/7677b54f-3486-46e2-4e37-bf8747814f00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
220
- },
221
- ambire: {
222
- id: "ambire",
223
- name: "Ambire Wallet",
224
- connector: ambireConnector,
225
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/c39b3a16-1a38-4588-f089-cb7aeb584700?projectId=34357d3c125c2bcf2ce2bc3309d98715",
226
- },
227
- argent: {
228
- id: "argent",
229
- name: "Argent",
230
- connector: walletConnectConnector,
231
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/215158d2-614b-49c9-410f-77aa661c3900?projectId=34357d3c125c2bcf2ce2bc3309d98715",
232
- },
233
- binance: {
234
- id: "binance",
235
- name: "Binance Wallet",
236
- connector: walletConnectConnector,
237
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/ebac7b39-688c-41e3-7912-a4fefba74600?projectId=34357d3c125c2bcf2ce2bc3309d98715",
238
- },
239
- okx: {
240
- id: "okx",
241
- name: "OKX Wallet",
242
- connector: okxwalletConnector,
243
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/c55df831-3c52-49fc-d1d1-97a926dc0c00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
244
- },
245
- zerion: {
246
- id: "zerion",
247
- name: "Zerion",
248
- connector: zerionConnector,
249
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/73f6f52f-7862-49e7-bb85-ba93ab72cc00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
250
- },
251
- phantom: {
252
- id: "phantom",
253
- name: "Phantom",
254
- connector: phantomConnector,
255
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/b6ec7b81-bb4f-427d-e290-7631e6e50d00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
256
- },
257
- coinbase: {
258
- id: "coinbase",
259
- name: "Coinbase Wallet",
260
- connector: coinbaseWalletConnector,
261
- icon: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",
262
- },
263
- rabby: {
264
- id: "rabby",
265
- name: "Rabby",
266
- connector: rabbyConnector,
267
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/255e6ba2-8dfd-43ad-e88e-57cbb98f6800?projectId=34357d3c125c2bcf2ce2bc3309d98715",
268
- },
269
- privy: {
270
- id: "privy",
271
- name: "Privy",
272
- icon: "https://avatars.githubusercontent.com/u/81824329?s=200&v=4",
273
- },
274
- gemini: {
275
- id: "gemini",
276
- name: "Gemini",
277
- connector: geminiConnector,
278
- icon: "https://explorer-api.walletconnect.com/v3/logo/sm/56a3fd87-2627-4903-fddd-205224dac500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
279
- },
280
- sequence: {
281
- id: "sequence",
282
- name: "Sequence",
283
- connector: sequenceConnector,
284
- icon: SequenceLogo as string,
285
- },
286
- "sequence-waas": {
287
- id: "sequence-waas",
288
- name: "Sequence WaaS",
289
- connector: sequenceConnector,
290
- icon: SequenceLogo as string,
291
- },
364
+ return React.useMemo(() => {
365
+ return getQRCodeWalletsInternal(trailsApiKey)
366
+ }, [trailsApiKey])
367
+ }
368
+
369
+ /**
370
+ * Internal function to get QR code wallets (for use outside React components)
371
+ */
372
+ function getQRCodeWalletsInternal(
373
+ projectAccessKey?: string,
374
+ ): QRCodeWalletOption[] {
375
+ const walletConfigs = getWalletConfigsInternal(projectAccessKey)
376
+
377
+ return [
378
+ {
379
+ id: "metamask",
380
+ label: "MetaMask",
381
+ usesEip681: true,
382
+ icon: walletConfigs.metamask?.icon || "",
383
+ },
384
+ {
385
+ id: "coinbase",
386
+ label: "CB Wallet",
387
+ usesEip681: false,
388
+ icon: walletConfigs.coinbase?.icon || "",
389
+ },
390
+ {
391
+ id: "trust",
392
+ label: "Trust Wallet",
393
+ usesEip681: false,
394
+ icon: walletConfigs.trust?.icon || "",
395
+ },
396
+ {
397
+ id: "rabby",
398
+ label: "Rabby",
399
+ usesEip681: false,
400
+ icon: walletConfigs.rabby?.icon || "",
401
+ },
402
+ {
403
+ id: "rainbow",
404
+ label: "Rainbow",
405
+ usesEip681: false,
406
+ icon: walletConfigs.rainbow?.icon || "",
407
+ },
408
+ {
409
+ id: "phantom",
410
+ label: "Phantom",
411
+ usesEip681: false,
412
+ icon: walletConfigs.phantom?.icon || "",
413
+ },
414
+ ] satisfies QRCodeWalletOption[]
292
415
  }
293
416
 
294
417
  export const topShownWallets = [
@@ -299,14 +422,47 @@ export const topShownWallets = [
299
422
  "phantom",
300
423
  ]
301
424
 
302
- export const getWalletIcon = (walletId?: string): string => {
425
+ /**
426
+ * Hook to get wallet icon
427
+ */
428
+ export function useWalletIcon(walletId?: string): string {
429
+ const walletConfigs = useWalletConfigs()
430
+
431
+ return React.useMemo(() => {
432
+ if (!walletId) return ""
433
+ return (walletConfigs[walletId]?.icon || "") as string
434
+ }, [walletId, walletConfigs])
435
+ }
436
+
437
+ /**
438
+ * Hook to get wallet name
439
+ */
440
+ export function useWalletName(walletId?: string): string {
441
+ const walletConfigs = useWalletConfigs()
442
+
443
+ return React.useMemo(() => {
444
+ if (!walletId) return ""
445
+ return (walletConfigs[walletId]?.name || "") as string
446
+ }, [walletId, walletConfigs])
447
+ }
448
+
449
+ // Legacy functions for backward compatibility (use hooks instead)
450
+ export const getWalletIcon = (
451
+ walletId?: string,
452
+ projectAccessKey?: string,
453
+ ): string => {
303
454
  if (!walletId) return ""
304
- return (WALLET_CONFIGS[walletId]?.icon || "") as string
455
+ const walletConfigs = getWalletConfigsInternal(projectAccessKey)
456
+ return (walletConfigs[walletId]?.icon || "") as string
305
457
  }
306
458
 
307
- export const getWalletName = (walletId?: string): string => {
459
+ export const getWalletName = (
460
+ walletId?: string,
461
+ projectAccessKey?: string,
462
+ ): string => {
308
463
  if (!walletId) return ""
309
- return (WALLET_CONFIGS[walletId]?.name || "") as string
464
+ const walletConfigs = getWalletConfigsInternal(projectAccessKey)
465
+ return (walletConfigs[walletId]?.name || "") as string
310
466
  }
311
467
 
312
468
  export const wagmiConnectorToWalletId = (wagmiConnector: any): string => {
@@ -332,13 +488,14 @@ export const wagmiConnectorToWalletId = (wagmiConnector: any): string => {
332
488
  return wagmiConnector.id || "injected"
333
489
  }
334
490
 
335
- // Hook to get combined wallets from WALLET_CONFIGS and wagmi connectors
491
+ // Hook to get combined wallets from wallet configs and wagmi connectors
336
492
  export const useWallets = () => {
337
493
  const { connectors } = useConnect()
494
+ const walletConfigs = useWalletConfigs()
338
495
 
339
496
  const allWallets = React.useMemo(() => {
340
497
  // Get config wallets that have connectors
341
- const configWallets = Object.values(WALLET_CONFIGS)
498
+ const configWallets = Object.values(walletConfigs)
342
499
  .filter((config) => config.connector)
343
500
  .map((config) => ({
344
501
  id: config.id,
@@ -401,7 +558,7 @@ export const useWallets = () => {
401
558
  }
402
559
 
403
560
  return allWallets
404
- }, [connectors])
561
+ }, [connectors, walletConfigs])
405
562
 
406
563
  return {
407
564
  wallets: allWallets,