thirdweb 5.105.8 → 5.105.10

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 (479) hide show
  1. package/dist/cjs/bridge/Chains.js +20 -14
  2. package/dist/cjs/bridge/Chains.js.map +1 -1
  3. package/dist/cjs/chains/chain-definitions/t-rex-testnet.js +20 -0
  4. package/dist/cjs/chains/chain-definitions/t-rex-testnet.js.map +1 -0
  5. package/dist/cjs/chains/utils.js +8 -34
  6. package/dist/cjs/chains/utils.js.map +1 -1
  7. package/dist/cjs/exports/chains.js +3 -1
  8. package/dist/cjs/exports/chains.js.map +1 -1
  9. package/dist/cjs/insight/common.js +5 -13
  10. package/dist/cjs/insight/common.js.map +1 -1
  11. package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
  12. package/dist/cjs/pay/buyWithFiat/isSwapRequiredPostOnramp.js +0 -44
  13. package/dist/cjs/pay/buyWithFiat/isSwapRequiredPostOnramp.js.map +1 -1
  14. package/dist/cjs/pay/utils/commonTypes.js +1 -2
  15. package/dist/cjs/pay/utils/commonTypes.js.map +1 -1
  16. package/dist/cjs/react/core/hooks/useBridgeQuote.js +3 -1
  17. package/dist/cjs/react/core/hooks/useBridgeQuote.js.map +1 -1
  18. package/dist/cjs/react/core/hooks/usePaymentMethods.js +87 -53
  19. package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -1
  20. package/dist/cjs/react/core/utils/storage.js +1 -2
  21. package/dist/cjs/react/core/utils/storage.js.map +1 -1
  22. package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +7 -2
  23. package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
  24. package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +3 -2
  25. package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
  26. package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js +4 -3
  27. package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
  28. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +11 -6
  29. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  30. package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js +0 -1
  31. package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
  32. package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js +1 -7
  33. package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
  34. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +0 -1
  35. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  36. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +0 -1
  37. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
  38. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +0 -112
  39. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
  40. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js +0 -9
  41. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
  42. package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +0 -1
  43. package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
  44. package/dist/cjs/react/web/ui/PayEmbed.js +1 -30
  45. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  46. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +0 -1
  47. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
  48. package/dist/cjs/react/web/ui/components/Modal.js +3 -3
  49. package/dist/cjs/react/web/ui/components/Modal.js.map +1 -1
  50. package/dist/cjs/react/web/ui/components/buttons.js +0 -2
  51. package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
  52. package/dist/cjs/react/web/ui/components/text.js +0 -1
  53. package/dist/cjs/react/web/ui/components/text.js.map +1 -1
  54. package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js +0 -1
  55. package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
  56. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +0 -1
  57. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  58. package/dist/cjs/version.js +1 -1
  59. package/dist/cjs/version.js.map +1 -1
  60. package/dist/esm/bridge/Chains.js +20 -14
  61. package/dist/esm/bridge/Chains.js.map +1 -1
  62. package/dist/esm/chains/chain-definitions/t-rex-testnet.js +17 -0
  63. package/dist/esm/chains/chain-definitions/t-rex-testnet.js.map +1 -0
  64. package/dist/esm/chains/utils.js +7 -33
  65. package/dist/esm/chains/utils.js.map +1 -1
  66. package/dist/esm/exports/chains.js +1 -0
  67. package/dist/esm/exports/chains.js.map +1 -1
  68. package/dist/esm/insight/common.js +6 -13
  69. package/dist/esm/insight/common.js.map +1 -1
  70. package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
  71. package/dist/esm/pay/buyWithFiat/isSwapRequiredPostOnramp.js +0 -43
  72. package/dist/esm/pay/buyWithFiat/isSwapRequiredPostOnramp.js.map +1 -1
  73. package/dist/esm/pay/utils/commonTypes.js +2 -1
  74. package/dist/esm/pay/utils/commonTypes.js.map +1 -1
  75. package/dist/esm/react/core/hooks/useBridgeQuote.js +3 -1
  76. package/dist/esm/react/core/hooks/useBridgeQuote.js.map +1 -1
  77. package/dist/esm/react/core/hooks/usePaymentMethods.js +88 -54
  78. package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -1
  79. package/dist/esm/react/core/utils/storage.js +0 -1
  80. package/dist/esm/react/core/utils/storage.js.map +1 -1
  81. package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +7 -2
  82. package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
  83. package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +3 -2
  84. package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
  85. package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js +4 -3
  86. package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
  87. package/dist/esm/react/web/ui/ConnectWallet/Details.js +12 -7
  88. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  89. package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js +0 -1
  90. package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
  91. package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js +1 -7
  92. package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
  93. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +0 -1
  94. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  95. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +1 -1
  96. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
  97. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +1 -110
  98. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
  99. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js +0 -8
  100. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
  101. package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +0 -1
  102. package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
  103. package/dist/esm/react/web/ui/PayEmbed.js +3 -32
  104. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  105. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +0 -1
  106. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
  107. package/dist/esm/react/web/ui/components/Modal.js +1 -1
  108. package/dist/esm/react/web/ui/components/Modal.js.map +1 -1
  109. package/dist/esm/react/web/ui/components/buttons.js +0 -2
  110. package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
  111. package/dist/esm/react/web/ui/components/text.js +0 -1
  112. package/dist/esm/react/web/ui/components/text.js.map +1 -1
  113. package/dist/esm/react/web/wallets/shared/GetStartedScreen.js +0 -1
  114. package/dist/esm/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
  115. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +0 -1
  116. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  117. package/dist/esm/version.js +1 -1
  118. package/dist/esm/version.js.map +1 -1
  119. package/dist/types/bridge/Chains.d.ts.map +1 -1
  120. package/dist/types/chains/chain-definitions/t-rex-testnet.d.ts +7 -0
  121. package/dist/types/chains/chain-definitions/t-rex-testnet.d.ts.map +1 -0
  122. package/dist/types/chains/types.d.ts +0 -7
  123. package/dist/types/chains/types.d.ts.map +1 -1
  124. package/dist/types/chains/utils.d.ts +2 -15
  125. package/dist/types/chains/utils.d.ts.map +1 -1
  126. package/dist/types/exports/chains.d.ts +1 -0
  127. package/dist/types/exports/chains.d.ts.map +1 -1
  128. package/dist/types/insight/common.d.ts +0 -1
  129. package/dist/types/insight/common.d.ts.map +1 -1
  130. package/dist/types/pay/buyWithCrypto/getStatus.d.ts +0 -3
  131. package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
  132. package/dist/types/pay/buyWithFiat/isSwapRequiredPostOnramp.d.ts +0 -7
  133. package/dist/types/pay/buyWithFiat/isSwapRequiredPostOnramp.d.ts.map +1 -1
  134. package/dist/types/pay/utils/commonTypes.d.ts +2 -1
  135. package/dist/types/pay/utils/commonTypes.d.ts.map +1 -1
  136. package/dist/types/react/core/hooks/useBridgeQuote.d.ts +2 -1
  137. package/dist/types/react/core/hooks/useBridgeQuote.d.ts.map +1 -1
  138. package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -1
  139. package/dist/types/react/core/utils/storage.d.ts +0 -1
  140. package/dist/types/react/core/utils/storage.d.ts.map +1 -1
  141. package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +1 -1
  142. package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +5 -1
  143. package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -1
  144. package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +2 -1
  145. package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -1
  146. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  147. package/dist/types/react/web/ui/ConnectWallet/MenuButton.d.ts.map +1 -1
  148. package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts.map +1 -1
  149. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts +0 -1
  150. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts.map +1 -1
  151. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +0 -29
  152. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts.map +1 -1
  153. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts +0 -26
  154. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map +1 -1
  155. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts +0 -6
  156. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts.map +1 -1
  157. package/dist/types/react/web/ui/PayEmbed.d.ts +1 -1
  158. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  159. package/dist/types/react/web/ui/components/Modal.d.ts +0 -4
  160. package/dist/types/react/web/ui/components/Modal.d.ts.map +1 -1
  161. package/dist/types/react/web/ui/components/buttons.d.ts +2 -1
  162. package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
  163. package/dist/types/react/web/ui/components/text.d.ts.map +1 -1
  164. package/dist/types/version.d.ts +1 -1
  165. package/dist/types/version.d.ts.map +1 -1
  166. package/package.json +2 -2
  167. package/src/bridge/Chains.ts +23 -14
  168. package/src/chains/chain-definitions/t-rex-testnet.ts +17 -0
  169. package/src/chains/types.ts +0 -8
  170. package/src/chains/utils.ts +10 -51
  171. package/src/exports/chains.ts +1 -0
  172. package/src/insight/common.ts +6 -19
  173. package/src/pay/buyWithCrypto/getStatus.ts +0 -5
  174. package/src/pay/buyWithFiat/isSwapRequiredPostOnramp.ts +0 -56
  175. package/src/pay/utils/commonTypes.ts +1 -1
  176. package/src/react/core/hooks/useBridgeQuote.ts +4 -0
  177. package/src/react/core/hooks/usePaymentMethods.ts +112 -65
  178. package/src/react/core/utils/storage.ts +0 -1
  179. package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +9 -1
  180. package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +8 -0
  181. package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +6 -0
  182. package/src/react/web/ui/ConnectWallet/Details.tsx +52 -43
  183. package/src/react/web/ui/ConnectWallet/MenuButton.tsx +0 -1
  184. package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +5 -9
  185. package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +0 -1
  186. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx +1 -1
  187. package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +0 -39
  188. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +0 -160
  189. package/src/react/web/ui/ConnectWallet/screens/Buy/utils.ts +0 -9
  190. package/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx +0 -1
  191. package/src/react/web/ui/PayEmbed.tsx +3 -66
  192. package/src/react/web/ui/TransactionButton/DepositScreen.tsx +0 -1
  193. package/src/react/web/ui/components/Modal.tsx +1 -1
  194. package/src/react/web/ui/components/buttons.tsx +1 -3
  195. package/src/react/web/ui/components/text.tsx +0 -1
  196. package/src/react/web/wallets/shared/GetStartedScreen.tsx +0 -1
  197. package/src/react/web/wallets/shared/OTPLoginUI.tsx +0 -1
  198. package/src/version.ts +1 -1
  199. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +0 -468
  200. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +0 -1
  201. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +0 -116
  202. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +0 -1
  203. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js +0 -29
  204. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js.map +0 -1
  205. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js +0 -11
  206. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js.map +0 -1
  207. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +0 -28
  208. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +0 -1
  209. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +0 -26
  210. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +0 -1
  211. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js +0 -58
  212. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js.map +0 -1
  213. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/Stepper.js +0 -59
  214. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/Stepper.js.map +0 -1
  215. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +0 -118
  216. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +0 -1
  217. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +0 -32
  218. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +0 -1
  219. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +0 -108
  220. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +0 -1
  221. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -45
  222. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +0 -1
  223. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +0 -532
  224. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +0 -1
  225. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +0 -21
  226. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +0 -1
  227. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +0 -39
  228. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +0 -1
  229. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +0 -134
  230. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +0 -1
  231. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js +0 -11
  232. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js.map +0 -1
  233. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -106
  234. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +0 -1
  235. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +0 -23
  236. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +0 -1
  237. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -50
  238. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +0 -1
  239. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +0 -68
  240. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +0 -1
  241. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +0 -225
  242. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +0 -1
  243. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js +0 -12
  244. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js.map +0 -1
  245. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +0 -39
  246. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +0 -1
  247. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +0 -55
  248. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +0 -1
  249. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +0 -49
  250. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +0 -1
  251. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +0 -176
  252. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +0 -1
  253. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +0 -69
  254. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +0 -1
  255. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +0 -34
  256. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +0 -1
  257. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +0 -194
  258. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +0 -1
  259. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +0 -344
  260. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +0 -1
  261. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +0 -15
  262. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +0 -1
  263. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +0 -198
  264. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +0 -1
  265. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +0 -15
  266. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +0 -1
  267. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +0 -54
  268. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +0 -1
  269. package/dist/cjs/react/web/ui/components/Drawer.js +0 -123
  270. package/dist/cjs/react/web/ui/components/Drawer.js.map +0 -1
  271. package/dist/cjs/react/web/ui/components/StepBar.js +0 -16
  272. package/dist/cjs/react/web/ui/components/StepBar.js.map +0 -1
  273. package/dist/cjs/react/web/ui/components/SwitchNetwork.js +0 -19
  274. package/dist/cjs/react/web/ui/components/SwitchNetwork.js.map +0 -1
  275. package/dist/cjs/react/web/ui/components/token/TokenRow.js +0 -43
  276. package/dist/cjs/react/web/ui/components/token/TokenRow.js.map +0 -1
  277. package/dist/cjs/react/web/utils/errors.js +0 -44
  278. package/dist/cjs/react/web/utils/errors.js.map +0 -1
  279. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +0 -465
  280. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +0 -1
  281. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +0 -113
  282. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +0 -1
  283. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js +0 -26
  284. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js.map +0 -1
  285. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js +0 -8
  286. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js.map +0 -1
  287. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +0 -24
  288. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +0 -1
  289. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +0 -23
  290. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +0 -1
  291. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js +0 -55
  292. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js.map +0 -1
  293. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/Stepper.js +0 -55
  294. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/Stepper.js.map +0 -1
  295. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +0 -115
  296. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +0 -1
  297. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +0 -29
  298. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +0 -1
  299. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +0 -105
  300. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +0 -1
  301. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -42
  302. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +0 -1
  303. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +0 -529
  304. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +0 -1
  305. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +0 -18
  306. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +0 -1
  307. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +0 -36
  308. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +0 -1
  309. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +0 -129
  310. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +0 -1
  311. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js +0 -8
  312. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js.map +0 -1
  313. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -103
  314. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +0 -1
  315. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +0 -20
  316. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +0 -1
  317. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -47
  318. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +0 -1
  319. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +0 -65
  320. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +0 -1
  321. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +0 -221
  322. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +0 -1
  323. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js +0 -9
  324. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js.map +0 -1
  325. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +0 -35
  326. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +0 -1
  327. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +0 -52
  328. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +0 -1
  329. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +0 -46
  330. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +0 -1
  331. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +0 -173
  332. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +0 -1
  333. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +0 -66
  334. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +0 -1
  335. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +0 -31
  336. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +0 -1
  337. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +0 -191
  338. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +0 -1
  339. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +0 -341
  340. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +0 -1
  341. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +0 -12
  342. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +0 -1
  343. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +0 -195
  344. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +0 -1
  345. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +0 -11
  346. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +0 -1
  347. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +0 -51
  348. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +0 -1
  349. package/dist/esm/react/web/ui/components/Drawer.js +0 -119
  350. package/dist/esm/react/web/ui/components/Drawer.js.map +0 -1
  351. package/dist/esm/react/web/ui/components/StepBar.js +0 -13
  352. package/dist/esm/react/web/ui/components/StepBar.js.map +0 -1
  353. package/dist/esm/react/web/ui/components/SwitchNetwork.js +0 -16
  354. package/dist/esm/react/web/ui/components/SwitchNetwork.js.map +0 -1
  355. package/dist/esm/react/web/ui/components/token/TokenRow.js +0 -40
  356. package/dist/esm/react/web/ui/components/token/TokenRow.js.map +0 -1
  357. package/dist/esm/react/web/utils/errors.js +0 -41
  358. package/dist/esm/react/web/utils/errors.js.map +0 -1
  359. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +0 -26
  360. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +0 -1
  361. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts +0 -18
  362. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +0 -1
  363. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts +0 -6
  364. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts.map +0 -1
  365. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts +0 -3
  366. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts.map +0 -1
  367. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts +0 -12
  368. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts.map +0 -1
  369. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts +0 -14
  370. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts.map +0 -1
  371. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts +0 -16
  372. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts.map +0 -1
  373. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts +0 -10
  374. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts.map +0 -1
  375. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts +0 -18
  376. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +0 -1
  377. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts +0 -6
  378. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts.map +0 -1
  379. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts +0 -26
  380. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts.map +0 -1
  381. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts +0 -8
  382. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +0 -1
  383. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts +0 -20
  384. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts.map +0 -1
  385. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts +0 -10
  386. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts.map +0 -1
  387. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts +0 -15
  388. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts.map +0 -1
  389. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +0 -55
  390. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +0 -1
  391. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.d.ts +0 -2
  392. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.d.ts.map +0 -1
  393. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts +0 -14
  394. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +0 -1
  395. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts +0 -10
  396. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts.map +0 -1
  397. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts +0 -16
  398. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts.map +0 -1
  399. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts +0 -18
  400. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts.map +0 -1
  401. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts +0 -32
  402. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +0 -1
  403. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts +0 -5
  404. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts.map +0 -1
  405. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts +0 -15
  406. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +0 -1
  407. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +0 -23
  408. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +0 -1
  409. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts +0 -21
  410. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts.map +0 -1
  411. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts +0 -32
  412. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts.map +0 -1
  413. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts +0 -18
  414. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts.map +0 -1
  415. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts +0 -15
  416. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts.map +0 -1
  417. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts +0 -22
  418. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +0 -1
  419. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts +0 -25
  420. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts.map +0 -1
  421. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts +0 -26
  422. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts.map +0 -1
  423. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.d.ts +0 -25
  424. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.d.ts.map +0 -1
  425. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts +0 -14
  426. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts.map +0 -1
  427. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts +0 -6
  428. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts.map +0 -1
  429. package/dist/types/react/web/ui/components/Drawer.d.ts +0 -25
  430. package/dist/types/react/web/ui/components/Drawer.d.ts.map +0 -1
  431. package/dist/types/react/web/ui/components/StepBar.d.ts +0 -5
  432. package/dist/types/react/web/ui/components/StepBar.d.ts.map +0 -1
  433. package/dist/types/react/web/ui/components/SwitchNetwork.d.ts +0 -6
  434. package/dist/types/react/web/ui/components/SwitchNetwork.d.ts.map +0 -1
  435. package/dist/types/react/web/ui/components/token/TokenRow.d.ts +0 -14
  436. package/dist/types/react/web/ui/components/token/TokenRow.d.ts.map +0 -1
  437. package/dist/types/react/web/utils/errors.d.ts +0 -8
  438. package/dist/types/react/web/utils/errors.d.ts.map +0 -1
  439. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +0 -1075
  440. package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +0 -286
  441. package/src/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.tsx +0 -85
  442. package/src/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.tsx +0 -13
  443. package/src/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.tsx +0 -68
  444. package/src/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.tsx +0 -48
  445. package/src/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.tsx +0 -104
  446. package/src/react/web/ui/ConnectWallet/screens/Buy/Stepper.tsx +0 -91
  447. package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +0 -395
  448. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.tsx +0 -61
  449. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +0 -263
  450. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +0 -85
  451. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +0 -775
  452. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.tsx +0 -54
  453. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +0 -65
  454. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +0 -193
  455. package/src/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.tsx +0 -12
  456. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +0 -294
  457. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.tsx +0 -56
  458. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.test.ts +0 -80
  459. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.ts +0 -77
  460. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.tsx +0 -154
  461. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +0 -377
  462. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.tsx +0 -20
  463. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.tsx +0 -109
  464. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +0 -114
  465. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +0 -117
  466. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.tsx +0 -359
  467. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.tsx +0 -232
  468. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.tsx +0 -111
  469. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +0 -448
  470. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +0 -558
  471. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.tsx +0 -56
  472. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.tsx +0 -282
  473. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts +0 -23
  474. package/src/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.tsx +0 -61
  475. package/src/react/web/ui/components/Drawer.tsx +0 -171
  476. package/src/react/web/ui/components/StepBar.tsx +0 -25
  477. package/src/react/web/ui/components/SwitchNetwork.tsx +0 -35
  478. package/src/react/web/ui/components/token/TokenRow.tsx +0 -135
  479. package/src/react/web/utils/errors.ts +0 -52
