@relayprotocol/relay-kit-ui 2.17.2

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 (924) hide show
  1. package/LICENSE +21 -0
  2. package/_cjs/package.json +1 -0
  3. package/_cjs/src/components/common/AmountInput.js +42 -0
  4. package/_cjs/src/components/common/AmountInput.js.map +1 -0
  5. package/_cjs/src/components/common/BalanceDisplay.js +18 -0
  6. package/_cjs/src/components/common/BalanceDisplay.js.map +1 -0
  7. package/_cjs/src/components/common/CopyToClipBoard.js +36 -0
  8. package/_cjs/src/components/common/CopyToClipBoard.js.map +1 -0
  9. package/_cjs/src/components/common/CustomAddressModal.js +105 -0
  10. package/_cjs/src/components/common/CustomAddressModal.js.map +1 -0
  11. package/_cjs/src/components/common/ErrorWell.js +41 -0
  12. package/_cjs/src/components/common/ErrorWell.js.map +1 -0
  13. package/_cjs/src/components/common/LoadingSpinner.js +19 -0
  14. package/_cjs/src/components/common/LoadingSpinner.js.map +1 -0
  15. package/_cjs/src/components/common/Modal.js +34 -0
  16. package/_cjs/src/components/common/Modal.js.map +1 -0
  17. package/_cjs/src/components/common/MultiWalletDropdown.js +148 -0
  18. package/_cjs/src/components/common/MultiWalletDropdown.js.map +1 -0
  19. package/_cjs/src/components/common/RefundReason.js +52 -0
  20. package/_cjs/src/components/common/RefundReason.js.map +1 -0
  21. package/_cjs/src/components/common/SlippageToleranceConfig.js +143 -0
  22. package/_cjs/src/components/common/SlippageToleranceConfig.js.map +1 -0
  23. package/_cjs/src/components/common/TokenSelector/ChainFilter.js +119 -0
  24. package/_cjs/src/components/common/TokenSelector/ChainFilter.js.map +1 -0
  25. package/_cjs/src/components/common/TokenSelector/ChainFilterSidebar.js +150 -0
  26. package/_cjs/src/components/common/TokenSelector/ChainFilterSidebar.js.map +1 -0
  27. package/_cjs/src/components/common/TokenSelector/SuggestedTokens.js +67 -0
  28. package/_cjs/src/components/common/TokenSelector/SuggestedTokens.js.map +1 -0
  29. package/_cjs/src/components/common/TokenSelector/TagPill.js +18 -0
  30. package/_cjs/src/components/common/TokenSelector/TagPill.js.map +1 -0
  31. package/_cjs/src/components/common/TokenSelector/TokenList.js +83 -0
  32. package/_cjs/src/components/common/TokenSelector/TokenList.js.map +1 -0
  33. package/_cjs/src/components/common/TokenSelector/TokenSelector.js +402 -0
  34. package/_cjs/src/components/common/TokenSelector/TokenSelector.js.map +1 -0
  35. package/_cjs/src/components/common/TokenSelector/triggers/TokenTrigger.js +42 -0
  36. package/_cjs/src/components/common/TokenSelector/triggers/TokenTrigger.js.map +1 -0
  37. package/_cjs/src/components/common/TransactionModal/DepositAddressModal.js +85 -0
  38. package/_cjs/src/components/common/TransactionModal/DepositAddressModal.js.map +1 -0
  39. package/_cjs/src/components/common/TransactionModal/DepositAddressModalRenderer.js +247 -0
  40. package/_cjs/src/components/common/TransactionModal/DepositAddressModalRenderer.js.map +1 -0
  41. package/_cjs/src/components/common/TransactionModal/TransactionModal.js +121 -0
  42. package/_cjs/src/components/common/TransactionModal/TransactionModal.js.map +1 -0
  43. package/_cjs/src/components/common/TransactionModal/TransactionModalRenderer.js +136 -0
  44. package/_cjs/src/components/common/TransactionModal/TransactionModalRenderer.js.map +1 -0
  45. package/_cjs/src/components/common/TransactionModal/steps/ApprovalPlusSwapStep.js +80 -0
  46. package/_cjs/src/components/common/TransactionModal/steps/ApprovalPlusSwapStep.js.map +1 -0
  47. package/_cjs/src/components/common/TransactionModal/steps/DepositAddressValidatingStep.js +21 -0
  48. package/_cjs/src/components/common/TransactionModal/steps/DepositAddressValidatingStep.js.map +1 -0
  49. package/_cjs/src/components/common/TransactionModal/steps/ErrorStep.js +82 -0
  50. package/_cjs/src/components/common/TransactionModal/steps/ErrorStep.js.map +1 -0
  51. package/_cjs/src/components/common/TransactionModal/steps/SwapConfirmationStep.js +117 -0
  52. package/_cjs/src/components/common/TransactionModal/steps/SwapConfirmationStep.js.map +1 -0
  53. package/_cjs/src/components/common/TransactionModal/steps/SwapSuccessStep.js +131 -0
  54. package/_cjs/src/components/common/TransactionModal/steps/SwapSuccessStep.js.map +1 -0
  55. package/_cjs/src/components/common/TransactionModal/steps/TransactionsByChain.js +67 -0
  56. package/_cjs/src/components/common/TransactionModal/steps/TransactionsByChain.js.map +1 -0
  57. package/_cjs/src/components/common/TransactionModal/steps/WaitingForDepositStep.js +86 -0
  58. package/_cjs/src/components/common/TransactionModal/steps/WaitingForDepositStep.js.map +1 -0
  59. package/_cjs/src/components/common/UnverifiedTokenModal.js +75 -0
  60. package/_cjs/src/components/common/UnverifiedTokenModal.js.map +1 -0
  61. package/_cjs/src/components/primitives/AccessibleList.js +33 -0
  62. package/_cjs/src/components/primitives/AccessibleList.js.map +1 -0
  63. package/_cjs/src/components/primitives/Anchor.js +57 -0
  64. package/_cjs/src/components/primitives/Anchor.js.map +1 -0
  65. package/_cjs/src/components/primitives/Box.js +10 -0
  66. package/_cjs/src/components/primitives/Box.js.map +1 -0
  67. package/_cjs/src/components/primitives/Button.js +155 -0
  68. package/_cjs/src/components/primitives/Button.js.map +1 -0
  69. package/_cjs/src/components/primitives/ChainIcon.js +35 -0
  70. package/_cjs/src/components/primitives/ChainIcon.js.map +1 -0
  71. package/_cjs/src/components/primitives/ChainTokenIcon.js +54 -0
  72. package/_cjs/src/components/primitives/ChainTokenIcon.js.map +1 -0
  73. package/_cjs/src/components/primitives/Collapsible.js +46 -0
  74. package/_cjs/src/components/primitives/Collapsible.js.map +1 -0
  75. package/_cjs/src/components/primitives/Dialog.js +104 -0
  76. package/_cjs/src/components/primitives/Dialog.js.map +1 -0
  77. package/_cjs/src/components/primitives/Dropdown.js +55 -0
  78. package/_cjs/src/components/primitives/Dropdown.js.map +1 -0
  79. package/_cjs/src/components/primitives/Flex.js +76 -0
  80. package/_cjs/src/components/primitives/Flex.js.map +1 -0
  81. package/_cjs/src/components/primitives/Input.js +69 -0
  82. package/_cjs/src/components/primitives/Input.js.map +1 -0
  83. package/_cjs/src/components/primitives/Pill.js +64 -0
  84. package/_cjs/src/components/primitives/Pill.js.map +1 -0
  85. package/_cjs/src/components/primitives/Skeleton.js +18 -0
  86. package/_cjs/src/components/primitives/Skeleton.js.map +1 -0
  87. package/_cjs/src/components/primitives/Switch.js +53 -0
  88. package/_cjs/src/components/primitives/Switch.js.map +1 -0
  89. package/_cjs/src/components/primitives/Tabs.js +53 -0
  90. package/_cjs/src/components/primitives/Tabs.js.map +1 -0
  91. package/_cjs/src/components/primitives/Text.js +106 -0
  92. package/_cjs/src/components/primitives/Text.js.map +1 -0
  93. package/_cjs/src/components/primitives/Tooltip.js +44 -0
  94. package/_cjs/src/components/primitives/Tooltip.js.map +1 -0
  95. package/_cjs/src/components/primitives/index.js +31 -0
  96. package/_cjs/src/components/primitives/index.js.map +1 -0
  97. package/_cjs/src/components/widgets/FeeBreakdown.js +165 -0
  98. package/_cjs/src/components/widgets/FeeBreakdown.js.map +1 -0
  99. package/_cjs/src/components/widgets/FetchingQuoteLoader.js +20 -0
  100. package/_cjs/src/components/widgets/FetchingQuoteLoader.js.map +1 -0
  101. package/_cjs/src/components/widgets/OnrampWidget/index.js +9 -0
  102. package/_cjs/src/components/widgets/OnrampWidget/index.js.map +1 -0
  103. package/_cjs/src/components/widgets/OnrampWidget/modals/OnrampModal.js +286 -0
  104. package/_cjs/src/components/widgets/OnrampWidget/modals/OnrampModal.js.map +1 -0
  105. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampConfirmingStep.js +42 -0
  106. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampConfirmingStep.js.map +1 -0
  107. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampMoonPayStep.js +203 -0
  108. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampMoonPayStep.js.map +1 -0
  109. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingPassthroughStep.js +45 -0
  110. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingPassthroughStep.js.map +1 -0
  111. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingStepUI.js +87 -0
  112. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingStepUI.js.map +1 -0
  113. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampSuccessStep.js +39 -0
  114. package/_cjs/src/components/widgets/OnrampWidget/modals/steps/OnrampSuccessStep.js.map +1 -0
  115. package/_cjs/src/components/widgets/OnrampWidget/widget/FiatCurrencyModal.js +171 -0
  116. package/_cjs/src/components/widgets/OnrampWidget/widget/FiatCurrencyModal.js.map +1 -0
  117. package/_cjs/src/components/widgets/OnrampWidget/widget/OnrampWidgetRenderer.js +197 -0
  118. package/_cjs/src/components/widgets/OnrampWidget/widget/OnrampWidgetRenderer.js.map +1 -0
  119. package/_cjs/src/components/widgets/OnrampWidget/widget/index.js +332 -0
  120. package/_cjs/src/components/widgets/OnrampWidget/widget/index.js.map +1 -0
  121. package/_cjs/src/components/widgets/PriceImpactTooltip.js +28 -0
  122. package/_cjs/src/components/widgets/PriceImpactTooltip.js.map +1 -0
  123. package/_cjs/src/components/widgets/SwapButton.js +37 -0
  124. package/_cjs/src/components/widgets/SwapButton.js.map +1 -0
  125. package/_cjs/src/components/widgets/SwapRouteSelector.js +86 -0
  126. package/_cjs/src/components/widgets/SwapRouteSelector.js.map +1 -0
  127. package/_cjs/src/components/widgets/SwapWidget/GasTopUpSection.js +24 -0
  128. package/_cjs/src/components/widgets/SwapWidget/GasTopUpSection.js.map +1 -0
  129. package/_cjs/src/components/widgets/SwapWidget/index.js +912 -0
  130. package/_cjs/src/components/widgets/SwapWidget/index.js.map +1 -0
  131. package/_cjs/src/components/widgets/SwapWidgetRenderer.js +735 -0
  132. package/_cjs/src/components/widgets/SwapWidgetRenderer.js.map +1 -0
  133. package/_cjs/src/components/widgets/TokenSelectorContainer.js +20 -0
  134. package/_cjs/src/components/widgets/TokenSelectorContainer.js.map +1 -0
  135. package/_cjs/src/components/widgets/WidgetContainer.js +27 -0
  136. package/_cjs/src/components/widgets/WidgetContainer.js.map +1 -0
  137. package/_cjs/src/components/widgets/WidgetErrorWell.js +148 -0
  138. package/_cjs/src/components/widgets/WidgetErrorWell.js.map +1 -0
  139. package/_cjs/src/components/widgets/WidgetFooter.js +34 -0
  140. package/_cjs/src/components/widgets/WidgetFooter.js.map +1 -0
  141. package/_cjs/src/constants/address.js +15 -0
  142. package/_cjs/src/constants/address.js.map +1 -0
  143. package/_cjs/src/constants/agwRegistryAbi.js +20 -0
  144. package/_cjs/src/constants/agwRegistryAbi.js.map +1 -0
  145. package/_cjs/src/constants/cache.js +6 -0
  146. package/_cjs/src/constants/cache.js.map +1 -0
  147. package/_cjs/src/constants/chainIdToAlchemyNetworkMap.js +13 -0
  148. package/_cjs/src/constants/chainIdToAlchemyNetworkMap.js.map +1 -0
  149. package/_cjs/src/constants/currencies.js +3 -0
  150. package/_cjs/src/constants/currencies.js.map +1 -0
  151. package/_cjs/src/constants/depositAddresses.js +14 -0
  152. package/_cjs/src/constants/depositAddresses.js.map +1 -0
  153. package/_cjs/src/constants/events.js +62 -0
  154. package/_cjs/src/constants/events.js.map +1 -0
  155. package/_cjs/src/constants/maxGasBuffer.js +12 -0
  156. package/_cjs/src/constants/maxGasBuffer.js.map +1 -0
  157. package/_cjs/src/constants/moonPayCurrencies.js +295 -0
  158. package/_cjs/src/constants/moonPayCurrencies.js.map +1 -0
  159. package/_cjs/src/constants/moonPayFiatCurrencies.js +209 -0
  160. package/_cjs/src/constants/moonPayFiatCurrencies.js.map +1 -0
  161. package/_cjs/src/constants/walletCompatibility.js +23 -0
  162. package/_cjs/src/constants/walletCompatibility.js.map +1 -0
  163. package/_cjs/src/hooks/index.js +51 -0
  164. package/_cjs/src/hooks/index.js.map +1 -0
  165. package/_cjs/src/hooks/useAdaptedWalletBalance.js +28 -0
  166. package/_cjs/src/hooks/useAdaptedWalletBalance.js.map +1 -0
  167. package/_cjs/src/hooks/useAtomicBatchSupport.js +34 -0
  168. package/_cjs/src/hooks/useAtomicBatchSupport.js.map +1 -0
  169. package/_cjs/src/hooks/useBitcoinBalance.js +40 -0
  170. package/_cjs/src/hooks/useBitcoinBalance.js.map +1 -0
  171. package/_cjs/src/hooks/useCexAddresses.js +21 -0
  172. package/_cjs/src/hooks/useCexAddresses.js.map +1 -0
  173. package/_cjs/src/hooks/useCurrencyBalance.js +234 -0
  174. package/_cjs/src/hooks/useCurrencyBalance.js.map +1 -0
  175. package/_cjs/src/hooks/useDebounceState.js +35 -0
  176. package/_cjs/src/hooks/useDebounceState.js.map +1 -0
  177. package/_cjs/src/hooks/useDisconnected.js +14 -0
  178. package/_cjs/src/hooks/useDisconnected.js.map +1 -0
  179. package/_cjs/src/hooks/useDuneBalances.js +99 -0
  180. package/_cjs/src/hooks/useDuneBalances.js.map +1 -0
  181. package/_cjs/src/hooks/useENSResolver.js +37 -0
  182. package/_cjs/src/hooks/useENSResolver.js.map +1 -0
  183. package/_cjs/src/hooks/useEclipseBalance.js +47 -0
  184. package/_cjs/src/hooks/useEclipseBalance.js.map +1 -0
  185. package/_cjs/src/hooks/useEnhancedTokensList.js +80 -0
  186. package/_cjs/src/hooks/useEnhancedTokensList.js.map +1 -0
  187. package/_cjs/src/hooks/useFallbackState.js +12 -0
  188. package/_cjs/src/hooks/useFallbackState.js.map +1 -0
  189. package/_cjs/src/hooks/useGasTopUpRequired.js +59 -0
  190. package/_cjs/src/hooks/useGasTopUpRequired.js.map +1 -0
  191. package/_cjs/src/hooks/useHyperliquidUsdcBalance.js +37 -0
  192. package/_cjs/src/hooks/useHyperliquidUsdcBalance.js.map +1 -0
  193. package/_cjs/src/hooks/useInternalRelayChains.js +23 -0
  194. package/_cjs/src/hooks/useInternalRelayChains.js.map +1 -0
  195. package/_cjs/src/hooks/useIpAddress.js +12 -0
  196. package/_cjs/src/hooks/useIpAddress.js.map +1 -0
  197. package/_cjs/src/hooks/useIsAGW.js +34 -0
  198. package/_cjs/src/hooks/useIsAGW.js.map +1 -0
  199. package/_cjs/src/hooks/useIsPassthrough.js +56 -0
  200. package/_cjs/src/hooks/useIsPassthrough.js.map +1 -0
  201. package/_cjs/src/hooks/useIsWalletCompatible.js +42 -0
  202. package/_cjs/src/hooks/useIsWalletCompatible.js.map +1 -0
  203. package/_cjs/src/hooks/useMoonPayCurrencies.js +23 -0
  204. package/_cjs/src/hooks/useMoonPayCurrencies.js.map +1 -0
  205. package/_cjs/src/hooks/useMoonPayGeolocation.js +25 -0
  206. package/_cjs/src/hooks/useMoonPayGeolocation.js.map +1 -0
  207. package/_cjs/src/hooks/useMoonPayTransaction.js +25 -0
  208. package/_cjs/src/hooks/useMoonPayTransaction.js.map +1 -0
  209. package/_cjs/src/hooks/useMounted.js +11 -0
  210. package/_cjs/src/hooks/useMounted.js.map +1 -0
  211. package/_cjs/src/hooks/usePreviousValueChange.js +14 -0
  212. package/_cjs/src/hooks/usePreviousValueChange.js.map +1 -0
  213. package/_cjs/src/hooks/useRelayClient.js +9 -0
  214. package/_cjs/src/hooks/useRelayClient.js.map +1 -0
  215. package/_cjs/src/hooks/useSuiBalance.js +48 -0
  216. package/_cjs/src/hooks/useSuiBalance.js.map +1 -0
  217. package/_cjs/src/hooks/useSupportedMoonPayCurrencyCode.js +65 -0
  218. package/_cjs/src/hooks/useSupportedMoonPayCurrencyCode.js.map +1 -0
  219. package/_cjs/src/hooks/useWalletAddress.js +23 -0
  220. package/_cjs/src/hooks/useWalletAddress.js.map +1 -0
  221. package/_cjs/src/hooks/widget/useSwapButtonCta.js +76 -0
  222. package/_cjs/src/hooks/widget/useSwapButtonCta.js.map +1 -0
  223. package/_cjs/src/icons/SwitchIcon.js +9 -0
  224. package/_cjs/src/icons/SwitchIcon.js.map +1 -0
  225. package/_cjs/src/icons/index.js +6 -0
  226. package/_cjs/src/icons/index.js.map +1 -0
  227. package/_cjs/src/img/AllChainsLogo.js +10 -0
  228. package/_cjs/src/img/AllChainsLogo.js.map +1 -0
  229. package/_cjs/src/img/MoonPayLogo.js +10 -0
  230. package/_cjs/src/img/MoonPayLogo.js.map +1 -0
  231. package/_cjs/src/img/ReservoirText.js +10 -0
  232. package/_cjs/src/img/ReservoirText.js.map +1 -0
  233. package/_cjs/src/index.js +23 -0
  234. package/_cjs/src/index.js.map +1 -0
  235. package/_cjs/src/providers/RelayClientProvider.js +14 -0
  236. package/_cjs/src/providers/RelayClientProvider.js.map +1 -0
  237. package/_cjs/src/providers/RelayKitProvider.js +123 -0
  238. package/_cjs/src/providers/RelayKitProvider.js.map +1 -0
  239. package/_cjs/src/styles.css +3408 -0
  240. package/_cjs/src/themes/RelayKitTheme.js +89 -0
  241. package/_cjs/src/themes/RelayKitTheme.js.map +1 -0
  242. package/_cjs/src/themes/index.js +6 -0
  243. package/_cjs/src/themes/index.js.map +1 -0
  244. package/_cjs/src/types/BridgeFee.js +3 -0
  245. package/_cjs/src/types/BridgeFee.js.map +1 -0
  246. package/_cjs/src/types/Fiat.js +3 -0
  247. package/_cjs/src/types/Fiat.js.map +1 -0
  248. package/_cjs/src/types/RelayTransaction.js +3 -0
  249. package/_cjs/src/types/RelayTransaction.js.map +1 -0
  250. package/_cjs/src/types/index.js +3 -0
  251. package/_cjs/src/types/index.js.map +1 -0
  252. package/_cjs/src/utils/address.js +75 -0
  253. package/_cjs/src/utils/address.js.map +1 -0
  254. package/_cjs/src/utils/bitcoin.js +12 -0
  255. package/_cjs/src/utils/bitcoin.js.map +1 -0
  256. package/_cjs/src/utils/browser.js +8 -0
  257. package/_cjs/src/utils/browser.js.map +1 -0
  258. package/_cjs/src/utils/ens.js +9 -0
  259. package/_cjs/src/utils/ens.js.map +1 -0
  260. package/_cjs/src/utils/errors.js +38 -0
  261. package/_cjs/src/utils/errors.js.map +1 -0
  262. package/_cjs/src/utils/fetcher.js +20 -0
  263. package/_cjs/src/utils/fetcher.js.map +1 -0
  264. package/_cjs/src/utils/getChainBlockExplorerUrl.js +12 -0
  265. package/_cjs/src/utils/getChainBlockExplorerUrl.js.map +1 -0
  266. package/_cjs/src/utils/getTxBlockExplorerUrl.js +28 -0
  267. package/_cjs/src/utils/getTxBlockExplorerUrl.js.map +1 -0
  268. package/_cjs/src/utils/hashing.js +41 -0
  269. package/_cjs/src/utils/hashing.js.map +1 -0
  270. package/_cjs/src/utils/localStorage.js +84 -0
  271. package/_cjs/src/utils/localStorage.js.map +1 -0
  272. package/_cjs/src/utils/moonPay.js +49 -0
  273. package/_cjs/src/utils/moonPay.js.map +1 -0
  274. package/_cjs/src/utils/nativeMaxAmount.js +137 -0
  275. package/_cjs/src/utils/nativeMaxAmount.js.map +1 -0
  276. package/_cjs/src/utils/numbers.js +171 -0
  277. package/_cjs/src/utils/numbers.js.map +1 -0
  278. package/_cjs/src/utils/qrcode.js +23 -0
  279. package/_cjs/src/utils/qrcode.js.map +1 -0
  280. package/_cjs/src/utils/quote.js +262 -0
  281. package/_cjs/src/utils/quote.js.map +1 -0
  282. package/_cjs/src/utils/relayTransaction.js +85 -0
  283. package/_cjs/src/utils/relayTransaction.js.map +1 -0
  284. package/_cjs/src/utils/slippage.js +18 -0
  285. package/_cjs/src/utils/slippage.js.map +1 -0
  286. package/_cjs/src/utils/solana.js +16 -0
  287. package/_cjs/src/utils/solana.js.map +1 -0
  288. package/_cjs/src/utils/steps.js +87 -0
  289. package/_cjs/src/utils/steps.js.map +1 -0
  290. package/_cjs/src/utils/sui.js +15 -0
  291. package/_cjs/src/utils/sui.js.map +1 -0
  292. package/_cjs/src/utils/theme.js +40 -0
  293. package/_cjs/src/utils/theme.js.map +1 -0
  294. package/_cjs/src/utils/time.js +36 -0
  295. package/_cjs/src/utils/time.js.map +1 -0
  296. package/_cjs/src/utils/titleCase.js +9 -0
  297. package/_cjs/src/utils/titleCase.js.map +1 -0
  298. package/_cjs/src/utils/tokenSelector.js +81 -0
  299. package/_cjs/src/utils/tokenSelector.js.map +1 -0
  300. package/_cjs/src/utils/tokens.js +56 -0
  301. package/_cjs/src/utils/tokens.js.map +1 -0
  302. package/_cjs/src/utils/tron.js +12 -0
  303. package/_cjs/src/utils/tron.js.map +1 -0
  304. package/_cjs/src/utils/truncate.js +18 -0
  305. package/_cjs/src/utils/truncate.js.map +1 -0
  306. package/_cjs/src/version.js +5 -0
  307. package/_cjs/src/version.js.map +1 -0
  308. package/_cjs/tsconfig.build.tsbuildinfo +1 -0
  309. package/_esm/package.json +1 -0
  310. package/_esm/src/components/common/AmountInput.js +43 -0
  311. package/_esm/src/components/common/AmountInput.js.map +1 -0
  312. package/_esm/src/components/common/BalanceDisplay.js +15 -0
  313. package/_esm/src/components/common/BalanceDisplay.js.map +1 -0
  314. package/_esm/src/components/common/CopyToClipBoard.js +31 -0
  315. package/_esm/src/components/common/CopyToClipBoard.js.map +1 -0
  316. package/_esm/src/components/common/CustomAddressModal.js +102 -0
  317. package/_esm/src/components/common/CustomAddressModal.js.map +1 -0
  318. package/_esm/src/components/common/ErrorWell.js +38 -0
  319. package/_esm/src/components/common/ErrorWell.js.map +1 -0
  320. package/_esm/src/components/common/LoadingSpinner.js +15 -0
  321. package/_esm/src/components/common/LoadingSpinner.js.map +1 -0
  322. package/_esm/src/components/common/Modal.js +30 -0
  323. package/_esm/src/components/common/Modal.js.map +1 -0
  324. package/_esm/src/components/common/MultiWalletDropdown.js +144 -0
  325. package/_esm/src/components/common/MultiWalletDropdown.js.map +1 -0
  326. package/_esm/src/components/common/RefundReason.js +49 -0
  327. package/_esm/src/components/common/RefundReason.js.map +1 -0
  328. package/_esm/src/components/common/SlippageToleranceConfig.js +143 -0
  329. package/_esm/src/components/common/SlippageToleranceConfig.js.map +1 -0
  330. package/_esm/src/components/common/TokenSelector/ChainFilter.js +116 -0
  331. package/_esm/src/components/common/TokenSelector/ChainFilter.js.map +1 -0
  332. package/_esm/src/components/common/TokenSelector/ChainFilterSidebar.js +150 -0
  333. package/_esm/src/components/common/TokenSelector/ChainFilterSidebar.js.map +1 -0
  334. package/_esm/src/components/common/TokenSelector/SuggestedTokens.js +63 -0
  335. package/_esm/src/components/common/TokenSelector/SuggestedTokens.js.map +1 -0
  336. package/_esm/src/components/common/TokenSelector/TagPill.js +15 -0
  337. package/_esm/src/components/common/TokenSelector/TagPill.js.map +1 -0
  338. package/_esm/src/components/common/TokenSelector/TokenList.js +79 -0
  339. package/_esm/src/components/common/TokenSelector/TokenList.js.map +1 -0
  340. package/_esm/src/components/common/TokenSelector/TokenSelector.js +411 -0
  341. package/_esm/src/components/common/TokenSelector/TokenSelector.js.map +1 -0
  342. package/_esm/src/components/common/TokenSelector/triggers/TokenTrigger.js +37 -0
  343. package/_esm/src/components/common/TokenSelector/triggers/TokenTrigger.js.map +1 -0
  344. package/_esm/src/components/common/TransactionModal/DepositAddressModal.js +83 -0
  345. package/_esm/src/components/common/TransactionModal/DepositAddressModal.js.map +1 -0
  346. package/_esm/src/components/common/TransactionModal/DepositAddressModalRenderer.js +245 -0
  347. package/_esm/src/components/common/TransactionModal/DepositAddressModalRenderer.js.map +1 -0
  348. package/_esm/src/components/common/TransactionModal/TransactionModal.js +120 -0
  349. package/_esm/src/components/common/TransactionModal/TransactionModal.js.map +1 -0
  350. package/_esm/src/components/common/TransactionModal/TransactionModalRenderer.js +135 -0
  351. package/_esm/src/components/common/TransactionModal/TransactionModalRenderer.js.map +1 -0
  352. package/_esm/src/components/common/TransactionModal/steps/ApprovalPlusSwapStep.js +77 -0
  353. package/_esm/src/components/common/TransactionModal/steps/ApprovalPlusSwapStep.js.map +1 -0
  354. package/_esm/src/components/common/TransactionModal/steps/DepositAddressValidatingStep.js +20 -0
  355. package/_esm/src/components/common/TransactionModal/steps/DepositAddressValidatingStep.js.map +1 -0
  356. package/_esm/src/components/common/TransactionModal/steps/ErrorStep.js +80 -0
  357. package/_esm/src/components/common/TransactionModal/steps/ErrorStep.js.map +1 -0
  358. package/_esm/src/components/common/TransactionModal/steps/SwapConfirmationStep.js +112 -0
  359. package/_esm/src/components/common/TransactionModal/steps/SwapConfirmationStep.js.map +1 -0
  360. package/_esm/src/components/common/TransactionModal/steps/SwapSuccessStep.js +130 -0
  361. package/_esm/src/components/common/TransactionModal/steps/SwapSuccessStep.js.map +1 -0
  362. package/_esm/src/components/common/TransactionModal/steps/TransactionsByChain.js +64 -0
  363. package/_esm/src/components/common/TransactionModal/steps/TransactionsByChain.js.map +1 -0
  364. package/_esm/src/components/common/TransactionModal/steps/WaitingForDepositStep.js +84 -0
  365. package/_esm/src/components/common/TransactionModal/steps/WaitingForDepositStep.js.map +1 -0
  366. package/_esm/src/components/common/UnverifiedTokenModal.js +70 -0
  367. package/_esm/src/components/common/UnverifiedTokenModal.js.map +1 -0
  368. package/_esm/src/components/primitives/AccessibleList.js +28 -0
  369. package/_esm/src/components/primitives/AccessibleList.js.map +1 -0
  370. package/_esm/src/components/primitives/Anchor.js +53 -0
  371. package/_esm/src/components/primitives/Anchor.js.map +1 -0
  372. package/_esm/src/components/primitives/Box.js +8 -0
  373. package/_esm/src/components/primitives/Box.js.map +1 -0
  374. package/_esm/src/components/primitives/Button.js +153 -0
  375. package/_esm/src/components/primitives/Button.js.map +1 -0
  376. package/_esm/src/components/primitives/ChainIcon.js +32 -0
  377. package/_esm/src/components/primitives/ChainIcon.js.map +1 -0
  378. package/_esm/src/components/primitives/ChainTokenIcon.js +50 -0
  379. package/_esm/src/components/primitives/ChainTokenIcon.js.map +1 -0
  380. package/_esm/src/components/primitives/Collapsible.js +40 -0
  381. package/_esm/src/components/primitives/Collapsible.js.map +1 -0
  382. package/_esm/src/components/primitives/Dialog.js +97 -0
  383. package/_esm/src/components/primitives/Dialog.js.map +1 -0
  384. package/_esm/src/components/primitives/Dropdown.js +49 -0
  385. package/_esm/src/components/primitives/Dropdown.js.map +1 -0
  386. package/_esm/src/components/primitives/Flex.js +73 -0
  387. package/_esm/src/components/primitives/Flex.js.map +1 -0
  388. package/_esm/src/components/primitives/Input.js +66 -0
  389. package/_esm/src/components/primitives/Input.js.map +1 -0
  390. package/_esm/src/components/primitives/Pill.js +60 -0
  391. package/_esm/src/components/primitives/Pill.js.map +1 -0
  392. package/_esm/src/components/primitives/Skeleton.js +16 -0
  393. package/_esm/src/components/primitives/Skeleton.js.map +1 -0
  394. package/_esm/src/components/primitives/Switch.js +49 -0
  395. package/_esm/src/components/primitives/Switch.js.map +1 -0
  396. package/_esm/src/components/primitives/Tabs.js +46 -0
  397. package/_esm/src/components/primitives/Tabs.js.map +1 -0
  398. package/_esm/src/components/primitives/Text.js +104 -0
  399. package/_esm/src/components/primitives/Text.js.map +1 -0
  400. package/_esm/src/components/primitives/Tooltip.js +41 -0
  401. package/_esm/src/components/primitives/Tooltip.js.map +1 -0
  402. package/_esm/src/components/primitives/index.js +14 -0
  403. package/_esm/src/components/primitives/index.js.map +1 -0
  404. package/_esm/src/components/widgets/FeeBreakdown.js +162 -0
  405. package/_esm/src/components/widgets/FeeBreakdown.js.map +1 -0
  406. package/_esm/src/components/widgets/FetchingQuoteLoader.js +19 -0
  407. package/_esm/src/components/widgets/FetchingQuoteLoader.js.map +1 -0
  408. package/_esm/src/components/widgets/OnrampWidget/index.js +2 -0
  409. package/_esm/src/components/widgets/OnrampWidget/index.js.map +1 -0
  410. package/_esm/src/components/widgets/OnrampWidget/modals/OnrampModal.js +281 -0
  411. package/_esm/src/components/widgets/OnrampWidget/modals/OnrampModal.js.map +1 -0
  412. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampConfirmingStep.js +38 -0
  413. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampConfirmingStep.js.map +1 -0
  414. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampMoonPayStep.js +176 -0
  415. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampMoonPayStep.js.map +1 -0
  416. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingPassthroughStep.js +40 -0
  417. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingPassthroughStep.js.map +1 -0
  418. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingStepUI.js +83 -0
  419. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingStepUI.js.map +1 -0
  420. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampSuccessStep.js +35 -0
  421. package/_esm/src/components/widgets/OnrampWidget/modals/steps/OnrampSuccessStep.js.map +1 -0
  422. package/_esm/src/components/widgets/OnrampWidget/widget/FiatCurrencyModal.js +170 -0
  423. package/_esm/src/components/widgets/OnrampWidget/widget/FiatCurrencyModal.js.map +1 -0
  424. package/_esm/src/components/widgets/OnrampWidget/widget/OnrampWidgetRenderer.js +195 -0
  425. package/_esm/src/components/widgets/OnrampWidget/widget/OnrampWidgetRenderer.js.map +1 -0
  426. package/_esm/src/components/widgets/OnrampWidget/widget/index.js +332 -0
  427. package/_esm/src/components/widgets/OnrampWidget/widget/index.js.map +1 -0
  428. package/_esm/src/components/widgets/PriceImpactTooltip.js +23 -0
  429. package/_esm/src/components/widgets/PriceImpactTooltip.js.map +1 -0
  430. package/_esm/src/components/widgets/SwapButton.js +36 -0
  431. package/_esm/src/components/widgets/SwapButton.js.map +1 -0
  432. package/_esm/src/components/widgets/SwapRouteSelector.js +84 -0
  433. package/_esm/src/components/widgets/SwapRouteSelector.js.map +1 -0
  434. package/_esm/src/components/widgets/SwapWidget/GasTopUpSection.js +23 -0
  435. package/_esm/src/components/widgets/SwapWidget/GasTopUpSection.js.map +1 -0
  436. package/_esm/src/components/widgets/SwapWidget/index.js +955 -0
  437. package/_esm/src/components/widgets/SwapWidget/index.js.map +1 -0
  438. package/_esm/src/components/widgets/SwapWidgetRenderer.js +754 -0
  439. package/_esm/src/components/widgets/SwapWidgetRenderer.js.map +1 -0
  440. package/_esm/src/components/widgets/TokenSelectorContainer.js +20 -0
  441. package/_esm/src/components/widgets/TokenSelectorContainer.js.map +1 -0
  442. package/_esm/src/components/widgets/WidgetContainer.js +26 -0
  443. package/_esm/src/components/widgets/WidgetContainer.js.map +1 -0
  444. package/_esm/src/components/widgets/WidgetErrorWell.js +153 -0
  445. package/_esm/src/components/widgets/WidgetErrorWell.js.map +1 -0
  446. package/_esm/src/components/widgets/WidgetFooter.js +31 -0
  447. package/_esm/src/components/widgets/WidgetFooter.js.map +1 -0
  448. package/_esm/src/constants/address.js +11 -0
  449. package/_esm/src/constants/address.js.map +1 -0
  450. package/_esm/src/constants/agwRegistryAbi.js +17 -0
  451. package/_esm/src/constants/agwRegistryAbi.js.map +1 -0
  452. package/_esm/src/constants/cache.js +3 -0
  453. package/_esm/src/constants/cache.js.map +1 -0
  454. package/_esm/src/constants/chainIdToAlchemyNetworkMap.js +11 -0
  455. package/_esm/src/constants/chainIdToAlchemyNetworkMap.js.map +1 -0
  456. package/_esm/src/constants/currencies.js +2 -0
  457. package/_esm/src/constants/currencies.js.map +1 -0
  458. package/_esm/src/constants/depositAddresses.js +11 -0
  459. package/_esm/src/constants/depositAddresses.js.map +1 -0
  460. package/_esm/src/constants/events.js +60 -0
  461. package/_esm/src/constants/events.js.map +1 -0
  462. package/_esm/src/constants/maxGasBuffer.js +9 -0
  463. package/_esm/src/constants/maxGasBuffer.js.map +1 -0
  464. package/_esm/src/constants/moonPayCurrencies.js +293 -0
  465. package/_esm/src/constants/moonPayCurrencies.js.map +1 -0
  466. package/_esm/src/constants/moonPayFiatCurrencies.js +207 -0
  467. package/_esm/src/constants/moonPayFiatCurrencies.js.map +1 -0
  468. package/_esm/src/constants/walletCompatibility.js +20 -0
  469. package/_esm/src/constants/walletCompatibility.js.map +1 -0
  470. package/_esm/src/hooks/index.js +25 -0
  471. package/_esm/src/hooks/index.js.map +1 -0
  472. package/_esm/src/hooks/useAdaptedWalletBalance.js +26 -0
  473. package/_esm/src/hooks/useAdaptedWalletBalance.js.map +1 -0
  474. package/_esm/src/hooks/useAtomicBatchSupport.js +33 -0
  475. package/_esm/src/hooks/useAtomicBatchSupport.js.map +1 -0
  476. package/_esm/src/hooks/useBitcoinBalance.js +38 -0
  477. package/_esm/src/hooks/useBitcoinBalance.js.map +1 -0
  478. package/_esm/src/hooks/useCexAddresses.js +19 -0
  479. package/_esm/src/hooks/useCexAddresses.js.map +1 -0
  480. package/_esm/src/hooks/useCurrencyBalance.js +232 -0
  481. package/_esm/src/hooks/useCurrencyBalance.js.map +1 -0
  482. package/_esm/src/hooks/useDebounceState.js +33 -0
  483. package/_esm/src/hooks/useDebounceState.js.map +1 -0
  484. package/_esm/src/hooks/useDisconnected.js +12 -0
  485. package/_esm/src/hooks/useDisconnected.js.map +1 -0
  486. package/_esm/src/hooks/useDuneBalances.js +98 -0
  487. package/_esm/src/hooks/useDuneBalances.js.map +1 -0
  488. package/_esm/src/hooks/useENSResolver.js +35 -0
  489. package/_esm/src/hooks/useENSResolver.js.map +1 -0
  490. package/_esm/src/hooks/useEclipseBalance.js +44 -0
  491. package/_esm/src/hooks/useEclipseBalance.js.map +1 -0
  492. package/_esm/src/hooks/useEnhancedTokensList.js +85 -0
  493. package/_esm/src/hooks/useEnhancedTokensList.js.map +1 -0
  494. package/_esm/src/hooks/useFallbackState.js +10 -0
  495. package/_esm/src/hooks/useFallbackState.js.map +1 -0
  496. package/_esm/src/hooks/useGasTopUpRequired.js +57 -0
  497. package/_esm/src/hooks/useGasTopUpRequired.js.map +1 -0
  498. package/_esm/src/hooks/useHyperliquidUsdcBalance.js +35 -0
  499. package/_esm/src/hooks/useHyperliquidUsdcBalance.js.map +1 -0
  500. package/_esm/src/hooks/useInternalRelayChains.js +19 -0
  501. package/_esm/src/hooks/useInternalRelayChains.js.map +1 -0
  502. package/_esm/src/hooks/useIpAddress.js +10 -0
  503. package/_esm/src/hooks/useIpAddress.js.map +1 -0
  504. package/_esm/src/hooks/useIsAGW.js +31 -0
  505. package/_esm/src/hooks/useIsAGW.js.map +1 -0
  506. package/_esm/src/hooks/useIsPassthrough.js +53 -0
  507. package/_esm/src/hooks/useIsPassthrough.js.map +1 -0
  508. package/_esm/src/hooks/useIsWalletCompatible.js +40 -0
  509. package/_esm/src/hooks/useIsWalletCompatible.js.map +1 -0
  510. package/_esm/src/hooks/useMoonPayCurrencies.js +21 -0
  511. package/_esm/src/hooks/useMoonPayCurrencies.js.map +1 -0
  512. package/_esm/src/hooks/useMoonPayGeolocation.js +23 -0
  513. package/_esm/src/hooks/useMoonPayGeolocation.js.map +1 -0
  514. package/_esm/src/hooks/useMoonPayTransaction.js +23 -0
  515. package/_esm/src/hooks/useMoonPayTransaction.js.map +1 -0
  516. package/_esm/src/hooks/useMounted.js +9 -0
  517. package/_esm/src/hooks/useMounted.js.map +1 -0
  518. package/_esm/src/hooks/usePreviousValueChange.js +12 -0
  519. package/_esm/src/hooks/usePreviousValueChange.js.map +1 -0
  520. package/_esm/src/hooks/useRelayClient.js +6 -0
  521. package/_esm/src/hooks/useRelayClient.js.map +1 -0
  522. package/_esm/src/hooks/useSuiBalance.js +45 -0
  523. package/_esm/src/hooks/useSuiBalance.js.map +1 -0
  524. package/_esm/src/hooks/useSupportedMoonPayCurrencyCode.js +61 -0
  525. package/_esm/src/hooks/useSupportedMoonPayCurrencyCode.js.map +1 -0
  526. package/_esm/src/hooks/useWalletAddress.js +20 -0
  527. package/_esm/src/hooks/useWalletAddress.js.map +1 -0
  528. package/_esm/src/hooks/widget/useSwapButtonCta.js +77 -0
  529. package/_esm/src/hooks/widget/useSwapButtonCta.js.map +1 -0
  530. package/_esm/src/icons/SwitchIcon.js +6 -0
  531. package/_esm/src/icons/SwitchIcon.js.map +1 -0
  532. package/_esm/src/icons/index.js +2 -0
  533. package/_esm/src/icons/index.js.map +1 -0
  534. package/_esm/src/img/AllChainsLogo.js +7 -0
  535. package/_esm/src/img/AllChainsLogo.js.map +1 -0
  536. package/_esm/src/img/MoonPayLogo.js +7 -0
  537. package/_esm/src/img/MoonPayLogo.js.map +1 -0
  538. package/_esm/src/img/ReservoirText.js +7 -0
  539. package/_esm/src/img/ReservoirText.js.map +1 -0
  540. package/_esm/src/index.js +13 -0
  541. package/_esm/src/index.js.map +1 -0
  542. package/_esm/src/providers/RelayClientProvider.js +10 -0
  543. package/_esm/src/providers/RelayClientProvider.js.map +1 -0
  544. package/_esm/src/providers/RelayKitProvider.js +120 -0
  545. package/_esm/src/providers/RelayKitProvider.js.map +1 -0
  546. package/_esm/src/styles.css +3408 -0
  547. package/_esm/src/themes/RelayKitTheme.js +86 -0
  548. package/_esm/src/themes/RelayKitTheme.js.map +1 -0
  549. package/_esm/src/themes/index.js +2 -0
  550. package/_esm/src/themes/index.js.map +1 -0
  551. package/_esm/src/types/BridgeFee.js +2 -0
  552. package/_esm/src/types/BridgeFee.js.map +1 -0
  553. package/_esm/src/types/Fiat.js +2 -0
  554. package/_esm/src/types/Fiat.js.map +1 -0
  555. package/_esm/src/types/RelayTransaction.js +2 -0
  556. package/_esm/src/types/RelayTransaction.js.map +1 -0
  557. package/_esm/src/types/index.js +2 -0
  558. package/_esm/src/types/index.js.map +1 -0
  559. package/_esm/src/utils/address.js +68 -0
  560. package/_esm/src/utils/address.js.map +1 -0
  561. package/_esm/src/utils/bitcoin.js +8 -0
  562. package/_esm/src/utils/bitcoin.js.map +1 -0
  563. package/_esm/src/utils/browser.js +4 -0
  564. package/_esm/src/utils/browser.js.map +1 -0
  565. package/_esm/src/utils/ens.js +5 -0
  566. package/_esm/src/utils/ens.js.map +1 -0
  567. package/_esm/src/utils/errors.js +36 -0
  568. package/_esm/src/utils/errors.js.map +1 -0
  569. package/_esm/src/utils/fetcher.js +15 -0
  570. package/_esm/src/utils/fetcher.js.map +1 -0
  571. package/_esm/src/utils/getChainBlockExplorerUrl.js +11 -0
  572. package/_esm/src/utils/getChainBlockExplorerUrl.js.map +1 -0
  573. package/_esm/src/utils/getTxBlockExplorerUrl.js +23 -0
  574. package/_esm/src/utils/getTxBlockExplorerUrl.js.map +1 -0
  575. package/_esm/src/utils/hashing.js +38 -0
  576. package/_esm/src/utils/hashing.js.map +1 -0
  577. package/_esm/src/utils/localStorage.js +93 -0
  578. package/_esm/src/utils/localStorage.js.map +1 -0
  579. package/_esm/src/utils/moonPay.js +44 -0
  580. package/_esm/src/utils/moonPay.js.map +1 -0
  581. package/_esm/src/utils/nativeMaxAmount.js +172 -0
  582. package/_esm/src/utils/nativeMaxAmount.js.map +1 -0
  583. package/_esm/src/utils/numbers.js +191 -0
  584. package/_esm/src/utils/numbers.js.map +1 -0
  585. package/_esm/src/utils/qrcode.js +19 -0
  586. package/_esm/src/utils/qrcode.js.map +1 -0
  587. package/_esm/src/utils/quote.js +248 -0
  588. package/_esm/src/utils/quote.js.map +1 -0
  589. package/_esm/src/utils/relayTransaction.js +80 -0
  590. package/_esm/src/utils/relayTransaction.js.map +1 -0
  591. package/_esm/src/utils/slippage.js +14 -0
  592. package/_esm/src/utils/slippage.js.map +1 -0
  593. package/_esm/src/utils/solana.js +12 -0
  594. package/_esm/src/utils/solana.js.map +1 -0
  595. package/_esm/src/utils/steps.js +102 -0
  596. package/_esm/src/utils/steps.js.map +1 -0
  597. package/_esm/src/utils/sui.js +11 -0
  598. package/_esm/src/utils/sui.js.map +1 -0
  599. package/_esm/src/utils/theme.js +37 -0
  600. package/_esm/src/utils/theme.js.map +1 -0
  601. package/_esm/src/utils/time.js +29 -0
  602. package/_esm/src/utils/time.js.map +1 -0
  603. package/_esm/src/utils/titleCase.js +12 -0
  604. package/_esm/src/utils/titleCase.js.map +1 -0
  605. package/_esm/src/utils/tokenSelector.js +79 -0
  606. package/_esm/src/utils/tokenSelector.js.map +1 -0
  607. package/_esm/src/utils/tokens.js +50 -0
  608. package/_esm/src/utils/tokens.js.map +1 -0
  609. package/_esm/src/utils/tron.js +8 -0
  610. package/_esm/src/utils/tron.js.map +1 -0
  611. package/_esm/src/utils/truncate.js +23 -0
  612. package/_esm/src/utils/truncate.js.map +1 -0
  613. package/_esm/src/version.js +2 -0
  614. package/_esm/src/version.js.map +1 -0
  615. package/_esm/tsconfig.build.tsbuildinfo +1 -0
  616. package/_types/src/components/common/AmountInput.d.ts +10 -0
  617. package/_types/src/components/common/AmountInput.d.ts.map +1 -0
  618. package/_types/src/components/common/BalanceDisplay.d.ts +14 -0
  619. package/_types/src/components/common/BalanceDisplay.d.ts.map +1 -0
  620. package/_types/src/components/common/CopyToClipBoard.d.ts +7 -0
  621. package/_types/src/components/common/CopyToClipBoard.d.ts.map +1 -0
  622. package/_types/src/components/common/CustomAddressModal.d.ts +22 -0
  623. package/_types/src/components/common/CustomAddressModal.d.ts.map +1 -0
  624. package/_types/src/components/common/ErrorWell.d.ts +11 -0
  625. package/_types/src/components/common/ErrorWell.d.ts.map +1 -0
  626. package/_types/src/components/common/LoadingSpinner.d.ts +6 -0
  627. package/_types/src/components/common/LoadingSpinner.d.ts.map +1 -0
  628. package/_types/src/components/common/Modal.d.ts +15 -0
  629. package/_types/src/components/common/Modal.d.ts.map +1 -0
  630. package/_types/src/components/common/MultiWalletDropdown.d.ts +17 -0
  631. package/_types/src/components/common/MultiWalletDropdown.d.ts.map +1 -0
  632. package/_types/src/components/common/RefundReason.d.ts +8 -0
  633. package/_types/src/components/common/RefundReason.d.ts.map +1 -0
  634. package/_types/src/components/common/SlippageToleranceConfig.d.ts +8 -0
  635. package/_types/src/components/common/SlippageToleranceConfig.d.ts.map +1 -0
  636. package/_types/src/components/common/TokenSelector/ChainFilter.d.ts +16 -0
  637. package/_types/src/components/common/TokenSelector/ChainFilter.d.ts.map +1 -0
  638. package/_types/src/components/common/TokenSelector/ChainFilterSidebar.d.ts +20 -0
  639. package/_types/src/components/common/TokenSelector/ChainFilterSidebar.d.ts.map +1 -0
  640. package/_types/src/components/common/TokenSelector/SuggestedTokens.d.ts +10 -0
  641. package/_types/src/components/common/TokenSelector/SuggestedTokens.d.ts.map +1 -0
  642. package/_types/src/components/common/TokenSelector/TagPill.d.ts +7 -0
  643. package/_types/src/components/common/TokenSelector/TagPill.d.ts.map +1 -0
  644. package/_types/src/components/common/TokenSelector/TokenList.d.ts +13 -0
  645. package/_types/src/components/common/TokenSelector/TokenList.d.ts.map +1 -0
  646. package/_types/src/components/common/TokenSelector/TokenSelector.d.ts +22 -0
  647. package/_types/src/components/common/TokenSelector/TokenSelector.d.ts.map +1 -0
  648. package/_types/src/components/common/TokenSelector/triggers/TokenTrigger.d.ts +11 -0
  649. package/_types/src/components/common/TokenSelector/triggers/TokenTrigger.d.ts.map +1 -0
  650. package/_types/src/components/common/TransactionModal/DepositAddressModal.d.ts +26 -0
  651. package/_types/src/components/common/TransactionModal/DepositAddressModal.d.ts.map +1 -0
  652. package/_types/src/components/common/TransactionModal/DepositAddressModalRenderer.d.ts +57 -0
  653. package/_types/src/components/common/TransactionModal/DepositAddressModalRenderer.d.ts.map +1 -0
  654. package/_types/src/components/common/TransactionModal/TransactionModal.d.ts +33 -0
  655. package/_types/src/components/common/TransactionModal/TransactionModal.d.ts.map +1 -0
  656. package/_types/src/components/common/TransactionModal/TransactionModalRenderer.d.ts +63 -0
  657. package/_types/src/components/common/TransactionModal/TransactionModalRenderer.d.ts.map +1 -0
  658. package/_types/src/components/common/TransactionModal/steps/ApprovalPlusSwapStep.d.ts +15 -0
  659. package/_types/src/components/common/TransactionModal/steps/ApprovalPlusSwapStep.d.ts.map +1 -0
  660. package/_types/src/components/common/TransactionModal/steps/DepositAddressValidatingStep.d.ts +9 -0
  661. package/_types/src/components/common/TransactionModal/steps/DepositAddressValidatingStep.d.ts.map +1 -0
  662. package/_types/src/components/common/TransactionModal/steps/ErrorStep.d.ts +17 -0
  663. package/_types/src/components/common/TransactionModal/steps/ErrorStep.d.ts.map +1 -0
  664. package/_types/src/components/common/TransactionModal/steps/SwapConfirmationStep.d.ts +30 -0
  665. package/_types/src/components/common/TransactionModal/steps/SwapConfirmationStep.d.ts.map +1 -0
  666. package/_types/src/components/common/TransactionModal/steps/SwapSuccessStep.d.ts +24 -0
  667. package/_types/src/components/common/TransactionModal/steps/SwapSuccessStep.d.ts.map +1 -0
  668. package/_types/src/components/common/TransactionModal/steps/TransactionsByChain.d.ts +14 -0
  669. package/_types/src/components/common/TransactionModal/steps/TransactionsByChain.d.ts.map +1 -0
  670. package/_types/src/components/common/TransactionModal/steps/WaitingForDepositStep.d.ts +13 -0
  671. package/_types/src/components/common/TransactionModal/steps/WaitingForDepositStep.d.ts.map +1 -0
  672. package/_types/src/components/common/UnverifiedTokenModal.d.ts +16 -0
  673. package/_types/src/components/common/UnverifiedTokenModal.d.ts.map +1 -0
  674. package/_types/src/components/primitives/AccessibleList.d.ts +17 -0
  675. package/_types/src/components/primitives/AccessibleList.d.ts.map +1 -0
  676. package/_types/src/components/primitives/Anchor.d.ts +44 -0
  677. package/_types/src/components/primitives/Anchor.d.ts.map +1 -0
  678. package/_types/src/components/primitives/Box.d.ts +10 -0
  679. package/_types/src/components/primitives/Box.d.ts.map +1 -0
  680. package/_types/src/components/primitives/Button.d.ts +11 -0
  681. package/_types/src/components/primitives/Button.d.ts.map +1 -0
  682. package/_types/src/components/primitives/ChainIcon.d.ts +12 -0
  683. package/_types/src/components/primitives/ChainIcon.d.ts.map +1 -0
  684. package/_types/src/components/primitives/ChainTokenIcon.d.ts +13 -0
  685. package/_types/src/components/primitives/ChainTokenIcon.d.ts.map +1 -0
  686. package/_types/src/components/primitives/Collapsible.d.ts +20 -0
  687. package/_types/src/components/primitives/Collapsible.d.ts.map +1 -0
  688. package/_types/src/components/primitives/Dialog.d.ts +23 -0
  689. package/_types/src/components/primitives/Dialog.d.ts.map +1 -0
  690. package/_types/src/components/primitives/Dropdown.d.ts +16 -0
  691. package/_types/src/components/primitives/Dropdown.d.ts.map +1 -0
  692. package/_types/src/components/primitives/Flex.d.ts +71 -0
  693. package/_types/src/components/primitives/Flex.d.ts.map +1 -0
  694. package/_types/src/components/primitives/Input.d.ts +18 -0
  695. package/_types/src/components/primitives/Input.d.ts.map +1 -0
  696. package/_types/src/components/primitives/Pill.d.ts +50 -0
  697. package/_types/src/components/primitives/Pill.d.ts.map +1 -0
  698. package/_types/src/components/primitives/Skeleton.d.ts +8 -0
  699. package/_types/src/components/primitives/Skeleton.d.ts.map +1 -0
  700. package/_types/src/components/primitives/Switch.d.ts +10 -0
  701. package/_types/src/components/primitives/Switch.d.ts.map +1 -0
  702. package/_types/src/components/primitives/Tabs.d.ts +17 -0
  703. package/_types/src/components/primitives/Tabs.d.ts.map +1 -0
  704. package/_types/src/components/primitives/Text.d.ts +99 -0
  705. package/_types/src/components/primitives/Text.d.ts.map +1 -0
  706. package/_types/src/components/primitives/Tooltip.d.ts +3 -0
  707. package/_types/src/components/primitives/Tooltip.d.ts.map +1 -0
  708. package/_types/src/components/primitives/index.d.ts +14 -0
  709. package/_types/src/components/primitives/index.d.ts.map +1 -0
  710. package/_types/src/components/widgets/FeeBreakdown.d.ts +14 -0
  711. package/_types/src/components/widgets/FeeBreakdown.d.ts.map +1 -0
  712. package/_types/src/components/widgets/FetchingQuoteLoader.d.ts +9 -0
  713. package/_types/src/components/widgets/FetchingQuoteLoader.d.ts.map +1 -0
  714. package/_types/src/components/widgets/OnrampWidget/index.d.ts +2 -0
  715. package/_types/src/components/widgets/OnrampWidget/index.d.ts.map +1 -0
  716. package/_types/src/components/widgets/OnrampWidget/modals/OnrampModal.d.ts +41 -0
  717. package/_types/src/components/widgets/OnrampWidget/modals/OnrampModal.d.ts.map +1 -0
  718. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampConfirmingStep.d.ts +22 -0
  719. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampConfirmingStep.d.ts.map +1 -0
  720. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampMoonPayStep.d.ts +33 -0
  721. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampMoonPayStep.d.ts.map +1 -0
  722. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingPassthroughStep.d.ts +11 -0
  723. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingPassthroughStep.d.ts.map +1 -0
  724. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingStepUI.d.ts +19 -0
  725. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampProcessingStepUI.d.ts.map +1 -0
  726. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampSuccessStep.d.ts +15 -0
  727. package/_types/src/components/widgets/OnrampWidget/modals/steps/OnrampSuccessStep.d.ts.map +1 -0
  728. package/_types/src/components/widgets/OnrampWidget/widget/FiatCurrencyModal.d.ts +10 -0
  729. package/_types/src/components/widgets/OnrampWidget/widget/FiatCurrencyModal.d.ts.map +1 -0
  730. package/_types/src/components/widgets/OnrampWidget/widget/OnrampWidgetRenderer.d.ts +45 -0
  731. package/_types/src/components/widgets/OnrampWidget/widget/OnrampWidgetRenderer.d.ts.map +1 -0
  732. package/_types/src/components/widgets/OnrampWidget/widget/index.d.ts +38 -0
  733. package/_types/src/components/widgets/OnrampWidget/widget/index.d.ts.map +1 -0
  734. package/_types/src/components/widgets/PriceImpactTooltip.d.ts +10 -0
  735. package/_types/src/components/widgets/PriceImpactTooltip.d.ts.map +1 -0
  736. package/_types/src/components/widgets/SwapButton.d.ts +14 -0
  737. package/_types/src/components/widgets/SwapButton.d.ts.map +1 -0
  738. package/_types/src/components/widgets/SwapRouteSelector.d.ts +14 -0
  739. package/_types/src/components/widgets/SwapRouteSelector.d.ts.map +1 -0
  740. package/_types/src/components/widgets/SwapWidget/GasTopUpSection.d.ts +13 -0
  741. package/_types/src/components/widgets/SwapWidget/GasTopUpSection.d.ts.map +1 -0
  742. package/_types/src/components/widgets/SwapWidget/index.d.ts +50 -0
  743. package/_types/src/components/widgets/SwapWidget/index.d.ts.map +1 -0
  744. package/_types/src/components/widgets/SwapWidgetRenderer.d.ts +133 -0
  745. package/_types/src/components/widgets/SwapWidgetRenderer.d.ts.map +1 -0
  746. package/_types/src/components/widgets/TokenSelectorContainer.d.ts +8 -0
  747. package/_types/src/components/widgets/TokenSelectorContainer.d.ts.map +1 -0
  748. package/_types/src/components/widgets/WidgetContainer.d.ts +29 -0
  749. package/_types/src/components/widgets/WidgetContainer.d.ts.map +1 -0
  750. package/_types/src/components/widgets/WidgetErrorWell.d.ts +26 -0
  751. package/_types/src/components/widgets/WidgetErrorWell.d.ts.map +1 -0
  752. package/_types/src/components/widgets/WidgetFooter.d.ts +3 -0
  753. package/_types/src/components/widgets/WidgetFooter.d.ts.map +1 -0
  754. package/_types/src/constants/address.d.ts +5 -0
  755. package/_types/src/constants/address.d.ts.map +1 -0
  756. package/_types/src/constants/agwRegistryAbi.d.ts +16 -0
  757. package/_types/src/constants/agwRegistryAbi.d.ts.map +1 -0
  758. package/_types/src/constants/cache.d.ts +3 -0
  759. package/_types/src/constants/cache.d.ts.map +1 -0
  760. package/_types/src/constants/chainIdToAlchemyNetworkMap.d.ts +2 -0
  761. package/_types/src/constants/chainIdToAlchemyNetworkMap.d.ts.map +1 -0
  762. package/_types/src/constants/currencies.d.ts +8 -0
  763. package/_types/src/constants/currencies.d.ts.map +1 -0
  764. package/_types/src/constants/depositAddresses.d.ts +2 -0
  765. package/_types/src/constants/depositAddresses.d.ts.map +1 -0
  766. package/_types/src/constants/events.d.ts +59 -0
  767. package/_types/src/constants/events.d.ts.map +1 -0
  768. package/_types/src/constants/maxGasBuffer.d.ts +9 -0
  769. package/_types/src/constants/maxGasBuffer.d.ts.map +1 -0
  770. package/_types/src/constants/moonPayCurrencies.d.ts +11 -0
  771. package/_types/src/constants/moonPayCurrencies.d.ts.map +1 -0
  772. package/_types/src/constants/moonPayFiatCurrencies.d.ts +8 -0
  773. package/_types/src/constants/moonPayFiatCurrencies.d.ts.map +1 -0
  774. package/_types/src/constants/walletCompatibility.d.ts +4 -0
  775. package/_types/src/constants/walletCompatibility.d.ts.map +1 -0
  776. package/_types/src/hooks/index.d.ts +25 -0
  777. package/_types/src/hooks/index.d.ts.map +1 -0
  778. package/_types/src/hooks/useAdaptedWalletBalance.d.ts +175 -0
  779. package/_types/src/hooks/useAdaptedWalletBalance.d.ts.map +1 -0
  780. package/_types/src/hooks/useAtomicBatchSupport.d.ts +9 -0
  781. package/_types/src/hooks/useAtomicBatchSupport.d.ts.map +1 -0
  782. package/_types/src/hooks/useBitcoinBalance.d.ts +13 -0
  783. package/_types/src/hooks/useBitcoinBalance.d.ts.map +1 -0
  784. package/_types/src/hooks/useCexAddresses.d.ts +6 -0
  785. package/_types/src/hooks/useCexAddresses.d.ts.map +1 -0
  786. package/_types/src/hooks/useCurrencyBalance.d.ts +23 -0
  787. package/_types/src/hooks/useCurrencyBalance.d.ts.map +1 -0
  788. package/_types/src/hooks/useDebounceState.d.ts +11 -0
  789. package/_types/src/hooks/useDebounceState.d.ts.map +1 -0
  790. package/_types/src/hooks/useDisconnected.d.ts +4 -0
  791. package/_types/src/hooks/useDisconnected.d.ts.map +1 -0
  792. package/_types/src/hooks/useDuneBalances.d.ts +25 -0
  793. package/_types/src/hooks/useDuneBalances.d.ts.map +1 -0
  794. package/_types/src/hooks/useENSResolver.d.ts +14 -0
  795. package/_types/src/hooks/useENSResolver.d.ts.map +1 -0
  796. package/_types/src/hooks/useEclipseBalance.d.ts +12 -0
  797. package/_types/src/hooks/useEclipseBalance.d.ts.map +1 -0
  798. package/_types/src/hooks/useEnhancedTokensList.d.ts +23 -0
  799. package/_types/src/hooks/useEnhancedTokensList.d.ts.map +1 -0
  800. package/_types/src/hooks/useFallbackState.d.ts +5 -0
  801. package/_types/src/hooks/useFallbackState.d.ts.map +1 -0
  802. package/_types/src/hooks/useGasTopUpRequired.d.ts +9 -0
  803. package/_types/src/hooks/useGasTopUpRequired.d.ts.map +1 -0
  804. package/_types/src/hooks/useHyperliquidUsdcBalance.d.ts +23 -0
  805. package/_types/src/hooks/useHyperliquidUsdcBalance.d.ts.map +1 -0
  806. package/_types/src/hooks/useInternalRelayChains.d.ts +131 -0
  807. package/_types/src/hooks/useInternalRelayChains.d.ts.map +1 -0
  808. package/_types/src/hooks/useIpAddress.d.ts +9 -0
  809. package/_types/src/hooks/useIpAddress.d.ts.map +1 -0
  810. package/_types/src/hooks/useIsAGW.d.ts +2 -0
  811. package/_types/src/hooks/useIsAGW.d.ts.map +1 -0
  812. package/_types/src/hooks/useIsPassthrough.d.ts +17 -0
  813. package/_types/src/hooks/useIsPassthrough.d.ts.map +1 -0
  814. package/_types/src/hooks/useIsWalletCompatible.d.ts +4 -0
  815. package/_types/src/hooks/useIsWalletCompatible.d.ts.map +1 -0
  816. package/_types/src/hooks/useMoonPayCurrencies.d.ts +51 -0
  817. package/_types/src/hooks/useMoonPayCurrencies.d.ts.map +1 -0
  818. package/_types/src/hooks/useMoonPayGeolocation.d.ts +25 -0
  819. package/_types/src/hooks/useMoonPayGeolocation.d.ts.map +1 -0
  820. package/_types/src/hooks/useMoonPayTransaction.d.ts +22 -0
  821. package/_types/src/hooks/useMoonPayTransaction.d.ts.map +1 -0
  822. package/_types/src/hooks/useMounted.d.ts +3 -0
  823. package/_types/src/hooks/useMounted.d.ts.map +1 -0
  824. package/_types/src/hooks/usePreviousValueChange.d.ts +3 -0
  825. package/_types/src/hooks/usePreviousValueChange.d.ts.map +1 -0
  826. package/_types/src/hooks/useRelayClient.d.ts +2 -0
  827. package/_types/src/hooks/useRelayClient.d.ts.map +1 -0
  828. package/_types/src/hooks/useSuiBalance.d.ts +14 -0
  829. package/_types/src/hooks/useSuiBalance.d.ts.map +1 -0
  830. package/_types/src/hooks/useSupportedMoonPayCurrencyCode.d.ts +11 -0
  831. package/_types/src/hooks/useSupportedMoonPayCurrencyCode.d.ts.map +1 -0
  832. package/_types/src/hooks/useWalletAddress.d.ts +5 -0
  833. package/_types/src/hooks/useWalletAddress.d.ts.map +1 -0
  834. package/_types/src/hooks/widget/useSwapButtonCta.d.ts +28 -0
  835. package/_types/src/hooks/widget/useSwapButtonCta.d.ts.map +1 -0
  836. package/_types/src/icons/SwitchIcon.d.ts +9 -0
  837. package/_types/src/icons/SwitchIcon.d.ts.map +1 -0
  838. package/_types/src/icons/index.d.ts +2 -0
  839. package/_types/src/icons/index.d.ts.map +1 -0
  840. package/_types/src/img/AllChainsLogo.d.ts +4 -0
  841. package/_types/src/img/AllChainsLogo.d.ts.map +1 -0
  842. package/_types/src/img/MoonPayLogo.d.ts +4 -0
  843. package/_types/src/img/MoonPayLogo.d.ts.map +1 -0
  844. package/_types/src/img/ReservoirText.d.ts +4 -0
  845. package/_types/src/img/ReservoirText.d.ts.map +1 -0
  846. package/_types/src/index.d.ts +11 -0
  847. package/_types/src/index.d.ts.map +1 -0
  848. package/_types/src/providers/RelayClientProvider.d.ts +9 -0
  849. package/_types/src/providers/RelayClientProvider.d.ts.map +1 -0
  850. package/_types/src/providers/RelayKitProvider.d.ts +58 -0
  851. package/_types/src/providers/RelayKitProvider.d.ts.map +1 -0
  852. package/_types/src/themes/RelayKitTheme.d.ts +78 -0
  853. package/_types/src/themes/RelayKitTheme.d.ts.map +1 -0
  854. package/_types/src/themes/index.d.ts +3 -0
  855. package/_types/src/themes/index.d.ts.map +1 -0
  856. package/_types/src/types/BridgeFee.d.ts +15 -0
  857. package/_types/src/types/BridgeFee.d.ts.map +1 -0
  858. package/_types/src/types/Fiat.d.ts +7 -0
  859. package/_types/src/types/Fiat.d.ts.map +1 -0
  860. package/_types/src/types/RelayTransaction.d.ts +4 -0
  861. package/_types/src/types/RelayTransaction.d.ts.map +1 -0
  862. package/_types/src/types/index.d.ts +21 -0
  863. package/_types/src/types/index.d.ts.map +1 -0
  864. package/_types/src/utils/address.d.ts +8 -0
  865. package/_types/src/utils/address.d.ts.map +1 -0
  866. package/_types/src/utils/bitcoin.d.ts +5 -0
  867. package/_types/src/utils/bitcoin.d.ts.map +1 -0
  868. package/_types/src/utils/browser.d.ts +2 -0
  869. package/_types/src/utils/browser.d.ts.map +1 -0
  870. package/_types/src/utils/ens.d.ts +2 -0
  871. package/_types/src/utils/ens.d.ts.map +1 -0
  872. package/_types/src/utils/errors.d.ts +3 -0
  873. package/_types/src/utils/errors.d.ts.map +1 -0
  874. package/_types/src/utils/fetcher.d.ts +4 -0
  875. package/_types/src/utils/fetcher.d.ts.map +1 -0
  876. package/_types/src/utils/getChainBlockExplorerUrl.d.ts +4 -0
  877. package/_types/src/utils/getChainBlockExplorerUrl.d.ts.map +1 -0
  878. package/_types/src/utils/getTxBlockExplorerUrl.d.ts +3 -0
  879. package/_types/src/utils/getTxBlockExplorerUrl.d.ts.map +1 -0
  880. package/_types/src/utils/hashing.d.ts +2 -0
  881. package/_types/src/utils/hashing.d.ts.map +1 -0
  882. package/_types/src/utils/localStorage.d.ts +30 -0
  883. package/_types/src/utils/localStorage.d.ts.map +1 -0
  884. package/_types/src/utils/moonPay.d.ts +11 -0
  885. package/_types/src/utils/moonPay.d.ts.map +1 -0
  886. package/_types/src/utils/nativeMaxAmount.d.ts +34 -0
  887. package/_types/src/utils/nativeMaxAmount.d.ts.map +1 -0
  888. package/_types/src/utils/numbers.d.ts +21 -0
  889. package/_types/src/utils/numbers.d.ts.map +1 -0
  890. package/_types/src/utils/qrcode.d.ts +3 -0
  891. package/_types/src/utils/qrcode.d.ts.map +1 -0
  892. package/_types/src/utils/quote.d.ts +132 -0
  893. package/_types/src/utils/quote.d.ts.map +1 -0
  894. package/_types/src/utils/relayTransaction.d.ts +21 -0
  895. package/_types/src/utils/relayTransaction.d.ts.map +1 -0
  896. package/_types/src/utils/slippage.d.ts +9 -0
  897. package/_types/src/utils/slippage.d.ts.map +1 -0
  898. package/_types/src/utils/solana.d.ts +10 -0
  899. package/_types/src/utils/solana.d.ts.map +1 -0
  900. package/_types/src/utils/steps.d.ts +43 -0
  901. package/_types/src/utils/steps.d.ts.map +1 -0
  902. package/_types/src/utils/sui.d.ts +8 -0
  903. package/_types/src/utils/sui.d.ts.map +1 -0
  904. package/_types/src/utils/theme.d.ts +5 -0
  905. package/_types/src/utils/theme.d.ts.map +1 -0
  906. package/_types/src/utils/time.d.ts +4 -0
  907. package/_types/src/utils/time.d.ts.map +1 -0
  908. package/_types/src/utils/titleCase.d.ts +8 -0
  909. package/_types/src/utils/titleCase.d.ts.map +1 -0
  910. package/_types/src/utils/tokenSelector.d.ts +23 -0
  911. package/_types/src/utils/tokenSelector.d.ts.map +1 -0
  912. package/_types/src/utils/tokens.d.ts +21 -0
  913. package/_types/src/utils/tokens.d.ts.map +1 -0
  914. package/_types/src/utils/tron.d.ts +6 -0
  915. package/_types/src/utils/tron.d.ts.map +1 -0
  916. package/_types/src/utils/truncate.d.ts +13 -0
  917. package/_types/src/utils/truncate.d.ts.map +1 -0
  918. package/_types/src/version.d.ts +2 -0
  919. package/_types/src/version.d.ts.map +1 -0
  920. package/_types/tsconfig.build.tsbuildinfo +1 -0
  921. package/dist/panda.buildinfo.json +575 -0
  922. package/dist/styles.css +3408 -0
  923. package/package.json +109 -0
  924. package/readme.md +36 -0
