0xtrails 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1341) hide show
  1. package/README.md +488 -3
  2. package/dist/BluvoExchangeSelection.lazy-D6ynQVSb.js +1 -0
  3. package/dist/BluvoOnrampFlow.lazy-BcDqhGLi.js +143 -0
  4. package/dist/ConnectWalletCard-BkbHCcWi.js +26 -0
  5. package/dist/actionBuilder-CAS2u5wu.js +2 -0
  6. package/dist/actions/index.d.ts +7 -23
  7. package/dist/actions/index.js +1 -37
  8. package/dist/contractConstants-CvJrYK9v.js +1 -0
  9. package/dist/defineProperty-BbfpZ9Tg.js +1 -0
  10. package/dist/edge-DmNcuJar.d.ts +121 -0
  11. package/dist/edge-L_Lk1K6j.js +1 -0
  12. package/dist/hooks/index.d.ts +6 -38
  13. package/dist/hooks/index.js +1 -67
  14. package/dist/hydrate/index.d.ts +196 -8
  15. package/dist/hydrate/index.js +1 -19
  16. package/dist/hydrate-QyWqQfec.js +1 -0
  17. package/dist/iife/trails.min.js +7324 -0
  18. package/dist/index-CMdwQmYL.d.ts +1044 -0
  19. package/dist/index.d.ts +1023 -114
  20. package/dist/index.js +1 -317
  21. package/dist/multicall-BCUHt_9t.d.ts +148 -0
  22. package/dist/offlineRecovery-BfgccnFf.d.ts +1232 -0
  23. package/dist/plugins/edge.d.ts +4 -0
  24. package/dist/plugins/edge.js +1 -0
  25. package/dist/quoteError-CmTH5Qm2.d.ts +24 -0
  26. package/dist/src-Cy3oxYgV.js +94 -0
  27. package/dist/sushiswapV3-D3h41LNZ.d.ts +723 -0
  28. package/dist/tokenTypes-D812t5L9.d.ts +31 -0
  29. package/dist/types-BK0WkVnx.d.ts +2161 -0
  30. package/dist/useViewManager-BeUH_k1s.d.ts +1224 -0
  31. package/dist/{actions/utils.d.ts → utils-KPnWBA9x.d.ts} +77 -52
  32. package/dist/widget/connect-showcase.d.ts +8 -0
  33. package/dist/widget/connect-showcase.js +1 -0
  34. package/dist/widget/index.d.ts +5 -21
  35. package/dist/widget/index.js +1 -33
  36. package/package.json +42 -42
  37. package/dist/_virtual/_@oxc-project_runtime@0.126.0/helpers/defineProperty.js +0 -12
  38. package/dist/_virtual/_@oxc-project_runtime@0.126.0/helpers/toPrimitive.js +0 -14
  39. package/dist/_virtual/_@oxc-project_runtime@0.126.0/helpers/toPropertyKey.js +0 -9
  40. package/dist/_virtual/_@oxc-project_runtime@0.126.0/helpers/typeof.js +0 -11
  41. package/dist/abi.d.ts +0 -37
  42. package/dist/abi.d.ts.map +0 -1
  43. package/dist/abis/erc20.d.ts +0 -19
  44. package/dist/abis/erc20.d.ts.map +0 -1
  45. package/dist/abis/requireUtils.d.ts +0 -134
  46. package/dist/abis/requireUtils.d.ts.map +0 -1
  47. package/dist/abis/requireUtils.js +0 -168
  48. package/dist/abis/trailsHydrate.d.ts +0 -7
  49. package/dist/abis/trailsHydrate.d.ts.map +0 -1
  50. package/dist/abis/trailsRouter.d.ts +0 -30
  51. package/dist/abis/trailsRouter.d.ts.map +0 -1
  52. package/dist/abis/trailsRouter.js +0 -66
  53. package/dist/abis/trailsSweep.d.ts +0 -7
  54. package/dist/abis/trailsSweep.d.ts.map +0 -1
  55. package/dist/abortController.d.ts +0 -8
  56. package/dist/abortController.d.ts.map +0 -1
  57. package/dist/abortController.js +0 -23
  58. package/dist/actions/actionBuilder.d.ts +0 -424
  59. package/dist/actions/actionBuilder.d.ts.map +0 -1
  60. package/dist/actions/actionBuilder.js +0 -173
  61. package/dist/actions/constants.d.ts +0 -1809
  62. package/dist/actions/constants.d.ts.map +0 -1
  63. package/dist/actions/constants.js +0 -37
  64. package/dist/actions/custom-integrations/sushiswapV3/addresses.d.ts +0 -4
  65. package/dist/actions/custom-integrations/sushiswapV3/addresses.d.ts.map +0 -1
  66. package/dist/actions/custom-integrations/sushiswapV3/addresses.js +0 -33
  67. package/dist/actions/custom-integrations/sushiswapV3/calldata.d.ts +0 -4
  68. package/dist/actions/custom-integrations/sushiswapV3/calldata.d.ts.map +0 -1
  69. package/dist/actions/custom-integrations/sushiswapV3/calldata.js +0 -124
  70. package/dist/actions/custom-integrations/sushiswapV3/calls.d.ts +0 -28
  71. package/dist/actions/custom-integrations/sushiswapV3/calls.d.ts.map +0 -1
  72. package/dist/actions/custom-integrations/sushiswapV3/calls.js +0 -27
  73. package/dist/actions/custom-integrations/sushiswapV3/helpers.d.ts +0 -15
  74. package/dist/actions/custom-integrations/sushiswapV3/helpers.d.ts.map +0 -1
  75. package/dist/actions/custom-integrations/sushiswapV3/helpers.js +0 -27
  76. package/dist/actions/custom-integrations/sushiswapV3/sushiswapV3.d.ts +0 -9
  77. package/dist/actions/custom-integrations/sushiswapV3/sushiswapV3.d.ts.map +0 -1
  78. package/dist/actions/custom-integrations/sushiswapV3/sushiswapV3.js +0 -246
  79. package/dist/actions/custom-integrations/sushiswapV3/types.d.ts +0 -95
  80. package/dist/actions/custom-integrations/sushiswapV3/types.d.ts.map +0 -1
  81. package/dist/actions/custom-integrations/uniswapV3/addresses.d.ts +0 -4
  82. package/dist/actions/custom-integrations/uniswapV3/addresses.d.ts.map +0 -1
  83. package/dist/actions/custom-integrations/uniswapV3/addresses.js +0 -33
  84. package/dist/actions/custom-integrations/uniswapV3/calldata.d.ts +0 -4
  85. package/dist/actions/custom-integrations/uniswapV3/calldata.d.ts.map +0 -1
  86. package/dist/actions/custom-integrations/uniswapV3/calldata.js +0 -190
  87. package/dist/actions/custom-integrations/uniswapV3/calls.d.ts +0 -50
  88. package/dist/actions/custom-integrations/uniswapV3/calls.d.ts.map +0 -1
  89. package/dist/actions/custom-integrations/uniswapV3/calls.js +0 -27
  90. package/dist/actions/custom-integrations/uniswapV3/helpers.d.ts +0 -23
  91. package/dist/actions/custom-integrations/uniswapV3/helpers.d.ts.map +0 -1
  92. package/dist/actions/custom-integrations/uniswapV3/helpers.js +0 -27
  93. package/dist/actions/custom-integrations/uniswapV3/types.d.ts +0 -90
  94. package/dist/actions/custom-integrations/uniswapV3/types.d.ts.map +0 -1
  95. package/dist/actions/custom-integrations/uniswapV3/uniswapV3.d.ts +0 -9
  96. package/dist/actions/custom-integrations/uniswapV3/uniswapV3.d.ts.map +0 -1
  97. package/dist/actions/custom-integrations/uniswapV3/uniswapV3.js +0 -244
  98. package/dist/actions/destinationCalls.d.ts +0 -17
  99. package/dist/actions/destinationCalls.d.ts.map +0 -1
  100. package/dist/actions/destinationCalls.js +0 -43
  101. package/dist/actions/dynamic.d.ts +0 -97
  102. package/dist/actions/dynamic.d.ts.map +0 -1
  103. package/dist/actions/dynamic.js +0 -27
  104. package/dist/actions/hooks/useEarnBalances.d.ts +0 -53
  105. package/dist/actions/hooks/useEarnBalances.d.ts.map +0 -1
  106. package/dist/actions/hooks/useEarnBalances.js +0 -37
  107. package/dist/actions/hooks/useEarnMarkets.d.ts +0 -29
  108. package/dist/actions/hooks/useEarnMarkets.d.ts.map +0 -1
  109. package/dist/actions/hooks/useEarnMarkets.js +0 -30
  110. package/dist/actions/hooks/useEarnProviders.d.ts +0 -18
  111. package/dist/actions/hooks/useEarnProviders.d.ts.map +0 -1
  112. package/dist/actions/hooks/useEarnProviders.js +0 -25
  113. package/dist/actions/hooks/useResolveActions.d.ts +0 -19
  114. package/dist/actions/hooks/useResolveActions.d.ts.map +0 -1
  115. package/dist/actions/hooks/useResolveActions.js +0 -56
  116. package/dist/actions/index.d.ts.map +0 -1
  117. package/dist/actions/resolveActions.d.ts +0 -13
  118. package/dist/actions/resolveActions.d.ts.map +0 -1
  119. package/dist/actions/resolveActions.js +0 -267
  120. package/dist/actions/resolvers.d.ts +0 -29
  121. package/dist/actions/resolvers.d.ts.map +0 -1
  122. package/dist/actions/resolvers.js +0 -161
  123. package/dist/actions/types/earn.d.ts +0 -51
  124. package/dist/actions/types/earn.d.ts.map +0 -1
  125. package/dist/actions/types.d.ts +0 -319
  126. package/dist/actions/types.d.ts.map +0 -1
  127. package/dist/actions/types.js +0 -24
  128. package/dist/actions/utils.d.ts.map +0 -1
  129. package/dist/actions/utils.js +0 -203
  130. package/dist/adapters/evmAdapter.d.ts +0 -10
  131. package/dist/adapters/evmAdapter.d.ts.map +0 -1
  132. package/dist/adapters/evmAdapter.js +0 -28
  133. package/dist/analytics/hooks/useWidgetAnalytics.d.ts +0 -8
  134. package/dist/analytics/hooks/useWidgetAnalytics.d.ts.map +0 -1
  135. package/dist/analytics/hooks/useWidgetAnalytics.js +0 -41
  136. package/dist/analytics.d.ts +0 -715
  137. package/dist/analytics.d.ts.map +0 -1
  138. package/dist/analytics.js +0 -881
  139. package/dist/chainRegistry.d.ts +0 -6
  140. package/dist/chainRegistry.d.ts.map +0 -1
  141. package/dist/chainRegistry.js +0 -47
  142. package/dist/chainResolution.d.ts +0 -6
  143. package/dist/chainResolution.d.ts.map +0 -1
  144. package/dist/chainResolution.js +0 -53
  145. package/dist/chainRpcClient.d.ts +0 -8
  146. package/dist/chainRpcClient.d.ts.map +0 -1
  147. package/dist/chainRpcClient.js +0 -67
  148. package/dist/chainSwitch.d.ts +0 -7
  149. package/dist/chainSwitch.d.ts.map +0 -1
  150. package/dist/chainSwitch.js +0 -66
  151. package/dist/chains.d.ts +0 -59
  152. package/dist/chains.d.ts.map +0 -1
  153. package/dist/chains.js +0 -152
  154. package/dist/committedIntentStore.d.ts +0 -5
  155. package/dist/committedIntentStore.d.ts.map +0 -1
  156. package/dist/committedIntentStore.js +0 -52
  157. package/dist/config.d.ts +0 -2
  158. package/dist/config.d.ts.map +0 -1
  159. package/dist/configDefaults.d.ts +0 -7
  160. package/dist/configDefaults.d.ts.map +0 -1
  161. package/dist/configDefaults.js +0 -9
  162. package/dist/configStore.d.ts +0 -31
  163. package/dist/configStore.d.ts.map +0 -1
  164. package/dist/configStore.js +0 -53
  165. package/dist/constants.d.ts +0 -176
  166. package/dist/constants.d.ts.map +0 -1
  167. package/dist/constants.js +0 -184
  168. package/dist/contractConstants.d.ts +0 -8
  169. package/dist/contractConstants.d.ts.map +0 -1
  170. package/dist/contractConstants.js +0 -9
  171. package/dist/contractUtils.d.ts +0 -6
  172. package/dist/contractUtils.d.ts.map +0 -1
  173. package/dist/contractUtils.js +0 -19
  174. package/dist/cssUtils.d.ts +0 -2
  175. package/dist/cssUtils.d.ts.map +0 -1
  176. package/dist/cssUtils.js +0 -7
  177. package/dist/customChains.d.ts +0 -24
  178. package/dist/customChains.d.ts.map +0 -1
  179. package/dist/customChains.js +0 -20
  180. package/dist/customTokens.d.ts +0 -12
  181. package/dist/customTokens.d.ts.map +0 -1
  182. package/dist/customTokens.js +0 -64
  183. package/dist/decoders.d.ts +0 -69
  184. package/dist/decoders.d.ts.map +0 -1
  185. package/dist/decoders.js +0 -181
  186. package/dist/ens.d.ts +0 -20
  187. package/dist/ens.d.ts.map +0 -1
  188. package/dist/ens.js +0 -92
  189. package/dist/error.d.ts +0 -97
  190. package/dist/error.d.ts.map +0 -1
  191. package/dist/error.js +0 -298
  192. package/dist/estimate.d.ts +0 -78
  193. package/dist/estimate.d.ts.map +0 -1
  194. package/dist/estimate.js +0 -147
  195. package/dist/explorer.d.ts +0 -12
  196. package/dist/explorer.d.ts.map +0 -1
  197. package/dist/explorer.js +0 -15
  198. package/dist/fees.d.ts +0 -65
  199. package/dist/fees.d.ts.map +0 -1
  200. package/dist/fees.js +0 -165
  201. package/dist/gasless.d.ts +0 -123
  202. package/dist/gasless.d.ts.map +0 -1
  203. package/dist/gasless.js +0 -314
  204. package/dist/hooks/index.d.ts.map +0 -1
  205. package/dist/hooks/persistedToken.d.ts +0 -22
  206. package/dist/hooks/persistedToken.d.ts.map +0 -1
  207. package/dist/hooks/persistedToken.js +0 -65
  208. package/dist/hooks/prepareTrailsSendTransactionDestination.d.ts +0 -26
  209. package/dist/hooks/prepareTrailsSendTransactionDestination.d.ts.map +0 -1
  210. package/dist/hooks/prepareTrailsSendTransactionDestination.js +0 -33
  211. package/dist/hooks/useAmountUsd.d.ts +0 -12
  212. package/dist/hooks/useAmountUsd.d.ts.map +0 -1
  213. package/dist/hooks/useAmountUsd.js +0 -21
  214. package/dist/hooks/useBalanceVisible.d.ts +0 -15
  215. package/dist/hooks/useBalanceVisible.d.ts.map +0 -1
  216. package/dist/hooks/useBalanceVisible.js +0 -46
  217. package/dist/hooks/useBluvoTokenList.d.ts +0 -13
  218. package/dist/hooks/useBluvoTokenList.d.ts.map +0 -1
  219. package/dist/hooks/useBluvoTokenList.js +0 -57
  220. package/dist/hooks/useChainFilter.d.ts +0 -14
  221. package/dist/hooks/useChainFilter.d.ts.map +0 -1
  222. package/dist/hooks/useChainFilter.js +0 -24
  223. package/dist/hooks/useCheckout.d.ts +0 -80
  224. package/dist/hooks/useCheckout.d.ts.map +0 -1
  225. package/dist/hooks/useCheckout.js +0 -118
  226. package/dist/hooks/useClickTracking.d.ts +0 -12
  227. package/dist/hooks/useClickTracking.d.ts.map +0 -1
  228. package/dist/hooks/useClickTracking.js +0 -37
  229. package/dist/hooks/useCombinedHistory.d.ts +0 -50
  230. package/dist/hooks/useCombinedHistory.d.ts.map +0 -1
  231. package/dist/hooks/useCombinedHistory.js +0 -168
  232. package/dist/hooks/useCustomTokenSearch.d.ts +0 -28
  233. package/dist/hooks/useCustomTokenSearch.d.ts.map +0 -1
  234. package/dist/hooks/useCustomTokenSearch.js +0 -165
  235. package/dist/hooks/useDebounce.d.ts +0 -10
  236. package/dist/hooks/useDebounce.d.ts.map +0 -1
  237. package/dist/hooks/useDebounce.js +0 -15
  238. package/dist/hooks/useDebugScreens.d.ts +0 -17
  239. package/dist/hooks/useDebugScreens.d.ts.map +0 -1
  240. package/dist/hooks/useDebugScreens.js +0 -412
  241. package/dist/hooks/useDefaultDestinationToken.d.ts +0 -20
  242. package/dist/hooks/useDefaultDestinationToken.d.ts.map +0 -1
  243. package/dist/hooks/useDefaultDestinationToken.js +0 -60
  244. package/dist/hooks/useDefaultOriginToken.d.ts +0 -26
  245. package/dist/hooks/useDefaultOriginToken.d.ts.map +0 -1
  246. package/dist/hooks/useDefaultOriginToken.js +0 -120
  247. package/dist/hooks/useDepositMonitor.d.ts +0 -20
  248. package/dist/hooks/useDepositMonitor.d.ts.map +0 -1
  249. package/dist/hooks/useDepositMonitor.js +0 -54
  250. package/dist/hooks/useDestinationSelectedToken.d.ts +0 -38
  251. package/dist/hooks/useDestinationSelectedToken.d.ts.map +0 -1
  252. package/dist/hooks/useDestinationSelectedToken.js +0 -178
  253. package/dist/hooks/useDisplayCurrencyPreference.d.ts +0 -15
  254. package/dist/hooks/useDisplayCurrencyPreference.d.ts.map +0 -1
  255. package/dist/hooks/useDisplayCurrencyPreference.js +0 -57
  256. package/dist/hooks/useEarnPool.d.ts +0 -12
  257. package/dist/hooks/useEarnPool.d.ts.map +0 -1
  258. package/dist/hooks/useEarnPool.js +0 -21
  259. package/dist/hooks/useEffectiveFundBalance.d.ts +0 -28
  260. package/dist/hooks/useEffectiveFundBalance.d.ts.map +0 -1
  261. package/dist/hooks/useEffectiveFundBalance.js +0 -24
  262. package/dist/hooks/useExchangeFundingSelection.d.ts +0 -17
  263. package/dist/hooks/useExchangeFundingSelection.d.ts.map +0 -1
  264. package/dist/hooks/useExchangeFundingSelection.js +0 -25
  265. package/dist/hooks/useExecutingIntentsCount.d.ts +0 -15
  266. package/dist/hooks/useExecutingIntentsCount.d.ts.map +0 -1
  267. package/dist/hooks/useExternalFundingReceiptSync.d.ts +0 -11
  268. package/dist/hooks/useExternalFundingReceiptSync.d.ts.map +0 -1
  269. package/dist/hooks/useExternalFundingReceiptSync.js +0 -32
  270. package/dist/hooks/useFiatOnRampCurrencies.d.ts +0 -15
  271. package/dist/hooks/useFiatOnRampCurrencies.d.ts.map +0 -1
  272. package/dist/hooks/useFiatOnRampCurrencies.js +0 -14
  273. package/dist/hooks/useFiatSelectedCurrency.d.ts +0 -19
  274. package/dist/hooks/useFiatSelectedCurrency.d.ts.map +0 -1
  275. package/dist/hooks/useFiatSelectedCurrency.js +0 -55
  276. package/dist/hooks/useGetIntent.d.ts +0 -19
  277. package/dist/hooks/useGetIntent.d.ts.map +0 -1
  278. package/dist/hooks/useGetIntent.js +0 -26
  279. package/dist/hooks/useIntentReceiptBalances.d.ts +0 -16
  280. package/dist/hooks/useIntentReceiptBalances.d.ts.map +0 -1
  281. package/dist/hooks/useIntentReceiptBalances.js +0 -77
  282. package/dist/hooks/useIntentTransactionHistory.d.ts +0 -25
  283. package/dist/hooks/useIntentTransactionHistory.d.ts.map +0 -1
  284. package/dist/hooks/useIntentTransactionHistory.js +0 -357
  285. package/dist/hooks/useIsMobile.d.ts +0 -5
  286. package/dist/hooks/useIsMobile.d.ts.map +0 -1
  287. package/dist/hooks/useIsMobile.js +0 -21
  288. package/dist/hooks/useLocalePreference.d.ts +0 -21
  289. package/dist/hooks/useLocalePreference.d.ts.map +0 -1
  290. package/dist/hooks/useLocalePreference.js +0 -193
  291. package/dist/hooks/useMeldTransactionHistory.d.ts +0 -49
  292. package/dist/hooks/useMeldTransactionHistory.d.ts.map +0 -1
  293. package/dist/hooks/useMeldTransactionHistory.js +0 -71
  294. package/dist/hooks/useMeldTransactionStatus.d.ts +0 -61
  295. package/dist/hooks/useMeldTransactionStatus.d.ts.map +0 -1
  296. package/dist/hooks/useMeldTransactionStatus.js +0 -284
  297. package/dist/hooks/useOnRampCountryDefaults.d.ts +0 -18
  298. package/dist/hooks/useOnRampCountryDefaults.d.ts.map +0 -1
  299. package/dist/hooks/useOnRampCountryDefaults.js +0 -20
  300. package/dist/hooks/useOnRampPaymentMethods.d.ts +0 -15
  301. package/dist/hooks/useOnRampPaymentMethods.d.ts.map +0 -1
  302. package/dist/hooks/useOnRampPaymentMethods.js +0 -27
  303. package/dist/hooks/useOnRampProviderWidget.d.ts +0 -40
  304. package/dist/hooks/useOnRampProviderWidget.d.ts.map +0 -1
  305. package/dist/hooks/useOnRampProviderWidget.js +0 -70
  306. package/dist/hooks/useOnRampQuote.d.ts +0 -38
  307. package/dist/hooks/useOnRampQuote.d.ts.map +0 -1
  308. package/dist/hooks/useOnRampQuote.js +0 -159
  309. package/dist/hooks/useOnRampTransactionStatus.d.ts +0 -73
  310. package/dist/hooks/useOnRampTransactionStatus.d.ts.map +0 -1
  311. package/dist/hooks/useOriginSelectedToken.d.ts +0 -22
  312. package/dist/hooks/useOriginSelectedToken.d.ts.map +0 -1
  313. package/dist/hooks/useOriginSelectedToken.js +0 -127
  314. package/dist/hooks/usePayMessage.d.ts +0 -35
  315. package/dist/hooks/usePayMessage.d.ts.map +0 -1
  316. package/dist/hooks/usePayMessage.js +0 -333
  317. package/dist/hooks/usePriceImpactWarning.d.ts +0 -8
  318. package/dist/hooks/usePriceImpactWarning.d.ts.map +0 -1
  319. package/dist/hooks/usePriceImpactWarning.js +0 -9
  320. package/dist/hooks/useQuote.d.ts +0 -611
  321. package/dist/hooks/useQuote.d.ts.map +0 -1
  322. package/dist/hooks/useQuote.js +0 -590
  323. package/dist/hooks/useRecentChains.d.ts +0 -7
  324. package/dist/hooks/useRecentChains.d.ts.map +0 -1
  325. package/dist/hooks/useRecentChains.js +0 -52
  326. package/dist/hooks/useRecentTokens.d.ts +0 -7
  327. package/dist/hooks/useRecentTokens.d.ts.map +0 -1
  328. package/dist/hooks/useRecentTokens.js +0 -82
  329. package/dist/hooks/useRecipients.d.ts +0 -17
  330. package/dist/hooks/useRecipients.d.ts.map +0 -1
  331. package/dist/hooks/useRecipients.js +0 -75
  332. package/dist/hooks/useSelectedFeeOption.d.ts +0 -31
  333. package/dist/hooks/useSelectedFeeOption.d.ts.map +0 -1
  334. package/dist/hooks/useSelectedFeeOption.js +0 -113
  335. package/dist/hooks/useSelectedFundMethod.d.ts +0 -73
  336. package/dist/hooks/useSelectedFundMethod.d.ts.map +0 -1
  337. package/dist/hooks/useSelectedFundMethod.js +0 -51
  338. package/dist/hooks/useSelectedRecipient.d.ts +0 -12
  339. package/dist/hooks/useSelectedRecipient.d.ts.map +0 -1
  340. package/dist/hooks/useSelectedRecipient.js +0 -39
  341. package/dist/hooks/useSendForm.d.ts +0 -141
  342. package/dist/hooks/useSendForm.d.ts.map +0 -1
  343. package/dist/hooks/useSendForm.js +0 -595
  344. package/dist/hooks/useSwapAmount.d.ts +0 -13
  345. package/dist/hooks/useSwapAmount.d.ts.map +0 -1
  346. package/dist/hooks/useSwapAmount.js +0 -24
  347. package/dist/hooks/useSwapState.d.ts +0 -21
  348. package/dist/hooks/useSwapState.d.ts.map +0 -1
  349. package/dist/hooks/useSwapState.js +0 -44
  350. package/dist/hooks/useTargetAmount.d.ts +0 -6
  351. package/dist/hooks/useTargetAmount.d.ts.map +0 -1
  352. package/dist/hooks/useTargetAmount.js +0 -17
  353. package/dist/hooks/useTheme.d.ts +0 -14
  354. package/dist/hooks/useTheme.d.ts.map +0 -1
  355. package/dist/hooks/useTheme.js +0 -47
  356. package/dist/hooks/useTokenList.d.ts +0 -43
  357. package/dist/hooks/useTokenList.d.ts.map +0 -1
  358. package/dist/hooks/useTokenList.js +0 -456
  359. package/dist/hooks/useTrailsSendTransaction.d.ts +0 -139
  360. package/dist/hooks/useTrailsSendTransaction.d.ts.map +0 -1
  361. package/dist/hooks/useTrailsSendTransaction.js +0 -418
  362. package/dist/hooks/useViewManager.d.ts +0 -89
  363. package/dist/hooks/useViewManager.d.ts.map +0 -1
  364. package/dist/hooks/useViewManager.js +0 -274
  365. package/dist/hooks/useWalletConnectionContext.d.ts +0 -26
  366. package/dist/hooks/useWalletConnectionContext.d.ts.map +0 -1
  367. package/dist/hooks/useWalletConnectionContext.js +0 -53
  368. package/dist/hooks/useWidgetProps.d.ts +0 -13
  369. package/dist/hooks/useWidgetProps.d.ts.map +0 -1
  370. package/dist/hooks/useWidgetProps.js +0 -18
  371. package/dist/hydrate/builder.d.ts +0 -131
  372. package/dist/hydrate/builder.d.ts.map +0 -1
  373. package/dist/hydrate/builder.js +0 -210
  374. package/dist/hydrate/constants.d.ts +0 -13
  375. package/dist/hydrate/constants.d.ts.map +0 -1
  376. package/dist/hydrate/constants.js +0 -5
  377. package/dist/hydrate/encodeExecute.d.ts +0 -73
  378. package/dist/hydrate/encodeExecute.d.ts.map +0 -1
  379. package/dist/hydrate/encodeExecute.js +0 -60
  380. package/dist/hydrate/index.d.ts.map +0 -1
  381. package/dist/hydrate/multicall.d.ts +0 -69
  382. package/dist/hydrate/multicall.d.ts.map +0 -1
  383. package/dist/hydrate/multicall.js +0 -167
  384. package/dist/hydrate/payload.d.ts +0 -38
  385. package/dist/hydrate/payload.d.ts.map +0 -1
  386. package/dist/hydrate/payload.js +0 -26
  387. package/dist/hydrate/selectors.d.ts +0 -28
  388. package/dist/hydrate/selectors.d.ts.map +0 -1
  389. package/dist/hydrate/selectors.js +0 -326
  390. package/dist/hydrate/source.d.ts +0 -11
  391. package/dist/hydrate/source.d.ts.map +0 -1
  392. package/dist/hydrate/source.js +0 -19
  393. package/dist/hydrate/types.d.ts +0 -21
  394. package/dist/hydrate/types.d.ts.map +0 -1
  395. package/dist/hydrate/utils.d.ts +0 -8
  396. package/dist/hydrate/utils.d.ts.map +0 -1
  397. package/dist/hydrate/utils.js +0 -23
  398. package/dist/index.d.ts.map +0 -1
  399. package/dist/indexerClient.d.ts +0 -23
  400. package/dist/indexerClient.d.ts.map +0 -1
  401. package/dist/indexerClient.js +0 -40
  402. package/dist/intentConfigStore.d.ts +0 -8
  403. package/dist/intentConfigStore.d.ts.map +0 -1
  404. package/dist/intentConfigStore.js +0 -40
  405. package/dist/intentProtocolApi.d.ts +0 -11
  406. package/dist/intentProtocolApi.d.ts.map +0 -1
  407. package/dist/intentProtocolApi.js +0 -11
  408. package/dist/intentProtocolEncoding.d.ts +0 -30
  409. package/dist/intentProtocolEncoding.d.ts.map +0 -1
  410. package/dist/intentProtocolEncoding.js +0 -114
  411. package/dist/intentProtocolResolver.d.ts +0 -28
  412. package/dist/intentProtocolResolver.d.ts.map +0 -1
  413. package/dist/intentProtocolResolver.js +0 -34
  414. package/dist/intentReceiptMonitor.d.ts +0 -24
  415. package/dist/intentReceiptMonitor.d.ts.map +0 -1
  416. package/dist/intentReceiptMonitor.js +0 -30
  417. package/dist/intentReceiptPoller.d.ts +0 -69
  418. package/dist/intentReceiptPoller.d.ts.map +0 -1
  419. package/dist/intentReceiptPoller.js +0 -162
  420. package/dist/intentValidation.d.ts +0 -5
  421. package/dist/intentValidation.d.ts.map +0 -1
  422. package/dist/intentValidation.js +0 -19
  423. package/dist/intents.d.ts +0 -148
  424. package/dist/intents.d.ts.map +0 -1
  425. package/dist/intents.js +0 -391
  426. package/dist/keyMachineClient.d.ts +0 -9
  427. package/dist/keyMachineClient.d.ts.map +0 -1
  428. package/dist/keyMachineClient.js +0 -13
  429. package/dist/keymachine/index.d.ts +0 -34
  430. package/dist/keymachine/index.d.ts.map +0 -1
  431. package/dist/keymachine/index.js +0 -92
  432. package/dist/keymachine/key-machine.gen.d.ts +0 -461
  433. package/dist/keymachine/key-machine.gen.d.ts.map +0 -1
  434. package/dist/keymachine/key-machine.gen.js +0 -164
  435. package/dist/localeUtils.d.ts +0 -46
  436. package/dist/localeUtils.d.ts.map +0 -1
  437. package/dist/localeUtils.js +0 -60
  438. package/dist/logger/index.d.ts +0 -16
  439. package/dist/logger/index.d.ts.map +0 -1
  440. package/dist/logger/index.js +0 -57
  441. package/dist/logger/useSyncLoggerDebug.d.ts +0 -2
  442. package/dist/logger/useSyncLoggerDebug.d.ts.map +0 -1
  443. package/dist/logger/useSyncLoggerDebug.js +0 -9
  444. package/dist/logger.d.ts +0 -2
  445. package/dist/logger.d.ts.map +0 -1
  446. package/dist/meld/components/MeldCountriesList.d.ts +0 -9
  447. package/dist/meld/components/MeldCountriesList.d.ts.map +0 -1
  448. package/dist/meld/components/MeldCountriesList.js +0 -167
  449. package/dist/meld/components/MeldFundMethods.d.ts +0 -14
  450. package/dist/meld/components/MeldFundMethods.d.ts.map +0 -1
  451. package/dist/meld/components/MeldFundMethods.js +0 -163
  452. package/dist/meld/components/MeldProvidersList.d.ts +0 -11
  453. package/dist/meld/components/MeldProvidersList.d.ts.map +0 -1
  454. package/dist/meld/components/MeldProvidersList.js +0 -145
  455. package/dist/meld/components/MeldTokensList.d.ts +0 -12
  456. package/dist/meld/components/MeldTokensList.d.ts.map +0 -1
  457. package/dist/meld/components/MeldTokensList.js +0 -215
  458. package/dist/meld/components/SimpleHeader.d.ts +0 -8
  459. package/dist/meld/components/SimpleHeader.d.ts.map +0 -1
  460. package/dist/meld/components/SimpleHeader.js +0 -18
  461. package/dist/meld/utils/meld.d.ts +0 -41
  462. package/dist/meld/utils/meld.d.ts.map +0 -1
  463. package/dist/meld/utils/meld.js +0 -24
  464. package/dist/mutations.d.ts +0 -19
  465. package/dist/mutations.d.ts.map +0 -1
  466. package/dist/mutations.js +0 -91
  467. package/dist/offlineRecovery.d.ts +0 -24
  468. package/dist/offlineRecovery.d.ts.map +0 -1
  469. package/dist/offlineRecovery.js +0 -219
  470. package/dist/onramp/MeshConnectFlow.d.ts +0 -27
  471. package/dist/onramp/MeshConnectFlow.d.ts.map +0 -1
  472. package/dist/onramp/MeshConnectFlow.js +0 -41
  473. package/dist/onramp/MeshConnectIframe.d.ts +0 -22
  474. package/dist/onramp/MeshConnectIframe.d.ts.map +0 -1
  475. package/dist/onramp/MeshConnectIframe.js +0 -434
  476. package/dist/onramp/SendFromExchangeButton.d.ts +0 -16
  477. package/dist/onramp/SendFromExchangeButton.d.ts.map +0 -1
  478. package/dist/onramp/SendFromExchangeButton.js +0 -36
  479. package/dist/onramp/TrailsOnRampProvider.d.ts +0 -38
  480. package/dist/onramp/TrailsOnRampProvider.d.ts.map +0 -1
  481. package/dist/onramp/TrailsOnRampProvider.js +0 -25
  482. package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.d.ts +0 -12
  483. package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.d.ts.map +0 -1
  484. package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.js +0 -18
  485. package/dist/onramp/index.d.ts +0 -13
  486. package/dist/onramp/index.d.ts.map +0 -1
  487. package/dist/onramp/mesh/components/MeshExchangeConfirmation.d.ts +0 -10
  488. package/dist/onramp/mesh/components/MeshExchangeConfirmation.d.ts.map +0 -1
  489. package/dist/onramp/mesh/components/MeshExchangeConfirmation.js +0 -62
  490. package/dist/onramp/mesh/components/MeshExchangeIcon.d.ts +0 -13
  491. package/dist/onramp/mesh/components/MeshExchangeIcon.d.ts.map +0 -1
  492. package/dist/onramp/mesh/components/MeshExchangeIcon.js +0 -54
  493. package/dist/onramp/mesh/components/MeshExchangeSelection.d.ts +0 -12
  494. package/dist/onramp/mesh/components/MeshExchangeSelection.d.ts.map +0 -1
  495. package/dist/onramp/mesh/components/MeshExchangeSelection.js +0 -135
  496. package/dist/onramp/mesh/components/MeshSessionOptions.d.ts +0 -15
  497. package/dist/onramp/mesh/components/MeshSessionOptions.d.ts.map +0 -1
  498. package/dist/onramp/mesh/components/MeshSessionOptions.js +0 -68
  499. package/dist/onramp/mesh/hooks/useMeshAccessTokens.d.ts +0 -9
  500. package/dist/onramp/mesh/hooks/useMeshAccessTokens.d.ts.map +0 -1
  501. package/dist/onramp/mesh/hooks/useMeshAccessTokens.js +0 -38
  502. package/dist/onramp/mesh/hooks/useMeshFundingSelection.d.ts +0 -11
  503. package/dist/onramp/mesh/hooks/useMeshFundingSelection.d.ts.map +0 -1
  504. package/dist/onramp/mesh/hooks/useMeshFundingSelection.js +0 -21
  505. package/dist/onramp/mesh/hooks/useMeshOnrampFlow.d.ts +0 -71
  506. package/dist/onramp/mesh/hooks/useMeshOnrampFlow.d.ts.map +0 -1
  507. package/dist/onramp/mesh/hooks/useMeshOnrampFlow.js +0 -168
  508. package/dist/onramp/mesh/hooks/useMeshOnrampSessionState.d.ts +0 -32
  509. package/dist/onramp/mesh/hooks/useMeshOnrampSessionState.d.ts.map +0 -1
  510. package/dist/onramp/mesh/hooks/useMeshOnrampSessionState.js +0 -28
  511. package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.d.ts +0 -19
  512. package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.d.ts.map +0 -1
  513. package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.js +0 -57
  514. package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.d.ts +0 -15
  515. package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.d.ts.map +0 -1
  516. package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.js +0 -45
  517. package/dist/onramp/mesh/hooks/useMeshSessionStorage.d.ts +0 -7
  518. package/dist/onramp/mesh/hooks/useMeshSessionStorage.d.ts.map +0 -1
  519. package/dist/onramp/mesh/hooks/useMeshSessionStorage.js +0 -20
  520. package/dist/onramp/meshSessionStorage.d.ts +0 -13
  521. package/dist/onramp/meshSessionStorage.d.ts.map +0 -1
  522. package/dist/onramp/meshSessionStorage.js +0 -165
  523. package/dist/onramp/meshconnect.d.ts +0 -32
  524. package/dist/onramp/meshconnect.d.ts.map +0 -1
  525. package/dist/onramp/meshconnect.js +0 -124
  526. package/dist/onramp/trailsOnramp.d.ts +0 -32
  527. package/dist/onramp/trailsOnramp.d.ts.map +0 -1
  528. package/dist/onramp/trailsOnramp.js +0 -64
  529. package/dist/onramp-client/index.d.ts +0 -13
  530. package/dist/onramp-client/index.d.ts.map +0 -1
  531. package/dist/onramp-client/index.js +0 -19
  532. package/dist/onrampClient.d.ts +0 -10
  533. package/dist/onrampClient.d.ts.map +0 -1
  534. package/dist/onrampClient.js +0 -31
  535. package/dist/package.js +0 -123
  536. package/dist/placeholder.d.ts +0 -142
  537. package/dist/placeholder.d.ts.map +0 -1
  538. package/dist/placeholder.js +0 -95
  539. package/dist/poolUtils.d.ts +0 -16
  540. package/dist/poolUtils.d.ts.map +0 -1
  541. package/dist/poolUtils.js +0 -87
  542. package/dist/pools.d.ts +0 -33
  543. package/dist/pools.d.ts.map +0 -1
  544. package/dist/pools.js +0 -77
  545. package/dist/prepareSend.d.ts +0 -12
  546. package/dist/prepareSend.d.ts.map +0 -1
  547. package/dist/prepareSend.js +0 -207
  548. package/dist/query/QueryProvider.d.ts +0 -9
  549. package/dist/query/QueryProvider.d.ts.map +0 -1
  550. package/dist/query/QueryProvider.js +0 -13
  551. package/dist/query/balance.fetchers.d.ts +0 -116
  552. package/dist/query/balance.fetchers.d.ts.map +0 -1
  553. package/dist/query/balance.fetchers.js +0 -289
  554. package/dist/query/balance.hooks.d.ts +0 -80
  555. package/dist/query/balance.hooks.d.ts.map +0 -1
  556. package/dist/query/balance.hooks.js +0 -123
  557. package/dist/query/balance.queries.d.ts +0 -93
  558. package/dist/query/balance.queries.d.ts.map +0 -1
  559. package/dist/query/balance.queries.js +0 -142
  560. package/dist/query/chains.hooks.d.ts +0 -5
  561. package/dist/query/chains.hooks.d.ts.map +0 -1
  562. package/dist/query/chains.hooks.js +0 -40
  563. package/dist/query/chains.queries.d.ts +0 -16
  564. package/dist/query/chains.queries.d.ts.map +0 -1
  565. package/dist/query/chains.queries.js +0 -17
  566. package/dist/query/client.d.ts +0 -16
  567. package/dist/query/client.d.ts.map +0 -1
  568. package/dist/query/client.js +0 -15
  569. package/dist/query/fiat.fetchers.d.ts +0 -11
  570. package/dist/query/fiat.fetchers.d.ts.map +0 -1
  571. package/dist/query/fiat.fetchers.js +0 -10
  572. package/dist/query/fiat.hooks.d.ts +0 -18
  573. package/dist/query/fiat.hooks.d.ts.map +0 -1
  574. package/dist/query/fiat.hooks.js +0 -20
  575. package/dist/query/fiat.queries.d.ts +0 -24
  576. package/dist/query/fiat.queries.d.ts.map +0 -1
  577. package/dist/query/fiat.queries.js +0 -39
  578. package/dist/query/geo.fetchers.d.ts +0 -5
  579. package/dist/query/geo.fetchers.d.ts.map +0 -1
  580. package/dist/query/geo.fetchers.js +0 -61
  581. package/dist/query/geo.hooks.d.ts +0 -5
  582. package/dist/query/geo.hooks.d.ts.map +0 -1
  583. package/dist/query/geo.hooks.js +0 -17
  584. package/dist/query/geo.queries.d.ts +0 -22
  585. package/dist/query/geo.queries.d.ts.map +0 -1
  586. package/dist/query/geo.queries.js +0 -33
  587. package/dist/query/helpers.d.ts +0 -18
  588. package/dist/query/helpers.d.ts.map +0 -1
  589. package/dist/query/helpers.js +0 -31
  590. package/dist/query/intentProtocol.queries.d.ts +0 -32
  591. package/dist/query/intentProtocol.queries.d.ts.map +0 -1
  592. package/dist/query/intentProtocol.queries.js +0 -41
  593. package/dist/query/meld.fetchers.d.ts +0 -19
  594. package/dist/query/meld.fetchers.d.ts.map +0 -1
  595. package/dist/query/meld.fetchers.js +0 -41
  596. package/dist/query/meld.hooks.d.ts +0 -4
  597. package/dist/query/meld.hooks.d.ts.map +0 -1
  598. package/dist/query/meld.hooks.js +0 -15
  599. package/dist/query/meld.queries.d.ts +0 -61
  600. package/dist/query/meld.queries.d.ts.map +0 -1
  601. package/dist/query/meld.queries.js +0 -97
  602. package/dist/query/persister.d.ts +0 -9
  603. package/dist/query/persister.d.ts.map +0 -1
  604. package/dist/query/persister.js +0 -13
  605. package/dist/query/price.fetchers.d.ts +0 -15
  606. package/dist/query/price.fetchers.d.ts.map +0 -1
  607. package/dist/query/price.fetchers.js +0 -26
  608. package/dist/query/price.hooks.d.ts +0 -352
  609. package/dist/query/price.hooks.d.ts.map +0 -1
  610. package/dist/query/price.hooks.js +0 -35
  611. package/dist/query/price.queries.d.ts +0 -34
  612. package/dist/query/price.queries.d.ts.map +0 -1
  613. package/dist/query/price.queries.js +0 -139
  614. package/dist/query/serialization.d.ts +0 -3
  615. package/dist/query/serialization.d.ts.map +0 -1
  616. package/dist/query/serialization.js +0 -17
  617. package/dist/query/token.fetchers.d.ts +0 -13
  618. package/dist/query/token.fetchers.d.ts.map +0 -1
  619. package/dist/query/token.fetchers.js +0 -6
  620. package/dist/query/token.hooks.d.ts +0 -41
  621. package/dist/query/token.hooks.d.ts.map +0 -1
  622. package/dist/query/token.hooks.js +0 -68
  623. package/dist/query/token.queries.d.ts +0 -67
  624. package/dist/query/token.queries.d.ts.map +0 -1
  625. package/dist/query/token.queries.js +0 -144
  626. package/dist/queryParams.d.ts +0 -9
  627. package/dist/queryParams.d.ts.map +0 -1
  628. package/dist/queryParamsCore.d.ts +0 -2
  629. package/dist/queryParamsCore.d.ts.map +0 -1
  630. package/dist/queryParamsCore.js +0 -10
  631. package/dist/quoteError.d.ts +0 -22
  632. package/dist/quoteError.d.ts.map +0 -1
  633. package/dist/quoteError.js +0 -9
  634. package/dist/recover.d.ts +0 -304
  635. package/dist/recover.d.ts.map +0 -1
  636. package/dist/recover.js +0 -703
  637. package/dist/smartContractWallet.d.ts +0 -8
  638. package/dist/smartContractWallet.d.ts.map +0 -1
  639. package/dist/smartContractWallet.js +0 -11
  640. package/dist/theme.d.ts +0 -3
  641. package/dist/theme.d.ts.map +0 -1
  642. package/dist/toast.d.ts +0 -9
  643. package/dist/toast.d.ts.map +0 -1
  644. package/dist/toast.js +0 -31
  645. package/dist/tokenRegistry.d.ts +0 -50
  646. package/dist/tokenRegistry.d.ts.map +0 -1
  647. package/dist/tokenRegistry.js +0 -589
  648. package/dist/tokenTypes.d.ts +0 -29
  649. package/dist/tokenTypes.d.ts.map +0 -1
  650. package/dist/tokens.d.ts +0 -62
  651. package/dist/tokens.d.ts.map +0 -1
  652. package/dist/tokens.js +0 -370
  653. package/dist/trailsClient.d.ts +0 -11
  654. package/dist/trailsClient.d.ts.map +0 -1
  655. package/dist/trailsClient.js +0 -29
  656. package/dist/transactionIntent/constants.d.ts +0 -8
  657. package/dist/transactionIntent/constants.d.ts.map +0 -1
  658. package/dist/transactionIntent/constants.js +0 -11
  659. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +0 -55
  660. package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +0 -1
  661. package/dist/transactionIntent/deposits/depositOrchestrator.js +0 -88
  662. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +0 -31
  663. package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +0 -1
  664. package/dist/transactionIntent/deposits/gaslessDeposit.js +0 -218
  665. package/dist/transactionIntent/deposits/index.d.ts +0 -4
  666. package/dist/transactionIntent/deposits/index.d.ts.map +0 -1
  667. package/dist/transactionIntent/deposits/standardDeposit.d.ts +0 -50
  668. package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +0 -1
  669. package/dist/transactionIntent/deposits/standardDeposit.js +0 -131
  670. package/dist/transactionIntent/execution/index.d.ts +0 -2
  671. package/dist/transactionIntent/execution/index.d.ts.map +0 -1
  672. package/dist/transactionIntent/execution/transactionState.d.ts +0 -5
  673. package/dist/transactionIntent/execution/transactionState.d.ts.map +0 -1
  674. package/dist/transactionIntent/execution/transactionState.js +0 -21
  675. package/dist/transactionIntent/handlers/index.d.ts +0 -2
  676. package/dist/transactionIntent/handlers/index.d.ts.map +0 -1
  677. package/dist/transactionIntent/handlers/intentHandler.d.ts +0 -71
  678. package/dist/transactionIntent/handlers/intentHandler.d.ts.map +0 -1
  679. package/dist/transactionIntent/handlers/intentHandler.js +0 -533
  680. package/dist/transactionIntent/helpers/index.d.ts +0 -2
  681. package/dist/transactionIntent/helpers/index.d.ts.map +0 -1
  682. package/dist/transactionIntent/helpers/transactionStateHelpers.d.ts +0 -68
  683. package/dist/transactionIntent/helpers/transactionStateHelpers.d.ts.map +0 -1
  684. package/dist/transactionIntent/helpers/transactionStateHelpers.js +0 -124
  685. package/dist/transactionIntent/index.d.ts +0 -10
  686. package/dist/transactionIntent/index.d.ts.map +0 -1
  687. package/dist/transactionIntent/quote/feeExtractors.d.ts +0 -13
  688. package/dist/transactionIntent/quote/feeExtractors.d.ts.map +0 -1
  689. package/dist/transactionIntent/quote/feeExtractors.js +0 -52
  690. package/dist/transactionIntent/quote/index.d.ts +0 -4
  691. package/dist/transactionIntent/quote/index.d.ts.map +0 -1
  692. package/dist/transactionIntent/quote/normalizeQuote.d.ts +0 -44
  693. package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +0 -1
  694. package/dist/transactionIntent/quote/normalizeQuote.js +0 -214
  695. package/dist/transactionIntent/quote/quoteHelpers.d.ts +0 -6
  696. package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +0 -1
  697. package/dist/transactionIntent/quote/quoteHelpers.js +0 -47
  698. package/dist/transactionIntent/types.d.ts +0 -181
  699. package/dist/transactionIntent/types.d.ts.map +0 -1
  700. package/dist/transactionIntent/types.js +0 -38
  701. package/dist/transactionIntent/utils/balanceChecker.d.ts +0 -20
  702. package/dist/transactionIntent/utils/balanceChecker.d.ts.map +0 -1
  703. package/dist/transactionIntent/utils/balanceChecker.js +0 -55
  704. package/dist/transactionIntent/utils/index.d.ts +0 -3
  705. package/dist/transactionIntent/utils/index.d.ts.map +0 -1
  706. package/dist/transactionIntent/utils/resilientDepositTracker.d.ts +0 -25
  707. package/dist/transactionIntent/utils/resilientDepositTracker.d.ts.map +0 -1
  708. package/dist/transactionIntent/utils/resilientDepositTracker.js +0 -62
  709. package/dist/transactionIntent/utils/testnetHelpers.d.ts +0 -2
  710. package/dist/transactionIntent/utils/testnetHelpers.d.ts.map +0 -1
  711. package/dist/transactionIntent/validators.d.ts +0 -4
  712. package/dist/transactionIntent/validators.d.ts.map +0 -1
  713. package/dist/transactionIntent/validators.js +0 -11
  714. package/dist/transactions.d.ts +0 -176
  715. package/dist/transactions.d.ts.map +0 -1
  716. package/dist/transactions.js +0 -115
  717. package/dist/umd/trails.min.js +0 -1251
  718. package/dist/utils/address.d.ts +0 -28
  719. package/dist/utils/address.d.ts.map +0 -1
  720. package/dist/utils/address.js +0 -30
  721. package/dist/utils/fiat.d.ts +0 -8
  722. package/dist/utils/fiat.d.ts.map +0 -1
  723. package/dist/utils/fiat.js +0 -30
  724. package/dist/utils/format.d.ts +0 -74
  725. package/dist/utils/format.d.ts.map +0 -1
  726. package/dist/utils/format.js +0 -274
  727. package/dist/utils/localStorageGc.d.ts +0 -22
  728. package/dist/utils/localStorageGc.d.ts.map +0 -1
  729. package/dist/utils/localStorageGc.js +0 -53
  730. package/dist/utils/passthrough.d.ts +0 -46
  731. package/dist/utils/passthrough.d.ts.map +0 -1
  732. package/dist/utils/passthrough.js +0 -20
  733. package/dist/utils/time.d.ts +0 -27
  734. package/dist/utils/time.d.ts.map +0 -1
  735. package/dist/utils/time.js +0 -68
  736. package/dist/utils/tokenResolution.d.ts +0 -19
  737. package/dist/utils/tokenResolution.d.ts.map +0 -1
  738. package/dist/utils/tokenResolution.js +0 -53
  739. package/dist/utils/validation.d.ts +0 -53
  740. package/dist/utils/validation.d.ts.map +0 -1
  741. package/dist/utils/validation.js +0 -80
  742. package/dist/utils.d.ts +0 -34
  743. package/dist/utils.d.ts.map +0 -1
  744. package/dist/utils.js +0 -58
  745. package/dist/version.d.ts +0 -3
  746. package/dist/version.d.ts.map +0 -1
  747. package/dist/version.js +0 -9
  748. package/dist/widget/assets/components/Aave.d.ts +0 -8
  749. package/dist/widget/assets/components/Aave.d.ts.map +0 -1
  750. package/dist/widget/assets/components/Aave.js +0 -29
  751. package/dist/widget/assets/components/ExchangeIconBlack.d.ts +0 -8
  752. package/dist/widget/assets/components/ExchangeIconBlack.d.ts.map +0 -1
  753. package/dist/widget/assets/components/FundMethodCardBrands.d.ts +0 -8
  754. package/dist/widget/assets/components/FundMethodCardBrands.d.ts.map +0 -1
  755. package/dist/widget/assets/components/FundMethodCardBrands.js +0 -49
  756. package/dist/widget/assets/components/FundMethodExchangeBrands.d.ts +0 -8
  757. package/dist/widget/assets/components/FundMethodExchangeBrands.d.ts.map +0 -1
  758. package/dist/widget/assets/components/FundMethodExchangeBrands.js +0 -37
  759. package/dist/widget/assets/components/MetaMaskIconFox.d.ts +0 -8
  760. package/dist/widget/assets/components/MetaMaskIconFox.d.ts.map +0 -1
  761. package/dist/widget/assets/components/MetaMaskIconFoxWithMargins.d.ts +0 -8
  762. package/dist/widget/assets/components/MetaMaskIconFoxWithMargins.d.ts.map +0 -1
  763. package/dist/widget/assets/components/MetaMaskLogoBlack.d.ts +0 -8
  764. package/dist/widget/assets/components/MetaMaskLogoBlack.d.ts.map +0 -1
  765. package/dist/widget/assets/components/MetaMaskLogoWhite.d.ts +0 -8
  766. package/dist/widget/assets/components/MetaMaskLogoWhite.d.ts.map +0 -1
  767. package/dist/widget/assets/components/Morpho.d.ts +0 -8
  768. package/dist/widget/assets/components/Morpho.d.ts.map +0 -1
  769. package/dist/widget/assets/components/Morpho.js +0 -51
  770. package/dist/widget/assets/components/TrailsBlack.d.ts +0 -8
  771. package/dist/widget/assets/components/TrailsBlack.d.ts.map +0 -1
  772. package/dist/widget/assets/components/TrailsBlack.js +0 -25
  773. package/dist/widget/assets/components/TrailsWhite.d.ts +0 -8
  774. package/dist/widget/assets/components/TrailsWhite.d.ts.map +0 -1
  775. package/dist/widget/assets/components/TrailsWhite.js +0 -25
  776. package/dist/widget/assets/components/WalletChangeBlack.d.ts +0 -8
  777. package/dist/widget/assets/components/WalletChangeBlack.d.ts.map +0 -1
  778. package/dist/widget/assets/components/WalletConnectLogo.d.ts +0 -8
  779. package/dist/widget/assets/components/WalletConnectLogo.d.ts.map +0 -1
  780. package/dist/widget/assets/components/WalletConnectLogoBlack.d.ts +0 -8
  781. package/dist/widget/assets/components/WalletConnectLogoBlack.d.ts.map +0 -1
  782. package/dist/widget/assets/components/WalletConnectLogoBlue.d.ts +0 -8
  783. package/dist/widget/assets/components/WalletConnectLogoBlue.d.ts.map +0 -1
  784. package/dist/widget/assets/components/WalletConnectLogoWhite.d.ts +0 -8
  785. package/dist/widget/assets/components/WalletConnectLogoWhite.d.ts.map +0 -1
  786. package/dist/widget/assets/components/index.d.ts +0 -17
  787. package/dist/widget/assets/components/index.d.ts.map +0 -1
  788. package/dist/widget/bluvo/bluvo-lib/BluvoCache.d.ts +0 -54
  789. package/dist/widget/bluvo/bluvo-lib/BluvoCache.d.ts.map +0 -1
  790. package/dist/widget/bluvo/bluvo-lib/BluvoCache.js +0 -68
  791. package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.d.ts +0 -386
  792. package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.d.ts.map +0 -1
  793. package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.js +0 -872
  794. package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.d.ts +0 -192
  795. package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.d.ts.map +0 -1
  796. package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.js +0 -294
  797. package/dist/widget/bluvo/bluvo-lib/WebSocketClient.d.ts +0 -51
  798. package/dist/widget/bluvo/bluvo-lib/WebSocketClient.d.ts.map +0 -1
  799. package/dist/widget/bluvo/bluvo-lib/WebSocketClient.js +0 -72
  800. package/dist/widget/bluvo/bluvo-lib/WebsocketListener.d.ts +0 -19
  801. package/dist/widget/bluvo/bluvo-lib/WebsocketListener.d.ts.map +0 -1
  802. package/dist/widget/bluvo/bluvo-lib/WebsocketListener.js +0 -62
  803. package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.d.ts +0 -44
  804. package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.d.ts.map +0 -1
  805. package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.js +0 -6
  806. package/dist/widget/bluvo/bluvo-lib/api.types.d.ts +0 -49
  807. package/dist/widget/bluvo/bluvo-lib/api.types.d.ts.map +0 -1
  808. package/dist/widget/bluvo/bluvo-lib/balanceTransform.d.ts +0 -84
  809. package/dist/widget/bluvo/bluvo-lib/balanceTransform.d.ts.map +0 -1
  810. package/dist/widget/bluvo/bluvo-lib/balanceTransform.js +0 -26
  811. package/dist/widget/bluvo/bluvo-lib/createMachine.d.ts +0 -3
  812. package/dist/widget/bluvo/bluvo-lib/createMachine.d.ts.map +0 -1
  813. package/dist/widget/bluvo/bluvo-lib/createMachine.js +0 -38
  814. package/dist/widget/bluvo/bluvo-lib/error-codes.d.ts +0 -156
  815. package/dist/widget/bluvo/bluvo-lib/error-codes.d.ts.map +0 -1
  816. package/dist/widget/bluvo/bluvo-lib/error-codes.js +0 -115
  817. package/dist/widget/bluvo/bluvo-lib/flow.types.d.ts +0 -356
  818. package/dist/widget/bluvo/bluvo-lib/flow.types.d.ts.map +0 -1
  819. package/dist/widget/bluvo/bluvo-lib/flowMachine.d.ts +0 -4
  820. package/dist/widget/bluvo/bluvo-lib/flowMachine.d.ts.map +0 -1
  821. package/dist/widget/bluvo/bluvo-lib/flowMachine.js +0 -45
  822. package/dist/widget/bluvo/bluvo-lib/flowMachine.types.d.ts +0 -20
  823. package/dist/widget/bluvo/bluvo-lib/flowMachine.types.d.ts.map +0 -1
  824. package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.d.ts +0 -39
  825. package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.d.ts.map +0 -1
  826. package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.js +0 -395
  827. package/dist/widget/bluvo/bluvo-lib/index.d.ts +0 -5
  828. package/dist/widget/bluvo/bluvo-lib/index.d.ts.map +0 -1
  829. package/dist/widget/bluvo/bluvo-lib/machine.types.d.ts +0 -15
  830. package/dist/widget/bluvo/bluvo-lib/machine.types.d.ts.map +0 -1
  831. package/dist/widget/bluvo/bluvo-lib/stateHelpers.d.ts +0 -23
  832. package/dist/widget/bluvo/bluvo-lib/stateHelpers.d.ts.map +0 -1
  833. package/dist/widget/bluvo/bluvo-lib/stateHelpers.js +0 -24
  834. package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.d.ts +0 -325
  835. package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.d.ts.map +0 -1
  836. package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.js +0 -152
  837. package/dist/widget/bluvo/bluvo-lib/useFlowMachine.d.ts +0 -11
  838. package/dist/widget/bluvo/bluvo-lib/useFlowMachine.d.ts.map +0 -1
  839. package/dist/widget/bluvo/bluvo-lib/useFlowMachine.js +0 -25
  840. package/dist/widget/bluvo/bluvo-lib/useWithdrawMachine.d.ts +0 -17
  841. package/dist/widget/bluvo/bluvo-lib/useWithdrawMachine.d.ts.map +0 -1
  842. package/dist/widget/bluvo/bluvo-lib/withdrawal.types.d.ts +0 -46
  843. package/dist/widget/bluvo/bluvo-lib/withdrawal.types.d.ts.map +0 -1
  844. package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.d.ts +0 -29
  845. package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.d.ts.map +0 -1
  846. package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.js +0 -95
  847. package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.d.ts +0 -3
  848. package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.d.ts.map +0 -1
  849. package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.js +0 -137
  850. package/dist/widget/bluvo/index.d.ts +0 -2
  851. package/dist/widget/bluvo/index.d.ts.map +0 -1
  852. package/dist/widget/components/AccountActionsDropdown.d.ts +0 -4
  853. package/dist/widget/components/AccountActionsDropdown.d.ts.map +0 -1
  854. package/dist/widget/components/AccountActionsDropdown.js +0 -23
  855. package/dist/widget/components/AccountIntentTransactionHistory.d.ts +0 -9
  856. package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +0 -1
  857. package/dist/widget/components/AccountIntentTransactionHistory.js +0 -426
  858. package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts +0 -4
  859. package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts.map +0 -1
  860. package/dist/widget/components/AccountIntentTransactionHistoryButton.js +0 -23
  861. package/dist/widget/components/AccountSettings.d.ts +0 -7
  862. package/dist/widget/components/AccountSettings.d.ts.map +0 -1
  863. package/dist/widget/components/AccountSettings.js +0 -106
  864. package/dist/widget/components/AddressOrEnsName.d.ts +0 -13
  865. package/dist/widget/components/AddressOrEnsName.d.ts.map +0 -1
  866. package/dist/widget/components/AddressOrEnsName.js +0 -13
  867. package/dist/widget/components/AddressWalletIcon.d.ts +0 -8
  868. package/dist/widget/components/AddressWalletIcon.d.ts.map +0 -1
  869. package/dist/widget/components/AddressWalletIcon.js +0 -32
  870. package/dist/widget/components/AllChainsIcon.d.ts +0 -9
  871. package/dist/widget/components/AllChainsIcon.d.ts.map +0 -1
  872. package/dist/widget/components/AllChainsIcon.js +0 -98
  873. package/dist/widget/components/BluvoExchangeSelection.d.ts +0 -12
  874. package/dist/widget/components/BluvoExchangeSelection.d.ts.map +0 -1
  875. package/dist/widget/components/BluvoExchangeSelection.js +0 -131
  876. package/dist/widget/components/BluvoExchangeSelection.lazy.d.ts +0 -2
  877. package/dist/widget/components/BluvoExchangeSelection.lazy.d.ts.map +0 -1
  878. package/dist/widget/components/BluvoExchangeSelection.lazy.js +0 -4
  879. package/dist/widget/components/BluvoOnrampFlow.d.ts +0 -20
  880. package/dist/widget/components/BluvoOnrampFlow.d.ts.map +0 -1
  881. package/dist/widget/components/BluvoOnrampFlow.js +0 -1472
  882. package/dist/widget/components/BluvoOnrampFlow.lazy.d.ts +0 -2
  883. package/dist/widget/components/BluvoOnrampFlow.lazy.d.ts.map +0 -1
  884. package/dist/widget/components/BluvoOnrampFlow.lazy.js +0 -4
  885. package/dist/widget/components/ChainFilterDropdown.d.ts +0 -17
  886. package/dist/widget/components/ChainFilterDropdown.d.ts.map +0 -1
  887. package/dist/widget/components/ChainFilterDropdown.js +0 -124
  888. package/dist/widget/components/ChainImage.d.ts +0 -8
  889. package/dist/widget/components/ChainImage.d.ts.map +0 -1
  890. package/dist/widget/components/ChainImage.js +0 -24
  891. package/dist/widget/components/ChainList.d.ts +0 -9
  892. package/dist/widget/components/ChainList.d.ts.map +0 -1
  893. package/dist/widget/components/ChainList.js +0 -177
  894. package/dist/widget/components/ClassicSwap.d.ts +0 -10
  895. package/dist/widget/components/ClassicSwap.d.ts.map +0 -1
  896. package/dist/widget/components/ClassicSwap.js +0 -786
  897. package/dist/widget/components/ConfigDisplay.d.ts +0 -7
  898. package/dist/widget/components/ConfigDisplay.d.ts.map +0 -1
  899. package/dist/widget/components/ConfigDisplay.js +0 -122
  900. package/dist/widget/components/ConnectWallet.d.ts +0 -12
  901. package/dist/widget/components/ConnectWallet.d.ts.map +0 -1
  902. package/dist/widget/components/ConnectWallet.js +0 -215
  903. package/dist/widget/components/ConnectedWallets.d.ts +0 -19
  904. package/dist/widget/components/ConnectedWallets.d.ts.map +0 -1
  905. package/dist/widget/components/ConnectedWallets.js +0 -149
  906. package/dist/widget/components/CopyButton.d.ts +0 -18
  907. package/dist/widget/components/CopyButton.d.ts.map +0 -1
  908. package/dist/widget/components/CopyButton.js +0 -51
  909. package/dist/widget/components/CountryFilterDropdown.d.ts +0 -15
  910. package/dist/widget/components/CountryFilterDropdown.d.ts.map +0 -1
  911. package/dist/widget/components/CountryFilterDropdown.js +0 -93
  912. package/dist/widget/components/DebugMenu.d.ts +0 -7
  913. package/dist/widget/components/DebugMenu.d.ts.map +0 -1
  914. package/dist/widget/components/DebugMenu.js +0 -33
  915. package/dist/widget/components/DebugScreensList.d.ts +0 -7
  916. package/dist/widget/components/DebugScreensList.d.ts.map +0 -1
  917. package/dist/widget/components/DebugScreensList.js +0 -56
  918. package/dist/widget/components/DebugToast.d.ts +0 -3
  919. package/dist/widget/components/DebugToast.d.ts.map +0 -1
  920. package/dist/widget/components/DebugToast.js +0 -46
  921. package/dist/widget/components/DepositTracker.d.ts +0 -13
  922. package/dist/widget/components/DepositTracker.d.ts.map +0 -1
  923. package/dist/widget/components/DepositTracker.js +0 -194
  924. package/dist/widget/components/DirectTransfer.d.ts +0 -15
  925. package/dist/widget/components/DirectTransfer.d.ts.map +0 -1
  926. package/dist/widget/components/DirectTransfer.js +0 -218
  927. package/dist/widget/components/Disconnect.d.ts +0 -8
  928. package/dist/widget/components/Disconnect.d.ts.map +0 -1
  929. package/dist/widget/components/Disconnect.js +0 -37
  930. package/dist/widget/components/DynamicInputStyles.d.ts +0 -22
  931. package/dist/widget/components/DynamicInputStyles.d.ts.map +0 -1
  932. package/dist/widget/components/DynamicInputStyles.js +0 -27
  933. package/dist/widget/components/DynamicSizeInputField.d.ts +0 -17
  934. package/dist/widget/components/DynamicSizeInputField.d.ts.map +0 -1
  935. package/dist/widget/components/DynamicSizeInputField.js +0 -125
  936. package/dist/widget/components/ENSAvatar.d.ts +0 -12
  937. package/dist/widget/components/ENSAvatar.d.ts.map +0 -1
  938. package/dist/widget/components/ENSAvatar.js +0 -22
  939. package/dist/widget/components/Earn.d.ts +0 -33
  940. package/dist/widget/components/Earn.d.ts.map +0 -1
  941. package/dist/widget/components/Earn.js +0 -79
  942. package/dist/widget/components/EarnMarkets.d.ts +0 -9
  943. package/dist/widget/components/EarnMarkets.d.ts.map +0 -1
  944. package/dist/widget/components/EarnMarkets.js +0 -313
  945. package/dist/widget/components/EarnPools.d.ts +0 -8
  946. package/dist/widget/components/EarnPools.d.ts.map +0 -1
  947. package/dist/widget/components/EarnPools.js +0 -256
  948. package/dist/widget/components/EarnPoolsFilters.d.ts +0 -18
  949. package/dist/widget/components/EarnPoolsFilters.d.ts.map +0 -1
  950. package/dist/widget/components/EarnPoolsFilters.js +0 -106
  951. package/dist/widget/components/EarnWithdraw.d.ts +0 -21
  952. package/dist/widget/components/EarnWithdraw.d.ts.map +0 -1
  953. package/dist/widget/components/EarnWithdraw.js +0 -477
  954. package/dist/widget/components/ErrorAnimationIcon.d.ts +0 -2
  955. package/dist/widget/components/ErrorAnimationIcon.d.ts.map +0 -1
  956. package/dist/widget/components/ErrorAnimationIcon.js +0 -148
  957. package/dist/widget/components/ErrorDisplay.d.ts +0 -9
  958. package/dist/widget/components/ErrorDisplay.d.ts.map +0 -1
  959. package/dist/widget/components/ErrorDisplay.js +0 -104
  960. package/dist/widget/components/ExecutingIntentsBadge.d.ts +0 -12
  961. package/dist/widget/components/ExecutingIntentsBadge.d.ts.map +0 -1
  962. package/dist/widget/components/ExecutionStatusBadge.d.ts +0 -5
  963. package/dist/widget/components/ExecutionStatusBadge.d.ts.map +0 -1
  964. package/dist/widget/components/ExecutionStatusBadge.js +0 -45
  965. package/dist/widget/components/FeeOption.d.ts +0 -20
  966. package/dist/widget/components/FeeOption.d.ts.map +0 -1
  967. package/dist/widget/components/FeeOption.js +0 -71
  968. package/dist/widget/components/FeeOptions.d.ts +0 -20
  969. package/dist/widget/components/FeeOptions.d.ts.map +0 -1
  970. package/dist/widget/components/FeeOptions.js +0 -99
  971. package/dist/widget/components/FiatSelector.d.ts +0 -18
  972. package/dist/widget/components/FiatSelector.d.ts.map +0 -1
  973. package/dist/widget/components/FiatSelector.js +0 -171
  974. package/dist/widget/components/FiatSelectorButton.d.ts +0 -11
  975. package/dist/widget/components/FiatSelectorButton.d.ts.map +0 -1
  976. package/dist/widget/components/FiatSelectorButton.js +0 -41
  977. package/dist/widget/components/Footer.d.ts +0 -7
  978. package/dist/widget/components/Footer.d.ts.map +0 -1
  979. package/dist/widget/components/Footer.js +0 -71
  980. package/dist/widget/components/Fund.d.ts +0 -19
  981. package/dist/widget/components/Fund.d.ts.map +0 -1
  982. package/dist/widget/components/Fund.js +0 -16
  983. package/dist/widget/components/Fund.types.d.ts +0 -22
  984. package/dist/widget/components/Fund.types.d.ts.map +0 -1
  985. package/dist/widget/components/FundExactInput.d.ts +0 -5
  986. package/dist/widget/components/FundExactInput.d.ts.map +0 -1
  987. package/dist/widget/components/FundExactInput.js +0 -1116
  988. package/dist/widget/components/FundExactOutput.d.ts +0 -5
  989. package/dist/widget/components/FundExactOutput.d.ts.map +0 -1
  990. package/dist/widget/components/FundExactOutput.js +0 -498
  991. package/dist/widget/components/FundMethods.d.ts +0 -15
  992. package/dist/widget/components/FundMethods.d.ts.map +0 -1
  993. package/dist/widget/components/FundMethods.js +0 -219
  994. package/dist/widget/components/FundWalletSelection.d.ts +0 -3
  995. package/dist/widget/components/FundWalletSelection.d.ts.map +0 -1
  996. package/dist/widget/components/FundWalletSelection.js +0 -38
  997. package/dist/widget/components/FundingMethodSelectorButton.d.ts +0 -11
  998. package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +0 -1
  999. package/dist/widget/components/FundingMethodSelectorButton.js +0 -57
  1000. package/dist/widget/components/GreenCheckAnimation.d.ts +0 -2
  1001. package/dist/widget/components/GreenCheckAnimation.d.ts.map +0 -1
  1002. package/dist/widget/components/GreenCheckAnimation.js +0 -135
  1003. package/dist/widget/components/HighPriceImpactBlock.d.ts +0 -7
  1004. package/dist/widget/components/HighPriceImpactBlock.d.ts.map +0 -1
  1005. package/dist/widget/components/HighPriceImpactBlock.js +0 -33
  1006. package/dist/widget/components/HookModalContent.d.ts +0 -8
  1007. package/dist/widget/components/HookModalContent.d.ts.map +0 -1
  1008. package/dist/widget/components/HookModalContent.js +0 -237
  1009. package/dist/widget/components/Identicon.d.ts +0 -9
  1010. package/dist/widget/components/Identicon.d.ts.map +0 -1
  1011. package/dist/widget/components/Identicon.js +0 -176
  1012. package/dist/widget/components/LoadingSpinner.d.ts +0 -5
  1013. package/dist/widget/components/LoadingSpinner.d.ts.map +0 -1
  1014. package/dist/widget/components/LoadingSpinner.js +0 -5
  1015. package/dist/widget/components/MeldForm.d.ts +0 -24
  1016. package/dist/widget/components/MeldForm.d.ts.map +0 -1
  1017. package/dist/widget/components/MeldForm.js +0 -447
  1018. package/dist/widget/components/MeldHistory.d.ts +0 -13
  1019. package/dist/widget/components/MeldHistory.d.ts.map +0 -1
  1020. package/dist/widget/components/MeldHistory.js +0 -307
  1021. package/dist/widget/components/MeldStepsFlow.d.ts +0 -6
  1022. package/dist/widget/components/MeldStepsFlow.d.ts.map +0 -1
  1023. package/dist/widget/components/MeldStepsFlow.js +0 -785
  1024. package/dist/widget/components/MeldTransactionStatus.d.ts +0 -20
  1025. package/dist/widget/components/MeldTransactionStatus.d.ts.map +0 -1
  1026. package/dist/widget/components/MeldTransactionStatus.js +0 -157
  1027. package/dist/widget/components/MeshExchangeAccountHeader.d.ts +0 -9
  1028. package/dist/widget/components/MeshExchangeAccountHeader.d.ts.map +0 -1
  1029. package/dist/widget/components/MeshExchangeAccountHeader.js +0 -30
  1030. package/dist/widget/components/Modal.d.ts +0 -9
  1031. package/dist/widget/components/Modal.d.ts.map +0 -1
  1032. package/dist/widget/components/Modal.js +0 -65
  1033. package/dist/widget/components/OFTProgressBar.d.ts +0 -16
  1034. package/dist/widget/components/OFTProgressBar.d.ts.map +0 -1
  1035. package/dist/widget/components/OFTProgressBar.js +0 -49
  1036. package/dist/widget/components/OnRampProviderSelector.d.ts +0 -13
  1037. package/dist/widget/components/OnRampProviderSelector.d.ts.map +0 -1
  1038. package/dist/widget/components/OnRampProviderSelector.js +0 -144
  1039. package/dist/widget/components/OnrampErrorScreen.d.ts +0 -15
  1040. package/dist/widget/components/OnrampErrorScreen.d.ts.map +0 -1
  1041. package/dist/widget/components/OnrampErrorScreen.js +0 -102
  1042. package/dist/widget/components/OnrampHistoryRow.d.ts +0 -13
  1043. package/dist/widget/components/OnrampHistoryRow.d.ts.map +0 -1
  1044. package/dist/widget/components/OnrampHistoryRow.js +0 -249
  1045. package/dist/widget/components/OnrampPaymentMethods.d.ts +0 -7
  1046. package/dist/widget/components/OnrampPaymentMethods.d.ts.map +0 -1
  1047. package/dist/widget/components/OnrampPaymentMethods.js +0 -54
  1048. package/dist/widget/components/OnrampProviderConfirmation.d.ts +0 -30
  1049. package/dist/widget/components/OnrampProviderConfirmation.d.ts.map +0 -1
  1050. package/dist/widget/components/OnrampProviderConfirmation.js +0 -705
  1051. package/dist/widget/components/OriginSelectionAmount.d.ts +0 -12
  1052. package/dist/widget/components/OriginSelectionAmount.d.ts.map +0 -1
  1053. package/dist/widget/components/OriginSelectionAmount.js +0 -104
  1054. package/dist/widget/components/OriginTransferInformation.d.ts +0 -10
  1055. package/dist/widget/components/OriginTransferInformation.d.ts.map +0 -1
  1056. package/dist/widget/components/OriginTransferInformation.js +0 -56
  1057. package/dist/widget/components/Pay.d.ts +0 -7
  1058. package/dist/widget/components/Pay.d.ts.map +0 -1
  1059. package/dist/widget/components/Pay.js +0 -649
  1060. package/dist/widget/components/PaymentMethods.d.ts +0 -10
  1061. package/dist/widget/components/PaymentMethods.d.ts.map +0 -1
  1062. package/dist/widget/components/PaymentMethods.js +0 -118
  1063. package/dist/widget/components/PercentageMaxButtons.d.ts +0 -14
  1064. package/dist/widget/components/PercentageMaxButtons.d.ts.map +0 -1
  1065. package/dist/widget/components/PercentageMaxButtons.js +0 -62
  1066. package/dist/widget/components/PoolDeposit.d.ts +0 -32
  1067. package/dist/widget/components/PoolDeposit.d.ts.map +0 -1
  1068. package/dist/widget/components/PoolDeposit.js +0 -426
  1069. package/dist/widget/components/PriceImpactWarning.d.ts +0 -11
  1070. package/dist/widget/components/PriceImpactWarning.d.ts.map +0 -1
  1071. package/dist/widget/components/PriceImpactWarning.js +0 -58
  1072. package/dist/widget/components/PulsatingButton.d.ts +0 -9
  1073. package/dist/widget/components/PulsatingButton.d.ts.map +0 -1
  1074. package/dist/widget/components/PulsatingButton.js +0 -48
  1075. package/dist/widget/components/QRCodeOptions.d.ts +0 -9
  1076. package/dist/widget/components/QRCodeOptions.d.ts.map +0 -1
  1077. package/dist/widget/components/QRCodeOptions.js +0 -57
  1078. package/dist/widget/components/QRCodeWalletSelect.d.ts +0 -13
  1079. package/dist/widget/components/QRCodeWalletSelect.d.ts.map +0 -1
  1080. package/dist/widget/components/QRCodeWalletSelect.js +0 -45
  1081. package/dist/widget/components/QrCode.d.ts +0 -10
  1082. package/dist/widget/components/QrCode.d.ts.map +0 -1
  1083. package/dist/widget/components/QrCode.js +0 -69
  1084. package/dist/widget/components/QuoteDetails.d.ts +0 -25
  1085. package/dist/widget/components/QuoteDetails.d.ts.map +0 -1
  1086. package/dist/widget/components/QuoteDetails.js +0 -728
  1087. package/dist/widget/components/QuoteInputErrorBlock.d.ts +0 -7
  1088. package/dist/widget/components/QuoteInputErrorBlock.d.ts.map +0 -1
  1089. package/dist/widget/components/QuoteInputErrorBlock.js +0 -22
  1090. package/dist/widget/components/Receipt.d.ts +0 -18
  1091. package/dist/widget/components/Receipt.d.ts.map +0 -1
  1092. package/dist/widget/components/Receipt.js +0 -443
  1093. package/dist/widget/components/ReceiptRecoverableFunds.d.ts +0 -25
  1094. package/dist/widget/components/ReceiptRecoverableFunds.d.ts.map +0 -1
  1095. package/dist/widget/components/ReceiptRecoverableFunds.js +0 -75
  1096. package/dist/widget/components/RecentChains.d.ts +0 -9
  1097. package/dist/widget/components/RecentChains.d.ts.map +0 -1
  1098. package/dist/widget/components/RecentChains.js +0 -28
  1099. package/dist/widget/components/RecentTokens.d.ts +0 -10
  1100. package/dist/widget/components/RecentTokens.d.ts.map +0 -1
  1101. package/dist/widget/components/RecentTokens.js +0 -37
  1102. package/dist/widget/components/RecipientSelectorButton.d.ts +0 -6
  1103. package/dist/widget/components/RecipientSelectorButton.d.ts.map +0 -1
  1104. package/dist/widget/components/RecipientSelectorButton.js +0 -36
  1105. package/dist/widget/components/Recipients.d.ts +0 -9
  1106. package/dist/widget/components/Recipients.d.ts.map +0 -1
  1107. package/dist/widget/components/Recipients.js +0 -208
  1108. package/dist/widget/components/RefundWarning.d.ts +0 -11
  1109. package/dist/widget/components/RefundWarning.d.ts.map +0 -1
  1110. package/dist/widget/components/RefundWarning.js +0 -33
  1111. package/dist/widget/components/RequiredPropsError.d.ts +0 -8
  1112. package/dist/widget/components/RequiredPropsError.d.ts.map +0 -1
  1113. package/dist/widget/components/RequiredPropsError.js +0 -14
  1114. package/dist/widget/components/ScreenHeader.d.ts +0 -13
  1115. package/dist/widget/components/ScreenHeader.d.ts.map +0 -1
  1116. package/dist/widget/components/ScreenHeader.js +0 -64
  1117. package/dist/widget/components/SearchInputField.d.ts +0 -14
  1118. package/dist/widget/components/SearchInputField.d.ts.map +0 -1
  1119. package/dist/widget/components/SearchInputField.js +0 -51
  1120. package/dist/widget/components/SessionTimeoutScreen.d.ts +0 -12
  1121. package/dist/widget/components/SessionTimeoutScreen.d.ts.map +0 -1
  1122. package/dist/widget/components/SessionTimeoutScreen.js +0 -64
  1123. package/dist/widget/components/ShadowPortal.d.ts +0 -6
  1124. package/dist/widget/components/ShadowPortal.d.ts.map +0 -1
  1125. package/dist/widget/components/ShadowPortal.js +0 -52
  1126. package/dist/widget/components/ShadowRootContext.d.ts +0 -8
  1127. package/dist/widget/components/ShadowRootContext.d.ts.map +0 -1
  1128. package/dist/widget/components/ShadowRootContext.js +0 -12
  1129. package/dist/widget/components/SimpleRecipientInputScreen.d.ts +0 -13
  1130. package/dist/widget/components/SimpleRecipientInputScreen.d.ts.map +0 -1
  1131. package/dist/widget/components/SimpleRecipientInputScreen.js +0 -48
  1132. package/dist/widget/components/SlippageToleranceSettings.d.ts +0 -9
  1133. package/dist/widget/components/SlippageToleranceSettings.d.ts.map +0 -1
  1134. package/dist/widget/components/SlippageToleranceSettings.js +0 -159
  1135. package/dist/widget/components/Swap.d.ts +0 -43
  1136. package/dist/widget/components/Swap.d.ts.map +0 -1
  1137. package/dist/widget/components/Swap.js +0 -6
  1138. package/dist/widget/components/SwapDisplay.d.ts +0 -9
  1139. package/dist/widget/components/SwapDisplay.d.ts.map +0 -1
  1140. package/dist/widget/components/SwapDisplay.js +0 -72
  1141. package/dist/widget/components/ThemeProvider.d.ts +0 -16
  1142. package/dist/widget/components/ThemeProvider.d.ts.map +0 -1
  1143. package/dist/widget/components/ThemeProvider.js +0 -52
  1144. package/dist/widget/components/ThemeSyncer.d.ts +0 -6
  1145. package/dist/widget/components/ThemeSyncer.d.ts.map +0 -1
  1146. package/dist/widget/components/ThemeSyncer.js +0 -25
  1147. package/dist/widget/components/Toast.d.ts +0 -24
  1148. package/dist/widget/components/Toast.d.ts.map +0 -1
  1149. package/dist/widget/components/Toast.js +0 -206
  1150. package/dist/widget/components/TokenDisplayNonSelectable.d.ts +0 -11
  1151. package/dist/widget/components/TokenDisplayNonSelectable.d.ts.map +0 -1
  1152. package/dist/widget/components/TokenDisplayNonSelectable.js +0 -30
  1153. package/dist/widget/components/TokenImage.d.ts +0 -11
  1154. package/dist/widget/components/TokenImage.d.ts.map +0 -1
  1155. package/dist/widget/components/TokenImage.js +0 -96
  1156. package/dist/widget/components/TokenList.d.ts +0 -20
  1157. package/dist/widget/components/TokenList.d.ts.map +0 -1
  1158. package/dist/widget/components/TokenList.js +0 -45
  1159. package/dist/widget/components/TokenSelector.d.ts +0 -32
  1160. package/dist/widget/components/TokenSelector.d.ts.map +0 -1
  1161. package/dist/widget/components/TokenSelector.js +0 -479
  1162. package/dist/widget/components/TokenSelectorButton.d.ts +0 -17
  1163. package/dist/widget/components/TokenSelectorButton.d.ts.map +0 -1
  1164. package/dist/widget/components/TokenSelectorButton.js +0 -64
  1165. package/dist/widget/components/TokenSkeleton.d.ts +0 -12
  1166. package/dist/widget/components/TokenSkeleton.d.ts.map +0 -1
  1167. package/dist/widget/components/TokenSkeleton.js +0 -36
  1168. package/dist/widget/components/Tooltip.d.ts +0 -14
  1169. package/dist/widget/components/Tooltip.d.ts.map +0 -1
  1170. package/dist/widget/components/Tooltip.js +0 -38
  1171. package/dist/widget/components/TrailsHookModal.d.ts +0 -10
  1172. package/dist/widget/components/TrailsHookModal.d.ts.map +0 -1
  1173. package/dist/widget/components/TrailsHookModal.js +0 -55
  1174. package/dist/widget/components/TransactionDetails.d.ts +0 -10
  1175. package/dist/widget/components/TransactionDetails.d.ts.map +0 -1
  1176. package/dist/widget/components/TransactionDetails.js +0 -492
  1177. package/dist/widget/components/TransactionHistoryItem.d.ts +0 -23
  1178. package/dist/widget/components/TransactionHistoryItem.d.ts.map +0 -1
  1179. package/dist/widget/components/TransactionHistoryItem.js +0 -547
  1180. package/dist/widget/components/TransferPendingVertical.d.ts +0 -16
  1181. package/dist/widget/components/TransferPendingVertical.d.ts.map +0 -1
  1182. package/dist/widget/components/TransferPendingVertical.js +0 -356
  1183. package/dist/widget/components/TruncatedTransactionHash.d.ts +0 -12
  1184. package/dist/widget/components/TruncatedTransactionHash.d.ts.map +0 -1
  1185. package/dist/widget/components/TruncatedTransactionHash.js +0 -36
  1186. package/dist/widget/components/UserPreferences.d.ts +0 -7
  1187. package/dist/widget/components/UserPreferences.d.ts.map +0 -1
  1188. package/dist/widget/components/UserPreferences.js +0 -282
  1189. package/dist/widget/components/WaasFeeOptions.d.ts +0 -12
  1190. package/dist/widget/components/WaasFeeOptions.d.ts.map +0 -1
  1191. package/dist/widget/components/WaasFeeOptions.js +0 -349
  1192. package/dist/widget/components/WalletAccountHeader.d.ts +0 -8
  1193. package/dist/widget/components/WalletAccountHeader.d.ts.map +0 -1
  1194. package/dist/widget/components/WalletAccountHeader.js +0 -45
  1195. package/dist/widget/components/WalletConfirmation.d.ts +0 -15
  1196. package/dist/widget/components/WalletConfirmation.d.ts.map +0 -1
  1197. package/dist/widget/components/WalletConfirmation.js +0 -145
  1198. package/dist/widget/components/WalletConnect.d.ts +0 -11
  1199. package/dist/widget/components/WalletConnect.d.ts.map +0 -1
  1200. package/dist/widget/components/WalletConnect.js +0 -164
  1201. package/dist/widget/components/WalletConnectionPending.d.ts +0 -12
  1202. package/dist/widget/components/WalletConnectionPending.d.ts.map +0 -1
  1203. package/dist/widget/components/WalletConnectionPending.js +0 -124
  1204. package/dist/widget/components/WalletList.d.ts +0 -16
  1205. package/dist/widget/components/WalletList.d.ts.map +0 -1
  1206. package/dist/widget/components/WalletList.js +0 -88
  1207. package/dist/widget/components/WidgetProviders.d.ts +0 -16
  1208. package/dist/widget/components/WidgetProviders.d.ts.map +0 -1
  1209. package/dist/widget/components/WidgetProviders.js +0 -43
  1210. package/dist/widget/components/Withdraw.d.ts +0 -12
  1211. package/dist/widget/components/Withdraw.d.ts.map +0 -1
  1212. package/dist/widget/components/Withdraw.js +0 -551
  1213. package/dist/widget/components/YellowWarningAnimation.d.ts +0 -2
  1214. package/dist/widget/components/YellowWarningAnimation.d.ts.map +0 -1
  1215. package/dist/widget/components/YellowWarningAnimation.js +0 -167
  1216. package/dist/widget/components/earnMarketUtils.d.ts +0 -11
  1217. package/dist/widget/components/earnMarketUtils.d.ts.map +0 -1
  1218. package/dist/widget/components/earnMarketUtils.js +0 -48
  1219. package/dist/widget/components/earnNetworks.d.ts +0 -6
  1220. package/dist/widget/components/earnNetworks.d.ts.map +0 -1
  1221. package/dist/widget/components/earnNetworks.js +0 -33
  1222. package/dist/widget/index.d.ts.map +0 -1
  1223. package/dist/widget/modes/EarnWidget.d.ts +0 -90
  1224. package/dist/widget/modes/EarnWidget.d.ts.map +0 -1
  1225. package/dist/widget/modes/EarnWidget.js +0 -41
  1226. package/dist/widget/modes/FundWidget.d.ts +0 -110
  1227. package/dist/widget/modes/FundWidget.d.ts.map +0 -1
  1228. package/dist/widget/modes/FundWidget.js +0 -48
  1229. package/dist/widget/modes/PayWidget.d.ts +0 -80
  1230. package/dist/widget/modes/PayWidget.d.ts.map +0 -1
  1231. package/dist/widget/modes/PayWidget.js +0 -40
  1232. package/dist/widget/modes/SwapWidget.d.ts +0 -76
  1233. package/dist/widget/modes/SwapWidget.d.ts.map +0 -1
  1234. package/dist/widget/modes/SwapWidget.js +0 -41
  1235. package/dist/widget/modes/WithdrawWidget.d.ts +0 -87
  1236. package/dist/widget/modes/WithdrawWidget.d.ts.map +0 -1
  1237. package/dist/widget/modes/WithdrawWidget.js +0 -38
  1238. package/dist/widget/props.d.ts +0 -255
  1239. package/dist/widget/props.d.ts.map +0 -1
  1240. package/dist/widget/props.js +0 -14
  1241. package/dist/widget/providers/TrailsModalProvider.d.ts +0 -78
  1242. package/dist/widget/providers/TrailsModalProvider.d.ts.map +0 -1
  1243. package/dist/widget/providers/TrailsModalProvider.js +0 -57
  1244. package/dist/widget/providers/TrailsProvider.d.ts +0 -100
  1245. package/dist/widget/providers/TrailsProvider.d.ts.map +0 -1
  1246. package/dist/widget/providers/TrailsProvider.js +0 -101
  1247. package/dist/widget/providers/UserActivityProvider.d.ts +0 -18
  1248. package/dist/widget/providers/UserActivityProvider.d.ts.map +0 -1
  1249. package/dist/widget/providers/UserActivityProvider.js +0 -38
  1250. package/dist/widget/providers/WalletContext.d.ts +0 -10
  1251. package/dist/widget/providers/WalletContext.d.ts.map +0 -1
  1252. package/dist/widget/providers/WalletContext.js +0 -23
  1253. package/dist/widget/providers/WidgetProviderTree.d.ts +0 -24
  1254. package/dist/widget/providers/WidgetProviderTree.d.ts.map +0 -1
  1255. package/dist/widget/providers/WidgetProviderTree.js +0 -35
  1256. package/dist/widget/providers/adapterConfig.d.ts +0 -13
  1257. package/dist/widget/providers/adapterConfig.d.ts.map +0 -1
  1258. package/dist/widget/providers/adapterConfig.js +0 -97
  1259. package/dist/widget/providers/sequenceSupport.d.ts +0 -42
  1260. package/dist/widget/providers/sequenceSupport.d.ts.map +0 -1
  1261. package/dist/widget/providers/walletRuntimeResolution.d.ts +0 -10
  1262. package/dist/widget/providers/walletRuntimeResolution.d.ts.map +0 -1
  1263. package/dist/widget/providers/walletRuntimeResolution.js +0 -14
  1264. package/dist/widget/shared/destinationDefaultToken.d.ts +0 -15
  1265. package/dist/widget/shared/destinationDefaultToken.d.ts.map +0 -1
  1266. package/dist/widget/shared/destinationDefaultToken.js +0 -18
  1267. package/dist/widget/shared/destinationSupport.d.ts +0 -40
  1268. package/dist/widget/shared/destinationSupport.d.ts.map +0 -1
  1269. package/dist/widget/shared/destinationSupport.js +0 -215
  1270. package/dist/widget/shared/mapSharedProps.d.ts +0 -9
  1271. package/dist/widget/shared/mapSharedProps.d.ts.map +0 -1
  1272. package/dist/widget/shared/mapSharedProps.js +0 -22
  1273. package/dist/widget/shared/methodMap.d.ts +0 -18
  1274. package/dist/widget/shared/methodMap.d.ts.map +0 -1
  1275. package/dist/widget/shared/methodMap.js +0 -25
  1276. package/dist/widget/shared/resolution.d.ts +0 -8
  1277. package/dist/widget/shared/resolution.d.ts.map +0 -1
  1278. package/dist/widget/shared/resolution.js +0 -63
  1279. package/dist/widget/shared/resolvePaymentSource.d.ts +0 -37
  1280. package/dist/widget/shared/resolvePaymentSource.d.ts.map +0 -1
  1281. package/dist/widget/shared/resolvePaymentSource.js +0 -19
  1282. package/dist/widget/shared/types.d.ts +0 -142
  1283. package/dist/widget/shared/types.d.ts.map +0 -1
  1284. package/dist/widget/styles.gen.d.ts +0 -2
  1285. package/dist/widget/styles.gen.d.ts.map +0 -1
  1286. package/dist/widget/styles.gen.js +0 -29
  1287. package/dist/widget/types/analytics.d.ts +0 -22
  1288. package/dist/widget/types/analytics.d.ts.map +0 -1
  1289. package/dist/widget/types/commonProps.d.ts +0 -48
  1290. package/dist/widget/types/commonProps.d.ts.map +0 -1
  1291. package/dist/widget/utils/countryUtils.d.ts +0 -37
  1292. package/dist/widget/utils/countryUtils.d.ts.map +0 -1
  1293. package/dist/widget/utils/countryUtils.js +0 -14
  1294. package/dist/widget/utils/forexRateStore.d.ts +0 -25
  1295. package/dist/widget/utils/forexRateStore.d.ts.map +0 -1
  1296. package/dist/widget/utils/forexRateStore.js +0 -59
  1297. package/dist/widget/utils/fundMethodSwitchState.d.ts +0 -14
  1298. package/dist/widget/utils/fundMethodSwitchState.d.ts.map +0 -1
  1299. package/dist/widget/utils/fundMethodSwitchState.js +0 -6
  1300. package/dist/widget/utils/historyFilters.d.ts +0 -13
  1301. package/dist/widget/utils/historyFilters.d.ts.map +0 -1
  1302. package/dist/widget/utils/historyFilters.js +0 -108
  1303. package/dist/widget/utils/localeStore.d.ts +0 -19
  1304. package/dist/widget/utils/localeStore.d.ts.map +0 -1
  1305. package/dist/widget/utils/localeStore.js +0 -39
  1306. package/dist/widget/utils/meldProviderUtils.d.ts +0 -6
  1307. package/dist/widget/utils/meldProviderUtils.d.ts.map +0 -1
  1308. package/dist/widget/utils/meldProviderUtils.js +0 -9
  1309. package/dist/widget/utils/meshSupportedTokens.d.ts +0 -4
  1310. package/dist/widget/utils/meshSupportedTokens.d.ts.map +0 -1
  1311. package/dist/widget/utils/meshSupportedTokens.js +0 -12
  1312. package/dist/widget/utils/onrampConfig.d.ts +0 -11
  1313. package/dist/widget/utils/onrampConfig.d.ts.map +0 -1
  1314. package/dist/widget/utils/onrampConfig.js +0 -6
  1315. package/dist/widget/utils/statusLabel.d.ts +0 -2
  1316. package/dist/widget/utils/statusLabel.d.ts.map +0 -1
  1317. package/dist/widget/utils/statusLabel.js +0 -6
  1318. package/dist/widget/utils/tokens.d.ts +0 -60
  1319. package/dist/widget/utils/tokens.d.ts.map +0 -1
  1320. package/dist/widget/utils/tokens.js +0 -16
  1321. package/dist/widget/utils/trailsOnrampConfig.d.ts +0 -23
  1322. package/dist/widget/utils/trailsOnrampConfig.d.ts.map +0 -1
  1323. package/dist/widget/utils/trailsOnrampConfig.js +0 -7
  1324. package/dist/widget/utils/transactionFailure.d.ts +0 -20
  1325. package/dist/widget/utils/transactionFailure.d.ts.map +0 -1
  1326. package/dist/widget/utils/transactionFailure.js +0 -12
  1327. package/dist/widget/utils/viewManagerGuards.d.ts +0 -5
  1328. package/dist/widget/utils/viewManagerGuards.d.ts.map +0 -1
  1329. package/dist/widget/utils/viewManagerGuards.js +0 -24
  1330. package/dist/widget/utils/walletConnectRedirect.d.ts +0 -19
  1331. package/dist/widget/utils/walletConnectRedirect.d.ts.map +0 -1
  1332. package/dist/widget/utils/walletConnectRedirect.js +0 -21
  1333. package/dist/widget/utils/windowUtils.d.ts +0 -13
  1334. package/dist/widget/utils/windowUtils.d.ts.map +0 -1
  1335. package/dist/widget/utils/windowUtils.js +0 -84
  1336. package/dist/widget/widget.d.ts +0 -16
  1337. package/dist/widget/widget.d.ts.map +0 -1
  1338. package/dist/widget/widget.js +0 -1541
  1339. package/dist/widgetFlowHooks.d.ts +0 -12
  1340. package/dist/widgetFlowHooks.d.ts.map +0 -1
  1341. package/dist/widgetFlowHooks.js +0 -18
