thirdweb 5.108.6 → 5.108.7

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 (391) hide show
  1. package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  2. package/dist/cjs/react/core/hooks/usePaymentMethods.js +1 -2
  3. package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -1
  4. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +1 -1
  5. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  6. package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +185 -99
  7. package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -1
  8. package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +210 -56
  9. package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
  10. package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +7 -7
  11. package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -1
  12. package/dist/cjs/react/web/ui/Bridge/FundWallet.js +233 -105
  13. package/dist/cjs/react/web/ui/Bridge/FundWallet.js.map +1 -1
  14. package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js +1 -7
  15. package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
  16. package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +16 -12
  17. package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
  18. package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +199 -36
  19. package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
  20. package/dist/cjs/react/web/ui/Bridge/bridge-widget/bridge-widget.js +2 -2
  21. package/dist/cjs/react/web/ui/Bridge/bridge-widget/bridge-widget.js.map +1 -1
  22. package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js +4 -5
  23. package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js.map +1 -1
  24. package/dist/cjs/react/web/ui/Bridge/common/active-wallet-details.js +52 -0
  25. package/dist/cjs/react/web/ui/Bridge/common/active-wallet-details.js.map +1 -0
  26. package/dist/cjs/react/web/ui/Bridge/common/decimal-input.js +36 -0
  27. package/dist/cjs/react/web/ui/Bridge/common/decimal-input.js.map +1 -0
  28. package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js +58 -0
  29. package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js.map +1 -0
  30. package/dist/cjs/react/web/ui/Bridge/common/token-balance.js +20 -0
  31. package/dist/cjs/react/web/ui/Bridge/common/token-balance.js.map +1 -0
  32. package/dist/cjs/react/web/ui/Bridge/common/token-query.js +34 -0
  33. package/dist/cjs/react/web/ui/Bridge/common/token-query.js.map +1 -0
  34. package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js +3 -3
  35. package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
  36. package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js +7 -7
  37. package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
  38. package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -4
  39. package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
  40. package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
  41. package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
  42. package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
  43. package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js +8 -11
  44. package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
  45. package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js +19 -147
  46. package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
  47. package/dist/cjs/react/web/ui/Bridge/types.js +3 -0
  48. package/dist/cjs/react/web/ui/Bridge/types.js.map +1 -0
  49. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +4 -2
  50. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  51. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
  52. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
  53. package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
  54. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +1 -1
  55. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
  56. package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +17 -10
  57. package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
  58. package/dist/cjs/react/web/ui/components/CopyIcon.js +1 -1
  59. package/dist/cjs/react/web/ui/components/CopyIcon.js.map +1 -1
  60. package/dist/cjs/stories/Bridge/CheckoutWidget.stories.js +115 -0
  61. package/dist/cjs/stories/Bridge/CheckoutWidget.stories.js.map +1 -0
  62. package/dist/cjs/stories/Bridge/ErrorBanner.stories.js +7 -111
  63. package/dist/cjs/stories/Bridge/ErrorBanner.stories.js.map +1 -1
  64. package/dist/cjs/stories/Bridge/PaymentDetails.stories.js +27 -306
  65. package/dist/cjs/stories/Bridge/PaymentDetails.stories.js.map +1 -1
  66. package/dist/cjs/stories/Bridge/PaymentSelection.stories.js +21 -128
  67. package/dist/cjs/stories/Bridge/PaymentSelection.stories.js.map +1 -1
  68. package/dist/cjs/stories/Bridge/StepRunner.stories.js +13 -39
  69. package/dist/cjs/stories/Bridge/StepRunner.stories.js.map +1 -1
  70. package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +13 -101
  71. package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -1
  72. package/dist/cjs/stories/Bridge/Transaction/TransactionWidget.stories.js +49 -0
  73. package/dist/cjs/stories/Bridge/Transaction/TransactionWidget.stories.js.map +1 -0
  74. package/dist/cjs/stories/Bridge/Transaction/useSendTransactionModal.stories.js +53 -0
  75. package/dist/cjs/stories/Bridge/Transaction/useSendTransactionModal.stories.js.map +1 -0
  76. package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js +11 -79
  77. package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
  78. package/dist/cjs/stories/Bridge/fixtures.js +21 -62
  79. package/dist/cjs/stories/Bridge/fixtures.js.map +1 -1
  80. package/dist/cjs/stories/BuyWidget.stories.js +44 -8
  81. package/dist/cjs/stories/BuyWidget.stories.js.map +1 -1
  82. package/dist/cjs/stories/utils.js +5 -2
  83. package/dist/cjs/stories/utils.js.map +1 -1
  84. package/dist/cjs/version.js +1 -1
  85. package/dist/cjs/x402/common.js +3 -5
  86. package/dist/cjs/x402/common.js.map +1 -1
  87. package/dist/cjs/x402/facilitator.js +0 -1
  88. package/dist/cjs/x402/facilitator.js.map +1 -1
  89. package/dist/cjs/x402/schemas.js +4 -0
  90. package/dist/cjs/x402/schemas.js.map +1 -1
  91. package/dist/cjs/x402/settle-payment.js +6 -5
  92. package/dist/cjs/x402/settle-payment.js.map +1 -1
  93. package/dist/cjs/x402/sign.js +2 -6
  94. package/dist/cjs/x402/sign.js.map +1 -1
  95. package/dist/cjs/x402/types.js.map +1 -1
  96. package/dist/cjs/x402/verify-payment.js +6 -5
  97. package/dist/cjs/x402/verify-payment.js.map +1 -1
  98. package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  99. package/dist/esm/react/core/hooks/usePaymentMethods.js +1 -2
  100. package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -1
  101. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +1 -1
  102. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  103. package/dist/esm/react/web/ui/Bridge/BuyWidget.js +185 -99
  104. package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -1
  105. package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +211 -57
  106. package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
  107. package/dist/esm/react/web/ui/Bridge/DirectPayment.js +7 -7
  108. package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -1
  109. package/dist/esm/react/web/ui/Bridge/FundWallet.js +237 -109
  110. package/dist/esm/react/web/ui/Bridge/FundWallet.js.map +1 -1
  111. package/dist/esm/react/web/ui/Bridge/QuoteLoader.js +1 -7
  112. package/dist/esm/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
  113. package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +16 -12
  114. package/dist/esm/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
  115. package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +198 -36
  116. package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
  117. package/dist/esm/react/web/ui/Bridge/bridge-widget/bridge-widget.js +2 -2
  118. package/dist/esm/react/web/ui/Bridge/bridge-widget/bridge-widget.js.map +1 -1
  119. package/dist/esm/react/web/ui/Bridge/common/WithHeader.js +4 -5
  120. package/dist/esm/react/web/ui/Bridge/common/WithHeader.js.map +1 -1
  121. package/dist/esm/react/web/ui/Bridge/common/active-wallet-details.js +49 -0
  122. package/dist/esm/react/web/ui/Bridge/common/active-wallet-details.js.map +1 -0
  123. package/dist/esm/react/web/ui/Bridge/common/decimal-input.js +33 -0
  124. package/dist/esm/react/web/ui/Bridge/common/decimal-input.js.map +1 -0
  125. package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js +55 -0
  126. package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js.map +1 -0
  127. package/dist/esm/react/web/ui/Bridge/common/token-balance.js +17 -0
  128. package/dist/esm/react/web/ui/Bridge/common/token-balance.js.map +1 -0
  129. package/dist/esm/react/web/ui/Bridge/common/token-query.js +31 -0
  130. package/dist/esm/react/web/ui/Bridge/common/token-query.js.map +1 -0
  131. package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js +3 -3
  132. package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
  133. package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js +7 -7
  134. package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
  135. package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -4
  136. package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
  137. package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
  138. package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
  139. package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
  140. package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js +8 -11
  141. package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
  142. package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js +16 -144
  143. package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
  144. package/dist/esm/react/web/ui/Bridge/types.js +2 -0
  145. package/dist/esm/react/web/ui/Bridge/types.js.map +1 -0
  146. package/dist/esm/react/web/ui/ConnectWallet/Details.js +4 -2
  147. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  148. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
  149. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
  150. package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
  151. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +1 -1
  152. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
  153. package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +17 -10
  154. package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
  155. package/dist/esm/react/web/ui/components/CopyIcon.js +1 -1
  156. package/dist/esm/react/web/ui/components/CopyIcon.js.map +1 -1
  157. package/dist/esm/stories/Bridge/CheckoutWidget.stories.js +112 -0
  158. package/dist/esm/stories/Bridge/CheckoutWidget.stories.js.map +1 -0
  159. package/dist/esm/stories/Bridge/ErrorBanner.stories.js +7 -111
  160. package/dist/esm/stories/Bridge/ErrorBanner.stories.js.map +1 -1
  161. package/dist/esm/stories/Bridge/PaymentDetails.stories.js +28 -307
  162. package/dist/esm/stories/Bridge/PaymentDetails.stories.js.map +1 -1
  163. package/dist/esm/stories/Bridge/PaymentSelection.stories.js +22 -129
  164. package/dist/esm/stories/Bridge/PaymentSelection.stories.js.map +1 -1
  165. package/dist/esm/stories/Bridge/StepRunner.stories.js +12 -38
  166. package/dist/esm/stories/Bridge/StepRunner.stories.js.map +1 -1
  167. package/dist/esm/stories/Bridge/SuccessScreen.stories.js +14 -102
  168. package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -1
  169. package/dist/esm/stories/Bridge/Transaction/TransactionWidget.stories.js +46 -0
  170. package/dist/esm/stories/Bridge/Transaction/TransactionWidget.stories.js.map +1 -0
  171. package/dist/esm/stories/Bridge/Transaction/useSendTransactionModal.stories.js +50 -0
  172. package/dist/esm/stories/Bridge/Transaction/useSendTransactionModal.stories.js.map +1 -0
  173. package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js +12 -80
  174. package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
  175. package/dist/esm/stories/Bridge/fixtures.js +15 -56
  176. package/dist/esm/stories/Bridge/fixtures.js.map +1 -1
  177. package/dist/esm/stories/BuyWidget.stories.js +37 -9
  178. package/dist/esm/stories/BuyWidget.stories.js.map +1 -1
  179. package/dist/esm/stories/utils.js +6 -3
  180. package/dist/esm/stories/utils.js.map +1 -1
  181. package/dist/esm/version.js +1 -1
  182. package/dist/esm/x402/common.js +3 -5
  183. package/dist/esm/x402/common.js.map +1 -1
  184. package/dist/esm/x402/facilitator.js +0 -1
  185. package/dist/esm/x402/facilitator.js.map +1 -1
  186. package/dist/esm/x402/schemas.js +5 -1
  187. package/dist/esm/x402/schemas.js.map +1 -1
  188. package/dist/esm/x402/settle-payment.js +6 -5
  189. package/dist/esm/x402/settle-payment.js.map +1 -1
  190. package/dist/esm/x402/sign.js +2 -6
  191. package/dist/esm/x402/sign.js.map +1 -1
  192. package/dist/esm/x402/types.js.map +1 -1
  193. package/dist/esm/x402/verify-payment.js +6 -5
  194. package/dist/esm/x402/verify-payment.js.map +1 -1
  195. package/dist/scripts/bridge-widget.d.ts +3 -3
  196. package/dist/scripts/bridge-widget.js +113 -150
  197. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +6 -0
  198. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  199. package/dist/types/react/core/hooks/usePaymentMethods.d.ts +1 -2
  200. package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -1
  201. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  202. package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +7 -12
  203. package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -1
  204. package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +5 -8
  205. package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -1
  206. package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +15 -12
  207. package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -1
  208. package/dist/types/react/web/ui/Bridge/FundWallet.d.ts +33 -15
  209. package/dist/types/react/web/ui/Bridge/FundWallet.d.ts.map +1 -1
  210. package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts +9 -12
  211. package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts.map +1 -1
  212. package/dist/types/react/web/ui/Bridge/StepRunner.d.ts +7 -7
  213. package/dist/types/react/web/ui/Bridge/StepRunner.d.ts.map +1 -1
  214. package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts +14 -7
  215. package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts.map +1 -1
  216. package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +3 -5
  217. package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -1
  218. package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts +4 -3
  219. package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts.map +1 -1
  220. package/dist/types/react/web/ui/Bridge/bridge-widget/bridge-widget.d.ts +3 -3
  221. package/dist/types/react/web/ui/Bridge/bridge-widget/bridge-widget.d.ts.map +1 -1
  222. package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts +4 -4
  223. package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts.map +1 -1
  224. package/dist/types/react/web/ui/Bridge/common/active-wallet-details.d.ts +8 -0
  225. package/dist/types/react/web/ui/Bridge/common/active-wallet-details.d.ts.map +1 -0
  226. package/dist/types/react/web/ui/Bridge/common/decimal-input.d.ts +6 -0
  227. package/dist/types/react/web/ui/Bridge/common/decimal-input.d.ts.map +1 -0
  228. package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts +13 -0
  229. package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts.map +1 -0
  230. package/dist/types/react/web/ui/Bridge/common/token-balance.d.ts +8 -0
  231. package/dist/types/react/web/ui/Bridge/common/token-balance.d.ts.map +1 -0
  232. package/dist/types/react/web/ui/Bridge/common/token-query.d.ts +15 -0
  233. package/dist/types/react/web/ui/Bridge/common/token-query.d.ts.map +1 -0
  234. package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts +13 -11
  235. package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts.map +1 -1
  236. package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts +8 -3
  237. package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts.map +1 -1
  238. package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +12 -16
  239. package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -1
  240. package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +1 -1
  241. package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -1
  242. package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +6 -6
  243. package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -1
  244. package/dist/types/react/web/ui/Bridge/swap-widget/swap-ui.d.ts.map +1 -1
  245. package/dist/types/react/web/ui/Bridge/types.d.ts +39 -0
  246. package/dist/types/react/web/ui/Bridge/types.d.ts.map +1 -0
  247. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  248. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
  249. package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts +2 -1
  250. package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts.map +1 -1
  251. package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +0 -1
  252. package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
  253. package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +3 -1
  254. package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
  255. package/dist/types/react/web/ui/components/CopyIcon.d.ts +1 -0
  256. package/dist/types/react/web/ui/components/CopyIcon.d.ts.map +1 -1
  257. package/dist/types/script-exports/bridge-widget-script.d.ts +3 -3
  258. package/dist/types/script-exports/bridge-widget-script.d.ts.map +1 -1
  259. package/dist/types/stories/Bridge/CheckoutWidget.stories.d.ts +25 -0
  260. package/dist/types/stories/Bridge/CheckoutWidget.stories.d.ts.map +1 -0
  261. package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts +3 -47
  262. package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts.map +1 -1
  263. package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts +3 -56
  264. package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts.map +1 -1
  265. package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts +5 -63
  266. package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts.map +1 -1
  267. package/dist/types/stories/Bridge/StepRunner.stories.d.ts +4 -52
  268. package/dist/types/stories/Bridge/StepRunner.stories.d.ts.map +1 -1
  269. package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +4 -54
  270. package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -1
  271. package/dist/types/stories/Bridge/Transaction/TransactionWidget.stories.d.ts +11 -0
  272. package/dist/types/stories/Bridge/Transaction/TransactionWidget.stories.d.ts.map +1 -0
  273. package/dist/types/stories/Bridge/Transaction/useSendTransactionModal.stories.d.ts +18 -0
  274. package/dist/types/stories/Bridge/Transaction/useSendTransactionModal.stories.d.ts.map +1 -0
  275. package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts +3 -34
  276. package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts.map +1 -1
  277. package/dist/types/stories/Bridge/fixtures.d.ts +19 -17
  278. package/dist/types/stories/Bridge/fixtures.d.ts.map +1 -1
  279. package/dist/types/stories/BuyWidget.stories.d.ts +9 -1
  280. package/dist/types/stories/BuyWidget.stories.d.ts.map +1 -1
  281. package/dist/types/stories/utils.d.ts +0 -2
  282. package/dist/types/stories/utils.d.ts.map +1 -1
  283. package/dist/types/version.d.ts +1 -1
  284. package/dist/types/x402/common.d.ts.map +1 -1
  285. package/dist/types/x402/facilitator.d.ts +2 -3
  286. package/dist/types/x402/facilitator.d.ts.map +1 -1
  287. package/dist/types/x402/schemas.d.ts +21 -0
  288. package/dist/types/x402/schemas.d.ts.map +1 -1
  289. package/dist/types/x402/settle-payment.d.ts.map +1 -1
  290. package/dist/types/x402/types.d.ts +5 -4
  291. package/dist/types/x402/types.d.ts.map +1 -1
  292. package/dist/types/x402/verify-payment.d.ts.map +1 -1
  293. package/package.json +1 -1
  294. package/src/react/core/hooks/transaction/useSendTransaction.ts +6 -0
  295. package/src/react/core/hooks/usePaymentMethods.ts +1 -4
  296. package/src/react/web/hooks/transaction/useSendTransaction.tsx +1 -0
  297. package/src/react/web/ui/Bridge/BuyWidget.tsx +355 -160
  298. package/src/react/web/ui/Bridge/CheckoutWidget.tsx +384 -107
  299. package/src/react/web/ui/Bridge/DirectPayment.tsx +34 -26
  300. package/src/react/web/ui/Bridge/FundWallet.tsx +610 -266
  301. package/src/react/web/ui/Bridge/QuoteLoader.tsx +10 -20
  302. package/src/react/web/ui/Bridge/StepRunner.tsx +7 -7
  303. package/src/react/web/ui/Bridge/TransactionPayment.tsx +35 -25
  304. package/src/react/web/ui/Bridge/TransactionWidget.tsx +395 -71
  305. package/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx +3 -3
  306. package/src/react/web/ui/Bridge/bridge-widget/bridge-widget.tsx +16 -14
  307. package/src/react/web/ui/Bridge/common/WithHeader.tsx +13 -19
  308. package/src/react/web/ui/Bridge/common/active-wallet-details.tsx +103 -0
  309. package/src/react/web/ui/Bridge/common/decimal-input.tsx +61 -0
  310. package/src/react/web/ui/Bridge/common/selected-token-button.tsx +168 -0
  311. package/src/react/web/ui/Bridge/common/token-balance.tsx +23 -0
  312. package/src/react/web/ui/Bridge/common/token-query.ts +49 -0
  313. package/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx +23 -14
  314. package/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx +36 -22
  315. package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +11 -22
  316. package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +1 -1
  317. package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +7 -8
  318. package/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx +14 -12
  319. package/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx +19 -332
  320. package/src/react/web/ui/Bridge/types.ts +47 -0
  321. package/src/react/web/ui/ConnectWallet/Details.tsx +3 -1
  322. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +1 -5
  323. package/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts +5 -1
  324. package/src/react/web/ui/TransactionButton/DepositScreen.tsx +1 -2
  325. package/src/react/web/ui/TransactionButton/TransactionModal.tsx +44 -27
  326. package/src/react/web/ui/components/CopyIcon.tsx +11 -2
  327. package/src/script-exports/bridge-widget-script.tsx +3 -3
  328. package/src/script-exports/readme.md +1 -8
  329. package/src/stories/Bridge/CheckoutWidget.stories.tsx +147 -0
  330. package/src/stories/Bridge/ErrorBanner.stories.tsx +13 -138
  331. package/src/stories/Bridge/PaymentDetails.stories.tsx +34 -349
  332. package/src/stories/Bridge/PaymentSelection.stories.tsx +28 -156
  333. package/src/stories/Bridge/StepRunner.stories.tsx +18 -65
  334. package/src/stories/Bridge/SuccessScreen.stories.tsx +21 -130
  335. package/src/stories/Bridge/Transaction/TransactionWidget.stories.tsx +63 -0
  336. package/src/stories/Bridge/Transaction/useSendTransactionModal.stories.tsx +68 -0
  337. package/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx +19 -108
  338. package/src/stories/Bridge/fixtures.ts +36 -63
  339. package/src/stories/BuyWidget.stories.tsx +103 -8
  340. package/src/stories/utils.tsx +16 -9
  341. package/src/version.ts +1 -1
  342. package/src/x402/common.ts +2 -5
  343. package/src/x402/facilitator.ts +3 -3
  344. package/src/x402/schemas.ts +10 -0
  345. package/src/x402/settle-payment.ts +7 -6
  346. package/src/x402/sign.ts +3 -8
  347. package/src/x402/types.ts +5 -4
  348. package/src/x402/verify-payment.ts +7 -6
  349. package/dist/cjs/react/core/machines/paymentMachine.js +0 -191
  350. package/dist/cjs/react/core/machines/paymentMachine.js.map +0 -1
  351. package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +0 -129
  352. package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +0 -1
  353. package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js +0 -258
  354. package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js.map +0 -1
  355. package/dist/cjs/stories/Bridge/DirectPayment.stories.js +0 -222
  356. package/dist/cjs/stories/Bridge/DirectPayment.stories.js.map +0 -1
  357. package/dist/cjs/stories/Bridge/FundWallet.stories.js +0 -201
  358. package/dist/cjs/stories/Bridge/FundWallet.stories.js.map +0 -1
  359. package/dist/cjs/stories/Bridge/TransactionPayment.stories.js +0 -168
  360. package/dist/cjs/stories/Bridge/TransactionPayment.stories.js.map +0 -1
  361. package/dist/esm/react/core/machines/paymentMachine.js +0 -188
  362. package/dist/esm/react/core/machines/paymentMachine.js.map +0 -1
  363. package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +0 -126
  364. package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +0 -1
  365. package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js +0 -255
  366. package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js.map +0 -1
  367. package/dist/esm/stories/Bridge/DirectPayment.stories.js +0 -219
  368. package/dist/esm/stories/Bridge/DirectPayment.stories.js.map +0 -1
  369. package/dist/esm/stories/Bridge/FundWallet.stories.js +0 -198
  370. package/dist/esm/stories/Bridge/FundWallet.stories.js.map +0 -1
  371. package/dist/esm/stories/Bridge/TransactionPayment.stories.js +0 -165
  372. package/dist/esm/stories/Bridge/TransactionPayment.stories.js.map +0 -1
  373. package/dist/types/react/core/machines/paymentMachine.d.ts +0 -89
  374. package/dist/types/react/core/machines/paymentMachine.d.ts.map +0 -1
  375. package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts +0 -99
  376. package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +0 -1
  377. package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts +0 -97
  378. package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts.map +0 -1
  379. package/dist/types/stories/Bridge/DirectPayment.stories.d.ts +0 -69
  380. package/dist/types/stories/Bridge/DirectPayment.stories.d.ts.map +0 -1
  381. package/dist/types/stories/Bridge/FundWallet.stories.d.ts +0 -67
  382. package/dist/types/stories/Bridge/FundWallet.stories.d.ts.map +0 -1
  383. package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts +0 -60
  384. package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts.map +0 -1
  385. package/src/react/core/machines/paymentMachine.test.ts +0 -519
  386. package/src/react/core/machines/paymentMachine.ts +0 -295
  387. package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +0 -425
  388. package/src/stories/Bridge/BridgeOrchestrator.stories.tsx +0 -298
  389. package/src/stories/Bridge/DirectPayment.stories.tsx +0 -256
  390. package/src/stories/Bridge/FundWallet.stories.tsx +0 -227
  391. package/src/stories/Bridge/TransactionPayment.stories.tsx +0 -202
