@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.
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +9 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +40 -11
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +9 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +16 -14
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +40 -10
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +5 -4
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +11 -0
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
- package/dist/cjs/anyspend/react/components/checkout/AddressForm.js +14 -0
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +158 -0
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +61 -0
- package/dist/cjs/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
- package/dist/cjs/anyspend/react/components/checkout/CartItemRow.js +9 -0
- package/dist/cjs/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
- package/dist/cjs/anyspend/react/components/checkout/CartSummary.js +20 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.js +27 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormField.js +31 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.js +75 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutLayout.js +13 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutOrderStatus.js +65 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +64 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
- package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +31 -0
- package/dist/cjs/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
- package/dist/cjs/anyspend/react/components/checkout/CoinbaseCheckoutPanel.js +170 -0
- package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
- package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +324 -0
- package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
- package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.js +62 -0
- package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
- package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.js +269 -0
- package/dist/cjs/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
- package/dist/cjs/anyspend/react/components/checkout/PoweredByBranding.js +9 -0
- package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
- package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.js +20 -0
- package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +19 -5
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +1 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethodDisplay.js +1 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +4 -4
- package/dist/cjs/anyspend/react/components/common/OrderStatus.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +93 -19
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -4
- package/dist/cjs/anyspend/react/components/common/PaySection.js +1 -1
- package/dist/cjs/anyspend/react/components/common/StepProgress.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/common/StepProgress.js +6 -11
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +1 -1
- package/dist/cjs/anyspend/react/components/common/TransferResultScreen.js +5 -1
- package/dist/cjs/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
- package/dist/cjs/anyspend/react/components/context/AnySpendCustomizationContext.js +92 -0
- package/dist/cjs/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
- package/dist/cjs/anyspend/react/components/icons/AnimatedCheckmark.js +71 -0
- package/dist/cjs/anyspend/react/components/index.d.ts +8 -1
- package/dist/cjs/anyspend/react/components/index.js +10 -1
- package/dist/cjs/anyspend/react/components/types/classes.d.ts +50 -0
- package/dist/cjs/anyspend/react/components/types/customization.d.ts +75 -0
- package/dist/cjs/anyspend/react/components/types/customization.js +2 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +3 -2
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -0
- package/dist/cjs/anyspend/services/anyspend.d.ts +1 -0
- package/dist/cjs/anyspend/services/anyspend.js +17 -2
- package/dist/cjs/anyspend/types/forms.d.ts +92 -0
- package/dist/cjs/anyspend/types/forms.js +8 -0
- package/dist/cjs/anyspend/utils/format.js +12 -3
- package/dist/cjs/app.shared.js +8 -0
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +9 -3
- package/dist/cjs/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/command.d.ts +7 -7
- package/dist/cjs/global-account/react/components/ui/dialog.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
- package/dist/cjs/global-account/react/components/ui/drawer.d.ts +3 -1
- package/dist/cjs/global-account/react/components/ui/drawer.js +1 -1
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -4
- package/dist/cjs/global-account/react/hooks/useUser.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +53 -1
- package/dist/cjs/shared/constants/chains/b3Chain.d.ts +2 -2
- package/dist/cjs/shared/constants/chains/supported.d.ts +3 -3
- package/dist/cjs/shared/utils/number.d.ts +5 -0
- package/dist/cjs/shared/utils/number.js +13 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +9 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +41 -12
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +9 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +16 -14
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +42 -12
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +5 -4
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +11 -0
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
- package/dist/esm/anyspend/react/components/checkout/AddressForm.js +11 -0
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +155 -0
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +58 -0
- package/dist/esm/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
- package/dist/esm/anyspend/react/components/checkout/CartItemRow.js +6 -0
- package/dist/esm/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
- package/dist/esm/anyspend/react/components/checkout/CartSummary.js +17 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.js +24 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormField.js +28 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.js +72 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutLayout.js +10 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutOrderStatus.js +62 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +61 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
- package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +28 -0
- package/dist/esm/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
- package/dist/esm/anyspend/react/components/checkout/CoinbaseCheckoutPanel.js +167 -0
- package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
- package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +321 -0
- package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
- package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.js +59 -0
- package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
- package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.js +266 -0
- package/dist/esm/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
- package/dist/esm/anyspend/react/components/checkout/PoweredByBranding.js +6 -0
- package/dist/esm/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
- package/dist/esm/anyspend/react/components/checkout/ShippingSelector.js +17 -0
- package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +19 -5
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +1 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethodDisplay.js +1 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +1 -1
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +4 -4
- package/dist/esm/anyspend/react/components/common/OrderStatus.d.ts +2 -1
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +96 -22
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +4 -4
- package/dist/esm/anyspend/react/components/common/PaySection.js +1 -1
- package/dist/esm/anyspend/react/components/common/StepProgress.d.ts +5 -1
- package/dist/esm/anyspend/react/components/common/StepProgress.js +6 -11
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +1 -1
- package/dist/esm/anyspend/react/components/common/TransferResultScreen.js +7 -3
- package/dist/esm/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
- package/dist/esm/anyspend/react/components/context/AnySpendCustomizationContext.js +88 -0
- package/dist/esm/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
- package/dist/esm/anyspend/react/components/icons/AnimatedCheckmark.js +68 -0
- package/dist/esm/anyspend/react/components/index.d.ts +8 -1
- package/dist/esm/anyspend/react/components/index.js +5 -0
- package/dist/esm/anyspend/react/components/types/classes.d.ts +50 -0
- package/dist/esm/anyspend/react/components/types/customization.d.ts +75 -0
- package/dist/esm/anyspend/react/components/types/customization.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +3 -2
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -0
- package/dist/esm/anyspend/services/anyspend.d.ts +1 -0
- package/dist/esm/anyspend/services/anyspend.js +17 -2
- package/dist/esm/anyspend/types/forms.d.ts +92 -0
- package/dist/esm/anyspend/types/forms.js +7 -0
- package/dist/esm/anyspend/utils/format.js +12 -3
- package/dist/esm/app.shared.js +8 -0
- package/dist/esm/global-account/react/components/B3DynamicModal.js +9 -3
- package/dist/esm/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/command.d.ts +7 -7
- package/dist/esm/global-account/react/components/ui/dialog.d.ts +2 -0
- package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
- package/dist/esm/global-account/react/components/ui/drawer.d.ts +3 -1
- package/dist/esm/global-account/react/components/ui/drawer.js +1 -1
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -4
- package/dist/esm/global-account/react/hooks/useUser.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +53 -1
- package/dist/esm/shared/constants/chains/b3Chain.d.ts +2 -2
- package/dist/esm/shared/constants/chains/supported.d.ts +3 -3
- package/dist/esm/shared/utils/number.d.ts +5 -0
- package/dist/esm/shared/utils/number.js +12 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +9 -0
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +9 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
- package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +11 -0
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
- package/dist/types/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
- package/dist/types/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
- package/dist/types/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
- package/dist/types/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
- package/dist/types/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
- package/dist/types/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
- package/dist/types/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
- package/dist/types/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
- package/dist/types/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
- package/dist/types/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
- package/dist/types/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
- package/dist/types/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
- package/dist/types/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
- package/dist/types/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
- package/dist/types/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
- package/dist/types/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
- package/dist/types/anyspend/react/components/common/OrderStatus.d.ts +2 -1
- package/dist/types/anyspend/react/components/common/StepProgress.d.ts +5 -1
- package/dist/types/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
- package/dist/types/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
- package/dist/types/anyspend/react/components/index.d.ts +8 -1
- package/dist/types/anyspend/react/components/types/classes.d.ts +50 -0
- package/dist/types/anyspend/react/components/types/customization.d.ts +75 -0
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
- package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
- package/dist/types/anyspend/services/anyspend.d.ts +1 -0
- package/dist/types/anyspend/types/forms.d.ts +92 -0
- package/dist/types/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/command.d.ts +7 -7
- package/dist/types/global-account/react/components/ui/dialog.d.ts +2 -0
- package/dist/types/global-account/react/components/ui/drawer.d.ts +3 -1
- package/dist/types/global-account/react/hooks/useAuth.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -4
- package/dist/types/global-account/react/hooks/useUser.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +53 -1
- package/dist/types/shared/constants/chains/b3Chain.d.ts +2 -2
- package/dist/types/shared/constants/chains/supported.d.ts +3 -3
- package/dist/types/shared/utils/number.d.ts +5 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +84 -37
- package/src/anyspend/react/components/AnySpendBondKit.tsx +12 -1
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +14 -0
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +10 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +38 -20
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +82 -35
- package/src/anyspend/react/components/AnySpendDeposit.tsx +24 -2
- package/src/anyspend/react/components/AnySpendDepositUpside.tsx +14 -0
- package/src/anyspend/react/components/AnySpendNFT.tsx +14 -0
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +14 -0
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +14 -0
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +14 -0
- package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +14 -0
- package/src/anyspend/react/components/AnySpendTournament.tsx +19 -0
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +14 -0
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +10 -0
- package/src/anyspend/react/components/checkout/AddressForm.tsx +98 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +398 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckoutTrigger.tsx +221 -0
- package/src/anyspend/react/components/checkout/CartItemRow.tsx +58 -0
- package/src/anyspend/react/components/checkout/CartSummary.tsx +158 -0
- package/src/anyspend/react/components/checkout/CheckoutCartPanel.tsx +98 -0
- package/src/anyspend/react/components/checkout/CheckoutFormField.tsx +129 -0
- package/src/anyspend/react/components/checkout/CheckoutFormPanel.tsx +241 -0
- package/src/anyspend/react/components/checkout/CheckoutLayout.tsx +52 -0
- package/src/anyspend/react/components/checkout/CheckoutOrderStatus.tsx +224 -0
- package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +341 -0
- package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +110 -0
- package/src/anyspend/react/components/checkout/CoinbaseCheckoutPanel.tsx +279 -0
- package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +630 -0
- package/src/anyspend/react/components/checkout/DiscountCodeInput.tsx +127 -0
- package/src/anyspend/react/components/checkout/FiatCheckoutPanel.tsx +612 -0
- package/src/anyspend/react/components/checkout/PoweredByBranding.tsx +42 -0
- package/src/anyspend/react/components/checkout/ShippingSelector.tsx +73 -0
- package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +29 -7
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +1 -1
- package/src/anyspend/react/components/common/CryptoPaymentMethodDisplay.tsx +1 -1
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +2 -2
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +5 -5
- package/src/anyspend/react/components/common/OrderStatus.tsx +140 -34
- package/src/anyspend/react/components/common/PanelOnramp.tsx +9 -9
- package/src/anyspend/react/components/common/PaySection.tsx +1 -1
- package/src/anyspend/react/components/common/StepProgress.tsx +40 -52
- package/src/anyspend/react/components/common/TokenBalance.tsx +0 -12
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +1 -9
- package/src/anyspend/react/components/common/TransferResultScreen.tsx +19 -11
- package/src/anyspend/react/components/context/AnySpendCustomizationContext.tsx +124 -0
- package/src/anyspend/react/components/icons/AnimatedCheckmark.tsx +119 -0
- package/src/anyspend/react/components/index.ts +33 -0
- package/src/anyspend/react/components/types/classes.ts +70 -0
- package/src/anyspend/react/components/types/customization.ts +99 -0
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +3 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +3 -2
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +5 -1
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +5 -2
- package/src/anyspend/services/anyspend.ts +19 -2
- package/src/anyspend/types/forms.ts +97 -0
- package/src/anyspend/utils/format.ts +12 -3
- package/src/app.shared.ts +11 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +13 -4
- package/src/global-account/react/components/ui/dialog.tsx +17 -8
- package/src/global-account/react/components/ui/drawer.tsx +2 -2
- package/src/global-account/react/stores/useModalStore.ts +52 -1
- package/src/shared/utils/number.ts +12 -0
- package/src/styles/index.css +48 -2
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
4
|
+
import { CreditCard, Wallet } from "lucide-react";
|
|
5
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
8
|
+
import { CheckoutOrderStatus } from "./CheckoutOrderStatus";
|
|
9
|
+
import { CoinbaseCheckoutPanel } from "./CoinbaseCheckoutPanel";
|
|
10
|
+
import { CryptoPayPanel } from "./CryptoPayPanel";
|
|
11
|
+
import { FiatCheckoutPanel } from "./FiatCheckoutPanel";
|
|
12
|
+
|
|
13
|
+
const SESSION_STORAGE_KEY = "anyspend_checkout_orderId";
|
|
14
|
+
|
|
15
|
+
export type PaymentMethod = "crypto" | "card" | "coinbase";
|
|
16
|
+
|
|
17
|
+
interface CheckoutPaymentPanelProps {
|
|
18
|
+
recipientAddress: string;
|
|
19
|
+
destinationTokenAddress: string;
|
|
20
|
+
destinationTokenChainId: number;
|
|
21
|
+
totalAmount: string;
|
|
22
|
+
buttonText?: string;
|
|
23
|
+
themeColor?: string;
|
|
24
|
+
returnUrl?: string;
|
|
25
|
+
returnLabel?: string;
|
|
26
|
+
onSuccess?: (result: { txHash?: string; orderId?: string }) => void;
|
|
27
|
+
onError?: (error: Error) => void;
|
|
28
|
+
callbackMetadata?: Record<string, unknown>;
|
|
29
|
+
classes?: AnySpendCheckoutClasses;
|
|
30
|
+
/** Which payment method to expand initially. Defaults to none (all collapsed). */
|
|
31
|
+
defaultPaymentMethod?: PaymentMethod;
|
|
32
|
+
/** Optional sender (payer) address — pre-fills token balances in the crypto panel */
|
|
33
|
+
senderAddress?: string;
|
|
34
|
+
/** Show the points row in the order status summary. Defaults to false. */
|
|
35
|
+
showPoints?: boolean;
|
|
36
|
+
/** Show the order ID row in the order status summary. Defaults to false. */
|
|
37
|
+
showOrderId?: boolean;
|
|
38
|
+
/** Whether the checkout form is valid. When false, payment methods are disabled. */
|
|
39
|
+
isFormValid?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function RadioCircle({ selected, themeColor }: { selected: boolean; themeColor?: string }) {
|
|
43
|
+
return (
|
|
44
|
+
<div
|
|
45
|
+
className={cn(
|
|
46
|
+
"flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border-2 transition-colors",
|
|
47
|
+
selected ? "border-blue-600" : "border-gray-300 dark:border-neutral-600",
|
|
48
|
+
)}
|
|
49
|
+
style={selected && themeColor ? { borderColor: themeColor } : undefined}
|
|
50
|
+
>
|
|
51
|
+
{selected && (
|
|
52
|
+
<div
|
|
53
|
+
className="h-2 w-2 rounded-full bg-blue-600"
|
|
54
|
+
style={themeColor ? { backgroundColor: themeColor } : undefined}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Card brand logos - all use consistent 32x20 viewBox */
|
|
62
|
+
function VisaLogo() {
|
|
63
|
+
return (
|
|
64
|
+
<svg viewBox="0 0 32 20" style={{ width: 32, height: 20 }} aria-label="Visa">
|
|
65
|
+
<rect width="32" height="20" rx="3" fill="#1A1F71" />
|
|
66
|
+
<text
|
|
67
|
+
x="16"
|
|
68
|
+
y="13.5"
|
|
69
|
+
textAnchor="middle"
|
|
70
|
+
fill="white"
|
|
71
|
+
fontSize="9"
|
|
72
|
+
fontWeight="bold"
|
|
73
|
+
fontFamily="sans-serif"
|
|
74
|
+
fontStyle="italic"
|
|
75
|
+
>
|
|
76
|
+
VISA
|
|
77
|
+
</text>
|
|
78
|
+
</svg>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function MastercardLogo() {
|
|
83
|
+
return (
|
|
84
|
+
<svg viewBox="0 0 32 20" style={{ width: 32, height: 20 }} aria-label="Mastercard">
|
|
85
|
+
<rect width="32" height="20" rx="3" fill="#252525" />
|
|
86
|
+
<circle cx="12.5" cy="10" r="6" fill="#EB001B" />
|
|
87
|
+
<circle cx="19.5" cy="10" r="6" fill="#F79E1B" />
|
|
88
|
+
<path d="M16 5.6a6 6 0 0 1 0 8.8 6 6 0 0 1 0-8.8z" fill="#FF5F00" />
|
|
89
|
+
</svg>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function AmexLogo() {
|
|
94
|
+
return (
|
|
95
|
+
<svg viewBox="0 0 32 20" style={{ width: 32, height: 20 }} aria-label="Amex">
|
|
96
|
+
<rect width="32" height="20" rx="3" fill="#006FCF" />
|
|
97
|
+
<text x="16" y="13" textAnchor="middle" fill="white" fontSize="7" fontWeight="bold" fontFamily="sans-serif">
|
|
98
|
+
AMEX
|
|
99
|
+
</text>
|
|
100
|
+
</svg>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Coinbase mark */
|
|
105
|
+
function CoinbaseLogo() {
|
|
106
|
+
return (
|
|
107
|
+
<svg viewBox="0 0 24 24" style={{ width: 20, height: 20 }} aria-label="Coinbase">
|
|
108
|
+
<circle cx="12" cy="12" r="12" fill="#0052FF" />
|
|
109
|
+
<path
|
|
110
|
+
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"
|
|
111
|
+
fill="white"
|
|
112
|
+
/>
|
|
113
|
+
</svg>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function CheckoutPaymentPanel({
|
|
118
|
+
recipientAddress,
|
|
119
|
+
destinationTokenAddress,
|
|
120
|
+
destinationTokenChainId,
|
|
121
|
+
totalAmount,
|
|
122
|
+
buttonText,
|
|
123
|
+
themeColor,
|
|
124
|
+
returnUrl,
|
|
125
|
+
returnLabel,
|
|
126
|
+
onSuccess,
|
|
127
|
+
onError,
|
|
128
|
+
callbackMetadata,
|
|
129
|
+
classes,
|
|
130
|
+
defaultPaymentMethod,
|
|
131
|
+
senderAddress,
|
|
132
|
+
showPoints,
|
|
133
|
+
showOrderId,
|
|
134
|
+
isFormValid = true,
|
|
135
|
+
}: CheckoutPaymentPanelProps) {
|
|
136
|
+
const [paymentMethod, setPaymentMethod] = useState<PaymentMethod | null>(defaultPaymentMethod ?? null);
|
|
137
|
+
|
|
138
|
+
// Restore activeOrderId from sessionStorage (handles page refresh / Coinbase return)
|
|
139
|
+
const [activeOrderId, setActiveOrderId] = useState<string | null>(() => {
|
|
140
|
+
if (typeof window !== "undefined") {
|
|
141
|
+
return sessionStorage.getItem(SESSION_STORAGE_KEY) || null;
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// Persist activeOrderId to sessionStorage
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (activeOrderId) {
|
|
149
|
+
sessionStorage.setItem(SESSION_STORAGE_KEY, activeOrderId);
|
|
150
|
+
} else {
|
|
151
|
+
sessionStorage.removeItem(SESSION_STORAGE_KEY);
|
|
152
|
+
}
|
|
153
|
+
}, [activeOrderId]);
|
|
154
|
+
|
|
155
|
+
const handleOrderCreated = useCallback((orderId: string) => {
|
|
156
|
+
setActiveOrderId(orderId);
|
|
157
|
+
}, []);
|
|
158
|
+
|
|
159
|
+
const handleRetry = useCallback(() => {
|
|
160
|
+
setActiveOrderId(null);
|
|
161
|
+
}, []);
|
|
162
|
+
|
|
163
|
+
if (activeOrderId) {
|
|
164
|
+
return (
|
|
165
|
+
<CheckoutOrderStatus
|
|
166
|
+
orderId={activeOrderId}
|
|
167
|
+
themeColor={themeColor}
|
|
168
|
+
returnUrl={returnUrl}
|
|
169
|
+
returnLabel={returnLabel}
|
|
170
|
+
onSuccess={onSuccess}
|
|
171
|
+
onError={onError}
|
|
172
|
+
onRetry={handleRetry}
|
|
173
|
+
showPoints={showPoints}
|
|
174
|
+
showOrderId={showOrderId}
|
|
175
|
+
classes={classes}
|
|
176
|
+
/>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const accordionButtonClass = (active: boolean) =>
|
|
181
|
+
cn(
|
|
182
|
+
"anyspend-payment-method-btn flex w-full items-center gap-3 px-4 py-4 text-left transition-colors",
|
|
183
|
+
active
|
|
184
|
+
? "bg-white dark:bg-neutral-900"
|
|
185
|
+
: "bg-white hover:bg-gray-50 dark:bg-neutral-900 dark:hover:bg-neutral-800",
|
|
186
|
+
classes?.paymentMethodButton,
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
const expandedPanelClass = cn(
|
|
190
|
+
"anyspend-payment-method-panel border-t border-gray-100 bg-white px-4 py-4 dark:border-neutral-800 dark:bg-neutral-900",
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<div className={cn("anyspend-payment-panel flex flex-col gap-5", classes?.paymentPanel)}>
|
|
195
|
+
<h2
|
|
196
|
+
className={cn(
|
|
197
|
+
"anyspend-payment-title text-lg font-semibold text-gray-900 dark:text-gray-100",
|
|
198
|
+
classes?.paymentTitle,
|
|
199
|
+
)}
|
|
200
|
+
>
|
|
201
|
+
Payment
|
|
202
|
+
</h2>
|
|
203
|
+
|
|
204
|
+
{!isFormValid && (
|
|
205
|
+
<p className="text-sm text-amber-600 dark:text-amber-400">
|
|
206
|
+
Please complete the required fields above before proceeding to payment.
|
|
207
|
+
</p>
|
|
208
|
+
)}
|
|
209
|
+
|
|
210
|
+
{/* Accordion-style payment methods */}
|
|
211
|
+
<div
|
|
212
|
+
className={cn(
|
|
213
|
+
"anyspend-payment-methods divide-y divide-gray-200 overflow-hidden rounded-xl border border-gray-200 dark:divide-neutral-700 dark:border-neutral-700",
|
|
214
|
+
!isFormValid && "pointer-events-none opacity-50",
|
|
215
|
+
classes?.paymentMethodSelector,
|
|
216
|
+
)}
|
|
217
|
+
>
|
|
218
|
+
{/* Pay with crypto */}
|
|
219
|
+
<div className="anyspend-method-crypto">
|
|
220
|
+
<button
|
|
221
|
+
onClick={() => setPaymentMethod(paymentMethod === "crypto" ? null : "crypto")}
|
|
222
|
+
className={accordionButtonClass(paymentMethod === "crypto")}
|
|
223
|
+
>
|
|
224
|
+
<RadioCircle selected={paymentMethod === "crypto"} themeColor={themeColor} />
|
|
225
|
+
<Wallet className="h-5 w-5 text-gray-700 dark:text-gray-300" />
|
|
226
|
+
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">Pay with crypto</span>
|
|
227
|
+
</button>
|
|
228
|
+
<AnimatePresence initial={false}>
|
|
229
|
+
{paymentMethod === "crypto" && (
|
|
230
|
+
<motion.div
|
|
231
|
+
key="crypto-panel"
|
|
232
|
+
initial={{ height: 0, opacity: 0 }}
|
|
233
|
+
animate={{ height: "auto", opacity: 1 }}
|
|
234
|
+
exit={{ height: 0, opacity: 0 }}
|
|
235
|
+
transition={{ duration: 0.2, ease: "easeOut" }}
|
|
236
|
+
style={{ overflow: "hidden" }}
|
|
237
|
+
>
|
|
238
|
+
<div className={expandedPanelClass}>
|
|
239
|
+
<CryptoPayPanel
|
|
240
|
+
recipientAddress={recipientAddress}
|
|
241
|
+
destinationTokenAddress={destinationTokenAddress}
|
|
242
|
+
destinationTokenChainId={destinationTokenChainId}
|
|
243
|
+
totalAmount={totalAmount}
|
|
244
|
+
buttonText={buttonText}
|
|
245
|
+
themeColor={themeColor}
|
|
246
|
+
onOrderCreated={handleOrderCreated}
|
|
247
|
+
onError={onError}
|
|
248
|
+
callbackMetadata={callbackMetadata}
|
|
249
|
+
classes={classes}
|
|
250
|
+
senderAddress={senderAddress}
|
|
251
|
+
/>
|
|
252
|
+
</div>
|
|
253
|
+
</motion.div>
|
|
254
|
+
)}
|
|
255
|
+
</AnimatePresence>
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
{/* Credit or Debit Card */}
|
|
259
|
+
<div className="anyspend-method-card">
|
|
260
|
+
<button
|
|
261
|
+
onClick={() => setPaymentMethod(paymentMethod === "card" ? null : "card")}
|
|
262
|
+
className={accordionButtonClass(paymentMethod === "card")}
|
|
263
|
+
>
|
|
264
|
+
<RadioCircle selected={paymentMethod === "card"} themeColor={themeColor} />
|
|
265
|
+
<CreditCard className="h-5 w-5 text-gray-700 dark:text-gray-300" />
|
|
266
|
+
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">Credit or debit card</span>
|
|
267
|
+
<div className="ml-auto flex items-center gap-1">
|
|
268
|
+
<VisaLogo />
|
|
269
|
+
<MastercardLogo />
|
|
270
|
+
<AmexLogo />
|
|
271
|
+
</div>
|
|
272
|
+
</button>
|
|
273
|
+
<AnimatePresence initial={false}>
|
|
274
|
+
{paymentMethod === "card" && (
|
|
275
|
+
<motion.div
|
|
276
|
+
key="card-panel"
|
|
277
|
+
initial={{ height: 0, opacity: 0 }}
|
|
278
|
+
animate={{ height: "auto", opacity: 1 }}
|
|
279
|
+
exit={{ height: 0, opacity: 0 }}
|
|
280
|
+
transition={{ duration: 0.2, ease: "easeOut" }}
|
|
281
|
+
style={{ overflow: "hidden" }}
|
|
282
|
+
>
|
|
283
|
+
<div className={expandedPanelClass}>
|
|
284
|
+
<FiatCheckoutPanel
|
|
285
|
+
recipientAddress={recipientAddress}
|
|
286
|
+
destinationTokenAddress={destinationTokenAddress}
|
|
287
|
+
destinationTokenChainId={destinationTokenChainId}
|
|
288
|
+
totalAmount={totalAmount}
|
|
289
|
+
themeColor={themeColor}
|
|
290
|
+
onOrderCreated={handleOrderCreated}
|
|
291
|
+
onError={onError}
|
|
292
|
+
callbackMetadata={callbackMetadata}
|
|
293
|
+
classes={classes}
|
|
294
|
+
/>
|
|
295
|
+
</div>
|
|
296
|
+
</motion.div>
|
|
297
|
+
)}
|
|
298
|
+
</AnimatePresence>
|
|
299
|
+
</div>
|
|
300
|
+
|
|
301
|
+
{/* Coinbase Pay */}
|
|
302
|
+
<div className="anyspend-method-coinbase">
|
|
303
|
+
<button
|
|
304
|
+
onClick={() => setPaymentMethod(paymentMethod === "coinbase" ? null : "coinbase")}
|
|
305
|
+
className={accordionButtonClass(paymentMethod === "coinbase")}
|
|
306
|
+
>
|
|
307
|
+
<RadioCircle selected={paymentMethod === "coinbase"} themeColor={themeColor} />
|
|
308
|
+
<CoinbaseLogo />
|
|
309
|
+
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">Coinbase Pay</span>
|
|
310
|
+
</button>
|
|
311
|
+
<AnimatePresence initial={false}>
|
|
312
|
+
{paymentMethod === "coinbase" && (
|
|
313
|
+
<motion.div
|
|
314
|
+
key="coinbase-panel"
|
|
315
|
+
initial={{ height: 0, opacity: 0 }}
|
|
316
|
+
animate={{ height: "auto", opacity: 1 }}
|
|
317
|
+
exit={{ height: 0, opacity: 0 }}
|
|
318
|
+
transition={{ duration: 0.2, ease: "easeOut" }}
|
|
319
|
+
style={{ overflow: "hidden" }}
|
|
320
|
+
>
|
|
321
|
+
<div className={expandedPanelClass}>
|
|
322
|
+
<CoinbaseCheckoutPanel
|
|
323
|
+
recipientAddress={recipientAddress}
|
|
324
|
+
destinationTokenAddress={destinationTokenAddress}
|
|
325
|
+
destinationTokenChainId={destinationTokenChainId}
|
|
326
|
+
totalAmount={totalAmount}
|
|
327
|
+
themeColor={themeColor}
|
|
328
|
+
onOrderCreated={handleOrderCreated}
|
|
329
|
+
onError={onError}
|
|
330
|
+
callbackMetadata={callbackMetadata}
|
|
331
|
+
classes={classes}
|
|
332
|
+
/>
|
|
333
|
+
</div>
|
|
334
|
+
</motion.div>
|
|
335
|
+
)}
|
|
336
|
+
</AnimatePresence>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
);
|
|
341
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
4
|
+
import { ExternalLink } from "lucide-react";
|
|
5
|
+
import { motion } from "motion/react";
|
|
6
|
+
import { useAnySpendCustomization } from "../context/AnySpendCustomizationContext";
|
|
7
|
+
import { AnimatedCheckmark } from "../icons/AnimatedCheckmark";
|
|
8
|
+
import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
9
|
+
|
|
10
|
+
interface CheckoutSuccessProps {
|
|
11
|
+
txHash?: string;
|
|
12
|
+
orderId?: string;
|
|
13
|
+
returnUrl?: string;
|
|
14
|
+
returnLabel?: string;
|
|
15
|
+
classes?: AnySpendCheckoutClasses;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }: CheckoutSuccessProps) {
|
|
19
|
+
const { content, slots } = useAnySpendCustomization();
|
|
20
|
+
|
|
21
|
+
if (slots.successScreen) {
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
{slots.successScreen({
|
|
25
|
+
title: typeof content.successTitle === "string" ? content.successTitle : "Payment Successful",
|
|
26
|
+
description:
|
|
27
|
+
typeof content.successDescription === "string"
|
|
28
|
+
? content.successDescription
|
|
29
|
+
: "Your payment has been processed successfully.",
|
|
30
|
+
txHash,
|
|
31
|
+
orderId,
|
|
32
|
+
explorerUrl: txHash ? `https://explorer.b3.fun/tx/${txHash}` : undefined,
|
|
33
|
+
onDone: () => {
|
|
34
|
+
if (returnUrl) window.location.href = returnUrl;
|
|
35
|
+
},
|
|
36
|
+
returnUrl,
|
|
37
|
+
returnLabel: content.returnButtonLabel || returnLabel,
|
|
38
|
+
})}
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className={cn("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel)}>
|
|
45
|
+
<div className="anyspend-success-icon mb-4">
|
|
46
|
+
<AnimatedCheckmark className="h-16 w-16" />
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<motion.h2
|
|
50
|
+
initial={{ opacity: 0, y: 10 }}
|
|
51
|
+
animate={{ opacity: 1, y: 0 }}
|
|
52
|
+
transition={{ duration: 0.3, delay: 1.0, ease: "easeOut" }}
|
|
53
|
+
className="anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100"
|
|
54
|
+
>
|
|
55
|
+
{content.successTitle || "Payment Successful"}
|
|
56
|
+
</motion.h2>
|
|
57
|
+
|
|
58
|
+
<motion.p
|
|
59
|
+
initial={{ opacity: 0, y: 10 }}
|
|
60
|
+
animate={{ opacity: 1, y: 0 }}
|
|
61
|
+
transition={{ duration: 0.3, delay: 1.15, ease: "easeOut" }}
|
|
62
|
+
className="anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400"
|
|
63
|
+
>
|
|
64
|
+
{content.successDescription || "Your payment has been processed successfully."}
|
|
65
|
+
</motion.p>
|
|
66
|
+
|
|
67
|
+
{txHash && (
|
|
68
|
+
<motion.a
|
|
69
|
+
initial={{ opacity: 0 }}
|
|
70
|
+
animate={{ opacity: 1 }}
|
|
71
|
+
transition={{ duration: 0.3, delay: 0.5, ease: "easeOut" }}
|
|
72
|
+
href={`https://explorer.b3.fun/tx/${txHash}`}
|
|
73
|
+
target="_blank"
|
|
74
|
+
rel="noopener noreferrer"
|
|
75
|
+
className="anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400"
|
|
76
|
+
>
|
|
77
|
+
View Transaction
|
|
78
|
+
<ExternalLink className="h-3.5 w-3.5" />
|
|
79
|
+
</motion.a>
|
|
80
|
+
)}
|
|
81
|
+
|
|
82
|
+
{!txHash && orderId && (
|
|
83
|
+
<motion.p
|
|
84
|
+
initial={{ opacity: 0 }}
|
|
85
|
+
animate={{ opacity: 1 }}
|
|
86
|
+
transition={{ duration: 0.3, delay: 0.5, ease: "easeOut" }}
|
|
87
|
+
className="anyspend-success-order-id mt-4 text-xs text-gray-400 dark:text-gray-500"
|
|
88
|
+
>
|
|
89
|
+
Order ID: {orderId}
|
|
90
|
+
</motion.p>
|
|
91
|
+
)}
|
|
92
|
+
|
|
93
|
+
{returnUrl && (
|
|
94
|
+
<motion.a
|
|
95
|
+
initial={{ opacity: 0, y: 10 }}
|
|
96
|
+
animate={{ opacity: 1, y: 0 }}
|
|
97
|
+
transition={{ duration: 0.3, delay: 0.6, ease: "easeOut" }}
|
|
98
|
+
href={returnUrl}
|
|
99
|
+
className={cn(
|
|
100
|
+
"anyspend-success-return-btn mt-6 inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors",
|
|
101
|
+
classes?.returnButton,
|
|
102
|
+
)}
|
|
103
|
+
style={{ backgroundColor: "#111827", color: "#fff" }}
|
|
104
|
+
>
|
|
105
|
+
{content.returnButtonLabel || returnLabel || "Return to Store"}
|
|
106
|
+
</motion.a>
|
|
107
|
+
)}
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
}
|