thirdweb 5.100.2-nightly-5ab59ff400cc32caa414354855fa07831ed90f3a-20250523000413 → 5.101.0

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 (428) hide show
  1. package/dist/cjs/bridge/Webhook.js +105 -0
  2. package/dist/cjs/bridge/Webhook.js.map +1 -0
  3. package/dist/cjs/bridge/index.js +4 -1
  4. package/dist/cjs/bridge/index.js.map +1 -1
  5. package/dist/cjs/engine/get-status.js +1 -0
  6. package/dist/cjs/engine/get-status.js.map +1 -1
  7. package/dist/cjs/engine/server-wallet.js +4 -1
  8. package/dist/cjs/engine/server-wallet.js.map +1 -1
  9. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +27 -0
  10. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +1 -0
  11. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +17 -16
  12. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
  13. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -1
  14. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
  15. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +6 -9
  16. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +1 -1
  17. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js +9 -0
  18. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
  19. package/dist/cjs/react/web/wallets/in-app/CountrySelector.js +10 -8
  20. package/dist/cjs/react/web/wallets/in-app/CountrySelector.js.map +1 -1
  21. package/dist/cjs/react/web/wallets/in-app/InputSelectionUI.js +6 -2
  22. package/dist/cjs/react/web/wallets/in-app/InputSelectionUI.js.map +1 -1
  23. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -1
  24. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  25. package/dist/cjs/utils/bytecode/resolveImplementation.js +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/cjs/version.js.map +1 -1
  28. package/dist/esm/bridge/Webhook.js +102 -0
  29. package/dist/esm/bridge/Webhook.js.map +1 -0
  30. package/dist/esm/bridge/index.js +2 -0
  31. package/dist/esm/bridge/index.js.map +1 -1
  32. package/dist/esm/engine/get-status.js +1 -0
  33. package/dist/esm/engine/get-status.js.map +1 -1
  34. package/dist/esm/engine/server-wallet.js +4 -1
  35. package/dist/esm/engine/server-wallet.js.map +1 -1
  36. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +23 -0
  37. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +1 -0
  38. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +17 -16
  39. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
  40. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -1
  41. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
  42. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +6 -9
  43. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +1 -1
  44. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js +8 -0
  45. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
  46. package/dist/esm/react/web/wallets/in-app/CountrySelector.js +10 -8
  47. package/dist/esm/react/web/wallets/in-app/CountrySelector.js.map +1 -1
  48. package/dist/esm/react/web/wallets/in-app/InputSelectionUI.js +6 -2
  49. package/dist/esm/react/web/wallets/in-app/InputSelectionUI.js.map +1 -1
  50. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -1
  51. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  52. package/dist/esm/utils/bytecode/resolveImplementation.js +1 -1
  53. package/dist/esm/version.js +1 -1
  54. package/dist/esm/version.js.map +1 -1
  55. package/dist/types/bridge/Webhook.d.ts +82 -0
  56. package/dist/types/bridge/Webhook.d.ts.map +1 -0
  57. package/dist/types/bridge/index.d.ts +4 -1
  58. package/dist/types/bridge/index.d.ts.map +1 -1
  59. package/dist/types/engine/get-status.d.ts.map +1 -1
  60. package/dist/types/engine/server-wallet.d.ts.map +1 -1
  61. package/dist/types/react/core/account/provider.d.ts +1 -1
  62. package/dist/types/react/core/account/provider.d.ts.map +1 -1
  63. package/dist/types/react/core/design-system/CustomThemeProvider.d.ts +1 -1
  64. package/dist/types/react/core/design-system/CustomThemeProvider.d.ts.map +1 -1
  65. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +1 -0
  66. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
  67. package/dist/types/react/core/providers/thirdweb-provider.d.ts +1 -1
  68. package/dist/types/react/core/providers/thirdweb-provider.d.ts.map +1 -1
  69. package/dist/types/react/core/wallet/provider.d.ts +1 -1
  70. package/dist/types/react/core/wallet/provider.d.ts.map +1 -1
  71. package/dist/types/react/native/providers/thirdweb-provider.d.ts +1 -1
  72. package/dist/types/react/native/providers/thirdweb-provider.d.ts.map +1 -1
  73. package/dist/types/react/native/ui/AutoConnect/AutoConnect.d.ts +1 -1
  74. package/dist/types/react/native/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
  75. package/dist/types/react/native/ui/components/Address.d.ts +1 -1
  76. package/dist/types/react/native/ui/components/Address.d.ts.map +1 -1
  77. package/dist/types/react/native/ui/components/ChainIcon.d.ts +1 -1
  78. package/dist/types/react/native/ui/components/ChainIcon.d.ts.map +1 -1
  79. package/dist/types/react/native/ui/components/Header.d.ts +1 -1
  80. package/dist/types/react/native/ui/components/Header.d.ts.map +1 -1
  81. package/dist/types/react/native/ui/components/RNImage.d.ts +1 -1
  82. package/dist/types/react/native/ui/components/RNImage.d.ts.map +1 -1
  83. package/dist/types/react/native/ui/components/TokenIcon.d.ts +1 -1
  84. package/dist/types/react/native/ui/components/TokenIcon.d.ts.map +1 -1
  85. package/dist/types/react/native/ui/components/WalletImage.d.ts +1 -1
  86. package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
  87. package/dist/types/react/native/ui/components/button.d.ts +2 -2
  88. package/dist/types/react/native/ui/components/button.d.ts.map +1 -1
  89. package/dist/types/react/native/ui/components/input.d.ts +2 -2
  90. package/dist/types/react/native/ui/components/input.d.ts.map +1 -1
  91. package/dist/types/react/native/ui/components/spacer.d.ts +1 -1
  92. package/dist/types/react/native/ui/components/spacer.d.ts.map +1 -1
  93. package/dist/types/react/native/ui/components/text.d.ts +1 -1
  94. package/dist/types/react/native/ui/components/text.d.ts.map +1 -1
  95. package/dist/types/react/native/ui/components/view.d.ts +1 -1
  96. package/dist/types/react/native/ui/components/view.d.ts.map +1 -1
  97. package/dist/types/react/native/ui/connect/ConnectButton.d.ts +1 -1
  98. package/dist/types/react/native/ui/connect/ConnectButton.d.ts.map +1 -1
  99. package/dist/types/react/native/ui/connect/ConnectModal.d.ts +2 -2
  100. package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
  101. package/dist/types/react/native/ui/connect/ConnectedButton.d.ts +1 -1
  102. package/dist/types/react/native/ui/connect/ConnectedButton.d.ts.map +1 -1
  103. package/dist/types/react/native/ui/connect/ConnectedModal.d.ts +1 -1
  104. package/dist/types/react/native/ui/connect/ConnectedModal.d.ts.map +1 -1
  105. package/dist/types/react/native/ui/connect/ErrorView.d.ts +1 -1
  106. package/dist/types/react/native/ui/connect/ErrorView.d.ts.map +1 -1
  107. package/dist/types/react/native/ui/connect/ExternalWalletsList.d.ts +2 -2
  108. package/dist/types/react/native/ui/connect/ExternalWalletsList.d.ts.map +1 -1
  109. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts +3 -3
  110. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
  111. package/dist/types/react/native/ui/connect/LoadingView.d.ts +1 -1
  112. package/dist/types/react/native/ui/connect/LoadingView.d.ts.map +1 -1
  113. package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts +1 -1
  114. package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts.map +1 -1
  115. package/dist/types/react/native/ui/connect/SendScreen.d.ts +1 -1
  116. package/dist/types/react/native/ui/connect/SendScreen.d.ts.map +1 -1
  117. package/dist/types/react/native/ui/connect/SuccessView.d.ts +1 -1
  118. package/dist/types/react/native/ui/connect/SuccessView.d.ts.map +1 -1
  119. package/dist/types/react/native/ui/connect/TokenListScreen.d.ts +2 -2
  120. package/dist/types/react/native/ui/connect/TokenListScreen.d.ts.map +1 -1
  121. package/dist/types/react/native/ui/connect/WalletLoadingThumbnail.d.ts +1 -1
  122. package/dist/types/react/native/ui/connect/WalletLoadingThumbnail.d.ts.map +1 -1
  123. package/dist/types/react/native/ui/prebuilt/Account/address.d.ts +1 -1
  124. package/dist/types/react/native/ui/prebuilt/Account/address.d.ts.map +1 -1
  125. package/dist/types/react/native/ui/prebuilt/Account/avatar.d.ts +1 -1
  126. package/dist/types/react/native/ui/prebuilt/Account/avatar.d.ts.map +1 -1
  127. package/dist/types/react/native/ui/prebuilt/Account/balance.d.ts +1 -1
  128. package/dist/types/react/native/ui/prebuilt/Account/balance.d.ts.map +1 -1
  129. package/dist/types/react/native/ui/prebuilt/Account/blobbie.d.ts +2 -2
  130. package/dist/types/react/native/ui/prebuilt/Account/blobbie.d.ts.map +1 -1
  131. package/dist/types/react/native/ui/prebuilt/Account/name.d.ts +1 -1
  132. package/dist/types/react/native/ui/prebuilt/Account/name.d.ts.map +1 -1
  133. package/dist/types/react/native/ui/prebuilt/Wallet/icon.d.ts +2 -2
  134. package/dist/types/react/native/ui/prebuilt/Wallet/icon.d.ts.map +1 -1
  135. package/dist/types/react/native/ui/prebuilt/Wallet/name.d.ts +1 -1
  136. package/dist/types/react/native/ui/prebuilt/Wallet/name.d.ts.map +1 -1
  137. package/dist/types/react/native/ui/transaction/TransactionButton.d.ts +1 -1
  138. package/dist/types/react/native/ui/transaction/TransactionButton.d.ts.map +1 -1
  139. package/dist/types/react/web/providers/thirdweb-provider.d.ts +1 -1
  140. package/dist/types/react/web/providers/thirdweb-provider.d.ts.map +1 -1
  141. package/dist/types/react/web/providers/wallet-ui-states-provider.d.ts +1 -1
  142. package/dist/types/react/web/providers/wallet-ui-states-provider.d.ts.map +1 -1
  143. package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts +1 -1
  144. package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
  145. package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts +1 -1
  146. package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts.map +1 -1
  147. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +1 -1
  148. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
  149. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +5 -5
  150. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  151. package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts +1 -1
  152. package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts.map +1 -1
  153. package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts +1 -1
  154. package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts.map +1 -1
  155. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +1 -1
  156. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
  157. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts +1 -1
  158. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts.map +1 -1
  159. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts +1 -1
  160. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts.map +1 -1
  161. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalSkeleton.d.ts +2 -2
  162. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalSkeleton.d.ts.map +1 -1
  163. package/dist/types/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.d.ts +1 -1
  164. package/dist/types/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.d.ts.map +1 -1
  165. package/dist/types/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.d.ts +1 -1
  166. package/dist/types/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.d.ts.map +1 -1
  167. package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts +1 -1
  168. package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts.map +1 -1
  169. package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts +1 -1
  170. package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts.map +1 -1
  171. package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts +1 -1
  172. package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts.map +1 -1
  173. package/dist/types/react/web/ui/ConnectWallet/PoweredByTW.d.ts +1 -1
  174. package/dist/types/react/web/ui/ConnectWallet/PoweredByTW.d.ts.map +1 -1
  175. package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts +1 -1
  176. package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts.map +1 -1
  177. package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts +1 -1
  178. package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
  179. package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts +1 -1
  180. package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
  181. package/dist/types/react/web/ui/ConnectWallet/WalletTypeRowButton.d.ts +1 -1
  182. package/dist/types/react/web/ui/ConnectWallet/WalletTypeRowButton.d.ts.map +1 -1
  183. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +1 -1
  184. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  185. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts +1 -1
  186. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +1 -1
  187. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts +1 -1
  188. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts.map +1 -1
  189. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts +1 -1
  190. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts.map +1 -1
  191. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts +12 -0
  192. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts.map +1 -0
  193. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts +1 -1
  194. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts.map +1 -1
  195. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts +1 -1
  196. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts.map +1 -1
  197. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts +2 -2
  198. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts.map +1 -1
  199. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts +1 -1
  200. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +1 -1
  201. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts +1 -1
  202. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts.map +1 -1
  203. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts +2 -2
  204. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts.map +1 -1
  205. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts +1 -1
  206. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
  207. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts +1 -1
  208. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts.map +1 -1
  209. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts +3 -2
  210. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts.map +1 -1
  211. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts +1 -1
  212. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +1 -1
  213. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts +1 -1
  214. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts.map +1 -1
  215. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts +1 -1
  216. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts.map +1 -1
  217. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts +1 -1
  218. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
  219. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts +1 -1
  220. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts.map +1 -1
  221. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts +2 -2
  222. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +1 -1
  223. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.d.ts +1 -1
  224. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.d.ts.map +1 -1
  225. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +1 -1
  226. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
  227. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.d.ts +1 -1
  228. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.d.ts.map +1 -1
  229. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts +1 -1
  230. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts.map +1 -1
  231. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts +1 -1
  232. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts.map +1 -1
  233. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts +1 -1
  234. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts.map +1 -1
  235. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts +1 -1
  236. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts.map +1 -1
  237. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts +1 -1
  238. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +1 -1
  239. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts +1 -1
  240. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts.map +1 -1
  241. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts +1 -1
  242. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts.map +1 -1
  243. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts +1 -1
  244. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
  245. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts +6 -0
  246. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts.map +1 -1
  247. package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts +1 -1
  248. package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts.map +1 -1
  249. package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts +1 -1
  250. package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts.map +1 -1
  251. package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts +1 -1
  252. package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts.map +1 -1
  253. package/dist/types/react/web/ui/ConnectWallet/screens/ManageWalletScreen.d.ts +1 -1
  254. package/dist/types/react/web/ui/ConnectWallet/screens/ManageWalletScreen.d.ts.map +1 -1
  255. package/dist/types/react/web/ui/ConnectWallet/screens/PrivateKey.d.ts +1 -1
  256. package/dist/types/react/web/ui/ConnectWallet/screens/PrivateKey.d.ts.map +1 -1
  257. package/dist/types/react/web/ui/ConnectWallet/screens/ReceiveFunds.d.ts +1 -1
  258. package/dist/types/react/web/ui/ConnectWallet/screens/ReceiveFunds.d.ts.map +1 -1
  259. package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts +2 -2
  260. package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts.map +1 -1
  261. package/dist/types/react/web/ui/ConnectWallet/screens/StartScreen.d.ts +1 -1
  262. package/dist/types/react/web/ui/ConnectWallet/screens/StartScreen.d.ts.map +1 -1
  263. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts +1 -1
  264. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
  265. package/dist/types/react/web/ui/ConnectWallet/screens/ViewAssets.d.ts +1 -1
  266. package/dist/types/react/web/ui/ConnectWallet/screens/ViewAssets.d.ts.map +1 -1
  267. package/dist/types/react/web/ui/ConnectWallet/screens/ViewNFTs.d.ts +2 -2
  268. package/dist/types/react/web/ui/ConnectWallet/screens/ViewNFTs.d.ts.map +1 -1
  269. package/dist/types/react/web/ui/ConnectWallet/screens/ViewTokens.d.ts +2 -2
  270. package/dist/types/react/web/ui/ConnectWallet/screens/ViewTokens.d.ts.map +1 -1
  271. package/dist/types/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.d.ts +1 -1
  272. package/dist/types/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.d.ts.map +1 -1
  273. package/dist/types/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.d.ts +1 -1
  274. package/dist/types/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.d.ts.map +1 -1
  275. package/dist/types/react/web/ui/ConnectWallet/screens/WalletLogoSpinner.d.ts +1 -1
  276. package/dist/types/react/web/ui/ConnectWallet/screens/WalletLogoSpinner.d.ts.map +1 -1
  277. package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts +1 -1
  278. package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts.map +1 -1
  279. package/dist/types/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.d.ts +1 -1
  280. package/dist/types/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.d.ts.map +1 -1
  281. package/dist/types/react/web/ui/PayEmbed.d.ts +1 -1
  282. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  283. package/dist/types/react/web/ui/SiteEmbed.d.ts +1 -1
  284. package/dist/types/react/web/ui/SiteEmbed.d.ts.map +1 -1
  285. package/dist/types/react/web/ui/SiteLink.d.ts +1 -1
  286. package/dist/types/react/web/ui/SiteLink.d.ts.map +1 -1
  287. package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +1 -1
  288. package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
  289. package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts +1 -1
  290. package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
  291. package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +1 -1
  292. package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
  293. package/dist/types/react/web/ui/TransactionButton/index.d.ts +1 -1
  294. package/dist/types/react/web/ui/TransactionButton/index.d.ts.map +1 -1
  295. package/dist/types/react/web/ui/components/OTPInput.d.ts +1 -1
  296. package/dist/types/react/web/ui/components/OTPInput.d.ts.map +1 -1
  297. package/dist/types/react/web/ui/components/QRCode.d.ts +1 -1
  298. package/dist/types/react/web/ui/components/QRCode.d.ts.map +1 -1
  299. package/dist/types/react/web/ui/components/StepBar.d.ts +1 -1
  300. package/dist/types/react/web/ui/components/StepBar.d.ts.map +1 -1
  301. package/dist/types/react/web/ui/components/SwitchNetwork.d.ts +1 -1
  302. package/dist/types/react/web/ui/components/SwitchNetwork.d.ts.map +1 -1
  303. package/dist/types/react/web/ui/components/Tabs.d.ts +1 -1
  304. package/dist/types/react/web/ui/components/Tabs.d.ts.map +1 -1
  305. package/dist/types/react/web/ui/components/TextDivider.d.ts +1 -1
  306. package/dist/types/react/web/ui/components/TextDivider.d.ts.map +1 -1
  307. package/dist/types/react/web/ui/components/TokenIcon.d.ts +1 -1
  308. package/dist/types/react/web/ui/components/TokenIcon.d.ts.map +1 -1
  309. package/dist/types/react/web/ui/components/WalletImage.d.ts +1 -1
  310. package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
  311. package/dist/types/react/web/ui/components/basic.d.ts +2 -2
  312. package/dist/types/react/web/ui/components/basic.d.ts.map +1 -1
  313. package/dist/types/react/web/ui/components/token/TokenRow.d.ts +1 -1
  314. package/dist/types/react/web/ui/components/token/TokenRow.d.ts.map +1 -1
  315. package/dist/types/react/web/ui/components/token/TokenSymbol.d.ts +1 -1
  316. package/dist/types/react/web/ui/components/token/TokenSymbol.d.ts.map +1 -1
  317. package/dist/types/react/web/ui/prebuilt/Account/address.d.ts +1 -1
  318. package/dist/types/react/web/ui/prebuilt/Account/address.d.ts.map +1 -1
  319. package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts +1 -1
  320. package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts.map +1 -1
  321. package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts +1 -1
  322. package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts.map +1 -1
  323. package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts +1 -1
  324. package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts.map +1 -1
  325. package/dist/types/react/web/ui/prebuilt/Account/name.d.ts +1 -1
  326. package/dist/types/react/web/ui/prebuilt/Account/name.d.ts.map +1 -1
  327. package/dist/types/react/web/ui/prebuilt/Chain/icon.d.ts +1 -1
  328. package/dist/types/react/web/ui/prebuilt/Chain/icon.d.ts.map +1 -1
  329. package/dist/types/react/web/ui/prebuilt/Chain/name.d.ts +1 -1
  330. package/dist/types/react/web/ui/prebuilt/Chain/name.d.ts.map +1 -1
  331. package/dist/types/react/web/ui/prebuilt/Chain/provider.d.ts +1 -1
  332. package/dist/types/react/web/ui/prebuilt/Chain/provider.d.ts.map +1 -1
  333. package/dist/types/react/web/ui/prebuilt/NFT/description.d.ts +1 -1
  334. package/dist/types/react/web/ui/prebuilt/NFT/description.d.ts.map +1 -1
  335. package/dist/types/react/web/ui/prebuilt/NFT/media.d.ts +1 -1
  336. package/dist/types/react/web/ui/prebuilt/NFT/media.d.ts.map +1 -1
  337. package/dist/types/react/web/ui/prebuilt/NFT/name.d.ts +1 -1
  338. package/dist/types/react/web/ui/prebuilt/NFT/name.d.ts.map +1 -1
  339. package/dist/types/react/web/ui/prebuilt/NFT/provider.d.ts +1 -1
  340. package/dist/types/react/web/ui/prebuilt/NFT/provider.d.ts.map +1 -1
  341. package/dist/types/react/web/ui/prebuilt/Token/icon.d.ts +1 -1
  342. package/dist/types/react/web/ui/prebuilt/Token/icon.d.ts.map +1 -1
  343. package/dist/types/react/web/ui/prebuilt/Token/name.d.ts +1 -1
  344. package/dist/types/react/web/ui/prebuilt/Token/name.d.ts.map +1 -1
  345. package/dist/types/react/web/ui/prebuilt/Token/provider.d.ts +1 -1
  346. package/dist/types/react/web/ui/prebuilt/Token/provider.d.ts.map +1 -1
  347. package/dist/types/react/web/ui/prebuilt/Token/symbol.d.ts +1 -1
  348. package/dist/types/react/web/ui/prebuilt/Token/symbol.d.ts.map +1 -1
  349. package/dist/types/react/web/ui/prebuilt/Wallet/icon.d.ts +2 -2
  350. package/dist/types/react/web/ui/prebuilt/Wallet/icon.d.ts.map +1 -1
  351. package/dist/types/react/web/ui/prebuilt/Wallet/name.d.ts +1 -1
  352. package/dist/types/react/web/ui/prebuilt/Wallet/name.d.ts.map +1 -1
  353. package/dist/types/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.d.ts +1 -1
  354. package/dist/types/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.d.ts.map +1 -1
  355. package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts +1 -1
  356. package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts.map +1 -1
  357. package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts +1 -1
  358. package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts.map +1 -1
  359. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts +1 -1
  360. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
  361. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts +1 -1
  362. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts.map +1 -1
  363. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletHeader.d.ts +1 -1
  364. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletHeader.d.ts.map +1 -1
  365. package/dist/types/react/web/wallets/in-app/CountrySelector.d.ts +3 -2
  366. package/dist/types/react/web/wallets/in-app/CountrySelector.d.ts.map +1 -1
  367. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +1 -1
  368. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
  369. package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts +1 -1
  370. package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts.map +1 -1
  371. package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts +1 -1
  372. package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts.map +1 -1
  373. package/dist/types/react/web/wallets/in-app/InputSelectionUI.d.ts +2 -1
  374. package/dist/types/react/web/wallets/in-app/InputSelectionUI.d.ts.map +1 -1
  375. package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts +1 -1
  376. package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts.map +1 -1
  377. package/dist/types/react/web/wallets/shared/CoinbaseSDKConnection.d.ts +1 -1
  378. package/dist/types/react/web/wallets/shared/CoinbaseSDKConnection.d.ts.map +1 -1
  379. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +1 -1
  380. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  381. package/dist/types/react/web/wallets/shared/ErrorState.d.ts +1 -1
  382. package/dist/types/react/web/wallets/shared/ErrorState.d.ts.map +1 -1
  383. package/dist/types/react/web/wallets/shared/GuestLogin.d.ts +1 -1
  384. package/dist/types/react/web/wallets/shared/GuestLogin.d.ts.map +1 -1
  385. package/dist/types/react/web/wallets/shared/LoadingScreen.d.ts +1 -1
  386. package/dist/types/react/web/wallets/shared/LoadingScreen.d.ts.map +1 -1
  387. package/dist/types/react/web/wallets/shared/LoadingState.d.ts +1 -1
  388. package/dist/types/react/web/wallets/shared/LoadingState.d.ts.map +1 -1
  389. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts +1 -1
  390. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
  391. package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts +1 -1
  392. package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
  393. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts +1 -1
  394. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
  395. package/dist/types/transaction/actions/to-serializable-transaction.d.ts +2 -2
  396. package/dist/types/utils/abi/decodeFunctionData.d.ts +1 -1
  397. package/dist/types/utils/abi/decodeFunctionData.d.ts.map +1 -1
  398. package/dist/types/utils/abi/decodeFunctionResult.d.ts +1 -1
  399. package/dist/types/utils/abi/decodeFunctionResult.d.ts.map +1 -1
  400. package/dist/types/utils/bytecode/resolveImplementation.d.ts +1 -1
  401. package/dist/types/version.d.ts +1 -1
  402. package/dist/types/version.d.ts.map +1 -1
  403. package/dist/types/wallets/ecosystem/types.d.ts +4 -0
  404. package/dist/types/wallets/ecosystem/types.d.ts.map +1 -1
  405. package/dist/types/wallets/in-app/core/wallet/types.d.ts +4 -0
  406. package/dist/types/wallets/in-app/core/wallet/types.d.ts.map +1 -1
  407. package/dist/types/wallets/in-app/native/helpers/storage/local.d.ts +1 -1
  408. package/package.json +6 -5
  409. package/src/bridge/Webhook.test.ts +589 -0
  410. package/src/bridge/Webhook.ts +139 -0
  411. package/src/bridge/index.ts +4 -1
  412. package/src/engine/get-status.ts +1 -0
  413. package/src/engine/server-wallet.test.ts +16 -16
  414. package/src/engine/server-wallet.ts +4 -1
  415. package/src/react/core/hooks/connection/ConnectButtonProps.ts +1 -0
  416. package/src/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.tsx +68 -0
  417. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +27 -36
  418. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +2 -1
  419. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.tsx +30 -33
  420. package/src/react/web/ui/ConnectWallet/screens/Buy/utils.ts +9 -0
  421. package/src/react/web/wallets/in-app/CountrySelector.tsx +14 -7
  422. package/src/react/web/wallets/in-app/InputSelectionUI.test.tsx +23 -0
  423. package/src/react/web/wallets/in-app/InputSelectionUI.tsx +7 -1
  424. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +3 -0
  425. package/src/utils/bytecode/resolveImplementation.ts +1 -1
  426. package/src/version.ts +1 -1
  427. package/src/wallets/ecosystem/types.ts +5 -0
  428. package/src/wallets/in-app/core/wallet/types.ts +5 -0
