0xtrails 0.12.2 → 0.13.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 (243) hide show
  1. package/dist/abis/trailsHydrate.d.ts.map +1 -1
  2. package/dist/analytics.d.ts +41 -0
  3. package/dist/analytics.d.ts.map +1 -1
  4. package/dist/{ccip-62W6LwH2.js → ccip-Cg9-lJ6K.js} +16 -16
  5. package/dist/chainSwitch.d.ts.map +1 -1
  6. package/dist/chains.d.ts +9 -3
  7. package/dist/chains.d.ts.map +1 -1
  8. package/dist/error.d.ts +1 -0
  9. package/dist/error.d.ts.map +1 -1
  10. package/dist/{index-C0QTNYIA.js → index-DEojZg7b.js} +50431 -50424
  11. package/dist/index.d.ts +1 -3
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +377 -421
  14. package/dist/intentReceiptPoller.d.ts.map +1 -1
  15. package/dist/intents.d.ts +1 -3
  16. package/dist/intents.d.ts.map +1 -1
  17. package/dist/mutations.d.ts +1 -4
  18. package/dist/mutations.d.ts.map +1 -1
  19. package/dist/prepareSend.d.ts.map +1 -1
  20. package/dist/query/balance.hooks.d.ts.map +1 -1
  21. package/dist/query/chains.hooks.d.ts.map +1 -1
  22. package/dist/query/chains.queries.d.ts +4 -1
  23. package/dist/query/chains.queries.d.ts.map +1 -1
  24. package/dist/queryParams.d.ts.map +1 -1
  25. package/dist/recover.d.ts.map +1 -1
  26. package/dist/tokens.d.ts.map +1 -1
  27. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
  28. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
  29. package/dist/transactionIntent/deposits/standardDeposit.d.ts +1 -7
  30. package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
  31. package/dist/transactionIntent/handlers/intentHandler.d.ts.map +1 -1
  32. package/dist/transactionIntent/helpers/transactionStateHelpers.d.ts +10 -1
  33. package/dist/transactionIntent/helpers/transactionStateHelpers.d.ts.map +1 -1
  34. package/dist/transactionIntent/types.d.ts +3 -6
  35. package/dist/transactionIntent/types.d.ts.map +1 -1
  36. package/dist/transactionIntent/utils/resilientDepositTracker.d.ts +3 -3
  37. package/dist/transactionIntent/utils/resilientDepositTracker.d.ts.map +1 -1
  38. package/dist/transactions.d.ts +2 -0
  39. package/dist/transactions.d.ts.map +1 -1
  40. package/dist/umd/trails.min.js +200 -200
  41. package/dist/walletUtils.d.ts +4 -0
  42. package/dist/walletUtils.d.ts.map +1 -1
  43. package/dist/wallets.d.ts +2 -1
  44. package/dist/wallets.d.ts.map +1 -1
  45. package/dist/widget/components/AccountActionsDropdown.d.ts.map +1 -1
  46. package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts.map +1 -1
  47. package/dist/widget/components/AccountSettings.d.ts.map +1 -1
  48. package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
  49. package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
  50. package/dist/widget/components/ConnectedWallets.d.ts +5 -1
  51. package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
  52. package/dist/widget/components/DepositTracker.d.ts +1 -1
  53. package/dist/widget/components/DepositTracker.d.ts.map +1 -1
  54. package/dist/widget/components/DirectTransfer.d.ts +0 -8
  55. package/dist/widget/components/DirectTransfer.d.ts.map +1 -1
  56. package/dist/widget/components/Fund.d.ts +1 -1
  57. package/dist/widget/components/Fund.d.ts.map +1 -1
  58. package/dist/widget/components/FundMethods.d.ts.map +1 -1
  59. package/dist/widget/components/FundWalletSelection.d.ts +0 -8
  60. package/dist/widget/components/FundWalletSelection.d.ts.map +1 -1
  61. package/dist/widget/components/FundingMethodSelectorButton.d.ts +1 -1
  62. package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -1
  63. package/dist/widget/components/MeldStepsFlow.d.ts.map +1 -1
  64. package/dist/widget/components/OnrampErrorScreen.d.ts.map +1 -1
  65. package/dist/widget/components/OnrampPaymentMethods.d.ts.map +1 -1
  66. package/dist/widget/components/OnrampProviderConfirmation.d.ts +0 -6
  67. package/dist/widget/components/OnrampProviderConfirmation.d.ts.map +1 -1
  68. package/dist/widget/components/Pay.d.ts.map +1 -1
  69. package/dist/widget/components/QrCode.d.ts.map +1 -1
  70. package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
  71. package/dist/widget/components/Receipt.d.ts.map +1 -1
  72. package/dist/widget/components/ReceiptRecoverableFunds.d.ts +25 -0
  73. package/dist/widget/components/ReceiptRecoverableFunds.d.ts.map +1 -0
  74. package/dist/widget/components/RecipientSelectorButton.d.ts +3 -1
  75. package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
  76. package/dist/widget/components/Recipients.d.ts.map +1 -1
  77. package/dist/widget/components/Swap.d.ts +2 -16
  78. package/dist/widget/components/Swap.d.ts.map +1 -1
  79. package/dist/widget/components/TokenSelector.d.ts.map +1 -1
  80. package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
  81. package/dist/widget/components/TransactionHistoryItem.d.ts.map +1 -1
  82. package/dist/widget/components/TransferPendingVertical.d.ts.map +1 -1
  83. package/dist/widget/components/TruncatedTransactionHash.d.ts.map +1 -1
  84. package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
  85. package/dist/widget/components/WalletConnect.d.ts.map +1 -1
  86. package/dist/widget/components/WidgetProviders.d.ts.map +1 -1
  87. package/dist/widget/components/Withdraw.d.ts.map +1 -1
  88. package/dist/widget/css/compiled.css +1 -1
  89. package/dist/widget/hooks/useClickTracking.d.ts.map +1 -1
  90. package/dist/widget/hooks/useDebugScreens.d.ts +1 -10
  91. package/dist/widget/hooks/useDebugScreens.d.ts.map +1 -1
  92. package/dist/widget/hooks/useDepositMonitor.d.ts +2 -4
  93. package/dist/widget/hooks/useDepositMonitor.d.ts.map +1 -1
  94. package/dist/widget/hooks/useExternalFundingReceiptSync.d.ts +11 -0
  95. package/dist/widget/hooks/useExternalFundingReceiptSync.d.ts.map +1 -0
  96. package/dist/widget/hooks/useIntentReceiptBalances.d.ts +16 -0
  97. package/dist/widget/hooks/useIntentReceiptBalances.d.ts.map +1 -0
  98. package/dist/widget/hooks/useQuote.d.ts +0 -4
  99. package/dist/widget/hooks/useQuote.d.ts.map +1 -1
  100. package/dist/widget/hooks/useScreenTracking.d.ts +2 -0
  101. package/dist/widget/hooks/useScreenTracking.d.ts.map +1 -0
  102. package/dist/widget/hooks/useSelectedFundMethod.d.ts +0 -2
  103. package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +1 -1
  104. package/dist/widget/hooks/useSendForm.d.ts +0 -4
  105. package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
  106. package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
  107. package/dist/widget/hooks/useTrailsSendTransaction.d.ts.map +1 -1
  108. package/dist/widget/hooks/useViewManager.d.ts +89 -0
  109. package/dist/widget/hooks/useViewManager.d.ts.map +1 -0
  110. package/dist/widget/hooks/useWalletConnectUri.d.ts.map +1 -1
  111. package/dist/widget/hooks/useWalletConnectionContext.d.ts +1 -1
  112. package/dist/widget/hooks/useWalletConnectionContext.d.ts.map +1 -1
  113. package/dist/widget/index.d.ts +1 -1
  114. package/dist/widget/index.d.ts.map +1 -1
  115. package/dist/widget/index.js +7 -6
  116. package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
  117. package/dist/widget/types/commonProps.d.ts +1 -6
  118. package/dist/widget/types/commonProps.d.ts.map +1 -1
  119. package/dist/widget/utils/forexRateStore.d.ts.map +1 -1
  120. package/dist/widget/utils/fundMethodSwitchState.d.ts +10 -0
  121. package/dist/widget/utils/fundMethodSwitchState.d.ts.map +1 -0
  122. package/dist/widget/utils/localeStore.d.ts.map +1 -1
  123. package/dist/widget/utils/viewManagerGuards.d.ts +5 -0
  124. package/dist/widget/utils/viewManagerGuards.d.ts.map +1 -0
  125. package/dist/widget/widget.d.ts +23 -2
  126. package/dist/widget/widget.d.ts.map +1 -1
  127. package/package.json +2 -2
  128. package/src/abis/trailsHydrate.ts +2 -1
  129. package/src/analytics.ts +60 -0
  130. package/src/chainSwitch.ts +11 -8
  131. package/src/chains.ts +82 -37
  132. package/src/constants.ts +2 -2
  133. package/src/error.ts +8 -0
  134. package/src/index.ts +1 -12
  135. package/src/intentReceiptPoller.ts +27 -0
  136. package/src/intents.ts +36 -87
  137. package/src/mutations.ts +11 -102
  138. package/src/onramp-client/index.ts +3 -3
  139. package/src/prepareSend.ts +6 -2
  140. package/src/query/balance.hooks.ts +31 -10
  141. package/src/query/chains.hooks.ts +7 -1
  142. package/src/query/chains.queries.ts +8 -5
  143. package/src/queryParams.ts +8 -6
  144. package/src/recover.ts +9 -9
  145. package/src/tokens.ts +4 -2
  146. package/src/transactionIntent/deposits/depositOrchestrator.ts +0 -2
  147. package/src/transactionIntent/deposits/gaslessDeposit.ts +8 -0
  148. package/src/transactionIntent/deposits/standardDeposit.ts +25 -35
  149. package/src/transactionIntent/handlers/intentHandler.ts +234 -138
  150. package/src/transactionIntent/helpers/transactionStateHelpers.ts +108 -1
  151. package/src/transactionIntent/types.ts +14 -8
  152. package/src/transactionIntent/utils/resilientDepositTracker.ts +72 -183
  153. package/src/transactions.ts +16 -0
  154. package/src/walletUtils.ts +188 -1
  155. package/src/wallets.ts +50 -15
  156. package/src/widget/compiled.css +1 -1
  157. package/src/widget/components/AccountActionsDropdown.tsx +4 -6
  158. package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +4 -6
  159. package/src/widget/components/AccountSettings.tsx +36 -22
  160. package/src/widget/components/ClassicSwap.tsx +67 -9
  161. package/src/widget/components/ConnectWallet.tsx +5 -7
  162. package/src/widget/components/ConnectedWallets.tsx +143 -82
  163. package/src/widget/components/DepositTracker.tsx +4 -5
  164. package/src/widget/components/DirectTransfer.tsx +85 -84
  165. package/src/widget/components/Earn.tsx +3 -3
  166. package/src/widget/components/Fund.tsx +90 -17
  167. package/src/widget/components/FundMethods.tsx +77 -43
  168. package/src/widget/components/FundWalletSelection.tsx +13 -397
  169. package/src/widget/components/FundingMethodSelectorButton.tsx +11 -10
  170. package/src/widget/components/MeldStepsFlow.tsx +64 -30
  171. package/src/widget/components/OnrampErrorScreen.tsx +2 -18
  172. package/src/widget/components/OnrampPaymentMethods.tsx +4 -6
  173. package/src/widget/components/OnrampProviderConfirmation.tsx +91 -110
  174. package/src/widget/components/OriginTransferInformation.tsx +2 -2
  175. package/src/widget/components/Pay.tsx +27 -7
  176. package/src/widget/components/PaymentMethods.tsx +10 -10
  177. package/src/widget/components/PoolDeposit.tsx +2 -2
  178. package/src/widget/components/QrCode.tsx +13 -11
  179. package/src/widget/components/QuoteDetails.tsx +16 -6
  180. package/src/widget/components/Receipt.tsx +66 -6
  181. package/src/widget/components/ReceiptRecoverableFunds.tsx +135 -0
  182. package/src/widget/components/RecipientSelectorButton.tsx +6 -17
  183. package/src/widget/components/Recipients.tsx +38 -29
  184. package/src/widget/components/Swap.tsx +2 -25
  185. package/src/widget/components/TokenList.tsx +2 -2
  186. package/src/widget/components/TokenSelector.tsx +11 -11
  187. package/src/widget/components/TokenSelectorButton.tsx +3 -3
  188. package/src/widget/components/TrailsHookModal.tsx +1 -1
  189. package/src/widget/components/TransactionDetails.tsx +43 -37
  190. package/src/widget/components/TransactionHistoryItem.tsx +1 -42
  191. package/src/widget/components/TransferPendingVertical.tsx +11 -4
  192. package/src/widget/components/TruncatedTransactionHash.tsx +5 -0
  193. package/src/widget/components/WalletConfirmation.tsx +5 -8
  194. package/src/widget/components/WalletConnect.tsx +6 -2
  195. package/src/widget/components/WidgetProviders.tsx +34 -43
  196. package/src/widget/components/Withdraw.tsx +25 -11
  197. package/src/widget/hooks/useClickTracking.ts +5 -0
  198. package/src/widget/hooks/useDebugScreens.ts +40 -86
  199. package/src/widget/hooks/useDepositMonitor.ts +14 -149
  200. package/src/widget/hooks/useExternalFundingReceiptSync.ts +79 -0
  201. package/src/widget/hooks/useIntentReceiptBalances.ts +141 -0
  202. package/src/widget/hooks/useQuote.ts +7 -16
  203. package/src/widget/hooks/useScreenTracking.ts +14 -0
  204. package/src/widget/hooks/useSelectedFundMethod.tsx +0 -5
  205. package/src/widget/hooks/useSendForm.ts +5 -14
  206. package/src/widget/hooks/useTokenList.ts +3 -16
  207. package/src/widget/hooks/useTrailsSendTransaction.ts +1 -5
  208. package/src/widget/hooks/useViewManager.tsx +505 -0
  209. package/src/widget/hooks/useWalletConnectUri.tsx +77 -18
  210. package/src/widget/hooks/useWalletConnectionContext.tsx +1 -1
  211. package/src/widget/index.tsx +1 -0
  212. package/src/widget/providers/TrailsProvider.tsx +0 -41
  213. package/src/widget/styles.ts +1 -1
  214. package/src/widget/types/commonProps.ts +0 -8
  215. package/src/widget/utils/forexRateStore.ts +0 -2
  216. package/src/widget/utils/fundMethodSwitchState.ts +25 -0
  217. package/src/widget/utils/localeStore.ts +0 -1
  218. package/src/widget/utils/viewManagerGuards.ts +49 -0
  219. package/src/widget/widget.tsx +405 -316
  220. package/dist/intentStorage.d.ts +0 -24
  221. package/dist/intentStorage.d.ts.map +0 -1
  222. package/dist/mode.d.ts +0 -2
  223. package/dist/mode.d.ts.map +0 -1
  224. package/dist/widget/hooks/useBack.d.ts +0 -22
  225. package/dist/widget/hooks/useBack.d.ts.map +0 -1
  226. package/dist/widget/hooks/useCurrentScreen.d.ts +0 -13
  227. package/dist/widget/hooks/useCurrentScreen.d.ts.map +0 -1
  228. package/dist/widget/hooks/useInitialRedirect.d.ts +0 -7
  229. package/dist/widget/hooks/useInitialRedirect.d.ts.map +0 -1
  230. package/dist/widget/hooks/useMode.d.ts +0 -20
  231. package/dist/widget/hooks/useMode.d.ts.map +0 -1
  232. package/dist/widget/hooks/usePreviousScreen.d.ts +0 -12
  233. package/dist/widget/hooks/usePreviousScreen.d.ts.map +0 -1
  234. package/dist/widget/workers/intentExecutionWorker.d.ts +0 -73
  235. package/dist/widget/workers/intentExecutionWorker.d.ts.map +0 -1
  236. package/src/intentStorage.ts +0 -106
  237. package/src/mode.ts +0 -1
  238. package/src/widget/hooks/useBack.tsx +0 -210
  239. package/src/widget/hooks/useCurrentScreen.tsx +0 -73
  240. package/src/widget/hooks/useInitialRedirect.tsx +0 -70
  241. package/src/widget/hooks/useMode.tsx +0 -51
  242. package/src/widget/hooks/usePreviousScreen.ts +0 -36
  243. package/src/widget/workers/intentExecutionWorker.ts +0 -502
