0xtrails 0.6.6 → 0.7.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 (365) hide show
  1. package/dist/aave.d.ts +10 -2
  2. package/dist/aave.d.ts.map +1 -1
  3. package/dist/analytics.d.ts +26 -0
  4. package/dist/analytics.d.ts.map +1 -1
  5. package/dist/{ccip-CbJrlK-L.js → ccip-fConRNoG.js} +21 -21
  6. package/dist/chains.d.ts +23 -8
  7. package/dist/chains.d.ts.map +1 -1
  8. package/dist/constants.d.ts +5 -5
  9. package/dist/constants.d.ts.map +1 -1
  10. package/dist/customTokens.d.ts +12 -0
  11. package/dist/customTokens.d.ts.map +1 -0
  12. package/dist/decoders.d.ts +2 -2
  13. package/dist/decoders.d.ts.map +1 -1
  14. package/dist/error.d.ts.map +1 -1
  15. package/dist/fees.d.ts +37 -2
  16. package/dist/fees.d.ts.map +1 -1
  17. package/dist/gasless.d.ts +15 -36
  18. package/dist/gasless.d.ts.map +1 -1
  19. package/dist/{index-w7_dK4c5.js → index-BbajxCG_.js} +59269 -77146
  20. package/dist/index.d.ts +8 -6
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +828 -359
  23. package/dist/indexerClient.d.ts.map +1 -1
  24. package/dist/intentReceiptMonitor.d.ts +1 -1
  25. package/dist/intentReceiptMonitor.d.ts.map +1 -1
  26. package/dist/intentReceiptPoller.d.ts +1 -1
  27. package/dist/intentReceiptPoller.d.ts.map +1 -1
  28. package/dist/intents.d.ts +3 -2
  29. package/dist/intents.d.ts.map +1 -1
  30. package/dist/mode.d.ts +1 -1
  31. package/dist/mode.d.ts.map +1 -1
  32. package/dist/mutations.d.ts +2 -2
  33. package/dist/mutations.d.ts.map +1 -1
  34. package/dist/prepareSend.d.ts +2 -2
  35. package/dist/prepareSend.d.ts.map +1 -1
  36. package/dist/prices.d.ts +1 -1
  37. package/dist/prices.d.ts.map +1 -1
  38. package/dist/sequenceWallet.d.ts +2 -2
  39. package/dist/sequenceWallet.d.ts.map +1 -1
  40. package/dist/time.d.ts +6 -0
  41. package/dist/time.d.ts.map +1 -1
  42. package/dist/tokenBalances.d.ts +40 -25
  43. package/dist/tokenBalances.d.ts.map +1 -1
  44. package/dist/tokens.d.ts +54 -14
  45. package/dist/tokens.d.ts.map +1 -1
  46. package/dist/trailsClient.d.ts +1 -1
  47. package/dist/trailsClient.d.ts.map +1 -1
  48. package/dist/trailsRouter.d.ts +2 -1
  49. package/dist/trailsRouter.d.ts.map +1 -1
  50. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +3 -2
  51. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
  52. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +2 -1
  53. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
  54. package/dist/transactionIntent/execution/transactionState.d.ts +1 -1
  55. package/dist/transactionIntent/execution/transactionState.d.ts.map +1 -1
  56. package/dist/transactionIntent/handlers/crossChain.d.ts +5 -3
  57. package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -1
  58. package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +5 -3
  59. package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -1
  60. package/dist/transactionIntent/quote/feeExtractors.d.ts +1 -6
  61. package/dist/transactionIntent/quote/feeExtractors.d.ts.map +1 -1
  62. package/dist/transactionIntent/quote/normalizeQuote.d.ts +4 -2
  63. package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
  64. package/dist/transactionIntent/quote/quoteHelpers.d.ts +1 -1
  65. package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
  66. package/dist/transactionIntent/types.d.ts +28 -5
  67. package/dist/transactionIntent/types.d.ts.map +1 -1
  68. package/dist/transactionIntent/utils/testnetHelpers.d.ts +0 -1
  69. package/dist/transactionIntent/utils/testnetHelpers.d.ts.map +1 -1
  70. package/dist/transactionIntent/validators.d.ts +0 -2
  71. package/dist/transactionIntent/validators.d.ts.map +1 -1
  72. package/dist/transactions.d.ts +2 -2
  73. package/dist/transactions.d.ts.map +1 -1
  74. package/dist/utils.d.ts +7 -0
  75. package/dist/utils.d.ts.map +1 -1
  76. package/dist/wallets.d.ts +1 -0
  77. package/dist/wallets.d.ts.map +1 -1
  78. package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
  79. package/dist/widget/components/AddressWalletIcon.d.ts +6 -0
  80. package/dist/widget/components/AddressWalletIcon.d.ts.map +1 -0
  81. package/dist/widget/components/ChainFilterDropdown.d.ts +2 -6
  82. package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
  83. package/dist/widget/components/ChainImage.d.ts.map +1 -1
  84. package/dist/widget/components/ChainList.d.ts +0 -5
  85. package/dist/widget/components/ChainList.d.ts.map +1 -1
  86. package/dist/widget/components/ClassicSwap.d.ts +6 -6
  87. package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
  88. package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
  89. package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
  90. package/dist/widget/components/DebugMenu.d.ts +1 -1
  91. package/dist/widget/components/DebugMenu.d.ts.map +1 -1
  92. package/dist/widget/components/DebugScreensList.d.ts.map +1 -1
  93. package/dist/widget/components/DepositTracker.d.ts.map +1 -1
  94. package/dist/widget/components/Earn.d.ts +5 -5
  95. package/dist/widget/components/Earn.d.ts.map +1 -1
  96. package/dist/widget/components/FeeOption.d.ts +1 -1
  97. package/dist/widget/components/FeeOption.d.ts.map +1 -1
  98. package/dist/widget/components/FeeOptions.d.ts +2 -2
  99. package/dist/widget/components/FeeOptions.d.ts.map +1 -1
  100. package/dist/widget/components/Footer.d.ts +1 -1
  101. package/dist/widget/components/Footer.d.ts.map +1 -1
  102. package/dist/widget/components/Fund.d.ts +5 -5
  103. package/dist/widget/components/Fund.d.ts.map +1 -1
  104. package/dist/widget/components/FundMethods.d.ts +0 -1
  105. package/dist/widget/components/FundMethods.d.ts.map +1 -1
  106. package/dist/widget/components/FundSwap.d.ts +6 -6
  107. package/dist/widget/components/FundSwap.d.ts.map +1 -1
  108. package/dist/widget/components/HookModalContent.d.ts +8 -0
  109. package/dist/widget/components/HookModalContent.d.ts.map +1 -0
  110. package/dist/widget/components/OriginSelectionAmount.d.ts +11 -0
  111. package/dist/widget/components/OriginSelectionAmount.d.ts.map +1 -0
  112. package/dist/widget/components/Pay.d.ts +5 -5
  113. package/dist/widget/components/Pay.d.ts.map +1 -1
  114. package/dist/widget/components/PoolDeposit.d.ts +5 -5
  115. package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
  116. package/dist/widget/components/PoolWithdraw.d.ts +3 -3
  117. package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
  118. package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
  119. package/dist/widget/components/Receipt.d.ts +2 -1
  120. package/dist/widget/components/Receipt.d.ts.map +1 -1
  121. package/dist/widget/components/RecentTokens.d.ts +4 -4
  122. package/dist/widget/components/RecentTokens.d.ts.map +1 -1
  123. package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
  124. package/dist/widget/components/ShadowPortal.d.ts +6 -0
  125. package/dist/widget/components/ShadowPortal.d.ts.map +1 -0
  126. package/dist/widget/components/Swap.d.ts +6 -6
  127. package/dist/widget/components/Swap.d.ts.map +1 -1
  128. package/dist/widget/components/ThemeProvider.d.ts +1 -1
  129. package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
  130. package/dist/widget/components/TokenList.d.ts +3 -4
  131. package/dist/widget/components/TokenList.d.ts.map +1 -1
  132. package/dist/widget/components/TokenSelector.d.ts +3 -4
  133. package/dist/widget/components/TokenSelector.d.ts.map +1 -1
  134. package/dist/widget/components/Tooltip.d.ts +6 -1
  135. package/dist/widget/components/Tooltip.d.ts.map +1 -1
  136. package/dist/widget/components/TrailsHookModal.d.ts +10 -0
  137. package/dist/widget/components/TrailsHookModal.d.ts.map +1 -0
  138. package/dist/widget/components/WaasFeeOptions.d.ts +3 -0
  139. package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
  140. package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
  141. package/dist/widget/components/WalletConnect.d.ts.map +1 -1
  142. package/dist/widget/components/WidgetProviders.d.ts +14 -0
  143. package/dist/widget/components/WidgetProviders.d.ts.map +1 -0
  144. package/dist/widget/css/compiled.css +1 -1
  145. package/dist/widget/hooks/useAddressWalletIcon.d.ts +10 -0
  146. package/dist/widget/hooks/useAddressWalletIcon.d.ts.map +1 -0
  147. package/dist/widget/hooks/useBalanceVisible.d.ts +1 -1
  148. package/dist/widget/hooks/useBalanceVisible.d.ts.map +1 -1
  149. package/dist/widget/hooks/useChainFilter.d.ts +1 -1
  150. package/dist/widget/hooks/useChainFilter.d.ts.map +1 -1
  151. package/dist/widget/hooks/useCheckout.d.ts +13 -1
  152. package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
  153. package/dist/widget/hooks/useConnector.d.ts +4 -0
  154. package/dist/widget/hooks/useConnector.d.ts.map +1 -0
  155. package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
  156. package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
  157. package/dist/widget/hooks/useCustomTokenFetch.d.ts +19 -0
  158. package/dist/widget/hooks/useCustomTokenFetch.d.ts.map +1 -0
  159. package/dist/widget/hooks/useCustomTokenSearch.d.ts +20 -0
  160. package/dist/widget/hooks/useCustomTokenSearch.d.ts.map +1 -0
  161. package/dist/widget/hooks/useDebounce.d.ts +10 -0
  162. package/dist/widget/hooks/useDebounce.d.ts.map +1 -0
  163. package/dist/widget/hooks/useDebugScreens.d.ts +7 -2
  164. package/dist/widget/hooks/useDebugScreens.d.ts.map +1 -1
  165. package/dist/widget/hooks/useDefaultTokenSelection.d.ts +3 -19
  166. package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
  167. package/dist/widget/hooks/useDestinationSelectedToken.d.ts +1 -14
  168. package/dist/widget/hooks/useDestinationSelectedToken.d.ts.map +1 -1
  169. package/dist/widget/hooks/useEarnPool.d.ts +1 -1
  170. package/dist/widget/hooks/useEarnPool.d.ts.map +1 -1
  171. package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
  172. package/dist/widget/hooks/useIsMobile.d.ts +5 -0
  173. package/dist/widget/hooks/useIsMobile.d.ts.map +1 -0
  174. package/dist/widget/hooks/useMode.d.ts +2 -2
  175. package/dist/widget/hooks/useMode.d.ts.map +1 -1
  176. package/dist/widget/hooks/useOriginSelectedToken.d.ts +2 -15
  177. package/dist/widget/hooks/useOriginSelectedToken.d.ts.map +1 -1
  178. package/dist/widget/hooks/usePayMessage.d.ts.map +1 -1
  179. package/dist/widget/hooks/usePriceImpactWarning.d.ts +1 -1
  180. package/dist/widget/hooks/usePriceImpactWarning.d.ts.map +1 -1
  181. package/dist/widget/hooks/useQuote.d.ts +173 -4
  182. package/dist/widget/hooks/useQuote.d.ts.map +1 -1
  183. package/dist/widget/hooks/useRecentTokens.d.ts +3 -3
  184. package/dist/widget/hooks/useRecentTokens.d.ts.map +1 -1
  185. package/dist/widget/hooks/useRecipients.d.ts +1 -1
  186. package/dist/widget/hooks/useRecipients.d.ts.map +1 -1
  187. package/dist/widget/hooks/useSelectedFeeOption.d.ts +2 -2
  188. package/dist/widget/hooks/useSelectedFeeOption.d.ts.map +1 -1
  189. package/dist/widget/hooks/useSelectedFundMethod.d.ts +1 -1
  190. package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +1 -1
  191. package/dist/widget/hooks/useSelectedRecipient.d.ts +1 -1
  192. package/dist/widget/hooks/useSelectedRecipient.d.ts.map +1 -1
  193. package/dist/widget/hooks/useSendForm.d.ts +9 -31
  194. package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
  195. package/dist/widget/hooks/useSwapAmount.d.ts +1 -1
  196. package/dist/widget/hooks/useSwapAmount.d.ts.map +1 -1
  197. package/dist/widget/hooks/useTheme.d.ts +1 -1
  198. package/dist/widget/hooks/useTheme.d.ts.map +1 -1
  199. package/dist/widget/hooks/useTokenList.d.ts +7 -31
  200. package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
  201. package/dist/widget/hooks/useTrailsSendTransaction.d.ts +83 -0
  202. package/dist/widget/hooks/useTrailsSendTransaction.d.ts.map +1 -0
  203. package/dist/widget/hooks/useWalletConnectUri.d.ts +11 -0
  204. package/dist/widget/hooks/useWalletConnectUri.d.ts.map +1 -0
  205. package/dist/widget/hooks/useWidgetProps.d.ts +5 -0
  206. package/dist/widget/hooks/useWidgetProps.d.ts.map +1 -1
  207. package/dist/widget/index.d.ts +2 -0
  208. package/dist/widget/index.d.ts.map +1 -1
  209. package/dist/widget/index.js +8 -5
  210. package/dist/widget/providers/TrailsModalProvider.d.ts +65 -0
  211. package/dist/widget/providers/TrailsModalProvider.d.ts.map +1 -0
  212. package/dist/widget/providers/TrailsProvider.d.ts +1 -1
  213. package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
  214. package/dist/widget/types.d.ts +11 -18
  215. package/dist/widget/types.d.ts.map +1 -1
  216. package/dist/widget/widget.d.ts +20 -11
  217. package/dist/widget/widget.d.ts.map +1 -1
  218. package/package.json +45 -49
  219. package/src/aave.ts +387 -138
  220. package/src/analytics.ts +208 -2
  221. package/src/chains.ts +65 -64
  222. package/src/constants.ts +18 -14
  223. package/src/customTokens.ts +151 -0
  224. package/src/decoders.ts +4 -7
  225. package/src/error.ts +7 -3
  226. package/src/fees.ts +239 -125
  227. package/src/gasless.ts +54 -108
  228. package/src/index.ts +29 -9
  229. package/src/indexerClient.ts +2 -0
  230. package/src/intentReceiptMonitor.ts +1 -4
  231. package/src/intentReceiptPoller.ts +2 -2
  232. package/src/intents.ts +16 -5
  233. package/src/mode.ts +1 -1
  234. package/src/mutations.ts +7 -3
  235. package/src/prepareSend.ts +19 -14
  236. package/src/prices.ts +1 -1
  237. package/src/sequenceWallet.ts +2 -2
  238. package/src/time.ts +28 -0
  239. package/src/tokenBalances.ts +348 -153
  240. package/src/tokens.ts +393 -142
  241. package/src/trailsClient.ts +1 -1
  242. package/src/trailsRouter.ts +4 -5
  243. package/src/transactionIntent/deposits/depositOrchestrator.ts +6 -2
  244. package/src/transactionIntent/deposits/gaslessDeposit.ts +13 -7
  245. package/src/transactionIntent/deposits/standardDeposit.ts +1 -1
  246. package/src/transactionIntent/execution/transactionState.ts +1 -1
  247. package/src/transactionIntent/handlers/crossChain.ts +75 -37
  248. package/src/transactionIntent/handlers/sameChainSameToken.ts +66 -20
  249. package/src/transactionIntent/quote/feeExtractors.ts +1 -29
  250. package/src/transactionIntent/quote/normalizeQuote.ts +99 -7
  251. package/src/transactionIntent/quote/quoteHelpers.ts +1 -1
  252. package/src/transactionIntent/types.ts +31 -6
  253. package/src/transactionIntent/utils/testnetHelpers.ts +0 -5
  254. package/src/transactionIntent/validators.ts +0 -30
  255. package/src/transactions.ts +3 -3
  256. package/src/utils.ts +18 -0
  257. package/src/wallets.ts +32 -10
  258. package/src/widget/compiled.css +1 -1
  259. package/src/widget/components/AccountIntentTransactionHistory.tsx +2 -1
  260. package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +2 -2
  261. package/src/widget/components/AddressWalletIcon.tsx +29 -0
  262. package/src/widget/components/ChainFilterDropdown.tsx +2 -8
  263. package/src/widget/components/ChainImage.tsx +8 -5
  264. package/src/widget/components/ChainList.tsx +6 -8
  265. package/src/widget/components/ClassicSwap.tsx +93 -85
  266. package/src/widget/components/ConnectWallet.tsx +1 -2
  267. package/src/widget/components/ConnectedWallets.tsx +17 -4
  268. package/src/widget/components/DebugMenu.tsx +2 -2
  269. package/src/widget/components/DebugScreensList.tsx +0 -1
  270. package/src/widget/components/DepositTracker.tsx +20 -34
  271. package/src/widget/components/Earn.tsx +7 -6
  272. package/src/widget/components/FeeOption.tsx +4 -4
  273. package/src/widget/components/FeeOptions.tsx +19 -39
  274. package/src/widget/components/Footer.tsx +1 -1
  275. package/src/widget/components/Fund.tsx +23 -119
  276. package/src/widget/components/FundMethods.tsx +9 -6
  277. package/src/widget/components/FundSwap.tsx +6 -5
  278. package/src/widget/components/FundingMethodSelectorButton.tsx +2 -2
  279. package/src/widget/components/HookModalContent.tsx +306 -0
  280. package/src/widget/components/Modal.tsx +1 -1
  281. package/src/widget/components/OriginSelectionAmount.tsx +135 -0
  282. package/src/widget/components/Pay.tsx +66 -124
  283. package/src/widget/components/PoolDeposit.tsx +11 -55
  284. package/src/widget/components/PoolWithdraw.tsx +3 -3
  285. package/src/widget/components/QuoteDetails.tsx +473 -728
  286. package/src/widget/components/Receipt.tsx +74 -7
  287. package/src/widget/components/RecentTokens.tsx +8 -8
  288. package/src/widget/components/RecipientSelectorButton.tsx +4 -2
  289. package/src/widget/components/ScreenHeader.tsx +2 -2
  290. package/src/widget/components/SearchInputField.tsx +1 -1
  291. package/src/widget/components/ShadowPortal.tsx +58 -0
  292. package/src/widget/components/Swap.tsx +6 -5
  293. package/src/widget/components/ThemeProvider.tsx +1 -1
  294. package/src/widget/components/TokenList.tsx +3 -4
  295. package/src/widget/components/TokenSelector.tsx +211 -80
  296. package/src/widget/components/Tooltip.tsx +18 -7
  297. package/src/widget/components/TrailsHookModal.tsx +118 -0
  298. package/src/widget/components/WaasFeeOptions.tsx +333 -138
  299. package/src/widget/components/WalletConfirmation.tsx +7 -2
  300. package/src/widget/components/WalletConnect.tsx +197 -235
  301. package/src/widget/components/WidgetProviders.tsx +75 -0
  302. package/src/widget/hooks/useAddressWalletIcon.ts +53 -0
  303. package/src/widget/hooks/useBalanceVisible.tsx +1 -1
  304. package/src/widget/hooks/useChainFilter.tsx +1 -1
  305. package/src/widget/hooks/useCheckout.ts +13 -1
  306. package/src/widget/hooks/useConnector.tsx +18 -0
  307. package/src/widget/hooks/useCurrentScreen.tsx +3 -3
  308. package/src/widget/hooks/useCustomTokenFetch.tsx +72 -0
  309. package/src/widget/hooks/useCustomTokenSearch.tsx +402 -0
  310. package/src/widget/hooks/useDebounce.ts +25 -0
  311. package/src/widget/hooks/useDebugScreens.ts +26 -10
  312. package/src/widget/hooks/useDefaultTokenSelection.tsx +99 -143
  313. package/src/widget/hooks/useDestinationSelectedToken.tsx +1 -14
  314. package/src/widget/hooks/useEarnPool.tsx +1 -1
  315. package/src/widget/hooks/useIntentTransactionHistory.ts +20 -11
  316. package/src/widget/hooks/useIsMobile.tsx +50 -0
  317. package/src/widget/hooks/useMode.ts +2 -3
  318. package/src/widget/hooks/useOriginSelectedToken.tsx +2 -15
  319. package/src/widget/hooks/usePayMessage.tsx +31 -11
  320. package/src/widget/hooks/usePriceImpactWarning.ts +1 -1
  321. package/src/widget/hooks/useQuote.ts +189 -6
  322. package/src/widget/hooks/useRecentTokens.ts +6 -6
  323. package/src/widget/hooks/useRecipients.ts +1 -1
  324. package/src/widget/hooks/useSelectedFeeOption.tsx +2 -2
  325. package/src/widget/hooks/useSelectedFundMethod.tsx +1 -1
  326. package/src/widget/hooks/useSelectedRecipient.tsx +1 -1
  327. package/src/widget/hooks/useSendForm.ts +328 -152
  328. package/src/widget/hooks/useSwapAmount.tsx +1 -1
  329. package/src/widget/hooks/useTheme.tsx +1 -1
  330. package/src/widget/hooks/useTokenList.ts +672 -400
  331. package/src/widget/hooks/useTrailsSendTransaction.ts +949 -0
  332. package/src/widget/hooks/useWalletConnectUri.tsx +228 -0
  333. package/src/widget/hooks/useWidgetProps.tsx +3 -1
  334. package/src/widget/index.tsx +12 -0
  335. package/src/widget/providers/TrailsModalProvider.tsx +195 -0
  336. package/src/widget/providers/TrailsProvider.tsx +9 -3
  337. package/src/widget/types.ts +12 -20
  338. package/src/widget/widget.tsx +598 -385
  339. package/dist/cctp.d.ts +0 -3
  340. package/dist/cctp.d.ts.map +0 -1
  341. package/dist/lifi.d.ts +0 -4
  342. package/dist/lifi.d.ts.map +0 -1
  343. package/dist/meshconnect.d.ts +0 -171
  344. package/dist/meshconnect.d.ts.map +0 -1
  345. package/dist/relaySdk.d.ts +0 -87
  346. package/dist/relaySdk.d.ts.map +0 -1
  347. package/dist/widget/components/MeshConnectExchanges.d.ts +0 -7
  348. package/dist/widget/components/MeshConnectExchanges.d.ts.map +0 -1
  349. package/dist/widget/components/MeshConnectFlow.d.ts +0 -13
  350. package/dist/widget/components/MeshConnectFlow.d.ts.map +0 -1
  351. package/dist/widget/components/MeshConnectIframe.d.ts +0 -15
  352. package/dist/widget/components/MeshConnectIframe.d.ts.map +0 -1
  353. package/dist/widget/components/Receive.d.ts +0 -12
  354. package/dist/widget/components/Receive.d.ts.map +0 -1
  355. package/dist/widget/hooks/useSelectedMeshExchange.d.ts +0 -14
  356. package/dist/widget/hooks/useSelectedMeshExchange.d.ts.map +0 -1
  357. package/src/cctp.ts +0 -54
  358. package/src/lifi.ts +0 -108
  359. package/src/meshconnect.ts +0 -531
  360. package/src/relaySdk.ts +0 -703
  361. package/src/widget/components/MeshConnectExchanges.tsx +0 -290
  362. package/src/widget/components/MeshConnectFlow.tsx +0 -90
  363. package/src/widget/components/MeshConnectIframe.tsx +0 -500
  364. package/src/widget/components/Receive.tsx +0 -175
  365. package/src/widget/hooks/useSelectedMeshExchange.tsx +0 -46