@@ -0,0 +1,139 @@
1
+ import { z } from "zod/v4-mini";
2
+ import { isAddress } from "../utils/address.js";
3
+ import { isHex } from "../utils/encoding/hex.js";
4
+
5
+ const hexSchema = z
6
+ .string()
7
+ .check(z.refine(isHex, { message: "Invalid hex string" }));
8
+ const addressSchema = z
9
+ .string()
10
+ .check(z.refine(isAddress, { message: "Invalid address" }));
11
+
12
+ const webhookSchema = z.union([
13
+ z.object({
14
+ version: z.literal(1),
15
+ data: z.object({}),
16
+ }),
17
+ z.object({
18
+ version: z.literal(2),
19
+ data: z.object({
20
+ paymentId: z.string(),
21
+ // only exists when the payment was triggered from a developer specified payment link
22
+ paymentLinkId: z.optional(z.string()),
23
+ clientId: z.string(),
24
+ action: z.enum(["TRANSFER", "BUY", "SELL"]),
25
+ status: z.enum(["PENDING", "FAILED", "COMPLETED"]),
26
+ originToken: addressSchema,
27
+ originAmount: z.string(),
28
+ destinationToken: addressSchema,
29
+ destinationAmount: z.string(),
30
+ sender: addressSchema,
31
+ receiver: addressSchema,
32
+ type: z.string(),
33
+ transactions: z.array(hexSchema),
34
+ developerFeeBps: z.coerce.number(),
35
+ developerFeeRecipient: addressSchema,
36
+ purchaseData: z.record(z.string(), z.unknown()),
37
+ }),
38
+ }),
39
+ ]);
40
+
41
+ export type WebhookPayload = Exclude<
42
+ z.infer<typeof webhookSchema>,
43
+ { version: 1 }
44
+ >;
45
+
46
+ /**
47
+ * Parses an incoming webhook from thirdweb.
48
+ *
49
+ * @param payload - The raw text body received from thirdweb.
50
+ * @param headers - The webhook headers received from thirdweb.
51
+ * @param secret - The webhook secret to verify the payload with.
52
+ */
53
+ export async function parse(
54
+ /**
55
+ * Raw text body received from thirdweb.
56
+ */
57
+ payload: string,
58
+
59
+ /**
60
+ * The webhook headers received from thirdweb.
61
+ */
62
+ headers: Record<string, string>,
63
+
64
+ /**
65
+ * The webhook secret to verify the payload with.
66
+ */
67
+ secret: string,
68
+
69
+ /**
70
+ * The tolerance in seconds for the timestamp verification.
71
+ */
72
+ tolerance = 300, // Default to 5 minutes if not specified
73
+ ) {
74
+ // Get the signature and timestamp from headers
75
+ const receivedSignature =
76
+ headers["x-payload-signature"] || headers["x-pay-signature"];
77
+ const receivedTimestamp =
78
+ headers["x-timestamp"] || headers["x-pay-timestamp"];
79
+
80
+ if (!receivedSignature || !receivedTimestamp) {
81
+ throw new Error("Missing required webhook headers: signature or timestamp");
82
+ }
83
+
84
+ // Verify timestamp
85
+ const now = Math.floor(Date.now() / 1000);
86
+ const timestamp = Number.parseInt(receivedTimestamp, 10);
87
+ const diff = Math.abs(now - timestamp);
88
+
89
+ if (diff > tolerance) {
90
+ throw new Error(
91
+ `Webhook timestamp is too old. Difference: ${diff}s, tolerance: ${tolerance}s`,
92
+ );
93
+ }
94
+
95
+ // Generate signature using the same method as the sender
96
+ const encoder = new TextEncoder();
97
+ const key = await crypto.subtle.importKey(
98
+ "raw",
99
+ encoder.encode(secret),
100
+ { name: "HMAC", hash: "SHA-256" },
101
+ false,
102
+ ["sign"],
103
+ );
104
+
105
+ const signature = await crypto.subtle.sign(
106
+ "HMAC",
107
+ key,
108
+ encoder.encode(`${receivedTimestamp}.${payload}`),
109
+ );
110
+
111
+ // Convert the signature to hex string
112
+ const computedSignature = Array.from(new Uint8Array(signature))
113
+ .map((b) => b.toString(16).padStart(2, "0"))
114
+ .join("");
115
+
116
+ // Compare signatures
117
+ if (computedSignature !== receivedSignature) {
118
+ throw new Error("Invalid webhook signature");
119
+ }
120
+
121
+ // Parse the payload as JSON
122
+ let payloadObject: unknown;
123
+ try {
124
+ payloadObject = JSON.parse(payload) as unknown;
125
+ } catch {
126
+ throw new Error("Invalid webhook payload: not valid JSON");
127
+ }
128
+
129
+ const parsedPayload = webhookSchema.parse(payloadObject);
130
+
131
+ // v1 is no longer supported
132
+ if (parsedPayload.version === 1) {
133
+ throw new Error(
134
+ "Invalid webhook payload: version 1 is no longer supported, please upgrade to webhook version 2.",
135
+ );
136
+ }
137
+
138
+ return parsedPayload;
139
+ }
@@ -2,9 +2,11 @@ export * as Buy from "./Buy.js";
2
2
  export * as Sell from "./Sell.js";
