thirdweb 5.102.7-nightly-3f747601135809eedf86a150752f4b5f12c99776-20250617000426 → 5.103.1-nightly-bb09e20bcb1662c088bf8b61486df7d0d92da8d0-20250618000421

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 (550) hide show
  1. package/dist/cjs/bridge/Routes.js +4 -1
  2. package/dist/cjs/bridge/Routes.js.map +1 -1
  3. package/dist/cjs/bridge/Token.js +57 -0
  4. package/dist/cjs/bridge/Token.js.map +1 -1
  5. package/dist/cjs/bridge/types/Errors.js +9 -0
  6. package/dist/cjs/bridge/types/Errors.js.map +1 -1
  7. package/dist/cjs/cli/bin.js +2 -2
  8. package/dist/cjs/cli/bin.js.map +1 -1
  9. package/dist/cjs/exports/react.js +9 -1
  10. package/dist/cjs/exports/react.js.map +1 -1
  11. package/dist/cjs/pay/buyWithFiat/getQuote.js +2 -2
  12. package/dist/cjs/pay/convert/cryptoToFiat.js +3 -3
  13. package/dist/cjs/pay/convert/cryptoToFiat.js.map +1 -1
  14. package/dist/cjs/pay/convert/fiatToCrypto.js +3 -3
  15. package/dist/cjs/pay/convert/fiatToCrypto.js.map +1 -1
  16. package/dist/cjs/pay/convert/get-token.js +15 -3
  17. package/dist/cjs/pay/convert/get-token.js.map +1 -1
  18. package/dist/cjs/pay/utils/commonTypes.js +1 -1
  19. package/dist/cjs/react/core/adapters/WindowAdapter.js +3 -0
  20. package/dist/cjs/react/core/adapters/WindowAdapter.js.map +1 -0
  21. package/dist/cjs/react/core/errors/mapBridgeError.js +27 -0
  22. package/dist/cjs/react/core/errors/mapBridgeError.js.map +1 -0
  23. package/dist/cjs/react/core/hooks/others/useChainQuery.js +1 -1
  24. package/dist/cjs/react/core/hooks/others/useChainQuery.js.map +1 -1
  25. package/dist/cjs/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js +40 -0
  26. package/dist/cjs/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js.map +1 -0
  27. package/dist/cjs/react/core/hooks/useBridgeError.js +94 -0
  28. package/dist/cjs/react/core/hooks/useBridgeError.js.map +1 -0
  29. package/dist/cjs/react/core/hooks/useBridgePrepare.js +90 -0
  30. package/dist/cjs/react/core/hooks/useBridgePrepare.js.map +1 -0
  31. package/dist/cjs/react/core/hooks/useBridgeQuote.js +50 -0
  32. package/dist/cjs/react/core/hooks/useBridgeQuote.js.map +1 -0
  33. package/dist/cjs/react/core/hooks/useBridgeRoutes.js +61 -0
  34. package/dist/cjs/react/core/hooks/useBridgeRoutes.js.map +1 -0
  35. package/dist/cjs/react/core/hooks/usePaymentMethods.js +154 -0
  36. package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -0
  37. package/dist/cjs/react/core/hooks/useStepExecutor.js +408 -0
  38. package/dist/cjs/react/core/hooks/useStepExecutor.js.map +1 -0
  39. package/dist/cjs/react/core/hooks/useTransactionDetails.js +126 -0
  40. package/dist/cjs/react/core/hooks/useTransactionDetails.js.map +1 -0
  41. package/dist/cjs/react/core/hooks/wallets/useSendToken.js +17 -2
  42. package/dist/cjs/react/core/hooks/wallets/useSendToken.js.map +1 -1
  43. package/dist/cjs/react/core/machines/paymentMachine.js +189 -0
  44. package/dist/cjs/react/core/machines/paymentMachine.js.map +1 -0
  45. package/dist/cjs/react/web/adapters/WindowAdapter.js +25 -0
  46. package/dist/cjs/react/web/adapters/WindowAdapter.js.map +1 -0
  47. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +5 -0
  48. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  49. package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +107 -0
  50. package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -0
  51. package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +177 -0
  52. package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -0
  53. package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +143 -0
  54. package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -0
  55. package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +62 -0
  56. package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -0
  57. package/dist/cjs/react/web/ui/Bridge/ErrorBanner.js +26 -0
  58. package/dist/cjs/react/web/ui/Bridge/ErrorBanner.js.map +1 -0
  59. package/dist/cjs/react/web/ui/Bridge/FundWallet.js +122 -0
  60. package/dist/cjs/react/web/ui/Bridge/FundWallet.js.map +1 -0
  61. package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js +99 -0
  62. package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js.map +1 -0
  63. package/dist/cjs/react/web/ui/Bridge/StepRunner.js +179 -0
  64. package/dist/cjs/react/web/ui/Bridge/StepRunner.js.map +1 -0
  65. package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +117 -0
  66. package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js.map +1 -0
  67. package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +162 -0
  68. package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -0
  69. package/dist/cjs/react/web/ui/Bridge/UnsupportedTokenScreen.js +23 -0
  70. package/dist/cjs/react/web/ui/Bridge/UnsupportedTokenScreen.js.map +1 -0
  71. package/dist/cjs/react/web/ui/Bridge/common/TokenAndChain.js +101 -0
  72. package/dist/cjs/react/web/ui/Bridge/common/TokenAndChain.js.map +1 -0
  73. package/dist/cjs/react/web/ui/Bridge/common/TokenBalanceRow.js +57 -0
  74. package/dist/cjs/react/web/ui/Bridge/common/TokenBalanceRow.js.map +1 -0
  75. package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js +27 -0
  76. package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js.map +1 -0
  77. package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js +121 -0
  78. package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -0
  79. package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js +80 -0
  80. package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -0
  81. package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +83 -0
  82. package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -0
  83. package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +111 -0
  84. package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -0
  85. package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js +71 -0
  86. package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -0
  87. package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +54 -0
  88. package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -0
  89. package/dist/cjs/react/web/ui/Bridge/payment-success/PaymentReceipt.js +140 -0
  90. package/dist/cjs/react/web/ui/Bridge/payment-success/PaymentReceipt.js.map +1 -0
  91. package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +61 -0
  92. package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -0
  93. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
  94. package/dist/cjs/react/web/ui/ConnectWallet/constants.js +1 -1
  95. package/dist/cjs/react/web/ui/ConnectWallet/icons/CreditCardIcon.js +12 -0
  96. package/dist/cjs/react/web/ui/ConnectWallet/icons/CreditCardIcon.js.map +1 -0
  97. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  98. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +3 -1
  99. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -1
  100. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +4 -0
  101. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
  102. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
  103. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js +4 -1
  104. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js.map +1 -1
  105. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js +1 -1
  106. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js.map +1 -1
  107. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
  108. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
  109. package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js +11 -0
  110. package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
  111. package/dist/cjs/react/web/ui/PayEmbed.js +2 -1
  112. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  113. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +6 -5
  114. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
  115. package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +43 -4
  116. package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
  117. package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +8 -4
  118. package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
  119. package/dist/cjs/react/web/ui/components/ChainName.js +2 -1
  120. package/dist/cjs/react/web/ui/components/ChainName.js.map +1 -1
  121. package/dist/cjs/react/web/ui/components/TokenIcon.js +6 -3
  122. package/dist/cjs/react/web/ui/components/TokenIcon.js.map +1 -1
  123. package/dist/cjs/react/web/ui/components/buttons.js +1 -5
  124. package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
  125. package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js +228 -0
  126. package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js.map +1 -0
  127. package/dist/cjs/stories/Bridge/DirectPayment.stories.js +194 -0
  128. package/dist/cjs/stories/Bridge/DirectPayment.stories.js.map +1 -0
  129. package/dist/cjs/stories/Bridge/ErrorBanner.stories.js +153 -0
  130. package/dist/cjs/stories/Bridge/ErrorBanner.stories.js.map +1 -0
  131. package/dist/cjs/stories/Bridge/FundWallet.stories.js +173 -0
  132. package/dist/cjs/stories/Bridge/FundWallet.stories.js.map +1 -0
  133. package/dist/cjs/stories/Bridge/PaymentDetails.stories.js +430 -0
  134. package/dist/cjs/stories/Bridge/PaymentDetails.stories.js.map +1 -0
  135. package/dist/cjs/stories/Bridge/PaymentSelection.stories.js +151 -0
  136. package/dist/cjs/stories/Bridge/PaymentSelection.stories.js.map +1 -0
  137. package/dist/cjs/stories/Bridge/StepRunner.stories.js +82 -0
  138. package/dist/cjs/stories/Bridge/StepRunner.stories.js.map +1 -0
  139. package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +180 -0
  140. package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -0
  141. package/dist/cjs/stories/Bridge/TransactionPayment.stories.js +139 -0
  142. package/dist/cjs/stories/Bridge/TransactionPayment.stories.js.map +1 -0
  143. package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js +94 -0
  144. package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -0
  145. package/dist/cjs/stories/Bridge/fixtures.js +731 -0
  146. package/dist/cjs/stories/Bridge/fixtures.js.map +1 -0
  147. package/dist/cjs/stories/TokenBalanceRow.stories.js +81 -0
  148. package/dist/cjs/stories/TokenBalanceRow.stories.js.map +1 -0
  149. package/dist/cjs/stories/WalletRow.stories.js +120 -0
  150. package/dist/cjs/stories/WalletRow.stories.js.map +1 -0
  151. package/dist/cjs/stories/utils.js +19 -1
  152. package/dist/cjs/stories/utils.js.map +1 -1
  153. package/dist/cjs/version.js +1 -1
  154. package/dist/esm/bridge/Routes.js +4 -1
  155. package/dist/esm/bridge/Routes.js.map +1 -1
  156. package/dist/esm/bridge/Token.js +56 -0
  157. package/dist/esm/bridge/Token.js.map +1 -1
  158. package/dist/esm/bridge/types/Errors.js +9 -0
  159. package/dist/esm/bridge/types/Errors.js.map +1 -1
  160. package/dist/esm/cli/bin.js +2 -2
  161. package/dist/esm/cli/bin.js.map +1 -1
  162. package/dist/esm/exports/react.js +4 -0
  163. package/dist/esm/exports/react.js.map +1 -1
  164. package/dist/esm/pay/buyWithFiat/getQuote.js +2 -2
  165. package/dist/esm/pay/convert/cryptoToFiat.js +4 -4
  166. package/dist/esm/pay/convert/cryptoToFiat.js.map +1 -1
  167. package/dist/esm/pay/convert/fiatToCrypto.js +4 -4
  168. package/dist/esm/pay/convert/fiatToCrypto.js.map +1 -1
  169. package/dist/esm/pay/convert/get-token.js +15 -3
  170. package/dist/esm/pay/convert/get-token.js.map +1 -1
  171. package/dist/esm/pay/utils/commonTypes.js +1 -1
  172. package/dist/esm/react/core/adapters/WindowAdapter.js +2 -0
  173. package/dist/esm/react/core/adapters/WindowAdapter.js.map +1 -0
  174. package/dist/esm/react/core/errors/mapBridgeError.js +23 -0
  175. package/dist/esm/react/core/errors/mapBridgeError.js.map +1 -0
  176. package/dist/esm/react/core/hooks/others/useChainQuery.js +1 -1
  177. package/dist/esm/react/core/hooks/others/useChainQuery.js.map +1 -1
  178. package/dist/esm/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js +37 -0
  179. package/dist/esm/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js.map +1 -0
  180. package/dist/esm/react/core/hooks/useBridgeError.js +91 -0
  181. package/dist/esm/react/core/hooks/useBridgeError.js.map +1 -0
  182. package/dist/esm/react/core/hooks/useBridgePrepare.js +87 -0
  183. package/dist/esm/react/core/hooks/useBridgePrepare.js.map +1 -0
  184. package/dist/esm/react/core/hooks/useBridgeQuote.js +47 -0
  185. package/dist/esm/react/core/hooks/useBridgeQuote.js.map +1 -0
  186. package/dist/esm/react/core/hooks/useBridgeRoutes.js +58 -0
  187. package/dist/esm/react/core/hooks/useBridgeRoutes.js.map +1 -0
  188. package/dist/esm/react/core/hooks/usePaymentMethods.js +151 -0
  189. package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -0
  190. package/dist/esm/react/core/hooks/useStepExecutor.js +405 -0
  191. package/dist/esm/react/core/hooks/useStepExecutor.js.map +1 -0
  192. package/dist/esm/react/core/hooks/useTransactionDetails.js +123 -0
  193. package/dist/esm/react/core/hooks/useTransactionDetails.js.map +1 -0
  194. package/dist/esm/react/core/hooks/wallets/useSendToken.js +17 -2
  195. package/dist/esm/react/core/hooks/wallets/useSendToken.js.map +1 -1
  196. package/dist/esm/react/core/machines/paymentMachine.js +186 -0
  197. package/dist/esm/react/core/machines/paymentMachine.js.map +1 -0
  198. package/dist/esm/react/web/adapters/WindowAdapter.js +21 -0
  199. package/dist/esm/react/web/adapters/WindowAdapter.js.map +1 -0
  200. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +5 -0
  201. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  202. package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +104 -0
  203. package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -0
  204. package/dist/esm/react/web/ui/Bridge/BuyWidget.js +174 -0
  205. package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -0
  206. package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +140 -0
  207. package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -0
  208. package/dist/esm/react/web/ui/Bridge/DirectPayment.js +59 -0
  209. package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -0
  210. package/dist/esm/react/web/ui/Bridge/ErrorBanner.js +23 -0
  211. package/dist/esm/react/web/ui/Bridge/ErrorBanner.js.map +1 -0
  212. package/dist/esm/react/web/ui/Bridge/FundWallet.js +119 -0
  213. package/dist/esm/react/web/ui/Bridge/FundWallet.js.map +1 -0
  214. package/dist/esm/react/web/ui/Bridge/QuoteLoader.js +96 -0
  215. package/dist/esm/react/web/ui/Bridge/QuoteLoader.js.map +1 -0
  216. package/dist/esm/react/web/ui/Bridge/StepRunner.js +176 -0
  217. package/dist/esm/react/web/ui/Bridge/StepRunner.js.map +1 -0
  218. package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +114 -0
  219. package/dist/esm/react/web/ui/Bridge/TransactionPayment.js.map +1 -0
  220. package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +159 -0
  221. package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -0
  222. package/dist/esm/react/web/ui/Bridge/UnsupportedTokenScreen.js +20 -0
  223. package/dist/esm/react/web/ui/Bridge/UnsupportedTokenScreen.js.map +1 -0
  224. package/dist/esm/react/web/ui/Bridge/common/TokenAndChain.js +96 -0
  225. package/dist/esm/react/web/ui/Bridge/common/TokenAndChain.js.map +1 -0
  226. package/dist/esm/react/web/ui/Bridge/common/TokenBalanceRow.js +54 -0
  227. package/dist/esm/react/web/ui/Bridge/common/TokenBalanceRow.js.map +1 -0
  228. package/dist/esm/react/web/ui/Bridge/common/WithHeader.js +24 -0
  229. package/dist/esm/react/web/ui/Bridge/common/WithHeader.js.map +1 -0
  230. package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js +119 -0
  231. package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -0
  232. package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js +77 -0
  233. package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -0
  234. package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +80 -0
  235. package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -0
  236. package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +108 -0
  237. package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -0
  238. package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js +68 -0
  239. package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -0
  240. package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +51 -0
  241. package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -0
  242. package/dist/esm/react/web/ui/Bridge/payment-success/PaymentReceipt.js +137 -0
  243. package/dist/esm/react/web/ui/Bridge/payment-success/PaymentReceipt.js.map +1 -0
  244. package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +58 -0
  245. package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -0
  246. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
  247. package/dist/esm/react/web/ui/ConnectWallet/constants.js +1 -1
  248. package/dist/esm/react/web/ui/ConnectWallet/icons/CreditCardIcon.js +8 -0
  249. package/dist/esm/react/web/ui/ConnectWallet/icons/CreditCardIcon.js.map +1 -0
  250. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  251. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +3 -1
  252. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -1
  253. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +3 -0
  254. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
  255. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
  256. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js +4 -1
  257. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js.map +1 -1
  258. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js +1 -1
  259. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js.map +1 -1
  260. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
  261. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
  262. package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js +9 -0
  263. package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
  264. package/dist/esm/react/web/ui/PayEmbed.js +2 -1
  265. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  266. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +6 -5
  267. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
  268. package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +45 -6
  269. package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
  270. package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +8 -4
  271. package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
  272. package/dist/esm/react/web/ui/components/ChainName.js +2 -2
  273. package/dist/esm/react/web/ui/components/ChainName.js.map +1 -1
  274. package/dist/esm/react/web/ui/components/TokenIcon.js +7 -4
  275. package/dist/esm/react/web/ui/components/TokenIcon.js.map +1 -1
  276. package/dist/esm/react/web/ui/components/buttons.js +1 -5
  277. package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
  278. package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js +226 -0
  279. package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js.map +1 -0
  280. package/dist/esm/stories/Bridge/DirectPayment.stories.js +191 -0
  281. package/dist/esm/stories/Bridge/DirectPayment.stories.js.map +1 -0
  282. package/dist/esm/stories/Bridge/ErrorBanner.stories.js +150 -0
  283. package/dist/esm/stories/Bridge/ErrorBanner.stories.js.map +1 -0
  284. package/dist/esm/stories/Bridge/FundWallet.stories.js +170 -0
  285. package/dist/esm/stories/Bridge/FundWallet.stories.js.map +1 -0
  286. package/dist/esm/stories/Bridge/PaymentDetails.stories.js +427 -0
  287. package/dist/esm/stories/Bridge/PaymentDetails.stories.js.map +1 -0
  288. package/dist/esm/stories/Bridge/PaymentSelection.stories.js +148 -0
  289. package/dist/esm/stories/Bridge/PaymentSelection.stories.js.map +1 -0
  290. package/dist/esm/stories/Bridge/StepRunner.stories.js +79 -0
  291. package/dist/esm/stories/Bridge/StepRunner.stories.js.map +1 -0
  292. package/dist/esm/stories/Bridge/SuccessScreen.stories.js +177 -0
  293. package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -0
  294. package/dist/esm/stories/Bridge/TransactionPayment.stories.js +136 -0
  295. package/dist/esm/stories/Bridge/TransactionPayment.stories.js.map +1 -0
  296. package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js +91 -0
  297. package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -0
  298. package/dist/esm/stories/Bridge/fixtures.js +728 -0
  299. package/dist/esm/stories/Bridge/fixtures.js.map +1 -0
  300. package/dist/esm/stories/TokenBalanceRow.stories.js +78 -0
  301. package/dist/esm/stories/TokenBalanceRow.stories.js.map +1 -0
  302. package/dist/esm/stories/WalletRow.stories.js +117 -0
  303. package/dist/esm/stories/WalletRow.stories.js.map +1 -0
  304. package/dist/esm/stories/utils.js +17 -0
  305. package/dist/esm/stories/utils.js.map +1 -1
  306. package/dist/esm/version.js +1 -1
  307. package/dist/types/bridge/Routes.d.ts +1 -0
  308. package/dist/types/bridge/Routes.d.ts.map +1 -1
  309. package/dist/types/bridge/Token.d.ts +48 -1
  310. package/dist/types/bridge/Token.d.ts.map +1 -1
  311. package/dist/types/bridge/types/BridgeAction.d.ts +1 -1
  312. package/dist/types/bridge/types/BridgeAction.d.ts.map +1 -1
  313. package/dist/types/bridge/types/Errors.d.ts +1 -0
  314. package/dist/types/bridge/types/Errors.d.ts.map +1 -1
  315. package/dist/types/exports/react.d.ts +4 -0
  316. package/dist/types/exports/react.d.ts.map +1 -1
  317. package/dist/types/pay/convert/get-token.d.ts +2 -1
  318. package/dist/types/pay/convert/get-token.d.ts.map +1 -1
  319. package/dist/types/pay/utils/commonTypes.d.ts +1 -1
  320. package/dist/types/react/core/adapters/WindowAdapter.d.ts +14 -0
  321. package/dist/types/react/core/adapters/WindowAdapter.d.ts.map +1 -0
  322. package/dist/types/react/core/errors/mapBridgeError.d.ts +17 -0
  323. package/dist/types/react/core/errors/mapBridgeError.d.ts.map +1 -0
  324. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +14 -6
  325. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
  326. package/dist/types/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.d.ts +54 -0
  327. package/dist/types/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.d.ts.map +1 -0
  328. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -1
  329. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  330. package/dist/types/react/core/hooks/useBridgeError.d.ts +72 -0
  331. package/dist/types/react/core/hooks/useBridgeError.d.ts.map +1 -0
  332. package/dist/types/react/core/hooks/useBridgePrepare.d.ts +75 -0
  333. package/dist/types/react/core/hooks/useBridgePrepare.d.ts.map +1 -0
  334. package/dist/types/react/core/hooks/useBridgeQuote.d.ts +14 -0
  335. package/dist/types/react/core/hooks/useBridgeQuote.d.ts.map +1 -0
  336. package/dist/types/react/core/hooks/useBridgeRoutes.d.ts +30 -0
  337. package/dist/types/react/core/hooks/useBridgeRoutes.d.ts.map +1 -0
  338. package/dist/types/react/core/hooks/usePaymentMethods.d.ts +36 -0
  339. package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -0
  340. package/dist/types/react/core/hooks/useStepExecutor.d.ts +67 -0
  341. package/dist/types/react/core/hooks/useStepExecutor.d.ts.map +1 -0
  342. package/dist/types/react/core/hooks/useTransactionDetails.d.ts +31 -0
  343. package/dist/types/react/core/hooks/useTransactionDetails.d.ts.map +1 -0
  344. package/dist/types/react/core/hooks/wallets/useSendToken.d.ts.map +1 -1
  345. package/dist/types/react/core/machines/paymentMachine.d.ts +86 -0
  346. package/dist/types/react/core/machines/paymentMachine.d.ts.map +1 -0
  347. package/dist/types/react/web/adapters/WindowAdapter.d.ts +19 -0
  348. package/dist/types/react/web/adapters/WindowAdapter.d.ts.map +1 -0
  349. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +5 -0
  350. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  351. package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts +78 -0
  352. package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +1 -0
  353. package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +325 -0
  354. package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -0
  355. package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +317 -0
  356. package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -0
  357. package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +27 -0
  358. package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -0
  359. package/dist/types/react/web/ui/Bridge/ErrorBanner.d.ts +17 -0
  360. package/dist/types/react/web/ui/Bridge/ErrorBanner.d.ts.map +1 -0
  361. package/dist/types/react/web/ui/Bridge/FundWallet.d.ts +35 -0
  362. package/dist/types/react/web/ui/Bridge/FundWallet.d.ts.map +1 -0
  363. package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts +57 -0
  364. package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts.map +1 -0
  365. package/dist/types/react/web/ui/Bridge/StepRunner.d.ts +39 -0
  366. package/dist/types/react/web/ui/Bridge/StepRunner.d.ts.map +1 -0
  367. package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts +27 -0
  368. package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts.map +1 -0
  369. package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +338 -0
  370. package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -0
  371. package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts +13 -0
  372. package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts.map +1 -0
  373. package/dist/types/react/web/ui/Bridge/common/TokenAndChain.d.ts +16 -0
  374. package/dist/types/react/web/ui/Bridge/common/TokenAndChain.d.ts.map +1 -0
  375. package/dist/types/react/web/ui/Bridge/common/TokenBalanceRow.d.ts +10 -0
  376. package/dist/types/react/web/ui/Bridge/common/TokenBalanceRow.d.ts.map +1 -0
  377. package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts +9 -0
  378. package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts.map +1 -0
  379. package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts +36 -0
  380. package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts.map +1 -0
  381. package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts +15 -0
  382. package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts.map +1 -0
  383. package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts +12 -0
  384. package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts.map +1 -0
  385. package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +50 -0
  386. package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -0
  387. package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +15 -0
  388. package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -0
  389. package/dist/types/react/web/ui/Bridge/payment-selection/WalletFiatSelection.d.ts +12 -0
  390. package/dist/types/react/web/ui/Bridge/payment-selection/WalletFiatSelection.d.ts.map +1 -0
  391. package/dist/types/react/web/ui/Bridge/payment-success/PaymentReceipt.d.ts +24 -0
  392. package/dist/types/react/web/ui/Bridge/payment-success/PaymentReceipt.d.ts.map +1 -0
  393. package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +28 -0
  394. package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -0
  395. package/dist/types/react/web/ui/ConnectWallet/constants.d.ts +1 -1
  396. package/dist/types/react/web/ui/ConnectWallet/icons/CreditCardIcon.d.ts +6 -0
  397. package/dist/types/react/web/ui/ConnectWallet/icons/CreditCardIcon.d.ts.map +1 -0
  398. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  399. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +1 -1
  400. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts +4 -0
  401. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts.map +1 -1
  402. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +4 -1
  403. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
  404. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.d.ts.map +1 -1
  405. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.d.ts.map +1 -1
  406. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
  407. package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts +2 -0
  408. package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts.map +1 -1
  409. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  410. package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
  411. package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts +2 -0
  412. package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
  413. package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
  414. package/dist/types/react/web/ui/components/ChainName.d.ts +3 -0
  415. package/dist/types/react/web/ui/components/ChainName.d.ts.map +1 -1
  416. package/dist/types/react/web/ui/components/TokenIcon.d.ts.map +1 -1
  417. package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
  418. package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts +90 -0
  419. package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts.map +1 -0
  420. package/dist/types/stories/Bridge/DirectPayment.stories.d.ts +65 -0
  421. package/dist/types/stories/Bridge/DirectPayment.stories.d.ts.map +1 -0
  422. package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts +55 -0
  423. package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts.map +1 -0
  424. package/dist/types/stories/Bridge/FundWallet.stories.d.ts +63 -0
  425. package/dist/types/stories/Bridge/FundWallet.stories.d.ts.map +1 -0
  426. package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts +70 -0
  427. package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts.map +1 -0
  428. package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts +65 -0
  429. package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts.map +1 -0
  430. package/dist/types/stories/Bridge/StepRunner.stories.d.ts +61 -0
  431. package/dist/types/stories/Bridge/StepRunner.stories.d.ts.map +1 -0
  432. package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +58 -0
  433. package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -0
  434. package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts +55 -0
  435. package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts.map +1 -0
  436. package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts +39 -0
  437. package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts.map +1 -0
  438. package/dist/types/stories/Bridge/fixtures.d.ts +37 -0
  439. package/dist/types/stories/Bridge/fixtures.d.ts.map +1 -0
  440. package/dist/types/stories/TokenBalanceRow.stories.d.ts +53 -0
  441. package/dist/types/stories/TokenBalanceRow.stories.d.ts.map +1 -0
  442. package/dist/types/stories/WalletRow.stories.d.ts +63 -0
  443. package/dist/types/stories/WalletRow.stories.d.ts.map +1 -0
  444. package/dist/types/stories/utils.d.ts +5 -0
  445. package/dist/types/stories/utils.d.ts.map +1 -1
  446. package/dist/types/version.d.ts +1 -1
  447. package/dist/types/wallets/utils/getWalletBalance.d.ts +1 -1
  448. package/dist/types/wallets/utils/getWalletBalance.d.ts.map +1 -1
  449. package/package.json +2 -1
  450. package/src/bridge/Routes.ts +5 -0
  451. package/src/bridge/Status.test.ts +1 -1
  452. package/src/bridge/Token.ts +82 -1
  453. package/src/bridge/types/BridgeAction.ts +1 -1
  454. package/src/bridge/types/Errors.ts +11 -0
  455. package/src/cli/bin.ts +2 -2
  456. package/src/exports/react.ts +16 -0
  457. package/src/pay/buyWithFiat/getQuote.ts +2 -2
  458. package/src/pay/convert/cryptoToFiat.ts +4 -4
  459. package/src/pay/convert/fiatToCrypto.ts +4 -4
  460. package/src/pay/convert/get-token.ts +17 -4
  461. package/src/pay/utils/commonTypes.ts +1 -1
  462. package/src/react/components.md +134 -0
  463. package/src/react/core/adapters/.keep +2 -0
  464. package/src/react/core/adapters/WindowAdapter.ts +13 -0
  465. package/src/react/core/errors/.keep +2 -0
  466. package/src/react/core/errors/mapBridgeError.test.ts +98 -0
  467. package/src/react/core/errors/mapBridgeError.ts +25 -0
  468. package/src/react/core/hooks/connection/ConnectButtonProps.ts +42 -37
  469. package/src/react/core/hooks/others/useChainQuery.ts +1 -1
  470. package/src/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.ts +100 -0
  471. package/src/react/core/hooks/transaction/useSendTransaction.ts +1 -1
  472. package/src/react/core/hooks/useBridgeError.ts +149 -0
  473. package/src/react/core/hooks/useBridgePrepare.test.ts +161 -0
  474. package/src/react/core/hooks/useBridgePrepare.ts +133 -0
  475. package/src/react/core/hooks/useBridgeQuote.ts +67 -0
  476. package/src/react/core/hooks/useBridgeRoutes.test.ts +137 -0
  477. package/src/react/core/hooks/useBridgeRoutes.ts +75 -0
  478. package/src/react/core/hooks/usePaymentMethods.ts +203 -0
  479. package/src/react/core/hooks/useStepExecutor.ts +606 -0
  480. package/src/react/core/hooks/useTransactionDetails.ts +177 -0
  481. package/src/react/core/hooks/wallets/useAutoConnectCore.test.tsx +1 -57
  482. package/src/react/core/hooks/wallets/useSendToken.ts +17 -3
  483. package/src/react/core/machines/.keep +2 -0
  484. package/src/react/core/machines/paymentMachine.test.ts +519 -0
  485. package/src/react/core/machines/paymentMachine.ts +290 -0
  486. package/src/react/core/types/.keep +2 -0
  487. package/src/react/core/utils/wallet.test.ts +77 -0
  488. package/src/react/native/flows/.keep +2 -0
  489. package/src/react/web/adapters/WindowAdapter.ts +23 -0
  490. package/src/react/web/adapters/adapters.test.ts +30 -0
  491. package/src/react/web/flows/.keep +2 -0
  492. package/src/react/web/hooks/transaction/useSendTransaction.tsx +5 -0
  493. package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +357 -0
  494. package/src/react/web/ui/Bridge/BuyWidget.tsx +494 -0
  495. package/src/react/web/ui/Bridge/CheckoutWidget.tsx +473 -0
  496. package/src/react/web/ui/Bridge/DirectPayment.tsx +234 -0
  497. package/src/react/web/ui/Bridge/ErrorBanner.tsx +86 -0
  498. package/src/react/web/ui/Bridge/FundWallet.tsx +341 -0
  499. package/src/react/web/ui/Bridge/QuoteLoader.tsx +219 -0
  500. package/src/react/web/ui/Bridge/StepRunner.tsx +417 -0
  501. package/src/react/web/ui/Bridge/TransactionPayment.tsx +403 -0
  502. package/src/react/web/ui/Bridge/TransactionWidget.tsx +485 -0
  503. package/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx +84 -0
  504. package/src/react/web/ui/Bridge/common/TokenAndChain.tsx +203 -0
  505. package/src/react/web/ui/Bridge/common/TokenBalanceRow.tsx +112 -0
  506. package/src/react/web/ui/Bridge/common/WithHeader.tsx +65 -0
  507. package/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx +318 -0
  508. package/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx +301 -0
  509. package/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx +186 -0
  510. package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +268 -0
  511. package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +282 -0
  512. package/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx +172 -0
  513. package/src/react/web/ui/Bridge/payment-success/PaymentReceipt.tsx +392 -0
  514. package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +155 -0
  515. package/src/react/web/ui/ConnectWallet/Details.test.tsx +2 -2
  516. package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +2 -2
  517. package/src/react/web/ui/ConnectWallet/constants.ts +1 -1
  518. package/src/react/web/ui/ConnectWallet/icons/CreditCardIcon.tsx +24 -0
  519. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +5 -2
  520. package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +3 -1
  521. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx +8 -0
  522. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +3 -2
  523. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx +7 -1
  524. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.tsx +1 -0
  525. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +7 -3
  526. package/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts +22 -0
  527. package/src/react/web/ui/PayEmbed.tsx +2 -0
  528. package/src/react/web/ui/TransactionButton/DepositScreen.tsx +10 -5
  529. package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +78 -25
  530. package/src/react/web/ui/TransactionButton/TransactionModal.tsx +15 -9
  531. package/src/react/web/ui/components/ChainName.tsx +4 -2
  532. package/src/react/web/ui/components/TokenIcon.tsx +7 -4
  533. package/src/react/web/ui/components/buttons.tsx +1 -5
  534. package/src/stories/Bridge/BridgeOrchestrator.stories.tsx +267 -0
  535. package/src/stories/Bridge/DirectPayment.stories.tsx +225 -0
  536. package/src/stories/Bridge/ErrorBanner.stories.tsx +184 -0
  537. package/src/stories/Bridge/FundWallet.stories.tsx +196 -0
  538. package/src/stories/Bridge/PaymentDetails.stories.tsx +501 -0
  539. package/src/stories/Bridge/PaymentSelection.stories.tsx +177 -0
  540. package/src/stories/Bridge/StepRunner.stories.tsx +109 -0
  541. package/src/stories/Bridge/SuccessScreen.stories.tsx +217 -0
  542. package/src/stories/Bridge/TransactionPayment.stories.tsx +170 -0
  543. package/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx +119 -0
  544. package/src/stories/Bridge/fixtures.ts +802 -0
  545. package/src/stories/TokenBalanceRow.stories.tsx +169 -0
  546. package/src/stories/WalletRow.stories.tsx +166 -0
  547. package/src/stories/utils.tsx +35 -0
  548. package/src/version.ts +1 -1
  549. package/src/wallets/connection/autoConnectCore.test.ts +0 -53
  550. package/src/wallets/utils/getWalletBalance.ts +1 -1
