thirdweb 5.30.0-nightly-e7434891354f351d2a399daebdddae9cf1fc817b-20240623000619 → 5.30.0-nightly-3979ff0238ae9b3a0a216e6c2d562eb7206a9fe8-20240626085813

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (479) hide show
  1. package/dist/cjs/auth/verifySignature.js +15 -1
  2. package/dist/cjs/auth/verifySignature.js.map +1 -1
  3. package/dist/cjs/exports/extensions/erc1155.js +3 -1
  4. package/dist/cjs/exports/extensions/erc1155.js.map +1 -1
  5. package/dist/cjs/exports/transaction.js +3 -1
  6. package/dist/cjs/exports/transaction.js.map +1 -1
  7. package/dist/cjs/react/core/design-system/index.js +2 -0
  8. package/dist/cjs/react/core/design-system/index.js.map +1 -1
  9. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +12 -24
  10. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  11. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +4 -6
  12. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
  13. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +12 -14
  14. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
  15. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +31 -28
  16. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  17. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js +7 -5
  18. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
  19. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +15 -17
  20. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
  21. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +11 -13
  22. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +1 -1
  23. package/dist/cjs/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js +1 -4
  24. package/dist/cjs/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js.map +1 -1
  25. package/dist/cjs/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.js +4 -6
  26. package/dist/cjs/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.js.map +1 -1
  27. package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +8 -11
  28. package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
  29. package/dist/cjs/react/web/ui/ConnectWallet/Modal/TOS.js +1 -3
  30. package/dist/cjs/react/web/ui/ConnectWallet/Modal/TOS.js.map +1 -1
  31. package/dist/cjs/react/web/ui/ConnectWallet/Modal/screen.js +5 -9
  32. package/dist/cjs/react/web/ui/ConnectWallet/Modal/screen.js.map +1 -1
  33. package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js +2 -2
  34. package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
  35. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js +2 -4
  36. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
  37. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +24 -30
  38. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  39. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +114 -86
  40. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  41. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +25 -0
  42. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +1 -0
  43. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +1 -1
  44. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +1 -1
  45. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +7 -3
  46. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  47. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -2
  48. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  49. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +4 -11
  50. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
  51. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +3 -16
  52. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +1 -1
  53. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +0 -3
  54. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
  55. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +4 -6
  56. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +1 -1
  57. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +2 -2
  58. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  59. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +2 -2
  60. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  61. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.js +2 -2
  62. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.js.map +1 -1
  63. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js +2 -2
  64. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js.map +1 -1
  65. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js +7 -0
  66. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -0
  67. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +2 -4
  68. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  69. package/dist/cjs/react/web/ui/ConnectWallet/screens/StartScreen.js +7 -9
  70. package/dist/cjs/react/web/ui/ConnectWallet/screens/StartScreen.js.map +1 -1
  71. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js +1 -1
  72. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  73. package/dist/cjs/react/web/ui/ConnectWallet/useConnectModal.js +23 -27
  74. package/dist/cjs/react/web/ui/ConnectWallet/useConnectModal.js.map +1 -1
  75. package/dist/cjs/react/web/ui/PayEmbed.js +1 -0
  76. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  77. package/dist/cjs/react/web/ui/components/ChainName.js +12 -1
  78. package/dist/cjs/react/web/ui/components/ChainName.js.map +1 -1
  79. package/dist/cjs/react/web/ui/components/basic.js +1 -1
  80. package/dist/cjs/react/web/ui/components/basic.js.map +1 -1
  81. package/dist/cjs/react/web/ui/components/buttons.js +6 -0
  82. package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
  83. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +6 -8
  84. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
  85. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletFormUI.js +5 -7
  86. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletFormUI.js.map +1 -1
  87. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +6 -8
  88. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  89. package/dist/cjs/react/web/wallets/in-app/InAppWalletFormUI.js +8 -11
  90. package/dist/cjs/react/web/wallets/in-app/InAppWalletFormUI.js.map +1 -1
  91. package/dist/cjs/react/web/wallets/in-app/InAppWalletSelectionUI.js +5 -7
  92. package/dist/cjs/react/web/wallets/in-app/InAppWalletSelectionUI.js.map +1 -1
  93. package/dist/cjs/react/web/wallets/in-app/useInAppWalletLocale.js +5 -5
  94. package/dist/cjs/react/web/wallets/in-app/useInAppWalletLocale.js.map +1 -1
  95. package/dist/cjs/react/web/wallets/shared/CoinbaseSDKConnection.js +4 -6
  96. package/dist/cjs/react/web/wallets/shared/CoinbaseSDKConnection.js.map +1 -1
  97. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +7 -9
  98. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  99. package/dist/cjs/react/web/wallets/shared/ConnectingScreen.js +3 -5
  100. package/dist/cjs/react/web/wallets/shared/ConnectingScreen.js.map +1 -1
  101. package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js +4 -6
  102. package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
  103. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +8 -10
  104. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  105. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +2 -4
  106. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  107. package/dist/cjs/react/web/wallets/shared/SocialLogin.js +3 -6
  108. package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
  109. package/dist/cjs/react/web/wallets/shared/WalletConnectConnection.js +24 -27
  110. package/dist/cjs/react/web/wallets/shared/WalletConnectConnection.js.map +1 -1
  111. package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
  112. package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
  113. package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js +2 -2
  114. package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
  115. package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
  116. package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
  117. package/dist/cjs/react/web/wallets/walletConnect/locale.js +3 -3
  118. package/dist/cjs/react/web/wallets/walletConnect/locale.js.map +1 -1
  119. package/dist/cjs/transaction/actions/gasless/send-gasless-transaction.js +14 -4
  120. package/dist/cjs/transaction/actions/gasless/send-gasless-transaction.js.map +1 -1
  121. package/dist/cjs/transaction/actions/send-transaction.js +7 -0
  122. package/dist/cjs/transaction/actions/send-transaction.js.map +1 -1
  123. package/dist/cjs/transaction/transaction-store.js +33 -0
  124. package/dist/cjs/transaction/transaction-store.js.map +1 -0
  125. package/dist/cjs/version.js +1 -1
  126. package/dist/cjs/wallets/in-app/web/utils/Storage/LocalStorage.js.map +1 -1
  127. package/dist/cjs/wallets/wallet-connect/controller.js +7 -3
  128. package/dist/cjs/wallets/wallet-connect/controller.js.map +1 -1
  129. package/dist/esm/auth/verifySignature.js +15 -1
  130. package/dist/esm/auth/verifySignature.js.map +1 -1
  131. package/dist/esm/exports/extensions/erc1155.js +1 -0
  132. package/dist/esm/exports/extensions/erc1155.js.map +1 -1
  133. package/dist/esm/exports/transaction.js +1 -0
  134. package/dist/esm/exports/transaction.js.map +1 -1
  135. package/dist/esm/react/core/design-system/index.js +2 -0
  136. package/dist/esm/react/core/design-system/index.js.map +1 -1
  137. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +12 -24
  138. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  139. package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +4 -6
  140. package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
  141. package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +12 -14
  142. package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
  143. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +31 -28
  144. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  145. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js +7 -5
  146. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
  147. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +16 -18
  148. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
  149. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +11 -13
  150. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +1 -1
  151. package/dist/esm/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js +1 -4
  152. package/dist/esm/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.js.map +1 -1
  153. package/dist/esm/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.js +4 -6
  154. package/dist/esm/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.js.map +1 -1
  155. package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +8 -11
  156. package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
  157. package/dist/esm/react/web/ui/ConnectWallet/Modal/TOS.js +1 -3
  158. package/dist/esm/react/web/ui/ConnectWallet/Modal/TOS.js.map +1 -1
  159. package/dist/esm/react/web/ui/ConnectWallet/Modal/screen.js +5 -9
  160. package/dist/esm/react/web/ui/ConnectWallet/Modal/screen.js.map +1 -1
  161. package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js +2 -2
  162. package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
  163. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js +2 -4
  164. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
  165. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +24 -30
  166. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  167. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +115 -87
  168. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  169. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +22 -0
  170. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +1 -0
  171. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +1 -1
  172. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +1 -1
  173. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +7 -3
  174. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  175. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -2
  176. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  177. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +4 -11
  178. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
  179. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +3 -16
  180. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +1 -1
  181. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +0 -3
  182. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
  183. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +4 -6
  184. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +1 -1
  185. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +2 -2
  186. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  187. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +2 -2
  188. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  189. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.js +2 -2
  190. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.js.map +1 -1
  191. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js +2 -2
  192. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js.map +1 -1
  193. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js +4 -0
  194. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -0
  195. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +2 -4
  196. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  197. package/dist/esm/react/web/ui/ConnectWallet/screens/StartScreen.js +7 -9
  198. package/dist/esm/react/web/ui/ConnectWallet/screens/StartScreen.js.map +1 -1
  199. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js +1 -1
  200. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  201. package/dist/esm/react/web/ui/ConnectWallet/useConnectModal.js +23 -27
  202. package/dist/esm/react/web/ui/ConnectWallet/useConnectModal.js.map +1 -1
  203. package/dist/esm/react/web/ui/PayEmbed.js +1 -0
  204. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  205. package/dist/esm/react/web/ui/components/ChainName.js +12 -1
  206. package/dist/esm/react/web/ui/components/ChainName.js.map +1 -1
  207. package/dist/esm/react/web/ui/components/basic.js +1 -1
  208. package/dist/esm/react/web/ui/components/basic.js.map +1 -1
  209. package/dist/esm/react/web/ui/components/buttons.js +6 -0
  210. package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
  211. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +7 -9
  212. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
  213. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletFormUI.js +5 -7
  214. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletFormUI.js.map +1 -1
  215. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +7 -9
  216. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  217. package/dist/esm/react/web/wallets/in-app/InAppWalletFormUI.js +8 -11
  218. package/dist/esm/react/web/wallets/in-app/InAppWalletFormUI.js.map +1 -1
  219. package/dist/esm/react/web/wallets/in-app/InAppWalletSelectionUI.js +6 -8
  220. package/dist/esm/react/web/wallets/in-app/InAppWalletSelectionUI.js.map +1 -1
  221. package/dist/esm/react/web/wallets/in-app/useInAppWalletLocale.js +5 -5
  222. package/dist/esm/react/web/wallets/in-app/useInAppWalletLocale.js.map +1 -1
  223. package/dist/esm/react/web/wallets/shared/CoinbaseSDKConnection.js +4 -6
  224. package/dist/esm/react/web/wallets/shared/CoinbaseSDKConnection.js.map +1 -1
  225. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +7 -9
  226. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  227. package/dist/esm/react/web/wallets/shared/ConnectingScreen.js +3 -5
  228. package/dist/esm/react/web/wallets/shared/ConnectingScreen.js.map +1 -1
  229. package/dist/esm/react/web/wallets/shared/GetStartedScreen.js +4 -6
  230. package/dist/esm/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
  231. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +8 -10
  232. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  233. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +2 -4
  234. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  235. package/dist/esm/react/web/wallets/shared/SocialLogin.js +3 -6
  236. package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
  237. package/dist/esm/react/web/wallets/shared/WalletConnectConnection.js +24 -27
  238. package/dist/esm/react/web/wallets/shared/WalletConnectConnection.js.map +1 -1
  239. package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
  240. package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
  241. package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js +1 -1
  242. package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
  243. package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
  244. package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
  245. package/dist/esm/react/web/wallets/walletConnect/locale.js +3 -3
  246. package/dist/esm/react/web/wallets/walletConnect/locale.js.map +1 -1
  247. package/dist/esm/transaction/actions/gasless/send-gasless-transaction.js +14 -4
  248. package/dist/esm/transaction/actions/gasless/send-gasless-transaction.js.map +1 -1
  249. package/dist/esm/transaction/actions/send-transaction.js +7 -0
  250. package/dist/esm/transaction/actions/send-transaction.js.map +1 -1
  251. package/dist/esm/transaction/transaction-store.js +29 -0
  252. package/dist/esm/transaction/transaction-store.js.map +1 -0
  253. package/dist/esm/version.js +1 -1
  254. package/dist/esm/wallets/in-app/web/utils/Storage/LocalStorage.js.map +1 -1
  255. package/dist/esm/wallets/wallet-connect/controller.js +7 -3
  256. package/dist/esm/wallets/wallet-connect/controller.js.map +1 -1
  257. package/dist/types/auth/verifySignature.d.ts +0 -20
  258. package/dist/types/auth/verifySignature.d.ts.map +1 -1
  259. package/dist/types/exports/extensions/erc1155.d.ts +1 -0
  260. package/dist/types/exports/extensions/erc1155.d.ts.map +1 -1
  261. package/dist/types/exports/transaction.d.ts +1 -0
  262. package/dist/types/exports/transaction.d.ts.map +1 -1
  263. package/dist/types/react/core/design-system/index.d.ts +2 -0
  264. package/dist/types/react/core/design-system/index.d.ts.map +1 -1
  265. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
  266. package/dist/types/react/web/ui/ConnectWallet/ConnectButtonProps.d.ts +2 -2
  267. package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts +7 -0
  268. package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts.map +1 -1
  269. package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts +20 -0
  270. package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts.map +1 -1
  271. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
  272. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts +32 -0
  273. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts.map +1 -1
  274. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts +32 -0
  275. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts.map +1 -1
  276. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalInline.d.ts +31 -2
  277. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalInline.d.ts.map +1 -1
  278. package/dist/types/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.d.ts +2 -0
  279. package/dist/types/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.d.ts.map +1 -1
  280. package/dist/types/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.d.ts +5 -0
  281. package/dist/types/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.d.ts.map +1 -1
  282. package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts +20 -0
  283. package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts.map +1 -1
  284. package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts +2 -0
  285. package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts.map +1 -1
  286. package/dist/types/react/web/ui/ConnectWallet/Modal/screen.d.ts +6 -1
  287. package/dist/types/react/web/ui/ConnectWallet/Modal/screen.d.ts.map +1 -1
  288. package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts.map +1 -1
  289. package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts +6 -0
  290. package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
  291. package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts +25 -0
  292. package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
  293. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  294. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts +14 -0
  295. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts.map +1 -0
  296. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
  297. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +9 -5
  298. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts.map +1 -1
  299. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts +2 -3
  300. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts.map +1 -1
  301. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts +2 -2
  302. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts.map +1 -1
  303. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +0 -2
  304. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
  305. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts.map +1 -1
  306. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
  307. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
  308. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts +2 -0
  309. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts.map +1 -0
  310. package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts.map +1 -1
  311. package/dist/types/react/web/ui/ConnectWallet/screens/StartScreen.d.ts +13 -1
  312. package/dist/types/react/web/ui/ConnectWallet/screens/StartScreen.d.ts.map +1 -1
  313. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts +1 -0
  314. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
  315. package/dist/types/react/web/ui/ConnectWallet/useConnectModal.d.ts.map +1 -1
  316. package/dist/types/react/web/ui/PayEmbed.d.ts +1 -0
  317. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  318. package/dist/types/react/web/ui/components/ChainName.d.ts +1 -0
  319. package/dist/types/react/web/ui/components/ChainName.d.ts.map +1 -1
  320. package/dist/types/react/web/ui/components/basic.d.ts +1 -0
  321. package/dist/types/react/web/ui/components/basic.d.ts.map +1 -1
  322. package/dist/types/react/web/ui/components/buttons.d.ts +2 -1
  323. package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
  324. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts +16 -0
  325. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
  326. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts +16 -2
  327. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts.map +1 -1
  328. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +16 -0
  329. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
  330. package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts +16 -2
  331. package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts.map +1 -1
  332. package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts +10 -0
  333. package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts.map +1 -1
  334. package/dist/types/react/web/wallets/in-app/useInAppWalletLocale.d.ts +3 -2
  335. package/dist/types/react/web/wallets/in-app/useInAppWalletLocale.d.ts.map +1 -1
  336. package/dist/types/react/web/wallets/shared/CoinbaseSDKConnection.d.ts +6 -1
  337. package/dist/types/react/web/wallets/shared/CoinbaseSDKConnection.d.ts.map +1 -1
  338. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +7 -2
  339. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  340. package/dist/types/react/web/wallets/shared/ConnectingScreen.d.ts +3 -0
  341. package/dist/types/react/web/wallets/shared/ConnectingScreen.d.ts.map +1 -1
  342. package/dist/types/react/web/wallets/shared/GetStartedScreen.d.ts +2 -0
  343. package/dist/types/react/web/wallets/shared/GetStartedScreen.d.ts.map +1 -1
  344. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts +7 -2
  345. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
  346. package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts +5 -0
  347. package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
  348. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts +7 -2
  349. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
  350. package/dist/types/react/web/wallets/shared/WalletConnectConnection.d.ts +16 -0
  351. package/dist/types/react/web/wallets/shared/WalletConnectConnection.d.ts.map +1 -1
  352. package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
  353. package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
  354. package/dist/types/react/web/wallets/shared/locale/getConnectLocale.d.ts +2 -2
  355. package/dist/types/react/web/wallets/shared/locale/getConnectLocale.d.ts.map +1 -1
  356. package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
  357. package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
  358. package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -1
  359. package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
  360. package/dist/types/transaction/actions/gasless/send-gasless-transaction.d.ts.map +1 -1
  361. package/dist/types/transaction/actions/send-transaction.d.ts.map +1 -1
  362. package/dist/types/transaction/actions/zksync/getEip721Domain.d.ts +3 -3
  363. package/dist/types/transaction/prepare-transaction.d.ts +3 -3
  364. package/dist/types/transaction/transaction-store.d.ts +22 -0
  365. package/dist/types/transaction/transaction-store.d.ts.map +1 -0
  366. package/dist/types/version.d.ts +1 -1
  367. package/dist/types/wallets/in-app/web/utils/Storage/LocalStorage.d.ts.map +1 -1
  368. package/package.json +4 -1
  369. package/src/auth/verifySignature.ts +16 -1
  370. package/src/exports/extensions/erc1155.ts +4 -0
  371. package/src/exports/transaction.ts +1 -0
  372. package/src/extensions/airdrop/write/airdropERC1155WithSignature.test.ts +8 -9
  373. package/src/extensions/airdrop/write/airdropERC20WithSignature.test.ts +9 -10
  374. package/src/extensions/airdrop/write/airdropERC721WithSignature.test.ts +5 -5
  375. package/src/extensions/airdrop/write/claimERC1155.test.ts +6 -6
  376. package/src/extensions/airdrop/write/claimERC20.test.ts +7 -7
  377. package/src/extensions/airdrop/write/claimERC721.test.ts +6 -6
  378. package/src/react/core/design-system/index.ts +2 -0
  379. package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +35 -33
  380. package/src/react/web/ui/ConnectWallet/ConnectButtonProps.ts +2 -2
  381. package/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +13 -6
  382. package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +58 -4
  383. package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +97 -38
  384. package/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx +56 -4
  385. package/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx +98 -30
  386. package/src/react/web/ui/ConnectWallet/Modal/ConnectModalInline.tsx +100 -15
  387. package/src/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.tsx +3 -5
  388. package/src/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.tsx +10 -5
  389. package/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx +43 -10
  390. package/src/react/web/ui/ConnectWallet/Modal/TOS.tsx +3 -3
  391. package/src/react/web/ui/ConnectWallet/Modal/screen.tsx +10 -12
  392. package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +2 -1
  393. package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +14 -6
  394. package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +112 -33
  395. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +411 -204
  396. package/src/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.tsx +45 -0
  397. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.tsx +1 -1
  398. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +7 -3
  399. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +12 -12
  400. package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +14 -5
  401. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts +6 -15
  402. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +3 -28
  403. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +2 -3
  404. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.tsx +4 -6
  405. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +2 -2
  406. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +2 -2
  407. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistoryButton.tsx +2 -2
  408. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.tsx +2 -2
  409. package/src/react/web/ui/ConnectWallet/screens/Buy/utils.ts +3 -0
  410. package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +2 -3
  411. package/src/react/web/ui/ConnectWallet/screens/StartScreen.tsx +23 -14
  412. package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +5 -1
  413. package/src/react/web/ui/ConnectWallet/useConnectModal.tsx +44 -39
  414. package/src/react/web/ui/PayEmbed-disconnected.test.tsx +15 -0
  415. package/src/react/web/ui/PayEmbed.test.tsx +33 -6
  416. package/src/react/web/ui/PayEmbed.tsx +3 -0
  417. package/src/react/web/ui/components/ChainName.tsx +18 -1
  418. package/src/react/web/ui/components/basic.tsx +2 -1
  419. package/src/react/web/ui/components/buttons.tsx +8 -0
  420. package/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx +33 -5
  421. package/src/react/web/wallets/ecosystem/EcosystemWalletFormUI.tsx +25 -12
  422. package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +34 -6
  423. package/src/react/web/wallets/in-app/InAppWalletFormUI.tsx +44 -23
  424. package/src/react/web/wallets/in-app/InAppWalletSelectionUI.tsx +20 -6
  425. package/src/react/web/wallets/in-app/useInAppWalletLocale.ts +10 -7
  426. package/src/react/web/wallets/shared/CoinbaseSDKConnection.tsx +12 -9
  427. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +14 -11
  428. package/src/react/web/wallets/shared/ConnectingScreen.tsx +7 -5
  429. package/src/react/web/wallets/shared/GetStartedScreen.tsx +7 -4
  430. package/src/react/web/wallets/shared/OTPLoginUI.tsx +15 -12
  431. package/src/react/web/wallets/shared/PassKeyLogin.tsx +5 -4
  432. package/src/react/web/wallets/shared/SocialLogin.tsx +11 -8
  433. package/src/react/web/wallets/shared/WalletConnectConnection.tsx +48 -27
  434. package/src/react/web/wallets/shared/locale/en.ts +2 -2
  435. package/src/react/web/wallets/shared/locale/es.ts +2 -2
  436. package/src/react/web/wallets/shared/locale/getConnectLocale.ts +3 -3
  437. package/src/react/web/wallets/shared/locale/ja.ts +2 -2
  438. package/src/react/web/wallets/shared/locale/tl.ts +2 -2
  439. package/src/react/web/wallets/shared/locale/types.ts +1 -1
  440. package/src/react/web/wallets/walletConnect/locale.ts +3 -3
  441. package/src/rpc/actions/eth_getLogs.test.ts +3 -2
  442. package/src/transaction/actions/gasless/send-gasless-transaction.ts +15 -4
  443. package/src/transaction/actions/send-transaction.test.ts +22 -1
  444. package/src/transaction/actions/send-transaction.ts +7 -0
  445. package/src/transaction/actions/zksync/getEip721Domain.ts +4 -4
  446. package/src/transaction/prepare-transaction.ts +3 -3
  447. package/src/transaction/transaction-store.test.ts +51 -0
  448. package/src/transaction/transaction-store.ts +46 -0
  449. package/src/version.ts +1 -1
  450. package/src/wallets/in-app/web/utils/Storage/LocalStorage.ts +4 -1
  451. package/src/wallets/wallet-connect/controller.ts +8 -3
  452. package/dist/cjs/react/core/hooks/others/useWalletConnectionCtx.js +0 -16
  453. package/dist/cjs/react/core/hooks/others/useWalletConnectionCtx.js.map +0 -1
  454. package/dist/cjs/react/core/providers/wallet-connection.js +0 -7
  455. package/dist/cjs/react/core/providers/wallet-connection.js.map +0 -1
  456. package/dist/cjs/react/web/ui/ConnectWallet/icons/CryptoIcon.js +0 -12
  457. package/dist/cjs/react/web/ui/ConnectWallet/icons/CryptoIcon.js.map +0 -1
  458. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.js +0 -44
  459. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.js.map +0 -1
  460. package/dist/esm/react/core/hooks/others/useWalletConnectionCtx.js +0 -13
  461. package/dist/esm/react/core/hooks/others/useWalletConnectionCtx.js.map +0 -1
  462. package/dist/esm/react/core/providers/wallet-connection.js +0 -4
  463. package/dist/esm/react/core/providers/wallet-connection.js.map +0 -1
  464. package/dist/esm/react/web/ui/ConnectWallet/icons/CryptoIcon.js +0 -8
  465. package/dist/esm/react/web/ui/ConnectWallet/icons/CryptoIcon.js.map +0 -1
  466. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.js +0 -41
  467. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.js.map +0 -1
  468. package/dist/types/react/core/hooks/others/useWalletConnectionCtx.d.ts +0 -29
  469. package/dist/types/react/core/hooks/others/useWalletConnectionCtx.d.ts.map +0 -1
  470. package/dist/types/react/core/providers/wallet-connection.d.ts +0 -35
  471. package/dist/types/react/core/providers/wallet-connection.d.ts.map +0 -1
  472. package/dist/types/react/web/ui/ConnectWallet/icons/CryptoIcon.d.ts +0 -6
  473. package/dist/types/react/web/ui/ConnectWallet/icons/CryptoIcon.d.ts.map +0 -1
  474. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.d.ts +0 -8
  475. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.d.ts.map +0 -1
  476. package/src/react/core/hooks/others/useWalletConnectionCtx.ts +0 -15
  477. package/src/react/core/providers/wallet-connection.tsx +0 -37
  478. package/src/react/web/ui/ConnectWallet/icons/CryptoIcon.tsx +0 -50
  479. package/src/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.tsx +0 -72
