thirdweb 5.32.2-nightly-229561e1a79fe2ab3f010c5a8659c7e0fc497ec3-20240703090013 → 5.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/dist/cjs/adapters/ethers5.js +2 -2
  2. package/dist/cjs/adapters/ethers5.js.map +1 -1
  3. package/dist/cjs/contract/verification/index.js +52 -28
  4. package/dist/cjs/contract/verification/index.js.map +1 -1
  5. package/dist/cjs/gas/fee-data.js +13 -6
  6. package/dist/cjs/gas/fee-data.js.map +1 -1
  7. package/dist/cjs/pay/buyWithCrypto/getQuote.js +1 -0
  8. package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
  9. package/dist/cjs/pay/buyWithFiat/getPostOnRampQuote.js +5 -0
  10. package/dist/cjs/pay/buyWithFiat/getPostOnRampQuote.js.map +1 -1
  11. package/dist/cjs/pay/buyWithFiat/getQuote.js.map +1 -1
  12. package/dist/cjs/react/core/hooks/auth/useSiweAuth.js +4 -1
  13. package/dist/cjs/react/core/hooks/auth/useSiweAuth.js.map +1 -1
  14. package/dist/cjs/react/native/ui/components/Header.js +1 -1
  15. package/dist/cjs/react/native/ui/components/Header.js.map +1 -1
  16. package/dist/cjs/react/native/ui/components/button.js +1 -1
  17. package/dist/cjs/react/native/ui/components/button.js.map +1 -1
  18. package/dist/cjs/react/native/ui/connect/ConnectButton.js +1 -1
  19. package/dist/cjs/react/native/ui/connect/ConnectButton.js.map +1 -1
  20. package/dist/cjs/react/native/ui/connect/ConnectModal.js +7 -8
  21. package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
  22. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +1 -1
  23. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -1
  24. package/dist/cjs/react/native/ui/icons/svgs.js +5 -5
  25. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +2 -2
  26. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  27. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +12 -2
  28. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  29. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +19 -5
  30. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  31. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +1 -1
  32. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
  33. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +5 -4
  34. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
  35. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +5 -4
  36. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  37. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js +1 -1
  38. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
  39. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +11 -7
  40. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
  41. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +1 -1
  42. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +1 -1
  43. package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +12 -12
  44. package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
  45. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js +3 -5
  46. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
  47. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +24 -14
  48. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  49. package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js +1 -0
  50. package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
  51. package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js +1 -0
  52. package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
  53. package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js +1 -0
  54. package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
  55. package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js +1 -0
  56. package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
  57. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +144 -87
  58. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  59. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js +49 -0
  60. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js.map +1 -0
  61. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +32 -0
  62. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -0
  63. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +1 -1
  64. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
  65. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +1 -1
  66. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
  67. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +6 -1
  68. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  69. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +2 -4
  70. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +1 -1
  71. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +1 -1
  72. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +1 -1
  73. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +18 -17
  74. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  75. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +2 -6
  76. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  77. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +1 -1
  78. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +1 -1
  79. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js +26 -0
  80. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -0
  81. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js +12 -1
  82. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js.map +1 -1
  83. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.js +1 -1
  84. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.js.map +1 -1
  85. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js +8 -1
  86. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js.map +1 -1
  87. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.js +1 -1
  88. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.js.map +1 -1
  89. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/types.js +3 -0
  90. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/types.js.map +1 -0
  91. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +55 -0
  92. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +1 -0
  93. package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +78 -0
  94. package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -0
  95. package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js +3 -4
  96. package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
  97. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +1 -1
  98. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  99. package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js +31 -0
  100. package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js.map +1 -0
  101. package/dist/cjs/react/web/ui/PayEmbed.js +3 -17
  102. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  103. package/dist/cjs/react/web/ui/components/CopyIcon.js +1 -1
  104. package/dist/cjs/react/web/ui/components/CopyIcon.js.map +1 -1
  105. package/dist/cjs/react/web/ui/components/Drawer.js +51 -17
  106. package/dist/cjs/react/web/ui/components/Drawer.js.map +1 -1
  107. package/dist/cjs/react/web/ui/components/SwitchNetwork.js +1 -3
  108. package/dist/cjs/react/web/ui/components/SwitchNetwork.js.map +1 -1
  109. package/dist/cjs/react/web/ui/components/WalletImage.js +1 -0
  110. package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
  111. package/dist/cjs/react/web/ui/components/buttons.js +5 -1
  112. package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
  113. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +2 -1
  114. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
  115. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +2 -1
  116. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  117. package/dist/cjs/react/web/wallets/in-app/InAppWalletSelectionUI.js +2 -2
  118. package/dist/cjs/react/web/wallets/in-app/InAppWalletSelectionUI.js.map +1 -1
  119. package/dist/cjs/utils/formatNumber.js +4 -1
  120. package/dist/cjs/utils/formatNumber.js.map +1 -1
  121. package/dist/cjs/version.js +1 -1
  122. package/dist/cjs/version.js.map +1 -1
  123. package/dist/esm/adapters/ethers5.js +2 -2
  124. package/dist/esm/adapters/ethers5.js.map +1 -1
  125. package/dist/esm/contract/verification/index.js +52 -28
  126. package/dist/esm/contract/verification/index.js.map +1 -1
  127. package/dist/esm/gas/fee-data.js +13 -6
  128. package/dist/esm/gas/fee-data.js.map +1 -1
  129. package/dist/esm/pay/buyWithCrypto/getQuote.js +1 -0
  130. package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
  131. package/dist/esm/pay/buyWithFiat/getPostOnRampQuote.js +5 -0
  132. package/dist/esm/pay/buyWithFiat/getPostOnRampQuote.js.map +1 -1
  133. package/dist/esm/pay/buyWithFiat/getQuote.js.map +1 -1
  134. package/dist/esm/react/core/hooks/auth/useSiweAuth.js +4 -1
  135. package/dist/esm/react/core/hooks/auth/useSiweAuth.js.map +1 -1
  136. package/dist/esm/react/native/ui/components/Header.js +1 -1
  137. package/dist/esm/react/native/ui/components/Header.js.map +1 -1
  138. package/dist/esm/react/native/ui/components/button.js +1 -1
  139. package/dist/esm/react/native/ui/components/button.js.map +1 -1
  140. package/dist/esm/react/native/ui/connect/ConnectButton.js +1 -1
  141. package/dist/esm/react/native/ui/connect/ConnectButton.js.map +1 -1
  142. package/dist/esm/react/native/ui/connect/ConnectModal.js +8 -9
  143. package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
  144. package/dist/esm/react/native/ui/connect/InAppWalletUI.js +1 -1
  145. package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -1
  146. package/dist/esm/react/native/ui/icons/svgs.js +5 -5
  147. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +2 -2
  148. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  149. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +12 -2
  150. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  151. package/dist/esm/react/web/ui/ConnectWallet/Details.js +20 -6
  152. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  153. package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +1 -1
  154. package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
  155. package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +5 -4
  156. package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
  157. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +2 -2
  158. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  159. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js +1 -1
  160. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
  161. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +11 -7
  162. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
  163. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +1 -1
  164. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +1 -1
  165. package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +12 -12
  166. package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
  167. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js +2 -4
  168. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
  169. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +25 -15
  170. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  171. package/dist/esm/react/web/ui/ConnectWallet/locale/en.js +1 -0
  172. package/dist/esm/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
  173. package/dist/esm/react/web/ui/ConnectWallet/locale/es.js +1 -0
  174. package/dist/esm/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
  175. package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js +1 -0
  176. package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
  177. package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js +1 -0
  178. package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
  179. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +145 -88
  180. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  181. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js +46 -0
  182. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js.map +1 -0
  183. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +29 -0
  184. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -0
  185. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +1 -1
  186. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
  187. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +1 -1
  188. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
  189. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +6 -1
  190. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  191. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +2 -4
  192. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +1 -1
  193. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +1 -1
  194. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +1 -1
  195. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +18 -17
  196. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  197. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +3 -7
  198. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  199. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +1 -1
  200. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +1 -1
  201. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js +23 -0
  202. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -0
  203. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js +12 -1
  204. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js.map +1 -1
  205. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.js +1 -1
  206. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.js.map +1 -1
  207. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js +8 -1
  208. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js.map +1 -1
  209. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.js +1 -1
  210. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.js.map +1 -1
  211. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/types.js +2 -0
  212. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/types.js.map +1 -0
  213. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +52 -0
  214. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +1 -0
  215. package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +75 -0
  216. package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -0
  217. package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js +4 -5
  218. package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
  219. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +1 -1
  220. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  221. package/dist/esm/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js +28 -0
  222. package/dist/esm/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js.map +1 -0
  223. package/dist/esm/react/web/ui/PayEmbed.js +3 -17
  224. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  225. package/dist/esm/react/web/ui/components/CopyIcon.js +1 -1
  226. package/dist/esm/react/web/ui/components/CopyIcon.js.map +1 -1
  227. package/dist/esm/react/web/ui/components/Drawer.js +54 -20
  228. package/dist/esm/react/web/ui/components/Drawer.js.map +1 -1
  229. package/dist/esm/react/web/ui/components/SwitchNetwork.js +1 -3
  230. package/dist/esm/react/web/ui/components/SwitchNetwork.js.map +1 -1
  231. package/dist/esm/react/web/ui/components/WalletImage.js +1 -0
  232. package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
  233. package/dist/esm/react/web/ui/components/buttons.js +5 -1
  234. package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
  235. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +2 -1
  236. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
  237. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +2 -1
  238. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  239. package/dist/esm/react/web/wallets/in-app/InAppWalletSelectionUI.js +2 -2
  240. package/dist/esm/react/web/wallets/in-app/InAppWalletSelectionUI.js.map +1 -1
  241. package/dist/esm/utils/formatNumber.js +4 -1
  242. package/dist/esm/utils/formatNumber.js.map +1 -1
  243. package/dist/esm/version.js +1 -1
  244. package/dist/esm/version.js.map +1 -1
  245. package/dist/types/contract/verification/index.d.ts +1 -0
  246. package/dist/types/contract/verification/index.d.ts.map +1 -1
  247. package/dist/types/gas/fee-data.d.ts.map +1 -1
  248. package/dist/types/pay/buyWithCrypto/getQuote.d.ts +5 -1
  249. package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
  250. package/dist/types/pay/buyWithFiat/getPostOnRampQuote.d.ts.map +1 -1
  251. package/dist/types/pay/buyWithFiat/getQuote.d.ts +4 -0
  252. package/dist/types/pay/buyWithFiat/getQuote.d.ts.map +1 -1
  253. package/dist/types/react/core/hooks/auth/useSiweAuth.d.ts.map +1 -1
  254. package/dist/types/react/native/ui/components/Header.d.ts +1 -1
  255. package/dist/types/react/native/ui/components/Header.d.ts.map +1 -1
  256. package/dist/types/react/native/ui/components/button.d.ts.map +1 -1
  257. package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
  258. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
  259. package/dist/types/react/native/ui/icons/svgs.d.ts +3 -3
  260. package/dist/types/react/native/ui/icons/svgs.d.ts.map +1 -1
  261. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +21 -1
  262. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  263. package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts.map +1 -1
  264. package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts +0 -2
  265. package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts.map +1 -1
  266. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +6 -0
  267. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
  268. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts.map +1 -1
  269. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts +7 -3
  270. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts.map +1 -1
  271. package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts +0 -2
  272. package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts.map +1 -1
  273. package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts +3 -1
  274. package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
  275. package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts +7 -5
  276. package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
  277. package/dist/types/react/web/ui/ConnectWallet/locale/en.d.ts.map +1 -1
  278. package/dist/types/react/web/ui/ConnectWallet/locale/es.d.ts.map +1 -1
  279. package/dist/types/react/web/ui/ConnectWallet/locale/ja.d.ts.map +1 -1
  280. package/dist/types/react/web/ui/ConnectWallet/locale/tl.d.ts.map +1 -1
  281. package/dist/types/react/web/ui/ConnectWallet/locale/types.d.ts +2 -0
  282. package/dist/types/react/web/ui/ConnectWallet/locale/types.d.ts.map +1 -1
  283. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +5 -4
  284. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  285. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.d.ts +8 -0
  286. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.d.ts.map +1 -0
  287. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts +13 -0
  288. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts.map +1 -0
  289. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.d.ts +2 -0
  290. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.d.ts.map +1 -1
  291. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts +2 -0
  292. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +1 -1
  293. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts +2 -0
  294. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts.map +1 -1
  295. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts +2 -0
  296. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts.map +1 -1
  297. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +12 -3
  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/swap/ConfirmationScreen.d.ts +2 -0
  300. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
  301. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +2 -0
  302. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
  303. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts +2 -2
  304. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts.map +1 -1
  305. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.d.ts +12 -0
  306. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.d.ts.map +1 -0
  307. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.d.ts.map +1 -1
  308. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.d.ts +2 -0
  309. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.d.ts.map +1 -1
  310. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.d.ts.map +1 -1
  311. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.d.ts +2 -0
  312. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.d.ts.map +1 -1
  313. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/types.d.ts +9 -0
  314. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/types.d.ts.map +1 -0
  315. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts +6 -0
  316. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts.map +1 -0
  317. package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts +9 -0
  318. package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts.map +1 -0
  319. package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts +1 -1
  320. package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts.map +1 -1
  321. package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts +25 -0
  322. package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts.map +1 -0
  323. package/dist/types/react/web/ui/ConnectWallet/screens/types.d.ts +1 -1
  324. package/dist/types/react/web/ui/ConnectWallet/screens/types.d.ts.map +1 -1
  325. package/dist/types/react/web/ui/PayEmbed.d.ts +1 -1
  326. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  327. package/dist/types/react/web/ui/components/CopyIcon.d.ts.map +1 -1
  328. package/dist/types/react/web/ui/components/Drawer.d.ts +2 -1
  329. package/dist/types/react/web/ui/components/Drawer.d.ts.map +1 -1
  330. package/dist/types/react/web/ui/components/SwitchNetwork.d.ts +1 -2
  331. package/dist/types/react/web/ui/components/SwitchNetwork.d.ts.map +1 -1
  332. package/dist/types/react/web/ui/components/WalletImage.d.ts +1 -0
  333. package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
  334. package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
  335. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts +0 -2
  336. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
  337. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +0 -2
  338. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
  339. package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts +0 -2
  340. package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts.map +1 -1
  341. package/dist/types/utils/formatNumber.d.ts.map +1 -1
  342. package/dist/types/version.d.ts +1 -1
  343. package/dist/types/version.d.ts.map +1 -1
  344. package/package.json +1 -1
  345. package/src/adapters/ethers5.ts +2 -2
  346. package/src/contract/verification/index.ts +63 -30
  347. package/src/gas/fee-data.ts +14 -6
  348. package/src/pay/buyWithCrypto/getQuote.ts +7 -3
  349. package/src/pay/buyWithFiat/getPostOnRampQuote.ts +5 -0
  350. package/src/pay/buyWithFiat/getQuote.ts +4 -0
  351. package/src/react/core/hooks/auth/useSiweAuth.ts +4 -1
  352. package/src/react/native/ui/components/Header.tsx +2 -2
  353. package/src/react/native/ui/components/button.tsx +6 -1
  354. package/src/react/native/ui/connect/ConnectButton.tsx +1 -1
  355. package/src/react/native/ui/connect/ConnectModal.tsx +9 -4
  356. package/src/react/native/ui/connect/InAppWalletUI.tsx +24 -20
  357. package/src/react/native/ui/icons/svgs.ts +5 -5
  358. package/src/react/web/hooks/transaction/useSendTransaction.tsx +30 -17
  359. package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +12 -1
  360. package/src/react/web/ui/ConnectWallet/Details.tsx +73 -2
  361. package/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +2 -0
  362. package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +3 -6
  363. package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +3 -2
  364. package/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx +2 -1
  365. package/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx +17 -10
  366. package/src/react/web/ui/ConnectWallet/Modal/ConnectModalInline.tsx +2 -1
  367. package/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx +14 -15
  368. package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +12 -13
  369. package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +35 -20
  370. package/src/react/web/ui/ConnectWallet/locale/en.ts +1 -0
  371. package/src/react/web/ui/ConnectWallet/locale/es.ts +1 -0
  372. package/src/react/web/ui/ConnectWallet/locale/ja.ts +1 -0
  373. package/src/react/web/ui/ConnectWallet/locale/tl.ts +1 -0
  374. package/src/react/web/ui/ConnectWallet/locale/types.ts +3 -0
  375. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +435 -266
  376. package/src/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.tsx +118 -0
  377. package/src/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.tsx +86 -0
  378. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx +3 -0
  379. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx +2 -0
  380. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +23 -0
  381. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx +4 -5
  382. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx +3 -0
  383. package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +15 -4
  384. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +43 -32
  385. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +4 -7
  386. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +3 -2
  387. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.tsx +66 -0
  388. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.tsx +16 -0
  389. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.tsx +3 -0
  390. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.tsx +27 -0
  391. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.tsx +3 -0
  392. package/src/react/web/ui/ConnectWallet/screens/Buy/types.ts +9 -0
  393. package/src/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.tsx +63 -0
  394. package/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx +203 -0
  395. package/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx +1 -13
  396. package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +2 -2
  397. package/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx +83 -0
  398. package/src/react/web/ui/ConnectWallet/screens/types.ts +2 -1
  399. package/src/react/web/ui/PayEmbed.tsx +7 -29
  400. package/src/react/web/ui/components/CopyIcon.tsx +5 -1
  401. package/src/react/web/ui/components/Drawer.tsx +91 -40
  402. package/src/react/web/ui/components/SwitchNetwork.tsx +2 -5
  403. package/src/react/web/ui/components/WalletImage.tsx +2 -0
  404. package/src/react/web/ui/components/buttons.tsx +5 -1
  405. package/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx +2 -3
  406. package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +2 -3
  407. package/src/react/web/wallets/in-app/InAppWalletSelectionUI.tsx +3 -3
  408. package/src/utils/format-number.test.ts +23 -8
  409. package/src/utils/formatNumber.ts +4 -1
  410. package/src/version.ts +1 -1