@@ -0,0 +1,143 @@
1
+ import{L as e}from"./ConnectWalletCard-BkbHCcWi.js";import{t}from"./defineProperty-BbfpZ9Tg.js";import{A as n,Bt as r,M as i,Tt as a,j as o,ut as s}from"./src-Cy3oxYgV.js";import{useCallback as c,useEffect as l,useMemo as ee,useRef as te,useState as u}from"react";import{useQuery as d,useQueryClient as f}from"@tanstack/react-query";import{jsx as p,jsxs as m}from"react/jsx-runtime";var h=class{constructor(){t(this,`ws`,null),t(this,`messageHandler`,void 0),t(this,`errorHandler`,void 0),t(this,`closeHandler`,void 0)}async connect(e,t,n,r){return new Promise((i,a)=>{let o=`${n}/v0/ws/oauth2/listen?idem=${encodeURIComponent(e)}&orgId=${encodeURIComponent(t)}`;this.ws=new WebSocket(o),r&&(this.messageHandler=r.onMessage,this.errorHandler=r.onError,this.closeHandler=r.onClose),this.ws.onopen=()=>{console.log(`[WebSocket] Connected: idem=${e}`),i()},this.ws.onerror=e=>{console.error(`[WebSocket] Connection error:`,e);let t=Error(`WebSocket connection failed`);this.errorHandler&&this.errorHandler(t),a(t)},this.ws.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{t=e.data}console.log(`[WebSocket] Message received:`,t),this.messageHandler&&this.messageHandler(t)},this.ws.onclose=()=>{console.log(`[WebSocket] Connection closed`),this.closeHandler&&this.closeHandler()}})}async waitForMessage(){return new Promise((e,t)=>{if(!this.ws){t(Error(`WebSocket not connected`));return}let n=performance.now(),r=setTimeout(()=>{t(Error(`WebSocket message timeout`))},3e4),i=t=>{let a=performance.now()-n;clearTimeout(r),this.ws?.removeEventListener(`message`,i);let o;try{o=JSON.parse(t.data)}catch{o=t.data}console.log(`[WebSocket] Message received in ${a.toFixed(2)}ms`),e({latency:a,data:o})};this.ws.addEventListener(`message`,i)})}disconnect(){this.ws&&(this.ws.close(),this.ws=null,this.messageHandler=void 0,this.errorHandler=void 0,this.closeHandler=void 0)}isConnected(){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN}},g=class{constructor(){t(this,`activeSubscriptions`,new Map)}async subscribe(e,t,n,r){if(this.activeSubscriptions.has(e)&&(console.warn(`Already subscribed to topic: ${e}. Closing existing subscription.`),await this.unsubscribe(e)),!e||e.trim().length===0){let e=Error(`Topic name cannot be empty`);return console.error(e.message),r.onError?.(e),null}if(!t||t.trim().length===0){let e=Error(`Organization ID cannot be empty`);return console.error(e.message),r.onError?.(e),null}if(!n||n.trim().length===0){let e=Error(`WebSocket base URL cannot be empty`);return console.error(e.message),r.onError?.(e),null}try{let i=new h;await i.connect(e,t,n,{onMessage:t=>{try{console.log(`Received message on topic ${e}:`,t),r.onMessage(t)}catch(t){console.error(`Error processing message on topic ${e}:`,t),r.onError?.(t instanceof Error?t:Error(String(t)))}},onError:t=>{console.error(`Subscription error on topic ${e}:`,t),r.onError?.(t),this.unsubscribe(e)},onClose:()=>{console.log(`WebSocket closed for topic ${e}`),this.activeSubscriptions.delete(e)}});let a={topicName:e,unsubscribe:()=>{i.disconnect(),this.activeSubscriptions.delete(e)}};return this.activeSubscriptions.set(e,{listener:i,subscription:a}),console.log(`Successfully subscribed to topic: ${e}`),a}catch(t){return console.error(`Error subscribing to topic ${e}:`,t),r.onError?.(t instanceof Error?t:Error(String(t))),null}}async unsubscribe(e){let t=this.activeSubscriptions.get(e);if(t)try{t.subscription.unsubscribe(),console.log(`Successfully unsubscribed from topic: ${e}`)}catch(t){console.error(`Error unsubscribing from topic ${e}:`,t)}}async unsubscribeAll(){let e=Array.from(this.activeSubscriptions.keys());await Promise.all(e.map(e=>this.unsubscribe(e)))}isSubscribed(e){return this.activeSubscriptions.has(e)}getActiveSubscriptionCount(){return this.activeSubscriptions.size}};const _={WithdrawFunds:`withdraw`,OAuth2Flow:`oauth2`,ConnectExchange:`connect`,QRCodeAuth:`qr_code_auth`};var v=class e{constructor(e=``,n=``,r=!1,i=!1,a){t(this,`wsClient`,void 0),t(this,`wsBase`,void 0),t(this,`apiBase`,void 0),t(this,`orgId`,void 0),t(this,`projectId`,void 0),t(this,`sandbox`,void 0),t(this,`dev`,void 0),t(this,`customDomain`,void 0),t(this,`oauth2`,{async openWindow(e,t,n,r,i){let{url:a,data:o,success:s,error:c}=await this.getURL(e,{walletId:t.walletId,idem:t.idem});if(o?.isQRCode)return()=>{};if(i===void 0){if(typeof window>`u`)return console.error(`This method can only be called in a browser environment`),()=>{};i=window}let l=r?.title||`${e} OAuth`,ee=r?.width||500,te=r?.height||600,u,d;if(r?.left!==void 0&&r?.top!==void 0)u=r.left,d=r.top;else{let e=i.screenLeft||i.screenX||0,t=i.screenTop||i.screenY||0,n=i.screen.width,r=i.screen.height;u=e+(n-ee)/2,d=t+(r-te)/2}let f=`<!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>${l}</title>
5
+ <style>
6
+ body {
7
+ margin: 0;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ height: 100vh;
12
+ background: #000;
13
+ }
14
+ .spinner {
15
+ border: 4px solid rgba(255, 255, 255, 0.3);
16
+ border-top: 4px solid #fff;
17
+ border-radius: 50%;
18
+ width: 48px;
19
+ height: 48px;
20
+ animation: spin 1s linear infinite;
21
+ }
22
+ @keyframes spin {
23
+ 0% { transform: rotate(0deg); }
24
+ 100% { transform: rotate(360deg); }
25
+ }
26
+ </style>
27
+ </head>
28
+ <body>
29
+ <div class="spinner"></div>
30
+ </body>
31
+ </html>`,p=`width=${ee},height=${te},left=${u},top=${d},status=yes,scrollbars=yes,resizable=yes`,m=i.open(`about:blank`,l,p);if(!m||m.closed||m.closed===void 0)return console.error(`Failed to open OAuth2 window. Please allow pop-ups for this site.`),()=>{};try{m.document.open(),m.document.write(f),m.document.close()}catch(e){console.error(`Failed to write loading HTML to popup:`,e);try{m.close()}catch{}return()=>{}}if(m.focus(),m.closed)return console.warn(`OAuth2 window was closed before URL could be loaded`),()=>{};if(!s||!a){console.error(`Failed to generate OAuth2 URL:`,c);let t=`<!DOCTYPE html>
32
+ <html>
33
+ <head>
34
+ <title>${l} - Error</title>
35
+ <meta charset="utf-8">
36
+ <meta name="viewport" content="width=device-width, initial-scale=1">
37
+ <style>
38
+ * {
39
+ margin: 0;
40
+ padding: 0;
41
+ box-sizing: border-box;
42
+ }
43
+ body {
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ height: 100vh;
48
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
49
+ background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
50
+ color: #ffffff;
51
+ padding: 1rem;
52
+ }
53
+ .error-container {
54
+ text-align: center;
55
+ background: rgba(255, 255, 255, 0.1);
56
+ padding: 3rem 2rem;
57
+ border-radius: 1rem;
58
+ backdrop-filter: blur(10px);
59
+ box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
60
+ max-width: 400px;
61
+ }
62
+ .error-icon {
63
+ font-size: 3rem;
64
+ margin-bottom: 1rem;
65
+ }
66
+ h2 {
67
+ font-size: 1.5rem;
68
+ font-weight: 600;
69
+ margin-bottom: 1rem;
70
+ }
71
+ p {
72
+ font-size: 0.875rem;
73
+ opacity: 0.9;
74
+ margin-bottom: 1.5rem;
75
+ line-height: 1.5;
76
+ }
77
+ button {
78
+ background: rgba(255, 255, 255, 0.9);
79
+ color: #f5576c;
80
+ border: none;
81
+ padding: 0.75rem 1.5rem;
82
+ border-radius: 0.5rem;
83
+ font-size: 0.875rem;
84
+ font-weight: 600;
85
+ cursor: pointer;
86
+ transition: all 0.2s;
87
+ }
88
+ button:hover {
89
+ background: #ffffff;
90
+ transform: translateY(-1px);
91
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
92
+ }
93
+ </style>
94
+ </head>
95
+ <body>
96
+ <div class="error-container">
97
+ <div class="error-icon">⚠️</div>
98
+ <h2>Connection Failed</h2>
99
+ <p>We couldn't connect to ${e}. Please close this window and try again.</p>
100
+ <p style="font-size: 0.75rem; opacity: 0.7;">${c||`Unknown error occurred`}</p>
101
+ <button onclick="window.close()">Close Window</button>
102
+ </div>
103
+ </body>
104
+ </html>`;try{m.document.open(),m.document.write(t),m.document.close()}catch(e){console.warn(`Could not display error in popup window:`,e);try{m.close()}catch{}}return()=>{try{m.closed||m.close()}catch{}}}try{m.location.href=a}catch(e){console.error(`Failed to navigate to OAuth URL:`,e);try{m.close()}catch{}return()=>{}}if(n?.onWindowClose){let e=!1,t=setInterval(()=>{try{return m.closed?(e||(e=!0,clearInterval(t),n.onWindowClose()),!0):(m.location.href,!1)}catch(r){return r.name===`SecurityError`||r instanceof DOMException&&r.code===18?!1:(e||(e=!0,clearInterval(t),n.onWindowClose()),!0)}},500);return()=>{if(clearInterval(t),!e)try{m&&!m.closed&&m.close()}catch(e){console.warn(`Failed to close OAuth window:`,e)}}}return()=>{try{m&&!m.closed&&m.close()}catch(e){console.warn(`Failed to close OAuth window:`,e)}}},getURL:async(e,{walletId:t,idem:n})=>{let r=new URL(`/v0/oauth2/${e}/url`,this.apiBase);r.searchParams.set(`idem`,n);try{let e=await fetch(r.toString(),{method:`GET`,headers:{"x-bluvo-org-id":this.orgId,"x-bluvo-project-id":this.projectId,"x-bluvo-wallet-id":t}}),n=await e.json();return{data:n,error:e.ok?void 0:n.error||`Failed to generate OAuth2 URL`,success:e.ok,url:e.ok?n.url:void 0}}catch(e){return{data:void 0,error:e instanceof Error?e.message:`Failed to generate OAuth2 URL`,success:!1,url:void 0}}}}),this.orgId=e,this.projectId=n,this.sandbox=r,this.dev=i,this.customDomain=a,this.wsClient=new g,a&&typeof a==`object`?(this.apiBase=`https://${a.api}`,this.wsBase=`wss://${a.ws}`):a&&typeof a==`string`&&a!==`api-bluvo.com`?(this.apiBase=`https://${a}`,this.wsBase=`wss://${a}`):i?(this.apiBase=`http://localhost:8787`,this.wsBase=`ws://localhost:8787`):r?(this.apiBase=`https://test.api-bluvo.com`,this.wsBase=`wss://test.api-bluvo.com`):(this.apiBase=`https://api-bluvo.com`,this.wsBase=`wss://api-bluvo.com`)}static createClient({orgId:t,projectId:n,sandbox:r,dev:i,customDomain:a}){return new e(t,n,r,i,a)}async listen(e,t){return console.log(`ws listening on topic`,e,`with orgId`,this.orgId),this.wsClient.subscribe(e,this.orgId,this.wsBase,{onError:t.onError,onMessage:e=>{console.log(`rawData from ws`,e);let n=e&&typeof e==`object`&&`body`in e?e.body:e,r=n?.success===!0,i=n?.success===!1,a=n?.success===void 0||!r&&!i;if(n.type===_.QRCodeAuth){let e=n;return a&&(e.qrCodeUrl||e.qrCodeStatus)?t.onQRCodeReceived?.(e):r?t.onQRCodeComplete?.(e):i?t.onQRCodeError?.(Error(n.error||`QR code authentication failed`)):void 0}if(a)return t.onStep?t.onStep(n):void 0;if(n.type===_.OAuth2Flow&&!t.onOAuth2Complete){console.error(`received OAuth2 message but no onOAuth2Complete handler is defined`);return}if(n.type===_.WithdrawFunds&&!t.onWithdrawComplete){console.error(`received Withdraw message but no onWithdrawComplete handler is defined`);return}if(n.type===_.OAuth2Flow){if(r&&n.walletId)return t.onOAuth2Complete?.(n);if(i)return t.onError?.(Error(n.error||`OAuth2 flow failed`))}if(n.type===_.WithdrawFunds){if(r&&n.walletId)return t.onWithdrawComplete?.(n);if(i){if(n.error&&typeof n.error==`object`){if(n.error.code&&n.error.message){let e=Error(n.error.message);return e.name=n.error.code,e.originalError=n.error,e.code=n.error.code,t.onError?.(e)}else if(n.error.name||n.error.message){let e=Error(n.error.message||`Withdraw funds flow failed`);return e.name=n.error.name||`WithdrawError`,e.originalError=n.error,t.onError?.(e)}}return t.onError?.(Error(n.error||`Withdraw funds flow failed`))}}}})}async unsubscribe(e){return this.wsClient.unsubscribe(e)}async unsubscribeAll(){return this.wsClient.unsubscribeAll()}isSubscribed(e){return this.wsClient.isSubscribed(e)}getActiveSubscriptionCount(){return this.wsClient.getActiveSubscriptionCount()}};const y={GENERIC_NOT_FOUND:`GENERIC_NOT_FOUND`,GENERIC_UNAUTHORIZED:`GENERIC_UNAUTHORIZED`,GENERIC_INTERNAL_SERVER_ERROR:`GENERIC_INTERNAL_SERVER_ERROR`,GENERIC_VALIDATION_ERROR:`GENERIC_VALIDATION_ERROR`,GENERIC_INVALID_REQUEST:`GENERIC_INVALID_REQUEST`,APIKEY_INSUFFICIENT_PERMISSIONS:`APIKEY_INSUFFICIENT_PERMISSIONS`,WALLET_NOT_FOUND:`WALLET_NOT_FOUND`,WALLET_INVALID_CREDENTIALS:`WALLET_INVALID_CREDENTIALS`,QUOTE_NOT_FOUND:`QUOTE_NOT_FOUND`,QUOTE_EXPIRED:`QUOTE_EXPIRED`,WITHDRAWAL_INSUFFICIENT_BALANCE:`WITHDRAWAL_INSUFFICIENT_BALANCE`,WITHDRAWAL_INSUFFICIENT_BALANCE_FOR_FEE:`WITHDRAWAL_INSUFFICIENT_BALANCE_FOR_FEE`,WITHDRAWAL_INVALID_ADDRESS:`WITHDRAWAL_INVALID_ADDRESS`,WITHDRAWAL_NETWORK_NOT_SUPPORTED:`WITHDRAWAL_NETWORK_NOT_SUPPORTED`,WITHDRAWAL_TOO_MANY_ADDRESSES:`WITHDRAWAL_TOO_MANY_ADDRESSES`,WITHDRAWAL_AMOUNT_BELOW_MINIMUM:`WITHDRAWAL_AMOUNT_BELOW_MINIMUM`,WITHDRAWAL_AMOUNT_ABOVE_MAXIMUM:`WITHDRAWAL_AMOUNT_ABOVE_MAXIMUM`,WITHDRAWAL_ASSET_NOT_SUPPORTED:`WITHDRAWAL_ASSET_NOT_SUPPORTED`,WITHDRAWAL_PROVIDER_ERROR:`WITHDRAWAL_PROVIDER_ERROR`,WITHDRAWAL_2FA_REQUIRED_TOTP:`WITHDRAWAL_2FA_REQUIRED_TOTP`,WITHDRAWAL_2FA_REQUIRED_SMS:`WITHDRAWAL_2FA_REQUIRED_SMS`,WITHDRAWAL_2FA_REQUIRED_FACE_RECOGNITION:`WITHDRAWAL_2FA_REQUIRED_FACE_RECOGNITION`,WITHDRAWAL_2FA_REQUIRED_EMAIL:`WITHDRAWAL_2FA_REQUIRED_EMAIL`,WITHDRAWAL_2FA_REQUIRED_YUBIKEY:`WITHDRAWAL_2FA_REQUIRED_YUBIKEY`,WITHDRAWAL_2FA_REQUIRED_PASSPHRASE:`WITHDRAWAL_2FA_REQUIRED_PASSPHRASE`,WITHDRAWAL_2FA_REQUIRED_MULTI_STEPS:`WITHDRAWAL_2FA_REQUIRED_MULTI_STEPS`,WITHDRAWAL_2FA_INCOMPLETE:`WITHDRAWAL_2FA_INCOMPLETE`,WITHDRAWAL_2FA_INVALID:`WITHDRAWAL_2FA_INVALID`,WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED:`WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED`,WITHDRAWAL_KYC_REQUIRED:`WITHDRAWAL_KYC_REQUIRED`,WITHDRAWAL_EMAIL_UNVERIFIED:`WITHDRAWAL_EMAIL_UNVERIFIED`,WITHDRAWAL_RATE_LIMIT_EXCEEDED:`WITHDRAWAL_RATE_LIMIT_EXCEEDED`,OAUTH_AUTHORIZATION_FAILED:`OAUTH_AUTHORIZATION_FAILED`,OAUTH_TOKEN_EXCHANGE_FAILED:`OAUTH_TOKEN_EXCHANGE_FAILED`,OAUTH_INVALID_STATE:`OAUTH_INVALID_STATE`,OAUTH_INSUFFICIENT_SCOPE:`OAUTH_INSUFFICIENT_SCOPE`,WEBHOOK_SIGNATURE_INVALID:`WEBHOOK_SIGNATURE_INVALID`,WEBHOOK_MISSING_HEADERS:`WEBHOOK_MISSING_HEADERS`,WEBHOOK_INVALID_TIMESTAMP:`WEBHOOK_INVALID_TIMESTAMP`,CACHE_MISS:`CACHE_MISS`,CACHE_EXPIRED:`CACHE_EXPIRED`,CACHE_INVALID_PATH:`CACHE_INVALID_PATH`,WITHDRAWAL_DRY_RUN_COMPLETE:`WITHDRAWAL_DRY_RUN_COMPLETE`};function ne(e){return typeof e==`object`&&!!e&&`code`in e&&`message`in e&&Object.values(y).includes(e.code)}function b(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.errorCode&&Object.values(y).includes(t.errorCode))return t.errorCode;if(t.type&&Object.values(y).includes(t.type))return t.type;if(t.code&&Object.values(y).includes(t.code))return t.code;if(ne(e))return e.code;let n=t;return n.response?.data?.type&&Object.values(y).includes(n.response.data.type)?n.response.data.type:null}function x(e){let t=b(e);if(t)return{knownCode:t,rawType:t};if(typeof e!=`object`||!e)return{knownCode:null,rawType:null};let n=e,r=n.type||n.errorCode||n.code;if(r&&typeof r==`string`&&r.length>0)return{knownCode:null,rawType:r};let i=n;if(i.response?.data?.type){let e=i.response.data.type;if(typeof e==`string`&&e.length>0)return{knownCode:null,rawType:e}}return{knownCode:null,rawType:null}}function S(e){if(typeof e!=`object`||!e)return null;let t=e;if(`result`in t)return t.result;let n=t;return n.response?.data?.result?n.response.data.result:`originalError`in t&&t.originalError!=null&&typeof t.originalError==`object`&&`result`in t.originalError?t.originalError.result:null}const C={INSUFFICIENT_BALANCE:y.WITHDRAWAL_INSUFFICIENT_BALANCE,INSUFFICIENT_BALANCE_CANNOT_COVER_FEE:y.WITHDRAWAL_INSUFFICIENT_BALANCE_FOR_FEE,AMOUNT_BELOW_MINIMUM:y.WITHDRAWAL_AMOUNT_BELOW_MINIMUM,AMOUNT_ABOVE_MAXIMUM:y.WITHDRAWAL_AMOUNT_ABOVE_MAXIMUM,INVALID_ADDRESS:y.WITHDRAWAL_INVALID_ADDRESS,NETWORK_NOT_SUPPORTED:y.WITHDRAWAL_NETWORK_NOT_SUPPORTED},w={TWO_FACTOR_REQUIRED:y.WITHDRAWAL_2FA_REQUIRED_TOTP,SMS_CODE_REQUIRED:y.WITHDRAWAL_2FA_REQUIRED_SMS,KYC_REQUIRED:y.WITHDRAWAL_KYC_REQUIRED,INSUFFICIENT_BALANCE:y.WITHDRAWAL_INSUFFICIENT_BALANCE,RESOURCE_EXHAUSTED:y.QUOTE_EXPIRED};function T(e,t){let n=e,r=new Set,i=!1;function a(){if(i)throw Error(`Machine has been disposed`)}function o(){r.forEach(e=>{try{e(n)}catch(e){console.error(`Error in state listener:`,e)}})}return{getState(){return a(),n},send(e){a();let r=n;n=t(n,e),n!==r&&o()},subscribe(e){return a(),r.add(e),e(n),()=>{r.delete(e)}},dispose(){i||(r.clear(),i=!0)}}}function E(e,t,n,r=null){return{type:e,context:n?{...t,...n}:t,error:r}}function D(e,t,n,r){return{type:e,context:r?{...t,...r}:t,error:n}}const re={type:`idle`,context:{quoteId:``,walletId:``,idempotencyKey:``,retryCount:0,maxRetries:3},error:null};function ie(e,t){switch(e.type){case`idle`:if(t.type===`EXECUTE`)return{type:`processing`,context:{...e.context,quoteId:t.quoteId,walletId:t.walletId,idempotencyKey:crypto.randomUUID(),retryCount:0},error:null};break;case`processing`:switch(t.type){case`REQUIRES_2FA`:return{type:`waitingFor2FA`,context:{...e.context,requiredActions:[`2fa`]},error:null};case`REQUIRES_SMS`:return{type:`waitingForSMS`,context:{...e.context,requiredActions:[`sms`]},error:null};case`REQUIRES_KYC`:return{type:`waitingForKYC`,context:{...e.context,requiredActions:[`kyc`]},error:null};case`SUCCESS`:return{type:`completed`,context:{...e.context,transactionId:t.transactionId},error:null};case`FAIL`:return e.context.retryCount<e.context.maxRetries?{type:`retrying`,context:{...e.context,retryCount:e.context.retryCount+1,lastError:t.error},error:t.error}:{type:`failed`,context:{...e.context,lastError:t.error},error:t.error};case`BLOCKED`:return{type:`blocked`,context:e.context,error:Error(t.reason)}}break;case`waitingFor2FA`:if(t.type===`SUBMIT_2FA`)return{type:`processing`,context:{...e.context,twoFactorCode:t.code,requiredActions:void 0},error:null};break;case`waitingForSMS`:if(t.type===`SUBMIT_SMS`)return{type:`processing`,context:{...e.context,smsCode:t.code,requiredActions:void 0},error:null};break;case`retrying`:if(t.type===`RETRY`)return{type:`processing`,context:{...e.context,idempotencyKey:crypto.randomUUID()},error:null};break}return console.log(`No transition for action ${t.type} in state ${e.type}`),e}function O(e){return T({...re,context:{...re.context,...e}},ie)}function ae(e,t){if(e.type!==`idle`)return null;switch(t.type){case`LOAD_EXCHANGES`:return E(`exchanges:loading`,e.context);case`START_OAUTH`:return E(`oauth:waiting`,e.context,{exchange:t.exchange,walletId:t.walletId,idempotencyKey:t.idem,topicName:t.idem,isQRCodeFlow:!1});case`START_QRCODE`:return E(`qrcode:waiting`,e.context,{exchange:t.exchange,walletId:t.walletId,idempotencyKey:t.idem,topicName:t.idem,isQRCodeFlow:!0});default:return null}}function k(e,t){switch(e.type){case`exchanges:loading`:switch(t.type){case`EXCHANGES_LOADED`:return E(`exchanges:ready`,e.context,{exchanges:t.exchanges});case`EXCHANGES_FAILED`:return D(`exchanges:error`,e.context,t.error);default:return null}case`exchanges:ready`:return t.type===`START_OAUTH`?E(`oauth:waiting`,e.context,{exchange:t.exchange,walletId:t.walletId,idempotencyKey:t.idem,topicName:t.idem,isQRCodeFlow:!1}):t.type===`START_QRCODE`?E(`qrcode:waiting`,e.context,{exchange:t.exchange,walletId:t.walletId,idempotencyKey:t.idem,topicName:t.idem,isQRCodeFlow:!0}):null;default:return null}}function A(e,t){switch(e.type){case`oauth:waiting`:return t.type===`OAUTH_WINDOW_OPENED`?E(`oauth:processing`,e.context):null;case`oauth:processing`:switch(t.type){case`OAUTH_COMPLETED`:return E(`oauth:completed`,e.context,{walletId:t.walletId});case`OAUTH_FAILED`:return D(`oauth:error`,e.context,t.error,{oauthErrorType:`recoverable`});case`OAUTH_FATAL`:return D(`oauth:fatal`,e.context,t.error,{oauthErrorType:`fatal`});case`OAUTH_WINDOW_CLOSED_BY_USER`:return D(`oauth:window_closed_by_user`,e.context,t.error);default:return null}case`oauth:completed`:return t.type===`LOAD_WALLET`?E(`wallet:loading`,e.context):null;default:return null}}function oe(e,t){switch(e.type){case`qrcode:waiting`:switch(t.type){case`QRCODE_URL_RECEIVED`:return E(`qrcode:displaying`,e.context,{qrCodeUrl:t.qrCodeUrl,qrCodeExpiresAt:t.expiresAt,qrCodeStatus:`available`});case`QRCODE_FAILED`:return D(`qrcode:error`,e.context,t.error);case`QRCODE_FATAL`:return D(`qrcode:fatal`,e.context,t.error);default:return null}case`qrcode:displaying`:switch(t.type){case`QRCODE_STATUS_UPDATED`:return E(`qrcode:displaying`,e.context,{qrCodeStatus:t.qrCodeStatus,qrCodeExpiresAt:t.qrCodeExpiresAt??e.context.qrCodeExpiresAt});case`QRCODE_SCANNED`:return E(`qrcode:scanning`,e.context,{qrCodeStatus:`scanned`});case`QRCODE_COMPLETED`:return E(`oauth:completed`,e.context,{walletId:t.walletId,exchange:t.exchange});case`QRCODE_TIMEOUT`:return D(`qrcode:timeout`,e.context,Error(`QR code has expired`));case`QRCODE_FAILED`:return D(`qrcode:error`,e.context,t.error);case`QRCODE_FATAL`:return D(`qrcode:fatal`,e.context,t.error);default:return null}case`qrcode:scanning`:switch(t.type){case`QRCODE_STATUS_UPDATED`:return E(`qrcode:scanning`,e.context,{qrCodeStatus:t.qrCodeStatus,qrCodeExpiresAt:t.qrCodeExpiresAt??e.context.qrCodeExpiresAt});case`QRCODE_COMPLETED`:return E(`oauth:completed`,e.context,{walletId:t.walletId,exchange:t.exchange});case`QRCODE_FAILED`:return D(`qrcode:error`,e.context,t.error);case`QRCODE_FATAL`:return D(`qrcode:fatal`,e.context,t.error);default:return null}case`qrcode:error`:case`qrcode:timeout`:return t.type===`REFRESH_QRCODE`?E(`qrcode:waiting`,e.context,{qrCodeUrl:void 0,qrCodeExpiresAt:void 0,qrCodeStatus:void 0}):null;default:return null}}function se(e,t){switch(e.type){case`wallet:loading`:switch(t.type){case`WALLET_LOADED`:return E(`wallet:ready`,e.context,{walletBalances:t.balances});case`WALLET_FAILED`:return D(`wallet:error`,e.context,t.error);default:return null}case`wallet:ready`:return t.type===`REQUEST_QUOTE`?E(`quote:requesting`,e.context,{lastQuoteRequest:{asset:t.asset,amount:t.amount,destinationAddress:t.destinationAddress,network:t.network}}):null;default:return null}}function ce(e,t,n){switch(e.type){case`quote:requesting`:switch(t.type){case`QUOTE_RECEIVED`:return t.quote&&console.log(`[State Machine] quote:requesting received QUOTE_RECEIVED with ID:`,t.quote.id,`ExpiresAt:`,new Date(t.quote.expiresAt).toLocaleTimeString()),E(`quote:ready`,e.context,{quote:t.quote});case`QUOTE_FAILED`:return D(`quote:error`,e.context,t.error);default:return null}case`quote:ready`:switch(t.type){case`REQUEST_QUOTE`:return console.log(`[State Machine] quote:ready received REQUEST_QUOTE, transitioning to quote:requesting`),E(`quote:requesting`,e.context,{quote:void 0,lastQuoteRequest:{asset:t.asset,amount:t.amount,destinationAddress:t.destinationAddress,network:t.network}});case`QUOTE_EXPIRED`:return D(`quote:expired`,e.context,Error(`Quote has expired`));case`START_WITHDRAWAL`:return n.withdrawalMachine||(n.withdrawalMachine=O({quoteId:t.quoteId,walletId:e.context.walletId,maxRetries:e.context.maxRetryAttempts})),n.withdrawalMachine.send({type:`EXECUTE`,quoteId:t.quoteId,walletId:e.context.walletId}),E(`withdraw:processing`,e.context);default:return null}case`quote:expired`:return t.type===`REQUEST_QUOTE`?E(`quote:requesting`,e.context,{quote:void 0}):null;default:return null}}function le(e,t,n){return n.withdrawalMachine?(n.withdrawalMachine.send({type:`SUBMIT_2FA`,code:t.code}),E(`withdraw:processing`,e.context,{invalid2FAAttempts:0})):e}function ue(e,t,n){return n.withdrawalMachine?(n.withdrawalMachine.send({type:`SUBMIT_SMS`,code:t.code}),E(`withdraw:processing`,e.context)):e}function de(e,t){return t.withdrawalMachine?(t.withdrawalMachine.send({type:`RETRY`}),E(`withdraw:processing`,e.context)):e}function fe(e,t,n){if(!t.withdrawalMachine)return null;let r=t.withdrawalMachine.getState();switch(r.type){case`waitingFor2FA`:if(e.type!==`withdraw:error2FA`)return E(`withdraw:error2FA`,e.context);break;case`waitingForSMS`:if(e.type!==`withdraw:errorSMS`)return E(`withdraw:errorSMS`,e.context);break;case`waitingForKYC`:if(e.type!==`withdraw:errorKYC`)return E(`withdraw:errorKYC`,e.context);break;case`completed`:if(n.type===`WITHDRAWAL_COMPLETED`)return E(`withdraw:completed`,e.context,{withdrawal:{id:r.context.idempotencyKey,status:`completed`,transactionId:n.transactionId}});break;case`blocked`:if(n.type===`WITHDRAWAL_BLOCKED`)return D(`withdraw:blocked`,e.context,Error(n.reason));break;case`failed`:return D(`withdraw:fatal`,e.context,r.error||Error(`Withdrawal failed`));case`retrying`:if(e.type!==`withdraw:retrying`)return E(`withdraw:retrying`,e.context,{retryAttempts:e.context.retryAttempts+1});break}return null}function j(e,t,n){switch(t.type){case`SUBMIT_2FA`:if(e.type===`withdraw:error2FA`)return le(e,t,n);break;case`SUBMIT_SMS`:if(e.type===`withdraw:errorSMS`)return ue(e,t,n);break;case`RETRY_WITHDRAWAL`:if(e.type===`withdraw:retrying`)return de(e,n);break;case`WITHDRAWAL_2FA_INVALID`:return D(`withdraw:error2FA`,{...e.context,invalid2FAAttempts:(e.context.invalid2FAAttempts||0)+1},Error(`Invalid 2FA code`));case`WITHDRAWAL_INSUFFICIENT_BALANCE`:return D(`withdraw:errorBalance`,e.context,Error(`Insufficient balance`));case`WITHDRAWAL_REQUIRES_2FA`:if(n.withdrawalMachine&&(n.withdrawalMachine.send({type:`REQUIRES_2FA`}),n.withdrawalMachine.getState().type===`waitingFor2FA`))return E(`withdraw:error2FA`,e.context);break;case`WITHDRAWAL_REQUIRES_SMS`:if(n.withdrawalMachine&&(n.withdrawalMachine.send({type:`REQUIRES_SMS`}),n.withdrawalMachine.getState().type===`waitingForSMS`))return E(`withdraw:errorSMS`,e.context);break;case`WITHDRAWAL_REQUIRES_KYC`:if(n.withdrawalMachine&&(n.withdrawalMachine.send({type:`REQUIRES_KYC`}),n.withdrawalMachine.getState().type===`waitingForKYC`))return E(`withdraw:errorKYC`,e.context);break;case`WITHDRAWAL_REQUIRES_2FA_MULTI_STEPS`:return E(`withdraw:error2FAMultiStep`,e.context,{multiStep2FA:{bizNo:t.result.bizNo,steps:t.result.steps,relation:t.result.relation,collectedCodes:{},faceQrCodeUrl:t.result.steps.find(e=>e.type===`FACE`)?.metadata?.qrCodeUrl,faceQrCodeExpiresAt:t.result.steps.find(e=>e.type===`FACE`)?.metadata?.qrCodeValidSeconds?Date.now()+t.result.steps.find(e=>e.type===`FACE`).metadata.qrCodeValidSeconds*1e3:void 0,mfa:t.result.mfa}});case`SUBMIT_2FA_MULTI_STEP`:if(e.type===`withdraw:error2FAMultiStep`&&e.context.multiStep2FA){let n=t.stepType===`GOOGLE`?`twofa`:t.stepType===`EMAIL`?`emailCode`:`smsCode`;return E(`withdraw:processing`,{...e.context,multiStep2FA:{...e.context.multiStep2FA,collectedCodes:{...e.context.multiStep2FA.collectedCodes,[n]:t.code}}})}break;case`POLL_FACE_VERIFICATION`:if(e.type===`withdraw:error2FAMultiStep`)return E(`withdraw:processing`,e.context);break;case`POLL_ROAMING_FIDO_VERIFICATION`:if(e.type===`withdraw:error2FAMultiStep`)return E(`withdraw:processing`,e.context);break;case`WITHDRAWAL_2FA_INCOMPLETE`:if(e.context.multiStep2FA)return E(`withdraw:error2FAMultiStep`,e.context,{multiStep2FA:{...e.context.multiStep2FA,bizNo:t.result.bizNo,steps:t.result.steps,relation:t.result.relation,faceQrCodeUrl:t.result.steps.find(e=>e.type===`FACE`)?.metadata?.qrCodeUrl||e.context.multiStep2FA.faceQrCodeUrl,faceQrCodeExpiresAt:t.result.steps.find(e=>e.type===`FACE`)?.metadata?.qrCodeValidSeconds?Date.now()+t.result.steps.find(e=>e.type===`FACE`).metadata.qrCodeValidSeconds*1e3:e.context.multiStep2FA.faceQrCodeExpiresAt,mfa:t.result.mfa||e.context.multiStep2FA.mfa}});break;case`WITHDRAWAL_DRY_RUN_COMPLETE`:return e.context.multiStep2FA?E(`withdraw:readyToConfirm`,e.context,{multiStep2FA:{...e.context.multiStep2FA,bizNo:t.result.bizNo||e.context.multiStep2FA.bizNo,steps:t.result.steps||e.context.multiStep2FA.steps,relation:t.result.relation||e.context.multiStep2FA.relation,mfa:t.result.mfa||e.context.multiStep2FA.mfa}}):E(`withdraw:readyToConfirm`,e.context);case`CONFIRM_WITHDRAWAL`:return E(`withdraw:processing`,e.context);case`WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED`:{let n=t.result?.valid2FAMethods,r=me(n);return D(`withdraw:fatal`,{...e.context,errorDetails:{valid2FAMethods:n}},Error(r))}case`WITHDRAWAL_SUCCESS`:n.withdrawalMachine&&n.withdrawalMachine.send({type:`SUCCESS`,transactionId:t.transactionId});break;case`WITHDRAWAL_FATAL`:return D(`withdraw:fatal`,e.context,t.error)}return null}function M(e,t,n){return[`withdraw:processing`,`withdraw:error2FA`,`withdraw:error2FAMultiStep`,`withdraw:errorSMS`,`withdraw:errorKYC`,`withdraw:errorBalance`,`withdraw:retrying`,`withdraw:readyToConfirm`].includes(e.type)?fe(e,n,t)||j(e,t,n):null}function pe(e,t,n){return t.type===`CANCEL_FLOW`?(n.withdrawalMachine&&(n.withdrawalMachine.dispose(),n.withdrawalMachine=void 0),E(`flow:cancelled`,e.context)):null}function me(e){if(!e||e.length===0)return`Please make sure your Exchange account has 2FA enabled.`;if(e.length===1)return`${e[0]} is the only supported two-factor authentication method.`;if(e.length===2)return`${e[0]} and ${e[1]} are the only supported two-factor authentication methods.`;let t=e[e.length-1];return`${e.slice(0,-1).join(`, `)}, and ${t} are the only supported two-factor authentication methods.`}const he=e=>({orgId:e.orgId,projectId:e.projectId,retryAttempts:0,maxRetryAttempts:e.maxRetryAttempts||3,autoRefreshQuotation:e.autoRefreshQuotation===void 0?!0:e.autoRefreshQuotation}),N=e=>({type:`idle`,context:he(e),error:null});function ge(e,t,n){let r=pe(e,t,n);if(r)return r;let i=[()=>ae(e,t),()=>k(e,t),()=>A(e,t),()=>oe(e,t),()=>se(e,t),()=>ce(e,t,n),()=>M(e,t,n)];for(let e of i){let t=e();if(t!==null)return t}return e}function P(e){let t={machine:null,withdrawalMachine:void 0};t.machine=T(N(e),(e,n)=>ge(e,n,t));let n=t.machine.dispose;return t.machine.dispose=()=>{t.withdrawalMachine&&t.withdrawalMachine.dispose(),n()},t.machine}function _e(e){let t={id:e.id,name:e.name,displayName:e.displayName,minWithdrawal:e.minWithdrawal,maxWithdrawal:e.maxWithdrawal,assetName:e.assetName,contractAddressVerified:e.contractAddressVerified??!0};return e.addressRegex!==null&&e.addressRegex!==void 0&&(t.addressRegex=e.addressRegex),e.chainId!==null&&e.chainId!==void 0&&(t.chainId=e.chainId),e.tokenAddress!==null&&e.tokenAddress!==void 0&&(t.tokenAddress=e.tokenAddress),e.contractAddress!==null&&e.contractAddress!==void 0&&(t.contractAddress=e.contractAddress),t}function ve(e){let t={asset:e.asset,balance:String(e.amount),networks:e.networks.map(_e)};return e.amountInFiat!==void 0&&(t.balanceInFiat=String(e.amountInFiat)),e.extra!==void 0&&(t.extra=e.extra),t}function F(e){return e.map(ve)}var ye=class e{static handleWithdrawalError(t,n){if(!n)return!1;let r=b(t),i=e.mapErrorCodeToAction(r,t);return i?(n.send(i),!0):!1}static mapErrorCodeToAction(e,t){if(!e)return{type:`WITHDRAWAL_FATAL`,error:t instanceof Error?t:Error(t?.error||t?.message||`Failed to execute withdrawal`)};switch(e){case y.WITHDRAWAL_2FA_REQUIRED_TOTP:case w.TWO_FACTOR_REQUIRED:return{type:`WITHDRAWAL_REQUIRES_2FA`};case y.WITHDRAWAL_2FA_REQUIRED_SMS:case w.SMS_CODE_REQUIRED:return{type:`WITHDRAWAL_REQUIRES_SMS`};case y.WITHDRAWAL_2FA_REQUIRED_MULTI_STEPS:return{type:`WITHDRAWAL_REQUIRES_2FA_MULTI_STEPS`,result:S(t)};case y.WITHDRAWAL_2FA_INCOMPLETE:return{type:`WITHDRAWAL_2FA_INCOMPLETE`,result:S(t)};case y.WITHDRAWAL_DRY_RUN_COMPLETE:return{type:`WITHDRAWAL_DRY_RUN_COMPLETE`,result:S(t)};case y.WITHDRAWAL_KYC_REQUIRED:case w.KYC_REQUIRED:return{type:`WITHDRAWAL_REQUIRES_KYC`};case y.WITHDRAWAL_INSUFFICIENT_BALANCE:case w.INSUFFICIENT_BALANCE:return{type:`WITHDRAWAL_INSUFFICIENT_BALANCE`};case y.QUOTE_EXPIRED:case w.RESOURCE_EXHAUSTED:return{type:`QUOTE_EXPIRED`};case y.WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED:return{type:`WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED`,result:S(t)};case y.WITHDRAWAL_INVALID_ADDRESS:return{type:`WITHDRAWAL_FATAL`,error:Error(`Invalid destination address`)};case y.WITHDRAWAL_AMOUNT_BELOW_MINIMUM:return{type:`WITHDRAWAL_FATAL`,error:Error(`Amount below minimum`)};case y.WITHDRAWAL_AMOUNT_ABOVE_MAXIMUM:return{type:`WITHDRAWAL_FATAL`,error:Error(`Amount above maximum`)};default:return{type:`WITHDRAWAL_FATAL`,error:t instanceof Error?t:Error(t?.error||t?.message||`Failed to execute withdrawal`)}}}static isRecoverableError(e){let t=b(e);return t?[y.WITHDRAWAL_2FA_REQUIRED_TOTP,y.WITHDRAWAL_2FA_REQUIRED_SMS,y.WITHDRAWAL_2FA_REQUIRED_MULTI_STEPS,y.WITHDRAWAL_2FA_INCOMPLETE,y.WITHDRAWAL_2FA_INVALID,y.WITHDRAWAL_KYC_REQUIRED,y.WITHDRAWAL_INSUFFICIENT_BALANCE,y.QUOTE_EXPIRED,w.TWO_FACTOR_REQUIRED,w.SMS_CODE_REQUIRED,w.KYC_REQUIRED,w.INSUFFICIENT_BALANCE,w.RESOURCE_EXHAUSTED].includes(t):!1}static isFatalError(t){return!e.isRecoverableError(t)}};const be=`qrcode`;function xe(){return{get(e){try{if(typeof localStorage<`u`)return localStorage.getItem(e)}catch{}return null},set(e,t){try{typeof localStorage<`u`&&localStorage.setItem(e,t)}catch{}},remove(e){try{typeof localStorage<`u`&&localStorage.removeItem(e)}catch{}}}}var Se=class{constructor(e){t(this,`adapter`,void 0),t(this,`prefix`,void 0),t(this,`minRemainingLifetimeSec`,void 0),t(this,`disabled`,void 0),this.adapter=e?.adapter||xe(),this.prefix=e?.prefix??`bluvo:`,this.minRemainingLifetimeSec=e?.minRemainingLifetimeSec??15,this.disabled=e?.disabled??!1}buildKey(e,t){return`${this.prefix}${e}:${t}`}async getCachedQRCode(e){if(this.disabled)return null;try{let t=this.buildKey(e,be),n=await this.adapter.get(t);if(!n)return null;let r=JSON.parse(n);if(!r?.message)return null;let i=r.message.qrCodeExpiresAt;return i?i-Date.now()<=this.minRemainingLifetimeSec*1e3?(await this.adapter.remove(t),null):r.message:null}catch{return null}}async cacheQRCode(e,t){if(!this.disabled&&!(!t.qrCodeUrl||!t.qrCodeExpiresAt))try{let n=this.buildKey(e,be),r={message:t,cachedAt:Date.now()};await this.adapter.set(n,JSON.stringify(r))}catch{}}async removeCachedQRCode(e){if(!this.disabled)try{let t=this.buildKey(e,be);await this.adapter.remove(t)}catch{}}};const Ce=[`binance-web`],I=300*1e3;var we=class{constructor(e){t(this,`webClient`,void 0),t(this,`flowMachine`,void 0),t(this,`subscription`,void 0),t(this,`generateId`,void 0),t(this,`quoteRefreshTimer`,void 0),t(this,`qrCodeTimeoutTimer`,void 0),t(this,`cache`,void 0),t(this,`options`,void 0),this.options=e,this.webClient=v.createClient({orgId:e.orgId,projectId:e.projectId,sandbox:e.options?.sandbox,dev:e.options?.dev,customDomain:e.options?.customDomain}),this.generateId=e.mkUUIDFn||(()=>crypto.randomUUID()),this.cache=new Se(e.cache)}async loadExchanges(e){this.flowMachine||(this.flowMachine=P({orgId:this.options.orgId,projectId:this.options.projectId,maxRetryAttempts:this.options.options?.maxRetryAttempts,autoRefreshQuotation:this.options.options?.autoRefreshQuotation})),this.flowMachine.send({type:`LOAD_EXCHANGES`});let t;try{t=await this.options.listExchangesFn(e)}catch(e){let t=x(e),n=e instanceof Error?e.message:`Failed to load exchanges`,r=Error(n);return this.flowMachine?.send({type:`EXCHANGES_FAILED`,error:r}),{success:!1,error:n,type:t.rawType||void 0}}if(!t||!Array.isArray(t)){let e=`Failed to load exchanges: Invalid response`,t=Error(e);return this.flowMachine?.send({type:`EXCHANGES_FAILED`,error:t}),{success:!1,error:e}}return this.flowMachine?.send({type:`EXCHANGES_LOADED`,exchanges:t}),{exchanges:t,success:!0,result:t}}async startWithdrawalFlow(e){let{data:t,error:n,success:r}=await this.options.getWalletByIdFn(e.walletId);if(r&&t?.exchange)return this.resumeWithdrawalFlow({exchange:t.exchange,walletId:e.walletId});if(r||console.warn(`Error checking wallet existence:`,n?.error||n?.message||`Unknown error`),Ce.includes(e.exchange.toLowerCase()))return this.startQRCodeFlow(e);this.dispose(),this.flowMachine=P({orgId:this.options.orgId,projectId:this.options.projectId,maxRetryAttempts:this.options.options?.maxRetryAttempts,autoRefreshQuotation:this.options.options?.autoRefreshQuotation});let i=this.generateId();this.flowMachine.send({type:`START_OAUTH`,exchange:e.exchange,walletId:e.walletId,idem:i}),this.subscription=await this.webClient.listen(i,{onOAuth2Complete:e=>{this.flowMachine?.send({type:`OAUTH_COMPLETED`,walletId:e.walletId,exchange:e.exchange}),this.options.onWalletConnectedFn&&this.options.onWalletConnectedFn(e.walletId,e.exchange),this.loadWallet(e.walletId)},onError:e=>{let t=b(e),n;if(e instanceof Error)n=e;else{let t=e&&typeof e==`object`&&`message`in e?String(e.message):`OAuth authentication failed`;n=Error(t)}t===y.OAUTH_TOKEN_EXCHANGE_FAILED?this.flowMachine?.send({type:`OAUTH_FATAL`,error:n}):(t===y.OAUTH_AUTHORIZATION_FAILED||y.OAUTH_INVALID_STATE,this.flowMachine?.send({type:`OAUTH_FAILED`,error:n}))}});let a=await this.webClient.oauth2.openWindow(e.exchange,{walletId:e.walletId,idem:i},{onWindowClose:()=>{}},e.popupOptions);return this.flowMachine.send({type:`OAUTH_WINDOW_OPENED`}),{machine:this.flowMachine,closeOAuthWindow:a}}handleQRCodeReceived(e,t,n){console.log(`qrcode received message:`,e);let r=e.qrCodeStatus;if(r===`expired`||r===`used`){this.qrCodeTimeoutTimer&&(clearTimeout(this.qrCodeTimeoutTimer),this.qrCodeTimeoutTimer=void 0),this.cache.removeCachedQRCode(t);let e=this.flowMachine?.getState();(e?.type===`qrcode:displaying`||e?.type===`qrcode:scanning`)&&this.flowMachine?.send({type:`QRCODE_TIMEOUT`});return}if(r===`scanned`){this.cache.removeCachedQRCode(t),this.flowMachine?.send({type:`QRCODE_STATUS_UPDATED`,qrCodeStatus:r,qrCodeExpiresAt:e.qrCodeExpiresAt||e.expiresAt}),this.flowMachine?.send({type:`QRCODE_SCANNED`});return}if(r===`confirmed`){this.cache.removeCachedQRCode(t),this.flowMachine?.send({type:`QRCODE_STATUS_UPDATED`,qrCodeStatus:r,qrCodeExpiresAt:e.qrCodeExpiresAt||e.expiresAt});return}let i=this.flowMachine?.getState();if(i?.type===`qrcode:waiting`&&e.qrCodeUrl){this.qrCodeTimeoutTimer&&clearTimeout(this.qrCodeTimeoutTimer);let n=e.qrCodeExpiresAt||e.expiresAt,r=n?Math.max(0,n-Date.now()):I;this.flowMachine?.send({type:`QRCODE_URL_RECEIVED`,qrCodeUrl:e.qrCodeUrl,expiresAt:n||Date.now()+I}),this.cache.cacheQRCode(t,e),this.qrCodeTimeoutTimer=setTimeout(()=>{let e=this.flowMachine?.getState();(e?.type===`qrcode:displaying`||e?.type===`qrcode:scanning`)&&this.flowMachine?.send({type:`QRCODE_TIMEOUT`})},r)}else r&&(i?.type===`qrcode:displaying`||i?.type===`qrcode:scanning`)&&this.flowMachine?.send({type:`QRCODE_STATUS_UPDATED`,qrCodeStatus:r,qrCodeExpiresAt:e.qrCodeExpiresAt||e.expiresAt})}handleQRCodeComplete(e,t,n){this.flowMachine?.send({type:`QRCODE_COMPLETED`,walletId:e.walletId,exchange:e.exchange}),this.options.onWalletConnectedFn&&this.options.onWalletConnectedFn(e.walletId,e.exchange),this.qrCodeTimeoutTimer&&(clearTimeout(this.qrCodeTimeoutTimer),this.qrCodeTimeoutTimer=void 0),this.cache.removeCachedQRCode(t),this.loadWallet(e.walletId)}handleQRCodeError(e,t,n){this.qrCodeTimeoutTimer&&(clearTimeout(this.qrCodeTimeoutTimer),this.qrCodeTimeoutTimer=void 0),this.cache.removeCachedQRCode(t),this.flowMachine?.send({type:`QRCODE_FAILED`,error:e})}handleQRCodeFlowError(e,t,n){let r=b(e),i;if(e instanceof Error)i=e;else{let t=e&&typeof e==`object`&&`message`in e?String(e.message):`QR code authentication failed`;i=Error(t)}this.qrCodeTimeoutTimer&&(clearTimeout(this.qrCodeTimeoutTimer),this.qrCodeTimeoutTimer=void 0),this.cache.removeCachedQRCode(t),r===y.OAUTH_TOKEN_EXCHANGE_FAILED?this.flowMachine?.send({type:`QRCODE_FATAL`,error:i}):this.flowMachine?.send({type:`QRCODE_FAILED`,error:i})}async startQRCodeFlow(e){this.dispose();let t=e.exchange,n=e.walletId,r=await this.cache.getCachedQRCode(t),i=r?.walletId===n?r:null;r&&!i&&await this.cache.removeCachedQRCode(t),this.flowMachine=P({orgId:this.options.orgId,projectId:this.options.projectId,maxRetryAttempts:this.options.options?.maxRetryAttempts,autoRefreshQuotation:this.options.options?.autoRefreshQuotation});let a=this.generateId();this.flowMachine.send({type:`START_QRCODE`,exchange:t,walletId:n,idem:a}),this.subscription=await this.webClient.listen(a,{onOAuth2Complete:e=>{this.handleQRCodeComplete(e,t,n)},onQRCodeReceived:e=>{this.handleQRCodeReceived(e,t,n)},onQRCodeComplete:e=>{this.handleQRCodeComplete(e,t,n)},onQRCodeError:e=>{this.handleQRCodeError(e,t,n)},onError:e=>{this.handleQRCodeFlowError(e,t,n)}}),i&&(console.log(`[BluvoCache] Replaying cached QR code for`,t),this.handleQRCodeReceived(i,t,n));let{url:o,data:s,success:c,error:l}=await this.webClient.oauth2.getURL(t,{walletId:n,idem:a});if((!c||!o)&&!i){console.error(`Failed to get QR code URL:`,l);let e=typeof l==`string`?l:l?.message||l?.error||`Failed to get QR code URL`;this.flowMachine?.send({type:`QRCODE_FAILED`,error:Error(e)})}if(s?.isQRCode===!1){let e=`Exchange does not support QR code authentication`;return console.error(e,{exchange:t,data:s}),this.flowMachine?.send({type:`QRCODE_FAILED`,error:Error(e)}),{machine:this.flowMachine,closeOAuthWindow:null}}if(o)try{let e=await fetch(o,{method:`GET`,credentials:`include`});e.ok||console.error(`Failed to trigger QR code generation:`,e.status,e.statusText)}catch(e){console.error(`Error triggering QR code generation:`,e)}return{machine:this.flowMachine,closeOAuthWindow:null}}async refreshQRCode(){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};let e=this.flowMachine.getState();if(e.type!==`qrcode:error`&&e.type!==`qrcode:timeout`)return{success:!1,error:`Cannot refresh QR code in state: ${e.type}`};if(!e.context.exchange||!e.context.walletId)return{success:!1,error:`Exchange or wallet ID not found in state`};let t=e.context.exchange,n=e.context.walletId;await this.cache.removeCachedQRCode(t),this.flowMachine.send({type:`REFRESH_QRCODE`});let r=this.generateId();this.subscription&&await this.webClient.unsubscribe(this.subscription.topicName),this.subscription=await this.webClient.listen(r,{onOAuth2Complete:e=>{this.handleQRCodeComplete(e,t,n)},onQRCodeReceived:e=>{this.handleQRCodeReceived(e,t,n)},onQRCodeComplete:e=>{this.handleQRCodeComplete(e,t,n)},onQRCodeError:e=>{this.handleQRCodeError(e,t,n)},onError:e=>{this.handleQRCodeFlowError(e,t,n)}});let{url:i,success:a,error:o}=await this.webClient.oauth2.getURL(e.context.exchange,{walletId:e.context.walletId,idem:r});if(!a||!i){console.error(`Failed to refresh QR code URL:`,o);let e=typeof o==`string`?o:o?.message||o?.error||`Failed to refresh QR code URL`;return this.flowMachine?.send({type:`QRCODE_FAILED`,error:Error(e)}),{success:!1,error:e}}try{let e=await fetch(i,{method:`GET`,credentials:`include`});e.ok||console.error(`Failed to trigger QR code refresh:`,e.status,e.statusText)}catch(e){console.error(`Error triggering QR code refresh:`,e)}return{success:!0}}async resumeWithdrawalFlow(e){return this.dispose(),this.flowMachine=P({orgId:this.options.orgId,projectId:this.options.projectId,maxRetryAttempts:this.options.options?.maxRetryAttempts,autoRefreshQuotation:this.options.options?.autoRefreshQuotation}),this.flowMachine.send({type:`START_OAUTH`,exchange:e.exchange,walletId:e.walletId,idem:this.generateId()}),this.flowMachine.send({type:`OAUTH_WINDOW_OPENED`}),this.flowMachine.send({type:`OAUTH_COMPLETED`,walletId:e.walletId,exchange:e.exchange}),this.options.onWalletConnectedFn&&this.options.onWalletConnectedFn(e.walletId,e.exchange),this.loadWallet(e.walletId),{machine:this.flowMachine,closeOAuthWindow:null}}async silentResumeWithdrawalFlow(e){this.dispose(),this.flowMachine=P({orgId:this.options.orgId,projectId:this.options.projectId,maxRetryAttempts:this.options.options?.maxRetryAttempts,autoRefreshQuotation:this.options.options?.autoRefreshQuotation});let t=e.preloadedBalances;if(!t){let{data:n,error:r,success:i}=await this.options.pingWalletByIdFn(e.walletId);if(!i){b(r)===y.WALLET_NOT_FOUND&&e.onWalletNotFound?.(e.walletId),console.warn(`Failed to ping wallet:`,r?.error||r?.message||`Failed to ping wallet`);return}if(n?.status===`INVALID_API_CREDENTIALS`){e.onWalletInvalidApiCredentials?.(e.walletId),console.warn(`Invalid API credentials for wallet`);return}let{data:a,error:o,success:s}=await this.options.fetchWithdrawableBalanceFn(e.walletId);if(!s){b(o)===y.WALLET_NOT_FOUND&&e.onWalletNotFound?.(e.walletId),console.warn(`Failed to fetch withdrawable balance:`,o?.error||o?.message||`Failed to fetch withdrawable balance`);return}t=a?.balances?F(a.balances):[],e.onWalletBalance?.(e.walletId,t)}return this.flowMachine.send({type:`START_OAUTH`,exchange:e.exchange,walletId:e.walletId,idem:this.generateId()}),this.flowMachine.send({type:`OAUTH_WINDOW_OPENED`}),this.flowMachine.send({type:`OAUTH_COMPLETED`,walletId:e.walletId,exchange:e.exchange}),this.flowMachine.send({type:`LOAD_WALLET`}),this.flowMachine.send({type:`WALLET_LOADED`,balances:t}),{machine:this.flowMachine}}async loadWallet(e){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};this.flowMachine.send({type:`LOAD_WALLET`});let{data:t,error:n,success:r}=await this.options.fetchWithdrawableBalanceFn(e);if(!r){let e=x(n),t=n instanceof Error?n.message:n?.error||n?.message||`Failed to load wallet`,r=Error(t);return this.flowMachine?.send({type:`WALLET_FAILED`,error:r}),{success:!1,error:t,type:e.rawType||void 0}}if(!t?.balances){let e=`No balance data returned`,t=Error(e);return this.flowMachine?.send({type:`WALLET_FAILED`,error:t}),{success:!1,error:e}}let i=F(t.balances);return this.flowMachine?.send({type:`WALLET_LOADED`,balances:i}),{balances:i,success:!0,result:{balances:i}}}async requestQuote(e){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};let t=this.flowMachine.getState();if(!t.context.walletId)return{success:!1,error:`Wallet ID not found in state`};console.log(`[SDK] requestQuote called, current state:`,t.type,`amount:`,e.amount),this.flowMachine.send({type:`REQUEST_QUOTE`,asset:e.asset,amount:e.amount,destinationAddress:e.destinationAddress,network:e.network}),console.log(`[SDK] REQUEST_QUOTE action sent to state machine`);let{data:n,error:r,success:i}=await this.options.requestQuotationFn(t.context.walletId,{asset:e.asset,amount:e.amount,address:e.destinationAddress,network:e.network,tag:e.tag,includeFee:e.includeFee??!0});if(!i){let e=x(r),t;if(e.knownCode)switch(e.knownCode){case y.WITHDRAWAL_INSUFFICIENT_BALANCE:case y.WITHDRAWAL_INSUFFICIENT_BALANCE_FOR_FEE:case C.INSUFFICIENT_BALANCE:case C.INSUFFICIENT_BALANCE_CANNOT_COVER_FEE:t=Error(`Insufficient balance`);break;case y.WITHDRAWAL_AMOUNT_BELOW_MINIMUM:case C.AMOUNT_BELOW_MINIMUM:t=Error(`Amount below minimum`);break;case y.WITHDRAWAL_AMOUNT_ABOVE_MAXIMUM:case C.AMOUNT_ABOVE_MAXIMUM:t=Error(`Amount above maximum`);break;case y.WITHDRAWAL_INVALID_ADDRESS:case C.INVALID_ADDRESS:t=Error(`Invalid destination address`);break;case y.WITHDRAWAL_NETWORK_NOT_SUPPORTED:case C.NETWORK_NOT_SUPPORTED:t=Error(`Network not supported`);break;default:t=r instanceof Error?r:Error(r?.error||r?.message||`Failed to get quote`)}else t=r instanceof Error?r:Error(r?.error||r?.message||`Failed to get quote`);return this.flowMachine?.send({type:`QUOTE_FAILED`,error:t}),{success:!1,error:t.message,type:e.rawType||void 0}}if(!n){let e=`No quote returned from backend`;return this.flowMachine?.send({type:`QUOTE_FAILED`,error:Error(e)}),{success:!1,error:e}}console.log(`[SDK] Backend returned quote with ID:`,n.id,`ExpiresAt:`,n.expiresAt);let a={id:n.id,asset:n.asset,amount:String(n.amountNoFee),estimatedFee:String(n.estimatedFee),estimatedTotal:String(n.estimatedTotal),amountWithFeeInFiat:String(n.amountWithFeeInFiat),amountNoFeeInFiat:String(n.amountNoFeeInFiat),estimatedFeeInFiat:String(n.estimatedFeeInFiat),additionalInfo:n.additionalInfo,expiresAt:new Date(n.expiresAt).getTime()};console.log(`[SDK] Sending QUOTE_RECEIVED action with new quote ID:`,a.id,`ExpiresAt:`,new Date(a.expiresAt).toLocaleTimeString()),this.flowMachine?.send({type:`QUOTE_RECEIVED`,quote:a}),this.quoteRefreshTimer&&clearTimeout(this.quoteRefreshTimer);let o=new Date(n.expiresAt).getTime()-Date.now();return o>0&&(this.quoteRefreshTimer=setTimeout(()=>{let e=this.flowMachine?.getState();e?.type===`quote:ready`&&e.context.quote?.id===n.id&&((e.context.autoRefreshQuotation===void 0||e.context.autoRefreshQuotation)&&e.context.lastQuoteRequest?(console.log(`[SDK] Quote expired, auto-refreshing...`),this.requestQuote(e.context.lastQuoteRequest)):(console.log(`[SDK] Quote expired, transitioning to expired state`),this.flowMachine?.send({type:`QUOTE_EXPIRED`})))},o)),{rawQuote:n,quoteData:a,success:!0,result:{rawQuote:n,quoteData:a}}}async executeWithdrawal(e){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};let t=this.flowMachine.getState();if(!t.context.walletId)return{success:!1,error:`Wallet ID not found in state`};if(t.type!==`quote:ready`)return{success:!1,error:`Cannot execute withdrawal in state: ${t.type}`};this.flowMachine.send({type:`START_WITHDRAWAL`,quoteId:e}),this.subscription&&await this.webClient.unsubscribe(this.subscription.topicName),this.subscription=await this.webClient.listen(e,{onWithdrawComplete:e=>{if(console.log(`onWithdrawComplete received:`,e),e.success&&e.type===_.WithdrawFunds){console.log(`Withdrawal completed successfully, transitioning state machine`),console.log(`Current flow machine state before completion:`,this.flowMachine?.getState()?.type),this.flowMachine?.send({type:`WITHDRAWAL_SUCCESS`,transactionId:e.transactionId||e.walletId||`completed`}),this.flowMachine?.send({type:`WITHDRAWAL_COMPLETED`,transactionId:e.transactionId||e.walletId||`completed`});let t=this.flowMachine?.getState();console.log(`Flow machine state after completion actions:`,t?.type)}},onStep:e=>{if(e.type===_.WithdrawFunds){let t=e;this.flowMachine?.send({type:`WITHDRAWAL_PROGRESS`,message:t.step})}},onError:e=>{switch(b(e)){case y.WITHDRAWAL_2FA_REQUIRED_TOTP:this.flowMachine?.send({type:`WITHDRAWAL_REQUIRES_2FA`});return;case y.WITHDRAWAL_2FA_REQUIRED_SMS:this.flowMachine?.send({type:`WITHDRAWAL_REQUIRES_SMS`});return;case y.WITHDRAWAL_2FA_INVALID:this.flowMachine?.send({type:`WITHDRAWAL_2FA_INVALID`});return;case y.WITHDRAWAL_KYC_REQUIRED:this.flowMachine?.send({type:`WITHDRAWAL_REQUIRES_KYC`});return;case y.WITHDRAWAL_INSUFFICIENT_BALANCE:this.flowMachine?.send({type:`WITHDRAWAL_INSUFFICIENT_BALANCE`});return;case y.WITHDRAWAL_INVALID_ADDRESS:this.flowMachine?.send({type:`WITHDRAWAL_FATAL`,error:Error(`Invalid destination address`)});return;case y.WITHDRAWAL_AMOUNT_BELOW_MINIMUM:this.flowMachine?.send({type:`WITHDRAWAL_FATAL`,error:Error(`Amount below minimum`)});return;case y.QUOTE_EXPIRED:this.flowMachine?.send({type:`QUOTE_EXPIRED`});return;case y.WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED:this.flowMachine?.send({type:`WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED`,result:S(e)});return;case y.WITHDRAWAL_2FA_REQUIRED_MULTI_STEPS:this.flowMachine?.send({type:`WITHDRAWAL_REQUIRES_2FA_MULTI_STEPS`,result:S(e)});return;case y.WITHDRAWAL_2FA_INCOMPLETE:this.flowMachine?.send({type:`WITHDRAWAL_2FA_INCOMPLETE`,result:S(e)});return;case y.WITHDRAWAL_DRY_RUN_COMPLETE:this.flowMachine?.send({type:`WITHDRAWAL_DRY_RUN_COMPLETE`,result:S(e)});return}console.error(`Unhandled withdrawal error`,e),this.flowMachine?.send({type:`WITHDRAWAL_FATAL`,error:e})}});let{data:n,error:r,success:i}=await this.options.executeWithdrawalFn(t.context.walletId,e,e,{});if(!i){let e=x(r),t=r instanceof Error?r.message:r?.error||r?.message||`Failed to execute withdrawal`;return console.error(`executeWithdrawal error`,r),this.handleWithdrawalError(r),{success:!1,error:t,type:e.rawType||void 0}}return{...n??{},success:!0,result:n}}async submit2FA(e){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};let t=this.flowMachine.getState();if(t.type!==`withdraw:error2FA`)return{success:!1,error:`Cannot submit 2FA in state: ${t.type}`};if(!t.context.quote||!t.context.walletId)return{success:!1,error:`Quote or wallet ID not found in state`};this.flowMachine.send({type:`SUBMIT_2FA`,code:e});let n=t.context.quote,r=this.generateId(),{data:i,error:a,success:o}=await this.options.executeWithdrawalFn(t.context.walletId,r,n.id,{twofa:e});if(!o){let e=x(a),t=a instanceof Error?a.message:a?.error||a?.message||`Failed to submit 2FA code`;return this.handleWithdrawalError(a),{success:!1,error:t,type:e.rawType||void 0}}return{...i??{},success:!0,result:i}}async submitSMS(e){if(!this.flowMachine)return;let t=this.flowMachine.getState();if(t.type!==`withdraw:errorSMS`)return;this.flowMachine.send({type:`SUBMIT_SMS`,code:e});let n=t.context.quote;if(n&&t.context.walletId){let r=this.generateId(),{data:i,error:a,success:o}=await this.options.executeWithdrawalFn(t.context.walletId,r,n.id,{smsCode:e});if(!o){this.handleWithdrawalError(a);return}return i}}async retryWithdrawal(){if(!this.flowMachine)return;let e=this.flowMachine.getState();if(e.type!==`withdraw:retrying`)return;this.flowMachine.send({type:`RETRY_WITHDRAWAL`});let t=e.context.quote;if(t)return await this.executeWithdrawal(t.id)}async submit2FAMultiStep(e,t){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};let n=this.flowMachine.getState();if(n.type!==`withdraw:error2FAMultiStep`)return{success:!1,error:`Cannot submit multi-step 2FA in state: ${n.type}`};if(!n.context.quote||!n.context.walletId||!n.context.multiStep2FA)return{success:!1,error:`Quote, wallet ID, or multi-step 2FA context not found`};this.flowMachine.send({type:`SUBMIT_2FA_MULTI_STEP`,stepType:e,code:t});let r=n.context.multiStep2FA,i={...r.collectedCodes};e===`GOOGLE`?i.twofa=t:e===`EMAIL`?i.emailCode=t:e===`SMS`&&(i.smsCode=t);let a=n.context.quote,o=this.generateId(),{data:s,error:c,success:l}=await this.options.executeWithdrawalFn(n.context.walletId,o,a.id,{bizNo:r.bizNo,...i});if(!l){let e=x(c),t=c instanceof Error?c.message:c?.error||c?.message||`Failed to submit multi-step 2FA`;return this.handleWithdrawalError(c),{success:!1,error:t,type:e.rawType||void 0}}return{success:!0,result:s}}async confirmWithdrawal(){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};let e=this.flowMachine.getState();if(e.type!==`withdraw:readyToConfirm`)return{success:!1,error:`Cannot confirm withdrawal in state: ${e.type}`};if(!e.context.quote||!e.context.walletId||!e.context.multiStep2FA)return{success:!1,error:`Quote, wallet ID, or multi-step 2FA context not found`};this.flowMachine.send({type:`CONFIRM_WITHDRAWAL`});let t=e.context.multiStep2FA,n=e.context.quote,r=this.generateId(),{data:i,error:a,success:o}=await this.options.executeWithdrawalFn(e.context.walletId,r,n.id,{bizNo:t.bizNo,...t.collectedCodes});if(!o){let e=x(a),t=a instanceof Error?a.message:a?.error||a?.message||`Failed to confirm withdrawal`;return this.handleWithdrawalError(a),{success:!1,error:t,type:e.rawType||void 0}}return{success:!0,result:i}}async pollFaceVerification(){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};let e=this.flowMachine.getState();if(e.type!==`withdraw:error2FAMultiStep`)return{success:!1,error:`Cannot poll FACE verification in state: ${e.type}`};if(!e.context.quote||!e.context.walletId||!e.context.multiStep2FA)return{success:!1,error:`Quote, wallet ID, or multi-step 2FA context not found`};let t=e.context.multiStep2FA,n=e.context.quote,r=this.generateId(),{data:i,error:a,success:o}=await this.options.executeWithdrawalFn(e.context.walletId,r,n.id,{bizNo:t.bizNo,dryRun:!0});if(!o){let e=x(a),t=a instanceof Error?a.message:a?.error||a?.message||`Failed to poll FACE verification`;return this.handleWithdrawalError(a),{success:!1,error:t,type:e.rawType||void 0}}return{success:!0,result:i}}async pollRoamingFidoVerification(){if(!this.flowMachine)return{success:!1,error:`Flow machine not initialized`};let e=this.flowMachine.getState();if(e.type!==`withdraw:error2FAMultiStep`)return{success:!1,error:`Cannot poll ROAMING_FIDO verification in state: ${e.type}`};if(!e.context.quote||!e.context.walletId||!e.context.multiStep2FA)return{success:!1,error:`Quote, wallet ID, or multi-step 2FA context not found`};let t=e.context.multiStep2FA,n=e.context.quote,r=this.generateId(),{data:i,error:a,success:o}=await this.options.executeWithdrawalFn(e.context.walletId,r,n.id,{bizNo:t.bizNo,dryRun:!0});if(!o){let e=x(a),t=a instanceof Error?a.message:a?.error||a?.message||`Failed to poll ROAMING_FIDO verification`;return this.handleWithdrawalError(a),{success:!1,error:t,type:e.rawType||void 0}}return{success:!0,result:i}}handleWithdrawalError(e){ye.handleWithdrawalError(e,this.flowMachine)}getState(){return this.flowMachine?.getState()}subscribe(e){return this.flowMachine?.subscribe(e)||(()=>{})}cancel(){this.flowMachine?.send({type:`CANCEL_FLOW`}),this.dispose()}dispose(){this.quoteRefreshTimer&&(clearTimeout(this.quoteRefreshTimer),this.quoteRefreshTimer=void 0),this.qrCodeTimeoutTimer&&(clearTimeout(this.qrCodeTimeoutTimer),this.qrCodeTimeoutTimer=void 0),this.subscription&&(this.webClient.unsubscribe(this.subscription.topicName),this.subscription=void 0),this.flowMachine&&(this.flowMachine.dispose(),this.flowMachine=void 0)}testWithdrawalComplete(e){console.log(`🧪 TEST: Simulating withdrawal completion`);let t={type:`withdraw`,success:!0,walletId:`test-wallet-id-${Date.now()}`,step:`complete`,stepIndex:4,totalSteps:4,transactionId:e||`test-transaction-${Date.now()}`};if(t.success&&t.type===`withdraw`){console.log(`🧪 TEST: Withdrawal completed successfully, transitioning state machine`),console.log(`🧪 TEST: Current flow machine state before completion:`,this.flowMachine?.getState()?.type),this.flowMachine?.send({type:`WITHDRAWAL_SUCCESS`,transactionId:t.transactionId}),this.flowMachine?.send({type:`WITHDRAWAL_COMPLETED`,transactionId:t.transactionId});let e=this.flowMachine?.getState();console.log(`🧪 TEST: Flow machine state after completion actions:`,e?.type)}}};function L(e){let[t,n]=u(()=>e?.getState()||null),r=te(e);return r.current=e,l(()=>{if(!e){n(null);return}return n(e.getState()),e.subscribe(e=>{n(e)})},[e]),{state:t,send:c(e=>{r.current?.send(e)},[]),isInState:e=>t?.type===e,hasError:t?.error!==null,error:t?.error,context:t?.context}}function Te(e){let[t]=u(()=>new we(e)),[n,r]=u(null),[i,a]=u([]),[o,s]=u(!1),[ee,d]=u(null),f=te(null),p=L(n),m=c(async e=>{let n=await t.startWithdrawalFlow(e);return r(n.machine),n.closeOAuthWindow&&(f.current=n.closeOAuthWindow),n},[t]),h=c(async e=>{let n=await t.resumeWithdrawalFlow(e);return r(n.machine),n},[t]),g=c(async e=>{let n=await t.silentResumeWithdrawalFlow(e);return n?(r(n.machine),n):(console.error(`Error resuming withdrawal flow silently`),null)},[t]),_=c(async e=>await t.requestQuote(e),[t]),v=c(async e=>await t.executeWithdrawal(e),[t]),y=c(async e=>await t.submit2FA(e),[t]),ne=c(async e=>await t.submitSMS(e),[t]),b=c(async()=>await t.retryWithdrawal(),[t]),x=c(async(e,n)=>await t.submit2FAMultiStep(e,n),[t]),S=c(async()=>await t.pollFaceVerification(),[t]),C=c(async()=>await t.pollRoamingFidoVerification(),[t]),w=c(async()=>await t.confirmWithdrawal(),[t]),T=c(async e=>{s(!0),d(null);try{let n=await t.loadExchanges(e);if(!n)return console.error(`Error loading exchanges`),null;if(!n.success){let e=Error(n.error||`Failed to load exchanges`);throw d(e),e}let r=n.exchanges||n.result||[];return a(r),r}catch(e){let t=e instanceof Error?e:Error(`Failed to load exchanges`);throw d(t),t}finally{s(!1)}},[t]),E=c(()=>{t.cancel(),r(null),f.current&&(f.current(),f.current=null)},[t]),D=c(async()=>await t.refreshQRCode(),[t]),re=c(e=>{t.testWithdrawalComplete(e)},[t]);return l(()=>()=>{t.dispose(),f.current&&f.current()},[t]),{...p,listExchanges:T,startWithdrawalFlow:m,resumeWithdrawalFlow:h,silentResumeWithdrawalFlow:g,requestQuote:_,executeWithdrawal:v,submit2FA:y,submitSMS:ne,submit2FAMultiStep:x,pollFaceVerification:S,pollRoamingFidoVerification:C,confirmWithdrawal:w,retryWithdrawal:b,cancel:E,refreshQRCode:D,testWithdrawalComplete:re,isIdle:p.state?.type===`idle`,isFlowCancelled:p.state?.type===`flow:cancelled`,isExchangesLoading:o||p.state?.type===`exchanges:loading`,isExchangesReady:p.state?.type===`exchanges:ready`||i.length>0,isExchangesError:p.state?.type===`exchanges:error`,exchangesError:ee||p.state?.type===`exchanges:error`&&p.error||null,isOAuthPending:p.state?.type===`oauth:waiting`||p.state?.type===`oauth:processing`,isOAuthWaiting:p.state?.type===`oauth:waiting`,isOAuthProcessing:p.state?.type===`oauth:processing`,isOAuthError:p.state?.type===`oauth:error`||p.state?.type===`oauth:fatal`,isOAuthFatal:p.state?.type===`oauth:fatal`,isWalletConnectionInvalid:p.state?.type===`oauth:fatal`||p.state?.type===`qrcode:fatal`,isOAuthComplete:p.state?.type===`oauth:completed`,isOAuthWindowBeenClosedByTheUser:p.state?.type===`oauth:window_closed_by_user`,isQRCodePending:p.state?.type?.startsWith(`qrcode:`)&&![`qrcode:error`,`qrcode:fatal`,`qrcode:timeout`].includes(p.state?.type||``),isQRCodeWaiting:p.state?.type===`qrcode:waiting`,isQRCodeDisplaying:p.state?.type===`qrcode:displaying`,isQRCodeScanning:p.state?.type===`qrcode:scanning`,isQRCodeError:p.state?.type===`qrcode:error`||p.state?.type===`qrcode:fatal`,isQRCodeFatal:p.state?.type===`qrcode:fatal`,isQRCodeTimeout:p.state?.type===`qrcode:timeout`,qrCodeUrl:p.context?.qrCodeUrl,qrCodeExpiresAt:p.context?.qrCodeExpiresAt,qrCodeStatus:p.context?.qrCodeStatus,isQRCodeFlow:p.context?.isQRCodeFlow||!1,isWalletLoading:p.state?.type===`wallet:loading`,isWalletError:p.state?.type===`wallet:error`,isWalletReady:p.state?.type===`wallet:ready`,isQuoteLoading:p.state?.type===`quote:requesting`,isQuoteReady:p.state?.type===`quote:ready`,isQuoteExpired:p.state?.type===`quote:expired`,isQuoteError:p.state?.type===`quote:error`,isWithdrawing:p.state?.type===`withdraw:processing`||p.state?.type===`withdraw:retrying`||!1,isWithdrawProcessing:p.state?.type===`withdraw:processing`,isWithdrawalComplete:p.state?.type===`withdraw:completed`,isWithdrawBlocked:p.state?.type===`withdraw:blocked`,hasFatalError:p.state?.type===`withdraw:fatal`,requires2FA:p.state?.type===`withdraw:error2FA`,requires2FAMultiStep:p.state?.type===`withdraw:error2FAMultiStep`,isReadyToConfirm:p.state?.type===`withdraw:readyToConfirm`,requiresSMS:p.state?.type===`withdraw:errorSMS`,requiresKYC:p.state?.type===`withdraw:errorKYC`,requiresValid2FAMethod:p.state?.type===`withdraw:fatal`&&!!p.context?.errorDetails?.valid2FAMethods||!1,requiresEmailVerification:p.state?.type===`withdraw:fatal`&&p.error?.message?.includes(`email`)||!1,hasInsufficientBalance:p.state?.type===`withdraw:errorBalance`,canRetry:p.state?.type===`withdraw:retrying`,hasAmountError:(p.state?.type===`quote:error`||p.state?.type===`withdraw:fatal`)&&(p.error?.message?.toLowerCase().includes(`amount`)||p.error?.message?.includes(`minimum`)||p.error?.message?.includes(`maximum`))||!1,hasAddressError:(p.state?.type===`quote:error`||p.state?.type===`withdraw:fatal`)&&(p.error?.message?.toLowerCase().includes(`address`)||p.error?.message?.toLowerCase().includes(`invalid destination`))||!1,hasNetworkError:(p.state?.type===`quote:error`||p.state?.type===`withdraw:fatal`)&&p.error?.message?.toLowerCase().includes(`network`)||!1,hasWalletNotFoundError:p.state?.type===`wallet:error`&&p.error?.message?.toLowerCase().includes(`not found`)||!1,hasInvalidCredentialsError:p.state?.type===`wallet:error`&&p.error?.message?.toLowerCase().includes(`invalid`)&&p.error?.message?.toLowerCase().includes(`credential`)||!1,invalid2FAAttempts:p.context?.invalid2FAAttempts||0,retryAttempts:p.context?.retryAttempts||0,maxRetryAttempts:p.context?.maxRetryAttempts||3,exchanges:p.context?.exchanges||i,walletBalances:p.context?.walletBalances||[],quote:p.context?.quote,withdrawal:p.context?.withdrawal,valid2FAMethods:p.context?.errorDetails?.valid2FAMethods,multiStep2FA:p.context?.multiStep2FA,multiStep2FASteps:p.context?.multiStep2FA?.steps||[],multiStep2FABizNo:p.context?.multiStep2FA?.bizNo,multiStep2FARelation:p.context?.multiStep2FA?.relation,collectedMultiStep2FACodes:p.context?.multiStep2FA?.collectedCodes,hasGoogleStep:p.context?.multiStep2FA?.steps?.some(e=>e.type===`GOOGLE`)||!1,hasEmailStep:p.context?.multiStep2FA?.steps?.some(e=>e.type===`EMAIL`)||!1,hasFaceStep:p.context?.multiStep2FA?.steps?.some(e=>e.type===`FACE`)||!1,hasRoamingFidoStep:p.context?.multiStep2FA?.steps?.some(e=>e.type===`ROAMING_FIDO`)||!1,hasSmsStep:p.context?.multiStep2FA?.steps?.some(e=>e.type===`SMS`)||!1,isGoogleStepVerified:p.context?.multiStep2FA?.mfa?.verified?.GOOGLE===!0||p.context?.multiStep2FA?.steps?.find(e=>e.type===`GOOGLE`)?.status===`success`,isEmailStepVerified:p.context?.multiStep2FA?.mfa?.verified?.EMAIL===!0||p.context?.multiStep2FA?.steps?.find(e=>e.type===`EMAIL`)?.status===`success`,isFaceStepVerified:p.context?.multiStep2FA?.mfa?.verified?.FACE===!0||p.context?.multiStep2FA?.steps?.find(e=>e.type===`FACE`)?.status===`success`,isRoamingFidoStepVerified:p.context?.multiStep2FA?.mfa?.verified?.ROAMING_FIDO===!0||p.context?.multiStep2FA?.steps?.find(e=>e.type===`ROAMING_FIDO`)?.status===`success`,isSmsStepVerified:p.context?.multiStep2FA?.mfa?.verified?.SMS===!0||p.context?.multiStep2FA?.steps?.find(e=>e.type===`SMS`)?.status===`success`,mfaVerified:p.context?.multiStep2FA?.mfa?.verified,allMultiStep2FAStepsVerified:(()=>{let e=p.context?.multiStep2FA;if(!e?.steps)return!1;let t=e.steps.filter(e=>e.required);if(t.length===0)return!1;let n=e.mfa?.verified;return n?t.every(e=>n[e.type]===!0):t.every(e=>e.status===`success`)})(),faceQrCodeUrl:p.context?.multiStep2FA?.faceQrCodeUrl,faceQrCodeExpiresAt:p.context?.multiStep2FA?.faceQrCodeExpiresAt,client:t}}const Ee=3e3;function De(e,t,n){return[`trails-bluvo-wallet`,e.trim(),t.trim().toLowerCase(),n.trim().toLowerCase()].join(`:`)}function Oe(e){if(!e||typeof window>`u`)return null;try{return window.sessionStorage.getItem(e)?.trim()||null}catch{return null}}function ke(e,t){if(!(!e||typeof window>`u`))try{if(t?.trim()){window.sessionStorage.setItem(e,t.trim());return}window.sessionStorage.removeItem(e)}catch{}}function Ae(e,t){return`trails-${e.trim()}-${t.trim().toLowerCase()}-${crypto.randomUUID().toLowerCase()}`}function R(e,t){return e instanceof Error?e.message:t}function je(e){return e?.trim().toUpperCase()??``}function Me(e){return e?.trim().toUpperCase().replaceAll(/\s+/g,` `)??``}function Ne(e){if(typeof e==`number`)return Number.isFinite(e)?e:NaN;if(typeof e!=`string`)return NaN;let t=e.replaceAll(`,`,``).trim();return t?Number.parseFloat(t):NaN}function Pe(e){let t=(e.originAmountFormatted||e.originAmountDisplay)?.trim(),n=e.originAmount?.trim();if(!t)throw Error(`Bluvo quote amount is missing.`);let r=Ne(t);if(!Number.isFinite(r)||r<=0)throw Error(`Bluvo quote amount is invalid.`);if(!n||n===t)return t;let i=Ne(n);return Number.isFinite(i)&&r*1e3,t}function Fe(e,t){let n=Ne(e);if(!Number.isFinite(n)||n<=0)return t;let r=t.includes(`.`)?t.split(`.`)[1]?.length??0:0;return n.toLocaleString(void 0,{minimumFractionDigits:r,maximumFractionDigits:Math.max(r,8)})}function Ie(e){return e===`INVALID_API_CREDENTIALS`}function Le(e){return e===`NOT_CONNECTED`}function Re(e){if(R(e,``).toLowerCase().includes(`wallet not found`))return!0;if(typeof e==`object`&&e&&`cause`in e&&typeof e.cause==`string`){let t=e.cause.toLowerCase();return t.includes(`wallet not found`)||t.includes(`wallet_not_found`)}return!1}function ze(e){return Re(e)}function z(e){return!!e&&e.success===!1&&(e.type===`WITHDRAWAL_PROVIDER_ERROR`||e.error===`ProviderError`)}function Be(e){return!!e&&e.success===!1&&e.type===`WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED`}function Ve(e){let t=e?.trim().toLowerCase()??``;return t.includes(`supported two-factor authentication methods`)||t.includes(`totp and sms are the only supported`)}function He(e,t){return e===`TwoFaNonValidRetryError`?`Invalid verification code. Please try again.`:t===`WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED`||e===`TwoFaMethodNotSupportedError`||Ve(e)?`That verification method is not currently supported for this exchange account. Try one of the supported 2FA methods.`:e??null}function Ue(e){return`<!DOCTYPE html>
105
+ <html>
106
+ <head>
107
+ <title>${e}</title>
108
+ <style>
109
+ body {
110
+ margin: 0;
111
+ display: flex;
112
+ flex-direction: column;
113
+ gap: 18px;
114
+ align-items: center;
115
+ justify-content: center;
116
+ height: 100vh;
117
+ background: #0b1220;
118
+ color: #fff;
119
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
120
+ }
121
+ .spinner {
122
+ border: 4px solid rgba(255, 255, 255, 0.3);
123
+ border-top: 4px solid #fff;
124
+ border-radius: 50%;
125
+ width: 48px;
126
+ height: 48px;
127
+ animation: spin 1s linear infinite;
128
+ }
129
+ .label {
130
+ font-size: 14px;
131
+ opacity: 0.8;
132
+ }
133
+ @keyframes spin {
134
+ 0% { transform: rotate(0deg); }
135
+ 100% { transform: rotate(360deg); }
136
+ }
137
+ </style>
138
+ </head>
139
+ <body>
140
+ <div class="spinner"></div>
141
+ <div class="label">Opening secure exchange authorization...</div>
142
+ </body>
143
+ </html>`}function We(e){return e.map(e=>({asset:e.asset,balance:e.amount.toString(),balanceInFiat:e.amountInFiat?.toString(),networks:(e.networks??[]).map(e=>({id:e.id,name:e.name,displayName:e.displayName,minWithdrawal:e.minWithdrawal,maxWithdrawal:e.maxWithdrawal,assetName:e.assetName,addressRegex:e.addressRegex,chainId:e.chainId,tokenAddress:e.tokenAddress,contractAddress:e.contractAddress,contractAddressVerified:e.contractAddressVerified}))}))}function B({title:e,description:t}){return p(`div`,{className:`rounded-xl border border-solid border-blue-200 bg-blue-50 px-4 py-3 text-left dark:border-blue-900/60 dark:bg-blue-950/30`,children:m(`div`,{className:`flex items-start gap-3`,children:[p(o,{className:`mt-0.5 h-4 w-4 shrink-0`}),m(`div`,{children:[p(`p`,{className:`text-sm font-medium text-blue-900 dark:text-blue-100`,children:e}),p(`p`,{className:`mt-1 text-xs leading-5 text-blue-700 dark:text-blue-200`,children:t})]})]})})}const V=t=>{let{environment:n,exchange:i,onBack:s}=t,c=a(),l=d({queryKey:[`bluvo-client-config`,n],queryFn:async()=>(e.console.log(`[bluvo]`,`getBluvoClientConfig request`,{environment:n}),c.getBluvoClientConfig({environment:n})),staleTime:5*6e4});return l.isLoading?m(`div`,{className:`flex flex-col h-full`,children:[p(r,{onBack:s,headerContent:`Fund via ${i.name}`,headerContentAlign:`left`}),p(`div`,{className:`flex flex-1 items-center justify-center py-2`,children:m(`div`,{className:`w-full max-w-md rounded-xl border border-solid border-gray-200 p-8 text-center dark:border-gray-700`,children:[p(o,{className:`mx-auto h-7 w-7`}),p(`div`,{className:`mt-4 text-sm font-medium text-gray-900 dark:text-white`,children:`Loading Bluvo configuration...`}),p(`div`,{className:`mt-2 text-sm text-gray-500 dark:text-gray-400`,children:`Preparing secure exchange funding.`})]})})]}):l.isError||!l.data?m(`div`,{className:`flex flex-col h-full`,children:[p(r,{onBack:s,headerContent:`Fund via ${i.name}`,headerContentAlign:`left`}),p(`div`,{className:`flex flex-1 items-center justify-center py-2`,children:m(`div`,{className:`w-full max-w-md rounded-lg border border-solid border-yellow-200 bg-yellow-50 p-8 text-left dark:border-yellow-800 dark:bg-yellow-900/20`,children:[p(`p`,{className:`text-sm font-medium text-yellow-900 dark:text-yellow-100`,children:`Bluvo configuration issue`}),p(`p`,{className:`mt-2 text-sm text-yellow-700 dark:text-yellow-300`,children:R(l.error,`Failed to load Bluvo configuration.`)})]})})]}):l.data.enabled?p(H,{bluvoConfig:l.data,...t},`${n}:${i.id}:${t.address??`no-address`}`):m(`div`,{className:`flex flex-col h-full`,children:[p(r,{onBack:s,headerContent:`Fund via ${i.name}`,headerContentAlign:`left`}),p(`div`,{className:`flex flex-1 items-center justify-center py-2`,children:m(`div`,{className:`w-full max-w-md rounded-lg border border-solid border-yellow-200 bg-yellow-50 p-8 text-left dark:border-yellow-800 dark:bg-yellow-900/20`,children:[p(`p`,{className:`text-sm font-medium text-yellow-900 dark:text-yellow-100`,children:`Exchange disabled`}),p(`p`,{className:`mt-2 text-sm text-yellow-700 dark:text-yellow-300`,children:`Bluvo exchange funding is currently disabled.`})]})})]})},H=({bluvoConfig:t,address:h,environment:g,exchange:_,quote:v,onBack:y,onContinue:ne,onSubmitted:b})=>{let x=a(),S=f(),{setSelectedBluvoWalletId:C,setSelectedBluvoBalances:w,clearSelectedBluvoFunding:T}=n(),[E,D]=u(null),[re,ie]=u(null),[O,ae]=u({twofa:``,emailCode:``,smsCode:``}),[k,A]=u(!1),[oe,se]=u(!1),[ce,le]=u(!1),[ue,de]=u(!1),[fe,j]=u(!1),[M,pe]=u(!1),[me,he]=u(!1),[N,ge]=u(null),[P,_e]=u([]),[ve,F]=u(`preview`),ye=te(null),be=te(null),xe=te(null),Se=`${_.id}:${_.logoUrl??``}`,Ce=h?De(g,_.id,h):null,[I,we]=u(()=>Oe(Ce)),L=c(e=>{ke(Ce,e),we(e)},[Ce]),V=c(()=>{L(null)},[L]);l(()=>{if(I||!Ce)return;let e=Oe(Ce);e&&we(e)},[I,Ce]);let H={data:I,isLoading:!1},U=Te({orgId:t.orgId,listExchangesFn:(async t=>{e.console.log(`[bluvo]`,`listExchangesFn request`,{environment:g,status:t});let n=((await x.getBluvoExchanges({environment:g})).exchanges??[]).map(e=>({id:e.id,name:e.name,logoUrl:e.logoUrl??``,status:e.status??`live`}));return t?n.filter(e=>e.status===t):n}),getWalletByIdFn:(async t=>{try{let e=await x.getBluvoWallet({environment:g,walletId:t});return{success:!0,data:{id:e.wallet.id,exchange:e.wallet.exchange,balances:{},invalidApi:e.wallet.invalidApi??!1,lastSyncAt:e.wallet.lastSyncAt,expiresAt:e.wallet.expiresAt},error:void 0}}catch(t){return e.console.error(`[bluvo]`,`getWalletByIdFn error`,t),{success:!1,data:void 0,error:{error:R(t,`Failed to load wallet`),type:`WALLET_NOT_FOUND`}}}}),pingWalletByIdFn:(async t=>{try{let e=await x.pingBluvoWallet({environment:g,walletId:t});return{success:!0,data:{id:e.walletId,exchange:e.exchange,status:e.status,success:e.success},error:void 0}}catch(t){return e.console.error(`[bluvo]`,`pingWalletByIdFn error`,t),{success:!1,data:void 0,error:{error:R(t,`Failed to ping wallet`),type:`WALLET_NOT_FOUND`}}}}),fetchWithdrawableBalanceFn:(async(t,n)=>{try{let e=await x.getBluvoWithdrawBalances({environment:g,walletId:t,refreshThresholdMinutes:n?.refreshThresholdMinutes??0,autoDeleteIfInvalid:n?.autoDeleteIfInvalid});return{success:!0,data:{lastSyncAt:e.lastSyncAt,balances:e.balances.map(e=>({asset:e.asset,amount:e.amount,amountInFiat:e.amountInFiat,networks:(e.networks??[]).map(e=>({id:e.id,name:e.name,displayName:e.displayName,minWithdrawal:e.minWithdrawal,maxWithdrawal:e.maxWithdrawal,assetName:e.assetName,addressRegex:e.addressRegex,chainId:e.chainId,tokenAddress:e.tokenAddress,contractAddress:e.contractAddress,contractAddressVerified:e.contractAddressVerified}))}))},error:void 0}}catch(t){return e.console.error(`[bluvo]`,`fetchWithdrawableBalanceFn error`,t),{success:!1,data:void 0,error:{error:R(t,`Failed to load withdrawable balances`),type:`WALLET_NOT_FOUND`}}}}),requestQuotationFn:(async(t,n)=>{if(!v?.intentId)return{success:!1,data:void 0,error:{error:`A committed intentId is required before creating a Bluvo quote.`,type:`UNKNOWN_ERROR`}};try{let e=await x.createBluvoWithdrawalQuote({environment:g,walletId:t,intentId:v.intentId,tag:n.tag});return ge({asset:e.quote.asset,amountNoFee:e.quote.amountNoFee,destinationAddress:e.quote.destinationAddress,network:e.quote.network}),{success:!0,data:{id:e.quote.id,asset:e.quote.asset,amountWithFee:e.quote.amountWithFee,amountNoFee:e.quote.amountNoFee,estimatedFee:e.quote.estimatedFee,destinationAddress:e.quote.destinationAddress,network:e.quote.network,tag:n.tag,estimatedTotal:e.quote.estimatedTotal,feeDetails:e.quote.feeDetails?.map(e=>({category:e.category,currency:e.currency,amount:e.amount,amountInFiat:e.amountInFiat,fiatCurrency:e.fiatCurrency})),expiresAt:e.quote.expiresAt,additionalInfo:{minWithdrawal:e.quote.additionalInfo?.minWithdrawal??null,maxWithdrawal:e.quote.additionalInfo?.maxWithdrawal}},error:void 0}}catch(t){return e.console.error(`[bluvo]`,`requestQuotationFn error`,t),{success:!1,data:void 0,error:{error:R(t,`Failed to create Bluvo quote`),type:`UNKNOWN_ERROR`}}}}),executeWithdrawalFn:(async(t,n,r,i)=>{e.console.log(`[bluvo]`,`executeWithdrawalFn request`,{environment:g,idem:n,quoteId:r,hasTwofa:!!i?.twofa,hasEmailCode:!!i?.emailCode,hasSmsCode:!!i?.smsCode,hasBizNo:!!i?.bizNo,dryRun:i?.dryRun});try{let e=await x.executeBluvoWithdrawal({environment:g,walletId:t,quoteId:r,twofa:i?.twofa,emailCode:i?.emailCode,smsCode:i?.smsCode,bizNo:i?.bizNo,tag:i?.tag,dryRun:i?.dryRun}),n=e.transactionId?{transactionId:e.transactionId}:e.challenge?{bizNo:e.challenge.bizNo,relation:e.challenge.relation,valid2FAMethods:e.challenge.valid2faMethods??[],steps:(e.challenge.steps??[]).map(e=>({type:e.type,status:e.status,required:e.required??!1,metadata:{email:e.email,emailSent:e.emailSent,qrCodeUrl:e.qrCodeUrl,qrCodeValidSeconds:e.qrCodeValidSeconds,roamingFlowId:e.roamingFlowId},error:e.error}))}:void 0,a={success:e.success,error:e.error,type:e.type,result:n};return e.success?{success:!0,data:a,error:void 0}:{success:!1,data:void 0,error:a}}catch(t){return e.console.error(`[bluvo]`,`executeWithdrawalFn error`,t),{success:!1,data:void 0,error:{error:R(t,`Failed to submit Bluvo withdrawal`),type:`UNKNOWN_ERROR`}}}}),onWalletConnectedFn:(t,n)=>{e.console.log(`[bluvo]`,`onWalletConnectedFn`,{connectedExchange:n})},options:{sandbox:g===`sandbox`}}),W=d({queryKey:[`bluvo-wallet-ping`,g,H.data],enabled:!!H.data&&!M,queryFn:async()=>x.pingBluvoWallet({environment:g,walletId:H.data}),retry:!1,refetchInterval:k?Ee:!1}),Ge=!!H.data&&!fe&&!M&&W.data?.success===!0,G=d({queryKey:[`bluvo-withdrawable-balances`,g,H.data],enabled:Ge,queryFn:async()=>x.getBluvoWithdrawBalances({environment:g,walletId:H.data,refreshThresholdMinutes:0}),retry:!1,staleTime:3e4}),K=G.data?.balances??[],q=W.data?.success===!0,J=G.isSuccess,Ke=Ge&&G.isLoading&&!J,qe=!!v&&!fe&&!M&&!ue&&!!H.data&&(W.isLoading||W.data?.success===!0)&&!J&&!G.isError,Y=q&&J&&K.length>0,X=ee(()=>{if(!v)return null;let e=je(v.originToken.symbol);return K.find(t=>je(t.asset)===e)??null},[K,v]),Z=ee(()=>!X||!v?null:X.networks?.find(e=>e.chainId===v.originChain.id||Me(e.name)===Me(v.originChain.name)||Me(e.displayName)===Me(v.originChain.name))??null,[X,v]),Je=N?.asset||U.quote?.asset||v?.originToken.symbol,Ye=v?Fe(N?.amountNoFee||U.quote?.amount,v.originAmountDisplay):``,Xe=N?.network&&Z?.id===N.network?Z.displayName||Z.name||N.network:N?.network||Z?.displayName||Z?.name||v?.originChain.name||``,Ze=N?.destinationAddress||v?.originDepositAddress||``,Qe=ee(()=>{if(!X||!v)return!1;let e=Ne(X.amount),t=Ne(v.originAmountFormatted)||Ne(v.originAmountDisplay);return!Number.isFinite(e)||!Number.isFinite(t)?!1:e>=t},[X,v]),Q=P.length>0?P:U.valid2FAMethods??[],$e=v?[v.intentId??``,v.originToken.symbol,v.originChain.id,v.originAmount,v.originDepositAddress].join(`:`):null,et=!q&&!k&&!U.isOAuthPending&&Le(W.data?.status)?null:E??U.exchangesError?.message??(Re(U.error)?null:U.error?.message)??((U.hasInvalidCredentialsError||!q&&Ie(W.data?.status))&&!q?`Bluvo reported invalid API credentials for this connection.`:null),tt=Q.length>0&&Ve(et)?null:et,nt=He(tt),rt=(H.isLoading||W.isLoading||Ge&&G.isLoading)&&!U.isOAuthPending;l(()=>{e.console.log(`[bluvo]`,`flow state`,{state:U.state?.type,isOAuthPending:U.isOAuthPending,isWalletLoading:U.isWalletLoading,isWalletReady:U.isWalletReady,isQuoteReady:U.isQuoteReady,isWithdrawing:U.isWithdrawing,requires2FA:U.requires2FA,requires2FAMultiStep:U.requires2FAMultiStep,isReadyToConfirm:U.isReadyToConfirm,isWithdrawalComplete:U.isWithdrawalComplete,isWalletConnected:q,isReadyToFund:Y,postAuthStep:ve})},[U.isOAuthPending,U.isQuoteReady,U.isReadyToConfirm,U.isWalletLoading,U.isWalletReady,U.isWithdrawalComplete,U.isWithdrawing,U.requires2FA,U.requires2FAMultiStep,U.state?.type,Y,q,ve]),l(()=>{M||!W.data?.success||!W.data.walletId||W.data.walletId===I||L(W.data.walletId)},[I,M,L,W.data?.success,W.data?.walletId]),l(()=>{G.isSuccess&&A(!1)},[G.isSuccess]),l(()=>{if(!(!I||!H.data||H.data!==I)){if(Le(W.data?.status)){V();return}Ie(W.data?.status)&&V()}},[I,V,H.data,W.data?.status]),l(()=>{!M&&G.isSuccess&&H.data&&we(H.data)},[M,H.data,G.isSuccess]),l(()=>{if(M){T();return}if(H.data){if(Le(W.data?.status)){T();return}if(Ie(W.data?.status)){T();return}J&&(C(H.data),w(K))}},[T,K,J,M,w,C,H.data,W.data?.status]),l(()=>{U.isOAuthWindowBeenClosedByTheUser&&!G.isSuccess&&(A(!1),D(`Bluvo authorization window was closed before connection completed.`))},[U.isOAuthWindowBeenClosedByTheUser,G.isSuccess]),l(()=>{if(!$e){be.current=null;return}be.current!==$e&&(be.current=$e,F(`preview`),j(!1),ge(null),_e([]),D(null))},[$e]),l(()=>{(U.requires2FA||U.requires2FAMultiStep)&&F(`verification`)},[U.requires2FA,U.requires2FAMultiStep]),l(()=>{U.requiresValid2FAMethod&&(F(`verification`),U.valid2FAMethods?.length&&_e(U.valid2FAMethods))},[U.requiresValid2FAMethod,U.valid2FAMethods]),l(()=>{U.isReadyToConfirm&&F(`confirm`)},[U.isReadyToConfirm]),l(()=>{M||!H.data||!G.isSuccess||!v||U.state||U.silentResumeWithdrawalFlow({exchange:_.id,walletId:H.data,preloadedBalances:We(K)})},[U,K,_.id,M,v,H.data,G.isSuccess]),l(()=>{let e=U.withdrawal?.transactionId;!U.isWithdrawalComplete||!e||ye.current!==e&&(ye.current=e,b({transactionId:e}))},[U.isWithdrawalComplete,U.withdrawal,b]);let it=c(async e=>{let t=Date.now()+3e5,n=null;for(;Date.now()<t;){try{let t=await x.pingBluvoWallet({environment:g,walletId:e});if(t.success)return await x.getBluvoWithdrawBalances({environment:g,walletId:e,refreshThresholdMinutes:0});n=Error(t.status||`Bluvo wallet is not connected yet.`)}catch(e){if(n=e,!ze(e))throw e}await new Promise(e=>window.setTimeout(e,Ee))}throw n??Error(`Timed out waiting for Bluvo withdrawable balances.`)},[g,x]),at=c(async(e,t)=>{let n=t.balances??[];S.setQueryData([`bluvo-withdrawable-balances`,g,e],t),L(e),C(e),w(n),pe(!1),de(!1),j(!1),D(null),await U.silentResumeWithdrawalFlow({exchange:_.id,walletId:e,preloadedBalances:We(n)}),n.length>0&&ne()},[U,g,_.id,ne,L,S,w,C]),$=c(async()=>{U.cancel(),ye.current=null,we(null),V(),T(),de(!0),F(`preview`),D(`Exchange authorization needs to be refreshed. Please reconnect.`)},[U,V,T]),ot=c(e=>{U.cancel(),ye.current=null,we(null),ge(null),_e([]),ae({twofa:``,emailCode:``,smsCode:``}),V(),T(),S.removeQueries({queryKey:[`bluvo-wallet-id`,g,_.id,h]}),S.removeQueries({queryKey:[`bluvo-wallet-ping`,g]}),S.removeQueries({queryKey:[`bluvo-withdrawable-balances`,g]}),pe(e===`manual-reconnect`),de(!1),F(`preview`),D(null)},[U,V,T,g,_.id,h,S]),st=c(async(t=!1)=>{if(!h){D(`Connect a wallet before linking an exchange`);return}D(null),de(!1);let n=t||M,r=null;try{if(n&&(U.cancel(),T(),V(),F(`preview`)),!n&&q){if(!H.data){D(`Resetting connection. Try again.`);return}e.console.log(`[bluvo]`,`reusing connected wallet`,{exchangeId:_.id}),await U.silentResumeWithdrawalFlow({exchange:_.id,walletId:H.data,preloadedBalances:We(K)});return}let t=n||Le(W.data?.status)||!I?Ae(g,_.id):I;L(t),pe(!0),A(!0);let i=`${_.name} OAuth`,a=`width=500,height=600,left=${window.screenLeft+(window.screen.width-500)/2},top=${window.screenTop+(window.screen.height-600)/2},status=yes,scrollbars=yes,resizable=yes`;if(r=window.open(`about:blank`,i,a),!r||r.closed||r.closed===void 0){A(!1),D(`Failed to open OAuth popup. Please allow pop-ups for this site.`);return}try{r.document.open(),r.document.write(Ue(i)),r.document.close(),r.focus()}catch(e){try{r.close()}catch{}A(!1),D(R(e,`Failed to initialize OAuth popup.`));return}let o=await x.getBluvoOAuthURL({environment:g,exchangeId:_.id,userAddress:h,walletId:t});if(r.closed){A(!1);return}let s=r,c=o.walletId;s.location.href=o.url;let l=window.setInterval(async()=>{try{if(s.closed){window.clearInterval(l),A(!1);let e=await it(c);e.balances?.length||e.lastSyncAt?await at(c,e):D(`Bluvo authorization window was closed before connection completed.`);return}s.location.href}catch(e){if(e?.name===`SecurityError`||e instanceof DOMException&&e.code===18)return;window.clearInterval(l),A(!1),D(ze(e)?`Bluvo is still provisioning the connected wallet. Please try connecting again in a moment.`:R(e,`Failed to confirm Bluvo connection.`))}},500)}catch(t){try{r?.close()}catch{}e.console.error(`[bluvo]`,`start authorization error`,t),D(R(t,`Failed to start Bluvo authorization`)),A(!1)}},[h,U,V,T,K,g,_.id,_.name,at,M,q,x,I,L,H.data,W.data?.status,it]),ct=c(async()=>{if(!h){D(`Connect a wallet before linking an exchange`);return}he(!0),D(null);let t=W.data?.walletId??H.data??I;if(!t){ot(`manual-reconnect`),j(!0),he(!1),await st(!0);return}try{await x.deleteBluvoWallet({environment:g,walletId:t})}catch(t){e.console.error(`[bluvo]`,`deleteBluvoWallet during reconnect error`,t)}finally{ot(`manual-reconnect`),j(!0),he(!1)}},[h,I,g,st,x,ot,H.data,W.data?.walletId]),lt=c(async()=>{if(!H.data){D(`Resetting connection. Try again.`);return}if(!q){D(`Connect your exchange before continuing.`);return}le(!0),j(!1),D(null);try{let e=K;if(!v){if(!J){let t=await x.getBluvoWithdrawBalances({environment:g,walletId:H.data,refreshThresholdMinutes:0});e=t.balances??[],S.setQueryData([`bluvo-withdrawable-balances`,g,H.data],t),C(H.data),w(e)}ne();return}if(!J){let t=await x.getBluvoWithdrawBalances({environment:g,walletId:H.data,refreshThresholdMinutes:0});e=t.balances??[],S.setQueryData([`bluvo-withdrawable-balances`,g,H.data],t)}if(e.length===0){D(`Your ${_.name.toLowerCase()} account is connected but no withdrawable assets are available yet.`);return}C(H.data),w(e),await U.silentResumeWithdrawalFlow({exchange:_.id,walletId:H.data,preloadedBalances:We(e)}),ne()}finally{le(!1)}},[U,K,_.id,_.name,g,J,q,ne,x,S,v,w,C,H.data]),ut=c(async e=>{if(!H.data){D(`Resetting connection. Try again.`);return}let t=U.quote?.id;if(!t){D(`Bluvo quote is not ready. Refresh the quote and try again.`);return}let n=e===`TOTP`?{environment:g,walletId:H.data,quoteId:t,twofa:O.twofa.trim()}:{environment:g,walletId:H.data,quoteId:t,smsCode:O.smsCode.trim()};se(!0);try{let e=await x.executeBluvoWithdrawal(n);if(z(e)){await $();return}if(Be(e)){_e(e.challenge?.valid2faMethods??[]),F(`verification`),D(He(e.error,e.type)||`Please use one of the supported 2FA methods.`);return}if(e.success&&e.transactionId){ye.current=e.transactionId,b({transactionId:e.transactionId});return}D(He(e.error,e.type)||`Failed to submit Bluvo verification code.`)}finally{se(!1)}},[U.quote?.id,g,$,b,x,O.smsCode,O.twofa,H.data]),dt=c(async()=>{D(null);try{if(!v)return;if(U.requires2FAMultiStep){let e=U.multiStep2FASteps.filter(e=>e.status!==`success`),t=e.some(e=>[`GOOGLE`,`EMAIL`,`SMS`].includes(e.type)),n=e.some(e=>[`FACE`,`ROAMING_FIDO`].includes(e.type)),r=!1;for(let t of e){if(t.type===`GOOGLE`&&O.twofa&&(r=!0,z(await U.submit2FAMultiStep(`GOOGLE`,O.twofa)))){await $();return}if(t.type===`EMAIL`&&O.emailCode&&(r=!0,z(await U.submit2FAMultiStep(`EMAIL`,O.emailCode)))){await $();return}if(t.type===`SMS`&&O.smsCode&&(r=!0,z(await U.submit2FAMultiStep(`SMS`,O.smsCode)))){await $();return}}if(t&&!r){D(`Enter the required Bluvo verification code to continue.`);return}n&&D(e.some(e=>e.type===`FACE`)?`Complete the face verification in your exchange app. We're checking for completion automatically.`:`Complete the security verification in your exchange app. We're checking for completion automatically.`);return}if(U.isReadyToConfirm){z(await U.confirmWithdrawal())&&await $();return}if(U.requiresValid2FAMethod||Q.length>0){if(Q.includes(`TOTP`)&&O.twofa.trim()){await ut(`TOTP`);return}if(Q.includes(`SMS`)&&O.smsCode.trim()){await ut(`SMS`);return}D(`Enter a supported Bluvo verification code to continue.`);return}if(U.requiresSMS){let e=O.smsCode.trim();if(!e){D(`Enter the SMS verification code to continue.`);return}z(await U.submitSMS(e))&&await $();return}if(U.requires2FA){z(await U.submit2FA(O.twofa))&&await $();return}let t=U.quote?.id;if(U.isQuoteExpired){D(`The Bluvo quote expired. Refresh the quote before continuing.`);return}if(!t){let n=Pe(v);e.console.log(`[bluvo]`,`requestQuote normalized amount`,{asset:v.originToken.symbol,rawAmount:v.originAmount,displayAmount:v.originAmountFormatted||v.originAmountDisplay,amountSent:n});let r=await U.requestQuote({asset:v.originToken.symbol,amount:n,destinationAddress:v.originDepositAddress,network:Z?.id,includeFee:!0});if(!r.success||!r.quoteData?.id){D(He(r.error)||`Failed to create Bluvo withdrawal quote`);return}t=r.quoteData.id}if(!t){D(`Failed to resolve Bluvo quote`);return}let n=await U.executeWithdrawal(t);if(z(n)){await $();return}if(n?.type===`WITHDRAWAL_2FA_METHOD_NOT_SUPPORTED`){let e=n?.result?.result?.valid2FAMethods??n?.result?.valid2FAMethods??[];_e(e),F(`verification`);return}if(U.requires2FA||U.requires2FAMultiStep||U.requiresValid2FAMethod){F(`verification`);return}U.isReadyToConfirm&&F(`confirm`)}catch(t){e.console.error(`[bluvo]`,`withdrawal submission failed`,t),D(He(R(t,`Failed to continue the Bluvo withdrawal flow`))||`Failed to continue the Bluvo withdrawal flow`)}},[U,Q,$,ut,Z?.id,v,O.emailCode,O.smsCode,O.twofa]),ft=_.logoUrl&&re!==Se,pt=U.multiStep2FASteps.filter(e=>e.status!==`success`),mt=pt.some(e=>e.type===`EMAIL`),ht=pt.some(e=>e.type===`SMS`)||U.requiresSMS,gt=pt.some(e=>e.type===`FACE`),_t=pt.some(e=>e.type===`ROAMING_FIDO`),vt=U.requires2FA||pt.some(e=>e.type===`GOOGLE`)||Q.includes(`TOTP`),yt=pt.filter(e=>![`EMAIL`,`SMS`,`GOOGLE`,`FACE`,`ROAMING_FIDO`].includes(e.type)),bt=ve===`verification`&&(U.requires2FA||U.requiresSMS||U.requires2FAMultiStep||U.requiresValid2FAMethod||Q.length>0),xt=`Submit Withdrawal`;ve===`preview`&&(xt=`Continue`),bt&&(xt=`Verify and Continue`),U.isReadyToConfirm&&(xt=`Confirm Withdrawal`),U.isQuoteExpired&&(xt=`Refresh Quote`),U.isWithdrawing&&(xt=`Submitting withdrawal...`),oe&&(xt=`Verifying...`);let St=U.isQuoteLoading||U.isWithdrawing||oe,Ct=rt||me||k||ce||U.isOAuthPending||H.isLoading||U.isWalletLoading;return l(()=>{!bt||!vt||xe.current?.focus()},[vt,bt]),l(()=>{if(!U.requires2FAMultiStep||!gt&&!_t)return;let t=!1,n=!1,r=async()=>{if(!(t||n)){n=!0;try{if(gt&&z(await U.pollFaceVerification())){await $();return}_t&&z(await U.pollRoamingFidoVerification())&&await $()}catch(t){e.console.warn(`[bluvo]`,`verification poll failed`,t)}finally{n=!1}}};r();let i=window.setInterval(()=>{r()},4e3);return()=>{t=!0,window.clearInterval(i)}},[U,$,gt,_t]),qe||q&&Ke?m(`div`,{className:`flex flex-col h-full`,children:[p(r,{onBack:y,headerContent:`Fund via ${_.name}`,headerContentAlign:`left`}),p(`div`,{className:`flex flex-1 items-center justify-center py-2`,children:m(`div`,{className:`flex w-full max-w-md flex-1 flex-col items-center justify-center rounded-2xl border border-solid border-gray-200 bg-transparent p-6 text-center dark:border-gray-700`,children:[p(o,{className:`h-8 w-8`}),p(`div`,{className:`mt-4 text-sm font-medium text-gray-900 dark:text-white`,children:`Checking exchange connection...`}),p(`div`,{className:`mt-2 text-sm text-gray-500 dark:text-gray-400`,children:`This may take a moment while we verify your exchange account.`})]})})]}):!v||fe?m(`div`,{className:`flex flex-col h-full`,children:[p(r,{onBack:fe&&v?()=>j(!1):y,headerContent:`Fund via ${_.name}`,headerContentAlign:`left`}),p(`div`,{className:`flex flex-1 items-center justify-center py-2`,children:m(`div`,{className:`flex w-full max-w-md flex-1 flex-col justify-between rounded-2xl border border-solid border-gray-200 bg-transparent p-6 dark:border-gray-700`,children:[m(`div`,{className:`flex flex-1 flex-col items-center justify-center text-center`,children:[p(`div`,{className:`mb-5 flex h-14 w-14 items-center justify-center overflow-hidden rounded-full border border-solid border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-950`,children:ft?p(`img`,{src:_.logoUrl,alt:_.name,className:`h-10 w-10 object-contain`,onError:()=>ie(Se)}):p(`span`,{className:`text-base font-semibold text-gray-700 dark:text-gray-200`,children:_.name.slice(0,1)})}),m(`div`,{className:`space-y-3`,children:[p(`h3`,{className:`max-w-[320px] text-xl font-semibold text-gray-900 dark:text-white`,children:q?`${_.name} connected`:`Connect ${_.name} account`}),p(`p`,{className:`text-sm text-gray-500 dark:text-gray-400`,children:q?!J||Y?`Your ${_.name.toLowerCase()} account is linked. Continue to the fund form to choose the asset and amount.`:`Your ${_.name.toLowerCase()} account is linked, but Bluvo has not returned any withdrawable assets for it yet.`:`Sign in to ${_.name.toLowerCase()} to link your account before continuing.`})]}),!rt&&q&&J&&!Y?m(`div`,{className:`mt-5 w-full rounded-lg border border-solid border-yellow-200 bg-yellow-50 px-4 py-3 text-left dark:border-yellow-800 dark:bg-yellow-900/20`,children:[p(`p`,{className:`text-sm font-medium text-yellow-900 dark:text-yellow-100`,children:`Connected but not ready to fund`}),p(`p`,{className:`mt-2 text-sm text-yellow-700 dark:text-yellow-300`,children:`Bluvo connected the exchange wallet, but no withdrawable assets are available yet.`})]}):null,!rt&&et?m(`div`,{className:`mt-5 w-full rounded-lg border border-solid border-yellow-200 bg-yellow-50 px-4 py-3 text-left dark:border-yellow-800 dark:bg-yellow-900/20`,children:[p(`p`,{className:`text-sm font-medium text-yellow-900 dark:text-yellow-100`,children:`Bluvo connection issue`}),p(`p`,{className:`mt-2 text-sm text-yellow-700 dark:text-yellow-300`,children:He(et)})]}):null]}),m(`div`,{className:`mt-6 space-y-4`,children:[k||U.isOAuthPending?p(B,{title:`Exchange window opened`,description:`Complete authorization in the secure exchange window. We'll continue automatically when it closes.`}):rt?p(B,{title:`Checking exchange connection`,description:`We are verifying the linked exchange wallet and syncing withdrawable balances.`}):ce?p(B,{title:`Preparing funding form`,description:`Loading balances and matching the exchange route to this quote.`}):null,p(`div`,{className:`flex justify-center`,children:p(`button`,{type:`button`,onClick:q?!J||Y?()=>void lt():()=>void ct():()=>void st(M),disabled:Ct,className:`min-w-[220px] cursor-pointer rounded-full bg-blue-600 px-7 py-3 text-base font-semibold text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-50`,children:m(`span`,{className:`inline-flex items-center justify-center gap-2`,children:[Ct?p(o,{className:`h-4 w-4`}):null,p(`span`,{children:rt?`Checking connection...`:me?`Resetting exchange...`:ce?`Preparing funding form...`:k||U.isOAuthPending?`Waiting for exchange authorization...`:q?!J||Y?`Continue`:`Reconnect Exchange`:`Connect Exchange`})]})})})]})]})})]}):m(`div`,{className:`flex flex-col h-full`,children:[p(r,{onBack:y,headerContent:`Fund via ${_.name}`,headerContentAlign:`left`}),p(`div`,{className:`flex-1 overflow-y-auto`,children:m(`div`,{className:`space-y-4 pt-2`,children:[m(`div`,{className:`rounded-xl border border-solid border-gray-200 bg-gray-50 p-4 dark:border-gray-800 dark:bg-gray-900/40`,children:[m(`div`,{className:`flex items-center gap-3`,children:[p(`div`,{className:`h-11 w-11 overflow-hidden rounded-full bg-white shadow-sm dark:bg-gray-950`,children:ft?p(`img`,{src:_.logoUrl,alt:_.name,className:`h-full w-full object-contain`,onError:()=>ie(Se)}):p(`div`,{className:`flex h-full w-full items-center justify-center text-sm font-semibold`,children:_.name.slice(0,1)})}),m(`div`,{children:[p(`div`,{className:`text-sm font-medium text-gray-900 dark:text-white`,children:_.name}),p(`div`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:q?!J||Y?`Exchange linked`:`Exchange linked, no withdrawable assets available`:`Link your exchange account to continue`})]})]}),!q||!Y||ue?p(`div`,{className:`mt-4`,children:p(`button`,{type:`button`,onClick:()=>ue||q?void ct():void st(M),disabled:Ct,className:`w-full cursor-pointer rounded-xl bg-blue-600 px-4 py-3 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60`,children:m(`span`,{className:`inline-flex items-center justify-center gap-2`,children:[Ct?p(o,{className:`h-4 w-4`}):null,p(`span`,{children:rt?`Checking connection...`:ce?`Preparing funding form...`:me?`Resetting exchange...`:k||U.isOAuthPending?`Waiting for exchange authorization...`:q||ue?`Reconnect Exchange`:`Connect Exchange`})]})})}):null]}),m(`div`,{className:`rounded-xl border border-solid border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900/40`,children:[p(`div`,{className:`text-sm font-medium text-gray-900 dark:text-white`,children:`Withdrawal Route`}),m(`div`,{className:`mt-3 space-y-2 text-sm text-gray-600 dark:text-gray-300`,children:[m(`div`,{children:[`Asset:`,` `,p(`span`,{className:`font-semibold text-gray-900 dark:text-white`,children:Je}),` `,`on `,Xe]}),m(`div`,{children:[`Amount:`,` `,p(`span`,{className:`font-semibold text-gray-900 dark:text-white`,children:Ye})]}),m(`div`,{className:`break-all`,children:[`Deposit address: `,Ze]})]})]}),q&&!X?m(`div`,{className:`rounded-xl border border-solid border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900/40`,children:[p(`div`,{className:`text-sm font-medium text-gray-900 dark:text-white`,children:`Route availability`}),m(`div`,{className:`mt-3 text-sm text-red-600 dark:text-red-300`,children:[_.name,` does not currently expose a`,` `,v.originToken.symbol,` balance for this Bluvo connection.`]})]}):null,X?m(`div`,{className:`rounded-xl border border-solid border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900/40`,children:[p(`div`,{className:`text-sm font-medium text-gray-900 dark:text-white`,children:`Exchange Balance`}),m(`div`,{className:`mt-3 space-y-2 text-sm text-gray-600 dark:text-gray-300`,children:[m(`div`,{children:[`Available: `,X.amount,` `,X.asset]}),m(`div`,{children:[`Network:`,` `,Z?.displayName||`Not supported for this route`]}),Qe?null:m(`div`,{className:`text-red-600 dark:text-red-300`,children:[`The connected exchange balance is below the required`,` `,v.originAmountDisplay,`.`]})]})]}):null,U.isQuoteExpired?m(`div`,{className:`rounded-xl border border-solid border-yellow-200 bg-yellow-50 p-4 dark:border-yellow-800 dark:bg-yellow-900/20`,children:[p(`div`,{className:`text-sm font-medium text-yellow-900 dark:text-yellow-100`,children:`Quote expired`}),p(`div`,{className:`mt-2 text-sm text-yellow-700 dark:text-yellow-300`,children:`Refresh the Bluvo quote before continuing to exchange verification.`})]}):null,bt?m(`div`,{className:`rounded-xl border border-solid border-yellow-200 bg-yellow-50 p-4 dark:border-yellow-800 dark:bg-yellow-900/20`,children:[p(`div`,{className:`text-sm font-medium text-yellow-900 dark:text-yellow-100`,children:`Additional verification required`}),m(`div`,{className:`mt-2 space-y-3`,children:[vt?p(`input`,{ref:xe,type:`text`,inputMode:`numeric`,value:O.twofa,onChange:e=>ae(t=>({...t,twofa:e.target.value})),placeholder:`Authenticator code`,className:`w-full rounded-lg border border-solid border-yellow-300 bg-white px-3 py-2 text-sm text-gray-900 dark:border-yellow-700 dark:bg-gray-950 dark:text-white`}):null,mt?p(`input`,{type:`text`,inputMode:`numeric`,value:O.emailCode,onChange:e=>ae(t=>({...t,emailCode:e.target.value})),placeholder:`Email verification code`,className:`w-full rounded-lg border border-solid border-yellow-300 bg-white px-3 py-2 text-sm text-gray-900 dark:border-yellow-700 dark:bg-gray-950 dark:text-white`}):null,ht?p(`input`,{type:`text`,inputMode:`numeric`,value:O.smsCode,onChange:e=>ae(t=>({...t,smsCode:e.target.value})),placeholder:`SMS verification code`,className:`w-full rounded-lg border border-solid border-yellow-300 bg-white px-3 py-2 text-sm text-gray-900 dark:border-yellow-700 dark:bg-gray-950 dark:text-white`}):null,gt?m(`div`,{className:`rounded-lg border border-solid border-yellow-300 bg-white p-3 dark:border-yellow-700 dark:bg-gray-950`,children:[p(`div`,{className:`text-sm font-medium text-yellow-900 dark:text-yellow-100`,children:`Scan to complete face verification`}),m(`p`,{className:`mt-1 text-xs text-yellow-800 dark:text-yellow-200`,children:[`Open `,_.name,` on your phone and scan this QR code. We'll keep checking automatically.`]}),m(`div`,{className:`mt-3 flex items-center gap-2 text-xs text-yellow-800 dark:text-yellow-200`,children:[p(o,{className:`h-3.5 w-3.5`}),`Waiting for verification to complete`]}),U.faceQrCodeUrl?p(`div`,{className:`mt-3 flex justify-center rounded-lg bg-white p-3`,children:p(`img`,{src:U.faceQrCodeUrl,alt:`${_.name} face verification QR code`,className:`h-40 w-40 object-contain`})}):p(`div`,{className:`mt-3 text-xs text-yellow-800 dark:text-yellow-200`,children:`Waiting for Bluvo to provide the face verification QR code.`})]}):null,_t?p(`div`,{className:`rounded-lg border border-solid border-yellow-300 bg-white p-3 text-xs text-yellow-800 dark:border-yellow-700 dark:bg-gray-950 dark:text-yellow-200`,children:m(`div`,{className:`flex items-center gap-2`,children:[p(o,{className:`h-3.5 w-3.5`}),m(`span`,{children:[`Complete the roaming security verification in`,` `,_.name,`. We'll keep checking automatically.`]})]})}):null,Q.length>0?m(`div`,{className:`text-xs text-yellow-800 dark:text-yellow-200`,children:[`Supported methods: `,Q.join(`, `)]}):null,yt.length>0?m(`div`,{className:`text-xs text-yellow-800 dark:text-yellow-200`,children:[`Unsupported verification step required:`,` `,yt.map(e=>e.type).join(`, `)]}):null]})]}):null,ve===`confirm`?m(`div`,{className:`rounded-xl border border-solid border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900/40`,children:[p(`div`,{className:`text-sm font-medium text-gray-900 dark:text-white`,children:`Ready to confirm`}),p(`div`,{className:`mt-2 text-sm text-gray-600 dark:text-gray-300`,children:`Verification is complete. Confirm the withdrawal to submit it to the exchange.`})]}):null,tt?p(i,{error:tt,errorPrettified:nt===tt?null:nt,severity:`error`}):null,ce?p(B,{title:`Preparing funding form`,description:`Loading balances and matching the exchange route to this quote.`}):k||U.isOAuthPending?p(B,{title:`Exchange window opened`,description:`Complete authorization in the secure exchange window. We'll continue automatically when it closes.`}):(H.isLoading||W.isLoading||G.isLoading)&&!q?p(B,{title:`Checking exchange connection`,description:`We are verifying the linked exchange wallet and syncing withdrawable balances.`}):U.isQuoteLoading?p(B,{title:`Creating withdrawal quote`,description:`Bluvo is preparing the exchange withdrawal details for this route.`}):U.isWithdrawing?p(B,{title:`Submitting withdrawal`,description:`The exchange is processing the withdrawal request.`}):null,p(`button`,{type:`button`,disabled:!q||!X||!Z||!Qe||ue||St,onClick:()=>void dt(),className:`w-full cursor-pointer rounded-xl bg-blue-600 px-4 py-3 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60`,children:m(`span`,{className:`inline-flex items-center justify-center gap-2`,children:[St?p(o,{className:`h-4 w-4`}):null,p(`span`,{children:xt})]})}),p(s,{quote:v,showContent:!0,compact:!0})]})})]})};export{V as default};