@@ -1,3 +1,4 @@
1
+ import { IdCardIcon } from "@radix-ui/react-icons";
1
2
  import { useMemo, useState } from "react";
2
3
  import type { Chain } from "../../../../../../chains/types.js";
3
4
  import type { ThirdwebClient } from "../../../../../../client/client.js";
@@ -10,6 +11,7 @@ import type { Account } from "../../../../../../wallets/interfaces/wallet.js";
10
11
  import {
11
12
  type Theme,
12
13
  fontSize,
14
+ iconSize,
13
15
  spacing,
14
16
  } from "../../../../../core/design-system/index.js";
15
17
  import {
@@ -22,6 +24,7 @@ import { useBuyWithFiatQuote } from "../../../../../core/hooks/pay/useBuyWithFia
22
24
  import { useActiveAccount } from "../../../../hooks/wallets/useActiveAccount.js";
23
25
  import { useActiveWalletChain } from "../../../../hooks/wallets/useActiveWalletChain.js";
24
26
  import { LoadingScreen } from "../../../../wallets/shared/LoadingScreen.js";
27
+ import { ChainName } from "../../../components/ChainName.js";
25
28
  import {
26
29
  Drawer,
27
30
  DrawerOverlay,
@@ -36,9 +39,11 @@ import { TokenIcon } from "../../../components/TokenIcon.js";
36
39
  import { Container, Line, ModalHeader } from "../../../components/basic.js";
37
40
  import { Button } from "../../../components/buttons.js";
38
41
  import { Text } from "../../../components/text.js";
42
+ import { TokenSymbol } from "../../../components/token/TokenSymbol.js";
39
43
  import type { PayUIOptions } from "../../ConnectButtonProps.js";
40
44
  import { ChainButton, NetworkSelectorContent } from "../../NetworkSelector.js";
41
45
  import type { SupportedTokens } from "../../defaultTokens.js";
46
+ import { CoinsIcon } from "../../icons/CoinsIcon.js";
42
47
  import type { ConnectLocale } from "../../locale/types.js";
43
48
  import { TokenSelector } from "../TokenSelector.js";
44
49
  import {
@@ -47,8 +52,8 @@ import {
47
52
  isNativeToken,
48
53
  } from "../nativeToken.js";
49
54
  import { EstimatedTimeAndFees } from "./EstimatedTimeAndFees.js";
55
+ import { PayTokenIcon } from "./PayTokenIcon.js";
50
56
  import { PayWithCreditCard } from "./PayWIthCreditCard.js";
51
- import { PaymentSelection } from "./PaymentSelection.js";
52
57
  import { CurrencySelection } from "./fiat/CurrencySelection.js";
53
58
  import { FiatFlow } from "./fiat/FiatFlow.js";
54
59
  import type { CurrencyMeta } from "./fiat/currencies.js";
@@ -119,19 +124,9 @@ type BuyScreenContentProps = {
119
124
  isEmbed: boolean;
120
125
  };
121
126
 
122
- function useBuyScreenStates(options: { payOptions: PayUIOptions }) {
123
- const { payOptions } = options;
124
-
125
- const [method, setMethod] = useState<"crypto" | "creditCard">(
126
- payOptions.buyWithCrypto === false
127
- ? "creditCard"
128
- : payOptions.buyWithFiat === false
129
- ? "crypto"
130
- : "creditCard",
131
- );
132
-
127
+ function useBuyScreenStates() {
133
128
  const [screen, setScreen] = useState<SelectedScreen>({
134
- type: "main",
129
+ id: "main",
135
130
  });
136
131
 
137
132
  const [drawerScreen, setDrawerScreen] = useState<React.ReactNode>();
@@ -143,15 +138,7 @@ function useBuyScreenStates(options: { payOptions: PayUIOptions }) {
143
138
  });
144
139
  }
145
140
 
146
- function showMainScreen() {
147
- setScreen({
148
- type: "main",
149
- });
150
- }
151
-
152
141
  return {
153
- method,
154
- setMethod,
155
142
  screen,
156
143
  setScreen,
157
144
  drawerScreen,
@@ -159,7 +146,6 @@ function useBuyScreenStates(options: { payOptions: PayUIOptions }) {
159
146
  drawerRef,
160
147
  drawerOverlayRef,
161
148
  closeDrawer,
162
- showMainScreen,
163
149
  };
164
150
  }
165
151
 
@@ -178,8 +164,6 @@ function BuyScreenContent(props: BuyScreenContentProps) {
178
164
 
179
165
  // screen
180
166
  const {
181
- method,
182
- setMethod,
183
167
  screen,
184
168
  setScreen,
185
169
  drawerScreen,
@@ -187,15 +171,12 @@ function BuyScreenContent(props: BuyScreenContentProps) {
187
171
  drawerRef,
188
172
  drawerOverlayRef,
189
173
  closeDrawer,
190
- showMainScreen,
191
- } = useBuyScreenStates({ payOptions });
174
+ } = useBuyScreenStates();
192
175
 
193
176
  // UI selection
194
177
  const {
195
178
  tokenAmount,
196
179
  setTokenAmount,
197
- setHasEditedAmount,
198
- hasEditedAmount,
199
180
  toChain,
200
181
  setToChain,
201
182
  deferredTokenAmount,
@@ -213,17 +194,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
213
194
  supportedDestinations,
214
195
  });
215
196
 
216
- // Buy Transaction flow states
217
- const { amountNeeded } = useBuyTxStates({
218
- setTokenAmount,
219
- buyForTx,
220
- hasEditedAmount,
221
- isMainScreen: screen.type === "main",
222
- account,
223
- });
224
-
225
197
  // check if the screen is expanded or not
226
- const isExpanded = activeChain && tokenAmount;
227
198
 
228
199
  // update supportedSources whenever toToken or toChain is updated
229
200
  const supportedSourcesQuery = useBuySupportedSources({
@@ -254,35 +225,28 @@ function BuyScreenContent(props: BuyScreenContentProps) {
254
225
  );
255
226
  }, [props.supportedTokens, supportedSourcesQuery.data, payOptions]);
256
227
 
257
- const { showPaymentSelection } = useEnabledPaymentMethods({
258
- payOptions,
259
- supportedDestinations,
260
- toChain,
261
- toToken,
262
- method,
263
- setMethod,
264
- });
265
-
266
228
  // screens ----------------------------
267
229
 
268
- if (screen.type === "node") {
230
+ if (screen.id === "node") {
269
231
  return screen.node;
270
232
  }
271
233
 
272
- if (screen.type === "select-currency") {
234
+ if (screen.id === "select-currency") {
235
+ const goBack = () => setScreen(screen.backScreen);
273
236
  return (
274
237
  <CurrencySelection
275
238
  onSelect={(currency) => {
276
- showMainScreen();
239
+ goBack();
277
240
  setSelectedCurrency(currency);
278
241
  }}
279
- onBack={showMainScreen}
242
+ onBack={goBack}
280
243
  />
281
244
  );
282
245
  }
283
246
 
284
- if (screen.type === "screen-id" && screen.name === "select-to-token") {
247
+ if (screen.id === "select-to-token") {
285
248
  const chains = supportedDestinations.map((x) => x.chain);
249
+ const goBack = () => setScreen(screen.backScreen);
286
250
  // if token selection is disabled - only show network selector screen
287
251
  if (payOptions.prefillBuy?.allowEdits?.token === false) {
288
252
  return (
@@ -291,21 +255,21 @@ function BuyScreenContent(props: BuyScreenContentProps) {
291
255
  client={props.client}
292
256
  connectLocale={props.connectLocale}
293
257
  setChain={setToChain}
294
- showMainScreen={showMainScreen}
258
+ goBack={goBack}
295
259
  />
296
260
  );
297
261
  }
298
262
 
299
263
  return (
300
264
  <TokenSelector
301
- onBack={showMainScreen}
265
+ onBack={goBack}
302
266
  tokenList={(
303
267
  (toChain?.id ? destinationSupportedTokens[toChain.id] : undefined) ||
304
268
  []
305
269
  ).filter((x) => x.address !== NATIVE_TOKEN_ADDRESS)}
306
270
  onTokenSelect={(tokenInfo) => {
307
271
  setToToken(tokenInfo);
308
- showMainScreen();
272
+ goBack();
309
273
  }}
310
274
  chain={toChain}
311
275
  chainSelection={
@@ -321,17 +285,18 @@ function BuyScreenContent(props: BuyScreenContentProps) {
321
285
  }
322
286
  connectLocale={connectLocale}
323
287
  client={client}
288
+ modalTitle="Buy"
324
289
  />
325
290
  );
326
291
  }
327
292
 
328
293
  if (
329
- screen.type === "screen-id" &&
330
- screen.name === "select-from-token" &&
294
+ screen.id === "select-from-token" &&
331
295
  supportedSourcesQuery.data &&
332
296
  sourceSupportedTokens
333
297
  ) {
334
298
  const chains = supportedSourcesQuery.data.map((x) => x.chain);
299
+ const goBack = () => setScreen(screen.backScreen);
335
300
  // if token selection is disabled - only show network selector screen
336
301
  if (
337
302
  payOptions.buyWithCrypto !== false &&
@@ -343,23 +308,21 @@ function BuyScreenContent(props: BuyScreenContentProps) {
343
308
  client={props.client}
344
309
  connectLocale={props.connectLocale}
345
310
  setChain={setFromChain}
346
- showMainScreen={showMainScreen}
311
+ goBack={goBack}
347
312
  />
348
313
  );
349
314
  }
350
315
 
351
316
  return (
352
317
  <TokenSelector
353
- onBack={showMainScreen}
318
+ onBack={goBack}
354
319
  tokenList={(
355
320
  (fromChain?.id ? sourceSupportedTokens[fromChain.id] : undefined) ||
356
321
  []
357
322
  ).filter((x) => x.address !== NATIVE_TOKEN_ADDRESS)}
358
323
  onTokenSelect={(tokenInfo) => {
359
324
  setFromToken(tokenInfo);
360
- setScreen({
361
- type: "main",
362
- });
325
+ goBack();
363
326
  }}
364
327
  chain={fromChain}
365
328
  chainSelection={
@@ -374,6 +337,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
374
337
  }
375
338
  connectLocale={connectLocale}
376
339
  client={client}
340
+ modalTitle="Pay with"
377
341
  />
378
342
  );
379
343
  }
@@ -404,74 +368,51 @@ function BuyScreenContent(props: BuyScreenContentProps) {
404
368
  </>
405
369
  )}
406
370
 
407
- <Container
408
- p="lg"
409
- style={{
410
- paddingBottom: 0,
411
- }}
412
- >
413
- <ModalHeader
414
- title={
415
- props.buyForTx
416
- ? `Not enough ${props.buyForTx.tokenSymbol}`
417
- : "Buy"
371
+ {screen.id === "main" && (
372
+ <MainScreen
373
+ account={account || null}
374
+ buyForTx={buyForTx || null}
375
+ client={client}
376
+ onSelectBuyToken={() =>
377
+ setScreen({ id: "select-to-token", backScreen: screen })
418
378
  }
419
- onBack={props.onBack}
379
+ payOptions={payOptions}
380
+ setTokenAmount={setTokenAmount}
381
+ toChain={toChain}
382
+ toToken={toToken}
383
+ tokenAmount={tokenAmount}
384
+ connectButton={props.connectButton}
385
+ onViewPendingTx={props.onViewPendingTx}
386
+ setScreen={setScreen}
387
+ supportedDestinations={supportedDestinations}
420
388
  />
389
+ )}
421
390
 
422
- <Spacer y="lg" />
423
- {!isExpanded && <Spacer y="xl" />}
424
-
425
- {/* Amount needed for Send Tx */}
426
- {amountNeeded && props.buyForTx ? (
427
- <BuyForTxUI
428
- amountNeeded={String(
429
- formatNumber(Number(toEther(amountNeeded)), 4),
430
- )}
431
- buyForTx={props.buyForTx}
432
- client={client}
433
- />
434
- ) : null}
435
-
436
- {/* To */}
437
- <BuyTokenInput
438
- value={tokenAmount}
439
- onChange={async (value) => {
440
- setHasEditedAmount(true);
441
- setTokenAmount(value);
442
- }}
443
- freezeAmount={payOptions.prefillBuy?.allowEdits?.amount === false}
444
- freezeChainAndToken={
445
- payOptions.prefillBuy?.allowEdits?.chain === false &&
446
- payOptions.prefillBuy?.allowEdits?.token === false
447
- }
448
- token={toToken}
449
- chain={toChain}
450
- onSelectToken={() => {
451
- setScreen({
452
- type: "screen-id",
453
- name: "select-to-token",
454
- });
391
+ {(screen.id === "select-payment-method" ||
392
+ screen.id === "buy-with-crypto" ||
393
+ screen.id === "buy-with-fiat") && (
394
+ <TokenSelectedLayout
395
+ selectedChain={toChain}
396
+ selectedToken={toToken}
397
+ tokenAmount={tokenAmount}
398
+ client={client}
399
+ onBack={() => {
400
+ if (
401
+ screen.id === "buy-with-crypto" ||
402
+ screen.id === "buy-with-fiat"
403
+ ) {
404
+ setScreen({ id: "select-payment-method" });
405
+ } else if (screen.id === "select-payment-method") {
406
+ setScreen({ id: "main" });
407
+ }
455
408
  }}
456
- client={props.client}
457
- hideTokenSelector={!!props.buyForTx}
458
- />
459
- </Container>
460
-
461
- {showPaymentSelection ? <Spacer y="lg" /> : <Spacer y="md" />}
462
-
463
- {isExpanded && (
464
- <>
465
- {showPaymentSelection && (
466
- <Container px="lg">
467
- <PaymentSelection selected={method} onSelect={setMethod} />
468
- <Spacer y="md" />
469
- </Container>
409
+ >
410
+ {screen.id === "select-payment-method" && (
411
+ <PaymentMethodSelection setScreen={(id) => setScreen({ id })} />
470
412
  )}
471
413
 
472
- {method === "crypto" && account && activeChain && (
414
+ {screen.id === "buy-with-crypto" && account && activeChain && (
473
415
  <SwapScreenContent
474
- {...props}
475
416
  setScreen={setScreen}
476
417
  setDrawerScreen={setDrawerScreen}
477
418
  tokenAmount={deferredTokenAmount}
@@ -481,91 +422,354 @@ function BuyScreenContent(props: BuyScreenContentProps) {
481
422
  fromToken={fromToken}
482
423
  showFromTokenSelector={() => {
483
424
  setScreen({
484
- type: "screen-id",
485
- name: "select-from-token",
425
+ id: "select-from-token",
426
+ backScreen: screen,
486
427
  });
487
428
  }}
488
429
  account={account}
489
430
  activeChain={activeChain}
431
+ buyForTx={buyForTx || null}
432
+ client={client}
433
+ isEmbed={props.isEmbed}
434
+ onDone={props.onDone}
435
+ onViewPendingTx={props.onViewPendingTx}
436
+ payOptions={payOptions}
490
437
  />
491
438
  )}
492
439
 
493
- {method === "creditCard" && account && (
440
+ {screen.id === "buy-with-fiat" && account && activeChain && (
494
441
  <FiatScreenContent
495
- {...props}
496
442
  setScreen={setScreen}
497
443
  setDrawerScreen={setDrawerScreen}
498
444
  tokenAmount={deferredTokenAmount}
499
445
  toChain={toChain}
500
446
  toToken={toToken}
501
- closeDrawer={closeDrawer}
502
447
  selectedCurrency={selectedCurrency}
448
+ buyForTx={buyForTx || null}
449
+ client={client}
450
+ isEmbed={props.isEmbed}
451
+ onDone={props.onDone}
452
+ onViewPendingTx={props.onViewPendingTx}
453
+ payOptions={payOptions}
454
+ theme={props.theme}
503
455
  showCurrencySelector={() => {
504
456
  setScreen({
505
- type: "select-currency",
457
+ id: "select-currency",
458
+ backScreen: screen,
506
459
  });
507
460
  }}
508
461
  account={account}
509
462
  />
510
463
  )}
464
+ </TokenSelectedLayout>
465
+ )}
466
+ </div>
467
+ </Container>
468
+ );
469
+ }
511
470
 
512
- <Spacer y="sm" />
513
- </>
471
+ function SelectedTokenInfo(props: {
472
+ selectedToken: ERC20OrNativeToken;
473
+ selectedChain: Chain;
474
+ tokenAmount: string;
475
+ client: ThirdwebClient;
476
+ }) {
477
+ return (
478
+ <div>
479
+ <Container
480
+ flex="row"
481
+ gap="sm"
482
+ center="y"
483
+ style={{
484
+ justifyContent: "space-between",
485
+ }}
486
+ >
487
+ <Container flex="row" gap="xs" center="y">
488
+ <Text color="primaryText" data-testid="tokenAmount" size="xxl">
489
+ {formatNumber(Number(props.tokenAmount), 3)}
490
+ </Text>
491
+
492
+ <Container flex="row" gap="xxs" center="y">
493
+ <TokenSymbol
494
+ token={props.selectedToken}
495
+ chain={props.selectedChain}
496
+ size="md"
497
+ color="secondaryText"
498
+ />
499
+ <PayTokenIcon
500
+ chain={props.selectedChain}
501
+ client={props.client}
502
+ size="sm"
503
+ token={props.selectedToken}
504
+ />
505
+ </Container>
506
+ </Container>
507
+
508
+ <ChainName
509
+ chain={props.selectedChain}
510
+ client={props.client}
511
+ size="sm"
512
+ short
513
+ />
514
+ </Container>
515
+ </div>
516
+ );
517
+ }
518
+
519
+ function MainScreen(props: {
520
+ buyForTx: BuyForTx | null;
521
+ client: ThirdwebClient;
522
+ setTokenAmount: (amount: string) => void;
523
+ account: Account | null;
524
+ tokenAmount: string;
525
+ payOptions: PayUIOptions;
526
+ toToken: ERC20OrNativeToken;
527
+ toChain: Chain;
528
+ onSelectBuyToken: () => void;
529
+ connectButton?: React.ReactNode;
530
+ onViewPendingTx: () => void;
531
+ setScreen: (screen: SelectedScreen) => void;
532
+ supportedDestinations: SupportedChainAndTokens;
533
+ }) {
534
+ const { showPaymentSelection, buyWithCryptoEnabled, buyWithFiatEnabled } =
535
+ useEnabledPaymentMethods({
536
+ payOptions: props.payOptions,
537
+ supportedDestinations: props.supportedDestinations,
538
+ toChain: props.toChain,
539
+ toToken: props.toToken,
540
+ });
541
+
542
+ const [hasEditedAmount, setHasEditedAmount] = useState(false);
543
+ const {
544
+ buyForTx,
545
+ setTokenAmount,
546
+ account,
547
+ client,
548
+ tokenAmount,
549
+ payOptions,
550
+ toToken,
551
+ toChain,
552
+ } = props;
553
+
554
+ // Buy Transaction flow states
555
+ const { amountNeeded } = useBuyTxStates({
556
+ setTokenAmount,
557
+ buyForTx,
558
+ hasEditedAmount,
559
+ account,
560
+ });
561
+
562
+ const disableContinue = !tokenAmount;
563
+
564
+ return (
565
+ <Container p="lg">
566
+ <ModalHeader
567
+ title={
568
+ props.buyForTx ? `Not enough ${props.buyForTx.tokenSymbol}` : "Buy"
569
+ }
570
+ />
571
+
572
+ {/* Amount needed for Send Tx */}
573
+ {amountNeeded && props.buyForTx ? (
574
+ <>
575
+ <Spacer y="lg" />
576
+ <BuyForTxUI
577
+ amountNeeded={String(
578
+ formatNumber(Number(toEther(amountNeeded)), 4),
579
+ )}
580
+ buyForTx={props.buyForTx}
581
+ client={client}
582
+ />
583
+ </>
584
+ ) : (
585
+ <Spacer y="xl" />
586
+ )}
587
+
588
+ {/* To */}
589
+ <BuyTokenInput
590
+ value={tokenAmount}
591
+ onChange={async (value) => {
592
+ setHasEditedAmount(true);
593
+ setTokenAmount(value);
594
+ }}
595
+ freezeAmount={payOptions.prefillBuy?.allowEdits?.amount === false}
596
+ freezeChainAndToken={
597
+ payOptions.prefillBuy?.allowEdits?.chain === false &&
598
+ payOptions.prefillBuy?.allowEdits?.token === false
599
+ }
600
+ token={toToken}
601
+ chain={toChain}
602
+ onSelectToken={props.onSelectBuyToken}
603
+ client={props.client}
604
+ hideTokenSelector={!!props.buyForTx}
605
+ />
606
+
607
+ <Spacer y="xl" />
608
+
609
+ {/* Continue */}
610
+ <Container flex="column" gap="sm">
611
+ {!account && props.connectButton ? (
612
+ <div>{props.connectButton}</div>
613
+ ) : (
614
+ <Button
615
+ variant="accent"
616
+ fullWidth
617
+ disabled={disableContinue}
618
+ data-disabled={disableContinue}
619
+ onClick={() => {
620
+ if (showPaymentSelection) {
621
+ props.setScreen({ id: "select-payment-method" });
622
+ } else if (buyWithCryptoEnabled) {
623
+ props.setScreen({ id: "buy-with-crypto" });
624
+ } else if (buyWithFiatEnabled) {
625
+ props.setScreen({ id: "buy-with-fiat" });
626
+ } else {
627
+ console.error("No payment method enabled");
628
+ }
629
+ }}
630
+ >
631
+ Continue
632
+ </Button>
514
633
  )}
515
634
 
516
- <Container px="lg" flex="column" gap="sm">
517
- {!isExpanded && (
518
- <>
519
- {!account && props.connectButton ? (
520
- <div>{props.connectButton}</div>
521
- ) : (
522
- <Button
523
- variant="accent"
524
- fullWidth
525
- disabled={true}
526
- data-disable={true}
527
- >
528
- Continue
529
- </Button>
530
- )}
531
- </>
532
- )}
635
+ {/* Do we want to remove this? */}
636
+ {account && (
637
+ <Button
638
+ variant="outline"
639
+ fullWidth
640
+ style={{
641
+ padding: spacing.xs,
642
+ fontSize: fontSize.sm,
643
+ }}
644
+ onClick={props.onViewPendingTx}
645
+ >
646
+ View all transactions
647
+ </Button>
648
+ )}
649
+ </Container>
650
+ </Container>
651
+ );
652
+ }
653
+
654
+ function TokenSelectedLayout(props: {
655
+ children: React.ReactNode;
656
+ tokenAmount: string;
657
+ selectedToken: ERC20OrNativeToken;
658
+ selectedChain: Chain;
659
+ client: ThirdwebClient;
660
+ onBack: () => void;
661
+ }) {
662
+ return (
663
+ <Container>
664
+ <Container p="lg">
665
+ <ModalHeader title={"Buy"} onBack={props.onBack} />
666
+ </Container>
533
667
 
534
- {account && (
535
- <Button
536
- variant="outline"
537
- fullWidth
668
+ <Container
669
+ px="lg"
670
+ style={{
671
+ paddingBottom: spacing.lg,
672
+ }}
673
+ >
674
+ <Spacer y="xs" />
675
+ <SelectedTokenInfo
676
+ selectedToken={props.selectedToken}
677
+ selectedChain={props.selectedChain}
678
+ tokenAmount={props.tokenAmount}
679
+ client={props.client}
680
+ />
681
+
682
+ <Spacer y="md" />
683
+ <Line />
684
+ <Spacer y="lg" />
685
+
686
+ <Text size="sm"> Pay with </Text>
687
+ <Spacer y="sm" />
688
+
689
+ {props.children}
690
+ </Container>
691
+ </Container>
692
+ );
693
+ }
694
+
695
+ function PaymentMethodSelection(props: {
696
+ setScreen: (screenId: "buy-with-crypto" | "buy-with-fiat") => void;
697
+ }) {
698
+ return (
699
+ <Container animate="fadein">
700
+ {/* Credit Card */}
701
+ <Container flex="column" gap="sm">
702
+ <Button
703
+ variant="outline"
704
+ bg="tertiaryBg"
705
+ onClick={() => props.setScreen("buy-with-fiat")}
706
+ gap="sm"
707
+ style={{
708
+ justifyContent: "flex-start",
709
+ textAlign: "left",
710
+ }}
711
+ >
712
+ <Container color="secondaryText" flex="row" center="both">
713
+ <IdCardIcon
538
714
  style={{
539
- padding: spacing.xs,
540
- fontSize: fontSize.sm,
715
+ width: iconSize.md,
716
+ height: iconSize.md,
541
717
  }}
542
- onClick={props.onViewPendingTx}
543
- >
544
- View all transactions
545
- </Button>
546
- )}
547
- </Container>
718
+ />
719
+ </Container>
548
720
 
549
- <Spacer y="lg" />
550
- </div>
721
+ <Container flex="column" gap="xxs">
722
+ <Text size="md" color="primaryText">
723
+ Credit Card
724
+ </Text>
725
+ <Text size="xs">Easily and securely make payments</Text>
726
+ </Container>
727
+ </Button>
728
+
729
+ {/* Crypto */}
730
+ <Button
731
+ variant="outline"
732
+ bg="tertiaryBg"
733
+ onClick={() => props.setScreen("buy-with-crypto")}
734
+ style={{
735
+ justifyContent: "flex-start",
736
+ }}
737
+ gap="sm"
738
+ >
739
+ <Container color="secondaryText" flex="row" center="both">
740
+ <CoinsIcon size={iconSize.md} />
741
+ </Container>
742
+
743
+ <Container flex="column" gap="xxs">
744
+ <Text size="md" color="primaryText">
745
+ Crypto
746
+ </Text>
747
+ <Text size="xs">Pay with confidence using crypto</Text>
748
+ </Container>
749
+ </Button>
750
+ </Container>
551
751
  </Container>
552
752
  );
553
753
  }
554
754
 
555
- function SwapScreenContent(
556
- props: BuyScreenContentProps & {
557
- setDrawerScreen: (screen: React.ReactNode) => void;
558
- setScreen: (screen: SelectedScreen) => void;
559
- tokenAmount: string;
560
- toToken: ERC20OrNativeToken;
561
- toChain: Chain;
562
- fromChain: Chain;
563
- fromToken: ERC20OrNativeToken;
564
- showFromTokenSelector: () => void;
565
- account: Account;
566
- activeChain: Chain;
567
- },
568
- ) {
755
+ function SwapScreenContent(props: {
756
+ setDrawerScreen: (screen: React.ReactNode) => void;
757
+ setScreen: (screen: SelectedScreen) => void;
758
+ tokenAmount: string;
759
+ toToken: ERC20OrNativeToken;
760
+ toChain: Chain;
761
+ fromChain: Chain;
762
+ fromToken: ERC20OrNativeToken;
763
+ showFromTokenSelector: () => void;
764
+ account: Account;
765
+ activeChain: Chain;
766
+ client: ThirdwebClient;
767
+ payOptions: PayUIOptions;
768
+ buyForTx: BuyForTx | null;
769
+ isEmbed: boolean;
770
+ onViewPendingTx: () => void;
771
+ onDone: () => void;
772
+ }) {
569
773
  const {
570
774
  setDrawerScreen,
571
775
  setScreen,
@@ -646,7 +850,7 @@ function SwapScreenContent(
646
850
  }
647
851
 
648
852
  setScreen({
649
- type: "node",
853
+ id: "node",
650
854
  node: (
651
855
  <SwapFlow
652
856
  isBuyForTx={!!props.buyForTx}
@@ -654,7 +858,7 @@ function SwapScreenContent(
654
858
  client={client}
655
859
  onBack={() => {
656
860
  setScreen({
657
- type: "main",
861
+ id: "buy-with-crypto",
658
862
  });
659
863
  }}
660
864
  buyWithCryptoQuote={quoteQuery.data}
@@ -664,7 +868,7 @@ function SwapScreenContent(
664
868
  onDone={props.onDone}
665
869
  onTryAgain={() => {
666
870
  setScreen({
667
- type: "main",
871
+ id: "buy-with-crypto",
668
872
  });
669
873
  quoteQuery.refetch();
670
874
  }}
@@ -695,7 +899,7 @@ function SwapScreenContent(
695
899
  : undefined;
696
900
 
697
901
  return (
698
- <Container px="lg" flex="column" gap="md">
902
+ <Container flex="column" gap="md" animate="fadein">
699
903
  {/* Quote info */}
700
904
  <div>
701
905
  <PayWithCrypto
@@ -749,8 +953,8 @@ function SwapScreenContent(
749
953
  <Text color="danger">Not Enough Funds</Text>
750
954
  ) : quoteQuery.isLoading ? (
751
955
  <>
752
- <Spinner size="sm" color="accentText" />
753
956
  Getting price quote
957
+ <Spinner size="sm" color="accentText" />
754
958
  </>
755
959
  ) : (
756
960
  "Continue"
@@ -761,19 +965,23 @@ function SwapScreenContent(
761
965
  );
762
966
  }
763
967
 
764
- function FiatScreenContent(
765
- props: BuyScreenContentProps & {
766
- setDrawerScreen: (screen: React.ReactNode) => void;
767
- setScreen: (screen: SelectedScreen) => void;
768
- tokenAmount: string;
769
- toToken: ERC20OrNativeToken;
770
- toChain: Chain;
771
- closeDrawer: () => void;
772
- selectedCurrency: CurrencyMeta;
773
- showCurrencySelector: () => void;
774
- account: Account;
775
- },
776
- ) {
968
+ function FiatScreenContent(props: {
969
+ setDrawerScreen: (screen: React.ReactNode) => void;
970
+ setScreen: (screen: SelectedScreen) => void;
971
+ tokenAmount: string;
972
+ toToken: ERC20OrNativeToken;
973
+ toChain: Chain;
974
+ selectedCurrency: CurrencyMeta;
975
+ showCurrencySelector: () => void;
976
+ account: Account;
977
+ payOptions: PayUIOptions;
978
+ theme: "light" | "dark" | Theme;
979
+ buyForTx: BuyForTx | null;
980
+ client: ThirdwebClient;
981
+ onViewPendingTx: () => void;
982
+ onDone: () => void;
983
+ isEmbed: boolean;
984
+ }) {
777
985
  const {
778
986
  toToken,
779
987
  tokenAmount,
@@ -827,14 +1035,14 @@ function FiatScreenContent(
827
1035
  }
828
1036
 
829
1037
  setScreen({
830
- type: "node",
1038
+ id: "node",
831
1039
  node: (
832
1040
  <FiatFlow
833
1041
  isBuyForTx={!!props.buyForTx}
834
1042
  quote={fiatQuoteQuery.data}
835
1043
  onBack={() => {
836
1044
  setScreen({
837
- type: "main",
1045
+ id: "buy-with-fiat",
838
1046
  });
839
1047
  }}
840
1048
  client={client}
@@ -899,8 +1107,7 @@ function FiatScreenContent(
899
1107
  const disableSubmit = !fiatQuoteQuery.data;
900
1108
 
901
1109
  return (
902
- <Container px="lg" flex="column" gap="md">
903
- {/* Show Calculated Fiat Amount */}
1110
+ <Container flex="column" gap="md" animate="fadein">
904
1111
  <div>
905
1112
  <PayWithCreditCard
906
1113
  isLoading={fiatQuoteQuery.isLoading}
@@ -939,8 +1146,8 @@ function FiatScreenContent(
939
1146
  >
940
1147
  {fiatQuoteQuery.isLoading ? (
941
1148
  <>
942
- <Spinner size="sm" color="accentText" />
943
1149
  Getting price quote
1150
+ <Spinner size="sm" color="accentText" />
944
1151
  </>
945
1152
  ) : (
946
1153
  "Continue"
@@ -1020,7 +1227,7 @@ function BuyForTxUI(props: {
1020
1227
 
1021
1228
  <Spacer y="md" />
1022
1229
  <Line />
1023
- <Spacer y="lg" />
1230
+ <Spacer y="xl" />
1024
1231
 
1025
1232
  <Text center size="sm">
1026
1233
  Purchase
@@ -1077,7 +1284,7 @@ function createSupportedTokens(
1077
1284
  }
1078
1285
 
1079
1286
  function ChainSelectionScreen(props: {
1080
- showMainScreen: () => void;
1287
+ goBack: () => void;
1081
1288
  chains: Chain[];
1082
1289
  client: ThirdwebClient;
1083
1290
  connectLocale: ConnectLocale;
@@ -1088,9 +1295,9 @@ function ChainSelectionScreen(props: {
1088
1295
  client={props.client}
1089
1296
  connectLocale={props.connectLocale}
1090
1297
  showTabs={false}
1091
- onBack={props.showMainScreen}
1298
+ onBack={props.goBack}
1092
1299
  chains={props.chains}
1093
- closeModal={props.showMainScreen}
1300
+ closeModal={props.goBack}
1094
1301
  networkSelector={{
1095
1302
  renderChain(renderChainProps) {
1096
1303
  return (
@@ -1100,7 +1307,7 @@ function ChainSelectionScreen(props: {
1100
1307
  switchingFailed={false}
1101
1308
  onClick={() => {
1102
1309
  props.setChain(renderChainProps.chain);
1103
- props.showMainScreen();
1310
+ props.goBack();
1104
1311
  }}
1105
1312
  client={props.client}
1106
1313
  connectLocale={props.connectLocale}