@@ -0,0 +1,754 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
3
+ import { useCurrencyBalance, useENSResolver, useRelayClient, useDebounceState, useWalletAddress, useDisconnected, usePreviousValueChange, useIsWalletCompatible, useFallbackState, useGasTopUpRequired } from '../../hooks/index.js';
4
+ import { formatUnits, parseUnits } from 'viem';
5
+ import { useAccount, useWalletClient } from 'wagmi';
6
+ import { useCapabilities } from 'wagmi/experimental';
7
+ import { useQueryClient } from '@tanstack/react-query';
8
+ import { calculatePriceTimeEstimate, calculateRelayerFeeProportionUsd, calculateUsdValue, extractQuoteId, getCurrentStep, getSwapEventData, isHighRelayerServiceFeeUsd, parseFees } from '../../utils/quote.js';
9
+ import { useQuote, useTokenPrice } from '@relayprotocol/relay-kit-hooks';
10
+ import { EventNames } from '../../constants/events.js';
11
+ import { ProviderOptionsContext } from '../../providers/RelayKitProvider.js';
12
+ import { addressWithFallback, isValidAddress, findSupportedWallet } from '../../utils/address.js';
13
+ import { adaptViemWallet, getDeadAddress } from '@relayprotocol/relay-sdk';
14
+ import { errorToJSON } from '../../utils/errors.js';
15
+ import { useSwapButtonCta } from '../../hooks/widget/useSwapButtonCta.js';
16
+ import { sha256 } from '../../utils/hashing.js';
17
+ import { get15MinuteInterval } from '../../utils/time.js';
18
+ // shared query options for useTokenPrice
19
+ const tokenPriceQueryOptions = {
20
+ staleTime: 60 * 1000, // 1 minute
21
+ refetchInterval: 30 * 1000, // 30 seconds
22
+ refetchOnWindowFocus: false
23
+ };
24
+ const SwapWidgetRenderer = ({ transactionModalOpen, setTransactionModalOpen, depositAddressModalOpen, fromToken: _fromToken, setFromToken: _setFromToken, toToken: _toToken, setToToken: _setToToken, defaultToAddress, defaultAmount, defaultTradeType, slippageTolerance, context, wallet, multiWalletSupportEnabled = false, linkedWallets, supportedWalletVMs, children, onAnalyticEvent, onSwapError }) => {
25
+ const [fromToken, setFromToken] = useFallbackState(_setFromToken ? _fromToken : undefined, _setFromToken
26
+ ? [
27
+ _fromToken,
28
+ _setFromToken
29
+ ]
30
+ : undefined);
31
+ const [toToken, setToToken] = useFallbackState(_setToToken ? _toToken : undefined, _setToToken
32
+ ? [_toToken, _setToToken]
33
+ : undefined);
34
+ const providerOptionsContext = useContext(ProviderOptionsContext);
35
+ const connectorKeyOverrides = providerOptionsContext.vmConnectorKeyOverrides;
36
+ const relayClient = useRelayClient();
37
+ const { connector } = useAccount();
38
+ const walletClient = useWalletClient();
39
+ const [customToAddress, setCustomToAddress] = useState(defaultToAddress);
40
+ const [useExternalLiquidity, setUseExternalLiquidity] = useState(false);
41
+ const address = useWalletAddress(wallet, linkedWallets);
42
+ const [tradeType, setTradeType] = useState(defaultTradeType ?? 'EXACT_INPUT');
43
+ const queryClient = useQueryClient();
44
+ const [steps, setSteps] = useState(null);
45
+ const [quoteInProgress, setQuoteInProgress] = useState(null);
46
+ const [waitingForSteps, setWaitingForSteps] = useState(false);
47
+ const [details, setDetails] = useState(null);
48
+ const [gasTopUpEnabled, setGasTopUpEnabled] = useState(false);
49
+ const [abortController, setAbortController] = useState(null);
50
+ const { value: amountInputValue, debouncedValue: debouncedInputAmountValue, setValue: setAmountInputValue, debouncedControls: debouncedAmountInputControls } = useDebounceState(!defaultTradeType || defaultTradeType === 'EXACT_INPUT'
51
+ ? (defaultAmount ?? '')
52
+ : '', 500);
53
+ const { value: amountOutputValue, debouncedValue: debouncedOutputAmountValue, setValue: setAmountOutputValue, debouncedControls: debouncedAmountOutputControls } = useDebounceState(defaultTradeType === 'EXPECTED_OUTPUT' ? (defaultAmount ?? '') : '', 500);
54
+ const [swapError, setSwapError] = useState(null);
55
+ const tokenPairIsCanonical = fromToken?.chainId !== undefined &&
56
+ toToken?.chainId !== undefined &&
57
+ fromToken.symbol === toToken.symbol;
58
+ const toChain = relayClient?.chains.find((chain) => chain.id === toToken?.chainId);
59
+ const fromChain = relayClient?.chains?.find((chain) => chain.id === fromToken?.chainId);
60
+ const fromChainWalletVMSupported = !fromChain?.vmType ||
61
+ supportedWalletVMs.includes(fromChain?.vmType) ||
62
+ fromChain?.id === 1337;
63
+ const toChainWalletVMSupported = !toChain?.vmType || supportedWalletVMs.includes(toChain?.vmType);
64
+ const defaultRecipient = useMemo(() => {
65
+ const _linkedWallet = linkedWallets?.find((linkedWallet) => address ===
66
+ (linkedWallet.vmType === 'evm'
67
+ ? linkedWallet.address.toLowerCase()
68
+ : linkedWallet.address));
69
+ const _isValidToAddress = isValidAddress(toChain?.vmType, customToAddress ?? '', toChain?.id, !customToAddress && _linkedWallet?.address === address
70
+ ? _linkedWallet?.connector
71
+ : undefined, connectorKeyOverrides);
72
+ if (multiWalletSupportEnabled &&
73
+ toChain &&
74
+ linkedWallets &&
75
+ !_isValidToAddress) {
76
+ const supportedAddress = findSupportedWallet(toChain, customToAddress, linkedWallets, connectorKeyOverrides);
77
+ return supportedAddress;
78
+ }
79
+ }, [
80
+ multiWalletSupportEnabled,
81
+ toChain,
82
+ customToAddress,
83
+ address,
84
+ linkedWallets,
85
+ setCustomToAddress
86
+ ]);
87
+ const recipient = customToAddress ?? defaultRecipient ?? address;
88
+ const { value: fromBalance, queryKey: fromBalanceQueryKey, isLoading: isLoadingFromBalance, isError: fromBalanceErrorFetching, isDuneBalance: fromBalanceIsDune, hasPendingBalance: fromBalancePending } = useCurrencyBalance({
89
+ chain: fromChain,
90
+ address: address,
91
+ currency: fromToken?.address ? fromToken.address : undefined,
92
+ enabled: fromToken !== undefined,
93
+ refreshInterval: undefined,
94
+ wallet
95
+ });
96
+ const { value: toBalance, queryKey: toBalanceQueryKey, isLoading: isLoadingToBalance, isDuneBalance: toBalanceIsDune, hasPendingBalance: toBalancePending } = useCurrencyBalance({
97
+ chain: toChain,
98
+ address: recipient,
99
+ currency: toToken?.address ? toToken.address : undefined,
100
+ enabled: toToken !== undefined,
101
+ refreshInterval: undefined,
102
+ wallet
103
+ });
104
+ const invalidateBalanceQueries = useCallback(() => {
105
+ const invalidatePeriodically = (invalidateFn) => {
106
+ let maxRefreshes = 4;
107
+ let refreshCount = 0;
108
+ const timer = setInterval(() => {
109
+ if (maxRefreshes === refreshCount) {
110
+ clearInterval(timer);
111
+ return;
112
+ }
113
+ refreshCount++;
114
+ invalidateFn();
115
+ }, 3000);
116
+ };
117
+ queryClient.invalidateQueries({ queryKey: ['useDuneBalances'] });
118
+ // Dune balances are sometimes stale, because of this we need to aggressively fetch them
119
+ // for a predetermined period to make sure we get back a fresh response
120
+ if (fromBalanceIsDune) {
121
+ invalidatePeriodically(() => {
122
+ queryClient.invalidateQueries({ queryKey: fromBalanceQueryKey });
123
+ });
124
+ }
125
+ else {
126
+ queryClient.invalidateQueries({ queryKey: fromBalanceQueryKey });
127
+ }
128
+ if (toBalanceIsDune) {
129
+ invalidatePeriodically(() => {
130
+ queryClient.invalidateQueries({ queryKey: toBalanceQueryKey });
131
+ });
132
+ }
133
+ else {
134
+ queryClient.invalidateQueries({ queryKey: toBalanceQueryKey });
135
+ }
136
+ }, [
137
+ queryClient,
138
+ fromBalanceQueryKey,
139
+ toBalanceQueryKey,
140
+ toBalanceIsDune,
141
+ fromBalanceIsDune,
142
+ address
143
+ ]);
144
+ const { data: capabilities } = useCapabilities({
145
+ query: {
146
+ enabled: connector &&
147
+ (connector.id === 'coinbaseWalletSDK' || connector.id === 'coinbase')
148
+ }
149
+ });
150
+ const hasAuxiliaryFundsSupport = Boolean(fromToken?.chainId
151
+ ? capabilities?.[fromToken?.chainId]?.auxiliaryFunds?.supported
152
+ : false);
153
+ const isSvmSwap = fromChain?.vmType === 'svm' || toChain?.vmType === 'svm';
154
+ const isBvmSwap = fromChain?.vmType === 'bvm' || toChain?.vmType === 'bvm';
155
+ const linkedWallet = linkedWallets?.find((linkedWallet) => address ===
156
+ (linkedWallet.vmType === 'evm'
157
+ ? linkedWallet.address.toLowerCase()
158
+ : linkedWallet.address) || linkedWallet.address === address);
159
+ const isRecipientLinked = (recipient
160
+ ? linkedWallets?.find((wallet) => wallet.address === recipient)
161
+ : undefined) !== undefined;
162
+ const isValidFromAddress = isValidAddress(fromChain?.vmType, address ?? '', fromChain?.id, linkedWallet?.connector, connectorKeyOverrides);
163
+ const fromAddressWithFallback = addressWithFallback(fromChain?.vmType, address, fromChain?.id, linkedWallet?.connector, connectorKeyOverrides);
164
+ const isValidToAddress = isValidAddress(toChain?.vmType, recipient ?? '', toChain?.id);
165
+ const toAddressWithFallback = addressWithFallback(toChain?.vmType, recipient, toChain?.id);
166
+ const externalLiquiditySupport = useQuote(relayClient ? relayClient : undefined, wallet, fromToken && toToken
167
+ ? {
168
+ user: getDeadAddress(fromChain?.vmType, fromChain?.id),
169
+ originChainId: fromToken.chainId,
170
+ destinationChainId: toToken.chainId,
171
+ originCurrency: fromToken.address,
172
+ destinationCurrency: toToken.address,
173
+ recipient: getDeadAddress(toChain?.vmType, toChain?.id),
174
+ tradeType,
175
+ appFees: providerOptionsContext.appFees,
176
+ amount: '10000000000000000000000', //Hardcode an extremely high number
177
+ referrer: relayClient?.source ?? undefined,
178
+ useExternalLiquidity: true
179
+ }
180
+ : undefined, undefined, undefined, {
181
+ refetchOnWindowFocus: false,
182
+ enabled: fromToken !== undefined &&
183
+ toToken !== undefined &&
184
+ fromChain &&
185
+ toChain &&
186
+ (fromChain.id === toChain.baseChainId ||
187
+ toChain.id === fromChain.baseChainId)
188
+ });
189
+ const supportsExternalLiquidity = tokenPairIsCanonical &&
190
+ externalLiquiditySupport.status === 'success' &&
191
+ fromChainWalletVMSupported
192
+ ? true
193
+ : false;
194
+ const { displayName: toDisplayName } = useENSResolver(recipient, {
195
+ enabled: toChain?.vmType === 'evm' && isValidToAddress
196
+ });
197
+ const [currentSlippageTolerance, setCurrentSlippageTolerance] = useState(slippageTolerance);
198
+ useEffect(() => {
199
+ setCurrentSlippageTolerance(slippageTolerance);
200
+ }, [slippageTolerance]);
201
+ const { required: gasTopUpRequired, amount: _gasTopUpAmount, amountUsd: _gasTopUpAmountUsd } = useGasTopUpRequired(toChain, fromChain, toToken, recipient);
202
+ // Retrieve the price of the `from` token
203
+ const { data: fromTokenPriceData, isLoading: isLoadingFromTokenPrice } = useTokenPrice(relayClient?.baseApiUrl, {
204
+ address: fromToken?.address ?? '',
205
+ chainId: fromToken?.chainId ?? 0,
206
+ referrer: relayClient?.source
207
+ }, {
208
+ enabled: !!(fromToken?.address && fromToken.chainId),
209
+ ...tokenPriceQueryOptions
210
+ });
211
+ // Retrieve the price of the `to` token
212
+ const { data: toTokenPriceData, isLoading: isLoadingToTokenPrice } = useTokenPrice(relayClient?.baseApiUrl, {
213
+ address: toToken?.address ?? '',
214
+ chainId: toToken?.chainId ?? 0,
215
+ referrer: relayClient?.source
216
+ }, {
217
+ enabled: !!(toToken?.address && toToken.chainId),
218
+ ...tokenPriceQueryOptions
219
+ });
220
+ const originChainSupportsProtocolv2 = fromChain?.protocol?.v2?.depository !== undefined;
221
+ const quoteProtocol = useMemo(() => {
222
+ //Enabled only on certain chains
223
+ if (fromChain?.id && originChainSupportsProtocolv2) {
224
+ if (!fromToken && !fromTokenPriceData) {
225
+ return undefined;
226
+ }
227
+ const relevantPrice = fromTokenPriceData?.price && !isLoadingFromTokenPrice
228
+ ? fromTokenPriceData.price
229
+ : undefined;
230
+ const amount = tradeType === 'EXACT_INPUT'
231
+ ? debouncedInputAmountValue
232
+ : debouncedOutputAmountValue;
233
+ if (!amount) {
234
+ return undefined;
235
+ }
236
+ const usdAmount = relevantPrice
237
+ ? calculateUsdValue(relevantPrice, amount)
238
+ : undefined;
239
+ return usdAmount !== undefined && usdAmount <= 100
240
+ ? 'preferV2'
241
+ : undefined;
242
+ }
243
+ else {
244
+ return undefined;
245
+ }
246
+ }, [
247
+ fromTokenPriceData,
248
+ isLoadingFromTokenPrice,
249
+ debouncedInputAmountValue,
250
+ tradeType,
251
+ originChainSupportsProtocolv2
252
+ ]);
253
+ const loadingProtocolVersion = fromChain?.id && originChainSupportsProtocolv2 && isLoadingFromTokenPrice;
254
+ const quoteParameters = fromToken && toToken
255
+ ? {
256
+ user: fromAddressWithFallback,
257
+ originChainId: fromToken.chainId,
258
+ destinationChainId: toToken.chainId,
259
+ originCurrency: fromToken.address,
260
+ destinationCurrency: toToken.address,
261
+ recipient: toAddressWithFallback,
262
+ tradeType,
263
+ appFees: providerOptionsContext.appFees,
264
+ amount: tradeType === 'EXACT_INPUT'
265
+ ? parseUnits(debouncedInputAmountValue, fromToken.decimals).toString()
266
+ : parseUnits(debouncedOutputAmountValue, toToken.decimals).toString(),
267
+ referrer: relayClient?.source ?? undefined,
268
+ useExternalLiquidity,
269
+ useDepositAddress: !fromChainWalletVMSupported || fromToken?.chainId === 1337,
270
+ refundTo: fromToken?.chainId === 1337 ? address : undefined,
271
+ slippageTolerance: slippageTolerance,
272
+ topupGas: gasTopUpEnabled && gasTopUpRequired,
273
+ protocolVersion: quoteProtocol
274
+ }
275
+ : undefined;
276
+ const onQuoteRequested = (options, config) => {
277
+ const interval = get15MinuteInterval();
278
+ const quoteRequestId = sha256({ ...options, interval });
279
+ onAnalyticEvent?.(EventNames.QUOTE_REQUESTED, {
280
+ parameters: options,
281
+ wallet_connector: linkedWallet?.connector,
282
+ chain_id_in: options?.originChainId,
283
+ chain_id_out: options?.destinationChainId,
284
+ http_config: config,
285
+ quote_request_id: quoteRequestId
286
+ });
287
+ };
288
+ const onQuoteReceived = ({ details, steps }, options) => {
289
+ const interval = get15MinuteInterval();
290
+ const quoteRequestId = sha256({ ...options, interval });
291
+ onAnalyticEvent?.(EventNames.QUOTE_RECEIVED, {
292
+ parameters: options,
293
+ wallet_connector: linkedWallet?.connector,
294
+ amount_in: details?.currencyIn?.amountFormatted,
295
+ amount_in_raw: details?.currencyIn?.amount,
296
+ currency_in: details?.currencyIn?.currency?.symbol,
297
+ chain_id_in: details?.currencyIn?.currency?.chainId,
298
+ amount_out: details?.currencyOut?.amountFormatted,
299
+ amount_out_raw: details?.currencyOut?.amount,
300
+ currency_out: details?.currencyOut?.currency?.symbol,
301
+ chain_id_out: details?.currencyOut?.currency?.chainId,
302
+ slippage_tolerance_destination_percentage: details?.slippageTolerance?.destination?.percent,
303
+ slippage_tolerance_origin_percentage: details?.slippageTolerance?.origin?.percent,
304
+ steps,
305
+ quote_request_id: quoteRequestId,
306
+ quote_id: steps ? extractQuoteId(steps) : undefined
307
+ });
308
+ };
309
+ const quoteFetchingEnabled = Boolean(relayClient &&
310
+ ((tradeType === 'EXACT_INPUT' &&
311
+ debouncedInputAmountValue &&
312
+ debouncedInputAmountValue.length > 0 &&
313
+ Number(debouncedInputAmountValue) !== 0) ||
314
+ (tradeType === 'EXPECTED_OUTPUT' &&
315
+ debouncedOutputAmountValue &&
316
+ debouncedOutputAmountValue.length > 0 &&
317
+ Number(debouncedOutputAmountValue) !== 0)) &&
318
+ fromToken !== undefined &&
319
+ toToken !== undefined &&
320
+ !transactionModalOpen &&
321
+ !depositAddressModalOpen &&
322
+ !loadingProtocolVersion);
323
+ const { data: _quoteData, error: quoteError, isFetching: isFetchingQuote, executeQuote: executeSwap, queryKey: quoteQueryKey } = useQuote(relayClient ? relayClient : undefined, wallet, quoteParameters, onQuoteRequested, onQuoteReceived, {
324
+ refetchOnWindowFocus: false,
325
+ enabled: quoteFetchingEnabled,
326
+ refetchInterval: !transactionModalOpen &&
327
+ !depositAddressModalOpen &&
328
+ debouncedInputAmountValue === amountInputValue &&
329
+ debouncedOutputAmountValue === amountOutputValue
330
+ ? 12000
331
+ : undefined
332
+ }, (e) => {
333
+ const errorMessage = errorToJSON(e?.response?.data?.message ? new Error(e?.response?.data?.message) : e);
334
+ const interval = get15MinuteInterval();
335
+ const quoteRequestId = sha256({ ...quoteParameters, interval });
336
+ onAnalyticEvent?.(EventNames.QUOTE_ERROR, {
337
+ wallet_connector: linkedWallet?.connector,
338
+ error_message: errorMessage,
339
+ parameters: quoteParameters,
340
+ quote_request_id: quoteRequestId,
341
+ status_code: e.response.status ?? e.status ?? ''
342
+ });
343
+ });
344
+ const invalidateQuoteQuery = useCallback(() => {
345
+ queryClient.invalidateQueries({ queryKey: quoteQueryKey });
346
+ }, [queryClient, quoteQueryKey]);
347
+ let error = _quoteData || (isFetchingQuote && quoteFetchingEnabled) ? null : quoteError;
348
+ let quote = error ? undefined : _quoteData;
349
+ const gasTopUpAmount = quote?.details?.currencyGasTopup?.amount
350
+ ? BigInt(quote?.details?.currencyGasTopup?.amount)
351
+ : _gasTopUpAmount;
352
+ const gasTopUpAmountUsd = quote?.details?.currencyGasTopup?.amountUsd ?? _gasTopUpAmountUsd;
353
+ useDisconnected(address, () => {
354
+ setCustomToAddress(undefined);
355
+ });
356
+ useEffect(() => {
357
+ if (tradeType === 'EXACT_INPUT') {
358
+ const amountOut = quote?.details?.currencyOut?.amount ?? '';
359
+ setAmountOutputValue(amountOut !== ''
360
+ ? formatUnits(BigInt(amountOut), Number(quote?.details?.currencyOut?.currency?.decimals ?? 18))
361
+ : '');
362
+ }
363
+ else if (tradeType === 'EXPECTED_OUTPUT') {
364
+ const amountIn = quote?.details?.currencyIn?.amount ?? '';
365
+ setAmountInputValue(amountIn !== ''
366
+ ? formatUnits(BigInt(amountIn), Number(quote?.details?.currencyIn?.currency?.decimals ?? 18))
367
+ : '');
368
+ }
369
+ debouncedAmountInputControls.flush();
370
+ debouncedAmountOutputControls.flush();
371
+ }, [quote, tradeType]);
372
+ useEffect(() => {
373
+ if (useExternalLiquidity &&
374
+ !externalLiquiditySupport.isFetching &&
375
+ !supportsExternalLiquidity) {
376
+ setUseExternalLiquidity(false);
377
+ }
378
+ }, [
379
+ supportsExternalLiquidity,
380
+ useExternalLiquidity,
381
+ externalLiquiditySupport.isFetching
382
+ ]);
383
+ const feeBreakdown = useMemo(() => {
384
+ const chains = relayClient?.chains;
385
+ const fromChain = chains?.find((chain) => chain.id === fromToken?.chainId);
386
+ const toChain = chains?.find((chain) => chain.id === toToken?.chainId);
387
+ return fromToken && toToken && fromChain && toChain && quote
388
+ ? parseFees(toChain, fromChain, quote)
389
+ : null;
390
+ }, [quote, fromToken, toToken, relayClient]);
391
+ const totalAmount = BigInt(quote?.details?.currencyIn?.amount ?? 0n);
392
+ const hasInsufficientBalance = Boolean(!fromBalanceErrorFetching &&
393
+ totalAmount &&
394
+ address &&
395
+ (fromBalance ?? 0n) < totalAmount &&
396
+ !hasAuxiliaryFundsSupport &&
397
+ fromChainWalletVMSupported);
398
+ const fetchQuoteErrorMessage = error
399
+ ? error?.message
400
+ ? error?.message
401
+ : 'Unknown Error'
402
+ : null;
403
+ const fetchQuoteDataErrorMessage = error
404
+ ? error?.response?.data?.message
405
+ ? error?.response?.data.message
406
+ : 'Unknown Error'
407
+ : null;
408
+ const isInsufficientLiquidityError = Boolean(fetchQuoteErrorMessage?.includes('No quotes available'));
409
+ const isCapacityExceededError = fetchQuoteDataErrorMessage?.includes('Amount is higher than the available liquidity') || fetchQuoteDataErrorMessage?.includes('Insufficient relayer liquidity');
410
+ const isCouldNotExecuteError = fetchQuoteDataErrorMessage?.includes('Could not execute');
411
+ const highRelayerServiceFee = isHighRelayerServiceFeeUsd(quote);
412
+ const relayerFeeProportion = calculateRelayerFeeProportionUsd(quote);
413
+ const timeEstimate = calculatePriceTimeEstimate(quote?.details);
414
+ const canonicalTimeEstimate = calculatePriceTimeEstimate(externalLiquiditySupport.data?.details);
415
+ const recipientWalletSupportsChain = useIsWalletCompatible(toChain?.id, recipient, linkedWallets, onAnalyticEvent);
416
+ const isFromNative = fromToken?.address === fromChain?.currency?.address;
417
+ const isSameCurrencySameRecipientSwap = fromToken?.address === toToken?.address &&
418
+ fromToken?.chainId === toToken?.chainId &&
419
+ address === recipient;
420
+ const ctaCopy = useSwapButtonCta({
421
+ fromToken,
422
+ toToken,
423
+ multiWalletSupportEnabled,
424
+ isValidFromAddress,
425
+ fromChainWalletVMSupported,
426
+ isValidToAddress,
427
+ toChainWalletVMSupported,
428
+ fromChain,
429
+ toChain,
430
+ isSameCurrencySameRecipientSwap,
431
+ debouncedInputAmountValue,
432
+ debouncedOutputAmountValue,
433
+ hasInsufficientBalance,
434
+ isInsufficientLiquidityError,
435
+ quote,
436
+ operation: quote?.details?.operation
437
+ });
438
+ usePreviousValueChange(isCapacityExceededError && supportsExternalLiquidity, !isFetchingQuote && !externalLiquiditySupport.isFetching, (capacityExceeded) => {
439
+ if (capacityExceeded) {
440
+ onAnalyticEvent?.(EventNames.CTA_MAX_CAPACITY_PROMPTED, {
441
+ inputAmount: debouncedInputAmountValue,
442
+ outputAmount: debouncedOutputAmountValue
443
+ });
444
+ }
445
+ });
446
+ const swap = useCallback(async () => {
447
+ let submittedEvents = [];
448
+ const swapErrorHandler = (error, currentSteps) => {
449
+ const errorMessage = errorToJSON(error?.response?.data?.message
450
+ ? new Error(error?.response?.data?.message)
451
+ : error);
452
+ if (error &&
453
+ ((typeof error.message === 'string' &&
454
+ error.message.includes('rejected')) ||
455
+ (typeof error === 'string' && error.includes('rejected')) ||
456
+ (typeof error === 'string' && error.includes('Approval Denied')) ||
457
+ (typeof error === 'string' && error.includes('denied transaction')) ||
458
+ (typeof error.message === 'string' &&
459
+ error.message.includes('Approval Denied')) ||
460
+ (typeof error.message === 'string' &&
461
+ error.message.includes('Plugin Closed')) ||
462
+ (typeof error.message === 'string' &&
463
+ error.message.includes('denied transaction')) ||
464
+ (typeof error.message === 'string' &&
465
+ error.message.includes('Failed to initialize request') &&
466
+ fromChain?.id === 2741)) // Abstract @TODO: remove once privy improves handling rejected transactions
467
+ ) {
468
+ // Close the transaction modal if the user rejects the tx
469
+ setTransactionModalOpen(false);
470
+ onAnalyticEvent?.(EventNames.USER_REJECTED_WALLET, {
471
+ error_message: errorMessage
472
+ });
473
+ return;
474
+ }
475
+ const { step, stepItem } = getCurrentStep(currentSteps);
476
+ const swapEventData = {
477
+ ...getSwapEventData(quote?.details, currentSteps ?? null, linkedWallet?.connector, quoteParameters),
478
+ error_message: errorMessage
479
+ };
480
+ const isApproval = step?.id === 'approve';
481
+ const errorEvent = isApproval
482
+ ? EventNames.APPROVAL_ERROR
483
+ : EventNames.DEPOSIT_ERROR;
484
+ //Filter out receipt/deposit transaction errors, those are approval/deposit errors
485
+ const isTransactionConfirmationError = (error &&
486
+ typeof error.message === 'string' &&
487
+ error.message.includes('TransactionConfirmationError')) ||
488
+ (error.name && error.name.includes('TransactionConfirmationError'));
489
+ if (stepItem?.receipt &&
490
+ stepItem.check &&
491
+ !isTransactionConfirmationError &&
492
+ (typeof stepItem.receipt === 'object' && 'status' in stepItem.receipt
493
+ ? stepItem.receipt.status !== 'reverted'
494
+ : true) &&
495
+ (!stepItem.checkStatus || stepItem.checkStatus !== 'unknown')) {
496
+ //In some cases there's a race condition where an error is thrown before the steps get a chance to call
497
+ //the callback which triggers the success event. This is a workaround to ensure the success event is triggered when
498
+ //we have a receipt and require a fill check if we haven't already send the success event.
499
+ const successEvent = isApproval
500
+ ? EventNames.APPROVAL_SUCCESS
501
+ : EventNames.DEPOSIT_SUCCESS;
502
+ if (!submittedEvents.includes(successEvent)) {
503
+ onAnalyticEvent?.(successEvent, swapEventData);
504
+ submittedEvents.push(successEvent);
505
+ //To preserve the order of events we need to delay sending the fill error event but mark that we did send it to avoid duplicates
506
+ setTimeout(() => {
507
+ onAnalyticEvent?.(EventNames.FILL_ERROR, swapEventData);
508
+ }, 20);
509
+ }
510
+ else {
511
+ onAnalyticEvent?.(EventNames.FILL_ERROR, swapEventData);
512
+ }
513
+ }
514
+ else if (!stepItem?.receipt ||
515
+ (typeof stepItem.receipt === 'object' &&
516
+ 'status' in stepItem.receipt &&
517
+ stepItem.receipt.status === 'reverted')) {
518
+ onAnalyticEvent?.(errorEvent, swapEventData);
519
+ }
520
+ else {
521
+ onAnalyticEvent?.(EventNames.SWAP_ERROR, swapEventData);
522
+ }
523
+ setSwapError(errorMessage);
524
+ onSwapError?.(errorMessage, { ...quote, steps: currentSteps });
525
+ };
526
+ try {
527
+ const swapEventData = getSwapEventData(quote?.details, quote?.steps ? quote?.steps : null, linkedWallet?.connector, quoteParameters);
528
+ onAnalyticEvent?.(EventNames.SWAP_CTA_CLICKED, swapEventData);
529
+ setWaitingForSteps(true);
530
+ if (!executeSwap) {
531
+ throw 'Missing a quote';
532
+ }
533
+ if (!wallet && !walletClient.data) {
534
+ throw 'Missing a wallet';
535
+ }
536
+ setSteps(quote?.steps);
537
+ setQuoteInProgress(quote);
538
+ setTransactionModalOpen(true);
539
+ const _wallet = wallet ?? adaptViemWallet(walletClient.data);
540
+ const activeWalletChainId = await _wallet?.getChainId();
541
+ const activeWalletChain = relayClient?.chains?.find((chain) => chain.id === activeWalletChainId);
542
+ let targetChainId = fromToken?.chainId;
543
+ //Special case for Hyperliquid, to sign txs on an evm chain
544
+ if (fromToken?.chainId === 1337) {
545
+ targetChainId =
546
+ activeWalletChain?.vmType !== 'evm' ? 1 : activeWalletChainId;
547
+ }
548
+ if (fromToken && targetChainId && targetChainId !== activeWalletChainId) {
549
+ onAnalyticEvent?.(EventNames.SWAP_SWITCH_NETWORK, {
550
+ activeWalletChainId,
551
+ ...swapEventData
552
+ });
553
+ await _wallet?.switchChain(targetChainId);
554
+ }
555
+ let _currentSteps = undefined;
556
+ const execPromise = executeSwap(({ steps: currentSteps }) => {
557
+ setSteps(currentSteps);
558
+ _currentSteps = currentSteps;
559
+ const { step, stepItem } = getCurrentStep(currentSteps);
560
+ const swapEventData = getSwapEventData(quote?.details, currentSteps, linkedWallet?.connector, quoteParameters);
561
+ if (step && stepItem) {
562
+ //@ts-ignore
563
+ const isApproval = step.id === 'approve' || step.id === 'approval';
564
+ let submittedEvent = isApproval
565
+ ? EventNames.APPROVAL_SUBMITTED
566
+ : EventNames.DEPOSIT_SUBMITTED;
567
+ const successEvent = isApproval
568
+ ? EventNames.APPROVAL_SUCCESS
569
+ : EventNames.DEPOSIT_SUCCESS;
570
+ const isBatchTransaction = Boolean(Array.isArray(step.items) &&
571
+ step.items.length > 1 &&
572
+ wallet?.handleBatchTransactionStep);
573
+ if (!isApproval && isBatchTransaction) {
574
+ submittedEvent = EventNames.BATCH_TX_SUBMITTED;
575
+ }
576
+ if (!submittedEvents.includes(submittedEvent) &&
577
+ !stepItem.receipt &&
578
+ stepItem?.txHashes &&
579
+ stepItem?.txHashes?.length > 0) {
580
+ submittedEvents.push(submittedEvent);
581
+ onAnalyticEvent?.(submittedEvent, swapEventData);
582
+ }
583
+ else if ((!submittedEvents.includes(successEvent) &&
584
+ stepItem.receipt &&
585
+ !(typeof stepItem.receipt === 'object' &&
586
+ 'status' in stepItem.receipt &&
587
+ stepItem.receipt.status === 'reverted')) ||
588
+ stepItem.checkStatus === 'pending') {
589
+ onAnalyticEvent?.(successEvent, swapEventData);
590
+ submittedEvents.push(successEvent);
591
+ }
592
+ if (stepItem.status === 'complete' &&
593
+ stepItem.check &&
594
+ !submittedEvents.includes(EventNames.FILL_SUCCESS)) {
595
+ //Sometimes a fill may be quicker than the tx receipt is available, so we need to handle this scenario
596
+ if (!submittedEvents.includes(EventNames.DEPOSIT_SUCCESS) &&
597
+ !isBatchTransaction) {
598
+ onAnalyticEvent?.(EventNames.DEPOSIT_SUCCESS, swapEventData);
599
+ submittedEvents.push(EventNames.DEPOSIT_SUCCESS);
600
+ //To preserve the order of events we need to delay sending the fill success event but mark that we did send it to avoid duplicates
601
+ setTimeout(() => {
602
+ onAnalyticEvent?.(EventNames.FILL_SUCCESS, swapEventData);
603
+ }, 20);
604
+ }
605
+ else {
606
+ onAnalyticEvent?.(EventNames.FILL_SUCCESS, swapEventData);
607
+ }
608
+ submittedEvents.push(EventNames.FILL_SUCCESS);
609
+ }
610
+ }
611
+ else if (currentSteps?.every((step) => step.items?.every((item) => item.status === 'complete')) &&
612
+ !submittedEvents.includes(EventNames.FILL_SUCCESS)) {
613
+ //Sometimes a fill may be quicker than the tx receipt is available, so we need to handle this scenario
614
+ if (!submittedEvents.includes(EventNames.DEPOSIT_SUCCESS) &&
615
+ !submittedEvents.includes(EventNames.BATCH_TX_SUBMITTED)) {
616
+ onAnalyticEvent?.(EventNames.DEPOSIT_SUCCESS, swapEventData);
617
+ submittedEvents.push(EventNames.DEPOSIT_SUCCESS);
618
+ //To preserve the order of events we need to delay sending the fill success event but mark that we did send it to avoid duplicates
619
+ setTimeout(() => {
620
+ onAnalyticEvent?.(EventNames.FILL_SUCCESS, swapEventData);
621
+ }, 20);
622
+ }
623
+ else {
624
+ onAnalyticEvent?.(EventNames.FILL_SUCCESS, swapEventData);
625
+ }
626
+ submittedEvents.push(EventNames.FILL_SUCCESS);
627
+ }
628
+ });
629
+ // Store the AbortController for potential cancellation immediately
630
+ if (execPromise &&
631
+ typeof execPromise === 'object' &&
632
+ 'abortController' in execPromise) {
633
+ setAbortController(execPromise.abortController);
634
+ }
635
+ execPromise
636
+ ?.catch((error) => {
637
+ swapErrorHandler(error, _currentSteps);
638
+ })
639
+ .finally(() => {
640
+ setWaitingForSteps(false);
641
+ setAbortController(null);
642
+ invalidateBalanceQueries();
643
+ });
644
+ }
645
+ catch (error) {
646
+ swapErrorHandler(error);
647
+ setWaitingForSteps(false);
648
+ }
649
+ // eslint-disable-next-line react-hooks/exhaustive-deps
650
+ }, [
651
+ relayClient,
652
+ address,
653
+ connector,
654
+ wallet,
655
+ walletClient,
656
+ fromToken,
657
+ toToken,
658
+ customToAddress,
659
+ recipient,
660
+ debouncedInputAmountValue,
661
+ debouncedOutputAmountValue,
662
+ tradeType,
663
+ useExternalLiquidity,
664
+ waitingForSteps,
665
+ executeSwap,
666
+ setSteps,
667
+ setQuoteInProgress,
668
+ invalidateBalanceQueries,
669
+ linkedWallet,
670
+ abortController
671
+ ]);
672
+ return (_jsx(_Fragment, { children: children({
673
+ quote,
674
+ steps,
675
+ setSteps,
676
+ swap,
677
+ transactionModalOpen,
678
+ feeBreakdown,
679
+ fromToken,
680
+ setFromToken,
681
+ toToken,
682
+ setToToken,
683
+ swapError,
684
+ error,
685
+ toDisplayName,
686
+ address,
687
+ recipient,
688
+ customToAddress,
689
+ setCustomToAddress,
690
+ tradeType,
691
+ setTradeType,
692
+ details,
693
+ isSameCurrencySameRecipientSwap,
694
+ debouncedInputAmountValue,
695
+ debouncedAmountInputControls,
696
+ setAmountInputValue,
697
+ amountInputValue,
698
+ amountOutputValue,
699
+ debouncedOutputAmountValue,
700
+ debouncedAmountOutputControls,
701
+ setAmountOutputValue,
702
+ toBalance,
703
+ toBalancePending,
704
+ isLoadingToBalance,
705
+ isFetchingQuote,
706
+ isLoadingFromBalance,
707
+ fromBalance,
708
+ fromBalancePending,
709
+ highRelayerServiceFee,
710
+ relayerFeeProportion,
711
+ hasInsufficientBalance,
712
+ isInsufficientLiquidityError,
713
+ isCapacityExceededError,
714
+ isCouldNotExecuteError,
715
+ ctaCopy,
716
+ isFromNative,
717
+ useExternalLiquidity,
718
+ slippageTolerance: currentSlippageTolerance,
719
+ supportsExternalLiquidity,
720
+ timeEstimate,
721
+ canonicalTimeEstimate,
722
+ fetchingExternalLiquiditySupport: externalLiquiditySupport.isFetching,
723
+ isSvmSwap,
724
+ isBvmSwap,
725
+ isValidFromAddress,
726
+ isValidToAddress,
727
+ supportedWalletVMs,
728
+ fromChainWalletVMSupported,
729
+ toChainWalletVMSupported,
730
+ isRecipientLinked,
731
+ recipientWalletSupportsChain,
732
+ gasTopUpEnabled,
733
+ setGasTopUpEnabled,
734
+ gasTopUpRequired,
735
+ gasTopUpAmount,
736
+ gasTopUpAmountUsd,
737
+ invalidateBalanceQueries,
738
+ invalidateQuoteQuery,
739
+ setUseExternalLiquidity,
740
+ setDetails,
741
+ setSwapError,
742
+ quoteInProgress,
743
+ setQuoteInProgress,
744
+ linkedWallet,
745
+ quoteParameters,
746
+ abortController,
747
+ fromTokenPriceData,
748
+ toTokenPriceData,
749
+ isLoadingFromTokenPrice,
750
+ isLoadingToTokenPrice
751
+ }) }));
752
+ };
753
+ export default SwapWidgetRenderer;
754
+ //# sourceMappingURL=SwapWidgetRenderer.js.map