@@ -0,0 +1,118 @@
1
+ import { ArrowRightIcon } from "@radix-ui/react-icons";
2
+ import { useMemo, useState, useSyncExternalStore } from "react";
3
+ import type { ThirdwebClient } from "../../../../../../client/client.js";
4
+ import { isAddress } from "../../../../../../utils/address.js";
5
+ import { iconSize } from "../../../../../core/design-system/index.js";
6
+ import { connectionManager } from "../../../../index.js";
7
+ import { Spacer } from "../../../components/Spacer.js";
8
+ import { TextDivider } from "../../../components/TextDivider.js";
9
+ import { ToolTip } from "../../../components/Tooltip.js";
10
+ import { Container } from "../../../components/basic.js";
11
+ import { IconButton } from "../../../components/buttons.js";
12
+ import { Input } from "../../../components/formElements.js";
13
+ import { Text } from "../../../components/text.js";
14
+ import { WalletSelectorButton } from "./WalletSelectorButton.js";
15
+
16
+ export function ReceiverWalletDrawerScreen(props: {
17
+ receiverAddress: string;
18
+ onSelect: (address: string) => void;
19
+ client: ThirdwebClient;
20
+ onBack: () => void;
21
+ }) {
22
+ const [address, setAddress] = useState<string>("");
23
+ const isValidAddress = useMemo(() => isAddress(address), [address]);
24
+ const showError = !!address && !isValidAddress;
25
+ const connectedWallets = useSyncExternalStore(
26
+ connectionManager.connectedWallets.subscribe,
27
+ connectionManager.connectedWallets.getValue,
28
+ );
29
+
30
+ function handleSubmit() {
31
+ props.onSelect(address);
32
+ props.onBack();
33
+ }
34
+
35
+ return (
36
+ <div>
37
+ <Text size="lg" color="primaryText">
38
+ Send to
39
+ </Text>
40
+ <Spacer y="lg" />
41
+
42
+ <div
43
+ style={{
44
+ position: "relative",
45
+ }}
46
+ >
47
+ <Input
48
+ data-error={showError}
49
+ value={address}
50
+ placeholder="Enter wallet address"
51
+ variant="outline"
52
+ onChange={(e) => setAddress(e.target.value)}
53
+ style={{
54
+ paddingRight: "50px",
55
+ }}
56
+ onKeyDown={(e) => {
57
+ if (isValidAddress && e.key === "Enter") {
58
+ handleSubmit();
59
+ }
60
+ }}
61
+ />
62
+
63
+ <ToolTip tip="Confirm">
64
+ <IconButton
65
+ disabled={!isValidAddress}
66
+ style={{
67
+ position: "absolute",
68
+ right: 0,
69
+ top: 0,
70
+ bottom: 0,
71
+ width: "40px",
72
+ }}
73
+ onClick={handleSubmit}
74
+ aria-label="Confirm"
75
+ >
76
+ <ArrowRightIcon width={iconSize.md} height={iconSize.md} />
77
+ </IconButton>
78
+ </ToolTip>
79
+ </div>
80
+
81
+ {showError && (
82
+ <>
83
+ <Spacer y="xs" />
84
+ <Text color="danger" size="sm">
85
+ Invalid address
86
+ </Text>
87
+ </>
88
+ )}
89
+
90
+ <Spacer y="lg" />
91
+ <TextDivider text="OR" />
92
+ <Spacer y="md" />
93
+
94
+ <Text size="sm">Connected</Text>
95
+ <Spacer y="xs" />
96
+
97
+ <Container flex="column" gap="sm">
98
+ {connectedWallets.map((w) => {
99
+ const address = (w.getAccount()?.address || "").toLowerCase();
100
+ return (
101
+ <WalletSelectorButton
102
+ address={address}
103
+ client={props.client}
104
+ onClick={() => {
105
+ props.onSelect(address);
106
+ props.onBack();
107
+ }}
108
+ key={w.id}
109
+ disableChevron
110
+ checked={address === props.receiverAddress.toLowerCase()}
111
+ walletId={w.id}
112
+ />
113
+ );
114
+ })}
115
+ </Container>
116
+ </div>
117
+ );
118
+ }
@@ -0,0 +1,86 @@
1
+ import { CheckIcon, ChevronDownIcon } from "@radix-ui/react-icons";
2
+ import type { ThirdwebClient } from "../../../../../../client/client.js";
3
+ import { shortenAddress } from "../../../../../../utils/address.js";
4
+ import type { WalletId } from "../../../../../../wallets/wallet-types.js";
5
+ import { useCustomTheme } from "../../../../../core/design-system/CustomThemeProvider.js";
6
+ import {
7
+ iconSize,
8
+ radius,
9
+ spacing,
10
+ } from "../../../../../core/design-system/index.js";
11
+ import { useConnectedWallets } from "../../../../hooks/wallets/useConnectedWallets.js";
12
+ import { WalletImage } from "../../../components/WalletImage.js";
13
+ import { Container } from "../../../components/basic.js";
14
+ import { Button } from "../../../components/buttons.js";
15
+ import { Text } from "../../../components/text.js";
16
+ import { GenericWalletIcon } from "../../icons/GenericWalletIcon.js";
17
+
18
+ export function WalletSelectorButton(props: {
19
+ address: string;
20
+ walletId: WalletId | undefined;
21
+ onClick: () => void;
22
+ client: ThirdwebClient;
23
+ containerStyle?: React.CSSProperties;
24
+ disableChevron?: boolean;
25
+ disabled?: boolean;
26
+ checked?: boolean;
27
+ }) {
28
+ const theme = useCustomTheme();
29
+ const connectedWallets = useConnectedWallets();
30
+ const walletId =
31
+ props.walletId ||
32
+ connectedWallets.find((x) => x.getAccount()?.address === props.address)?.id;
33
+
34
+ return (
35
+ <Container
36
+ bg="tertiaryBg"
37
+ style={{
38
+ borderRadius: radius.lg,
39
+ border: `1px solid ${theme.colors.borderColor}`,
40
+ ...props.containerStyle,
41
+ }}
42
+ >
43
+ <Button
44
+ fullWidth
45
+ disabled={props.disabled}
46
+ onClick={props.onClick}
47
+ variant="ghost"
48
+ style={{
49
+ justifyContent: "space-between",
50
+ padding: spacing.sm,
51
+ backgroundColor: theme.colors.tertiaryBg,
52
+ }}
53
+ gap="sm"
54
+ >
55
+ <Container flex="row" center="y" gap="sm" color="secondaryText">
56
+ {walletId ? (
57
+ <WalletImage
58
+ id={walletId}
59
+ size={iconSize.md}
60
+ client={props.client}
61
+ />
62
+ ) : (
63
+ <GenericWalletIcon size={iconSize.md} />
64
+ )}
65
+
66
+ <Text size="sm" color="primaryText">
67
+ {shortenAddress(props.address)}
68
+ </Text>
69
+ </Container>
70
+ {!props.disableChevron && (
71
+ <ChevronDownIcon
72
+ width={iconSize.sm}
73
+ height={iconSize.sm}
74
+ style={{
75
+ color: theme.colors.secondaryText,
76
+ }}
77
+ />
78
+ )}
79
+
80
+ {props.checked && (
81
+ <CheckIcon width={iconSize.md} height={iconSize.md} />
82
+ )}
83
+ </Button>
84
+ </Container>
85
+ );
86
+ }
@@ -5,6 +5,7 @@ import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/get
5
5
  import { isSwapRequiredPostOnramp } from "../../../../../../../pay/buyWithFiat/isSwapRequiredPostOnramp.js";