@@ -0,0 +1,473 @@
1
+ "use client";
2
+
3
+ import { useQuery } from "@tanstack/react-query";
4
+ import type { Token } from "../../../../bridge/index.js";
5
+ import type { Chain } from "../../../../chains/types.js";
6
+ import type { ThirdwebClient } from "../../../../client/client.js";
7
+ import { NATIVE_TOKEN_ADDRESS } from "../../../../constants/addresses.js";
8
+ import { getToken } from "../../../../pay/convert/get-token.js";
9
+ import { type Address, checksumAddress } from "../../../../utils/address.js";
10
+ import { stringify } from "../../../../utils/json.js";
11
+ import { toTokens } from "../../../../utils/units.js";
12
+ import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
13
+ import type { SmartWalletOptions } from "../../../../wallets/smart/types.js";
14
+ import type { AppMetadata } from "../../../../wallets/types.js";
15
+ import type { WalletId } from "../../../../wallets/wallet-types.js";
16
+ import { CustomThemeProvider } from "../../../core/design-system/CustomThemeProvider.js";
17
+ import type { Theme } from "../../../core/design-system/index.js";
18
+ import type { SiweAuthOptions } from "../../../core/hooks/auth/useSiweAuth.js";
19
+ import type { ConnectButton_connectModalOptions } from "../../../core/hooks/connection/ConnectButtonProps.js";
20
+ import type { SupportedTokens } from "../../../core/utils/defaultTokens.js";
21
+ import { EmbedContainer } from "../ConnectWallet/Modal/ConnectEmbed.js";
22
+ import { useConnectLocale } from "../ConnectWallet/locale/getConnectLocale.js";
23
+ import { DynamicHeight } from "../components/DynamicHeight.js";
24
+ import { Spinner } from "../components/Spinner.js";
25
+ import type { LocaleId } from "../types.js";
26
+ import { BridgeOrchestrator, type UIOptions } from "./BridgeOrchestrator.js";
27
+ import { UnsupportedTokenScreen } from "./UnsupportedTokenScreen.js";
28
+
29
+ export type CheckoutWidgetProps = {
30
+ supportedTokens?: SupportedTokens;
31
+ /**
32
+ * A client is the entry point to the thirdweb SDK.
33
+ * It is required for all other actions.
34
+ * You can create a client using the `createThirdwebClient` function. Refer to the [Creating a Client](https://portal.thirdweb.com/typescript/v5/client) documentation for more information.
35
+ *
36
+ * You must provide a `clientId` or `secretKey` in order to initialize a client. Pass `clientId` if you want for client-side usage and `secretKey` for server-side usage.
37
+ *
38
+ * ```tsx
39
+ * import { createThirdwebClient } from "thirdweb";
40
+ *
41
+ * const client = createThirdwebClient({
42
+ * clientId: "<your_client_id>",
43
+ * })
44
+ * ```
45
+ */
46
+ client: ThirdwebClient;
47
+ /**
48
+ * By default - ConnectButton UI uses the `en-US` locale for english language users.
49
+ *
50
+ * You can customize the language used in the ConnectButton UI by setting the `locale` prop.
51
+ *
52
+ * Refer to the [`LocaleId`](https://portal.thirdweb.com/references/typescript/v5/LocaleId) type for supported locales.
53
+ */
54
+ locale?: LocaleId;
55
+ /**
56
+ * Set the theme for the `CheckoutWidget` component. By default it is set to `"dark"`
57
+ *
58
+ * theme can be set to either `"dark"`, `"light"` or a custom theme object.
59
+ * You can also import [`lightTheme`](https://portal.thirdweb.com/references/typescript/v5/lightTheme)
60
+ * or [`darkTheme`](https://portal.thirdweb.com/references/typescript/v5/darkTheme)
61
+ * functions from `thirdweb/react` to use the default themes as base and overrides parts of it.
62
+ * @example
63
+ * ```ts
64
+ * import { lightTheme } from "thirdweb/react";
65
+ *
66
+ * const customTheme = lightTheme({
67
+ * colors: {
68
+ * modalBg: 'red'
69
+ * }
70
+ * })
71
+ *
72
+ * function Example() {
73
+ * return <CheckoutWidget client={client} theme={customTheme} />
74
+ * }
75
+ * ```
76
+ */
77
+ theme?: "light" | "dark" | Theme;
78
+
79
+ /**
80
+ * Customize the options for "Connect" Button showing in the CheckoutWidget UI when the user is not connected to a wallet.
81
+ *
82
+ * Refer to the [`CheckoutWidgetConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/CheckoutWidgetConnectOptions) type for more details.
83
+ */
84
+ connectOptions?: CheckoutWidgetConnectOptions;
85
+
86
+ /**
87
+ * All wallet IDs included in this array will be hidden from wallet selection when connected.
88
+ */
89
+ hiddenWallets?: WalletId[];
90
+
91
+ /**
92
+ * The wallet that should be pre-selected in the CheckoutWidget UI.
93
+ */
94
+ activeWallet?: Wallet;
95
+
96
+ style?: React.CSSProperties;
97
+
98
+ className?: string;
99
+
100
+ /**
101
+ * The chain the accepted token is on.
102
+ */
103
+ chain: Chain;
104
+
105
+ /**
106
+ * Address of the token to accept as payment. Leave undefined for the native token, or use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.
107
+ */
108
+ tokenAddress?: Address;
109
+
110
+ /**
111
+ * The price of the item **(in wei)**.
112
+ */
113
+ amount: bigint;
114
+
115
+ /**
116
+ * The wallet address or ENS funds will be paid to.
117
+ */
118
+ seller: Address;
119
+
120
+ /**
121
+ * The product name.
122
+ */
123
+ name?: string;
124
+
125
+ /**
126
+ * The product description.
127
+ */
128
+ description?: string;
129
+
130
+ /**
131
+ * The product image URL.
132
+ */
133
+ image?: string;
134
+
135
+ /**
136
+ * Whether the user or the seller pays the protocol fees. Defaults to the user.
137
+ */
138
+ feePayer?: "user" | "seller";
139
+
140
+ /**
141
+ * Preset fiat amounts to display in the UI. Defaults to [5, 10, 20].
142
+ */
143
+ presetOptions?: [number, number, number];
144
+
145
+ /**
146
+ * Arbitrary data to be included in the returned status and webhook events.
147
+ */
148
+ purchaseData?: Record<string, unknown>;
149
+
150
+ /**
151
+ * Callback triggered when the purchase is successful.
152
+ */
153
+ onSuccess?: () => void;
154
+
155
+ /**
156
+ * Callback triggered when the purchase encounters an error.
157
+ */
158
+ onError?: (error: Error) => void;
159
+
160
+ /**
161
+ * Callback triggered when the user cancels the purchase.
162
+ */
163
+ onCancel?: () => void;
164
+
165
+ /**
166
+ * @hidden
167
+ */
168
+ paymentLinkId?: string;
169
+ };
170
+
171
+ // Enhanced UIOptions to handle unsupported token state
172
+ type UIOptionsResult =
173
+ | { type: "success"; data: UIOptions }
174
+ | {
175
+ type: "indexing_token";
176
+ token: Token;
177
+ chain: Chain;
178
+ }
179
+ | {
180
+ type: "unsupported_token";
181
+ tokenAddress: Address;
182
+ chain: Chain;
183
+ };
184
+
185
+ /**
186
+ * Widget a prebuilt UI for purchasing a specific token.
187
+ *
188
+ * @param props - Props of type [`CheckoutWidgetProps`](https://portal.thirdweb.com/references/typescript/v5/CheckoutWidgetProps) to configure the CheckoutWidget component.
189
+ *
190
+ * @example
191
+ * ### Default configuration
192
+ *
193
+ * By default, the `CheckoutWidget` component will allows users to fund their wallets with crypto or fiat on any of the supported chains..
194
+ *
195
+ * ```tsx
196
+ * <CheckoutWidget
197
+ * client={client}
198
+ * />
199
+ * ```
200
+ *
201
+ * ### Customize the UI
202
+ *
203
+ * You can customize the UI of the `CheckoutWidget` component by passing a custom theme object to the `theme` prop.
204
+ *
205
+ * ```tsx
206
+ * <CheckoutWidget
207
+ * client={client}
208
+ * theme={darkTheme({
209
+ * colors: {
210
+ * modalBg: "red",
211
+ * },
212
+ * })}
213
+ * />
214
+ * ```
215
+ *
216
+ * Refer to the [`Theme`](https://portal.thirdweb.com/references/typescript/v5/Theme) type for more details.
217
+ *
218
+ * ### Update the Title
219
+ *
220
+ * You can update the title of the widget by passing a `title` prop to the `CheckoutWidget` component.
221
+ *
222
+ * ```tsx
223
+ * <CheckoutWidget
224
+ * client={client}
225
+ * title="Checkout ETH"
226
+ * />
227
+ * ```
228
+ *
229
+ * ### Configure the wallet connection
230
+ *
231
+ * You can customize the wallet connection flow by passing a `connectOptions` object to the `CheckoutWidget` component.
232
+ *
233
+ * ```tsx
234
+ * <CheckoutWidget
235
+ * client={client}
236
+ * connectOptions={{
237
+ * connectModal: {
238
+ * size: 'compact',
239
+ * title: "Sign in",
240
+ * }
241
+ * }}
242
+ * />
243
+ * ```
244
+ *
245
+ * Refer to the [`CheckoutWidgetConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/CheckoutWidgetConnectOptions) type for more details.
246
+ *
247
+ * @bridge
248
+ * @beta
249
+ * @react
250
+ */
251
+ export function CheckoutWidget(props: CheckoutWidgetProps) {
252
+ const localeQuery = useConnectLocale(props.locale || "en_US");
253
+ const theme = props.theme || "dark";
254
+
255
+ const bridgeDataQuery = useQuery({
256
+ queryKey: ["bridgeData", stringify(props)],
257
+ queryFn: async (): Promise<UIOptionsResult> => {
258
+ const token = await getToken(
259
+ props.client,
260
+ checksumAddress(props.tokenAddress || NATIVE_TOKEN_ADDRESS),
261
+ props.chain.id,
262
+ ).catch((err) =>
263
+ err.message.includes("not supported") ? undefined : Promise.reject(err),
264
+ );
265
+ if (!token) {
266
+ return {
267
+ type: "unsupported_token",
268
+ tokenAddress: checksumAddress(
269
+ props.tokenAddress || NATIVE_TOKEN_ADDRESS,
270
+ ),
271
+ chain: props.chain,
272
+ };
273
+ }
274
+ return {
275
+ type: "success",
276
+ data: {
277
+ mode: "direct_payment",
278
+ metadata: {
279
+ title: props.name,
280
+ image: props.image,
281
+ description: props.description,
282
+ },
283
+ paymentInfo: {
284
+ token,
285
+ amount: toTokens(props.amount, token.decimals),
286
+ sellerAddress: props.seller,
287
+ feePayer: props.feePayer === "seller" ? "receiver" : "sender", // User is sender, seller is receiver
288
+ },
289
+ },
290
+ };
291
+ },
292
+ });
293
+
294
+ let content = null;
295
+ if (!localeQuery.data || bridgeDataQuery.isLoading) {
296
+ content = (
297
+ <div
298
+ style={{
299
+ minHeight: "350px",
300
+ display: "flex",
301
+ justifyContent: "center",
302
+ alignItems: "center",
303
+ }}
304
+ >
305
+ <Spinner size="xl" color="secondaryText" />
306
+ </div>
307
+ );
308
+ } else if (bridgeDataQuery.data?.type === "unsupported_token") {
309
+ // Show unsupported token screen
310
+ content = <UnsupportedTokenScreen chain={bridgeDataQuery.data.chain} />;
311
+ } else if (bridgeDataQuery.data?.type === "success") {
312
+ // Show normal bridge orchestrator
313
+ content = (
314
+ <BridgeOrchestrator
315
+ client={props.client}
316
+ uiOptions={bridgeDataQuery.data.data}
317
+ connectOptions={props.connectOptions}
318
+ connectLocale={localeQuery.data}
319
+ purchaseData={props.purchaseData}
320
+ paymentLinkId={props.paymentLinkId}
321
+ onComplete={() => {
322
+ props.onSuccess?.();
323
+ }}
324
+ onError={(err: Error) => {
325
+ props.onError?.(err);
326
+ }}
327
+ onCancel={() => {
328
+ props.onCancel?.();
329
+ }}
330
+ presetOptions={props.presetOptions}
331
+ receiverAddress={props.seller}
332
+ />
333
+ );
334
+ }
335
+
336
+ return (
337
+ <CustomThemeProvider theme={theme}>
338
+ <EmbedContainer
339
+ modalSize="compact"
340
+ style={props.style}
341
+ className={props.className}
342
+ >
343
+ <DynamicHeight>{content}</DynamicHeight>
344
+ </EmbedContainer>
345
+ </CustomThemeProvider>
346
+ );
347
+ }
348
+
349
+ /**
350
+ * Connection options for the `CheckoutWidget` component
351
+ *
352
+ * @example
353
+ * ```tsx
354
+ * <CheckoutWidget client={client} connectOptions={{
355
+ * connectModal: {
356
+ * size: 'compact',
357
+ * title: "Sign in",
358
+ * }
359
+ * }}
360
+ * />
361
+ * ```
362
+ */
363
+ type CheckoutWidgetConnectOptions = {
364
+ /**
365
+ * Configurations for the `ConnectButton`'s Modal that is shown for connecting a wallet
366
+ * Refer to the [`ConnectButton_connectModalOptions`](https://portal.thirdweb.com/references/typescript/v5/ConnectButton_connectModalOptions) type for more details
367
+ */
368
+ connectModal?: ConnectButton_connectModalOptions;
369
+
370
+ /**
371
+ * Configure options for WalletConnect
372
+ *
373
+ * By default WalletConnect uses the thirdweb's default project id.
374
+ * Setting your own project id is recommended.
375
+ *
376
+ * You can create a project id by signing up on [walletconnect.com](https://walletconnect.com/)
377
+ */
378
+ walletConnect?: {
379
+ projectId?: string;
380
+ };
381
+
382
+ /**
383
+ * Enable Account abstraction for all wallets. This will connect to the users's smart account based on the connected personal wallet and the given options.
384
+ *
385
+ * This allows to sponsor gas fees for your user's transaction using the thirdweb account abstraction infrastructure.
386
+ *
387
+ */
388
+ accountAbstraction?: SmartWalletOptions;
389
+
390
+ /**
391
+ * Array of wallets to show in Connect Modal. If not provided, default wallets will be used.
392
+ */
393
+ wallets?: Wallet[];
394
+ /**
395
+ * When the user has connected their wallet to your site, this configuration determines whether or not you want to automatically connect to the last connected wallet when user visits your site again in the future.
396
+ *
397
+ * By default it is set to `{ timeout: 15000 }` meaning that autoConnect is enabled and if the autoConnection does not succeed within 15 seconds, it will be cancelled.
398
+ *
399
+ * If you want to disable autoConnect, set this prop to `false`.
400
+ *
401
+ * If you want to customize the timeout, you can assign an object with a `timeout` key to this prop.
402
+ * ```
403
+ */
404
+ autoConnect?:
405
+ | {
406
+ timeout: number;
407
+ }
408
+ | boolean;
409
+
410
+ /**
411
+ * Metadata of the app that will be passed to connected wallet. Setting this is highly recommended.
412
+ */
413
+ appMetadata?: AppMetadata;
414
+
415
+ /**
416
+ * The [`Chain`](https://portal.thirdweb.com/references/typescript/v5/Chain) object of the blockchain you want the wallet to connect to
417
+ *
418
+ * If a `chain` is not specified, Wallet will be connected to whatever is the default set in the wallet.
419
+ *
420
+ * If a `chain` is specified, Wallet will be prompted to switch to given chain after connection if it is not already connected to it.
421
+ * This ensures that the wallet is connected to the correct blockchain before interacting with your app.
422
+ *
423
+ * The `ConnectButton` also shows a "Switch Network" button until the wallet is connected to the specified chain. Clicking on the "Switch Network" button triggers the wallet to switch to the specified chain.
424
+ *
425
+ * You can create a `Chain` object using the [`defineChain`](https://portal.thirdweb.com/references/typescript/v5/defineChain) function.
426
+ * At minimum, you need to pass the `id` of the blockchain to `defineChain` function to create a `Chain` object.
427
+ * ```
428
+ */
429
+ chain?: Chain;
430
+
431
+ /**
432
+ * Array of chains that your app supports.
433
+ *
434
+ * This is only relevant if your app is a multi-chain app and works across multiple blockchains.
435
+ * If your app only works on a single blockchain, you should only specify the `chain` prop.
436
+ *
437
+ * Given list of chains will used in various ways:
438
+ * - They will be displayed in the network selector in the `ConnectButton`'s details modal post connection
439
+ * - They will be sent to wallet at the time of connection if the wallet supports requesting multiple chains ( example: WalletConnect ) so that users can switch between the chains post connection easily
440
+ *
441
+ * You can create a `Chain` object using the [`defineChain`](https://portal.thirdweb.com/references/typescript/v5/defineChain) function.
442
+ * At minimum, you need to pass the `id` of the blockchain to `defineChain` function to create a `Chain` object.
443
+ *
444
+ * ```tsx
445
+ * import { defineChain } from "thirdweb/react";
446
+ *
447
+ * const polygon = defineChain({
448
+ * id: 137,
449
+ * });
450
+ * ```
451
+ */
452
+ chains?: Chain[];
453
+
454
+ /**
455
+ * Wallets to show as recommended in the `ConnectButton`'s Modal
456
+ */
457
+ recommendedWallets?: Wallet[];
458
+
459
+ /**
460
+ * By default, ConnectButton modal shows a "All Wallets" button that shows a list of 500+ wallets.
461
+ *
462
+ * You can disable this button by setting `showAllWallets` prop to `false`
463
+ */
464
+ showAllWallets?: boolean;
465
+
466
+ /**
467
+ * Enable SIWE (Sign in with Ethererum) by passing an object of type `SiweAuthOptions` to
468
+ * enforce the users to sign a message after connecting their wallet to authenticate themselves.
469
+ *
470
+ * Refer to the [`SiweAuthOptions`](https://portal.thirdweb.com/references/typescript/v5/SiweAuthOptions) for more details
471
+ */
472
+ auth?: SiweAuthOptions;
473
+ };
@@ -0,0 +1,234 @@
1
+ "use client";
2
+ import type { Token } from "../../../../bridge/types/Token.js";
3
+ import { defineChain } from "../../../../chains/utils.js";
4
+ import type { ThirdwebClient } from "../../../../client/client.js";
5
+ import { type Address, shortenAddress } from "../../../../utils/address.js";
6
+ import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
7
+ import { useActiveAccount } from "../../../core/hooks/wallets/useActiveAccount.js";
8
+ import { useEnsName } from "../../../core/utils/wallet.js";
9
+ import { ConnectButton } from "../ConnectWallet/ConnectButton.js";
10
+ import { PoweredByThirdweb } from "../ConnectWallet/PoweredByTW.js";
11
+ import { FiatValue } from "../ConnectWallet/screens/Buy/swap/FiatValue.js";
12
+ import type { PayEmbedConnectOptions } from "../PayEmbed.js";
13
+ import { ChainName } from "../components/ChainName.js";
14
+ import { Spacer } from "../components/Spacer.js";
15
+ import { Container, Line } from "../components/basic.js";
16
+ import { Button } from "../components/buttons.js";
17
+ import { Text } from "../components/text.js";
18
+ import type { UIOptions } from "./BridgeOrchestrator.js";
19
+ import { ChainIcon } from "./common/TokenAndChain.js";
20
+ import { WithHeader } from "./common/WithHeader.js";
21
+
22
+ export interface DirectPaymentProps {
23
+ /**
24
+ * Payment information for the direct payment
25
+ */
26
+ uiOptions: Extract<UIOptions, { mode: "direct_payment" }>;
27
+
28
+ /**
29
+ * ThirdwebClient for blockchain interactions
30
+ */
31
+ client: ThirdwebClient;
32
+
33
+ /**
34
+ * Called when user continues with the payment
35
+ */
36
+ onContinue: (amount: string, token: Token, receiverAddress: Address) => void;
37
+
38
+ /**
39
+ * Connect options for wallet connection
40
+ */
41
+ connectOptions?: PayEmbedConnectOptions;
42
+ }
43
+
44
+ export function DirectPayment({
45
+ uiOptions,
46
+ client,
47
+ onContinue,
48
+ connectOptions,
49
+ }: DirectPaymentProps) {
50
+ const activeAccount = useActiveAccount();
51
+ const chain = defineChain(uiOptions.paymentInfo.token.chainId);
52
+ const theme = useCustomTheme();
53
+ const handleContinue = () => {
54
+ onContinue(
55
+ uiOptions.paymentInfo.amount,
56
+ uiOptions.paymentInfo.token,
57
+ uiOptions.paymentInfo.sellerAddress,
58
+ );
59
+ };
60
+ const ensName = useEnsName({
61
+ address: uiOptions.paymentInfo.sellerAddress,
62
+ client,
63
+ });
64
+ const sellerAddress =
65
+ ensName.data || shortenAddress(uiOptions.paymentInfo.sellerAddress);
66
+
67
+ const buyNow = (
68
+ <Container flex="row" gap="3xs">
69
+ <Text size="md" color="primaryButtonText">
70
+ Buy Now ·
71
+ </Text>
72
+ <FiatValue
73
+ tokenAmount={uiOptions.paymentInfo.amount}
74
+ token={uiOptions.paymentInfo.token}
75
+ chain={chain}
76
+ client={client}
77
+ color="primaryButtonText"
78
+ size="md"
79
+ />
80
+ </Container>
81
+ );
82
+
83
+ return (
84
+ <WithHeader
85
+ uiOptions={uiOptions}
86
+ defaultTitle="Direct Payment"
87
+ client={client}
88
+ >
89
+ {/* Price section */}
90
+ <Container
91
+ flex="row"
92
+ center="y"
93
+ gap="3xs"
94
+ style={{
95
+ justifyContent: "space-between",
96
+ }}
97
+ >
98
+ <FiatValue
99
+ tokenAmount={uiOptions.paymentInfo.amount}
100
+ token={uiOptions.paymentInfo.token}
101
+ chain={chain}
102
+ client={client}
103
+ color="primaryText"
104
+ size="xl"
105
+ weight={700}
106
+ />
107
+ <Container flex="row" gap="3xs">
108
+ <Text
109
+ size="xs"
110
+ color="secondaryText"
111
+ style={{
112
+ overflow: "hidden",
113
+ textOverflow: "ellipsis",
114
+ whiteSpace: "nowrap",
115
+ }}
116
+ >
117
+ One-time payment
118
+ </Text>
119
+ </Container>
120
+ </Container>
121
+
122
+ <Spacer y="md" />
123
+
124
+ <Line />
125
+
126
+ <Spacer y="md" />
127
+
128
+ {/* Seller section */}
129
+ <Container
130
+ flex="row"
131
+ style={{
132
+ justifyContent: "space-between",
133
+ alignItems: "center",
134
+ }}
135
+ >
136
+ <Text size="sm" color="secondaryText">
137
+ Sold by
138
+ </Text>
139
+ <Text
140
+ size="sm"
141
+ color="primaryText"
142
+ style={{
143
+ fontFamily: "monospace",
144
+ }}
145
+ >
146
+ {sellerAddress}
147
+ </Text>
148
+ </Container>
149
+
150
+ <Spacer y="xs" />
151
+
152
+ <Container
153
+ flex="row"
154
+ style={{
155
+ justifyContent: "space-between",
156
+ alignItems: "center",
157
+ }}
158
+ >
159
+ <Text size="sm" color="secondaryText">
160
+ Price
161
+ </Text>
162
+ <Text
163
+ size="sm"
164
+ color="primaryText"
165
+ style={{
166
+ fontFamily: "monospace",
167
+ }}
168
+ >
169
+ {`${uiOptions.paymentInfo.amount} ${uiOptions.paymentInfo.token.symbol}`}
170
+ </Text>
171
+ </Container>
172
+
173
+ <Spacer y="xs" />
174
+
175
+ {/* Network section */}
176
+ <Container
177
+ flex="row"
178
+ style={{
179
+ justifyContent: "space-between",
180
+ alignItems: "center",
181
+ }}
182
+ >
183
+ <Text size="sm" color="secondaryText">
184
+ Network
185
+ </Text>
186
+ <Container flex="row" gap="3xs" center="y">
187
+ <ChainIcon chain={chain} size={"xs"} client={client} />
188
+ <ChainName
189
+ chain={chain}
190
+ client={client}
191
+ size="sm"
192
+ color="primaryText"
193
+ short
194
+ style={{
195
+ fontFamily: "monospace",
196
+ }}
197
+ />
198
+ </Container>
199
+ </Container>
200
+
201
+ <Spacer y="md" />
202
+
203
+ <Line />
204
+
205
+ <Spacer y="lg" />
206
+
207
+ {/* Action button */}
208
+ <Container flex="column">
209
+ {activeAccount ? (
210
+ <Button variant="primary" fullWidth onClick={handleContinue}>
211
+ {buyNow}
212
+ </Button>
213
+ ) : (
214
+ <ConnectButton
215
+ client={client}
216
+ theme={theme}
217
+ connectButton={{
218
+ label: buyNow,
219
+ style: {
220
+ width: "100%",
221
+ },
222
+ }}
223
+ {...connectOptions}
224
+ />
225
+ )}
226
+
227
+ <Spacer y="md" />
228
+
229
+ <PoweredByThirdweb />
230
+ <Spacer y="lg" />
231
+ </Container>
232
+ </WithHeader>
233
+ );
234
+ }