3
3
  export * as Transfer from "./Transfer.js";
4
4
  export * as Onramp from "./Onramp.js";
5
+ export * as Webhook from "./Webhook.js";
5
6
  export { status } from "./Status.js";
6
7
  export { routes } from "./Routes.js";
7
8
  export { chains } from "./Chains.js";
9
+ export { parse } from "./Webhook.js";
8
10
 
9
11
  export type { Chain } from "./types/Chain.js";
10
12
  export type { Quote, PreparedQuote } from "./types/Quote.js";
@@ -16,5 +18,6 @@ export type {
16
18
  } from "./types/Route.js";
17
19
  export type { Status } from "./types/Status.js";
18
20
  export type { Token } from "./types/Token.js";
19
- export type { Action } from "./types/BridgeAction.js";
20
21
  export type { ApiError } from "./types/Errors.js";
22
+ export type { Action } from "./types/BridgeAction.js";
23
+ export type { WebhookPayload } from "./Webhook.js";
@@ -79,6 +79,7 @@ export async function getTransactionStatus(args: {
79
79
  const { client, transactionId } = args;
80
80
  const searchResult = await searchTransactions({
81
81
  baseUrl: getThirdwebBaseUrl("engineCloud"),
82
+ bodySerializer: stringify,
82
83
  fetch: getClientFetch(client),
83
84
  body: {
84
85
  filters: [
@@ -3,13 +3,14 @@ import { TEST_CLIENT } from "../../test/src/test-clients.js";
3
3
  import { TEST_ACCOUNT_B } from "../../test/src/test-wallets.js";
4
4
  import { typedData } from "../../test/src/typed-data.js";
5
5
  import { arbitrumSepolia } from "../chains/chain-definitions/arbitrum-sepolia.js";
6
+ import { baseSepolia } from "../chains/chain-definitions/base-sepolia.js";
6
7
  import { sepolia } from "../chains/chain-definitions/sepolia.js";
7
8
  import { getContract } from "../contract/contract.js";
8
9
  import { setContractURI } from "../extensions/common/__generated__/IContractMetadata/write/setContractURI.js";
10
+ import { mintTo } from "../extensions/erc20/write/mintTo.js";
9
11
  import { claimTo } from "../extensions/erc1155/drops/write/claimTo.js";
10
12
  import { getAllActiveSigners } from "../extensions/erc4337/__generated__/IAccountPermissions/read/getAllActiveSigners.js";
11
13
  import { sendTransaction } from "../transaction/actions/send-transaction.js";
12
- import { setThirdwebDomains } from "../utils/domains.js";
13
14
  import {
14
15
  DEFAULT_ACCOUNT_FACTORY_V0_6,
15
16
  ENTRYPOINT_ADDRESS_v0_6,
@@ -32,12 +33,12 @@ describe.runIf(
32
33
  let serverWallet: Engine.ServerWallet;
33
34
 
34
35
  beforeAll(async () => {
35
- setThirdwebDomains({
36
- rpc: "rpc.thirdweb-dev.com",
37
- storage: "storage.thirdweb-dev.com",
38
- bundler: "bundler.thirdweb-dev.com",
39
- engineCloud: "engine.thirdweb-dev.com",
40
- });
36
+ // setThirdwebDomains({
37
+ // rpc: "rpc.thirdweb-dev.com",
38
+ // storage: "storage.thirdweb-dev.com",
39
+ // bundler: "bundler.thirdweb-dev.com",
40
+ // engineCloud: "engine.thirdweb-dev.com",
41
+ // });
41
42
  serverWallet = Engine.serverWallet({
42
43
  client: TEST_CLIENT,
43
44
  vaultAccessToken: process.env.VAULT_TOKEN as string,
@@ -81,7 +82,7 @@ describe.runIf(
81
82
  });
82
83
  const claimTx = claimTo({
83
84
  contract: nftContract,
84
- to: TEST_ACCOUNT_B.address,
85
+ to: serverWallet.address,
85
86
  tokenId: 0n,
86
87
  quantity: 1n,
87
88
  });
@@ -97,16 +98,15 @@ describe.runIf(
97
98
  });
98
99
 
99
100
  it("should send a extension tx", async () => {
100
- const nftContract = getContract({
101
+ const tokenContract = getContract({
101
102
  client: TEST_CLIENT,
102
- chain: sepolia,
103
- address: "0xe2cb0eb5147b42095c2FfA6F7ec953bb0bE347D8",
103
+ chain: baseSepolia,
104
+ address: "0x87C52295891f208459F334975a3beE198fE75244",
104
105
  });
105
- const claimTx = claimTo({
106
- contract: nftContract,
107
- to: TEST_ACCOUNT_B.address,
108
- tokenId: 0n,
109
- quantity: 1n,
106
+ const claimTx = mintTo({
107
+ contract: tokenContract,
108
+ to: serverWallet.address,
109
+ amount: "0.001",
110
110
  });
111
111
  const tx = await sendTransaction({
112
112
  account: serverWallet,
@@ -144,13 +144,14 @@ export function serverWallet(options: ServerWalletOptions): ServerWallet {
144
144
 
145
145
  const result = await sendTransaction({
146
146
  baseUrl: getThirdwebBaseUrl("engineCloud"),
147
+ bodySerializer: stringify,
147
148
  fetch: getClientFetch(client),
148
149
  headers,
149
150
  body,
150
151
  });
151
152
 
152
153
  if (result.error) {
153
- throw new Error(`Error sending transaction: ${result.error}`);
154
+ throw new Error(`Error sending transaction: ${stringify(result.error)}`);
154
155
  }
155
156
 
156
157
  const data = result.data?.result;
@@ -220,6 +221,7 @@ export function serverWallet(options: ServerWalletOptions): ServerWallet {
220
221
 
221
222
  const signResult = await signMessage({
222
223
  baseUrl: getThirdwebBaseUrl("engineCloud"),
224
+ bodySerializer: stringify,
223
225
  fetch: getClientFetch(client),
224
226
  headers,
225
227
  body: {
@@ -256,6 +258,7 @@ export function serverWallet(options: ServerWalletOptions): ServerWallet {
256
258
 
257
259
  const signResult = await signTypedData({
258
260
  baseUrl: getThirdwebBaseUrl("engineCloud"),
261
+ bodySerializer: stringify,
259
262
  fetch: getClientFetch(client),
260
263
  headers,
261
264
  body: {
@@ -98,6 +98,7 @@ export type PayUIOptions = Prettify<
98
98
  currency?: CurrencyMeta["shorthand"];
99
99
  };
100
100
  preferredProvider?: FiatProvider;
101
+ supportedProviders?: FiatProvider[];
101
102
  }
102
103
  | false;
103
104
 
@@ -0,0 +1,68 @@
1
+ import { ChevronDownIcon } from "@radix-ui/react-icons";
2
+ import type { FiatProvider } from "../../../../../../pay/utils/commonTypes.js";
3
+ import { iconSize, spacing } from "../../../../../core/design-system/index.js";
4
+ import { Container } from "../../../components/basic.js";
5
+ import { Button } from "../../../components/buttons.js";
6
+ import { Text } from "../../../components/text.js";
7
+ import { getProviderLabel } from "./utils.js";
8
+
9
+ /**
10
+ * Shows the selected payment provider based on the preferred provider OR the quoted provider.
11
+ * @internal
12
+ */
13
+ export const PayProviderSelection = (props: {
14
+ onShowProviders: () => void;
15
+ quotedProvider?: FiatProvider;
16
+ preferredProvider?: FiatProvider;
17
+ supportedProviders: FiatProvider[];
18
+ }) => {
19
+ const ProviderItem = (
20
+ <Container
21
+ flex="row"
22
+ center="y"
23
+ gap="xxs"
24
+ color="secondaryText"
25
+ style={{ padding: spacing.md }}
26
+ >
27
+ <Text size="xs">
28
+ {getProviderLabel(
29
+ props.preferredProvider ?? props.quotedProvider ?? "",
30
+ )}
31
+ </Text>
32
+ {props.supportedProviders.length > 1 && (
33
+ <ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
34
+ )}
35
+ </Container>
36
+ );
37
+
38
+ return (
39
+ <Container
40
+ bg="tertiaryBg"
41
+ flex="row"
42
+ borderColor="borderColor"
43
+ style={{
44
+ paddingLeft: spacing.md,
45
+ justifyContent: "space-between",
46
+ alignItems: "center",
47
+ borderWidth: "1px",
48
+ borderStyle: "solid",
49
+ borderBottom: "none",
50
+ }}
51
+ >
52
+ <Text size="xs" color="secondaryText">
53
+ Provider
54
+ </Text>
55
+ {props.supportedProviders.length > 1 ? (
56
+ <Button
57
+ variant="ghost"
58
+ onClick={props.onShowProviders}
59
+ style={{ padding: 0 }} // Padding is managed within children as the button is conditional
60
+ >
61
+ {ProviderItem}
62
+ </Button>
63
+ ) : (
64
+ ProviderItem
65
+ )}
66
+ </Container>
67
+ );
68
+ };
@@ -1,15 +1,13 @@
1
- import { ChevronDownIcon } from "@radix-ui/react-icons";
2
1
  import { useState } from "react";
3
2
  import { trackPayEvent } from "../../../../../../../analytics/track/pay.js";
4
3
  import type { Chain } from "../../../../../../../chains/types.js";
5
4
  import type { ThirdwebClient } from "../../../../../../../client/client.js";
6
5
  import { NATIVE_TOKEN_ADDRESS } from "../../../../../../../constants/addresses.js";
7
- import type { FiatProvider } from "../../../../../../../pay/utils/commonTypes.js";
8
6
  import {
9
- type Theme,
10
- iconSize,
11
- spacing,
12
- } from "../../../../../../core/design-system/index.js";
7
+ type FiatProvider,
8
+ FiatProviders,
9
+ } from "../../../../../../../pay/utils/commonTypes.js";
10
+ import type { Theme } from "../../../../../../core/design-system/index.js";
13
11
  import type { PayUIOptions } from "../../../../../../core/hooks/connection/ConnectButtonProps.js";
14
12
  import { useBuyWithFiatQuote } from "../../../../../../core/hooks/pay/useBuyWithFiatQuote.js";
15
13
  import { PREFERRED_FIAT_PROVIDER_STORAGE_KEY } from "../../../../../../core/utils/storage.js";
@@ -26,6 +24,7 @@ import { Button } from "../../../../components/buttons.js";
26
24
  import { Text } from "../../../../components/text.js";
27
25
  import { type ERC20OrNativeToken, isNativeToken } from "../../nativeToken.js";
28
26
  import { EstimatedTimeAndFees } from "../EstimatedTimeAndFees.js";
27
+ import { PayProviderSelection } from "../PayProviderSelection.js";
29
28
  import { PayWithCreditCard } from "../PayWIthCreditCard.js";
30
29
  import type { SelectedScreen } from "../main/types.js";
31
30
  import { FiatFees } from "../swap/Fees.js";
@@ -84,6 +83,19 @@ export function FiatScreenContent(props: {
84
83
  : undefined,
85
84
  );
86
85
 
86
+ const supportedProviders = (() => {
87
+ if (!buyWithFiatOptions) return [...FiatProviders];
88
+ const options = buyWithFiatOptions?.supportedProviders ?? [];
89
+ const optionsWithPreferred =
90
+ options.length > 0
91
+ ? new Set([
92
+ ...(preferredProvider ? [preferredProvider] : []),
93
+ ...options,
94
+ ])
95
+ : FiatProviders;
96
+ return Array.from(optionsWithPreferred);
97
+ })();
98
+
87
99
  const fiatQuoteQuery = useBuyWithFiatQuote(
88
100
  buyWithFiatOptions !== false && tokenAmount
89
101
  ? {
@@ -98,8 +110,8 @@ export function FiatScreenContent(props: {
98
110
  isTestMode: buyWithFiatOptions?.testMode,
99
111
  purchaseData: props.payOptions.purchaseData,
100
112
  fromAddress: payer.account.address,
101
- preferredProvider: preferredProvider,
102
113
  paymentLinkId: paymentLinkId,
114
+ preferredProvider: preferredProvider ?? supportedProviders[0],
103
115
  }
104
116
  : undefined,
105
117
  );
@@ -159,6 +171,7 @@ export function FiatScreenContent(props: {
159
171
  </Text>
160
172
  <Spacer y="lg" />
161
173
  <Providers
174
+ supportedProviders={supportedProviders}
162
175
  preferredProvider={
163
176
  preferredProvider || fiatQuoteQuery.data?.provider
164
177
  }
@@ -188,35 +201,13 @@ export function FiatScreenContent(props: {
188
201
  currency={selectedCurrency}
189
202
  onSelectCurrency={showCurrencySelector}
190
203
  />
191
- <Container
192
- bg="tertiaryBg"
193
- flex="row"
194
- borderColor="borderColor"
195
- style={{
196
- paddingLeft: spacing.md,
197
- justifyContent: "space-between",
198
- alignItems: "center",
199
- borderWidth: "1px",
200
- borderStyle: "solid",
201
- borderBottom: "none",
202
- }}
203
- >
204
- <Text size="xs" color="secondaryText">
205
- Provider
206
- </Text>
207
- <Button variant="ghost" onClick={showProviders}>
208
- <Container flex="row" center="y" gap="xxs" color="secondaryText">
209
- <Text size="xs">
210
- {preferredProvider
211
- ? `${preferredProvider.charAt(0).toUpperCase() + preferredProvider.slice(1).toLowerCase()}`
212
- : fiatQuoteQuery.data?.provider
213
- ? `${fiatQuoteQuery.data?.provider.charAt(0).toUpperCase() + fiatQuoteQuery.data?.provider.slice(1).toLowerCase()}`
214
- : ""}
215
- </Text>
216
- <ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
217
- </Container>
218
- </Button>
219
- </Container>
204
+ {/** Shows preferred or quoted provider and conditional selection */}
205
+ <PayProviderSelection
206
+ onShowProviders={showProviders}
207
+ quotedProvider={fiatQuoteQuery.data?.provider}
208
+ preferredProvider={preferredProvider}
209
+ supportedProviders={supportedProviders}
210
+ />
220
211
  {/* Estimated time + View fees button */}
221
212
  <EstimatedTimeAndFees
222
213
  quoteIsLoading={fiatQuoteQuery.isLoading}
@@ -44,6 +44,7 @@ import { StepConnectorArrow } from "../swap/StepConnector.js";
44
44
  import { WalletRow } from "../swap/WalletRow.js";
45
45
  import { addPendingTx } from "../swap/pendingSwapTx.js";
46
46
  import type { PayerInfo } from "../types.js";
47
+ import { getProviderLabel } from "../utils.js";
47
48
  import { StepContainer } from "./FiatSteps.js";
48
49
 
49
50
  type OnRampScreenState = {
@@ -213,7 +214,7 @@ function StepUI(props: {
213
214
  />
214
215
  <Container flex="column" gap="3xs" center="y" style={{ flex: "1" }}>
215
216
  <Text size="sm" color="primaryText">
216
- {step.action.charAt(0).toUpperCase() + step.action.slice(1)}
217
+ {getProviderLabel(step.action)}
217
218
  </Text>
218
219
 
219
220
  <Container
@@ -1,14 +1,14 @@
1
- import {
2
- type FiatProvider,
3
- FiatProviders,
4
- } from "../../../../../../../pay/utils/commonTypes.js";
1
+ import type { FiatProvider } from "../../../../../../../pay/utils/commonTypes.js";
5
2
  import { Container } from "../../../../components/basic.js";
6
3
  import { Button } from "../../../../components/buttons.js";
7
4
  import { Link } from "../../../../components/text.js";
5
+ import { getProviderLabel } from "../utils.js";
8
6
  /**
9
7
  * @internal
10
8
  */
9
+
11
10
  export function Providers(props: {
11
+ supportedProviders: FiatProvider[];
12
12
  preferredProvider?: FiatProvider;
13
13
  onSelect: (provider: FiatProvider) => void;
14
14
  }) {
@@ -21,37 +21,34 @@ export function Providers(props: {
21
21
  alignItems: "flex-start",
22
22
  }}
23
23
  >
24
- {FiatProviders.map((provider) => {
25
- return (
26
- <Container
27
- key={provider}
28
- flex="row"
29
- expand
30
- style={{
31
- justifyContent: "space-between",
32
- }}
24
+ {props.supportedProviders.map((provider) => (
25
+ <Container
26
+ key={provider}
27
+ flex="row"
28
+ expand
29
+ style={{
30
+ justifyContent: "space-between",
31
+ }}
32
+ >
33
+ <Button
34
+ fullWidth
35
+ onClick={() => props.onSelect(provider)}
36
+ variant={"link"}
33
37
  >
34
- <Button
35
- fullWidth
36
- onClick={() => props.onSelect(provider)}
37
- variant={"link"}
38
+ <Link
39
+ color={
40
+ props.preferredProvider === provider
41
+ ? "primaryText"
42
+ : "secondaryText"
43
+ }
44
+ size="sm"
45
+ hoverColor="primaryText"
38
46
  >
39
- <Link
40
- color={
41
- props.preferredProvider === provider
42
- ? "primaryText"
43
- : "secondaryText"
44
- }
45
- size="sm"
46
- hoverColor="primaryText"
47
- >
48
- {provider.charAt(0).toUpperCase() +
49
- provider.slice(1).toLowerCase()}
50
- </Link>
51
- </Button>
52
- </Container>
53
- );
54
- })}
47
+ {getProviderLabel(provider)}
48
+ </Link>
49
+ </Button>
50
+ </Container>
51
+ ))}
55
52
  </Container>
56
53
  );
57
54
  }
@@ -1,3 +1,12 @@
1
1
  export function getBuyTokenAmountFontSize(value: string) {
2
2
  return value.length > 10 ? "26px" : value.length > 6 ? "34px" : "50px";
3
3
  }
4
+
5
+ /**
6
+ *
7
+ * @param str accepts any string but expects a fully upppercased string / type FiatProvider
8
+ * @returns Fiat provider label to be rendered used within presentation logic
9
+ */
10
+ export function getProviderLabel(str: string) {
11
+ return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
12
+ }
@@ -21,19 +21,26 @@ export function getCountrySelector(countryIsoCode: SupportedSmsCountry) {
21
21
  export function CountrySelector({
22
22
  countryCode,
23
23
  setCountryCode,
24
+ allowedCountryCodes,
24
25
  }: {
25
26
  countryCode: string;
26
27
  setCountryCode: React.Dispatch<React.SetStateAction<string>>;
28
+ allowedCountryCodes?: SupportedSmsCountry[];
27
29
  }) {
28
30
  const selectRef = useRef<HTMLSelectElement>(null);
29
31
 
30
- const supportedCountriesForSms = supportedSmsCountries ?? [
31
- {
32
- countryIsoCode: "US",
33
- countryName: "United States",
34
- phoneNumberCode: 1,
35
- },
36
- ];
32
+ const supportedCountriesForSms =
33
+ allowedCountryCodes && allowedCountryCodes.length > 0
34
+ ? supportedSmsCountries.filter((c) =>
35
+ allowedCountryCodes.includes(c.countryIsoCode as SupportedSmsCountry),
36
+ )
37
+ : (supportedSmsCountries ?? [
38
+ {
39
+ countryIsoCode: "US",
40
+ countryName: "United States",
41
+ phoneNumberCode: 1,
42
+ },
43
+ ]);
37
44
 
38
45
  return (
39
46
  <>
@@ -42,4 +42,27 @@ describe("InputSelectionUI", () => {
42
42
 
43
43
  expect(screen.getByRole("combobox")).toHaveValue("US +1");
44
44
  });
45
+
46
+ it("should filter countries based on allowedSmsCountryCodes", () => {
47
+ const mockGetCountrySelector = vi.mocked(getCountrySelector);
48
+ mockGetCountrySelector.mockReturnValue("IN +91");
49
+
50
+ render(
51
+ <InputSelectionUI
52
+ onSelect={vi.fn()}
53
+ placeholder=""
54
+ name=""
55
+ type=""
56
+ submitButtonText=""
57
+ format="phone"
58
+ allowedSmsCountryCodes={["IN", "BR"]}
59
+ />,
60
+ );
61
+
62
+ const options = screen.getAllByRole("option");
63
+ const optionTexts = options.map((o) => o.textContent);
64
+ expect(optionTexts.some((t) => t?.includes("India"))).toBe(true);
65
+ expect(optionTexts.some((t) => t?.includes("Brazil"))).toBe(true);
66
+ expect(optionTexts.some((t) => t?.includes("United States"))).toBe(false);
67
+ });
45
68
  });
@@ -24,11 +24,16 @@ export function InputSelectionUI(props: {
24
24
  format?: "phone";
25
25
  disabled?: boolean;
26
26
  defaultSmsCountryCode?: SupportedSmsCountry;
27
+ allowedSmsCountryCodes?: SupportedSmsCountry[];
27
28
  }) {
28
29
  const [countryCodeInfo, setCountryCodeInfo] = useState(
29
30
  props.defaultSmsCountryCode
30
31
  ? getCountrySelector(props.defaultSmsCountryCode)
31
- : "US +1",
32
+ : props.allowedSmsCountryCodes &&
33
+ props.allowedSmsCountryCodes.length > 0 &&
34
+ props.allowedSmsCountryCodes[0]
35
+ ? getCountrySelector(props.allowedSmsCountryCodes[0])
36
+ : "US +1",
32
37
  );
33
38
  const [input, setInput] = useState("");
34
39
  const [error, setError] = useState<string | undefined>();
@@ -69,6 +74,7 @@ export function InputSelectionUI(props: {
69
74
  <CountrySelector
70
75
  countryCode={countryCodeInfo}
71
76
  setCountryCode={setCountryCodeInfo}
77
+ allowedCountryCodes={props.allowedSmsCountryCodes}
72
78
  />
73
79
  )}
74
80
  <Input
@@ -451,6 +451,9 @@ export const ConnectWalletSocialOptions = (
451
451
  defaultSmsCountryCode={
452
452
  wallet.getConfig()?.auth?.defaultSmsCountryCode
453
453
  }
454
+ allowedSmsCountryCodes={
455
+ wallet.getConfig()?.auth?.allowedSmsCountryCodes
456
+ }
454
457
  />
455
458
  ) : (
456
459
  <WalletTypeRowButton