6
6
  import { openOnrampPopup } from "../openOnRamppopup.js";
7
7
  import { addPendingTx } from "../swap/pendingSwapTx.js";
8
+ import type { PayerInfo } from "../types.js";
8
9
  import { OnrampStatusScreen } from "./FiatStatusScreen.js";
9
10
  import { FiatSteps, fiatQuoteToPartialQuote } from "./FiatSteps.js";
10
11
  import { PostOnRampSwapFlow } from "./PostOnRampSwapFlow.js";
@@ -46,6 +47,7 @@ export function FiatFlow(props: {
46
47
  onDone: () => void;
47
48
  isBuyForTx: boolean;
48
49
  isEmbed: boolean;
50
+ payer: PayerInfo;
49
51
  }) {
50
52
  const hasTwoSteps = isSwapRequiredPostOnramp(props.quote);
51
53
  const [screen, setScreen] = useState<Screen>(
@@ -116,6 +118,7 @@ export function FiatFlow(props: {
116
118
  }}
117
119
  isBuyForTx={props.isBuyForTx}
118
120
  isEmbed={props.isEmbed}
121
+ payer={props.payer}
119
122
  />
120
123
  );
121
124
  }
@@ -177,6 +177,8 @@ function OnrampStatusScreenUI(props: {
177
177
  }
178
178
  : undefined
179
179
  }