@@ -69,6 +69,7 @@ export function usePayMessage(): UsePayMessageReturn {
69
69
  toChainId,
70
70
  toAmount,
71
71
  toToken,
72
+ toCalldata,
72
73
  } = useWidgetProps()
73
74
 
74
75
  const { targetAmountUsdFormatted } = useTargetAmount()
@@ -121,12 +122,24 @@ export function usePayMessage(): UsePayMessageReturn {
121
122
  case "APP_DESCRIPTION":
122
123
  parts.push({ type: "text", value: appDescription || "" })
123
124
  break
124
- case "TO_AMOUNT_USD":
125
- parts.push({
126
- type: "amount",
127
- value: targetAmountUsdFormatted || "$0.00",
128
- })
125
+ case "TO_AMOUNT_USD": {
126
+ const usdValue = targetAmountUsdFormatted || "$0.00"
127
+ // If USD value is $0, use token amount + symbol instead
128
+ if (usdValue === "$0.00" || usdValue === "$0") {
129
+ const tokenAmount = toAmount || "0"
130
+ const tokenSymbol = tokenInfo?.symbol || ""
131
+ parts.push({
132
+ type: "amount",
133
+ value: `${tokenAmount} ${tokenSymbol}`.trim(),
134
+ })
135
+ } else {
136
+ parts.push({
137
+ type: "amount",
138
+ value: usdValue,
139
+ })
140
+ }
129
141
  break
142
+ }
130
143
  case "TO_ADDRESS":
131
144
  parts.push({ type: "toAddress", value: toAddress || "" })
132
145
  break
@@ -228,11 +241,17 @@ export function usePayMessage(): UsePayMessageReturn {
228
241
  {/* Large amount in center */}
229
242
  <div className="font-bold text-center">
230
243
  {(() => {
231
- const amountToShow = targetAmountUsdFormatted || toAmount || "0"
244
+ const usdValue = targetAmountUsdFormatted || "$0.00"
245
+ const tokenAmount = toAmount || "0"
232
246
  const tokenSymbol = tokenInfo?.symbol || ""
233
- const displayText = targetAmountUsdFormatted
234
- ? amountToShow
235
- : `${amountToShow} ${tokenSymbol}`.trim()
247
+
248
+ // If USD value is $0, show token amount + symbol instead
249
+ const displayText =
250
+ usdValue === "$0.00" || usdValue === "$0"
251
+ ? `${tokenAmount} ${tokenSymbol}`.trim()
252
+ : targetAmountUsdFormatted
253
+ ? usdValue
254
+ : `${tokenAmount} ${tokenSymbol}`.trim()
236
255
 
237
256
  // Dynamic font size based on text length
238
257
  const textLength = displayText.length
@@ -255,8 +274,8 @@ export function usePayMessage(): UsePayMessageReturn {
255
274
  {/* Recipient info below */}
256
275
  {toAddress && (
257
276
  <div className="flex items-center space-x-2 text-center">
258
- <span className="text-sm text-gray-600 dark:text-gray-400">
259
- to
277
+ <span className="text-sm text-gray-900 dark:text-gray-100">
278
+ {toCalldata ? "to" : "Recipient"}
260
279
  </span>
261
280
  <Identicon value={toAddress} size={20} />
262
281
  <a
@@ -434,6 +453,7 @@ export function usePayMessage(): UsePayMessageReturn {
434
453
  tokenInfo,
435
454
  toChainId,
436
455
  toAddress,
456
+ toCalldata,
437
457
  targetAmountUsdFormatted,
438
458
  toAmount,
439
459
  ])
@@ -11,7 +11,7 @@ const PriceImpactWarningContext =
11
11
 
12
12
  export const PriceImpactWarningProvider = PriceImpactWarningContext.Provider
13
13
 
14
- export const usePriceImpactWarning = (): PriceImpactWarningConfig => {
14
+ export function usePriceImpactWarning(): PriceImpactWarningConfig {
15
15
  const context = useContext(PriceImpactWarningContext)
16
16
  return context || {}
17
17
  }
@@ -14,29 +14,48 @@ import { prepareSend } from "../../prepareSend.js"
14
14
  import { abortControllerRegistry } from "../../abortController.js"
15
15
  import { TradeType } from "../../prepareSend.js"
16
16
  import { getChainInfo, useChainRpcClient } from "../../chains.js"
17
- import type { IntentTransaction } from "@0xsequence/trails-api"
17
+ import type { IntentTransaction } from "@0xtrails/api"
18
18
  import type { PrepareSendOptions } from "../../transactionIntent/types.js"
19
19
  import type { Chain } from "../../chains.js"
20
- import type { SupportedToken } from "../../tokens.js"
20
+ import type { Token } from "../../tokens.js"
21
21
  import type { TransactionState } from "../../transactions.js"
22
22
  import type { PrepareSendFees } from "../../prepareSend.js"
23
23
  import { getTokenPrice } from "../../prices.js"
24
24
  import { useCommitIntent, useExecuteIntent } from "../../mutations.js"
25
25
  import type { CheckoutOnHandlers } from "./useCheckout.js"
26
- import type { FeeOption } from "@0xsequence/trails-api"
27
-
26
+ import type { FeeOption } from "@0xtrails/api"
27
+
28
+ /**
29
+ * Configuration options for the `useQuote` hook.
30
+ *
31
+ * All parameters are optional, but the hook will not fetch a quote until all required
32
+ * parameters are provided (walletClient, fromTokenAddress, fromChainId, toTokenAddress,
33
+ * toChainId, swapAmount, toRecipient).
34
+ */
28
35
  export type UseQuoteProps = {
36
+ /** The wallet client from wagmi (e.g., from `useWalletClient()`). Required for quote fetching. */
29
37
  walletClient?: any // TODO: fix this, has to do with viem/wagmi versions
38
+ /** The contract address of the origin token. */
30
39
  fromTokenAddress?: string | null
40
+ /** The chain ID of the origin chain */
31
41
  fromChainId?: number | null
42
+ /** The contract address of the destination token. */
32
43
  toTokenAddress?: string | null
44
+ /** The chain ID of the destination chain. */
33
45
  toChainId?: number | null
46
+ /** Optional custom calldata for the destination chain. Used for executing arbitrary contract calls. */
34
47
  toCalldata?: string | null
48
+ /** The amount to swap, as a string or bigint in the token's smallest unit (wei/smallest unit). For example, 1 USDC (6 decimals) = '1000000'. */
35
49
  swapAmount?: string | bigint
50
+ /** The recipient address for the destination token. */
36
51
  toRecipient?: string | null
52
+ /** The trade type: `TradeType.EXACT_INPUT` (you specify input amount) or `TradeType.EXACT_OUTPUT` (you specify output amount). Defaults to `EXACT_OUTPUT`. */
37
53
  tradeType?: TradeType | null
54
+ /** Slippage tolerance as a decimal string or number (e.g., '0.005' for 0.5%, '0.01' for 1%). Defaults to a reasonable value if not provided. */
38
55
  slippageTolerance?: string | number | null
56
+ /** Optional callback function that receives transaction state updates during swap execution. */
39
57
  onStatusUpdate?: ((transactionStates: TransactionState[]) => void) | null
58
+ /** Optional quote provider ID to use. If not specified, the best available provider will be selected. */
40
59
  quoteProvider?: string | null
41
60
  /**
42
61
  * Optional checkout event handlers for tracking the states of a Trails transaction.
@@ -67,14 +86,26 @@ export type UseQuoteProps = {
67
86
  * - `triggerCheckoutStatusUpdate`
68
87
  */
69
88
  checkoutOnHandlers?: Partial<CheckoutOnHandlers>
89
+ /** Optional paymaster URL for gasless ERC-4337 transactions. */
70
90
  paymasterUrl?: string
91
+ /** Optional fee option selection (e.g., user selects USDC as the fee token instead of ETH) */
71
92
  selectedFeeOption?: FeeOption | null
93
+ /** Optional AbortSignal to cancel the quote request. */
72
94
  abortSignal?: AbortSignal
95
+ /** Optional API key override for Trails API access. */
73
96
  apiKey?: string | null
97
+ /** Optional environment override for node gateway ('prod' | 'dev' | 'local' | 'cors-anywhere'). */
74
98
  nodeGatewayEnv?: "prod" | "dev" | "local" | "cors-anywhere"
99
+ /** Optional flag to indicate if the wallet is a smart wallet. */
75
100
  isSmartWallet?: boolean | null
76
101
  }
77
102
 
103
+ /**
104
+ * Return type for the `swap` function returned by {@link useQuote}.
105
+ *
106
+ * Contains information about both the origin and destination transactions,
107
+ * including transaction hashes, explorer URLs, and receipts.
108
+ */
78
109
  export type SwapReturn = {
79
110
  originTransaction: {
80
111
  transactionHash?: string | null
@@ -89,24 +120,35 @@ export type SwapReturn = {
89
120
  totalCompletionSeconds?: number
90
121
  }
91
122
 
123
+ /**
124
+ * Information about a quote provider (LiFi, CCTP, Relay, etc.) used for routing the swap.
125
+ */
92
126
  export type QuoteProviderInfo = {
93
127
  id: string
94
128
  name: string
95
129
  url: string
96
130
  }
97
131
 
132
+ /**
133
+ * A quote object containing all the details about a Trails intent transaction.
134
+ *
135
+ * Includes token amounts, fees, price impact, estimated completion time,
136
+ * and other relevant information for displaying to the user.
137
+ */
98
138
  export type Quote = {
99
139
  fromAmount: string
100
140
  fromAmountMin: string
101
141
  toAmount: string
102
142
  toAmountMin: string
103
- originToken: SupportedToken
104
- destinationToken: SupportedToken
143
+ originToken: Token
144
+ destinationToken: Token
105
145
  originChain: Chain
106
146
  destinationChain: Chain
107
147
  fees: PrepareSendFees
108
148
  slippageTolerance: string
109
149
  priceImpact: string
150
+ priceImpactUsd?: string
151
+ priceImpactUsdDisplay?: string
110
152
  completionEstimateSeconds: number
111
153
  transactionStates?: TransactionState[]
112
154
  originTokenRate?: string
@@ -118,19 +160,147 @@ export type Quote = {
118
160
  gasCostUsdDisplay?: string
119
161
  gasCost?: string
120
162
  gasCostFormatted?: string
163
+ totalFeesUsd?: number
164
+ totalFeesUsdDisplay?: string
165
+ totalGasUsd?: number
166
+ totalGasUsdDisplay?: string
167
+ allProviderFeesUsd?: number
168
+ allProviderFeesUsdDisplay?: string
121
169
  }
122
170
 
171
+ /**
172
+ * Return type for the {@link useQuote} hook.
173
+ *
174
+ * Provides the quote data, swap function, loading state, error information,
175
+ * and utility functions for managing the quote lifecycle.
176
+ */
123
177
  export type UseQuoteReturn = {
178
+ /** The quote object with swap details, or `null` if not available. */
124
179
  quote: Quote | null
180
+ /** A function to execute the swap, or `null` if not available. Returns a Promise that resolves to swap result with transaction receipts. */
125
181
  swap: (() => Promise<SwapReturn | null>) | null
182
+ /** Boolean indicating if a quote is currently being fetched. */
126
183
  isLoadingQuote: boolean
184
+ /** Any error that occurred while fetching the quote, or `null`. */
127
185
  quoteError: unknown
186
+ /** A user-friendly error message string. */
128
187
  quoteErrorPrettified: string
188
+ /** Function to manually refetch the quote (useful for refreshing stale quotes). */
129
189
  refetchQuote: () => void
190
+ /** Function to abort any in-flight quote requests. */
130
191
  abort: () => void
131
192
  }
132
193
 
133
194
  // TODO: consolidate useSendForm, prepareSend, and useQuote hooks into a single hook
195
+
196
+ /**
197
+ * React hook for fetching quotes and executing cross-chain or same-chain intent transactions.
198
+ *
199
+ * This hook provides a simple interface to get quotes for intent transactions and execute them.
200
+ * It handles both cross-chain and same-chain intent transactions, automatically fetching token balances,
201
+ * calculating fees, and providing transaction state updates.
202
+ *
203
+ * @example
204
+ * Cross-chain swap example:
205
+ * ```tsx
206
+ * import { useQuote, TradeType } from '0xtrails'
207
+ * import { useEffect } from 'react'
208
+ * import { useWalletClient, useAccount } from 'wagmi'
209
+ *
210
+ * export const Swap = () => {
211
+ * const { data: walletClient } = useWalletClient()
212
+ * const { address } = useAccount()
213
+ *
214
+ * const { quote, swap, isLoadingQuote, quoteError, refetchQuote } = useQuote({
215
+ * walletClient,
216
+ * fromTokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // USDC
217
+ * fromChainId: 1, // Ethereum
218
+ * toTokenAddress: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC
219
+ * toChainId: 8453, // Base
220
+ * swapAmount: '1000000', // 1 USDC (6 decimals)
221
+ * tradeType: TradeType.EXACT_INPUT,
222
+ * toRecipient: address,
223
+ * slippageTolerance: '0.005', // 0.5%
224
+ * onStatusUpdate: (states) => {
225
+ * console.log('Transaction states:', states)
226
+ * }
227
+ * })
228
+ *
229
+ * // Quotes can become stale; refetch every ~30 seconds
230
+ * useEffect(() => {
231
+ * const id = setInterval(() => {
232
+ * refetchQuote?.()
233
+ * }, 30000)
234
+ * return () => clearInterval(id)
235
+ * }, [refetchQuote])
236
+ *
237
+ * const handleSwap = async () => {
238
+ * if (!swap) return
239
+ *
240
+ * try {
241
+ * const result = await swap()
242
+ * console.log('Swap completed:', result)
243
+ * } catch (error) {
244
+ * console.error('Swap failed:', error)
245
+ * }
246
+ * }
247
+ *
248
+ * if (isLoadingQuote) return <div>Getting quote...</div>
249
+ * if (quoteError) return <div>Error: {String(quoteError)}</div>
250
+ * if (!quote) return <div>No quote available</div>
251
+ *
252
+ * return (
253
+ * <div>
254
+ * <div>From: {quote.fromAmount} {quote.originToken.symbol}</div>
255
+ * <div>To: {quote.toAmount} {quote.destinationToken.symbol}</div>
256
+ * <button onClick={handleSwap}>Execute Swap</button>
257
+ * </div>
258
+ * )
259
+ * }
260
+ * ```
261
+ *
262
+ * @param props - Configuration options for the quote
263
+ * @param props.walletClient - The wallet client from wagmi (e.g., from `useWalletClient()`)
264
+ * @param props.fromTokenAddress - The contract address of the token to swap from.
265
+ * @param props.fromChainId - The chain ID of the origin chain
266
+ * @param props.toTokenAddress - The contract address of the token to swap to. Use `zeroAddress` for native tokens
267
+ * @param props.toChainId - The chain ID of the destination chain
268
+ * @param props.swapAmount - The amount to swap, as a string or bigint in the token's smallest unit (wei/smallest unit). For example, 1 USDC (6 decimals) = '1000000'
269
+ * @param props.tradeType - The trade type: `TradeType.EXACT_INPUT` (you specify input amount) or `TradeType.EXACT_OUTPUT` (you specify output amount). Defaults to `EXACT_OUTPUT`
270
+ * @param props.toRecipient - The recipient address for the destination token.
271
+ * @param props.slippageTolerance - Slippage tolerance as a decimal string or number (e.g., '0.005' for 0.5%, '0.01' for 1%). Defaults to a reasonable value if not provided
272
+ * @param props.toCalldata - Optional custom calldata for the destination chain. Used for executing arbitrary contract calls (e.g., swap and mint an NFT on destination chain)
273
+ * @param props.onStatusUpdate - Optional callback function that receives transaction state updates during swap execution
274
+ * @param props.quoteProvider - Optional quote provider ID to use (auto, lifi, relay, cctp, direct). If not specified, the best available provider will be selected
275
+ * @param props.checkoutOnHandlers - Optional event handlers for tracking checkout/transaction lifecycle events
276
+ * @param props.paymasterUrl - Optional paymaster URL for gasless ERC-4337 transactions
277
+ * @param props.selectedFeeOption - Optional fee option selection (e.g., user selects USDC as the fee token instead of ETH)
278
+ * @param props.abortSignal - Optional AbortSignal to cancel the quote request
279
+ * @param props.apiKey - Optional API key override for Trails API access
280
+ * @param props.nodeGatewayEnv - Optional environment override ('prod' | 'dev' | 'local' | 'cors-anywhere')
281
+ * @param props.isSmartWallet - Optional flag to indicate if the wallet is a smart wallet
282
+ *
283
+ * @returns An object containing:
284
+ * - `quote` - The quote object with swap details, or `null` if not available
285
+ * - `swap` - A function to execute the swap, or `null` if not available. Returns a Promise that resolves to swap result with transaction receipts
286
+ * - `isLoadingQuote` - Boolean indicating if a quote is currently being fetched
287
+ * - `quoteError` - Any error that occurred while fetching the quote, or `null`
288
+ * - `quoteErrorPrettified` - A user-friendly error message string
289
+ * - `refetchQuote` - Function to manually refetch the quote (useful for refreshing stale quotes)
290
+ * - `abort` - Function to abort any in-flight quote requests
291
+ *
292
+ * @remarks
293
+ * - The hook uses React Query internally, so quotes are cached and automatically refetched based on query key changes
294
+ * - Quotes are considered stale after 30 seconds. You may want to periodically call `refetchQuote()` to keep quotes fresh
295
+ * - The hook will not fetch a quote until all required parameters are provided (walletClient, token addresses, chain IDs, swap amount, recipient)
296
+ * - For native tokens (ETH, MATIC, etc.), use the zero address (`0x0000000000000000000000000000000000000000`)
297
+ *
298
+ * @see {@link TradeType} for available trade types
299
+ * @see {@link Quote} for the quote object structure
300
+ * @see {@link SwapReturn} for the swap result structure
301
+ *
302
+ * For more information go to {@link https://docs.trails.build/sdk/hooks#usequote-hook}
303
+ */
134
304
  export function useQuote({
135
305
  walletClient,
136
306
  fromTokenAddress,
@@ -471,6 +641,8 @@ export function useQuote({
471
641
  originPublicClient: originPublicClient ?? undefined,
472
642
  destinationPublicClient: destinationPublicClient ?? undefined,
473
643
  isSmartWallet: isSmartWallet ?? undefined,
644
+ trailsApiKey,
645
+ trailsApiUrl,
474
646
  }
475
647
 
476
648
  logger.console.log("[trails-sdk] options", options)
@@ -488,6 +660,9 @@ export function useQuote({
488
660
  destinationChain: prepareSendQuote.destinationChain,
489
661
  fees: prepareSendQuote.fees,
490
662
  priceImpact: prepareSendQuote.priceImpact,
663
+ priceImpactUsd: prepareSendQuote.priceImpactUsd ?? undefined,
664
+ priceImpactUsdDisplay:
665
+ prepareSendQuote.priceImpactUsdDisplay ?? undefined,
491
666
  completionEstimateSeconds: prepareSendQuote.completionEstimateSeconds,
492
667
  slippageTolerance: prepareSendQuote.slippageTolerance,
493
668
  transactionStates: prepareSendQuote.transactionStates,
@@ -502,6 +677,14 @@ export function useQuote({
502
677
  gasCostUsdDisplay: prepareSendQuote.gasCostUsdDisplay ?? undefined,
503
678
  gasCost: prepareSendQuote.gasCost ?? undefined,
504
679
  gasCostFormatted: prepareSendQuote.gasCostFormatted ?? undefined,
680
+ totalFeesUsd: prepareSendQuote.grandTotalUsd ?? undefined,
681
+ totalFeesUsdDisplay:
682
+ prepareSendQuote.grandTotalUsdDisplay ?? undefined,
683
+ totalGasUsd: prepareSendQuote.totalGasUsd ?? undefined,
684
+ totalGasUsdDisplay: prepareSendQuote.totalGasUsdDisplay ?? undefined,
685
+ allProviderFeesUsd: prepareSendQuote.allProviderFeesUsd ?? undefined,
686
+ allProviderFeesUsdDisplay:
687
+ prepareSendQuote.allProviderFeesUsdDisplay ?? undefined,
505
688
  }
506
689
 
507
690
  const swap = async (): Promise<SwapReturn> => {
@@ -1,17 +1,17 @@
1
- import { JsonEncode } from "@0xsequence/trails-api"
1
+ import { JsonEncode } from "@0xtrails/api"
2
2
  import { useState, useEffect, useCallback } from "react"
3
- import type { SupportedToken } from "../../tokens.js"
3
+ import type { Token } from "../../tokens.js"
4
4
  import { logger } from "../../logger.js"
5
5
 
6
6
  interface RecentTokensStorage {
7
- [accountAddress: string]: SupportedToken[]
7
+ [accountAddress: string]: Token[]
8
8
  }
9
9
 
10
10
  const RECENT_TOKENS_KEY = "trails_recent_tokens"
11
11
  const MAX_RECENT_TOKENS = 10
12
12
 
13
13
  export function useRecentTokens(accountAddress?: string) {
14
- const [recentTokens, setRecentTokens] = useState<SupportedToken[]>([])
14
+ const [recentTokens, setRecentTokens] = useState<Token[]>([])
15
15
 
16
16
  // Load recent tokens from localStorage for the current account
17
17
  useEffect(() => {
@@ -38,7 +38,7 @@ export function useRecentTokens(accountAddress?: string) {
38
38
 
39
39
  // Add or update a recent token
40
40
  const addRecentToken = useCallback(
41
- (token: SupportedToken) => {
41
+ (token: Token) => {
42
42
  if (!accountAddress) return
43
43
 
44
44
  try {
@@ -55,7 +55,7 @@ export function useRecentTokens(accountAddress?: string) {
55
55
  (t) =>
56
56
  !(
57
57
  t.contractAddress === token.contractAddress &&
58
- t.chainId === token.chainId
58
+ (t.chainId || 0) === (token.chainId || 0)
59
59
  ),
60
60
  )
61
61
 
@@ -12,7 +12,7 @@ export interface RecentRecipient {
12
12
  const STORAGE_KEY = "trails-recent-recipients"
13
13
  const MAX_RECENT_RECIPIENTS = 10
14
14
 
15
- export const useRecipients = () => {
15
+ export function useRecipients() {
16
16
  const [recentRecipients, setRecentRecipients] = useState<RecentRecipient[]>(
17
17
  [],
18
18
  )
@@ -7,7 +7,7 @@ import React, {
7
7
  useMemo,
8
8
  type ReactNode,
9
9
  } from "react"
10
- import type { FeeOption } from "@0xsequence/trails-api"
10
+ import type { FeeOption } from "@0xtrails/api"
11
11
  import { formatRawAmount, formatUsdAmountDisplay } from "../../tokenBalances.js"
12
12
  import { logger } from "../../index.js"
13
13
  import { isNativeToken, normalizeAddress } from "../../utils.js"
@@ -301,7 +301,7 @@ export const SelectedFeeOptionProvider: React.FC<
301
301
  )
302
302
  }
303
303
 
304
- export const useSelectedFeeOption = (): SelectedFeeOptionContextType => {
304
+ export function useSelectedFeeOption(): SelectedFeeOptionContextType {
305
305
  const context = useContext(SelectedFeeOptionContext)
306
306
 
307
307
  if (context === undefined) {
@@ -30,7 +30,7 @@ export const SelectedFundMethodProvider = ({
30
30
  )
31
31
  }
32
32
 
33
- export const useSelectedFundMethod = (): SelectedFundMethodContextType => {
33
+ export function useSelectedFundMethod(): SelectedFundMethodContextType {
34
34
  const context = useContext(SelectedFundMethodContext)
35
35
  if (context === undefined) {
36
36
  throw new Error(
@@ -47,7 +47,7 @@ export const SelectedRecipientProvider: React.FC<
47
47
  )
48
48
  }
49
49
 
50
- export const useSelectedRecipient = () => {
50
+ export function useSelectedRecipient() {
51
51
  const context = useContext(SelectedRecipientContext)
52
52
  if (context === undefined) {
53
53
  throw new Error(