@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,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
4
|
+
import { formatTokenAmount, safeBigInt } from "@b3dotfun/sdk/shared/utils/number";
|
|
5
|
+
import type { ShippingOption } from "../../../types/forms";
|
|
6
|
+
|
|
7
|
+
interface ShippingSelectorProps {
|
|
8
|
+
options: ShippingOption[];
|
|
9
|
+
selectedId: string | null;
|
|
10
|
+
onSelect: (option: ShippingOption) => void;
|
|
11
|
+
tokenSymbol?: string;
|
|
12
|
+
tokenDecimals?: number;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function formatAmount(amount: string, decimals: number, symbol: string): string {
|
|
17
|
+
const bi = safeBigInt(amount);
|
|
18
|
+
if (bi === BigInt(0)) return "Free";
|
|
19
|
+
return `${formatTokenAmount(bi, decimals)} ${symbol}`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function ShippingSelector({
|
|
23
|
+
options,
|
|
24
|
+
selectedId,
|
|
25
|
+
onSelect,
|
|
26
|
+
tokenSymbol = "",
|
|
27
|
+
tokenDecimals = 6,
|
|
28
|
+
className,
|
|
29
|
+
}: ShippingSelectorProps) {
|
|
30
|
+
if (options.length === 0) return null;
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={cn("anyspend-shipping-selector space-y-2", className)}>
|
|
34
|
+
<div className="anyspend-shipping-title text-sm font-semibold text-gray-900 dark:text-gray-100">Shipping</div>
|
|
35
|
+
<div className="anyspend-shipping-options space-y-2">
|
|
36
|
+
{options.map(option => (
|
|
37
|
+
<label
|
|
38
|
+
key={option.id}
|
|
39
|
+
className={cn(
|
|
40
|
+
"anyspend-shipping-option flex cursor-pointer items-center justify-between rounded-lg border p-3 transition-colors",
|
|
41
|
+
selectedId === option.id
|
|
42
|
+
? "anyspend-shipping-option-selected border-blue-500 bg-blue-50 dark:border-blue-400 dark:bg-blue-900/20"
|
|
43
|
+
: "border-gray-200 bg-white hover:border-gray-300 dark:border-neutral-600 dark:bg-neutral-800 dark:hover:border-neutral-500",
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
<div className="flex items-center gap-3">
|
|
47
|
+
<input
|
|
48
|
+
type="radio"
|
|
49
|
+
name="shipping"
|
|
50
|
+
checked={selectedId === option.id}
|
|
51
|
+
onChange={() => onSelect(option)}
|
|
52
|
+
className="h-4 w-4 border-gray-300 text-blue-500 focus:ring-blue-500"
|
|
53
|
+
/>
|
|
54
|
+
<div>
|
|
55
|
+
<div className="anyspend-shipping-option-name text-sm font-medium text-gray-900 dark:text-gray-100">
|
|
56
|
+
{option.name}
|
|
57
|
+
</div>
|
|
58
|
+
{(option.description || option.estimated_days) && (
|
|
59
|
+
<div className="anyspend-shipping-option-detail text-xs text-gray-500 dark:text-gray-400">
|
|
60
|
+
{option.description || (option.estimated_days && `${option.estimated_days}`)}
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div className="anyspend-shipping-option-price text-sm font-medium text-gray-900 dark:text-gray-100">
|
|
66
|
+
{formatAmount(option.amount, tokenDecimals, tokenSymbol)}
|
|
67
|
+
</div>
|
|
68
|
+
</label>
|
|
69
|
+
))}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -7,6 +7,7 @@ import centerTruncate from "@b3dotfun/sdk/shared/utils/centerTruncate";
|
|
|
7
7
|
import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
|
|
8
8
|
import { motion } from "framer-motion";
|
|
9
9
|
import { ChevronRight, Loader2 } from "lucide-react";
|
|
10
|
+
import { useAnySpendCustomization } from "../context/AnySpendCustomizationContext";
|
|
10
11
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
11
12
|
import { OrderDetailsCollapsible } from "./OrderDetailsCollapsible";
|
|
12
13
|
import { PaymentMethodSwitch } from "./PaymentMethodSwitch";
|
|
@@ -46,6 +47,8 @@ export default function ConnectWalletPayment({
|
|
|
46
47
|
? connectedSmartWallet?.getAccount()?.address
|
|
47
48
|
: connectedEOAWallet?.getAccount()?.address;
|
|
48
49
|
|
|
50
|
+
const { slots } = useAnySpendCustomization();
|
|
51
|
+
|
|
49
52
|
const srcToken = order.metadata.srcToken;
|
|
50
53
|
const dstToken = order.metadata.dstToken;
|
|
51
54
|
|
|
@@ -62,6 +65,31 @@ export default function ConnectWalletPayment({
|
|
|
62
65
|
return <div>Loading...</div>;
|
|
63
66
|
}
|
|
64
67
|
|
|
68
|
+
const paymentLabel =
|
|
69
|
+
order.srcChain === RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
70
|
+
? "Pay from Phantom Wallet"
|
|
71
|
+
: cryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET
|
|
72
|
+
? "Pay from Global Account"
|
|
73
|
+
: "Pay from Connected Wallet";
|
|
74
|
+
|
|
75
|
+
const connectedAddress =
|
|
76
|
+
order.srcChain === RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
77
|
+
? phantomWalletAddress
|
|
78
|
+
: connectedEvmAddress;
|
|
79
|
+
|
|
80
|
+
if (slots.connectWalletButton) {
|
|
81
|
+
return (
|
|
82
|
+
<div className="flex w-full flex-col items-center gap-6">
|
|
83
|
+
{slots.connectWalletButton({
|
|
84
|
+
onPayment,
|
|
85
|
+
txLoading,
|
|
86
|
+
connectedAddress: connectedAddress || undefined,
|
|
87
|
+
paymentLabel,
|
|
88
|
+
})}
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
65
93
|
return (
|
|
66
94
|
<div className="flex w-full flex-col items-center gap-6">
|
|
67
95
|
{/* Payment Button */}
|
|
@@ -85,13 +113,7 @@ export default function ConnectWalletPayment({
|
|
|
85
113
|
</>
|
|
86
114
|
) : (
|
|
87
115
|
<>
|
|
88
|
-
<span className="whitespace-nowrap pl-4 text-lg md:text-sm">
|
|
89
|
-
{order.srcChain === RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
90
|
-
? "Pay from Phantom Wallet"
|
|
91
|
-
: cryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET
|
|
92
|
-
? "Pay from Global Account"
|
|
93
|
-
: "Pay from Connected Wallet"}
|
|
94
|
-
</span>
|
|
116
|
+
<span className="whitespace-nowrap pl-4 text-lg md:text-sm">{paymentLabel}</span>
|
|
95
117
|
<ChevronRight className="h-4 w-4" />
|
|
96
118
|
</>
|
|
97
119
|
)}
|
|
@@ -108,7 +108,7 @@ export function CryptoPaySection({
|
|
|
108
108
|
<button
|
|
109
109
|
className={
|
|
110
110
|
classes?.paymentMethodButton ||
|
|
111
|
-
"text-as-
|
|
111
|
+
"text-as-tertiary flex h-7 items-center gap-2 text-sm transition-colors focus:!outline-none"
|
|
112
112
|
}
|
|
113
113
|
onClick={onSelectCryptoPaymentMethod}
|
|
114
114
|
>
|
|
@@ -25,7 +25,7 @@ export function CryptoPaymentMethodDisplay({
|
|
|
25
25
|
return (
|
|
26
26
|
<>
|
|
27
27
|
{connectedAddress ? (
|
|
28
|
-
<span className="text-as-
|
|
28
|
+
<span className="text-as-tertiary whitespace-nowrap">
|
|
29
29
|
{connectedName ? formatUsername(connectedName) : shortenAddress(connectedAddress)}
|
|
30
30
|
</span>
|
|
31
31
|
) : (
|
|
@@ -85,11 +85,11 @@ export function CryptoReceiveSection({
|
|
|
85
85
|
</div>
|
|
86
86
|
{effectiveRecipientAddress ? (
|
|
87
87
|
<button
|
|
88
|
-
className={classes?.recipientButton || "text-as-
|
|
88
|
+
className={classes?.recipientButton || "text-as-tertiary flex h-7 items-center gap-2 rounded-lg"}
|
|
89
89
|
onClick={onSelectRecipient}
|
|
90
90
|
>
|
|
91
91
|
<>
|
|
92
|
-
<span className={classes?.recipientValue || "text-as-
|
|
92
|
+
<span className={classes?.recipientValue || "text-as-tertiary flex items-center gap-1 text-sm"}>
|
|
93
93
|
{customRecipientLabel ||
|
|
94
94
|
(recipientName ? formatUsername(recipientName) : shortenAddress(effectiveRecipientAddress || ""))}
|
|
95
95
|
</span>
|
|
@@ -63,7 +63,7 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
63
63
|
? "0"
|
|
64
64
|
: order.type === "custom" || order.type === "deposit_first"
|
|
65
65
|
? order.payload.amount?.toString() || "0"
|
|
66
|
-
: order.payload.expectedDstAmount
|
|
66
|
+
: order.payload.expectedDstAmount?.toString() || "0";
|
|
67
67
|
|
|
68
68
|
const finalFormattedExpectedDstAmount =
|
|
69
69
|
formattedExpectedDstAmount || formatTokenAmount(BigInt(expectedDstAmount), dstToken.decimals);
|
|
@@ -86,7 +86,7 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
86
86
|
<div className="order-details-content flex w-full flex-col items-center gap-3 whitespace-nowrap py-2 text-sm">
|
|
87
87
|
{/* Recipient Section */}
|
|
88
88
|
<div className="order-details-recipient-section flex w-full justify-between gap-4">
|
|
89
|
-
<div className="order-details-recipient-label text-as-
|
|
89
|
+
<div className="order-details-recipient-label text-as-tertiary">Recipient</div>
|
|
90
90
|
<div className="order-details-recipient-info flex flex-col items-end gap-1">
|
|
91
91
|
{recipientName && (
|
|
92
92
|
<div className="order-details-recipient-name text-as-primary font-semibold">{recipientName}</div>
|
|
@@ -108,7 +108,7 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
108
108
|
|
|
109
109
|
{/* Expected Amount/Action Section */}
|
|
110
110
|
<div className="order-details-expected-section flex w-full items-start justify-between gap-2">
|
|
111
|
-
<div className="order-details-expected-label text-as-
|
|
111
|
+
<div className="order-details-expected-label text-as-tertiary shrink-0">
|
|
112
112
|
{order.type === "swap" ||
|
|
113
113
|
order.type === "deposit_first" ||
|
|
114
114
|
order.type === "mint_nft" ||
|
|
@@ -174,7 +174,7 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
174
174
|
<div className="order-details-divider divider w-full" />
|
|
175
175
|
{/* Points Section */}
|
|
176
176
|
<div className="order-details-points-section flex w-full justify-between gap-4">
|
|
177
|
-
<div className="order-details-points-label text-as-
|
|
177
|
+
<div className="order-details-points-label text-as-tertiary">Points</div>
|
|
178
178
|
<div className="order-details-points-value text-as-brand font-semibold">
|
|
179
179
|
+{formatNumber(points)} pts
|
|
180
180
|
</div>
|
|
@@ -186,7 +186,7 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
186
186
|
|
|
187
187
|
{/* Order ID / Total Section */}
|
|
188
188
|
<div className="order-details-id-total-section flex w-full justify-between gap-4">
|
|
189
|
-
<div className="order-details-id-total-label text-as-
|
|
189
|
+
<div className="order-details-id-total-label text-as-tertiary">
|
|
190
190
|
{showTotal ? "Total (included fee)" : "Order ID"}
|
|
191
191
|
</div>
|
|
192
192
|
<div className="order-details-id-total-value text-as-primary overflow-hidden text-ellipsis whitespace-nowrap">
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { getStatusDisplay } from "@b3dotfun/sdk/anyspend";
|
|
2
2
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
3
3
|
import { useSearchParams } from "@b3dotfun/sdk/shared/react";
|
|
4
|
-
import {
|
|
5
|
-
import { memo } from "react";
|
|
4
|
+
import { Clock, Loader2, RotateCcw, X } from "lucide-react";
|
|
5
|
+
import React, { memo, useEffect, useRef } from "react";
|
|
6
|
+
import { useAnySpendCustomization } from "../context/AnySpendCustomizationContext";
|
|
7
|
+
import { AnimatedCheckmark } from "../icons/AnimatedCheckmark";
|
|
6
8
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
7
9
|
import { Step, StepProgress } from "./StepProgress";
|
|
8
10
|
|
|
11
|
+
/** Map order status to its step index in the StepProgress. -1 = not a step state. */
|
|
12
|
+
function getStepIndex(status: string): number {
|
|
13
|
+
if (["waiting_stripe_payment", "scanning_deposit_transaction"].includes(status)) return 0;
|
|
14
|
+
if (["quoting_after_deposit", "sending_token_from_vault", "relay", "executing"].includes(status)) return 1;
|
|
15
|
+
return -1;
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
export const OrderStatus = memo(function OrderStatus({
|
|
10
19
|
order,
|
|
11
20
|
selectedCryptoPaymentMethod,
|
|
@@ -13,63 +22,160 @@ export const OrderStatus = memo(function OrderStatus({
|
|
|
13
22
|
order: components["schemas"]["Order"];
|
|
14
23
|
selectedCryptoPaymentMethod?: CryptoPaymentMethodType;
|
|
15
24
|
}) {
|
|
16
|
-
const
|
|
17
|
-
const {
|
|
25
|
+
const { text: defaultText, description: defaultDescription } = getStatusDisplay(order);
|
|
26
|
+
const { content, slots } = useAnySpendCustomization();
|
|
18
27
|
const searchParams = useSearchParams();
|
|
19
28
|
const cryptoPaymentMethod = selectedCryptoPaymentMethod || searchParams.get("cryptoPaymentMethod");
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
const currentStepIndex = getStepIndex(order.status);
|
|
31
|
+
const prevStepIndexRef = useRef<number>(currentStepIndex);
|
|
32
|
+
const shouldAnimateCheck = currentStepIndex > prevStepIndexRef.current;
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
prevStepIndexRef.current = currentStepIndex;
|
|
36
|
+
}, [currentStepIndex]);
|
|
37
|
+
|
|
38
|
+
// Resolve content overrides based on order status
|
|
39
|
+
let text = defaultText;
|
|
40
|
+
let description: string | React.ReactNode = defaultDescription;
|
|
41
|
+
|
|
42
|
+
if (order.status === "executed") {
|
|
43
|
+
if (content.successTitle && typeof content.successTitle === "string") text = content.successTitle;
|
|
44
|
+
if (content.successDescription) description = content.successDescription;
|
|
45
|
+
} else if (order.status === "failure") {
|
|
46
|
+
if (content.failureTitle && typeof content.failureTitle === "string") text = content.failureTitle;
|
|
47
|
+
if (content.failureDescription) description = content.failureDescription;
|
|
48
|
+
} else if (order.status === "expired") {
|
|
49
|
+
if (content.expiredTitle && typeof content.expiredTitle === "string") text = content.expiredTitle;
|
|
50
|
+
if (content.expiredDescription) description = content.expiredDescription;
|
|
51
|
+
} else if (order.status === "refunded") {
|
|
52
|
+
if (content.refundedTitle && typeof content.refundedTitle === "string") text = content.refundedTitle;
|
|
53
|
+
if (content.refundedDescription) description = content.refundedDescription;
|
|
54
|
+
} else if (content.processingTitle || content.processingDescription) {
|
|
55
|
+
if (content.processingTitle && typeof content.processingTitle === "string") text = content.processingTitle;
|
|
56
|
+
if (content.processingDescription) description = content.processingDescription;
|
|
57
|
+
}
|
|
23
58
|
|
|
24
59
|
const paymentSteps: Step[] = [
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
title: text,
|
|
28
|
-
description: description,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 2,
|
|
32
|
-
title: text,
|
|
33
|
-
description: description,
|
|
34
|
-
},
|
|
60
|
+
{ id: 1, title: text, description: typeof description === "string" ? description : defaultDescription || "" },
|
|
61
|
+
{ id: 2, title: text, description: typeof description === "string" ? description : defaultDescription || "" },
|
|
35
62
|
];
|
|
36
63
|
|
|
37
|
-
if (
|
|
38
|
-
// hide step if order is scanning_deposit_transaction and crypto payment method is transfer_crypto
|
|
64
|
+
if (currentStepIndex === 0) {
|
|
39
65
|
if (!(order.status === "scanning_deposit_transaction" && cryptoPaymentMethod === "transfer_crypto")) {
|
|
40
66
|
return <StepProgress steps={paymentSteps} currentStepIndex={0} />;
|
|
41
67
|
}
|
|
42
68
|
}
|
|
43
69
|
|
|
44
|
-
if (
|
|
45
|
-
return <StepProgress steps={paymentSteps} currentStepIndex={1} />;
|
|
70
|
+
if (currentStepIndex === 1) {
|
|
71
|
+
return <StepProgress steps={paymentSteps} currentStepIndex={1} animateCompletedSteps={shouldAnimateCheck} />;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (order.status === "refunding") {
|
|
75
|
+
return (
|
|
76
|
+
<div className="flex items-center justify-center gap-2">
|
|
77
|
+
<div className="flex flex-col items-center">
|
|
78
|
+
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-amber-500/15">
|
|
79
|
+
<Loader2 className="h-6 w-6 animate-spin text-amber-500" />
|
|
80
|
+
</div>
|
|
81
|
+
<h2 className="text-as-primary mt-4 text-xl font-semibold">{text}</h2>
|
|
82
|
+
<div className="text-as-tertiary mt-1 text-center text-sm">{description}</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
46
86
|
}
|
|
47
87
|
|
|
48
88
|
if (selectedCryptoPaymentMethod === "transfer_crypto" && order.status === "scanning_deposit_transaction") {
|
|
49
89
|
return null;
|
|
50
90
|
}
|
|
51
91
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
92
|
+
if (order.status === "executed") {
|
|
93
|
+
return (
|
|
94
|
+
<div className="flex items-center justify-center gap-2">
|
|
95
|
+
<div className="flex flex-col items-center">
|
|
96
|
+
<AnimatedCheckmark className="h-14 w-14" />
|
|
97
|
+
<h2 className="text-as-primary mt-4 text-xl font-semibold">{content.successTitle || text}</h2>
|
|
98
|
+
<div className="text-as-tertiary mt-1 text-center text-sm">{content.successDescription || description}</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (order.status === "expired") {
|
|
105
|
+
if (slots.errorScreen) {
|
|
106
|
+
return (
|
|
107
|
+
<>
|
|
108
|
+
{slots.errorScreen({
|
|
109
|
+
title: text,
|
|
110
|
+
description: typeof description === "string" ? description : defaultDescription || "",
|
|
111
|
+
errorType: "expired",
|
|
112
|
+
orderId: order.id,
|
|
113
|
+
})}
|
|
114
|
+
</>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return (
|
|
118
|
+
<div className="flex items-center justify-center gap-2">
|
|
55
119
|
<div className="flex flex-col items-center">
|
|
56
|
-
<div className=
|
|
57
|
-
<
|
|
120
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-amber-500/15">
|
|
121
|
+
<Clock className="h-5 w-5 text-amber-500" />
|
|
58
122
|
</div>
|
|
59
123
|
<h2 className="text-as-primary mt-4 text-xl font-semibold">{text}</h2>
|
|
60
|
-
<div className="text-as-
|
|
124
|
+
<div className="text-as-tertiary mt-1 text-center text-sm">{description}</div>
|
|
61
125
|
</div>
|
|
62
|
-
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (order.status === "refunded") {
|
|
131
|
+
if (slots.errorScreen) {
|
|
132
|
+
return (
|
|
133
|
+
<>
|
|
134
|
+
{slots.errorScreen({
|
|
135
|
+
title: text,
|
|
136
|
+
description: typeof description === "string" ? description : defaultDescription || "",
|
|
137
|
+
errorType: "refunded",
|
|
138
|
+
orderId: order.id,
|
|
139
|
+
})}
|
|
140
|
+
</>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
return (
|
|
144
|
+
<div className="flex items-center justify-center gap-2">
|
|
63
145
|
<div className="flex flex-col items-center">
|
|
64
|
-
<div className="bg-as-
|
|
65
|
-
<
|
|
66
|
-
</div>
|
|
67
|
-
<div className="font-sf-rounded text-as-content-primary mt-4 text-lg font-semibold">{text}</div>
|
|
68
|
-
<div className="text-as-tertiarry text-center" style={{ whiteSpace: "normal" }}>
|
|
69
|
-
{description}
|
|
146
|
+
<div className="bg-as-surface-secondary flex h-10 w-10 items-center justify-center rounded-full">
|
|
147
|
+
<RotateCcw className="text-as-secondary h-5 w-5" />
|
|
70
148
|
</div>
|
|
149
|
+
<h2 className="text-as-primary mt-4 text-xl font-semibold">{text}</h2>
|
|
150
|
+
<div className="text-as-tertiary mt-1 text-center text-sm">{description}</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (slots.errorScreen) {
|
|
157
|
+
return (
|
|
158
|
+
<>
|
|
159
|
+
{slots.errorScreen({
|
|
160
|
+
title: text,
|
|
161
|
+
description: typeof description === "string" ? description : defaultDescription || "",
|
|
162
|
+
errorType: "failure",
|
|
163
|
+
orderId: order.id,
|
|
164
|
+
})}
|
|
165
|
+
</>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return (
|
|
169
|
+
<div className="flex items-center justify-center gap-2">
|
|
170
|
+
<div className="flex flex-col items-center">
|
|
171
|
+
<div className="bg-as-error-secondary flex h-10 w-10 items-center justify-center rounded-full">
|
|
172
|
+
<X className="text-as-content-icon-error h-5 w-5" />
|
|
173
|
+
</div>
|
|
174
|
+
<h2 className="text-as-primary mt-4 text-xl font-semibold">{text}</h2>
|
|
175
|
+
<div className="text-as-tertiary mt-1 text-center text-sm" style={{ whiteSpace: "normal" }}>
|
|
176
|
+
{description}
|
|
71
177
|
</div>
|
|
72
|
-
|
|
178
|
+
</div>
|
|
73
179
|
</div>
|
|
74
180
|
);
|
|
75
181
|
});
|
|
@@ -142,9 +142,9 @@ export function PanelOnramp({
|
|
|
142
142
|
{/* Pay Section */}
|
|
143
143
|
<div className="border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4">
|
|
144
144
|
<div className="flex h-7 w-full items-center justify-between">
|
|
145
|
-
<span className="text-as-
|
|
145
|
+
<span className="text-as-tertiary flex items-center text-sm font-bold">Pay</span>
|
|
146
146
|
<button
|
|
147
|
-
className="text-as-
|
|
147
|
+
className="text-as-tertiary flex h-7 items-center gap-1 text-sm"
|
|
148
148
|
onClick={() => setActivePanel(fiatPaymentMethodIndex)} // PanelView.FIAT_PAYMENT_METHOD
|
|
149
149
|
>
|
|
150
150
|
{(() => {
|
|
@@ -175,7 +175,7 @@ export function PanelOnramp({
|
|
|
175
175
|
{/* Amount Input */}
|
|
176
176
|
<div className="flex items-center justify-center pb-2 pt-8">
|
|
177
177
|
<div className="flex gap-1">
|
|
178
|
-
<span className="text-as-
|
|
178
|
+
<span className="text-as-tertiary text-2xl font-bold">$</span>
|
|
179
179
|
<Input
|
|
180
180
|
ref={amountInputRef}
|
|
181
181
|
type="text"
|
|
@@ -227,10 +227,10 @@ export function PanelOnramp({
|
|
|
227
227
|
{/* Recipient Section */}
|
|
228
228
|
<div className="border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4">
|
|
229
229
|
<div className="flex w-full items-center justify-between gap-2">
|
|
230
|
-
<span className="text-as-
|
|
230
|
+
<span className="text-as-tertiary flex items-center text-sm">Recipient</span>
|
|
231
231
|
{_recipientAddress ? (
|
|
232
232
|
<button
|
|
233
|
-
className="text-as-
|
|
233
|
+
className="text-as-tertiary flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700"
|
|
234
234
|
onClick={() => setActivePanel(recipientSelectionPanelIndex)} // Recipient selection panel
|
|
235
235
|
>
|
|
236
236
|
<span className="text-sm">
|
|
@@ -241,7 +241,7 @@ export function PanelOnramp({
|
|
|
241
241
|
</button>
|
|
242
242
|
) : (
|
|
243
243
|
<button
|
|
244
|
-
className="text-as-
|
|
244
|
+
className="text-as-tertiary flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700"
|
|
245
245
|
onClick={() => setActivePanel(5)} // Recipient selection panel
|
|
246
246
|
>
|
|
247
247
|
<Wallet className="text-as-brand" size={16} />
|
|
@@ -254,13 +254,13 @@ export function PanelOnramp({
|
|
|
254
254
|
<div className="divider w-full" />
|
|
255
255
|
|
|
256
256
|
<div className="flex items-center justify-between gap-4">
|
|
257
|
-
<span className="text-as-
|
|
257
|
+
<span className="text-as-tertiary text-sm">Expected to receive</span>
|
|
258
258
|
<div className="flex flex-wrap items-center justify-end gap-1">
|
|
259
259
|
<span className="text-as-primary font-semibold">
|
|
260
260
|
{destinationAmount || "0"} {dstTokenSymbol || destinationToken?.symbol || ""}
|
|
261
261
|
</span>
|
|
262
262
|
<div className="flex items-center gap-1">
|
|
263
|
-
<span className="text-as-
|
|
263
|
+
<span className="text-as-tertiary text-sm">
|
|
264
264
|
on {destinationChainId ? ALL_CHAINS[destinationChainId]?.name : ""}
|
|
265
265
|
</span>
|
|
266
266
|
{destinationToken && destinationChainId && destinationToken.metadata?.logoURI && (
|
|
@@ -275,7 +275,7 @@ export function PanelOnramp({
|
|
|
275
275
|
<div className="">
|
|
276
276
|
<div className="flex items-center justify-between">
|
|
277
277
|
<div className="flex items-center gap-1.5">
|
|
278
|
-
<span className="text-as-
|
|
278
|
+
<span className="text-as-tertiary text-sm">Total</span>
|
|
279
279
|
{anyspendQuote?.data?.fee && onShowFeeDetail && (
|
|
280
280
|
<button
|
|
281
281
|
onClick={onShowFeeDetail}
|
|
@@ -82,7 +82,7 @@ export function CryptoPaySection({
|
|
|
82
82
|
<div className="flex items-center justify-between">
|
|
83
83
|
<div className="text-as-primary/50 flex h-7 items-center text-sm">Pay</div>
|
|
84
84
|
<button
|
|
85
|
-
className="text-as-
|
|
85
|
+
className="text-as-tertiary flex h-7 items-center gap-2 text-sm transition-colors focus:!outline-none"
|
|
86
86
|
onClick={onSelectCryptoPaymentMethod}
|
|
87
87
|
>
|
|
88
88
|
{selectedCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ? (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { motion } from "framer-motion";
|
|
4
|
-
import {
|
|
4
|
+
import { AnimatedCheckmark } from "../icons/AnimatedCheckmark";
|
|
5
5
|
|
|
6
6
|
export interface Step {
|
|
7
7
|
id: string | number;
|
|
@@ -13,9 +13,18 @@ export interface StepProgressProps {
|
|
|
13
13
|
steps: Step[];
|
|
14
14
|
currentStepIndex: number;
|
|
15
15
|
className?: string;
|
|
16
|
+
/** When false, completed step checkmarks render in their static (post-animation) state.
|
|
17
|
+
* Use false when the step was already completed in a previous render (e.g. transitioning
|
|
18
|
+
* between sub-states within the same step). Defaults to true. */
|
|
19
|
+
animateCompletedSteps?: boolean;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
export function StepProgress({
|
|
22
|
+
export function StepProgress({
|
|
23
|
+
steps,
|
|
24
|
+
currentStepIndex,
|
|
25
|
+
className = "",
|
|
26
|
+
animateCompletedSteps = true,
|
|
27
|
+
}: StepProgressProps) {
|
|
19
28
|
const currentStep = steps[currentStepIndex];
|
|
20
29
|
|
|
21
30
|
return (
|
|
@@ -25,32 +34,34 @@ export function StepProgress({ steps, currentStepIndex, className = "" }: StepPr
|
|
|
25
34
|
{steps.map((_, index) => (
|
|
26
35
|
<>
|
|
27
36
|
<div key={index} className="flex items-center">
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
index
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
{index < currentStepIndex ? (
|
|
38
|
+
// Completed step - checkmark replaces the whole circle
|
|
39
|
+
<motion.div
|
|
40
|
+
initial={{ scale: 0.8, opacity: 0 }}
|
|
41
|
+
animate={{ scale: 1, opacity: 1 }}
|
|
42
|
+
transition={{ delay: index * 0.2 }}
|
|
43
|
+
>
|
|
44
|
+
<AnimatedCheckmark className="h-10 w-10" strokeWidth={2.5} static={!animateCompletedSteps} />
|
|
45
|
+
</motion.div>
|
|
46
|
+
) : (
|
|
47
|
+
<motion.div
|
|
48
|
+
initial={{ scale: 0.8, opacity: 0 }}
|
|
49
|
+
animate={{ scale: 1, opacity: 1 }}
|
|
50
|
+
transition={{ delay: index * 0.2 }}
|
|
51
|
+
className={`border-as-border-secondary relative flex h-10 w-10 items-center justify-center rounded-full border-[3px]`}
|
|
52
|
+
>
|
|
53
|
+
{index === currentStepIndex ? (
|
|
54
|
+
// Current step - show spinning border and step number
|
|
55
|
+
<>
|
|
56
|
+
<div className="border-t-as-primary absolute -inset-0.5 animate-spin rounded-full border-[3px] border-transparent" />
|
|
57
|
+
<span className="text-as-primary font-semibold">{index + 1}</span>
|
|
58
|
+
</>
|
|
59
|
+
) : (
|
|
60
|
+
// Future step - show step number with disabled styling
|
|
61
|
+
<span className="text-as-content-disabled font-semibold">{index + 1}</span>
|
|
62
|
+
)}
|
|
63
|
+
</motion.div>
|
|
64
|
+
)}
|
|
54
65
|
</div>
|
|
55
66
|
{/* Connector dots - don't show after last step */}
|
|
56
67
|
{index < steps.length - 1 && (
|
|
@@ -73,32 +84,9 @@ export function StepProgress({ steps, currentStepIndex, className = "" }: StepPr
|
|
|
73
84
|
className="text-center"
|
|
74
85
|
>
|
|
75
86
|
<h2 className="text-as-primary text-xl font-semibold">{currentStep.title}</h2>
|
|
76
|
-
{currentStep.description && <p className="text-as-
|
|
87
|
+
{currentStep.description && <p className="text-as-tertiary mt-1 text-sm">{currentStep.description}</p>}
|
|
77
88
|
</motion.div>
|
|
78
89
|
)}
|
|
79
90
|
</div>
|
|
80
91
|
);
|
|
81
92
|
}
|
|
82
|
-
|
|
83
|
-
// Example usage:
|
|
84
|
-
/*
|
|
85
|
-
// Basic 3-step process
|
|
86
|
-
const paymentSteps = [
|
|
87
|
-
{ id: 1, title: "Connect Wallet", description: "Connect your wallet to continue" },
|
|
88
|
-
{ id: 2, title: "Confirm Transaction", description: "Review and confirm your transaction" },
|
|
89
|
-
{ id: 3, title: "Complete Payment", description: "Finalize your transaction" }
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
// 5-step onboarding process
|
|
93
|
-
const onboardingSteps = [
|
|
94
|
-
{ id: "signup", title: "Sign Up", description: "Create your account" },
|
|
95
|
-
{ id: "verify", title: "Verify Email", description: "Check your email for verification" },
|
|
96
|
-
{ id: "profile", title: "Setup Profile", description: "Complete your profile information" },
|
|
97
|
-
{ id: "preferences", title: "Set Preferences", description: "Configure your settings" },
|
|
98
|
-
{ id: "complete", title: "All Done!", description: "Welcome to the platform" }
|
|
99
|
-
];
|
|
100
|
-
|
|
101
|
-
// Usage in component:
|
|
102
|
-
<StepProgress steps={paymentSteps} currentStepIndex={1} />
|
|
103
|
-
<StepProgress steps={onboardingSteps} currentStepIndex={2} className="my-8" />
|
|
104
|
-
*/
|