@b3dotfun/sdk 0.1.66 → 0.1.68

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 (365) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +9 -0
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +40 -11
  3. package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
  4. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
  5. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
  6. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
  7. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  8. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  9. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +9 -0
  10. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +16 -14
  11. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
  12. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +40 -10
  13. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
  14. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +5 -4
  15. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
  16. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
  17. package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +7 -1
  18. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
  19. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
  20. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
  21. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
  22. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  23. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
  24. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
  25. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
  26. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  27. package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +11 -0
  28. package/dist/cjs/anyspend/react/components/AnySpendTournament.js +2 -2
  29. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
  30. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
  31. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
  32. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
  33. package/dist/cjs/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
  34. package/dist/cjs/anyspend/react/components/checkout/AddressForm.js +14 -0
  35. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
  36. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +158 -0
  37. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
  38. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +61 -0
  39. package/dist/cjs/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
  40. package/dist/cjs/anyspend/react/components/checkout/CartItemRow.js +9 -0
  41. package/dist/cjs/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
  42. package/dist/cjs/anyspend/react/components/checkout/CartSummary.js +20 -0
  43. package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
  44. package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.js +27 -0
  45. package/dist/cjs/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
  46. package/dist/cjs/anyspend/react/components/checkout/CheckoutFormField.js +31 -0
  47. package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
  48. package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.js +75 -0
  49. package/dist/cjs/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
  50. package/dist/cjs/anyspend/react/components/checkout/CheckoutLayout.js +13 -0
  51. package/dist/cjs/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
  52. package/dist/cjs/anyspend/react/components/checkout/CheckoutOrderStatus.js +65 -0
  53. package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
  54. package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +64 -0
  55. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
  56. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +31 -0
  57. package/dist/cjs/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
  58. package/dist/cjs/anyspend/react/components/checkout/CoinbaseCheckoutPanel.js +170 -0
  59. package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
  60. package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +324 -0
  61. package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
  62. package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.js +62 -0
  63. package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
  64. package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.js +269 -0
  65. package/dist/cjs/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
  66. package/dist/cjs/anyspend/react/components/checkout/PoweredByBranding.js +9 -0
  67. package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
  68. package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.js +20 -0
  69. package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +19 -5
  70. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +1 -1
  71. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethodDisplay.js +1 -1
  72. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +1 -1
  73. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +4 -4
  74. package/dist/cjs/anyspend/react/components/common/OrderStatus.d.ts +2 -1
  75. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +93 -19
  76. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -4
  77. package/dist/cjs/anyspend/react/components/common/PaySection.js +1 -1
  78. package/dist/cjs/anyspend/react/components/common/StepProgress.d.ts +5 -1
  79. package/dist/cjs/anyspend/react/components/common/StepProgress.js +6 -11
  80. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +1 -1
  81. package/dist/cjs/anyspend/react/components/common/TransferResultScreen.js +5 -1
  82. package/dist/cjs/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
  83. package/dist/cjs/anyspend/react/components/context/AnySpendCustomizationContext.js +92 -0
  84. package/dist/cjs/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
  85. package/dist/cjs/anyspend/react/components/icons/AnimatedCheckmark.js +71 -0
  86. package/dist/cjs/anyspend/react/components/index.d.ts +8 -1
  87. package/dist/cjs/anyspend/react/components/index.js +10 -1
  88. package/dist/cjs/anyspend/react/components/types/classes.d.ts +50 -0
  89. package/dist/cjs/anyspend/react/components/types/customization.d.ts +75 -0
  90. package/dist/cjs/anyspend/react/components/types/customization.js +2 -0
  91. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
  92. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
  93. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
  94. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +3 -2
  95. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
  96. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -0
  97. package/dist/cjs/anyspend/services/anyspend.d.ts +1 -0
  98. package/dist/cjs/anyspend/services/anyspend.js +17 -2
  99. package/dist/cjs/anyspend/types/forms.d.ts +92 -0
  100. package/dist/cjs/anyspend/types/forms.js +8 -0
  101. package/dist/cjs/anyspend/utils/format.js +12 -3
  102. package/dist/cjs/app.shared.js +8 -0
  103. package/dist/cjs/global-account/react/components/B3DynamicModal.js +9 -3
  104. package/dist/cjs/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  105. package/dist/cjs/global-account/react/components/ui/command.d.ts +7 -7
  106. package/dist/cjs/global-account/react/components/ui/dialog.d.ts +2 -0
  107. package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
  108. package/dist/cjs/global-account/react/components/ui/drawer.d.ts +3 -1
  109. package/dist/cjs/global-account/react/components/ui/drawer.js +1 -1
  110. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +1 -1
  111. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
  112. package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -4
  113. package/dist/cjs/global-account/react/hooks/useUser.d.ts +1 -1
  114. package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +1 -1
  115. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +53 -1
  116. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +2 -2
  117. package/dist/cjs/shared/constants/chains/supported.d.ts +3 -3
  118. package/dist/cjs/shared/utils/number.d.ts +5 -0
  119. package/dist/cjs/shared/utils/number.js +13 -0
  120. package/dist/esm/anyspend/react/components/AnySpend.d.ts +9 -0
  121. package/dist/esm/anyspend/react/components/AnySpend.js +41 -12
  122. package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
  123. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
  124. package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
  125. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
  126. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  127. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  128. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +9 -0
  129. package/dist/esm/anyspend/react/components/AnySpendCustom.js +16 -14
  130. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
  131. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +42 -12
  132. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
  133. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +5 -4
  134. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
  135. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
  136. package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +7 -1
  137. package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
  138. package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
  139. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
  140. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
  141. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  142. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
  143. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
  144. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
  145. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  146. package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +11 -0
  147. package/dist/esm/anyspend/react/components/AnySpendTournament.js +2 -2
  148. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
  149. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
  150. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
  151. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
  152. package/dist/esm/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
  153. package/dist/esm/anyspend/react/components/checkout/AddressForm.js +11 -0
  154. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
  155. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +155 -0
  156. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
  157. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +58 -0
  158. package/dist/esm/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
  159. package/dist/esm/anyspend/react/components/checkout/CartItemRow.js +6 -0
  160. package/dist/esm/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
  161. package/dist/esm/anyspend/react/components/checkout/CartSummary.js +17 -0
  162. package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
  163. package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.js +24 -0
  164. package/dist/esm/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
  165. package/dist/esm/anyspend/react/components/checkout/CheckoutFormField.js +28 -0
  166. package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
  167. package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.js +72 -0
  168. package/dist/esm/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
  169. package/dist/esm/anyspend/react/components/checkout/CheckoutLayout.js +10 -0
  170. package/dist/esm/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
  171. package/dist/esm/anyspend/react/components/checkout/CheckoutOrderStatus.js +62 -0
  172. package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
  173. package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +61 -0
  174. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
  175. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +28 -0
  176. package/dist/esm/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
  177. package/dist/esm/anyspend/react/components/checkout/CoinbaseCheckoutPanel.js +167 -0
  178. package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
  179. package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +321 -0
  180. package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
  181. package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.js +59 -0
  182. package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
  183. package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.js +266 -0
  184. package/dist/esm/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
  185. package/dist/esm/anyspend/react/components/checkout/PoweredByBranding.js +6 -0
  186. package/dist/esm/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
  187. package/dist/esm/anyspend/react/components/checkout/ShippingSelector.js +17 -0
  188. package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +19 -5
  189. package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +1 -1
  190. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethodDisplay.js +1 -1
  191. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +1 -1
  192. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +4 -4
  193. package/dist/esm/anyspend/react/components/common/OrderStatus.d.ts +2 -1
  194. package/dist/esm/anyspend/react/components/common/OrderStatus.js +96 -22
  195. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +4 -4
  196. package/dist/esm/anyspend/react/components/common/PaySection.js +1 -1
  197. package/dist/esm/anyspend/react/components/common/StepProgress.d.ts +5 -1
  198. package/dist/esm/anyspend/react/components/common/StepProgress.js +6 -11
  199. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +1 -1
  200. package/dist/esm/anyspend/react/components/common/TransferResultScreen.js +7 -3
  201. package/dist/esm/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
  202. package/dist/esm/anyspend/react/components/context/AnySpendCustomizationContext.js +88 -0
  203. package/dist/esm/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
  204. package/dist/esm/anyspend/react/components/icons/AnimatedCheckmark.js +68 -0
  205. package/dist/esm/anyspend/react/components/index.d.ts +8 -1
  206. package/dist/esm/anyspend/react/components/index.js +5 -0
  207. package/dist/esm/anyspend/react/components/types/classes.d.ts +50 -0
  208. package/dist/esm/anyspend/react/components/types/customization.d.ts +75 -0
  209. package/dist/esm/anyspend/react/components/types/customization.js +1 -0
  210. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
  211. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
  212. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
  213. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +3 -2
  214. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
  215. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -0
  216. package/dist/esm/anyspend/services/anyspend.d.ts +1 -0
  217. package/dist/esm/anyspend/services/anyspend.js +17 -2
  218. package/dist/esm/anyspend/types/forms.d.ts +92 -0
  219. package/dist/esm/anyspend/types/forms.js +7 -0
  220. package/dist/esm/anyspend/utils/format.js +12 -3
  221. package/dist/esm/app.shared.js +8 -0
  222. package/dist/esm/global-account/react/components/B3DynamicModal.js +9 -3
  223. package/dist/esm/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  224. package/dist/esm/global-account/react/components/ui/command.d.ts +7 -7
  225. package/dist/esm/global-account/react/components/ui/dialog.d.ts +2 -0
  226. package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
  227. package/dist/esm/global-account/react/components/ui/drawer.d.ts +3 -1
  228. package/dist/esm/global-account/react/components/ui/drawer.js +1 -1
  229. package/dist/esm/global-account/react/hooks/useAuth.d.ts +1 -1
  230. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
  231. package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -4
  232. package/dist/esm/global-account/react/hooks/useUser.d.ts +1 -1
  233. package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +1 -1
  234. package/dist/esm/global-account/react/stores/useModalStore.d.ts +53 -1
  235. package/dist/esm/shared/constants/chains/b3Chain.d.ts +2 -2
  236. package/dist/esm/shared/constants/chains/supported.d.ts +3 -3
  237. package/dist/esm/shared/utils/number.d.ts +5 -0
  238. package/dist/esm/shared/utils/number.js +12 -0
  239. package/dist/styles/index.css +1 -1
  240. package/dist/types/anyspend/react/components/AnySpend.d.ts +9 -0
  241. package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
  242. package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
  243. package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  244. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +9 -0
  245. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
  246. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
  247. package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
  248. package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +7 -1
  249. package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
  250. package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
  251. package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
  252. package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
  253. package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +11 -0
  254. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
  255. package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
  256. package/dist/types/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
  257. package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
  258. package/dist/types/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
  259. package/dist/types/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
  260. package/dist/types/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
  261. package/dist/types/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
  262. package/dist/types/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
  263. package/dist/types/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
  264. package/dist/types/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
  265. package/dist/types/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
  266. package/dist/types/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
  267. package/dist/types/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
  268. package/dist/types/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
  269. package/dist/types/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
  270. package/dist/types/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
  271. package/dist/types/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
  272. package/dist/types/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
  273. package/dist/types/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
  274. package/dist/types/anyspend/react/components/common/OrderStatus.d.ts +2 -1
  275. package/dist/types/anyspend/react/components/common/StepProgress.d.ts +5 -1
  276. package/dist/types/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
  277. package/dist/types/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
  278. package/dist/types/anyspend/react/components/index.d.ts +8 -1
  279. package/dist/types/anyspend/react/components/types/classes.d.ts +50 -0
  280. package/dist/types/anyspend/react/components/types/customization.d.ts +75 -0
  281. package/dist/types/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
  282. package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
  283. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
  284. package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
  285. package/dist/types/anyspend/services/anyspend.d.ts +1 -0
  286. package/dist/types/anyspend/types/forms.d.ts +92 -0
  287. package/dist/types/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  288. package/dist/types/global-account/react/components/ui/command.d.ts +7 -7
  289. package/dist/types/global-account/react/components/ui/dialog.d.ts +2 -0
  290. package/dist/types/global-account/react/components/ui/drawer.d.ts +3 -1
  291. package/dist/types/global-account/react/hooks/useAuth.d.ts +1 -1
  292. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
  293. package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -4
  294. package/dist/types/global-account/react/hooks/useUser.d.ts +1 -1
  295. package/dist/types/global-account/react/hooks/useUserQuery.d.ts +1 -1
  296. package/dist/types/global-account/react/stores/useModalStore.d.ts +53 -1
  297. package/dist/types/shared/constants/chains/b3Chain.d.ts +2 -2
  298. package/dist/types/shared/constants/chains/supported.d.ts +3 -3
  299. package/dist/types/shared/utils/number.d.ts +5 -0
  300. package/package.json +1 -1
  301. package/src/anyspend/react/components/AnySpend.tsx +84 -37
  302. package/src/anyspend/react/components/AnySpendBondKit.tsx +12 -1
  303. package/src/anyspend/react/components/AnySpendBuySpin.tsx +14 -0
  304. package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +10 -0
  305. package/src/anyspend/react/components/AnySpendCustom.tsx +38 -20
  306. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +82 -35
  307. package/src/anyspend/react/components/AnySpendDeposit.tsx +24 -2
  308. package/src/anyspend/react/components/AnySpendDepositUpside.tsx +14 -0
  309. package/src/anyspend/react/components/AnySpendNFT.tsx +14 -0
  310. package/src/anyspend/react/components/AnySpendStakeB3.tsx +14 -0
  311. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +14 -0
  312. package/src/anyspend/react/components/AnySpendStakeUpside.tsx +14 -0
  313. package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +14 -0
  314. package/src/anyspend/react/components/AnySpendTournament.tsx +19 -0
  315. package/src/anyspend/react/components/AnyspendDepositHype.tsx +14 -0
  316. package/src/anyspend/react/components/AnyspendSignatureMint.tsx +10 -0
  317. package/src/anyspend/react/components/checkout/AddressForm.tsx +98 -0
  318. package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +398 -0
  319. package/src/anyspend/react/components/checkout/AnySpendCheckoutTrigger.tsx +221 -0
  320. package/src/anyspend/react/components/checkout/CartItemRow.tsx +58 -0
  321. package/src/anyspend/react/components/checkout/CartSummary.tsx +158 -0
  322. package/src/anyspend/react/components/checkout/CheckoutCartPanel.tsx +98 -0
  323. package/src/anyspend/react/components/checkout/CheckoutFormField.tsx +129 -0
  324. package/src/anyspend/react/components/checkout/CheckoutFormPanel.tsx +241 -0
  325. package/src/anyspend/react/components/checkout/CheckoutLayout.tsx +52 -0
  326. package/src/anyspend/react/components/checkout/CheckoutOrderStatus.tsx +224 -0
  327. package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +341 -0
  328. package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +110 -0
  329. package/src/anyspend/react/components/checkout/CoinbaseCheckoutPanel.tsx +279 -0
  330. package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +630 -0
  331. package/src/anyspend/react/components/checkout/DiscountCodeInput.tsx +127 -0
  332. package/src/anyspend/react/components/checkout/FiatCheckoutPanel.tsx +612 -0
  333. package/src/anyspend/react/components/checkout/PoweredByBranding.tsx +42 -0
  334. package/src/anyspend/react/components/checkout/ShippingSelector.tsx +73 -0
  335. package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +29 -7
  336. package/src/anyspend/react/components/common/CryptoPaySection.tsx +1 -1
  337. package/src/anyspend/react/components/common/CryptoPaymentMethodDisplay.tsx +1 -1
  338. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +2 -2
  339. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +5 -5
  340. package/src/anyspend/react/components/common/OrderStatus.tsx +140 -34
  341. package/src/anyspend/react/components/common/PanelOnramp.tsx +9 -9
  342. package/src/anyspend/react/components/common/PaySection.tsx +1 -1
  343. package/src/anyspend/react/components/common/StepProgress.tsx +40 -52
  344. package/src/anyspend/react/components/common/TokenBalance.tsx +0 -12
  345. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +1 -9
  346. package/src/anyspend/react/components/common/TransferResultScreen.tsx +19 -11
  347. package/src/anyspend/react/components/context/AnySpendCustomizationContext.tsx +124 -0
  348. package/src/anyspend/react/components/icons/AnimatedCheckmark.tsx +119 -0
  349. package/src/anyspend/react/components/index.ts +33 -0
  350. package/src/anyspend/react/components/types/classes.ts +70 -0
  351. package/src/anyspend/react/components/types/customization.ts +99 -0
  352. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +3 -2
  353. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +3 -2
  354. package/src/anyspend/react/hooks/useAnyspendFlow.ts +5 -1
  355. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +5 -2
  356. package/src/anyspend/services/anyspend.ts +19 -2
  357. package/src/anyspend/types/forms.ts +97 -0
  358. package/src/anyspend/utils/format.ts +12 -3
  359. package/src/app.shared.ts +11 -0
  360. package/src/global-account/react/components/B3DynamicModal.tsx +13 -4
  361. package/src/global-account/react/components/ui/dialog.tsx +17 -8
  362. package/src/global-account/react/components/ui/drawer.tsx +2 -2
  363. package/src/global-account/react/stores/useModalStore.ts +52 -1
  364. package/src/shared/utils/number.ts +12 -0
  365. package/src/styles/index.css +48 -2
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CheckoutLayout = CheckoutLayout;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const cn_1 = require("../../../../shared/utils/cn");
7
+ function CheckoutLayout({ mode, paymentPanel, cartPanel, classes }) {
8
+ const rightColumnWidth = mode === "page" ? 380 : 340;
9
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-checkout mx-auto w-full", classes?.root), style: {
10
+ ...(mode === "page" ? { maxWidth: 1100, padding: "2rem 1rem" } : undefined),
11
+ "--anyspend-cart-width": `${rightColumnWidth}px`,
12
+ }, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-checkout-grid", classes?.layout), children: [(0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-payment-col order-2", "rounded-2xl border border-gray-200 bg-white p-6 shadow-sm dark:border-neutral-700 dark:bg-neutral-900", classes?.paymentColumn), children: paymentPanel }), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-cart-col order-1", "rounded-2xl border border-gray-200 bg-gray-50 p-6 dark:border-neutral-700 dark:bg-neutral-800/50", classes?.cartColumn), children: cartPanel })] }) }));
13
+ }
@@ -0,0 +1,28 @@
1
+ import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
2
+ interface CheckoutOrderStatusProps {
3
+ /** The order ID to track */
4
+ orderId: string;
5
+ /** Theme color (hex) */
6
+ themeColor?: string;
7
+ /** Return URL for the terminal success state */
8
+ returnUrl?: string;
9
+ /** Label for the return button */
10
+ returnLabel?: string;
11
+ /** Called when the order reaches "executed" */
12
+ onSuccess?: (result: {
13
+ txHash?: string;
14
+ orderId?: string;
15
+ }) => void;
16
+ /** Called when the order reaches a failure/expired/refunded terminal state */
17
+ onError?: (error: Error) => void;
18
+ /** Called when the user clicks "Try again" on failure */
19
+ onRetry?: () => void;
20
+ /** Show the points row in the order status summary. Defaults to false. */
21
+ showPoints?: boolean;
22
+ /** Show the order ID row in the order status summary. Defaults to false. */
23
+ showOrderId?: boolean;
24
+ /** Custom class names */
25
+ classes?: AnySpendCheckoutClasses;
26
+ }
27
+ export declare function CheckoutOrderStatus({ orderId, themeColor, returnUrl, returnLabel, onSuccess, onError, onRetry, showPoints, showOrderId, classes, }: CheckoutOrderStatusProps): import("react/jsx-runtime").JSX.Element;
28
+ export {};
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CheckoutOrderStatus = CheckoutOrderStatus;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const anyspend_1 = require("../../../../anyspend");
7
+ const useAnyspendOrderAndTransactions_1 = require("../../../../anyspend/react/hooks/useAnyspendOrderAndTransactions");
8
+ const useOnOrderSuccess_1 = require("../../../../anyspend/react/hooks/useOnOrderSuccess");
9
+ const react_1 = require("../../../../global-account/react");
10
+ const cn_1 = require("../../../../shared/utils/cn");
11
+ const formatNumber_1 = require("../../../../shared/utils/formatNumber");
12
+ const lucide_react_1 = require("lucide-react");
13
+ const react_2 = require("motion/react");
14
+ const react_3 = require("react");
15
+ const AnySpendCustomizationContext_1 = require("../context/AnySpendCustomizationContext");
16
+ const OrderStatus_1 = require("../common/OrderStatus");
17
+ function CheckoutOrderStatus({ orderId, themeColor, returnUrl, returnLabel, onSuccess, onError, onRetry, showPoints = false, showOrderId = false, classes, }) {
18
+ // Stable refs for callback props to avoid re-triggering effects
19
+ const onErrorRef = (0, react_3.useRef)(onError);
20
+ onErrorRef.current = onError;
21
+ const { orderAndTransactions, isLoadingOrderAndTransactions } = (0, useAnyspendOrderAndTransactions_1.useAnyspendOrderAndTransactions)(orderId);
22
+ const order = orderAndTransactions?.data?.order;
23
+ const executeTx = orderAndTransactions?.data?.executeTx;
24
+ const points = orderAndTransactions?.data?.points;
25
+ const { content } = (0, AnySpendCustomizationContext_1.useAnySpendCustomization)();
26
+ // Fire onSuccess when order reaches "executed"
27
+ (0, useOnOrderSuccess_1.useOnOrderSuccess)({
28
+ orderData: orderAndTransactions,
29
+ orderId,
30
+ onSuccess: (txHash) => onSuccess?.({ orderId, txHash }),
31
+ });
32
+ // Fire onError once for terminal failure states
33
+ const onErrorCalled = (0, react_3.useRef)(false);
34
+ (0, react_3.useEffect)(() => {
35
+ if (!order || onErrorCalled.current)
36
+ return;
37
+ if (order.status === "failure" || order.status === "expired" || order.status === "refunded") {
38
+ const { description } = (0, anyspend_1.getStatusDisplay)(order);
39
+ onErrorRef.current?.(new Error(description || `Order ${order.status}`));
40
+ onErrorCalled.current = true;
41
+ }
42
+ }, [order]);
43
+ // Reset error flag if orderId changes
44
+ const prevOrderId = (0, react_3.useRef)(orderId);
45
+ (0, react_3.useEffect)(() => {
46
+ if (prevOrderId.current !== orderId) {
47
+ onErrorCalled.current = false;
48
+ prevOrderId.current = orderId;
49
+ }
50
+ }, [orderId]);
51
+ // Clear persisted orderId when order reaches a terminal state
52
+ const orderStatus = order?.status;
53
+ (0, react_3.useEffect)(() => {
54
+ if (orderStatus && ["executed", "failure", "expired", "refunded"].includes(orderStatus)) {
55
+ sessionStorage.removeItem("anyspend_checkout_orderId");
56
+ }
57
+ }, [orderStatus]);
58
+ // Loading state
59
+ if (isLoadingOrderAndTransactions || !order) {
60
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex flex-col items-center gap-3 py-12", classes?.orderStatusPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-6 w-6 animate-spin text-gray-400" }), (0, jsx_runtime_1.jsx)(react_1.TextShimmer, { duration: 1.5, className: "text-sm", children: "Loading order status..." })] }));
61
+ }
62
+ const isExecuted = order.status === "executed";
63
+ const isRefunding = order.status === "refunding";
64
+ return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-checkout-order-status flex flex-col items-center gap-5 py-6", classes?.orderStatusPanel), children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order }), (showPoints || showOrderId) && ((0, jsx_runtime_1.jsx)(react_2.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, delay: 0.15 }, className: "bg-as-surface-secondary border-as-border-secondary w-full rounded-xl border px-4 py-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2 text-sm", children: [showPoints && points != null && points > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiary", children: "Points" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-brand font-semibold", children: ["+", (0, formatNumber_1.formatNumber)(points), " pts"] })] }), showOrderId && (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" })] })), showOrderId && ((0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiary shrink-0", children: "Order ID" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: order.id })] }))] }) })), isExecuted && executeTx && ((0, jsx_runtime_1.jsxs)(react_2.motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.3, ease: "easeOut" }, href: (0, anyspend_1.getExplorerTxUrl)(order.dstChain, executeTx.txHash), target: "_blank", rel: "noopener noreferrer", className: (0, cn_1.cn)("flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400", classes?.transactionLink), children: ["View Transaction", (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "h-3.5 w-3.5" })] })), order.status === "failure" && order.errorDetails && ((0, jsx_runtime_1.jsx)(react_2.motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.2, delay: 0.2 }, className: "max-w-[40ch] text-center text-sm text-red-500 dark:text-red-400", children: (0, anyspend_1.getErrorDisplay)(order.errorDetails) })), (order.status === "failure" || order.status === "expired") && onRetry && ((0, jsx_runtime_1.jsxs)(react_2.motion.button, { initial: { opacity: 0, y: 6 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, delay: 0.3 }, onClick: onRetry, className: (0, cn_1.cn)("flex items-center gap-2 rounded-xl px-6 py-3 text-sm font-medium transition-colors", "bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-neutral-800 dark:text-gray-300 dark:hover:bg-neutral-700", classes?.retryButton), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "h-4 w-4" }), content.retryButtonLabel || "Try Again"] })), (isExecuted || order.status === "refunded") && returnUrl && ((0, jsx_runtime_1.jsx)(react_2.motion.a, { initial: { opacity: 0, y: 6 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, delay: 0.4 }, href: returnUrl, className: (0, cn_1.cn)("inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors", classes?.returnButton), style: { backgroundColor: themeColor || "#111827", color: "#fff" }, children: content.returnButtonLabel || returnLabel || "Return to Store" })), isRefunding && ((0, jsx_runtime_1.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please wait while your funds are being returned." }))] }));
65
+ }
@@ -0,0 +1,31 @@
1
+ import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
2
+ export type PaymentMethod = "crypto" | "card" | "coinbase";
3
+ interface CheckoutPaymentPanelProps {
4
+ recipientAddress: string;
5
+ destinationTokenAddress: string;
6
+ destinationTokenChainId: number;
7
+ totalAmount: string;
8
+ buttonText?: string;
9
+ themeColor?: string;
10
+ returnUrl?: string;
11
+ returnLabel?: string;
12
+ onSuccess?: (result: {
13
+ txHash?: string;
14
+ orderId?: string;
15
+ }) => void;
16
+ onError?: (error: Error) => void;
17
+ callbackMetadata?: Record<string, unknown>;
18
+ classes?: AnySpendCheckoutClasses;
19
+ /** Which payment method to expand initially. Defaults to none (all collapsed). */
20
+ defaultPaymentMethod?: PaymentMethod;
21
+ /** Optional sender (payer) address — pre-fills token balances in the crypto panel */
22
+ senderAddress?: string;
23
+ /** Show the points row in the order status summary. Defaults to false. */
24
+ showPoints?: boolean;
25
+ /** Show the order ID row in the order status summary. Defaults to false. */
26
+ showOrderId?: boolean;
27
+ /** Whether the checkout form is valid. When false, payment methods are disabled. */
28
+ isFormValid?: boolean;
29
+ }
30
+ export declare function CheckoutPaymentPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, buttonText, themeColor, returnUrl, returnLabel, onSuccess, onError, callbackMetadata, classes, defaultPaymentMethod, senderAddress, showPoints, showOrderId, isFormValid, }: CheckoutPaymentPanelProps): import("react/jsx-runtime").JSX.Element;
31
+ export {};
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CheckoutPaymentPanel = CheckoutPaymentPanel;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const cn_1 = require("../../../../shared/utils/cn");
7
+ const lucide_react_1 = require("lucide-react");
8
+ const react_1 = require("motion/react");
9
+ const react_2 = require("react");
10
+ const CheckoutOrderStatus_1 = require("./CheckoutOrderStatus");
11
+ const CoinbaseCheckoutPanel_1 = require("./CoinbaseCheckoutPanel");
12
+ const CryptoPayPanel_1 = require("./CryptoPayPanel");
13
+ const FiatCheckoutPanel_1 = require("./FiatCheckoutPanel");
14
+ const SESSION_STORAGE_KEY = "anyspend_checkout_orderId";
15
+ function RadioCircle({ selected, themeColor }) {
16
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border-2 transition-colors", selected ? "border-blue-600" : "border-gray-300 dark:border-neutral-600"), style: selected && themeColor ? { borderColor: themeColor } : undefined, children: selected && ((0, jsx_runtime_1.jsx)("div", { className: "h-2 w-2 rounded-full bg-blue-600", style: themeColor ? { backgroundColor: themeColor } : undefined })) }));
17
+ }
18
+ /** Card brand logos - all use consistent 32x20 viewBox */
19
+ function VisaLogo() {
20
+ return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 32 20", style: { width: 32, height: 20 }, "aria-label": "Visa", children: [(0, jsx_runtime_1.jsx)("rect", { width: "32", height: "20", rx: "3", fill: "#1A1F71" }), (0, jsx_runtime_1.jsx)("text", { x: "16", y: "13.5", textAnchor: "middle", fill: "white", fontSize: "9", fontWeight: "bold", fontFamily: "sans-serif", fontStyle: "italic", children: "VISA" })] }));
21
+ }
22
+ function MastercardLogo() {
23
+ return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 32 20", style: { width: 32, height: 20 }, "aria-label": "Mastercard", children: [(0, jsx_runtime_1.jsx)("rect", { width: "32", height: "20", rx: "3", fill: "#252525" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12.5", cy: "10", r: "6", fill: "#EB001B" }), (0, jsx_runtime_1.jsx)("circle", { cx: "19.5", cy: "10", r: "6", fill: "#F79E1B" }), (0, jsx_runtime_1.jsx)("path", { d: "M16 5.6a6 6 0 0 1 0 8.8 6 6 0 0 1 0-8.8z", fill: "#FF5F00" })] }));
24
+ }
25
+ function AmexLogo() {
26
+ return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 32 20", style: { width: 32, height: 20 }, "aria-label": "Amex", children: [(0, jsx_runtime_1.jsx)("rect", { width: "32", height: "20", rx: "3", fill: "#006FCF" }), (0, jsx_runtime_1.jsx)("text", { x: "16", y: "13", textAnchor: "middle", fill: "white", fontSize: "7", fontWeight: "bold", fontFamily: "sans-serif", children: "AMEX" })] }));
27
+ }
28
+ /** Coinbase mark */
29
+ function CoinbaseLogo() {
30
+ return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 24 24", style: { width: 20, height: 20 }, "aria-label": "Coinbase", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "12", fill: "#0052FF" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 4.5a7.5 7.5 0 1 0 0 15 7.5 7.5 0 0 0 0-15zm-1.8 4.8h3.6c.33 0 .6.27.6.6v4.2c0 .33-.27.6-.6.6h-3.6a.6.6 0 0 1-.6-.6V9.9c0-.33.27-.6.6-.6z", fill: "white" })] }));
31
+ }
32
+ function CheckoutPaymentPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, buttonText, themeColor, returnUrl, returnLabel, onSuccess, onError, callbackMetadata, classes, defaultPaymentMethod, senderAddress, showPoints, showOrderId, isFormValid = true, }) {
33
+ const [paymentMethod, setPaymentMethod] = (0, react_2.useState)(defaultPaymentMethod ?? null);
34
+ // Restore activeOrderId from sessionStorage (handles page refresh / Coinbase return)
35
+ const [activeOrderId, setActiveOrderId] = (0, react_2.useState)(() => {
36
+ if (typeof window !== "undefined") {
37
+ return sessionStorage.getItem(SESSION_STORAGE_KEY) || null;
38
+ }
39
+ return null;
40
+ });
41
+ // Persist activeOrderId to sessionStorage
42
+ (0, react_2.useEffect)(() => {
43
+ if (activeOrderId) {
44
+ sessionStorage.setItem(SESSION_STORAGE_KEY, activeOrderId);
45
+ }
46
+ else {
47
+ sessionStorage.removeItem(SESSION_STORAGE_KEY);
48
+ }
49
+ }, [activeOrderId]);
50
+ const handleOrderCreated = (0, react_2.useCallback)((orderId) => {
51
+ setActiveOrderId(orderId);
52
+ }, []);
53
+ const handleRetry = (0, react_2.useCallback)(() => {
54
+ setActiveOrderId(null);
55
+ }, []);
56
+ if (activeOrderId) {
57
+ return ((0, jsx_runtime_1.jsx)(CheckoutOrderStatus_1.CheckoutOrderStatus, { orderId: activeOrderId, themeColor: themeColor, returnUrl: returnUrl, returnLabel: returnLabel, onSuccess: onSuccess, onError: onError, onRetry: handleRetry, showPoints: showPoints, showOrderId: showOrderId, classes: classes }));
58
+ }
59
+ const accordionButtonClass = (active) => (0, cn_1.cn)("anyspend-payment-method-btn flex w-full items-center gap-3 px-4 py-4 text-left transition-colors", active
60
+ ? "bg-white dark:bg-neutral-900"
61
+ : "bg-white hover:bg-gray-50 dark:bg-neutral-900 dark:hover:bg-neutral-800", classes?.paymentMethodButton);
62
+ const expandedPanelClass = (0, cn_1.cn)("anyspend-payment-method-panel border-t border-gray-100 bg-white px-4 py-4 dark:border-neutral-800 dark:bg-neutral-900");
63
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-payment-panel flex flex-col gap-5", classes?.paymentPanel), children: [(0, jsx_runtime_1.jsx)("h2", { className: (0, cn_1.cn)("anyspend-payment-title text-lg font-semibold text-gray-900 dark:text-gray-100", classes?.paymentTitle), children: "Payment" }), !isFormValid && ((0, jsx_runtime_1.jsx)("p", { className: "text-sm text-amber-600 dark:text-amber-400", children: "Please complete the required fields above before proceeding to payment." })), (0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-payment-methods divide-y divide-gray-200 overflow-hidden rounded-xl border border-gray-200 dark:divide-neutral-700 dark:border-neutral-700", !isFormValid && "pointer-events-none opacity-50", classes?.paymentMethodSelector), children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-method-crypto", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setPaymentMethod(paymentMethod === "crypto" ? null : "crypto"), className: accordionButtonClass(paymentMethod === "crypto"), children: [(0, jsx_runtime_1.jsx)(RadioCircle, { selected: paymentMethod === "crypto", themeColor: themeColor }), (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Pay with crypto" })] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { initial: false, children: paymentMethod === "crypto" && ((0, jsx_runtime_1.jsx)(react_1.motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, children: (0, jsx_runtime_1.jsx)("div", { className: expandedPanelClass, children: (0, jsx_runtime_1.jsx)(CryptoPayPanel_1.CryptoPayPanel, { recipientAddress: recipientAddress, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, totalAmount: totalAmount, buttonText: buttonText, themeColor: themeColor, onOrderCreated: handleOrderCreated, onError: onError, callbackMetadata: callbackMetadata, classes: classes, senderAddress: senderAddress }) }) }, "crypto-panel")) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-method-card", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setPaymentMethod(paymentMethod === "card" ? null : "card"), className: accordionButtonClass(paymentMethod === "card"), children: [(0, jsx_runtime_1.jsx)(RadioCircle, { selected: paymentMethod === "card", themeColor: themeColor }), (0, jsx_runtime_1.jsx)(lucide_react_1.CreditCard, { className: "h-5 w-5 text-gray-700 dark:text-gray-300" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Credit or debit card" }), (0, jsx_runtime_1.jsxs)("div", { className: "ml-auto flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)(VisaLogo, {}), (0, jsx_runtime_1.jsx)(MastercardLogo, {}), (0, jsx_runtime_1.jsx)(AmexLogo, {})] })] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { initial: false, children: paymentMethod === "card" && ((0, jsx_runtime_1.jsx)(react_1.motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, children: (0, jsx_runtime_1.jsx)("div", { className: expandedPanelClass, children: (0, jsx_runtime_1.jsx)(FiatCheckoutPanel_1.FiatCheckoutPanel, { recipientAddress: recipientAddress, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, totalAmount: totalAmount, themeColor: themeColor, onOrderCreated: handleOrderCreated, onError: onError, callbackMetadata: callbackMetadata, classes: classes }) }) }, "card-panel")) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-method-coinbase", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setPaymentMethod(paymentMethod === "coinbase" ? null : "coinbase"), className: accordionButtonClass(paymentMethod === "coinbase"), children: [(0, jsx_runtime_1.jsx)(RadioCircle, { selected: paymentMethod === "coinbase", themeColor: themeColor }), (0, jsx_runtime_1.jsx)(CoinbaseLogo, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Coinbase Pay" })] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { initial: false, children: paymentMethod === "coinbase" && ((0, jsx_runtime_1.jsx)(react_1.motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, children: (0, jsx_runtime_1.jsx)("div", { className: expandedPanelClass, children: (0, jsx_runtime_1.jsx)(CoinbaseCheckoutPanel_1.CoinbaseCheckoutPanel, { recipientAddress: recipientAddress, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, totalAmount: totalAmount, themeColor: themeColor, onOrderCreated: handleOrderCreated, onError: onError, callbackMetadata: callbackMetadata, classes: classes }) }) }, "coinbase-panel")) })] })] })] }));
64
+ }
@@ -0,0 +1,10 @@
1
+ import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
2
+ interface CheckoutSuccessProps {
3
+ txHash?: string;
4
+ orderId?: string;
5
+ returnUrl?: string;
6
+ returnLabel?: string;
7
+ classes?: AnySpendCheckoutClasses;
8
+ }
9
+ export declare function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CheckoutSuccess = CheckoutSuccess;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const cn_1 = require("../../../../shared/utils/cn");
7
+ const lucide_react_1 = require("lucide-react");
8
+ const react_1 = require("motion/react");
9
+ const AnySpendCustomizationContext_1 = require("../context/AnySpendCustomizationContext");
10
+ const AnimatedCheckmark_1 = require("../icons/AnimatedCheckmark");
11
+ function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }) {
12
+ const { content, slots } = (0, AnySpendCustomizationContext_1.useAnySpendCustomization)();
13
+ if (slots.successScreen) {
14
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: slots.successScreen({
15
+ title: typeof content.successTitle === "string" ? content.successTitle : "Payment Successful",
16
+ description: typeof content.successDescription === "string"
17
+ ? content.successDescription
18
+ : "Your payment has been processed successfully.",
19
+ txHash,
20
+ orderId,
21
+ explorerUrl: txHash ? `https://explorer.b3.fun/tx/${txHash}` : undefined,
22
+ onDone: () => {
23
+ if (returnUrl)
24
+ window.location.href = returnUrl;
25
+ },
26
+ returnUrl,
27
+ returnLabel: content.returnButtonLabel || returnLabel,
28
+ }) }));
29
+ }
30
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-success-icon mb-4", children: (0, jsx_runtime_1.jsx)(AnimatedCheckmark_1.AnimatedCheckmark, { className: "h-16 w-16" }) }), (0, jsx_runtime_1.jsx)(react_1.motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), (0, jsx_runtime_1.jsx)(react_1.motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && ((0, jsx_runtime_1.jsxs)(react_1.motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: `https://explorer.b3.fun/tx/${txHash}`, target: "_blank", rel: "noopener noreferrer", className: "anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400", children: ["View Transaction", (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "h-3.5 w-3.5" })] })), !txHash && orderId && ((0, jsx_runtime_1.jsxs)(react_1.motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, className: "anyspend-success-order-id mt-4 text-xs text-gray-400 dark:text-gray-500", children: ["Order ID: ", orderId] })), returnUrl && ((0, jsx_runtime_1.jsx)(react_1.motion.a, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 0.6, ease: "easeOut" }, href: returnUrl, className: (0, cn_1.cn)("anyspend-success-return-btn mt-6 inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors", classes?.returnButton), style: { backgroundColor: "#111827", color: "#fff" }, children: content.returnButtonLabel || returnLabel || "Return to Store" }))] }));
31
+ }
@@ -0,0 +1,20 @@
1
+ import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
2
+ interface CoinbaseCheckoutPanelProps {
3
+ recipientAddress: string;
4
+ destinationTokenAddress: string;
5
+ destinationTokenChainId: number;
6
+ totalAmount: string;
7
+ themeColor?: string;
8
+ /** @deprecated Use onOrderCreated instead. Kept for backward compatibility. */
9
+ onSuccess?: (result: {
10
+ txHash?: string;
11
+ orderId?: string;
12
+ }) => void;
13
+ /** Called when order is created — triggers lifecycle tracking in parent */
14
+ onOrderCreated?: (orderId: string) => void;
15
+ onError?: (error: Error) => void;
16
+ callbackMetadata?: Record<string, unknown>;
17
+ classes?: AnySpendCheckoutClasses;
18
+ }
19
+ export declare function CoinbaseCheckoutPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, themeColor, onSuccess, onOrderCreated, onError, callbackMetadata, }: CoinbaseCheckoutPanelProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CoinbaseCheckoutPanel = CoinbaseCheckoutPanel;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("../../../../anyspend/react");
7
+ const anyspend_1 = require("../../../../anyspend/services/anyspend");
8
+ const number_1 = require("../../../../shared/utils/number");
9
+ const react_2 = require("../../../../global-account/react");
10
+ const lucide_react_1 = require("lucide-react");
11
+ const react_3 = require("motion/react");
12
+ const react_4 = require("react");
13
+ /** Map chain IDs to Coinbase blockchain identifiers */
14
+ const CHAIN_ID_TO_COINBASE_BLOCKCHAIN = {
15
+ 1: "ethereum",
16
+ 8453: "base",
17
+ 42161: "arbitrum",
18
+ 10: "optimism",
19
+ 137: "polygon",
20
+ 43114: "avalanche",
21
+ 56: "bsc",
22
+ };
23
+ function CoinbaseCheckoutPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, themeColor, onSuccess, onOrderCreated, onError, callbackMetadata, }) {
24
+ // Stable refs for callback props to avoid re-triggering effects
25
+ const onSuccessRef = (0, react_4.useRef)(onSuccess);
26
+ onSuccessRef.current = onSuccess;
27
+ const onOrderCreatedRef = (0, react_4.useRef)(onOrderCreated);
28
+ onOrderCreatedRef.current = onOrderCreated;
29
+ const onErrorRef = (0, react_4.useRef)(onError);
30
+ onErrorRef.current = onError;
31
+ const { data: tokenData } = (0, react_2.useTokenData)(destinationTokenChainId, destinationTokenAddress);
32
+ const formattedAmount = (0, react_4.useMemo)(() => {
33
+ const decimals = tokenData?.decimals || 18;
34
+ return (0, number_1.formatTokenAmount)(BigInt(totalAmount), decimals);
35
+ }, [totalAmount, tokenData]);
36
+ const { geoData, coinbaseAvailablePaymentMethods, isLoading } = (0, react_1.useGeoOnrampOptions)(formattedAmount);
37
+ // Order + redirect state
38
+ const [orderId, setOrderId] = (0, react_4.useState)(null);
39
+ const [isRedirecting, setIsRedirecting] = (0, react_4.useState)(false);
40
+ const [error, setError] = (0, react_4.useState)(null);
41
+ const orderCreatedRef = (0, react_4.useRef)(false);
42
+ const { createOrder, isCreatingOrder } = (0, react_1.useAnyspendCreateOnrampOrder)({
43
+ onSuccess: data => {
44
+ const id = data.data?.id;
45
+ if (id) {
46
+ setOrderId(id);
47
+ }
48
+ else {
49
+ setError("Failed to create Coinbase order. Please try again.");
50
+ }
51
+ },
52
+ onError: (err) => {
53
+ setError(err.message || "Failed to create payment order.");
54
+ onErrorRef.current?.(err);
55
+ },
56
+ });
57
+ // Once we have orderId, generate Coinbase onramp URL and redirect
58
+ (0, react_4.useEffect)(() => {
59
+ if (!orderId || isRedirecting)
60
+ return;
61
+ const blockchain = CHAIN_ID_TO_COINBASE_BLOCKCHAIN[destinationTokenChainId];
62
+ if (!blockchain) {
63
+ setError(`Coinbase Pay is not supported for this chain.`);
64
+ return;
65
+ }
66
+ const paymentMethodId = coinbaseAvailablePaymentMethods[0]?.id || "CARD";
67
+ setIsRedirecting(true);
68
+ anyspend_1.anyspendService
69
+ .getCoinbaseOnrampUrl({
70
+ presetFiatAmount: formattedAmount,
71
+ fiatCurrency: "USD",
72
+ defaultAsset: tokenData?.symbol || "USDC",
73
+ defaultPaymentMethod: paymentMethodId,
74
+ destinationAddress: recipientAddress,
75
+ blockchains: [blockchain],
76
+ country: geoData?.country || "US",
77
+ orderId,
78
+ redirectUrl: window.location.href,
79
+ useSessionToken: false,
80
+ })
81
+ .then(response => {
82
+ if (response.data?.url) {
83
+ // Persist orderId directly before redirect — useEffect won't run in time
84
+ if (orderId) {
85
+ sessionStorage.setItem("anyspend_checkout_orderId", orderId);
86
+ onOrderCreatedRef.current?.(orderId);
87
+ }
88
+ onSuccessRef.current?.({ orderId });
89
+ window.location.href = response.data.url;
90
+ }
91
+ else {
92
+ setError("Failed to generate Coinbase Pay URL.");
93
+ setIsRedirecting(false);
94
+ }
95
+ })
96
+ .catch(err => {
97
+ setError(err.message || "Failed to generate Coinbase Pay URL.");
98
+ setIsRedirecting(false);
99
+ onErrorRef.current?.(err instanceof Error ? err : new Error(err.message));
100
+ });
101
+ }, [
102
+ orderId,
103
+ isRedirecting,
104
+ destinationTokenChainId,
105
+ coinbaseAvailablePaymentMethods,
106
+ formattedAmount,
107
+ tokenData,
108
+ recipientAddress,
109
+ geoData,
110
+ ]);
111
+ const handleContinue = (0, react_4.useCallback)(() => {
112
+ if (isCreatingOrder || orderCreatedRef.current)
113
+ return;
114
+ setError(null);
115
+ orderCreatedRef.current = true;
116
+ const dstToken = {
117
+ address: destinationTokenAddress,
118
+ chainId: destinationTokenChainId,
119
+ decimals: tokenData?.decimals || 18,
120
+ symbol: tokenData?.symbol || "",
121
+ name: tokenData?.name || "",
122
+ metadata: { logoURI: tokenData?.logoURI || "" },
123
+ };
124
+ const paymentMethodId = coinbaseAvailablePaymentMethods[0]?.id || "CARD";
125
+ createOrder({
126
+ recipientAddress,
127
+ orderType: "swap",
128
+ dstChain: destinationTokenChainId,
129
+ dstToken,
130
+ srcFiatAmount: formattedAmount,
131
+ onramp: {
132
+ vendor: "coinbase",
133
+ paymentMethod: paymentMethodId,
134
+ country: geoData?.country || "US",
135
+ redirectUrl: window.location.href,
136
+ },
137
+ expectedDstAmount: totalAmount,
138
+ callbackMetadata,
139
+ });
140
+ }, [
141
+ isCreatingOrder,
142
+ destinationTokenAddress,
143
+ destinationTokenChainId,
144
+ tokenData,
145
+ coinbaseAvailablePaymentMethods,
146
+ recipientAddress,
147
+ formattedAmount,
148
+ geoData,
149
+ totalAmount,
150
+ callbackMetadata,
151
+ createOrder,
152
+ ]);
153
+ if (isLoading) {
154
+ return ((0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.2, ease: "easeOut" }, className: "anyspend-coinbase-loading flex items-center justify-center py-6", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-5 w-5 animate-spin text-gray-400" }), (0, jsx_runtime_1.jsx)(react_2.TextShimmer, { duration: 1.5, className: "ml-2 text-sm", children: "Checking availability..." })] }));
155
+ }
156
+ if (coinbaseAvailablePaymentMethods.length === 0) {
157
+ return ((0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: "anyspend-coinbase-unavailable py-4 text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Coinbase Pay is not available in your region for this amount." }) }));
158
+ }
159
+ const isProcessing = isCreatingOrder || isRedirecting;
160
+ return ((0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, ease: "easeOut" }, className: "anyspend-coinbase-panel flex flex-col gap-3", children: [(0, jsx_runtime_1.jsx)("p", { className: "anyspend-coinbase-description text-sm text-gray-600 dark:text-gray-400", children: "Pay with your Coinbase account using debit card, bank account, or crypto balance." }), (0, jsx_runtime_1.jsx)(react_3.AnimatePresence, { initial: false, children: error && ((0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, height: 0 }, animate: { opacity: 1, height: "auto" }, exit: { opacity: 0, height: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, className: "rounded-lg border border-red-200 bg-red-50 px-3 py-2 dark:border-red-800 dark:bg-red-900/20", children: (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: error }) }, "coinbase-error")) }), (0, jsx_runtime_1.jsx)(react_2.ShinyButton, { accentColor: themeColor || "#0052FF", onClick: () => {
161
+ if (error) {
162
+ // Reset state for retry
163
+ setError(null);
164
+ setOrderId(null);
165
+ setIsRedirecting(false);
166
+ orderCreatedRef.current = false;
167
+ }
168
+ handleContinue();
169
+ }, disabled: isProcessing, className: "anyspend-coinbase-btn w-full", textClassName: "text-white", children: isProcessing ? ((0, jsx_runtime_1.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), isRedirecting ? "Redirecting to Coinbase..." : "Creating order..."] })) : error ? ("Try again") : ("Continue with Coinbase") })] }));
170
+ }
@@ -0,0 +1,23 @@
1
+ import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
2
+ interface CryptoPayPanelProps {
3
+ recipientAddress: string;
4
+ destinationTokenAddress: string;
5
+ destinationTokenChainId: number;
6
+ totalAmount: string;
7
+ buttonText?: string;
8
+ themeColor?: string;
9
+ /** @deprecated Use onOrderCreated instead. Kept for backward compatibility. */
10
+ onSuccess?: (result: {
11
+ txHash?: string;
12
+ orderId?: string;
13
+ }) => void;
14
+ /** Called when an order is created and payment committed — triggers lifecycle tracking in parent */
15
+ onOrderCreated?: (orderId: string) => void;
16
+ onError?: (error: Error) => void;
17
+ callbackMetadata?: Record<string, unknown>;
18
+ classes?: AnySpendCheckoutClasses;
19
+ /** Optional sender address for pre-fetching balances. Falls back to connected wallet. */
20
+ senderAddress?: string;
21
+ }
22
+ export declare function CryptoPayPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, buttonText, themeColor, onSuccess, onOrderCreated, onError, callbackMetadata, classes, senderAddress, }: CryptoPayPanelProps): import("react/jsx-runtime").JSX.Element;
23
+ export {};