package/dist/index.js CHANGED
@@ -1,64 +1,27 @@
1
1
  "use client";
2
- import { l as d, u as pe, a as we, b as Re, c as Pe, d as Ue, e as He, f as xe, g as B, h as V, i as se, j as L, k as G, T as O, m as oe, n as re, o as Oe, p as De, q as N } from "./index-C0QTNYIA.js";
3
- import { I as tt, r as nt, M as st, S as ot, s as rt, t as at, v as it, w as ct, x as dt, y as lt, z as ut, U as ft, A as Tt, B as mt, C as gt, D as kt, E as ht, F as At, G as It, H as Ct, J as Et, K as St, L as yt, N as pt, O as wt, P as Rt, Q as Pt, R as Ut, V as Ht, W as xt, X as Ot, Y as Dt, Z as Mt, _ as Bt, $ as Lt, a0 as Nt, a1 as Wt, a2 as qt, a3 as Ft, a4 as Qt, a5 as _t, a6 as Kt, a7 as $t, a8 as jt, a9 as Vt, aa as Gt, ab as Xt, ac as Yt, ad as vt, ae as zt, af as Jt, ag as Zt, ah as bt, ai as en, aj as tn, ak as nn, al as sn, am as on, an as rn, ao as an, ap as cn, aq as dn, ar as ln, as as un, at as fn, au as Tn, av as mn, aw as gn, ax as kn, ay as hn, az as An, aA as In, aB as Cn, aC as En, aD as Sn, aE as yn, aF as pn, aG as wn, aH as Rn, aI as Pn, aJ as Un, aK as Hn, aL as xn, aM as On, aN as Dn, aO as Mn, aP as Bn, aQ as Ln, aR as Nn, aS as Wn, aT as qn, aU as Fn, aV as Qn, aW as _n, aX as Kn, aY as $n, aZ as jn, a_ as Vn, a$ as Gn } from "./index-C0QTNYIA.js";
4
- import { useQuery as Me, useQueryClient as Be, useMutation as Le } from "@tanstack/react-query";
5
- import { useRef as Ne, useCallback as W } from "react";
6
- import { useWalletClient as We, useAccount as qe, useChainId as Fe } from "wagmi";
7
- import { zeroAddress as R, erc20Abi as Qe } from "viem";
8
- const ae = 150, ze = (s, A) => {
9
- const I = Me({
10
- queryKey: ["waitIntentReceipt", s],
11
- queryFn: async () => {
12
- if (!s)
13
- throw new Error("Intent ID is required for monitoring");
14
- d.console.log(
15
- `[trails-sdk] 🔍 Monitoring intent receipt for ${s}`
16
- );
17
- const T = await A.waitIntentReceipt({
18
- intentId: s
19
- });
20
- return d.console.log(
21
- `[trails-sdk] 📊 Intent ${s} status: ${T.intentReceipt.status}, done: ${T.done}`
22
- ), T;
23
- },
24
- enabled: !!s,
25
- refetchIntervalInBackground: !0,
26
- refetchInterval: (T) => {
27
- const C = T.state.data;
28
- return C && C.done ? (d.console.log(
29
- `[trails-sdk] ✅ Intent monitoring complete for ${s}`
30
- ), !1) : ae;
31
- },
32
- retry: (T, C) => T >= 30 ? (d.console.error(
33
- `[trails-sdk] ❌ Giving up on intent ${s} after 30 failed API attempts:`,
34
- C
35
- ), !1) : !0
36
- });
37
- return {
38
- intentReceipt: I.data?.intentReceipt ?? null,
39
- done: I.data?.done ?? !1,
40
- isLoading: I.isLoading,
41
- isError: I.isError,
42
- error: I.error
43
- };
44
- };
45
- function Je(s) {
46
- const { data: A } = We(), { chainId: I } = qe(), T = Fe(), C = pe(), { trailsApiKey: ie, sequenceIndexerUrl: ce, sequenceMetadataUrl: de } = we(), P = Be(), {
47
- openModal: X,
48
- setPendingSelection: le,
49
- setHostTransactionState: Y,
50
- setHostTransactionQuote: q,
51
- setHostTransactionStates: F,
52
- setHostTransactionTimestamp: Q,
2
+ import { u as ye, a as we, b as pe, c as Pe, d as Re, e as Ue, f as He, l as T, g as M, h as G, i as se, j as N, k as X, T as H, m as oe, n as ae, o as xe, p as Oe, q as W } from "./index-DEojZg7b.js";
3
+ import { I as Ze, M as be, S as et, r as tt, s as nt, t as st, v as ot, w as at, x as rt, y as it, U as ct, W as dt, z as lt, A as ut, B as Tt, C as ft, D as mt, E as gt, F as kt, G as ht, H as At, J as Ct, K as It, L as Et, N as St, O as yt, P as wt, Q as pt, R as Pt, V as Rt, X as Ut, Y as Ht, Z as xt, _ as Ot, $ as Dt, a0 as Bt, a1 as Mt, a2 as Nt, a3 as Wt, a4 as Ft, a5 as Lt, a6 as Qt, a7 as qt, a8 as _t, a9 as Kt, aa as jt, ab as Vt, ac as Gt, ad as Xt, ae as Yt, af as $t, ag as zt, ah as Jt, ai as vt, aj as Zt, ak as bt, al as en, am as tn, an as nn, ao as sn, ap as on, aq as an, ar as rn, as as cn, at as dn, au as ln, av as un, aw as Tn, ax as fn, ay as mn, az as gn, aA as kn, aB as hn, aC as An, aD as Cn, aE as In, aF as En, aG as Sn, aH as yn, aI as wn, aJ as pn, aK as Pn, aL as Rn, aM as Un, aN as Hn, aO as xn, aP as On, aQ as Dn, aR as Bn, aS as Mn, aT as Nn, aU as Wn, aV as Fn, aW as Ln, aX as Qn, aY as qn } from "./index-DEojZg7b.js";
4
+ import { useQueryClient as De, useMutation as Be } from "@tanstack/react-query";
5
+ import { useRef as Me, useCallback as F } from "react";
6
+ import { useWalletClient as Ne, useAccount as We, useChainId as Fe } from "wagmi";
7
+ import { zeroAddress as y, erc20Abi as Le } from "viem";
8
+ function $e(i) {
9
+ const { data: I } = Ne(), { chainId: x } = We(), O = Fe(), w = ye(), { trailsApiKey: re, sequenceIndexerUrl: ie, sequenceMetadataUrl: ce } = we(), p = De(), {
10
+ openModal: Y,
11
+ setPendingSelection: de,
12
+ setHostTransactionState: $,
13
+ setHostTransactionQuote: L,
14
+ setHostTransactionStates: Q,
15
+ setHostTransactionTimestamp: q,
53
16
  hostTransactionState: D,
54
- setReceiptActionButtonText: ue,
55
- setOnReceiptAction: fe,
17
+ setReceiptActionButtonText: le,
18
+ setOnReceiptAction: ue,
56
19
  retryTransactionRef: Te,
57
- repeatTransactionRef: me,
58
- setLastOriginSelection: ge
59
- } = Re(), _ = Pe(), { supportedTokens: U } = Ue(), ke = He(), he = xe(), M = Ne(null), m = W(
20
+ repeatTransactionRef: fe,
21
+ setLastOriginSelection: me
22
+ } = pe(), _ = Pe(), { supportedTokens: P } = Re(), ge = Ue(), ke = He(), B = Me(null), f = F(
60
23
  (e) => {
61
- Y((n) => ({
24
+ $((n) => ({
62
25
  status: e.status ?? n.status,
63
26
  details: e.details === null ? void 0 : e.details ? { ...n.details, ...e.details } : n.details,
64
27
  error: e.error === null ? void 0 : e.error !== void 0 ? e.error : n.error,
@@ -66,457 +29,454 @@ function Je(s) {
66
29
  retryEnabled: e.retryEnabled !== void 0 ? e.retryEnabled : n.retryEnabled
67
30
  }));
68
31
  },
69
- [Y]
70
- ), v = async (e, n, o) => {
71
- if (d.console.log(
32
+ [$]
33
+ ), z = async (e, n, s) => {
34
+ if (T.console.log(
72
35
  "[trails-sdk] [useTrailsSendTransaction] Executing transaction",
73
36
  { variables: e, originSelection: n }
74
- ), !A || !A.account)
37
+ ), !I || !I.account)
75
38
  throw new Error(
76
39
  "Wallet client not available. Please connect your wallet."
77
40
  );
78
41
  if (!e.to)
79
42
  throw new Error("Transaction 'to' address is required.");
80
- let a, r, g;
43
+ let a, o, m;
81
44
  if (n)
82
- a = n.fromTokenAddress, r = n.fromChainId, g = n.fromAmount;
45
+ a = n.fromTokenAddress, o = n.fromChainId, m = n.fromAmount;
83
46
  else if (e.fromTokenAddress && e.fromChainId && e.fromAmount)
84
- a = e.fromTokenAddress, r = e.fromChainId, g = e.fromAmount;
47
+ a = e.fromTokenAddress, o = e.fromChainId, m = e.fromAmount;
85
48
  else if (e.to && e.value !== void 0) {
86
- const t = I || T;
49
+ const t = x || O;
87
50
  if (!t)
88
51
  throw new Error("Chain ID not available. Please connect your wallet.");
89
- r = t, a = R, g = e.value.toString();
52
+ o = t, a = y, m = e.value.toString();
90
53
  } else
91
54
  throw new Error(
92
55
  "Origin token parameters are required. Please provide 'value' (native token), or 'fromTokenAddress'/'fromChainId'/'fromAmount' (ERC20 token), or select via modal."
93
56
  );
94
- const S = I || T;
95
- if (!S)
57
+ const A = x || O;
58
+ if (!A)
96
59
  throw new Error("Chain ID not available. Please connect your wallet.");
97
- let E, k, i, h;
60
+ let h, g, r, k;
98
61
  if (e.tokenAddress && e.tokenAmount)
99
- E = e.tokenAddress, k = B(
100
- U,
62
+ h = e.tokenAddress, g = M(
63
+ P,
101
64
  e.tokenAddress
102
- )?.chainId ?? S, i = e.tokenAmount, h = e.to;
65
+ )?.chainId ?? A, r = e.tokenAmount, k = e.to;
103
66
  else if (e.to && e.value !== void 0)
104
- E = R, k = S, i = e.value.toString(), h = e.to;
67
+ h = y, g = A, r = e.value.toString(), k = e.to;
105
68
  else
106
69
  throw new Error(
107
70
  "Either 'value' or 'tokenAddress'/'tokenAmount' must be provided."
108
71
  );
109
- const f = e.tokenAddress && e.tokenAmount ? O.EXACT_OUTPUT : O.EXACT_INPUT;
110
- if (f === O.EXACT_INPUT && !g)
72
+ const u = e.tokenAddress && e.tokenAmount ? H.EXACT_OUTPUT : H.EXACT_INPUT;
73
+ if (u === H.EXACT_INPUT && !m)
111
74
  throw new Error(
112
75
  "Origin amount is required for this transaction. Please provide 'value' or 'fromAmount'."
113
76
  );
114
- const w = f === O.EXACT_OUTPUT ? i : g;
115
- let l = [];
77
+ const S = u === H.EXACT_OUTPUT ? r : m;
78
+ let d = [];
116
79
  try {
117
- l = (await P.ensureQueryData(
118
- V.withPrices(
119
- A.account.address,
80
+ d = (await p.ensureQueryData(
81
+ G.withPrices(
82
+ I.account.address,
120
83
  _,
121
- C
84
+ w
122
85
  )
123
86
  )).balances;
124
87
  } catch (t) {
125
- d.console.warn(
88
+ T.console.warn(
126
89
  "[trails-sdk] [useTrailsSendTransaction] Error fetching balances, proceeding with zero balance",
127
90
  t
128
- ), l = [];
91
+ ), d = [];
129
92
  }
130
- const z = l.find(
131
- (t) => t.chainId === r && (oe(t.contractAddress, a) || !t.contractAddress && a === R)
93
+ const J = d.find(
94
+ (t) => t.chainId === o && (oe(t.contractAddress, a) || !t.contractAddress && a === y)
132
95
  )?.balance ?? "0";
133
- let J = 0;
96
+ let v = 0;
134
97
  try {
135
- const c = re(r)?.nativeCurrency?.symbol ?? "";
136
- c && (J = (await Oe(C, {
98
+ const c = ae(o)?.nativeCurrency?.symbol ?? "";
99
+ c && (v = (await xe(w, {
137
100
  tokenSymbol: c,
138
- tokenAddress: R,
139
- chainId: r
101
+ tokenAddress: y,
102
+ chainId: o
140
103
  }))?.priceUsd ?? 0);
141
104
  } catch (t) {
142
- d.console.warn(
105
+ T.console.warn(
143
106
  "[trails-sdk] [useTrailsSendTransaction] Error getting native token price",
144
107
  t
145
108
  );
146
109
  }
147
- const Z = B(
148
- U,
110
+ const Z = M(
111
+ P,
149
112
  a,
150
- r
151
- ), b = B(
152
- U,
153
- E,
154
- k
155
- ), { getChainRpcClient: j } = await import("./index-C0QTNYIA.js").then((t) => t.bo), ee = j(r), te = j(k), ne = async (t, c) => {
113
+ o
114
+ ), b = M(
115
+ P,
116
+ h,
117
+ g
118
+ ), { getChainRpcClient: V } = await import("./index-DEojZg7b.js").then((t) => t.bl), ee = V(o), te = V(g), ne = async (t, c) => {
156
119
  try {
157
- const p = c === r ? ee : c === k ? te : j(c);
158
- return p ? oe(t, R) ? re(c)?.nativeCurrency.decimals ?? 18 : await p.readContract({
120
+ const E = c === o ? ee : c === g ? te : V(c);
121
+ return E ? oe(t, y) ? ae(c)?.nativeCurrency.decimals ?? 18 : await E.readContract({
159
122
  address: t,
160
- abi: Qe,
123
+ abi: Le,
161
124
  functionName: "decimals"
162
125
  }) : null;
163
- } catch (p) {
164
- return d.console.error(
126
+ } catch (E) {
127
+ return T.console.error(
165
128
  `[trails-sdk] Error fetching decimals on-chain for token ${t} on chain ${c}:`,
166
- p
129
+ E
167
130
  ), null;
168
131
  }
169
132
  };
170
- let H = Z?.decimals;
171
- if (!H && a) {
133
+ let R = Z?.decimals;
134
+ if (!R && a) {
172
135
  const t = await ne(
173
136
  a,
174
- r
137
+ o
175
138
  );
176
- t !== null && (H = t);
139
+ t !== null && (R = t);
177
140
  }
178
- H || (H = 18);
179
- let x = b?.decimals;
180
- if (!x && E) {
141
+ R || (R = 18);
142
+ let U = b?.decimals;
143
+ if (!U && h) {
181
144
  const t = await ne(
182
- E,
183
- k
145
+ h,
146
+ g
184
147
  );
185
- t !== null && (x = t);
148
+ t !== null && (U = t);
186
149
  }
187
- x || (x = 18);
188
- const Ie = b?.symbol ?? "", Ce = Z?.symbol ?? "", Ee = (t) => {
189
- o?.trackInWidget && F(t), s?.onStatusUpdate?.(t);
190
- }, { send: Se, quote: ye } = await De({
191
- queryClient: P,
192
- account: A.account,
150
+ U || (U = 18);
151
+ const Ae = b?.symbol ?? "", Ce = Z?.symbol ?? "", Ie = (t) => {
152
+ s?.trackInWidget && Q(t), i?.onStatusUpdate?.(t);
153
+ }, { send: Ee, quote: Se } = await Oe({
154
+ queryClient: p,
155
+ account: I.account,
193
156
  originTokenAddress: a,
194
- originChainId: r,
195
- originTokenBalance: z,
196
- destinationChainId: k,
197
- recipient: h,
198
- destinationTokenAddress: E,
199
- swapAmount: w,
200
- tradeType: f,
157
+ originChainId: o,
158
+ originTokenBalance: J,
159
+ destinationChainId: g,
160
+ recipient: k,
161
+ destinationTokenAddress: h,
162
+ swapAmount: S,
163
+ tradeType: u,
201
164
  originTokenSymbol: Ce,
202
- destinationTokenSymbol: Ie,
203
- client: A,
204
- trailsClient: C,
165
+ destinationTokenSymbol: Ae,
166
+ client: I,
167
+ trailsClient: w,
205
168
  destinationCalldata: e.data ? e.data.toString() : void 0,
206
- onTransactionStateChange: Ee,
207
- sourceTokenDecimals: H,
208
- destinationTokenDecimals: x,
209
- paymasterUrl: s?.paymasterUrl,
210
- slippageTolerance: s?.slippageTolerance?.toString(),
211
- originNativeTokenPriceUsd: J,
212
- swapProvider: s?.swapProvider,
213
- bridgeProvider: s?.bridgeProvider,
214
- commitIntentFn: (t, c) => ke.mutateAsync({
215
- intent: t,
216
- skipIntentMonitoring: c?.skipIntentMonitoring
217
- }),
218
- executeIntentFn: he.mutateAsync,
219
- checkoutOnHandlers: s?.checkoutOnHandlers,
220
- sequenceIndexerUrl: ce,
221
- sequenceMetadataUrl: de,
222
- sequenceProjectAccessKey: ie,
169
+ onTransactionStateChange: Ie,
170
+ sourceTokenDecimals: R,
171
+ destinationTokenDecimals: U,
172
+ paymasterUrl: i?.paymasterUrl,
173
+ slippageTolerance: i?.slippageTolerance?.toString(),
174
+ originNativeTokenPriceUsd: v,
175
+ swapProvider: i?.swapProvider,
176
+ bridgeProvider: i?.bridgeProvider,
177
+ commitIntentFn: (t) => ge.mutateAsync(t),
178
+ executeIntentFn: ke.mutateAsync,
179
+ checkoutOnHandlers: i?.checkoutOnHandlers,
180
+ sequenceIndexerUrl: ie,
181
+ sequenceMetadataUrl: ce,
182
+ sequenceProjectAccessKey: re,
223
183
  originPublicClient: ee ?? void 0,
224
184
  destinationPublicClient: te ?? void 0,
225
- isSmartWallet: s?.isSmartWallet ?? void 0,
226
- mode: s?.mode ?? void 0
185
+ isSmartWallet: i?.isSmartWallet ?? void 0,
186
+ mode: i?.mode ?? void 0
227
187
  });
228
- o?.trackInWidget && (q(ye ?? null), D.details || m({
188
+ s?.trackInWidget && (L(Se ?? null), D.details || f({
229
189
  details: {
230
- to: h,
231
- tokenAddress: E,
232
- tokenAmount: f === O.EXACT_OUTPUT ? i : void 0,
233
- toChainId: k,
190
+ to: k,
191
+ tokenAddress: h,
192
+ tokenAmount: u === H.EXACT_OUTPUT ? r : void 0,
193
+ toChainId: g,
234
194
  data: e.data
235
195
  }
236
- }), (!D.status || D.status === "idle") && Q(Date.now()));
196
+ }), (!D.status || D.status === "idle") && q(Date.now()));
237
197
  try {
238
- o?.trackInWidget && m({ retryEnabled: !1 });
198
+ s?.trackInWidget && f({ retryEnabled: !1 });
239
199
  const {
240
200
  depositUserTxnReceipt: t,
241
201
  destinationIntentTransaction: c,
242
- totalCompletionSeconds: p
243
- } = await Se({
202
+ totalCompletionSeconds: E
203
+ } = await Ee({
244
204
  selectedFeeOption: null,
245
205
  // Transition to "pending" when wallet signature is complete
246
206
  onOriginSend: () => {
247
- o?.trackInWidget && m({ status: "pending", error: null });
207
+ s?.trackInWidget && f({ status: "pending", error: null });
248
208
  }
249
209
  });
250
- return o?.trackInWidget && m({
210
+ return s?.trackInWidget && f({
251
211
  status: "success",
252
212
  result: {
253
213
  originTxHash: t?.transactionHash,
254
- originExplorerUrl: t?.transactionHash ? N({
214
+ originExplorerUrl: t?.transactionHash ? W({
255
215
  txHash: t.transactionHash,
256
- chainId: r
216
+ chainId: o
257
217
  }) : void 0,
258
218
  destinationTxHash: c?.txnHash,
259
- destinationExplorerUrl: c?.txnHash ? N({
219
+ destinationExplorerUrl: c?.txnHash ? W({
260
220
  txHash: c.txnHash,
261
- chainId: k
221
+ chainId: g
262
222
  }) : void 0
263
223
  }
264
224
  }), {
265
225
  originTransaction: {
266
226
  transactionHash: t?.transactionHash,
267
- explorerUrl: N({
227
+ explorerUrl: W({
268
228
  txHash: t?.transactionHash,
269
- chainId: r
229
+ chainId: o
270
230
  }),
271
231
  receipt: t
272
232
  },
273
233
  destinationTransaction: {
274
234
  transactionHash: c?.txnHash,
275
- explorerUrl: N({
235
+ explorerUrl: W({
276
236
  txHash: c?.txnHash,
277
- chainId: k
237
+ chainId: g
278
238
  }),
279
239
  receipt: c
280
240
  },
281
- totalCompletionSeconds: p
241
+ totalCompletionSeconds: E
282
242
  };
283
243
  } catch (t) {
284
- if (o?.trackInWidget) {
285
- const c = G(t);
286
- m(c ? {
244
+ if (s?.trackInWidget) {
245
+ const c = X(t);
246
+ f(c ? {
287
247
  status: "confirmation",
288
248
  error: null,
289
249
  retryEnabled: !0
290
250
  } : {
291
251
  status: "error",
292
- error: L(t),
252
+ error: N(t),
293
253
  retryEnabled: !1
294
254
  });
295
255
  }
296
256
  throw t;
297
257
  }
298
- }, u = Le({
258
+ }, l = Be({
299
259
  mutationFn: async (e) => {
300
- d.console.log(
260
+ T.console.log(
301
261
  "[trails-sdk] [useTrailsSendTransaction] Starting transaction",
302
262
  e
303
- ), M.current = e, ue(
304
- s?.receiptActionButtonText ?? "Transact Again"
305
- ), fe(s?.onReceiptAction ?? null);
306
- const n = e.value !== void 0, o = e.fromTokenAddress !== void 0 && e.fromChainId !== void 0, a = n || o;
307
- let r;
308
- if (e.tokenAddress && U) {
309
- const i = B(
310
- U,
263
+ ), B.current = e, le(
264
+ i?.receiptActionButtonText ?? "Transact Again"
265
+ ), ue(i?.onReceiptAction ?? null);
266
+ const n = e.value !== void 0, s = e.fromTokenAddress !== void 0 && e.fromChainId !== void 0, a = n || s;
267
+ let o;
268
+ if (e.tokenAddress && P) {
269
+ const r = M(
270
+ P,
311
271
  e.tokenAddress
312
272
  );
313
- i && (r = i.chainId);
273
+ r && (o = r.chainId);
314
274
  }
315
- r || (r = I || T);
316
- let g = !0, S = !0;
317
- if (A?.account)
275
+ o || (o = x || O);
276
+ let m = !0, A = !0;
277
+ if (I?.account)
318
278
  try {
319
279
  if (a) {
320
- let i, h, f;
321
- if (e.value !== void 0 ? (i = R, h = I || T || 1, f = e.value.toString()) : e.fromTokenAddress && e.fromChainId && (i = e.fromTokenAddress, h = e.fromChainId, f = e.fromAmount), i && h && f && f !== "0") {
322
- const { balances: w } = await P.ensureQueryData(
323
- V.withPrices(
324
- A.account.address,
280
+ let r, k, u;
281
+ if (e.value !== void 0 ? (r = y, k = x || O || 1, u = e.value.toString()) : e.fromTokenAddress && e.fromChainId && (r = e.fromTokenAddress, k = e.fromChainId, u = e.fromAmount), r && k && u && u !== "0") {
282
+ const { balances: S } = await p.ensureQueryData(
283
+ G.withPrices(
284
+ I.account.address,
325
285
  _,
326
- C
286
+ w
327
287
  )
328
288
  );
329
- g = se(
330
- w,
331
- i,
332
- f,
333
- h
334
- ), d.console.log(
289
+ m = se(
290
+ S,
291
+ r,
292
+ u,
293
+ k
294
+ ), T.console.log(
335
295
  "[trails-sdk] [useTrailsSendTransaction] Origin token balance check:",
336
296
  {
337
- tokenAddress: i,
338
- amount: f,
339
- chainId: h,
340
- hasSufficientBalance: g
297
+ tokenAddress: r,
298
+ amount: u,
299
+ chainId: k,
300
+ hasSufficientBalance: m
341
301
  }
342
302
  );
343
303
  }
344
304
  }
345
- if (g && e.tokenAddress && e.tokenAmount) {
346
- const i = await P.ensureQueryData(
347
- V.withPrices(
348
- A.account.address,
305
+ if (m && e.tokenAddress && e.tokenAmount) {
306
+ const r = await p.ensureQueryData(
307
+ G.withPrices(
308
+ I.account.address,
349
309
  _,
350
- C
310
+ w
351
311
  )
352
312
  );
353
- S = se(
354
- i.balances,
313
+ A = se(
314
+ r.balances,
355
315
  e.tokenAddress,
356
316
  e.tokenAmount,
357
- r
358
- ), d.console.log(
317
+ o
318
+ ), T.console.log(
359
319
  "[trails-sdk] [useTrailsSendTransaction] Destination token balance check:",
360
320
  {
361
321
  tokenAddress: e.tokenAddress,
362
322
  tokenAmount: e.tokenAmount,
363
- chainId: r,
364
- hasSufficientBalance: S
323
+ chainId: o,
324
+ hasSufficientBalance: A
365
325
  }
366
326
  );
367
327
  }
368
- } catch (i) {
369
- d.console.warn(
328
+ } catch (r) {
329
+ T.console.warn(
370
330
  "[trails-sdk] [useTrailsSendTransaction] Error checking balances, defaulting to origin selection:",
371
- i
372
- ), g = !1, S = !1;
331
+ r
332
+ ), m = !1, A = !1;
373
333
  }
374
- const E = !a || !g || !S;
375
- if (d.console.log(
334
+ const h = !a || !m || !A;
335
+ if (T.console.log(
376
336
  "[trails-sdk] [useTrailsSendTransaction] Origin selection decision:",
377
337
  {
378
338
  hasOriginParams: a,
379
- hasSufficientOriginBalance: g,
380
- hasSufficientDestinationTokenBalance: S,
381
- needsOriginSelection: E
339
+ hasSufficientOriginBalance: m,
340
+ hasSufficientDestinationTokenBalance: A,
341
+ needsOriginSelection: h
382
342
  }
383
- ), E) {
384
- const i = !(e.tokenAddress && e.tokenAmount), h = {
343
+ ), h) {
344
+ const r = !(e.tokenAddress && e.tokenAmount), k = {
385
345
  to: e.to,
386
346
  tokenAddress: e.tokenAddress,
387
347
  tokenAmount: e.tokenAmount,
388
- toChainId: r,
348
+ toChainId: o,
389
349
  data: e.data
390
350
  };
391
- return m({
351
+ return f({
392
352
  status: "awaiting-origin",
393
- details: h,
353
+ details: k,
394
354
  error: null,
395
355
  result: null
396
- }), q(null), F([]), Q(Date.now()), new Promise((f, w) => {
397
- le({
398
- resolve: async (l) => {
356
+ }), L(null), Q([]), q(Date.now()), new Promise((u, S) => {
357
+ de({
358
+ resolve: async (d) => {
399
359
  try {
400
- M.current = {
360
+ B.current = {
401
361
  ...e,
402
- fromTokenAddress: l.fromTokenAddress,
403
- fromChainId: l.fromChainId,
404
- fromAmount: l.fromAmount
405
- }, ge({
406
- tokenAddress: l.fromTokenAddress,
407
- chainId: l.fromChainId,
408
- amount: l.fromAmount
409
- }), m({ status: "confirmation" });
410
- const y = await v(e, l, {
362
+ fromTokenAddress: d.fromTokenAddress,
363
+ fromChainId: d.fromChainId,
364
+ fromAmount: d.fromAmount
365
+ }, me({
366
+ tokenAddress: d.fromTokenAddress,
367
+ chainId: d.fromChainId,
368
+ amount: d.fromAmount
369
+ }), f({ status: "confirmation" });
370
+ const C = await z(e, d, {
411
371
  trackInWidget: !0
412
372
  });
413
- f(y);
414
- } catch (y) {
415
- G(y) || m({
373
+ u(C);
374
+ } catch (C) {
375
+ X(C) || f({
416
376
  status: "error",
417
- error: L(y)
418
- }), w(y);
377
+ error: N(C)
378
+ }), S(C);
419
379
  }
420
380
  },
421
- reject: (l) => {
422
- const y = l instanceof Error ? l : new Error(String(l));
423
- m({
381
+ reject: (d) => {
382
+ const C = d instanceof Error ? d : new Error(String(d));
383
+ f({
424
384
  status: "error",
425
- error: L(y)
426
- }), w(y);
385
+ error: N(C)
386
+ }), S(C);
427
387
  },
428
- requireAmountInput: i
388
+ requireAmountInput: r
429
389
  }), setTimeout(() => {
430
- d.console.log(
390
+ T.console.log(
431
391
  "[trails-sdk] [useTrailsSendTransaction] Calling openModal()"
432
- ), X();
392
+ ), Y();
433
393
  }, 0);
434
394
  });
435
395
  }
436
- const k = {
396
+ const g = {
437
397
  to: e.to,
438
398
  tokenAddress: e.tokenAddress,
439
399
  tokenAmount: e.tokenAmount,
440
- toChainId: r,
400
+ toChainId: o,
441
401
  data: e.data
442
402
  };
443
- return m({
403
+ return f({
444
404
  status: "confirmation",
445
- details: k,
405
+ details: g,
446
406
  error: null,
447
407
  result: null
448
- }), q(null), F([]), Q(Date.now()), X(), v(e, void 0, { trackInWidget: !0 });
408
+ }), L(null), Q([]), q(Date.now()), Y(), z(e, void 0, { trackInWidget: !0 });
449
409
  },
450
410
  onSuccess: (e, n) => {
451
- d.console.log(
411
+ T.console.log(
452
412
  "[trails-sdk] [useTrailsSendTransaction] Transaction successful",
453
413
  { data: e, variables: n }
454
- ), P.invalidateQueries({ queryKey: ["prepareSend"] }), s?.onSuccess?.(e, n);
414
+ ), p.invalidateQueries({ queryKey: ["prepareSend"] }), i?.onSuccess?.(e, n);
455
415
  },
456
416
  onError: (e, n) => {
457
- d.console.error(
417
+ T.console.error(
458
418
  "[trails-sdk] [useTrailsSendTransaction] Transaction error",
459
419
  { error: e, variables: n }
460
420
  );
461
- const o = L(e), a = G(e);
462
- D.status !== "idle" && !a && m({
421
+ const s = N(e), a = X(e);
422
+ D.status !== "idle" && !a && f({
463
423
  status: "error",
464
- error: o
465
- }), s?.onError?.(new Error(o), n);
424
+ error: s
425
+ }), i?.onError?.(new Error(s), n);
466
426
  },
467
- onSettled: (e, n, o) => {
468
- d.console.log(
427
+ onSettled: (e, n, s) => {
428
+ T.console.log(
469
429
  "[trails-sdk] [useTrailsSendTransaction] Transaction settled",
470
- { data: e, error: n, variables: o }
471
- ), s?.onSettled?.(e, n, o);
430
+ { data: e, error: n, variables: s }
431
+ ), i?.onSettled?.(e, n, s);
472
432
  }
473
- }), K = W(
433
+ }), K = F(
474
434
  (e, n) => {
475
- u.mutate(e, {
476
- onSuccess: (o) => {
477
- n?.onSuccess?.(o);
435
+ l.mutate(e, {
436
+ onSuccess: (s) => {
437
+ n?.onSuccess?.(s);
478
438
  },
479
- onError: (o) => {
480
- n?.onError?.(o);
439
+ onError: (s) => {
440
+ n?.onError?.(s);
481
441
  },
482
- onSettled: (o, a) => {
483
- n?.onSettled?.(o, a);
442
+ onSettled: (s, a) => {
443
+ n?.onSettled?.(s, a);
484
444
  }
485
445
  });
486
446
  },
487
- [u]
488
- ), Ae = W(
489
- async (e, n) => u.mutateAsync(e, {
490
- onSuccess: (o) => {
491
- n?.onSuccess?.(o);
447
+ [l]
448
+ ), he = F(
449
+ async (e, n) => l.mutateAsync(e, {
450
+ onSuccess: (s) => {
451
+ n?.onSuccess?.(s);
492
452
  },
493
- onError: (o) => {
494
- n?.onError?.(o);
453
+ onError: (s) => {
454
+ n?.onError?.(s);
495
455
  },
496
- onSettled: (o, a) => {
497
- n?.onSettled?.(o, a);
456
+ onSettled: (s, a) => {
457
+ n?.onSettled?.(s, a);
498
458
  }
499
459
  }),
500
- [u]
501
- ), $ = W(() => {
502
- M.current && K(M.current);
460
+ [l]
461
+ ), j = F(() => {
462
+ B.current && K(B.current);
503
463
  }, [K]);
504
- return Te.current = $, me.current = $, {
464
+ return Te.current = j, fe.current = j, {
505
465
  sendTransaction: K,
506
- sendTransactionAsync: Ae,
507
- retry: $,
508
- data: u.data,
509
- error: u.error,
510
- isPending: u.isPending,
511
- isSuccess: u.isSuccess,
512
- isError: u.isError,
513
- isIdle: u.isIdle,
514
- status: u.status,
515
- reset: u.reset,
516
- variables: u.variables
466
+ sendTransactionAsync: he,
467
+ retry: j,
468
+ data: l.data,
469
+ error: l.error,
470
+ isPending: l.isPending,
471
+ isSuccess: l.isSuccess,
472
+ isError: l.isError,
473
+ isIdle: l.isIdle,
474
+ status: l.status,
475
+ reset: l.reset,
476
+ variables: l.variables
517
477
  };
518
478
  }
519
- const _e = ["JPY", "KRW", "VND", "CLP", "ISK"], Ke = {
479
+ const Qe = ["JPY", "KRW", "VND", "CLP", "ISK"], qe = {
520
480
  USD: "$",
521
481
  EUR: "€",
522
482
  GBP: "£",
@@ -531,127 +491,123 @@ const _e = ["JPY", "KRW", "VND", "CLP", "ISK"], Ke = {
531
491
  NOK: "kr",
532
492
  DKK: "kr"
533
493
  };
534
- function Ze(s) {
494
+ function ze(i) {
535
495
  return {
536
- decimals: _e.includes(s) ? 0 : 2,
537
- symbol: Ke[s] || s
496
+ decimals: Qe.includes(i) ? 0 : 2,
497
+ symbol: qe[i] || i
538
498
  };
539
499
  }
540
500
  export {
541
- tt as InsufficientBalanceError,
542
- nt as IntentExecutionWorker,
543
- st as MIN_REFETCH_INTERVAL,
544
- ot as SDK_VERSION,
545
- rt as TRAILS_ROUTER_PLACEHOLDER_AMOUNT,
546
- O as TradeType,
547
- at as TrailsClient,
548
- it as TrailsHookModal,
549
- ct as TrailsModalProvider,
550
- dt as TrailsOnramp,
551
- lt as TrailsProvider,
552
- ut as TrailsWidget,
553
- ft as UserRejectionError,
554
- Tt as attemptSwitchChain,
555
- V as balanceQueries,
556
- mt as buildRefundTransactionWithSignature,
557
- gt as calcAmountUsdPrice,
558
- kt as calculateOriginAndDestinationIntentAddresses,
559
- ht as chainQueries,
560
- At as clearAllStoredIntents,
561
- It as commitIntent,
562
- Ct as convertApiTokenInfoToToken,
563
- Et as createModalController,
564
- St as determineRefundCall,
565
- yt as fetchCountryCode,
566
- pt as fiatQueries,
567
- wt as formatBalanceFields,
568
- Rt as formatPriceFields,
569
- Pt as formatTvl,
570
- Ut as formatUsdAmountFormatted,
571
- Ht as formatUsdAmountLocaleDisplay,
572
- xt as formatUsdFields,
573
- Ot as geoQueries,
574
- Dt as getAccountTotalBalanceUsd,
575
- Mt as getAccountTransactionHistory,
576
- Bt as getAllChains,
577
- re as getChainInfo,
578
- Lt as getChainRpcClient,
579
- Ze as getCurrencyInfo,
580
- Nt as getERC20TransferData,
581
- Wt as getHasSufficientBalanceToken,
582
- qt as getHasSufficientBalanceUsd,
583
- Ft as getIntent,
584
- Qt as getIntentConfigurationFromCalls,
585
- _t as getIsApiError,
586
- Kt as getIsBalanceTooLowError,
587
- $t as getIsInsufficientLiquidityError,
588
- jt as getIsNoAvailableQuoteError,
589
- Vt as getIsQuoteFailedError,
590
- Gt as getIsQuoteInputError,
591
- Xt as getIsQuoteTokenError,
592
- Yt as getIsRateLimitedError,
593
- vt as getIsRequiredAmountNotMetError,
594
- G as getIsUserRejectionError,
595
- zt as getIsWalletAlreadyConnectedError,
596
- Jt as getMinLogLevel,
597
- Zt as getOnrampClient,
598
- bt as getPrettifiedErrorMessage,
599
- en as getRpcUrl,
600
- tn as getStoredIntents,
601
- nn as getSupportedChains,
602
- sn as getSupportedTokens,
603
- Oe as getTokenPrice,
604
- on as getTokenPrices,
605
- rn as getTrailsClient,
606
- an as getTxTimeDiff,
607
- cn as getVersion,
608
- dn as invalidateTokenBalancesCache,
609
- ln as invalidateTokenPricesCache,
610
- un as isValidInteger,
611
- fn as isValidNumeric,
612
- d as logger,
613
- Tn as meldQueries,
614
- mn as normalizeNumber,
615
- gn as pollIntentReceipt,
616
- De as prepareSend,
617
- kn as quoteIntent,
618
- hn as removeStoredIntent,
619
- An as sendOriginTransaction,
620
- In as signPayload,
621
- Cn as storeIntentForMonitoring,
622
- En as useAccountTotalBalanceUsd,
623
- Sn as useAccountTransactionHistory,
624
- yn as useChainRpcClient,
625
- He as useCommitIntent,
626
- pn as useCountryCode,
627
- wn as useCountryList,
628
- Rn as useExchangeRate,
629
- xe as useExecuteIntent,
630
- Pn as useFiatCurrencyList,
631
- Un as useGetIntent,
632
- Hn as useGetTokenImageUrl,
633
- xn as useHasSufficientBalanceToken,
634
- On as useHasSufficientBalanceUsd,
501
+ Ze as InsufficientBalanceError,
502
+ be as MIN_REFETCH_INTERVAL,
503
+ et as SDK_VERSION,
504
+ tt as TRAILS_ROUTER_PLACEHOLDER_AMOUNT,
505
+ H as TradeType,
506
+ nt as TrailsClient,
507
+ st as TrailsHookModal,
508
+ ot as TrailsModalProvider,
509
+ at as TrailsOnramp,
510
+ rt as TrailsProvider,
511
+ it as TrailsWidget,
512
+ ct as UserRejectionError,
513
+ dt as WidgetFundMethod,
514
+ lt as attemptSwitchChain,
515
+ G as balanceQueries,
516
+ ut as buildRefundTransactionWithSignature,
517
+ Tt as calcAmountUsdPrice,
518
+ ft as calculateOriginAndDestinationIntentAddresses,
519
+ mt as chainQueries,
520
+ gt as commitIntent,
521
+ kt as convertApiTokenInfoToToken,
522
+ ht as createModalController,
523
+ At as determineRefundCall,
524
+ Ct as fetchCountryCode,
525
+ It as fiatQueries,
526
+ Et as formatBalanceFields,
527
+ St as formatPriceFields,
528
+ yt as formatTvl,
529
+ wt as formatUsdAmountFormatted,
530
+ pt as formatUsdAmountLocaleDisplay,
531
+ Pt as formatUsdFields,
532
+ Rt as geoQueries,
533
+ Ut as getAccountTotalBalanceUsd,
534
+ Ht as getAccountTransactionHistory,
535
+ xt as getAllChains,
536
+ ae as getChainInfo,
537
+ Ot as getChainRpcClient,
538
+ ze as getCurrencyInfo,
539
+ Dt as getERC20TransferData,
540
+ Bt as getHasSufficientBalanceToken,
541
+ Mt as getHasSufficientBalanceUsd,
542
+ Nt as getIntent,
543
+ Wt as getIntentConfigurationFromCalls,
544
+ Ft as getIsApiError,
545
+ Lt as getIsBalanceTooLowError,
546
+ Qt as getIsInsufficientLiquidityError,
547
+ qt as getIsNoAvailableQuoteError,
548
+ _t as getIsQuoteFailedError,
549
+ Kt as getIsQuoteInputError,
550
+ jt as getIsQuoteTokenError,
551
+ Vt as getIsRateLimitedError,
552
+ Gt as getIsRequiredAmountNotMetError,
553
+ X as getIsUserRejectionError,
554
+ Xt as getIsWalletAlreadyConnectedError,
555
+ Yt as getMinLogLevel,
556
+ $t as getOnrampClient,
557
+ zt as getPrettifiedErrorMessage,
558
+ Jt as getRpcUrl,
559
+ vt as getSupportedChains,
560
+ Zt as getSupportedTokens,
561
+ xe as getTokenPrice,
562
+ bt as getTokenPrices,
563
+ en as getTrailsClient,
564
+ tn as getTxTimeDiff,
565
+ nn as getVersion,
566
+ sn as invalidateTokenBalancesCache,
567
+ on as invalidateTokenPricesCache,
568
+ an as isValidInteger,
569
+ rn as isValidNumeric,
570
+ T as logger,
571
+ cn as meldQueries,
572
+ dn as normalizeNumber,
573
+ ln as pollIntentReceipt,
574
+ Oe as prepareSend,
575
+ un as quoteIntent,
576
+ Tn as sendOriginTransaction,
577
+ fn as signPayload,
578
+ mn as useAccountTotalBalanceUsd,
579
+ gn as useAccountTransactionHistory,
580
+ kn as useChainRpcClient,
581
+ Ue as useCommitIntent,
582
+ hn as useCountryCode,
583
+ An as useCountryList,
584
+ Cn as useExchangeRate,
585
+ He as useExecuteIntent,
586
+ In as useFiatCurrencyList,
587
+ En as useGetIntent,
588
+ Sn as useGetTokenImageUrl,
589
+ yn as useHasSufficientBalanceToken,
590
+ wn as useHasSufficientBalanceUsd,
635
591
  Pe as useIndexerGatewayClient,
636
- ze as useIntentReceiptMonitor,
637
- Dn as useIntentRecover,
638
- Mn as useIntentRecoverWithAddress,
639
- Bn as useIntentTransactionHistory,
640
- Ln as useMeldPaymentMethods,
641
- Nn as useMeldServiceProviders,
642
- Wn as useOnrampClient,
643
- qn as useQuote,
644
- Fn as useSupportedChains,
645
- Ue as useSupportedTokens,
646
- Qn as useTokenAddress,
647
- _n as useTokenBalances,
648
- Kn as useTokenBalancesForMultipleAccounts,
649
- $n as useTokenInfo,
650
- jn as useTokenList,
651
- Vn as useTokenPrice,
652
- Gn as useTokenPrices,
592
+ pn as useIntentReceiptMonitor,
593
+ Pn as useIntentRecover,
594
+ Rn as useIntentRecoverWithAddress,
595
+ Un as useIntentTransactionHistory,
596
+ Hn as useMeldPaymentMethods,
597
+ xn as useMeldServiceProviders,
598
+ On as useOnrampClient,
599
+ Dn as useQuote,
600
+ Bn as useSupportedChains,
601
+ Re as useSupportedTokens,
602
+ Mn as useTokenAddress,
603
+ Nn as useTokenBalances,
604
+ Wn as useTokenBalancesForMultipleAccounts,
605
+ Fn as useTokenInfo,
606
+ Ln as useTokenList,
607
+ Qn as useTokenPrice,
608
+ qn as useTokenPrices,
653
609
  we as useTrails,
654
- pe as useTrailsClient,
655
- Re as useTrailsModal,
656
- Je as useTrailsSendTransaction
610
+ ye as useTrailsClient,
611
+ pe as useTrailsModal,
612
+ $e as useTrailsSendTransaction
657
613
  };