180
+ fromAddress={props.quote.fromAddress.toLowerCase()}
181
+ toAddress={props.quote.toAddress.toLowerCase()}
180
182
  />
181
183
  );
182
184
 
@@ -1,6 +1,7 @@
1
1
  import { ExternalLinkIcon } from "@radix-ui/react-icons";
2
2
  import { getCachedChain } from "../../../../../../../chains/utils.js";
3
3
  import type { ThirdwebClient } from "../../../../../../../client/client.js";
4
+ import { shortenAddress } from "../../../../../../../utils/address.js";
4
5
  import { formatNumber } from "../../../../../../../utils/formatNumber.js";
5
6
  import {
6
7
  fontSize,
@@ -37,6 +38,8 @@ export function OnRampTxDetailsTable(props: {
37
38
  text: FiatStatusMeta["status"];
38
39
  txHash?: string;
39
40
  };
41
+ fromAddress?: string;
42
+ toAddress?: string;
40
43
  }) {
41
44
  const onRampExplorers = useChainExplorers(
42
45
  getCachedChain(props.token.chainId),
@@ -112,6 +115,26 @@ export function OnRampTxDetailsTable(props: {
112
115
  </>
113
116
  )}
114
117
 
118
+ {props.fromAddress &&
119
+ props.toAddress &&
120
+ props.fromAddress !== props.toAddress && (
121
+ <>
122
+ {lineSpacer}
123
+ <Container
124
+ flex="row"
125
+ center="y"
126
+ style={{
127
+ justifyContent: "space-between",
128
+ }}
129
+ >
130
+ <Text>Send to</Text>
131
+ <Container flex="row" gap="xs" center="y">
132
+ <Text>{shortenAddress(props.toAddress)}</Text>
133
+ </Container>
134
+ </Container>
135
+ </>
136
+ )}
137
+
115
138
  {lineSpacer}
116
139
 
117
140
  {/* Transaction Hash link */}
@@ -5,7 +5,6 @@ import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/
5
5
  import { getPostOnRampQuote } from "../../../../../../../pay/buyWithFiat/getPostOnRampQuote.js";
6
6
  import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
7
7
  import { iconSize } from "../../../../../../core/design-system/index.js";
8
- import { useActiveAccount } from "../../../../../hooks/wallets/useActiveAccount.js";
9
8
  import { Spacer } from "../../../../components/Spacer.js";
10
9
  import { Spinner } from "../../../../components/Spinner.js";
11
10
  import { Container, ModalHeader } from "../../../../components/basic.js";
@@ -13,6 +12,7 @@ import { Button } from "../../../../components/buttons.js";
13
12
  import { Text } from "../../../../components/text.js";
14
13
  import { AccentFailIcon } from "../../../icons/AccentFailIcon.js";
15
14
  import { SwapFlow } from "../swap/SwapFlow.js";
15
+ import type { PayerInfo } from "../types.js";
16
16
 
17
17
  export function PostOnRampSwap(props: {
18
18
  client: ThirdwebClient;
@@ -22,9 +22,8 @@ export function PostOnRampSwap(props: {
22
22
  onDone: () => void;
23
23
  isBuyForTx: boolean;
24
24
  isEmbed: boolean;
25
+ payer: PayerInfo;
25
26
  }) {
26
- const account = useActiveAccount();
27
-
28
27
  const [lockedOnRampQuote, setLockedOnRampQuote] = useState<
29
28
  BuyWithCryptoQuote | undefined
30
29
  >(undefined);
@@ -92,7 +91,7 @@ export function PostOnRampSwap(props: {
92
91
  );
93
92
  }
94
93
 
95
- if (!lockedOnRampQuote || !account) {
94
+ if (!lockedOnRampQuote) {
96
95
  return (
97
96
  <Container fullHeight>
98
97
  <Container p="lg">
@@ -118,7 +117,7 @@ export function PostOnRampSwap(props: {
118
117
 
119
118
  return (
120
119
  <SwapFlow
121
- account={account}
120
+ payer={props.payer}
122
121
  buyWithCryptoQuote={lockedOnRampQuote}
123
122
  client={props.client}
124
123
  onBack={props.onBack}
@@ -1,6 +1,7 @@
1
1
  import { useState } from "react";
2
2
  import type { ThirdwebClient } from "../../../../../../../client/client.js";
3
3
  import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
4
+ import type { PayerInfo } from "../types.js";
4
5
  import { type BuyWithFiatPartialQuote, FiatSteps } from "./FiatSteps.js";
5
6
  import { PostOnRampSwap } from "./PostOnRampSwap.js";
6
7
 
@@ -20,6 +21,7 @@ export function PostOnRampSwapFlow(props: {
20
21
  onSwapFlowStarted: () => void;
21
22
  isBuyForTx: boolean;
22
23
  isEmbed: boolean;
24
+ payer: PayerInfo;
23
25
  }) {
24
26
  const [statusForSwap, setStatusForSwap] = useState<
25
27
  BuyWithFiatStatus | undefined
@@ -35,6 +37,7 @@ export function PostOnRampSwapFlow(props: {
35
37
  onDone={props.onDone}
36
38
  isBuyForTx={props.isBuyForTx}
37
39
  isEmbed={props.isEmbed}
40
+ payer={props.payer}
38
41
  />
39
42
  );
40
43
  }
@@ -1,3 +1,5 @@
1
+ import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
2
+ import type { BuyWithFiatQuote } from "../../../../../../../pay/buyWithFiat/getQuote.js";
1
3
  import type { PreparedTransaction } from "../../../../../../../transaction/prepare-transaction.js";
2
4
 
3
5
  export type BuyForTx = {
@@ -8,10 +10,6 @@ export type BuyForTx = {
8
10
  };
9
11
 
10
12
  export type SelectedScreen =
11
- | {
12
- id: "node";
13
- node: React.ReactNode;
14
- }
15
13
  | {
16
14
  id:
17
15
  | "main"
@@ -30,4 +28,17 @@ export type SelectedScreen =
30
28
  | {
31
29
  id: "select-currency";
32
30
  backScreen: SelectedScreen;
31
+ }
32
+ | {
33
+ id: "swap-flow";
34
+ quote: BuyWithCryptoQuote;
35
+ }
36
+ | {
37
+ id: "fiat-flow";
38
+ quote: BuyWithFiatQuote;
39
+ openedWindow: Window | null;
40
+ }
41
+ | {
42
+ id: "connect-payer-wallet";
43
+ backScreen: SelectedScreen;
33
44
  };
@@ -3,7 +3,9 @@ import { useState } from "react";
3
3
  import type { Chain } from "../../../../../../../chains/types.js";
4
4
  import type { ThirdwebClient } from "../../../../../../../client/client.js";
5
5
  import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
6
+ import { sendTransaction } from "../../../../../../../transaction/actions/send-transaction.js";
6
7
  import { waitForReceipt } from "../../../../../../../transaction/actions/wait-for-tx-receipt.js";
8
+ import { shortenAddress } from "../../../../../../../utils/address.js";
7
9
  import { formatNumber } from "../../../../../../../utils/formatNumber.js";
8
10
  import { useCustomTheme } from "../../../../../../core/design-system/CustomThemeProvider.js";
9
11
  import {
@@ -11,10 +13,6 @@ import {
11
13
  iconSize,
12
14
  } from "../../../../../../core/design-system/index.js";
13
15
  import { useChainName } from "../../../../../../core/hooks/others/useChainQuery.js";
14
- import { useSendTransactionCore } from "../../../../../../core/hooks/transaction/useSendTransaction.js";
15
- import { useActiveWallet } from "../../../../../hooks/wallets/useActiveWallet.js";
16
- import { useActiveWalletChain } from "../../../../../hooks/wallets/useActiveWalletChain.js";
17
- import { useSwitchActiveWalletChain } from "../../../../../hooks/wallets/useSwitchActiveWalletChain.js";
18
16
  import { Skeleton } from "../../../../components/Skeleton.js";
19
17
  import { Spacer } from "../../../../components/Spacer.js";
20
18
  import { Spinner } from "../../../../components/Spinner.js";
@@ -27,6 +25,7 @@ import { StyledDiv } from "../../../../design-system/elements.js";
27
25
  import type { ERC20OrNativeToken } from "../../nativeToken.js";
28
26
  import { PayTokenIcon } from "../PayTokenIcon.js";
29
27
  import { Step } from "../Stepper.js";
28
+ import type { PayerInfo } from "../types.js";
30
29
  import { SwapFees } from "./Fees.js";
31
30
  import { formatSeconds } from "./formatSeconds.js";
32
31
  import { addPendingTx } from "./pendingSwapTx.js";
@@ -49,15 +48,8 @@ export function SwapConfirmationScreen(props: {
49
48
  fromToken: ERC20OrNativeToken;
50
49
  fromTokenSymbol: string;
51
50
  isFiatFlow: boolean;
51
+ payer: PayerInfo;
52
52
  }) {
53
- const activeChain = useActiveWalletChain();
54
- const activeWallet = useActiveWallet();
55
- const switchChain = useSwitchActiveWalletChain();
56
- const sendTransactionMutation = useSendTransactionCore({
57
- wallet: activeWallet,
58
- switchChain,
59
- });
60
-
61
53
  const isApprovalRequired = props.quote.approval !== undefined;
62
54
  const initialStep = isApprovalRequired ? "approval" : "swap";
63
55
 
@@ -66,6 +58,9 @@ export function SwapConfirmationScreen(props: {
66
58
  "pending" | "success" | "error" | "idle"
67
59
  >("idle");
68
60
 
61
+ const receiver = props.quote.swapDetails.toAddress;
62
+ const sender = props.quote.swapDetails.fromAddress;
63
+
69
64
  return (
70
65
  <Container p="lg">
71
66
  <ModalHeader title="Buy" onBack={props.onBack} />
@@ -85,17 +80,6 @@ export function SwapConfirmationScreen(props: {
85
80
  <Spacer y="lg" />
86
81
  )}
87
82
 
88
- {/* Receive */}
89
- <ConfirmItem label="Receive">
90
- <RenderTokenInfo
91
- chain={props.toChain}
92
- amount={String(formatNumber(Number(props.toAmount), 4))}
93
- symbol={props.toTokenSymbol}
94
- token={props.toToken}
95
- client={props.client}
96
- />
97
- </ConfirmItem>
98
-
99
83
  {/* Pay */}
100
84
  <ConfirmItem label="Pay">
101
85
  <RenderTokenInfo
@@ -107,6 +91,17 @@ export function SwapConfirmationScreen(props: {
107
91
  />
108
92
  </ConfirmItem>
109
93
 
94
+ {/* Receive */}
95
+ <ConfirmItem label="Receive">
96
+ <RenderTokenInfo
97
+ chain={props.toChain}
98
+ amount={String(formatNumber(Number(props.toAmount), 4))}
99
+ symbol={props.toTokenSymbol}
100
+ token={props.toToken}
101
+ client={props.client}
102
+ />
103
+ </ConfirmItem>
104
+
110
105
  {/* Fees */}
111
106
  <ConfirmItem label="Fees">
112
107
  <SwapFees quote={props.quote} align="right" />
@@ -122,6 +117,13 @@ export function SwapConfirmationScreen(props: {
122
117
  </Text>
123
118
  </ConfirmItem>
124
119
 
120
+ {/* Send to */}
121
+ {receiver !== sender && (
122
+ <ConfirmItem label="Send to">
123
+ <Text color="primaryText">{shortenAddress(receiver)}</Text>
124
+ </ConfirmItem>
125
+ )}
126
+
125
127
  <Spacer y="xl" />
126
128
 
127
129
  {/* Show 2 steps - Approve and confirm */}
@@ -162,11 +164,13 @@ export function SwapConfirmationScreen(props: {
162
164
  </>
163
165
  )}
164
166
 
165
- {activeChain && activeChain.id !== props.fromChain.id ? (
167
+ {props.payer.chain.id !== props.fromChain.id ? (
166
168
  <SwitchNetworkButton
167
169
  fullWidth
168
- chain={props.fromChain}
169
170
  variant="accent"
171
+ switchChain={async () => {
172
+ await props.payer.wallet.switchChain(props.fromChain);
173
+ }}
170
174
  />
171
175
  ) : (
172
176
  <Button
@@ -178,9 +182,10 @@ export function SwapConfirmationScreen(props: {
178
182
  try {
179
183
  setStatus("pending");
180
184
 
181
- const tx = await sendTransactionMutation.mutateAsync(
182
- props.quote.approval,
183
- );
185
+ const tx = await sendTransaction({
186
+ account: props.payer.account,
187
+ transaction: props.quote.approval,
188
+ });
184
189
 
185
190
  await waitForReceipt({ ...tx, maxBlocksWaitTime: 50 });
186
191
  // props.onQuoteFinalized(props.quote);
@@ -201,8 +206,8 @@ export function SwapConfirmationScreen(props: {
201
206
  // Fix for inApp wallet
202
207
  // Ideally - the pay server sends a non-legacy transaction to avoid this issue
203
208
  if (
204
- activeWallet?.id === "inApp" ||
205
- activeWallet?.id === "embedded"
209
+ props.payer.wallet.id === "inApp" ||
210
+ props.payer.wallet.id === "embedded"
206
211
  ) {
207
212
  tx = {
208
213
  ...props.quote.transactionRequest,
@@ -210,7 +215,10 @@ export function SwapConfirmationScreen(props: {
210
215
  };
211
216
  }
212
217
 
213
- const _swapTx = await sendTransactionMutation.mutateAsync(tx);
218
+ const _swapTx = await sendTransaction({
219
+ account: props.payer.account,
220
+ transaction: tx,
221
+ });
214
222
 
215
223
  await waitForReceipt({ ..._swapTx, maxBlocksWaitTime: 50 });
216
224
 
@@ -289,7 +297,10 @@ function RenderTokenInfo(props: {
289
297
  );
290
298
  }
291
299
 
292
- function ConfirmItem(props: { label: string; children: React.ReactNode }) {
300
+ function ConfirmItem(props: {
301
+ label: string;
302
+ children: React.ReactNode;
303
+ }) {
293
304
  return (
294
305
  <>
295
306
  <Container
@@ -2,16 +2,15 @@ import { ChevronDownIcon } from "@radix-ui/react-icons";
2
2
  import type { Chain } from "../../../../../../../chains/types.js";
3
3
  import type { ThirdwebClient } from "../../../../../../../client/client.js";
4
4
  import { formatNumber } from "../../../../../../../utils/formatNumber.js";
5
+ import type { Account } from "../../../../../../../wallets/interfaces/wallet.js";
5
6
  import {
6
7
  fontSize,
7
8
  iconSize,
8
- radius,
9
9
  spacing,
10
10
  } from "../../../../../../core/design-system/index.js";
11
11
  import { useChainName } from "../../../../../../core/hooks/others/useChainQuery.js";
12
12
  import { useWalletBalance } from "../../../../../../core/hooks/others/useWalletBalance.js";
13
13
  import type { TokenInfo } from "../../../../../../core/utils/defaultTokens.js";
14
- import { useActiveAccount } from "../../../../../hooks/wallets/useActiveAccount.js";
15
14
  import { Skeleton } from "../../../../components/Skeleton.js";
16
15
  import { Container } from "../../../../components/basic.js";
17
16
  import { Button } from "../../../../components/buttons.js";
@@ -36,12 +35,12 @@ export function PayWithCrypto(props: {
36
35
  isLoading: boolean;
37
36
  client: ThirdwebClient;
38
37
  freezeChainAndTokenSelection?: boolean;
38
+ payerAccount: Account;
39
39
  }) {
40
40
  const { name } = useChainName(props.chain);
41
- const activeAccount = useActiveAccount();
42
41
 
43
42
  const balanceQuery = useWalletBalance({
44
- address: activeAccount?.address,
43
+ address: props.payerAccount.address,
45
44
  chain: props.chain,
46
45
  tokenAddress: isNativeToken(props.token) ? undefined : props.token.address,
47
46
  client: props.client,
@@ -53,10 +52,8 @@ export function PayWithCrypto(props: {
53
52
  borderColor="borderColor"
54
53
  flex="row"
55
54
  style={{
56
- borderRadius: radius.md,
57
- borderBottomRightRadius: 0,
58
- borderBottomLeftRadius: 0,
59
55
  borderWidth: "1px",
56
+ borderTopWidth: 0,
60
57
  borderStyle: "solid",
61
58
  borderBottom: "none",
62
59
  flexWrap: "nowrap",
@@ -3,16 +3,16 @@ import { getCachedChain } from "../../../../../../../chains/utils.js";
3
3
  import type { ThirdwebClient } from "../../../../../../../client/client.js";
4
4
  import { NATIVE_TOKEN_ADDRESS } from "../../../../../../../constants/addresses.js";
5
5
  import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
6
- import type { Account } from "../../../../../../../wallets/interfaces/wallet.js";
7
6
  import type { TokenInfo } from "../../../../../../core/utils/defaultTokens.js";
8
7
  import { type ERC20OrNativeToken, NATIVE_TOKEN } from "../../nativeToken.js";
8
+ import type { PayerInfo } from "../types.js";
9
9
  import { SwapConfirmationScreen } from "./ConfirmationScreen.js";
10
10
  import { SwapStatusScreen } from "./SwapStatusScreen.js";
11
11
 
12
12
  type SwapFlowProps = {
13
13
  onBack?: () => void;
14
14
  buyWithCryptoQuote: BuyWithCryptoQuote;
15
- account: Account;
15
+ payer: PayerInfo;
16
16
  onViewPendingTx: () => void;
17
17
  client: ThirdwebClient;
18
18
  isFiatFlow: boolean;
@@ -104,6 +104,7 @@ export function SwapFlow(props: SwapFlowProps) {
104
104
  onTryAgain={props.onTryAgain}
105
105
  quote={quote}
106
106
  isFiatFlow={props.isFiatFlow}
107
+ payer={props.payer}
107
108
  />
108
109
  );
109
110
  }