@@ -1,775 +0,0 @@
1
- import { useMutation, useQueryClient } from "@tanstack/react-query";
2
- import { useCallback, useEffect, useRef, useState } from "react";
3
- import { trackPayEvent } from "../../../../../../../analytics/track/pay.js";
4
- import { getCachedChain } from "../../../../../../../chains/utils.js";
5
- import type { ThirdwebClient } from "../../../../../../../client/client.js";
6
- import { getContract } from "../../../../../../../contract/contract.js";
7
- import { allowance } from "../../../../../../../extensions/erc20/__generated__/IERC20/read/allowance.js";
8
- import { approve } from "../../../../../../../extensions/erc20/write/approve.js";
9
- import { getBuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
10
- import type { BuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
11
- import type { BuyWithFiatQuote } from "../../../../../../../pay/buyWithFiat/getQuote.js";
12
- import {
13
- type BuyWithFiatStatus,
14
- getBuyWithFiatStatus,
15
- } from "../../../../../../../pay/buyWithFiat/getStatus.js";
16
- import {
17
- getOnRampSteps,
18
- type OnRampStep,
19
- } from "../../../../../../../pay/buyWithFiat/isSwapRequiredPostOnramp.js";
20
- import type { PayTokenInfo } from "../../../../../../../pay/utils/commonTypes.js";
21
- import { sendBatchTransaction } from "../../../../../../../transaction/actions/send-batch-transaction.js";
22
- import { sendTransaction } from "../../../../../../../transaction/actions/send-transaction.js";
23
- import type { WaitForReceiptOptions } from "../../../../../../../transaction/actions/wait-for-tx-receipt.js";
24
- import { waitForReceipt } from "../../../../../../../transaction/actions/wait-for-tx-receipt.js";
25
- import { formatNumber } from "../../../../../../../utils/formatNumber.js";
26
- import { isInAppSigner } from "../../../../../../../wallets/in-app/core/wallet/is-in-app-signer.js";
27
- import { spacing } from "../../../../../../core/design-system/index.js";
28
- import { useChainName } from "../../../../../../core/hooks/others/useChainQuery.js";
29
- import { useBuyWithCryptoStatus } from "../../../../../../core/hooks/pay/useBuyWithCryptoStatus.js";
30
- import { useBuyWithFiatStatus } from "../../../../../../core/hooks/pay/useBuyWithFiatStatus.js";
31
- import { useConnectedWallets } from "../../../../../../core/hooks/wallets/useConnectedWallets.js";
32
- import { invalidateWalletBalance } from "../../../../../../core/providers/invalidateWalletBalance.js";
33
- import { Container, ModalHeader } from "../../../../components/basic.js";
34
- import { Button } from "../../../../components/buttons.js";
35
- import { Spacer } from "../../../../components/Spacer.js";
36
- import { Spinner } from "../../../../components/Spinner.js";
37
- import { SwitchNetworkButton } from "../../../../components/SwitchNetwork.js";
38
- import { Text } from "../../../../components/text.js";
39
- import { TokenSymbol } from "../../../../components/token/TokenSymbol.js";
40
- import { openOnrampPopup } from "../openOnRamppopup.js";
41
- import { PayTokenIcon } from "../PayTokenIcon.js";
42
- import type { FiatStatusMeta } from "../pay-transactions/statusMeta.js";
43
- import { addPendingTx } from "../swap/pendingSwapTx.js";
44
- import { StepConnectorArrow } from "../swap/StepConnector.js";
45
- import { WalletRow } from "../swap/WalletRow.js";
46
- import type { PayerInfo } from "../types.js";
47
- import { getProviderLabel } from "../utils.js";
48
- import { StepContainer } from "./FiatSteps.js";
49
-
50
- type OnRampScreenState = {
51
- steps: Array<{
52
- index: number;
53
- step: OnRampStep;
54
- status: FiatStatusMeta["progressStatus"];
55
- }>;
56
- handleContinue: () => void;
57
- isLoading: boolean;
58
- isDone: boolean;
59
- isFailed: boolean;
60
- };
61
-
62
- export function OnRampScreen(props: {
63
- title: string;
64
- quote: BuyWithFiatQuote;
65
- onBack: () => void;
66
- client: ThirdwebClient;
67
- testMode: boolean;
68
- theme: "light" | "dark";
69
- onDone: () => void;
70
- transactionMode: boolean;
71
- isEmbed: boolean;
72
- payer: PayerInfo;
73
- onSuccess: (status: BuyWithFiatStatus) => void;
74
- receiverAddress: string;
75
- paymentLinkId?: string;
76
- }) {
77
- const connectedWallets = useConnectedWallets();
78
- const isAutoMode = isInAppSigner({
79
- connectedWallets,
80
- wallet: props.payer.wallet,
81
- });
82
- const state = useOnRampScreenState({
83
- client: props.client,
84
- isAutoMode,
85
- onDone: props.onDone,
86
- onSuccess: props.onSuccess,
87
- payer: props.payer,
88
- paymentLinkId: props.paymentLinkId,
89
- quote: props.quote,
90
- theme: props.theme,
91
- });
92
- const firstStepChainId = state.steps[0]?.step.token.chainId;
93
- return (
94
- <Container p="lg">
95
- <ModalHeader onBack={props.onBack} title={props.title} />
96
- <Spacer y="xl" />
97
- <Container
98
- center="y"
99
- flex="column"
100
- gap="xs"
101
- style={{
102
- paddingLeft: spacing.md,
103
- }}
104
- >
105
- <WalletRow
106
- address={props.receiverAddress}
107
- client={props.client}
108
- iconSize="md"
109
- label="Recipient wallet"
110
- textSize="sm"
111
- />
112
- </Container>
113
- <Spacer y="md" />
114
- <Container flex="column">
115
- {state.steps.map(({ step, status }, index) => (
116
- <Container flex="column" key={step.action}>
117
- <StepContainer
118
- index={index}
119
- state={status}
120
- style={{
121
- flex: "1",
122
- }}
123
- >
124
- <StepUI
125
- client={props.client}
126
- index={index}
127
- payer={props.payer}
128
- step={step}
129
- />
130
- </StepContainer>
131
- {index < state.steps.length - 1 && <StepConnectorArrow />}
132
- </Container>
133
- ))}
134
- </Container>
135
-
136
- <Spacer y="md" />
137
-
138
- <Text
139
- center
140
- color="secondaryText"
141
- size="xs"
142
- style={{ padding: `0 ${spacing.xl}` }}
143
- >
144
- Keep this window open until all transactions are complete.
145
- </Text>
146
-
147
- <Spacer y="lg" />
148
-
149
- <Container flex="column" gap="md">
150
- {!state.isDone &&
151
- firstStepChainId &&
152
- firstStepChainId !== props.payer.chain.id ? (
153
- <SwitchNetworkButton
154
- fullWidth
155
- switchChain={async () => {
156
- await props.payer.wallet.switchChain(
157
- getCachedChain(firstStepChainId),
158
- );
159
- }}
160
- variant="accent"
161
- />
162
- ) : (
163
- <Button
164
- disabled={state.isLoading}
165
- fullWidth
166
- gap="sm"
167
- onClick={state.handleContinue}
168
- variant="accent"
169
- >
170
- {state.isLoading
171
- ? "Processing"
172
- : state.isDone
173
- ? props.transactionMode
174
- ? "Continue Transaction"
175
- : "Done"
176
- : state.isFailed
177
- ? "Retry"
178
- : "Continue"}
179
- {state.isLoading && <Spinner color="primaryText" size="sm" />}
180
- </Button>
181
- )}
182
- </Container>
183
- </Container>
184
- );
185
- }
186
-
187
- function StepUI(props: {
188
- step: OnRampStep;
189
- index: number;
190
- client: ThirdwebClient;
191
- payer: PayerInfo;
192
- }) {
193
- const { step, client } = props;
194
- const chain = useChainName(getCachedChain(step.token.chainId));
195
- return (
196
- <Container flex="column" gap="xs" py="3xs">
197
- <Container
198
- center="y"
199
- flex="row"
200
- gap="sm"
201
- style={{
202
- display: "flex",
203
- flexWrap: "nowrap",
204
- justifyContent: "space-between",
205
- }}
206
- >
207
- <PayTokenIcon
208
- chain={getCachedChain(step.token.chainId)}
209
- client={client}
210
- size="md"
211
- token={{
212
- address: step.token.tokenAddress,
213
- }}
214
- />
215
- <Container center="y" flex="column" gap="3xs" style={{ flex: "1" }}>
216
- <Text color="primaryText" size="sm">
217
- {getProviderLabel(step.action)}
218
- </Text>
219
-
220
- <Container
221
- center="y"
222
- flex="row"
223
- gap="xs"
224
- style={{
225
- display: "flex",
226
- flexWrap: "nowrap",
227
- justifyContent: "space-between",
228
- }}
229
- >
230
- <Container
231
- center="y"
232
- flex="row"
233
- gap="xxs"
234
- style={{
235
- flex: "1 1 60%",
236
- flexWrap: "nowrap",
237
- maxWidth: "60%",
238
- minWidth: 0,
239
- overflow: "hidden",
240
- }}
241
- >
242
- <Text color="primaryText" size="sm">
243
- {formatNumber(Number(step.amount), 5)}
244
- </Text>
245
- <TokenSymbol
246
- chain={getCachedChain(step.token.chainId)}
247
- color="secondaryText"
248
- size="sm"
249
- token={{
250
- address: step.token.tokenAddress,
251
- name: step.token.name || "",
252
- symbol: step.token.symbol || "",
253
- }}
254
- />
255
- </Container>
256
- <Container
257
- center="y"
258
- flex="row"
259
- gap="xs"
260
- style={{
261
- flex: "1 1 40%",
262
- flexWrap: "nowrap",
263
- justifyContent: "flex-end",
264
- maxWidth: "40%",
265
- minWidth: 0,
266
- }}
267
- >
268
- <Text
269
- size="xs"
270
- style={{
271
- overflow: "hidden",
272
- textOverflow: "ellipsis",
273
- whiteSpace: "nowrap",
274
- }}
275
- >
276
- {chain.name}
277
- </Text>
278
- </Container>
279
- </Container>
280
- </Container>
281
- </Container>
282
- </Container>
283
- );
284
- }
285
-
286
- function useOnRampScreenState(props: {
287
- quote: BuyWithFiatQuote;
288
- client: ThirdwebClient;
289
- onSuccess: (status: BuyWithFiatStatus) => void;
290
- onDone: () => void;
291
- payer: PayerInfo;
292
- theme: "light" | "dark";
293
- isAutoMode?: boolean;
294
- paymentLinkId?: string;
295
- }): OnRampScreenState {
296
- const onRampSteps = getOnRampSteps(props.quote);
297
- const [currentStepIndex, setCurrentStepIndex] = useState(0);
298
- const [swapTxHash, setSwapTxHash] = useState<{
299
- hash: string;
300
- chainId: number;
301
- }>();
302
- const [popupWindow, setPopupWindow] = useState<Window | null>(null);
303
-
304
- // Track onramp status
305
- const { uiStatus: fiatOnrampStatus } = useOnRampStatus({
306
- client: props.client,
307
- intentId: props.quote.intentId,
308
- onSuccess: (status) => {
309
- if (onRampSteps.length === 1) {
310
- // If only one step, this is the final success
311
- props.onSuccess(status);
312
- } else {
313
- // Move to next step (swap)
314
- setCurrentStepIndex((prev) => prev + 1);
315
- }
316
- },
317
- openedWindow: popupWindow,
318
- });
319
-
320
- // Get quote for current swap/bridge step if needed
321
- const previousStep = onRampSteps[currentStepIndex - 1];
322
- const currentStep = onRampSteps[currentStepIndex];
323
-
324
- // Handle swap execution
325
- const swapMutation = useSwapMutation({
326
- client: props.client,
327
- isFiatFlow: true,
328
- payer: props.payer,
329
- paymentLinkId: props.paymentLinkId,
330
- });
331
-
332
- // Track swap status
333
- const { uiStatus: swapStatus } = useSwapStatus({
334
- chainId: swapTxHash?.chainId,
335
- client: props.client,
336
- onSuccess: () => {
337
- if (currentStepIndex === onRampSteps.length - 1) {
338
- // Last step completed - call final success
339
- getBuyWithFiatStatus({
340
- client: props.client,
341
- intentId: props.quote.intentId,
342
- }).then(props.onSuccess);
343
- } else {
344
- // Reset swap state before moving to next step
345
- setSwapTxHash(undefined);
346
- swapMutation.reset();
347
- // Move to next step
348
- setCurrentStepIndex((prev) => prev + 1);
349
- }
350
- },
351
- transactionHash: swapTxHash?.hash,
352
- });
353
-
354
- // Map steps to their current status
355
- const steps = onRampSteps.map((step, index) => {
356
- let status: FiatStatusMeta["progressStatus"] = "unknown";
357
-
358
- if (index === 0) {
359
- // First step (onramp) status
360
- status = fiatOnrampStatus;
361
- } else if (index < currentStepIndex) {
362
- // Previous steps are completed
363
- status = "completed";
364
- } else if (index === currentStepIndex) {
365
- // Current step - could be swap or bridge
366
- if (swapMutation.isPending) {
367
- status = "pending";
368
- } else if (swapMutation.error) {
369
- status = "failed";
370
- } else if (swapTxHash) {
371
- status = swapStatus;
372
- } else {
373
- status = "actionRequired";
374
- }
375
- }
376
-
377
- return {
378
- index,
379
- status,
380
- step,
381
- };
382
- });
383
-
384
- const isLoading = steps.some((step) => step.status === "pending");
385
- const isDone = steps.every((step) => step.status === "completed");
386
- const isFailed = steps.some((step) => step.status === "failed");
387
-
388
- // Update handleContinue to handle done state
389
- const handleContinue = useCallback(async () => {
390
- if (isDone) {
391
- props.onDone();
392
- return;
393
- }
394
-
395
- if (currentStepIndex === 0) {
396
- // First step - open onramp popup
397
- const popup = openOnrampPopup(props.quote.onRampLink, props.theme);
398
- trackPayEvent({
399
- amountWei: props.quote.onRampToken.amountWei,
400
- client: props.client,
401
- event: "open_onramp_popup",
402
- toChainId: props.quote.onRampToken.token.chainId,
403
- toToken: props.quote.onRampToken.token.tokenAddress,
404
- walletAddress: props.payer.account.address,
405
- walletType: props.payer.wallet.id,
406
- });
407
- setPopupWindow(popup);
408
- addPendingTx({
409
- intentId: props.quote.intentId,
410
- type: "fiat",
411
- });
412
- } else if (previousStep && currentStep && !swapTxHash) {
413
- // Execute swap/bridge
414
- try {
415
- const result = await swapMutation.mutateAsync({
416
- amount: currentStep.amount,
417
- fromToken: previousStep.token,
418
- toToken: currentStep.token,
419
- });
420
- setSwapTxHash({
421
- chainId: result.chainId,
422
- hash: result.transactionHash,
423
- });
424
- } catch (e) {
425
- console.error("Failed to execute swap:", e);
426
- }
427
- } else if (isFailed) {
428
- // retry the quote step
429
- setSwapTxHash(undefined);
430
- swapMutation.reset();
431
- }
432
- }, [
433
- isDone,
434
- currentStepIndex,
435
- swapTxHash,
436
- props.quote,
437
- props.onDone,
438
- swapMutation,
439
- props.theme,
440
- isFailed,
441
- swapMutation.reset,
442
- props.client,
443
- props.payer.account.address,
444
- props.payer.wallet.id,
445
- currentStep,
446
- previousStep,
447
- ]);
448
-
449
- // Auto-progress effect
450
- useEffect(() => {
451
- if (!props.isAutoMode) {
452
- return;
453
- }
454
-
455
- // Auto-start next swap step when previous step completes
456
- if (
457
- !isLoading &&
458
- !isDone &&
459
- !isFailed &&
460
- currentStepIndex > 0 &&
461
- currentStepIndex < onRampSteps.length &&
462
- !swapTxHash
463
- ) {
464
- handleContinue();
465
- }
466
- }, [
467
- props.isAutoMode,
468
- currentStepIndex,
469
- swapTxHash,
470
- onRampSteps.length,
471
- handleContinue,
472
- isDone,
473
- isFailed,
474
- isLoading,
475
- ]);
476
-
477
- return {
478
- handleContinue,
479
- isDone,
480
- isFailed,
481
- isLoading,
482
- steps,
483
- };
484
- }
485
-
486
- function useOnRampStatus(props: {
487
- intentId: string;
488
- client: ThirdwebClient;
489
- onSuccess: (status: BuyWithFiatStatus) => void;
490
- openedWindow: Window | null;
491
- }) {
492
- const queryClient = useQueryClient();
493
- const statusQuery = useBuyWithFiatStatus({
494
- client: props.client,
495
- intentId: props.intentId,
496
- queryOptions: {
497
- enabled: !!props.openedWindow,
498
- },
499
- });
500
- let uiStatus: FiatStatusMeta["progressStatus"] = "actionRequired";
501
-
502
- switch (statusQuery.data?.status) {
503
- case "ON_RAMP_TRANSFER_COMPLETED":
504
- uiStatus = "completed";
505
- break;
506
- case "PAYMENT_FAILED":
507
- uiStatus = "failed";
508
- break;
509
- case "PENDING_PAYMENT":
510
- uiStatus = "pending";
511
- break;
512
- default:
513
- uiStatus = "actionRequired";
514
- break;
515
- }
516
-
517
- const purchaseCbCalled = useRef(false);
518
- useEffect(() => {
519
- if (purchaseCbCalled.current || !props.onSuccess) {
520
- return;
521
- }
522
-
523
- if (statusQuery.data && uiStatus === "completed") {
524
- purchaseCbCalled.current = true;
525
- props.onSuccess(statusQuery.data);
526
- }
527
- }, [props.onSuccess, statusQuery.data, uiStatus]);
528
-
529
- // close the onramp popup if onramp is completed
530
- useEffect(() => {
531
- if (!props.openedWindow) {
532
- return;
533
- }
534
-
535
- if (uiStatus === "completed") {
536
- try {
537
- if (props.openedWindow && !props.openedWindow.closed) {
538
- props.openedWindow.close();
539
- }
540
- } catch (e) {
541
- console.warn("Failed to close payment window:", e);
542
- }
543
- }
544
- }, [props.openedWindow, uiStatus]);
545
-
546
- // invalidate wallet balance when onramp is completed
547
- const invalidatedBalance = useRef(false);
548
- useEffect(() => {
549
- if (!invalidatedBalance.current && uiStatus === "completed") {
550
- invalidatedBalance.current = true;
551
- invalidateWalletBalance(queryClient);
552
- }
553
- }, [uiStatus, queryClient]);
554
-
555
- return { uiStatus };
556
- }
557
-
558
- function useSwapStatus(props: {
559
- client: ThirdwebClient;
560
- transactionHash?: string;
561
- chainId?: number;
562
- onSuccess: (status: BuyWithCryptoStatus) => void;
563
- }) {
564
- const swapStatus = useBuyWithCryptoStatus(
565
- props.transactionHash && props.chainId
566
- ? {
567
- chainId: props.chainId,
568
- client: props.client,
569
- transactionHash: props.transactionHash,
570
- }
571
- : undefined,
572
- );
573
-
574
- let uiStatus: FiatStatusMeta["progressStatus"] = "unknown";
575
-
576
- switch (swapStatus.data?.status) {
577
- case "COMPLETED":
578
- uiStatus = "completed";
579
- break;
580
- case "FAILED":
581
- uiStatus = "failed";
582
- break;
583
- case "PENDING":
584
- case "NOT_FOUND":
585
- uiStatus = "pending";
586
- break;
587
- case "NONE":
588
- uiStatus = "unknown";
589
- break;
590
- default:
591
- uiStatus = "unknown";
592
- break;
593
- }
594
-
595
- const purchaseCbCalled = useRef(false);
596
- useEffect(() => {
597
- if (purchaseCbCalled.current || !props.onSuccess) {
598
- return;
599
- }
600
-
601
- if (swapStatus.data?.status === "COMPLETED") {
602
- purchaseCbCalled.current = true;
603
- props.onSuccess(swapStatus.data);
604
- }
605
- }, [props.onSuccess, swapStatus]);
606
-
607
- const queryClient = useQueryClient();
608
- const balanceInvalidated = useRef(false);
609
- useEffect(() => {
610
- if (uiStatus === "completed" && !balanceInvalidated.current) {
611
- balanceInvalidated.current = true;
612
- invalidateWalletBalance(queryClient);
613
- }
614
- }, [queryClient, uiStatus]);
615
-
616
- return { uiStatus };
617
- }
618
-
619
- function useSwapMutation(props: {
620
- client: ThirdwebClient;
621
- payer: PayerInfo;
622
- isFiatFlow: boolean;
623
- paymentLinkId?: string;
624
- }) {
625
- const queryClient = useQueryClient();
626
- return useMutation({
627
- mutationFn: async (input: {
628
- fromToken: PayTokenInfo;
629
- toToken: PayTokenInfo;
630
- amount: string;
631
- }) => {
632
- const { fromToken, toToken, amount } = input;
633
- const wallet = props.payer.wallet;
634
-
635
- // in case the wallet is not on the same chain as the fromToken, switch to it
636
- if (wallet.getChain()?.id !== fromToken.chainId) {
637
- await wallet.switchChain(getCachedChain(fromToken.chainId));
638
- }
639
-
640
- const account = wallet.getAccount();
641
-
642
- if (!account) {
643
- throw new Error("Payer wallet has no account");
644
- }
645
-
646
- // always get a fresh quote before executing
647
- const quote = await getBuyWithCryptoQuote({
648
- client: props.client,
649
- fromAddress: account.address,
650
- fromChainId: fromToken.chainId,
651
- fromTokenAddress: fromToken.tokenAddress,
652
- paymentLinkId: props.paymentLinkId,
653
- toAddress: account.address,
654
- toAmount: amount,
655
- toChainId: toToken.chainId,
656
- toTokenAddress: toToken.tokenAddress,
657
- });
658
-
659
- const canBatch = account.sendBatchTransaction;
660
- const tokenContract = getContract({
661
- address: quote.swapDetails.fromToken.tokenAddress,
662
- chain: getCachedChain(quote.swapDetails.fromToken.chainId),
663
- client: props.client,
664
- });
665
- const approveTxRequired =
666
- quote.approvalData &&
667
- (await allowance({
668
- contract: tokenContract,
669
- owner: account.address,
670
- spender: quote.approvalData.spenderAddress,
671
- })) < BigInt(quote.approvalData.amountWei);
672
- if (approveTxRequired && quote.approvalData && !canBatch) {
673
- trackPayEvent({
674
- amountWei: quote.swapDetails.fromAmountWei,
675
- chainId: quote.swapDetails.fromToken.chainId,
676
- client: props.client,
677
- event: "prompt_swap_approval",
678
- fromToken: quote.swapDetails.fromToken.tokenAddress,
679
- toChainId: quote.swapDetails.toToken.chainId,
680
- toToken: quote.swapDetails.toToken.tokenAddress,
681
- walletAddress: account.address,
682
- walletType: props.payer.wallet.id,
683
- });
684
-
685
- const transaction = approve({
686
- amountWei: BigInt(quote.approvalData.amountWei),
687
- contract: tokenContract,
688
- spender: quote.approvalData.spenderAddress,
689
- });
690
-
691
- const tx = await sendTransaction({
692
- account,
693
- transaction,
694
- });
695
-
696
- await waitForReceipt({ ...tx, maxBlocksWaitTime: 50 });
697
-
698
- trackPayEvent({
699
- amountWei: quote.swapDetails.fromAmountWei,
700
- chainId: quote.swapDetails.fromToken.chainId,
701
- client: props.client,
702
- event: "swap_approval_success",
703
- fromToken: quote.swapDetails.fromToken.tokenAddress,
704
- toChainId: quote.swapDetails.toToken.chainId,
705
- toToken: quote.swapDetails.toToken.tokenAddress,
706
- walletAddress: account.address,
707
- walletType: props.payer.wallet.id,
708
- });
709
- }
710
-
711
- trackPayEvent({
712
- amountWei: quote.swapDetails.fromAmountWei,
713
- chainId: quote.swapDetails.fromToken.chainId,
714
- client: props.client,
715
- event: "prompt_swap_execution",
716
- fromToken: quote.swapDetails.fromToken.tokenAddress,
717
- toChainId: quote.swapDetails.toToken.chainId,
718
- toToken: quote.swapDetails.toToken.tokenAddress,
719
- walletAddress: account.address,
720
- walletType: props.payer.wallet.id,
721
- });
722
- const tx = quote.transactionRequest;
723
- let _swapTx: WaitForReceiptOptions;
724
- // check if we can batch approval and swap
725
- if (canBatch && quote.approvalData && approveTxRequired) {
726
- const approveTx = approve({
727
- amountWei: BigInt(quote.approvalData.amountWei),
728
- contract: tokenContract,
729
- spender: quote.approvalData.spenderAddress,
730
- });
731
-
732
- _swapTx = await sendBatchTransaction({
733
- account,
734
- transactions: [approveTx, tx],
735
- });
736
- } else {
737
- _swapTx = await sendTransaction({
738
- account,
739
- transaction: tx,
740
- });
741
- }
742
-
743
- await waitForReceipt({ ..._swapTx, maxBlocksWaitTime: 50 });
744
-
745
- trackPayEvent({
746
- amountWei: quote.swapDetails.fromAmountWei,
747
- chainId: quote.swapDetails.fromToken.chainId,
748
- client: props.client,
749
- event: "swap_execution_success",
750
- fromToken: quote.swapDetails.fromToken.tokenAddress,
751
- toChainId: quote.swapDetails.toToken.chainId,
752
- toToken: quote.swapDetails.toToken.tokenAddress,
753
- walletAddress: account.address,
754
- walletType: props.payer.wallet.id,
755
- });
756
-
757
- // do not add pending tx if the swap is part of fiat flow
758
- if (!props.isFiatFlow) {
759
- addPendingTx({
760
- chainId: _swapTx.chain.id,
761
- txHash: _swapTx.transactionHash,
762
- type: "swap",
763
- });
764
- }
765
-
766
- return {
767
- chainId: _swapTx.chain.id,
768
- transactionHash: _swapTx.transactionHash,
769
- };
770
- },
771
- onSuccess: () => {
772
- invalidateWalletBalance(queryClient);
773
- },
774
- });
775
- }