@@ -1,21 +1,22 @@
1
1
  import type { Token } from "../../../../../bridge/index.js";
2
2
  import { defineChain } from "../../../../../chains/utils.js";
3
3
  import type { ThirdwebClient } from "../../../../../client/client.js";
4
+ import type { SupportedFiatCurrency } from "../../../../../pay/convert/type.js";
5
+ import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js";
4
6
  import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
5
7
  import { radius, spacing } from "../../../../core/design-system/index.js";
6
8
  import { useTransactionDetails } from "../../../../core/hooks/useTransactionDetails.js";
7
- import type { PaymentMethod } from "../../../../core/machines/paymentMachine.js";
8
9
  import { getFiatCurrencyIcon } from "../../ConnectWallet/screens/Buy/fiat/currencies.js";
9
10
  import { FiatValue } from "../../ConnectWallet/screens/Buy/swap/FiatValue.js";
10
11
  import { StepConnectorArrow } from "../../ConnectWallet/screens/Buy/swap/StepConnector.js";
11
12
  import { WalletRow } from "../../ConnectWallet/screens/Buy/swap/WalletRow.js";
12
13
  import { Container } from "../../components/basic.js";
13
14
  import { Text } from "../../components/text.js";
14
- import type { UIOptions } from "../BridgeOrchestrator.js";
15
15
  import { TokenBalanceRow } from "../common/TokenBalanceRow.js";
