@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
|
@@ -64,18 +64,6 @@ export function TokenBalance({
|
|
|
64
64
|
|
|
65
65
|
{!!rawBalance && (
|
|
66
66
|
<>
|
|
67
|
-
{/* <button
|
|
68
|
-
onClick={() => handlePercentageClick(20)}
|
|
69
|
-
className="text-as-primary/50 bg-as-on-surface-2 hover:bg-as-on-surface-3 inline-flex rounded-lg px-2 py-1 text-xs transition-colors sm:hidden"
|
|
70
|
-
>
|
|
71
|
-
20%
|
|
72
|
-
</button>
|
|
73
|
-
<button
|
|
74
|
-
onClick={() => handlePercentageClick(50)}
|
|
75
|
-
className="text-as-primary/50 bg-as-on-surface-2 hover:bg-as-on-surface-3 inline-flex rounded-lg px-2 py-1 text-xs transition-colors"
|
|
76
|
-
>
|
|
77
|
-
50%
|
|
78
|
-
</button> */}
|
|
79
67
|
<button
|
|
80
68
|
onClick={() => handlePercentageClick(100)}
|
|
81
69
|
className="text-as-primary/50 bg-as-on-surface-2 hover:bg-as-on-surface-3 inline-flex cursor-pointer rounded-lg px-2 py-1 text-xs transition-colors"
|
|
@@ -248,7 +248,7 @@ export const TransferCryptoDetails = memo(function TransferCryptoDetails({
|
|
|
248
248
|
{order.globalAddress}
|
|
249
249
|
</div>
|
|
250
250
|
<div className="order-transfer-crypto-address-copy-icon-wrapper place-self-end">
|
|
251
|
-
<Copy className="order-transfer-crypto-address-copy-icon group-hover:text-as-brand text-as-
|
|
251
|
+
<Copy className="order-transfer-crypto-address-copy-icon group-hover:text-as-brand text-as-tertiary h-4 w-4 cursor-pointer transition-all duration-200" />
|
|
252
252
|
</div>
|
|
253
253
|
</div>
|
|
254
254
|
</div>
|
|
@@ -275,14 +275,6 @@ export const TransferCryptoDetails = memo(function TransferCryptoDetails({
|
|
|
275
275
|
Copy deposit address
|
|
276
276
|
</ShinyButton>
|
|
277
277
|
|
|
278
|
-
{/* <button
|
|
279
|
-
className="order-transfer-crypto-cancel-btn text-as-primary/60 hover:text-as-primary flex w-full items-center justify-center gap-2 py-2 transition-colors"
|
|
280
|
-
onClick={onBack}
|
|
281
|
-
>
|
|
282
|
-
<RefreshCcw className="h-4 w-4" />
|
|
283
|
-
Cancel and start over
|
|
284
|
-
</button> */}
|
|
285
|
-
|
|
286
278
|
<PaymentMethodSwitch
|
|
287
279
|
currentMethod={CryptoPaymentMethodType.TRANSFER_CRYPTO}
|
|
288
280
|
onMethodChange={onPaymentMethodChange}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
import { ALL_CHAINS } from "@b3dotfun/sdk/anyspend";
|
|
4
4
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
5
5
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
6
|
-
import {
|
|
6
|
+
import { ShinyButton } from "@b3dotfun/sdk/global-account/react";
|
|
7
|
+
import { Home } from "lucide-react";
|
|
8
|
+
import { useAnySpendCustomization } from "../context/AnySpendCustomizationContext";
|
|
9
|
+
import { AnimatedCheckmark } from "../icons/AnimatedCheckmark";
|
|
7
10
|
import { TransferResult } from "../../hooks/useWatchTransfer";
|
|
8
11
|
import { ChainTokenIcon } from "./ChainTokenIcon";
|
|
9
12
|
|
|
@@ -37,6 +40,7 @@ export function TransferResultScreen({
|
|
|
37
40
|
onClose,
|
|
38
41
|
}: TransferResultScreenProps) {
|
|
39
42
|
const chain = ALL_CHAINS[chainId];
|
|
43
|
+
const { content } = useAnySpendCustomization();
|
|
40
44
|
|
|
41
45
|
const handleClose = () => {
|
|
42
46
|
if (onClose) {
|
|
@@ -54,15 +58,17 @@ export function TransferResultScreen({
|
|
|
54
58
|
)}
|
|
55
59
|
>
|
|
56
60
|
<div className="anyspend-transfer-result-content flex flex-col items-center gap-6">
|
|
57
|
-
{/*
|
|
58
|
-
<div className="anyspend-transfer-success-icon
|
|
59
|
-
<
|
|
61
|
+
{/* Animated success checkmark */}
|
|
62
|
+
<div className="anyspend-transfer-success-icon">
|
|
63
|
+
<AnimatedCheckmark className="h-16 w-16" />
|
|
60
64
|
</div>
|
|
61
65
|
|
|
62
66
|
{/* Success message */}
|
|
63
67
|
<div className="anyspend-transfer-success-message flex flex-col items-center gap-2">
|
|
64
|
-
<h2 className="text-as-primary text-xl font-semibold">Transfer Received
|
|
65
|
-
<p className="text-as-secondary text-center text-sm">
|
|
68
|
+
<h2 className="text-as-primary text-xl font-semibold">{content.successTitle || "Transfer Received!"}</h2>
|
|
69
|
+
<p className="text-as-secondary text-center text-sm">
|
|
70
|
+
{content.successDescription || "Your transfer has been successfully received."}
|
|
71
|
+
</p>
|
|
66
72
|
</div>
|
|
67
73
|
|
|
68
74
|
{/* Amount display */}
|
|
@@ -89,18 +95,20 @@ export function TransferResultScreen({
|
|
|
89
95
|
</div>
|
|
90
96
|
|
|
91
97
|
{/* Close button */}
|
|
92
|
-
<
|
|
98
|
+
<ShinyButton
|
|
99
|
+
accentColor="hsl(var(--as-brand))"
|
|
93
100
|
onClick={handleClose}
|
|
94
|
-
className="anyspend-transfer-close-button
|
|
101
|
+
className="anyspend-transfer-close-button w-full"
|
|
102
|
+
textClassName="text-white"
|
|
95
103
|
>
|
|
96
104
|
{mode === "page" ? (
|
|
97
|
-
|
|
105
|
+
<span className="flex items-center justify-center gap-2">
|
|
98
106
|
Return to Home <Home className="ml-2 h-4 w-4" />
|
|
99
|
-
|
|
107
|
+
</span>
|
|
100
108
|
) : (
|
|
101
109
|
"Close"
|
|
102
110
|
)}
|
|
103
|
-
</
|
|
111
|
+
</ShinyButton>
|
|
104
112
|
</div>
|
|
105
113
|
</div>
|
|
106
114
|
);
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useMemo, type ReactNode } from "react";
|
|
4
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "../types/customization";
|
|
5
|
+
|
|
6
|
+
interface AnySpendCustomizationContextValue {
|
|
7
|
+
slots: AnySpendSlots;
|
|
8
|
+
content: AnySpendContent;
|
|
9
|
+
theme: AnySpendTheme;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const AnySpendCustomizationContext = createContext<AnySpendCustomizationContextValue>({
|
|
13
|
+
slots: {},
|
|
14
|
+
content: {},
|
|
15
|
+
theme: {},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
/** Convert a hex color to HSL string (e.g. "210 50% 40%"). Supports both 3-digit (#fff) and 6-digit (#ffffff) formats. */
|
|
19
|
+
function hexToHsl(hex: string): string | null {
|
|
20
|
+
const hexStr = hex.replace(/^#/, "");
|
|
21
|
+
let r: number, g: number, b: number;
|
|
22
|
+
|
|
23
|
+
if (hexStr.length === 3) {
|
|
24
|
+
// 3-digit hex shorthand (e.g., #fff)
|
|
25
|
+
[r, g, b] = [0, 1, 2].map(i => parseInt(hexStr[i] + hexStr[i], 16) / 255);
|
|
26
|
+
} else if (hexStr.length === 6) {
|
|
27
|
+
// 6-digit hex (e.g., #ffffff)
|
|
28
|
+
[r, g, b] = [0, 2, 4].map(i => parseInt(hexStr.substring(i, i + 2), 16) / 255);
|
|
29
|
+
} else {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const max = Math.max(r, g, b);
|
|
34
|
+
const min = Math.min(r, g, b);
|
|
35
|
+
let h = 0;
|
|
36
|
+
let s = 0;
|
|
37
|
+
const l = (max + min) / 2;
|
|
38
|
+
|
|
39
|
+
if (max !== min) {
|
|
40
|
+
const d = max - min;
|
|
41
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
42
|
+
switch (max) {
|
|
43
|
+
case r:
|
|
44
|
+
h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
|
|
45
|
+
break;
|
|
46
|
+
case g:
|
|
47
|
+
h = ((b - r) / d + 2) / 6;
|
|
48
|
+
break;
|
|
49
|
+
case b:
|
|
50
|
+
h = ((r - g) / d + 4) / 6;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return `${Math.round(h * 360)} ${Math.round(s * 100)}% ${Math.round(l * 100)}%`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const CSS_VAR_MAP: Record<string, string> = {
|
|
59
|
+
primary: "--as-primary",
|
|
60
|
+
secondary: "--as-secondary",
|
|
61
|
+
tertiary: "--as-tertiary",
|
|
62
|
+
surfacePrimary: "--as-surface-primary",
|
|
63
|
+
surfaceSecondary: "--as-surface-secondary",
|
|
64
|
+
brand: "--as-brand",
|
|
65
|
+
borderPrimary: "--as-border-primary",
|
|
66
|
+
borderSecondary: "--as-border-secondary",
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export interface AnySpendCustomizationProviderProps {
|
|
70
|
+
slots?: AnySpendSlots;
|
|
71
|
+
content?: AnySpendContent;
|
|
72
|
+
theme?: AnySpendTheme;
|
|
73
|
+
children: ReactNode;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function AnySpendCustomizationProvider({ slots, content, theme, children }: AnySpendCustomizationProviderProps) {
|
|
77
|
+
const value = useMemo<AnySpendCustomizationContextValue>(
|
|
78
|
+
() => ({
|
|
79
|
+
slots: slots || {},
|
|
80
|
+
content: content || {},
|
|
81
|
+
theme: theme || {},
|
|
82
|
+
}),
|
|
83
|
+
[slots, content, theme],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const cssVarOverrides = useMemo(() => {
|
|
87
|
+
const vars: Record<string, string> = {};
|
|
88
|
+
|
|
89
|
+
// Convert brandColor hex → HSL → --as-brand
|
|
90
|
+
if (theme?.brandColor) {
|
|
91
|
+
const hsl = hexToHsl(theme.brandColor);
|
|
92
|
+
if (hsl) vars["--as-brand"] = hsl;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Apply explicit color overrides (convert hex to HSL)
|
|
96
|
+
if (theme?.colors) {
|
|
97
|
+
for (const [key, val] of Object.entries(theme.colors)) {
|
|
98
|
+
const cssVar = CSS_VAR_MAP[key];
|
|
99
|
+
if (cssVar && val) {
|
|
100
|
+
const hsl = hexToHsl(val);
|
|
101
|
+
if (hsl) vars[cssVar] = hsl;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return vars;
|
|
107
|
+
}, [theme?.brandColor, theme?.colors]);
|
|
108
|
+
|
|
109
|
+
const hasOverrides = Object.keys(cssVarOverrides).length > 0;
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<AnySpendCustomizationContext.Provider value={value}>
|
|
113
|
+
{hasOverrides ? (
|
|
114
|
+
<div style={{ ...cssVarOverrides, display: "contents" } as React.CSSProperties}>{children}</div>
|
|
115
|
+
) : (
|
|
116
|
+
children
|
|
117
|
+
)}
|
|
118
|
+
</AnySpendCustomizationContext.Provider>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function useAnySpendCustomization(): AnySpendCustomizationContextValue {
|
|
123
|
+
return useContext(AnySpendCustomizationContext);
|
|
124
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
5
|
+
|
|
6
|
+
interface AnimatedCheckmarkProps {
|
|
7
|
+
/** Circle stroke / fill color (CSS color value) */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Checkmark stroke color (defaults to white) */
|
|
10
|
+
checkColor?: string;
|
|
11
|
+
/** Stroke width for the circle and check path */
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
/** Tailwind or custom className to control size, e.g. "h-16 w-16" */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Animation delay in seconds */
|
|
16
|
+
delay?: number;
|
|
17
|
+
/** Render in final (post-animation) state with no animation */
|
|
18
|
+
static?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Animated checkmark SVG component.
|
|
23
|
+
* Circle draws in → checkmark draws → background fills → subtle scale bounce.
|
|
24
|
+
*
|
|
25
|
+
* Size is controlled via className (Tailwind classes like `h-10 w-10`, `h-16 w-16`, etc.).
|
|
26
|
+
* The SVG scales to fit its container via viewBox.
|
|
27
|
+
*/
|
|
28
|
+
export function AnimatedCheckmark({
|
|
29
|
+
color = "#22c55e",
|
|
30
|
+
checkColor = "#fff",
|
|
31
|
+
strokeWidth = 2,
|
|
32
|
+
className,
|
|
33
|
+
delay = 0,
|
|
34
|
+
static: isStatic = false,
|
|
35
|
+
}: AnimatedCheckmarkProps) {
|
|
36
|
+
const id = `ac-${useId().replace(/:/g, "")}`;
|
|
37
|
+
|
|
38
|
+
if (isStatic) {
|
|
39
|
+
return (
|
|
40
|
+
<svg
|
|
41
|
+
className={className}
|
|
42
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
43
|
+
viewBox="0 0 52 52"
|
|
44
|
+
style={{
|
|
45
|
+
borderRadius: "50%",
|
|
46
|
+
display: "block",
|
|
47
|
+
strokeWidth,
|
|
48
|
+
stroke: checkColor,
|
|
49
|
+
strokeMiterlimit: 10,
|
|
50
|
+
boxShadow: `inset 0px 0px 0px 100px ${color}`,
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<circle
|
|
54
|
+
cx="26"
|
|
55
|
+
cy="26"
|
|
56
|
+
r="25"
|
|
57
|
+
fill="none"
|
|
58
|
+
style={{
|
|
59
|
+
strokeWidth,
|
|
60
|
+
strokeMiterlimit: 10,
|
|
61
|
+
stroke: color,
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
<path fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8" style={{ transformOrigin: "50% 50%" }} />
|
|
65
|
+
</svg>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
<style
|
|
72
|
+
dangerouslySetInnerHTML={{
|
|
73
|
+
__html: `
|
|
74
|
+
@keyframes ${id}-stroke {
|
|
75
|
+
100% { stroke-dashoffset: 0; }
|
|
76
|
+
}
|
|
77
|
+
@keyframes ${id}-scale {
|
|
78
|
+
0%, 100% { transform: none; }
|
|
79
|
+
50% { transform: scale3d(1.1, 1.1, 1); }
|
|
80
|
+
}
|
|
81
|
+
@keyframes ${id}-fill {
|
|
82
|
+
100% { box-shadow: inset 0px 0px 0px 100px ${color}; }
|
|
83
|
+
}
|
|
84
|
+
.${id} {
|
|
85
|
+
border-radius: 50%;
|
|
86
|
+
display: block;
|
|
87
|
+
stroke-width: ${strokeWidth};
|
|
88
|
+
stroke: ${checkColor};
|
|
89
|
+
stroke-miterlimit: 10;
|
|
90
|
+
box-shadow: inset 0px 0px 0px ${color};
|
|
91
|
+
animation:
|
|
92
|
+
${id}-fill .4s ease-in-out ${delay + 0.4}s forwards,
|
|
93
|
+
${id}-scale .3s ease-in-out ${delay + 0.9}s both;
|
|
94
|
+
}
|
|
95
|
+
.${id}__circle {
|
|
96
|
+
stroke-dasharray: 166;
|
|
97
|
+
stroke-dashoffset: 166;
|
|
98
|
+
stroke-width: ${strokeWidth};
|
|
99
|
+
stroke-miterlimit: 10;
|
|
100
|
+
stroke: ${color};
|
|
101
|
+
fill: none;
|
|
102
|
+
animation: ${id}-stroke .6s cubic-bezier(0.65, 0, 0.45, 1) ${delay}s forwards;
|
|
103
|
+
}
|
|
104
|
+
.${id}__check {
|
|
105
|
+
transform-origin: 50% 50%;
|
|
106
|
+
stroke-dasharray: 48;
|
|
107
|
+
stroke-dashoffset: 48;
|
|
108
|
+
animation: ${id}-stroke .3s cubic-bezier(0.65, 0, 0.45, 1) ${delay + 0.8}s forwards;
|
|
109
|
+
}
|
|
110
|
+
`,
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
<svg className={cn(id, className)} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
|
|
114
|
+
<circle className={`${id}__circle`} cx="26" cy="26" r="25" fill="none" />
|
|
115
|
+
<path className={`${id}__check`} fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8" />
|
|
116
|
+
</svg>
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
// Checkout
|
|
2
|
+
export { AnySpendCheckout } from "./checkout/AnySpendCheckout";
|
|
3
|
+
export type {
|
|
4
|
+
AnySpendCheckoutProps,
|
|
5
|
+
CheckoutItem,
|
|
6
|
+
CheckoutSummaryLine,
|
|
7
|
+
AnySpendCheckoutClasses,
|
|
8
|
+
CheckoutFormSchema,
|
|
9
|
+
CheckoutFormComponentProps,
|
|
10
|
+
ShippingOption,
|
|
11
|
+
DiscountResult,
|
|
12
|
+
AddressData,
|
|
13
|
+
} from "./checkout/AnySpendCheckout";
|
|
14
|
+
export { AnySpendCheckoutTrigger } from "./checkout/AnySpendCheckoutTrigger";
|
|
15
|
+
export type { AnySpendCheckoutTriggerProps } from "./checkout/AnySpendCheckoutTrigger";
|
|
16
|
+
export type { PaymentMethod } from "./checkout/CheckoutPaymentPanel";
|
|
17
|
+
|
|
1
18
|
// Components
|
|
2
19
|
export { AnySpend } from "./AnySpend";
|
|
3
20
|
export { AnySpendBondKit } from "./AnySpendBondKit";
|
|
@@ -11,6 +28,7 @@ export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from ".
|
|
|
11
28
|
// Classes types for styling customization
|
|
12
29
|
export type {
|
|
13
30
|
AnySpendAllClasses,
|
|
31
|
+
AnySpendCheckoutClasses as AnySpendCheckoutClassesFromTypes,
|
|
14
32
|
AnySpendClasses,
|
|
15
33
|
AnySpendCustomExactInClasses,
|
|
16
34
|
AnySpendDepositClasses,
|
|
@@ -23,6 +41,21 @@ export type {
|
|
|
23
41
|
QRDepositClasses,
|
|
24
42
|
RecipientSelectionClasses,
|
|
25
43
|
} from "./types/classes";
|
|
44
|
+
|
|
45
|
+
// Customization types (slots, content, theme)
|
|
46
|
+
export type {
|
|
47
|
+
ActionButtonSlotProps,
|
|
48
|
+
AnySpendContent,
|
|
49
|
+
AnySpendSlots,
|
|
50
|
+
AnySpendTheme,
|
|
51
|
+
ConnectWalletButtonSlotProps,
|
|
52
|
+
ErrorScreenSlotProps,
|
|
53
|
+
SuccessScreenSlotProps,
|
|
54
|
+
} from "./types/customization";
|
|
55
|
+
|
|
56
|
+
// Customization context (for advanced/nested usage)
|
|
57
|
+
export { AnySpendCustomizationProvider, useAnySpendCustomization } from "./context/AnySpendCustomizationContext";
|
|
58
|
+
|
|
26
59
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
|
|
27
60
|
export { AnySpendWorkflowTrigger } from "./AnySpendWorkflowTrigger";
|
|
28
61
|
export type { AnySpendWorkflowTriggerProps } from "./AnySpendWorkflowTrigger";
|
|
@@ -452,11 +452,81 @@ export interface QRDepositClasses {
|
|
|
452
452
|
orderDetailsContent?: string;
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
+
/** Classes for AnySpendCheckout component */
|
|
456
|
+
export interface AnySpendCheckoutClasses {
|
|
457
|
+
// Layout
|
|
458
|
+
root?: string;
|
|
459
|
+
layout?: string;
|
|
460
|
+
paymentColumn?: string;
|
|
461
|
+
cartColumn?: string;
|
|
462
|
+
|
|
463
|
+
// Payment panel
|
|
464
|
+
paymentPanel?: string;
|
|
465
|
+
paymentTitle?: string;
|
|
466
|
+
paymentMethodSelector?: string;
|
|
467
|
+
paymentMethodButton?: string;
|
|
468
|
+
|
|
469
|
+
// Crypto panel
|
|
470
|
+
cryptoPanel?: string;
|
|
471
|
+
tokenSelector?: string;
|
|
472
|
+
quoteDisplay?: string;
|
|
473
|
+
payButton?: string;
|
|
474
|
+
|
|
475
|
+
// Fiat / Stripe panel
|
|
476
|
+
fiatPanel?: string;
|
|
477
|
+
stripeForm?: string;
|
|
478
|
+
stripeSubmitButton?: string;
|
|
479
|
+
|
|
480
|
+
// Coinbase panel
|
|
481
|
+
coinbasePanel?: string;
|
|
482
|
+
|
|
483
|
+
// Cart panel
|
|
484
|
+
cartPanel?: string;
|
|
485
|
+
cartTitle?: string;
|
|
486
|
+
cartItemRow?: string;
|
|
487
|
+
cartItemImage?: string;
|
|
488
|
+
cartItemName?: string;
|
|
489
|
+
cartItemDescription?: string;
|
|
490
|
+
cartItemPrice?: string;
|
|
491
|
+
cartSummary?: string;
|
|
492
|
+
cartTotal?: string;
|
|
493
|
+
cartSubtotal?: string;
|
|
494
|
+
cartSummaryLine?: string;
|
|
495
|
+
cartSummaryLineLabel?: string;
|
|
496
|
+
cartSummaryLineAmount?: string;
|
|
497
|
+
cartDiscount?: string;
|
|
498
|
+
cartItemMetadata?: string;
|
|
499
|
+
cartItemMetadataLabel?: string;
|
|
500
|
+
cartItemMetadataValue?: string;
|
|
501
|
+
|
|
502
|
+
// Form panel
|
|
503
|
+
formPanel?: string;
|
|
504
|
+
formField?: string;
|
|
505
|
+
formFieldLabel?: string;
|
|
506
|
+
formFieldInput?: string;
|
|
507
|
+
shippingSelector?: string;
|
|
508
|
+
discountInput?: string;
|
|
509
|
+
addressForm?: string;
|
|
510
|
+
|
|
511
|
+
// Branding
|
|
512
|
+
poweredBy?: string;
|
|
513
|
+
|
|
514
|
+
// Success
|
|
515
|
+
successPanel?: string;
|
|
516
|
+
returnButton?: string;
|
|
517
|
+
|
|
518
|
+
// Order status tracking
|
|
519
|
+
orderStatusPanel?: string;
|
|
520
|
+
retryButton?: string;
|
|
521
|
+
transactionLink?: string;
|
|
522
|
+
}
|
|
523
|
+
|
|
455
524
|
/** Combined classes for all AnySpend-related components */
|
|
456
525
|
export interface AnySpendAllClasses {
|
|
457
526
|
deposit?: AnySpendDepositClasses;
|
|
458
527
|
anySpend?: AnySpendClasses;
|
|
459
528
|
customExactIn?: AnySpendCustomExactInClasses;
|
|
529
|
+
checkout?: AnySpendCheckoutClasses;
|
|
460
530
|
cryptoPaySection?: CryptoPaySectionClasses;
|
|
461
531
|
cryptoReceiveSection?: CryptoReceiveSectionClasses;
|
|
462
532
|
panelOnramp?: PanelOnrampClasses;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type {
|
|
3
|
+
CheckoutFormComponentProps,
|
|
4
|
+
ShippingSelectorSlotProps,
|
|
5
|
+
DiscountInputSlotProps,
|
|
6
|
+
} from "../../../types/forms";
|
|
7
|
+
|
|
8
|
+
// === SLOT PROP INTERFACES ===
|
|
9
|
+
|
|
10
|
+
export interface ActionButtonSlotProps {
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
text: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ConnectWalletButtonSlotProps {
|
|
18
|
+
onPayment: () => void;
|
|
19
|
+
txLoading: boolean;
|
|
20
|
+
connectedAddress?: string;
|
|
21
|
+
paymentLabel: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface SuccessScreenSlotProps {
|
|
25
|
+
title: string;
|
|
26
|
+
description: string;
|
|
27
|
+
txHash?: string;
|
|
28
|
+
orderId?: string;
|
|
29
|
+
explorerUrl?: string;
|
|
30
|
+
onDone: () => void;
|
|
31
|
+
returnUrl?: string;
|
|
32
|
+
returnLabel?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ErrorScreenSlotProps {
|
|
36
|
+
title: string;
|
|
37
|
+
description: string;
|
|
38
|
+
errorType: "failure" | "expired" | "refunded";
|
|
39
|
+
orderId?: string;
|
|
40
|
+
onRetry?: () => void;
|
|
41
|
+
onDone?: () => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// === SLOTS (element replacement) ===
|
|
45
|
+
|
|
46
|
+
export interface AnySpendSlots {
|
|
47
|
+
actionButton?: (props: ActionButtonSlotProps) => ReactNode;
|
|
48
|
+
connectWalletButton?: (props: ConnectWalletButtonSlotProps) => ReactNode;
|
|
49
|
+
header?: (props: { mode: "page" | "modal" }) => ReactNode;
|
|
50
|
+
footer?: ReactNode;
|
|
51
|
+
successScreen?: (props: SuccessScreenSlotProps) => ReactNode;
|
|
52
|
+
errorScreen?: (props: ErrorScreenSlotProps) => ReactNode;
|
|
53
|
+
/** Replace the entire checkout form panel with a custom component */
|
|
54
|
+
checkoutForm?: (props: CheckoutFormComponentProps) => ReactNode;
|
|
55
|
+
/** Replace the shipping method selector */
|
|
56
|
+
shippingSelector?: (props: ShippingSelectorSlotProps) => ReactNode;
|
|
57
|
+
/** Replace the discount code input */
|
|
58
|
+
discountInput?: (props: DiscountInputSlotProps) => ReactNode;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// === CONTENT (text/message overrides) ===
|
|
62
|
+
|
|
63
|
+
export interface AnySpendContent {
|
|
64
|
+
// Success states
|
|
65
|
+
successTitle?: string | ReactNode;
|
|
66
|
+
successDescription?: string | ReactNode;
|
|
67
|
+
|
|
68
|
+
// Error states
|
|
69
|
+
failureTitle?: string | ReactNode;
|
|
70
|
+
failureDescription?: string | ReactNode;
|
|
71
|
+
expiredTitle?: string | ReactNode;
|
|
72
|
+
expiredDescription?: string | ReactNode;
|
|
73
|
+
refundedTitle?: string | ReactNode;
|
|
74
|
+
refundedDescription?: string | ReactNode;
|
|
75
|
+
|
|
76
|
+
// Processing states
|
|
77
|
+
processingTitle?: string | ReactNode;
|
|
78
|
+
processingDescription?: string | ReactNode;
|
|
79
|
+
|
|
80
|
+
// Buttons
|
|
81
|
+
returnButtonLabel?: string;
|
|
82
|
+
retryButtonLabel?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// === THEME ===
|
|
86
|
+
|
|
87
|
+
export interface AnySpendTheme {
|
|
88
|
+
brandColor?: string;
|
|
89
|
+
colors?: Partial<{
|
|
90
|
+
primary: string;
|
|
91
|
+
secondary: string;
|
|
92
|
+
tertiary: string;
|
|
93
|
+
surfacePrimary: string;
|
|
94
|
+
surfaceSecondary: string;
|
|
95
|
+
brand: string;
|
|
96
|
+
borderPrimary: string;
|
|
97
|
+
borderSecondary: string;
|
|
98
|
+
}>;
|
|
99
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { USDC_BASE } from "@b3dotfun/sdk/anyspend/constants";
|
|
2
2
|
import { anyspendService } from "@b3dotfun/sdk/anyspend/services/anyspend";
|
|
3
3
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
4
|
+
import { CreateOrderResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
4
5
|
import { VisitorData } from "@b3dotfun/sdk/anyspend/types/fingerprint";
|
|
5
6
|
import { buildMetadata, buildPayload, normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
6
7
|
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
@@ -26,7 +27,7 @@ export type CreateOnrampOrderParams = Omit<CreateOrderParams, "srcChain" | "srcT
|
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export type UseAnyspendCreateOnrampOrderProps = {
|
|
29
|
-
onSuccess?: (data:
|
|
30
|
+
onSuccess?: (data: CreateOrderResponse) => void;
|
|
30
31
|
onError?: (error: Error) => void;
|
|
31
32
|
};
|
|
32
33
|
|
|
@@ -124,7 +125,7 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError }: UseAnyspend
|
|
|
124
125
|
throw error;
|
|
125
126
|
}
|
|
126
127
|
},
|
|
127
|
-
onSuccess: (data:
|
|
128
|
+
onSuccess: (data: CreateOrderResponse) => {
|
|
128
129
|
onSuccess?.(data);
|
|
129
130
|
},
|
|
130
131
|
onError: (error: Error) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { anyspendService } from "@b3dotfun/sdk/anyspend/services/anyspend";
|
|
2
2
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
3
|
+
import { CreateOrderResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
3
4
|
import { VisitorData } from "@b3dotfun/sdk/anyspend/types/fingerprint";
|
|
4
5
|
import { buildMetadata, buildPayload, normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
5
6
|
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
@@ -26,7 +27,7 @@ export type CreateOrderParams = {
|
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export type UseAnyspendCreateOrderProps = {
|
|
29
|
-
onSuccess?: (data:
|
|
30
|
+
onSuccess?: (data: CreateOrderResponse) => void;
|
|
30
31
|
onError?: (error: Error) => void;
|
|
31
32
|
};
|
|
32
33
|
|
|
@@ -99,7 +100,7 @@ export function useAnyspendCreateOrder({ onSuccess, onError }: UseAnyspendCreate
|
|
|
99
100
|
throw error;
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
|
-
onSuccess: (data:
|
|
103
|
+
onSuccess: (data: CreateOrderResponse) => {
|
|
103
104
|
onSuccess?.(data);
|
|
104
105
|
},
|
|
105
106
|
onError: (error: Error) => {
|
|
@@ -110,6 +110,8 @@ interface UseAnyspendFlowProps {
|
|
|
110
110
|
disableUrlParamManagement?: boolean;
|
|
111
111
|
orderType?: "hype_duel" | "custom_exact_in" | "swap";
|
|
112
112
|
customExactInConfig?: CustomExactInConfig;
|
|
113
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
114
|
+
senderAddress?: string;
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
// This hook serves for order hype_duel and custom_exact_in
|
|
@@ -127,6 +129,7 @@ export function useAnyspendFlow({
|
|
|
127
129
|
disableUrlParamManagement = false,
|
|
128
130
|
orderType = "hype_duel",
|
|
129
131
|
customExactInConfig,
|
|
132
|
+
senderAddress,
|
|
130
133
|
}: UseAnyspendFlowProps) {
|
|
131
134
|
const searchParams = useSearchParamsSSR();
|
|
132
135
|
const router = useRouter();
|
|
@@ -180,9 +183,10 @@ export function useAnyspendFlow({
|
|
|
180
183
|
const recipientName = recipientProfile.data?.name;
|
|
181
184
|
|
|
182
185
|
// Check token balance for crypto payments
|
|
186
|
+
const effectiveBalanceAddress = senderAddress || walletAddress;
|
|
183
187
|
const { rawBalance, isLoading: isBalanceLoading } = useTokenBalance({
|
|
184
188
|
token: selectedSrcToken,
|
|
185
|
-
address:
|
|
189
|
+
address: effectiveBalanceAddress,
|
|
186
190
|
});
|
|
187
191
|
|
|
188
192
|
// Check if user has enough balance
|