16
+ import type { ModeInfo, PaymentMethod } from "../types.js";
16
17
 
17
18
  export function PaymentOverview(props: {
18
- uiOptions: UIOptions;
19
+ currency: SupportedFiatCurrency;
19
20
  receiver: string;
20
21
  sender?: string;
21
22
  client: ThirdwebClient;
@@ -23,6 +24,11 @@ export function PaymentOverview(props: {
23
24
  toToken: Token;
24
25
  fromAmount: string;
25
26
  toAmount: string;
27
+ metadata: {
28
+ title: string | undefined;
29
+ description: string | undefined;
30
+ };
31
+ modeInfo: ModeInfo;
26
32
  }) {
27
33
  const theme = useCustomTheme();
28
34
  const sender =
@@ -32,6 +38,7 @@ export function PaymentOverview(props: {
32
38
  : undefined);
33
39
  const isDifferentRecipient =
34
40
  props.receiver.toLowerCase() !== sender?.toLowerCase();
41
+
35
42
  return (
36
43
  <Container>
37
44
  {/* Sell */}
@@ -63,7 +70,7 @@ export function PaymentOverview(props: {
63
70
  )}
64
71
  {props.paymentMethod.type === "wallet" && (
65
72
  <TokenBalanceRow
66
- currency={props.uiOptions.currency}
73
+ currency={props.currency}
67
74
  amount={props.fromAmount}
68
75
  client={props.client}
69
76
  onClick={() => {}}
@@ -134,7 +141,7 @@ export function PaymentOverview(props: {
134
141
  />
135
142
  </Container>
136
143
  )}
137
- {props.uiOptions.mode === "direct_payment" && (
144
+ {props.modeInfo.mode === "direct_payment" && (
138
145
  <Container
139
146
  center="y"
140
147
  flex="row"
@@ -144,11 +151,11 @@ export function PaymentOverview(props: {
144
151
  >
145
152
  <Container center="y" flex="column" gap="3xs" style={{ flex: 1 }}>
146
153
  <Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
147
- {props.uiOptions.metadata?.title || "Payment"}
154
+ {props.metadata.title || "Payment"}
148
155
  </Text>
149
- {props.uiOptions.metadata?.description && (
156
+ {props.metadata.description && (
150
157
  <Text color="secondaryText" size="xs">
151
- {props.uiOptions.metadata.description}
158
+ {props.metadata.description}
152
159
  </Text>
153
160
  )}
154
161
  </Container>
@@ -159,24 +166,24 @@ export function PaymentOverview(props: {
159
166
  style={{ alignItems: "flex-end" }}
160
167
  >
161
168
  <FiatValue
162
- currency={props.uiOptions.currency}
169
+ currency={props.currency}
163
170
  chain={defineChain(props.toToken.chainId)}
164
171
  client={props.client}
165
172
  color="primaryText"
166
173
  size="sm"
167
174
  token={props.toToken}
168
- tokenAmount={props.uiOptions.paymentInfo.amount}
175
+ tokenAmount={props.modeInfo.paymentInfo.amount}
169
176
  weight={600}
170
177
  />
171
178
  <Text color="secondaryText" size="xs">
172
- {props.uiOptions.paymentInfo.amount} {props.toToken.symbol}
179
+ {props.modeInfo.paymentInfo.amount} {props.toToken.symbol}
173
180
  </Text>
174
181
  </Container>
175
182
  </Container>
176
183
  )}
177
- {props.uiOptions.mode === "fund_wallet" && (
184
+ {props.modeInfo.mode === "fund_wallet" && (
178
185
  <TokenBalanceRow
179
- currency={props.uiOptions.currency}
186
+ currency={props.currency}
180
187
  amount={props.toAmount}
181
188
  client={props.client}
182
189
  onClick={() => {}}
@@ -188,11 +195,13 @@ export function PaymentOverview(props: {
188
195
  token={props.toToken}
189
196
  />
190
197
  )}
191
- {props.uiOptions.mode === "transaction" && (
198
+ {props.modeInfo.mode === "transaction" && (
192
199
  <TransactionOverViewCompact
193
200
  client={props.client}
194
201
  paymentMethod={props.paymentMethod}
195
- uiOptions={props.uiOptions}
202
+ currency={props.currency}
203
+ transaction={props.modeInfo.transaction}
204
+ metadata={props.metadata}
196
205
  />
197
206
  )}
198
207
  </Container>
@@ -201,16 +210,21 @@ export function PaymentOverview(props: {
201
210
  }
202
211
 
203
212
  const TransactionOverViewCompact = (props: {
204
- uiOptions: Extract<UIOptions, { mode: "transaction" }>;
213
+ transaction: PreparedTransaction;
214
+ currency: SupportedFiatCurrency;
205
215
  paymentMethod: PaymentMethod;
206
216
  client: ThirdwebClient;
217
+ metadata: {
218
+ title: string | undefined;
219
+ description: string | undefined;
220
+ };
207
221
  }) => {
208
222
  const theme = useCustomTheme();
209
223
  const txInfo = useTransactionDetails({
210
224
  client: props.client,
211
- transaction: props.uiOptions.transaction,
225
+ transaction: props.transaction,
212
226
  wallet: props.paymentMethod.payerWallet,
213
- currency: props.uiOptions.currency,
227
+ currency: props.currency,
214
228
  });
215
229
 
216
230
  if (!txInfo.data) {
@@ -234,7 +248,7 @@ const TransactionOverViewCompact = (props: {
234
248
  }}
235
249
  />
236
250
  {/* Description skeleton - only if metadata exists */}
237
- {props.uiOptions.metadata?.description && (
251
+ {props.metadata.description && (
238
252
  <div
239
253
  style={{
240
254
  backgroundColor: theme.colors.skeletonBg,
@@ -275,11 +289,11 @@ const TransactionOverViewCompact = (props: {
275
289
  >
276
290
  <Container center="y" flex="column" gap="3xs" style={{ flex: 1 }}>
277
291
  <Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
278
- {props.uiOptions.metadata?.title || "Transaction"}
292
+ {props.metadata.title || "Transaction"}
279
293
  </Text>
280
- {props.uiOptions.metadata?.description && (
294
+ {props.metadata.description && (
281
295
  <Text color="secondaryText" size="xs">
282
- {props.uiOptions.metadata.description}
296
+ {props.metadata.description}
283
297
  </Text>
284
298
  )}
285
299
  </Container>
@@ -12,18 +12,18 @@ import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
12
12
  import { usePaymentMethods } from "../../../../core/hooks/usePaymentMethods.js";
13
13
  import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js";
14
14
  import { useConnectedWallets } from "../../../../core/hooks/wallets/useConnectedWallets.js";
15
- import type { PaymentMethod } from "../../../../core/machines/paymentMachine.js";
16
15
  import type { SupportedTokens } from "../../../../core/utils/defaultTokens.js";
17
16
  import type { ConnectLocale } from "../../ConnectWallet/locale/types.js";
18
17
  import { WalletSwitcherConnectionScreen } from "../../ConnectWallet/screens/WalletSwitcherConnectionScreen.js";
19
18
  import { Container, ModalHeader } from "../../components/basic.js";
20
19
  import { Spacer } from "../../components/Spacer.js";
21
20
  import type { PayEmbedConnectOptions } from "../../PayEmbed.js";
21
+ import type { PaymentMethod } from "../types.js";
22
22
  import { FiatProviderSelection } from "./FiatProviderSelection.js";
23
23
  import { TokenSelection } from "./TokenSelection.js";
24
24
  import { WalletFiatSelection } from "./WalletFiatSelection.js";
25
25
 
26
- export interface PaymentSelectionProps {
26
+ type PaymentSelectionProps = {
27
27
  /**
28
28
  * The destination token to bridge to
29
29
  */
@@ -37,7 +37,7 @@ export interface PaymentSelectionProps {
37
37
  /**
38
38
  * The receiver address
39
39
  */
40
- receiverAddress?: Address;
40
+ receiverAddress: Address;
41
41
 
42
42
  /**
43
43
  * ThirdwebClient for API calls
@@ -57,47 +57,41 @@ export interface PaymentSelectionProps {
57
57
  /**
58
58
  * Called when user wants to go back
59
59
  */
60
- onBack?: () => void;
60
+ onBack: () => void;
61
61
 
62
62
  /**
63
63
  * Connect options for wallet connection
64
64
  */
65
- connectOptions?: PayEmbedConnectOptions;
65
+ connectOptions: PayEmbedConnectOptions | undefined;
66
66
 
67
67
  /**
68
68
  * Locale for connect UI
69
69
  */
70
70
  connectLocale: ConnectLocale;
71
71
 
72
- /**
73
- * Whether to include the destination token in the payment methods
74
- */
75
- includeDestinationToken?: boolean;
76
-
77
72
  /**
78
73
  * Allowed payment methods
79
- * @default ["crypto", "card"]
80
74
  */
81
- paymentMethods?: ("crypto" | "card")[];
75
+ paymentMethods: ("crypto" | "card")[];
82
76
 
83
77
  /**
84
78
  * Fee payer
85
79
  */
86
- feePayer?: "sender" | "receiver";
80
+ feePayer: "sender" | "receiver" | undefined;
87
81
 
88
82
  /**
89
83
  * The currency to use for the payment.
90
84
  * @default "USD"
91
85
  */
92
- currency?: SupportedFiatCurrency;
86
+ currency: SupportedFiatCurrency;
93
87
 
94
88
  /**
95
89
  * The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support.
96
90
  */
97
91
  country: string | undefined;
98
92
 
99
- supportedTokens?: SupportedTokens;
100
- }
93
+ supportedTokens: SupportedTokens | undefined;
94
+ };
101
95
 
102
96
  type Step =
103
97
  | { type: "walletSelection" }
@@ -115,8 +109,7 @@ export function PaymentSelection({
115
109
  onBack,
116
110
  connectOptions,
117
111
  connectLocale,
118
- includeDestinationToken,
119
- paymentMethods = ["crypto", "card"],
112
+ paymentMethods,
120
113
  supportedTokens,
121
114
  feePayer,
122
115
  currency,
@@ -161,10 +154,6 @@ export function PaymentSelection({
161
154
  client,
162
155
  destinationAmount,
163
156
  destinationToken,
164
- includeDestinationToken:
165
- includeDestinationToken ||
166
- receiverAddress?.toLowerCase() !==
167
- payerWallet?.getAccount()?.address?.toLowerCase(),
168
157
  payerWallet,
169
158
  supportedTokens,
170
159
  });
@@ -4,7 +4,6 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
4
4
  import type { SupportedFiatCurrency } from "../../../../../pay/convert/type.js";
5
5
  import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
6
6
  import { radius, spacing } from "../../../../core/design-system/index.js";
7
- import type { PaymentMethod } from "../../../../core/machines/paymentMachine.js";
8
7
  import {
9
8
  formatCurrencyAmount,
10
9
  formatTokenAmount,
@@ -15,6 +14,7 @@ import { Skeleton } from "../../components/Skeleton.js";
15
14
  import { Spacer } from "../../components/Spacer.js";
16
15
  import { Text } from "../../components/text.js";
17
16
  import { TokenAndChain } from "../common/TokenAndChain.js";
17
+ import type { PaymentMethod } from "../types.js";
18
18
 
19
19
  interface TokenSelectionProps {
20
20
  paymentMethods: PaymentMethod[];
@@ -13,14 +13,13 @@ import { Container, ModalHeader } from "../../components/basic.js";
13
13
  import { Button } from "../../components/buttons.js";
14
14
  import { Spacer } from "../../components/Spacer.js";
15
15
  import { Text } from "../../components/text.js";
16
- import type { UIOptions } from "../BridgeOrchestrator.js";
17
16
  import { PaymentReceipt } from "./PaymentReceipt.js";
18
17
 
19
- export interface SuccessScreenProps {
18
+ type SuccessScreenProps = {
20
19
  /**
21
20
  * UI options
22
21
  */
23
- uiOptions: UIOptions;
22
+ showContinueWithTx: boolean;
24
23
  /**
25
24
  * Prepared quote from Bridge.prepare
26
25
  */
@@ -46,19 +45,19 @@ export interface SuccessScreenProps {
46
45
  /**
47
46
  * Whether or not this payment is associated with a payment ID. If it does, we show a different message.
48
47
  */
49
- hasPaymentId?: boolean;
50
- }
48
+ hasPaymentId: boolean;
49
+ };
51
50
 
52
51
  type ViewState = "success" | "detail";
53
52
 
54
53
  export function SuccessScreen({
55
- uiOptions,
56
54
  preparedQuote,
57
55
  completedStatuses,
58
56
  onDone,
59
57
  windowAdapter,
60
58
  client,
61
59
  hasPaymentId = false,
60
+ showContinueWithTx,
62
61
  }: SuccessScreenProps) {
63
62
  const theme = useCustomTheme();
64
63
  const [viewState, setViewState] = useState<ViewState>("success");
@@ -137,7 +136,7 @@ export function SuccessScreen({
137
136
  <Text center color="secondaryText" size="sm">
138
137
  {hasPaymentId
139
138
  ? "You can now close this page and return to the application."
140
- : uiOptions.mode === "transaction"
139
+ : showContinueWithTx
141
140
  ? "Click continue to execute your transaction."
142
141
  : "Your payment has been completed successfully."}
143
142
  </Text>
@@ -158,7 +157,7 @@ export function SuccessScreen({
158
157
 
159
158
  {!hasPaymentId && (
160
159
  <Button fullWidth onClick={onDone} variant="accent">
161
- {uiOptions.mode === "transaction" ? "Continue" : "Done"}
160
+ {showContinueWithTx ? "Continue" : "Done"}
162
161
  </Button>
163
162
  )}
164
163
  </Container>
@@ -260,7 +260,7 @@ export function SwapWidget(props: SwapWidgetProps) {
260
260
  style={props.style}
261
261
  className={props.className}
262
262
  >
263
- <SwapWidgetContent {...props} />
263
+ <SwapWidgetContent {...props} currency={props.currency || "USD"} />
264
264
  </SwapWidgetContainer>
265
265
  );
266
266
  }
@@ -314,7 +314,11 @@ type SwapWidgetScreen =
314
314
  >
315
315
  | { id: "error"; error: Error; preparedQuote: SwapPreparedQuote };
316
316
 
317
- function SwapWidgetContent(props: SwapWidgetProps) {
317
+ function SwapWidgetContent(
318
+ props: SwapWidgetProps & {
319
+ currency: SupportedFiatCurrency;
320
+ },
321
+ ) {
318
322
  const [screen, setScreen] = useState<SwapWidgetScreen>({ id: "1:swap-ui" });
319
323
  const activeWalletInfo = useActiveWalletInfo();
320
324
  const isPersistEnabled = props.persistTokenSelections !== false;
@@ -385,7 +389,7 @@ function SwapWidgetContent(props: SwapWidgetProps) {
385
389
  client={props.client}
386
390
  theme={props.theme || "dark"}
387
391
  connectOptions={props.connectOptions}
388
- currency={props.currency || "USD"}
392
+ currency={props.currency}
389
393
  activeWalletInfo={activeWalletInfo}
390
394
  buyToken={buyToken}
391
395
  sellToken={sellToken}
@@ -412,7 +416,10 @@ function SwapWidgetContent(props: SwapWidgetProps) {
412
416
  if (screen.id === "2:preview") {
413
417
  return (
414
418
  <PaymentDetails
415
- title="Review Swap"
419
+ metadata={{
420
+ title: "Review Swap",
421
+ description: undefined,
422
+ }}
416
423
  confirmButtonLabel="Swap"
417
424
  client={props.client}
418
425
  onBack={() => {
@@ -434,10 +441,9 @@ function SwapWidgetContent(props: SwapWidgetProps) {
434
441
  action: screen.mode,
435
442
  }}
436
443
  preparedQuote={screen.preparedQuote}
437
- uiOptions={{
438
- destinationToken: screen.buyToken,
444
+ currency={props.currency}
445
+ modeInfo={{
439
446
  mode: "fund_wallet",
440
- currency: props.currency,
441
447
  }}
442
448
  />
443
449
  );
@@ -487,11 +493,7 @@ function SwapWidgetContent(props: SwapWidgetProps) {
487
493
  });
488
494
  }}
489
495
  preparedQuote={screen.preparedQuote}
490
- uiOptions={{
491
- destinationToken: screen.buyToken,
492
- mode: "fund_wallet",
493
- currency: props.currency,
494
- }}
496
+ showContinueWithTx={false}
495
497
  windowAdapter={webWindowAdapter}
496
498
  hasPaymentId={false} // TODO Question: Do we need to expose this as prop?
497
499
  />