@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
|
@@ -48,6 +48,8 @@ import { useCryptoPaymentMethodState } from "../hooks/useCryptoPaymentMethodStat
|
|
|
48
48
|
import { useOnOrderSuccess } from "../hooks/useOnOrderSuccess";
|
|
49
49
|
import { useRecipientAddressState } from "../hooks/useRecipientAddressState";
|
|
50
50
|
import { AnySpendFingerprintWrapper, getFingerprintConfig } from "./AnySpendFingerprintWrapper";
|
|
51
|
+
import { AnySpendCustomizationProvider } from "./context/AnySpendCustomizationContext";
|
|
52
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
51
53
|
import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPaymentMethod";
|
|
52
54
|
import { CryptoPaymentMethodDisplay } from "./common/CryptoPaymentMethodDisplay";
|
|
53
55
|
import { FeeBreakDown } from "./common/FeeBreakDown";
|
|
@@ -191,12 +193,22 @@ export function AnySpendCustom(props: {
|
|
|
191
193
|
onShowPointsDetail?: () => void;
|
|
192
194
|
/** Fiat amount in USD for fiat payments */
|
|
193
195
|
srcFiatAmount?: string;
|
|
196
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
197
|
+
senderAddress?: string;
|
|
198
|
+
/** Render function overrides for replaceable UI elements */
|
|
199
|
+
slots?: AnySpendSlots;
|
|
200
|
+
/** String or ReactNode overrides for text/messages */
|
|
201
|
+
content?: AnySpendContent;
|
|
202
|
+
/** Structured color/theme configuration */
|
|
203
|
+
theme?: AnySpendTheme;
|
|
194
204
|
}) {
|
|
195
205
|
const fingerprintConfig = getFingerprintConfig();
|
|
196
206
|
|
|
197
207
|
return (
|
|
198
208
|
<AnySpendFingerprintWrapper fingerprint={fingerprintConfig}>
|
|
199
|
-
<
|
|
209
|
+
<AnySpendCustomizationProvider slots={props.slots} content={props.content} theme={props.theme}>
|
|
210
|
+
<AnySpendCustomInner {...props} />
|
|
211
|
+
</AnySpendCustomizationProvider>
|
|
200
212
|
</AnySpendFingerprintWrapper>
|
|
201
213
|
);
|
|
202
214
|
}
|
|
@@ -220,6 +232,7 @@ function AnySpendCustomInner({
|
|
|
220
232
|
onShowPointsDetail,
|
|
221
233
|
srcFiatAmount: srcFiatAmountProps,
|
|
222
234
|
forceFiatPayment,
|
|
235
|
+
senderAddress,
|
|
223
236
|
}: {
|
|
224
237
|
loadOrder?: string;
|
|
225
238
|
mode?: "modal" | "page";
|
|
@@ -245,6 +258,10 @@ function AnySpendCustomInner({
|
|
|
245
258
|
onShowPointsDetail?: () => void;
|
|
246
259
|
srcFiatAmount?: string;
|
|
247
260
|
forceFiatPayment?: boolean;
|
|
261
|
+
senderAddress?: string;
|
|
262
|
+
slots?: AnySpendSlots;
|
|
263
|
+
content?: AnySpendContent;
|
|
264
|
+
theme?: AnySpendTheme;
|
|
248
265
|
}) {
|
|
249
266
|
const hasMounted = useHasMounted();
|
|
250
267
|
|
|
@@ -282,15 +299,16 @@ function AnySpendCustomInner({
|
|
|
282
299
|
const { data: tokenList } = useAnyspendTokenList(srcChainId, "");
|
|
283
300
|
|
|
284
301
|
// Get token balances for the selected chain
|
|
302
|
+
const effectiveBalanceAddress = senderAddress || currentWallet?.wallet?.address || "";
|
|
285
303
|
const { nativeTokens, fungibleTokens } = useTokenBalancesByChain({
|
|
286
|
-
address:
|
|
304
|
+
address: effectiveBalanceAddress,
|
|
287
305
|
chainsIds: [srcChainId],
|
|
288
|
-
enabled: !!
|
|
306
|
+
enabled: !!effectiveBalanceAddress && !!chainName,
|
|
289
307
|
});
|
|
290
308
|
|
|
291
309
|
// Find a token with a balance, prioritizing tokens the user already owns
|
|
292
310
|
const getTokenWithBalance = useCallback(() => {
|
|
293
|
-
if (!
|
|
311
|
+
if (!effectiveBalanceAddress || (!nativeTokens && !fungibleTokens) || !tokenList) {
|
|
294
312
|
return getDefaultToken(srcChainId);
|
|
295
313
|
}
|
|
296
314
|
|
|
@@ -321,7 +339,7 @@ function AnySpendCustomInner({
|
|
|
321
339
|
|
|
322
340
|
// Default fallback
|
|
323
341
|
return getDefaultToken(srcChainId);
|
|
324
|
-
}, [
|
|
342
|
+
}, [effectiveBalanceAddress, nativeTokens, fungibleTokens, tokenList, srcChainId]);
|
|
325
343
|
|
|
326
344
|
// Set the selected token with preference for tokens user owns
|
|
327
345
|
const [srcToken, setSrcToken] = useState<components["schemas"]["Token"]>(getDefaultToken(srcChainId));
|
|
@@ -476,7 +494,7 @@ function AnySpendCustomInner({
|
|
|
476
494
|
dstToken: dstToken,
|
|
477
495
|
srcAmount: srcAmount.toString(),
|
|
478
496
|
recipientAddress,
|
|
479
|
-
creatorAddress: currentWallet?.wallet?.address,
|
|
497
|
+
creatorAddress: senderAddress || currentWallet?.wallet?.address,
|
|
480
498
|
nft:
|
|
481
499
|
orderType === "mint_nft"
|
|
482
500
|
? metadata.nftContract.type === "erc1155"
|
|
@@ -656,7 +674,7 @@ function AnySpendCustomInner({
|
|
|
656
674
|
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
657
675
|
className="flex w-full items-center justify-between gap-4"
|
|
658
676
|
>
|
|
659
|
-
<div className="text-as-
|
|
677
|
+
<div className="text-as-tertiary text-sm">
|
|
660
678
|
{orderType === "swap"
|
|
661
679
|
? "Recipient"
|
|
662
680
|
: orderType === "mint_nft"
|
|
@@ -668,10 +686,10 @@ function AnySpendCustomInner({
|
|
|
668
686
|
<div className="flex flex-wrap items-center justify-end gap-2">
|
|
669
687
|
{recipientAddress ? (
|
|
670
688
|
<button
|
|
671
|
-
className={cn("text-as-
|
|
689
|
+
className={cn("text-as-tertiary flex items-center gap-2 rounded-lg")}
|
|
672
690
|
onClick={() => setActivePanel(PanelView.RECIPIENT_SELECTION)}
|
|
673
691
|
>
|
|
674
|
-
<div className="text-as-
|
|
692
|
+
<div className="text-as-tertiary flex items-center gap-1 text-sm">
|
|
675
693
|
<span className="whitespace-nowrap">
|
|
676
694
|
{recipientName ? formatUsername(recipientName) : shortenAddress(recipientAddress)}
|
|
677
695
|
</span>
|
|
@@ -935,9 +953,9 @@ function AnySpendCustomInner({
|
|
|
935
953
|
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
936
954
|
className="relative flex w-full items-center justify-between"
|
|
937
955
|
>
|
|
938
|
-
<div className="text-as-
|
|
956
|
+
<div className="text-as-tertiary flex h-7 items-center text-sm">Pay</div>
|
|
939
957
|
<button
|
|
940
|
-
className="text-as-
|
|
958
|
+
className="text-as-tertiary flex flex-wrap items-center justify-end gap-2 text-sm transition-colors hover:text-blue-700"
|
|
941
959
|
onClick={() => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD)}
|
|
942
960
|
>
|
|
943
961
|
<CryptoPaymentMethodDisplay
|
|
@@ -965,9 +983,9 @@ function AnySpendCustomInner({
|
|
|
965
983
|
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
966
984
|
className="relative flex w-full items-center justify-between"
|
|
967
985
|
>
|
|
968
|
-
<div className="text-as-
|
|
986
|
+
<div className="text-as-tertiary text-sm">Pay with</div>
|
|
969
987
|
<OrderToken
|
|
970
|
-
address={
|
|
988
|
+
address={effectiveBalanceAddress || undefined}
|
|
971
989
|
context="from"
|
|
972
990
|
chainId={srcChainId}
|
|
973
991
|
setChainId={setSrcChainId}
|
|
@@ -992,9 +1010,9 @@ function AnySpendCustomInner({
|
|
|
992
1010
|
transition={{ duration: 0.3, delay: 0.1, ease: "easeInOut" }}
|
|
993
1011
|
className="relative flex w-full items-center justify-between gap-4"
|
|
994
1012
|
>
|
|
995
|
-
<span className="text-as-
|
|
1013
|
+
<span className="text-as-tertiary flex flex-wrap items-center gap-1.5 text-sm">
|
|
996
1014
|
<span className="whitespace-nowrap">
|
|
997
|
-
Total <span className="text-as-
|
|
1015
|
+
Total <span className="text-as-tertiary">(with fee)</span>
|
|
998
1016
|
</span>
|
|
999
1017
|
{anyspendQuote?.data?.fee && (
|
|
1000
1018
|
<TooltipProvider>
|
|
@@ -1095,9 +1113,9 @@ function AnySpendCustomInner({
|
|
|
1095
1113
|
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
1096
1114
|
className="relative flex w-full items-center justify-between"
|
|
1097
1115
|
>
|
|
1098
|
-
<div className="text-as-
|
|
1116
|
+
<div className="text-as-tertiary flex h-7 items-center text-sm">Pay with</div>
|
|
1099
1117
|
<button
|
|
1100
|
-
className="text-as-
|
|
1118
|
+
className="text-as-tertiary flex flex-wrap items-center justify-end gap-2 text-sm transition-colors hover:text-blue-700"
|
|
1101
1119
|
onClick={() => setActivePanel(PanelView.FIAT_PAYMENT_METHOD)}
|
|
1102
1120
|
>
|
|
1103
1121
|
{(() => {
|
|
@@ -1142,9 +1160,9 @@ function AnySpendCustomInner({
|
|
|
1142
1160
|
transition={{ duration: 0.3, delay: 0.1, ease: "easeInOut" }}
|
|
1143
1161
|
className="relative flex w-full items-center justify-between gap-4"
|
|
1144
1162
|
>
|
|
1145
|
-
<span className="text-as-
|
|
1163
|
+
<span className="text-as-tertiary flex flex-wrap items-center gap-1.5 text-sm">
|
|
1146
1164
|
<span className="whitespace-nowrap">
|
|
1147
|
-
Total <span className="text-as-
|
|
1165
|
+
Total <span className="text-as-tertiary">(USD)</span>
|
|
1148
1166
|
</span>
|
|
1149
1167
|
{anyspendQuote?.data?.fee && (
|
|
1150
1168
|
<TooltipProvider>
|
|
@@ -1173,7 +1191,7 @@ function AnySpendCustomInner({
|
|
|
1173
1191
|
) : (
|
|
1174
1192
|
<>
|
|
1175
1193
|
${parseFloat(srcFiatAmount || "0").toFixed(2)}
|
|
1176
|
-
<span className="text-as-
|
|
1194
|
+
<span className="text-as-tertiary text-base">+</span>
|
|
1177
1195
|
</>
|
|
1178
1196
|
)}
|
|
1179
1197
|
</span>
|
|
@@ -15,10 +15,13 @@ import {
|
|
|
15
15
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
16
16
|
import { formatUnits } from "@b3dotfun/sdk/shared/utils/number";
|
|
17
17
|
import invariant from "invariant";
|
|
18
|
-
import { ArrowDown,
|
|
18
|
+
import { ArrowDown, Loader2 } from "lucide-react";
|
|
19
|
+
import { AnimatedCheckmark } from "./icons/AnimatedCheckmark";
|
|
19
20
|
import { motion } from "motion/react";
|
|
20
21
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
22
|
+
import { AnySpendCustomizationProvider, useAnySpendCustomization } from "./context/AnySpendCustomizationContext";
|
|
21
23
|
import type { AnySpendCustomExactInClasses } from "./types/classes";
|
|
24
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
22
25
|
|
|
23
26
|
import { useSetActiveWallet } from "thirdweb/react";
|
|
24
27
|
import { B3_TOKEN } from "../../constants";
|
|
@@ -85,6 +88,14 @@ export interface AnySpendCustomExactInProps {
|
|
|
85
88
|
allowDirectTransfer?: boolean;
|
|
86
89
|
/** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
|
|
87
90
|
callbackMetadata?: Record<string, unknown>;
|
|
91
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
92
|
+
senderAddress?: string;
|
|
93
|
+
/** Render function overrides for replaceable UI elements */
|
|
94
|
+
slots?: AnySpendSlots;
|
|
95
|
+
/** String or ReactNode overrides for text/messages */
|
|
96
|
+
content?: AnySpendContent;
|
|
97
|
+
/** Structured color/theme configuration */
|
|
98
|
+
theme?: AnySpendTheme;
|
|
88
99
|
}
|
|
89
100
|
|
|
90
101
|
export function AnySpendCustomExactIn(props: AnySpendCustomExactInProps) {
|
|
@@ -92,7 +103,9 @@ export function AnySpendCustomExactIn(props: AnySpendCustomExactInProps) {
|
|
|
92
103
|
|
|
93
104
|
return (
|
|
94
105
|
<AnySpendFingerprintWrapper fingerprint={fingerprintConfig}>
|
|
95
|
-
<
|
|
106
|
+
<AnySpendCustomizationProvider slots={props.slots} content={props.content} theme={props.theme}>
|
|
107
|
+
<AnySpendCustomExactInInner {...props} />
|
|
108
|
+
</AnySpendCustomizationProvider>
|
|
96
109
|
</AnySpendFingerprintWrapper>
|
|
97
110
|
);
|
|
98
111
|
}
|
|
@@ -123,7 +136,9 @@ function AnySpendCustomExactInInner({
|
|
|
123
136
|
classes,
|
|
124
137
|
allowDirectTransfer = false,
|
|
125
138
|
callbackMetadata,
|
|
139
|
+
senderAddress,
|
|
126
140
|
}: AnySpendCustomExactInProps) {
|
|
141
|
+
const { slots, content } = useAnySpendCustomization();
|
|
127
142
|
const actionLabel = customExactInConfig?.action ?? "Custom Execution";
|
|
128
143
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
129
144
|
|
|
@@ -188,6 +203,7 @@ function AnySpendCustomExactInInner({
|
|
|
188
203
|
disableUrlParamManagement: true,
|
|
189
204
|
orderType,
|
|
190
205
|
customExactInConfig,
|
|
206
|
+
senderAddress,
|
|
191
207
|
});
|
|
192
208
|
|
|
193
209
|
const { connectedEOAWallet } = useAccountWallet();
|
|
@@ -503,26 +519,35 @@ function AnySpendCustomExactInInner({
|
|
|
503
519
|
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
504
520
|
className={cn("mt-4 flex w-full max-w-[460px] flex-col gap-2")}
|
|
505
521
|
>
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
522
|
+
{slots.actionButton ? (
|
|
523
|
+
slots.actionButton({
|
|
524
|
+
onClick: onMainButtonClick,
|
|
525
|
+
disabled: btnInfo.disable,
|
|
526
|
+
loading: btnInfo.loading,
|
|
527
|
+
text: btnInfo.text,
|
|
528
|
+
})
|
|
529
|
+
) : (
|
|
530
|
+
<ShinyButton
|
|
531
|
+
accentColor={"hsl(var(--as-brand))"}
|
|
532
|
+
disabled={btnInfo.disable}
|
|
533
|
+
onClick={onMainButtonClick}
|
|
534
|
+
className={
|
|
535
|
+
(btnInfo.error && classes?.mainButtonError) ||
|
|
536
|
+
(btnInfo.disable && classes?.mainButtonDisabled) ||
|
|
537
|
+
classes?.mainButton ||
|
|
538
|
+
cn(
|
|
539
|
+
"as-main-button relative w-full",
|
|
540
|
+
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand",
|
|
541
|
+
)
|
|
542
|
+
}
|
|
543
|
+
textClassName={cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white")}
|
|
544
|
+
>
|
|
545
|
+
<div className="flex items-center justify-center gap-2">
|
|
546
|
+
{btnInfo.loading && <Loader2 className="h-4 w-4 animate-spin" />}
|
|
547
|
+
{btnInfo.text}
|
|
548
|
+
</div>
|
|
549
|
+
</ShinyButton>
|
|
550
|
+
)}
|
|
526
551
|
</motion.div>
|
|
527
552
|
|
|
528
553
|
{/* Gas indicator - show when source chain has gas data, hide for direct transfers */}
|
|
@@ -580,7 +605,7 @@ function AnySpendCustomExactInInner({
|
|
|
580
605
|
dstToken: selectedDstToken,
|
|
581
606
|
srcAmount: srcAmountFromQuote,
|
|
582
607
|
expectedDstAmount,
|
|
583
|
-
creatorAddress: globalAddress,
|
|
608
|
+
creatorAddress: senderAddress || globalAddress,
|
|
584
609
|
payload: {
|
|
585
610
|
amount: activeOutputAmountInWei,
|
|
586
611
|
data: encodedData,
|
|
@@ -605,7 +630,7 @@ function AnySpendCustomExactInInner({
|
|
|
605
630
|
dstToken: selectedDstToken,
|
|
606
631
|
srcAmount: srcAmountBigInt.toString(),
|
|
607
632
|
expectedDstAmount: expectedDstAmountRaw,
|
|
608
|
-
creatorAddress: globalAddress,
|
|
633
|
+
creatorAddress: senderAddress || globalAddress,
|
|
609
634
|
payload,
|
|
610
635
|
callbackMetadata,
|
|
611
636
|
});
|
|
@@ -667,7 +692,7 @@ function AnySpendCustomExactInInner({
|
|
|
667
692
|
srcFiatAmount: srcAmount,
|
|
668
693
|
onramp: onrampOptions,
|
|
669
694
|
expectedDstAmount,
|
|
670
|
-
creatorAddress: globalAddress,
|
|
695
|
+
creatorAddress: senderAddress || globalAddress,
|
|
671
696
|
payload: {
|
|
672
697
|
amount: activeOutputAmountInWei,
|
|
673
698
|
data: encodedData,
|
|
@@ -689,7 +714,7 @@ function AnySpendCustomExactInInner({
|
|
|
689
714
|
srcFiatAmount: srcAmount,
|
|
690
715
|
onramp: onrampOptions,
|
|
691
716
|
expectedDstAmount: expectedDstAmountRaw,
|
|
692
|
-
creatorAddress: globalAddress,
|
|
717
|
+
creatorAddress: senderAddress || globalAddress,
|
|
693
718
|
payload,
|
|
694
719
|
});
|
|
695
720
|
}
|
|
@@ -791,20 +816,42 @@ function AnySpendCustomExactInInner({
|
|
|
791
816
|
/>
|
|
792
817
|
) : null;
|
|
793
818
|
|
|
794
|
-
const
|
|
819
|
+
const exactInSuccessTitle = content.successTitle || "Transfer Complete!";
|
|
820
|
+
const exactInSuccessDesc =
|
|
821
|
+
content.successDescription || `${srcAmount} ${selectedSrcToken.symbol} sent on ${getChainName(selectedSrcChainId)}`;
|
|
822
|
+
const exactInReturnLabel = content.returnButtonLabel || returnHomeLabel;
|
|
823
|
+
|
|
824
|
+
const directTransferSuccessView = slots.successScreen ? (
|
|
825
|
+
<>
|
|
826
|
+
{slots.successScreen({
|
|
827
|
+
title: typeof exactInSuccessTitle === "string" ? exactInSuccessTitle : "Transfer Complete!",
|
|
828
|
+
description: typeof exactInSuccessDesc === "string" ? exactInSuccessDesc : "",
|
|
829
|
+
txHash: directTransferTxHash,
|
|
830
|
+
explorerUrl: directTransferTxHash
|
|
831
|
+
? getExplorerTxUrl(selectedSrcChainId, directTransferTxHash || "")
|
|
832
|
+
: undefined,
|
|
833
|
+
onDone: () => {
|
|
834
|
+
onSuccess?.(srcAmount);
|
|
835
|
+
if (returnToHomeUrl) {
|
|
836
|
+
window.location.href = returnToHomeUrl;
|
|
837
|
+
} else {
|
|
838
|
+
setB3ModalOpen(false);
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
returnUrl: returnToHomeUrl,
|
|
842
|
+
returnLabel: exactInReturnLabel || undefined,
|
|
843
|
+
})}
|
|
844
|
+
</>
|
|
845
|
+
) : (
|
|
795
846
|
<motion.div
|
|
796
847
|
initial={{ opacity: 0, scale: 0.95 }}
|
|
797
848
|
animate={{ opacity: 1, scale: 1 }}
|
|
798
849
|
className="flex flex-col items-center justify-center gap-6 py-8"
|
|
799
850
|
>
|
|
800
|
-
<
|
|
801
|
-
<CheckCircle className="h-10 w-10 text-green-500" />
|
|
802
|
-
</div>
|
|
851
|
+
<AnimatedCheckmark className="h-16 w-16" />
|
|
803
852
|
<div className="text-center">
|
|
804
|
-
<h2 className="text-as-primary mb-2 text-xl font-bold">
|
|
805
|
-
<p className="text-as-primary/60 text-sm">
|
|
806
|
-
{srcAmount} {selectedSrcToken.symbol} sent on {getChainName(selectedSrcChainId)}
|
|
807
|
-
</p>
|
|
853
|
+
<h2 className="text-as-primary mb-2 text-xl font-bold">{exactInSuccessTitle}</h2>
|
|
854
|
+
<p className="text-as-primary/60 text-sm">{exactInSuccessDesc}</p>
|
|
808
855
|
<p className="text-as-primary/60 mt-1 text-sm">
|
|
809
856
|
to {selectedRecipientOrDefault?.slice(0, 6)}...{selectedRecipientOrDefault?.slice(-4)}
|
|
810
857
|
</p>
|
|
@@ -830,7 +877,7 @@ function AnySpendCustomExactInInner({
|
|
|
830
877
|
}
|
|
831
878
|
}}
|
|
832
879
|
>
|
|
833
|
-
{
|
|
880
|
+
{exactInReturnLabel || (returnToHomeUrl ? "Return to Home" : "Done")}
|
|
834
881
|
</Button>
|
|
835
882
|
</motion.div>
|
|
836
883
|
);
|
|
@@ -19,6 +19,7 @@ import { CreditCardIcon } from "./icons/CreditCardIcon";
|
|
|
19
19
|
import { QrCodeIcon } from "./icons/QrCodeIcon";
|
|
20
20
|
import { QRDeposit } from "./QRDeposit";
|
|
21
21
|
import type { AnySpendAllClasses } from "./types/classes";
|
|
22
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
22
23
|
|
|
23
24
|
export interface DepositContractConfig {
|
|
24
25
|
/** Custom function ABI JSON string */
|
|
@@ -125,6 +126,14 @@ export interface AnySpendDepositProps {
|
|
|
125
126
|
destinationTokenAmount?: string;
|
|
126
127
|
/** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
|
|
127
128
|
callbackMetadata?: Record<string, unknown>;
|
|
129
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
130
|
+
senderAddress?: string;
|
|
131
|
+
/** Custom slot overrides for sub-components */
|
|
132
|
+
slots?: AnySpendSlots;
|
|
133
|
+
/** Custom content overrides for sub-components */
|
|
134
|
+
content?: AnySpendContent;
|
|
135
|
+
/** Custom theme overrides for sub-components */
|
|
136
|
+
theme?: AnySpendTheme;
|
|
128
137
|
}
|
|
129
138
|
|
|
130
139
|
// Default supported chains
|
|
@@ -251,6 +260,10 @@ export function AnySpendDeposit({
|
|
|
251
260
|
allowDirectTransfer = false,
|
|
252
261
|
destinationTokenAmount,
|
|
253
262
|
callbackMetadata,
|
|
263
|
+
senderAddress,
|
|
264
|
+
slots,
|
|
265
|
+
content,
|
|
266
|
+
theme,
|
|
254
267
|
}: AnySpendDepositProps) {
|
|
255
268
|
// Extract deposit-specific classes for convenience
|
|
256
269
|
const depositClasses = classes?.deposit;
|
|
@@ -280,9 +293,10 @@ export function AnySpendDeposit({
|
|
|
280
293
|
[destinationTokenAddress, destinationTokenChainId, destinationTokenData],
|
|
281
294
|
);
|
|
282
295
|
|
|
283
|
-
// Fetch balances for EOA wallet
|
|
296
|
+
// Fetch balances for EOA wallet (use senderAddress as fallback for pre-filled balance display)
|
|
297
|
+
const effectiveBalanceAddress = senderAddress || eoaAddress;
|
|
284
298
|
const { data: balanceData, isLoading: isBalanceLoading } = useSimBalance(
|
|
285
|
-
shouldShowChainSelection ?
|
|
299
|
+
shouldShowChainSelection ? effectiveBalanceAddress : undefined,
|
|
286
300
|
supportedChains.map(c => c.id),
|
|
287
301
|
);
|
|
288
302
|
|
|
@@ -701,6 +715,10 @@ export function AnySpendDeposit({
|
|
|
701
715
|
allowDirectTransfer={allowDirectTransfer}
|
|
702
716
|
destinationTokenAmount={destinationTokenAmount}
|
|
703
717
|
callbackMetadata={callbackMetadata}
|
|
718
|
+
senderAddress={senderAddress}
|
|
719
|
+
slots={slots}
|
|
720
|
+
content={content}
|
|
721
|
+
theme={theme}
|
|
704
722
|
/>
|
|
705
723
|
) : (
|
|
706
724
|
<AnySpend
|
|
@@ -725,6 +743,10 @@ export function AnySpendDeposit({
|
|
|
725
743
|
allowDirectTransfer={allowDirectTransfer}
|
|
726
744
|
destinationTokenAmount={destinationTokenAmount}
|
|
727
745
|
callbackMetadata={callbackMetadata}
|
|
746
|
+
senderAddress={senderAddress}
|
|
747
|
+
slots={slots}
|
|
748
|
+
content={content}
|
|
749
|
+
theme={theme}
|
|
728
750
|
/>
|
|
729
751
|
)}
|
|
730
752
|
</div>
|
|
@@ -2,6 +2,7 @@ import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
|
2
2
|
import { normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
3
3
|
import { base } from "viem/chains";
|
|
4
4
|
import { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
5
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
5
6
|
|
|
6
7
|
const DEPOSIT_FOR_FUNCTION_ABI = JSON.stringify([
|
|
7
8
|
{
|
|
@@ -33,6 +34,10 @@ export function AnySpendDepositUpside({
|
|
|
33
34
|
depositContractAddress,
|
|
34
35
|
token,
|
|
35
36
|
onSuccess,
|
|
37
|
+
senderAddress,
|
|
38
|
+
slots,
|
|
39
|
+
content,
|
|
40
|
+
theme,
|
|
36
41
|
}: {
|
|
37
42
|
loadOrder?: string;
|
|
38
43
|
mode?: "modal" | "page";
|
|
@@ -42,6 +47,11 @@ export function AnySpendDepositUpside({
|
|
|
42
47
|
depositContractAddress: string;
|
|
43
48
|
token: components["schemas"]["Token"];
|
|
44
49
|
onSuccess?: (amount: string) => void;
|
|
50
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
51
|
+
senderAddress?: string;
|
|
52
|
+
slots?: AnySpendSlots;
|
|
53
|
+
content?: AnySpendContent;
|
|
54
|
+
theme?: AnySpendTheme;
|
|
45
55
|
}) {
|
|
46
56
|
if (!recipientAddress) return null;
|
|
47
57
|
|
|
@@ -76,6 +86,10 @@ export function AnySpendDepositUpside({
|
|
|
76
86
|
customExactInConfig={customExactInConfig}
|
|
77
87
|
header={header}
|
|
78
88
|
onSuccess={onSuccess}
|
|
89
|
+
senderAddress={senderAddress}
|
|
90
|
+
slots={slots}
|
|
91
|
+
content={content}
|
|
92
|
+
theme={theme}
|
|
79
93
|
/>
|
|
80
94
|
);
|
|
81
95
|
}
|
|
@@ -11,6 +11,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
11
11
|
import { b3 } from "viem/chains";
|
|
12
12
|
import { GetQuoteResponse } from "../../types/api_req_res";
|
|
13
13
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
14
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
14
15
|
|
|
15
16
|
// ABI for contractURI and uri functions
|
|
16
17
|
const CONTRACT_URI_ABI = [
|
|
@@ -37,6 +38,10 @@ export function AnySpendNFT({
|
|
|
37
38
|
nftContract,
|
|
38
39
|
onSuccess,
|
|
39
40
|
onShowPointsDetail,
|
|
41
|
+
senderAddress,
|
|
42
|
+
slots,
|
|
43
|
+
content,
|
|
44
|
+
theme,
|
|
40
45
|
}: {
|
|
41
46
|
loadOrder?: string;
|
|
42
47
|
mode?: "modal" | "page";
|
|
@@ -44,6 +49,11 @@ export function AnySpendNFT({
|
|
|
44
49
|
nftContract: components["schemas"]["NftContract"];
|
|
45
50
|
onSuccess?: (txHash?: string) => void;
|
|
46
51
|
onShowPointsDetail?: () => void;
|
|
52
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
53
|
+
senderAddress?: string;
|
|
54
|
+
slots?: AnySpendSlots;
|
|
55
|
+
content?: AnySpendContent;
|
|
56
|
+
theme?: AnySpendTheme;
|
|
47
57
|
}) {
|
|
48
58
|
const [imageUrlWithFallback, setFallbackImageUrl] = useState<string | null>(nftContract.imageUrl);
|
|
49
59
|
const hasFetchedRef = useRef(false);
|
|
@@ -168,6 +178,10 @@ export function AnySpendNFT({
|
|
|
168
178
|
header={header}
|
|
169
179
|
onSuccess={onSuccess}
|
|
170
180
|
onShowPointsDetail={onShowPointsDetail}
|
|
181
|
+
senderAddress={senderAddress}
|
|
182
|
+
slots={slots}
|
|
183
|
+
content={content}
|
|
184
|
+
theme={theme}
|
|
171
185
|
/>
|
|
172
186
|
);
|
|
173
187
|
}
|
|
@@ -22,6 +22,7 @@ import { createPublicClient, encodeFunctionData, erc20Abi, http } from "viem";
|
|
|
22
22
|
import { base } from "viem/chains";
|
|
23
23
|
import { useAccount, useWaitForTransactionReceipt } from "wagmi";
|
|
24
24
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
25
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
25
26
|
import { EthIcon } from "./icons/EthIcon";
|
|
26
27
|
import { SolIcon } from "./icons/SolIcon";
|
|
27
28
|
import { UsdcIcon } from "./icons/USDCIcon";
|
|
@@ -49,12 +50,21 @@ export function AnySpendStakeB3({
|
|
|
49
50
|
recipientAddress,
|
|
50
51
|
stakeAmount,
|
|
51
52
|
onSuccess,
|
|
53
|
+
senderAddress,
|
|
54
|
+
slots,
|
|
55
|
+
content,
|
|
56
|
+
theme,
|
|
52
57
|
}: {
|
|
53
58
|
loadOrder?: string;
|
|
54
59
|
mode?: "modal" | "page";
|
|
55
60
|
recipientAddress: string;
|
|
56
61
|
stakeAmount?: string;
|
|
57
62
|
onSuccess?: () => void;
|
|
63
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
64
|
+
senderAddress?: string;
|
|
65
|
+
slots?: AnySpendSlots;
|
|
66
|
+
content?: AnySpendContent;
|
|
67
|
+
theme?: AnySpendTheme;
|
|
58
68
|
}) {
|
|
59
69
|
const hasMounted = useHasMounted();
|
|
60
70
|
const { setB3ModalOpen } = useModalStore();
|
|
@@ -507,6 +517,10 @@ export function AnySpendStakeB3({
|
|
|
507
517
|
header={header}
|
|
508
518
|
onSuccess={onSuccess}
|
|
509
519
|
showRecipient={true}
|
|
520
|
+
senderAddress={senderAddress}
|
|
521
|
+
slots={slots}
|
|
522
|
+
content={content}
|
|
523
|
+
theme={theme}
|
|
510
524
|
/>
|
|
511
525
|
);
|
|
512
526
|
}
|
|
@@ -22,6 +22,7 @@ import { createPublicClient, encodeFunctionData, erc20Abi, http } from "viem";
|
|
|
22
22
|
import { base } from "viem/chains";
|
|
23
23
|
import { useAccount, useWaitForTransactionReceipt } from "wagmi";
|
|
24
24
|
import { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
25
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
25
26
|
import { EthIcon } from "./icons/EthIcon";
|
|
26
27
|
import { SolIcon } from "./icons/SolIcon";
|
|
27
28
|
import { UsdcIcon } from "./icons/USDCIcon";
|
|
@@ -54,6 +55,10 @@ export function AnySpendStakeB3ExactIn({
|
|
|
54
55
|
recipientAddress,
|
|
55
56
|
stakeAmount,
|
|
56
57
|
onSuccess,
|
|
58
|
+
senderAddress,
|
|
59
|
+
slots,
|
|
60
|
+
content,
|
|
61
|
+
theme,
|
|
57
62
|
}: {
|
|
58
63
|
loadOrder?: string;
|
|
59
64
|
mode?: "modal" | "page";
|
|
@@ -62,6 +67,11 @@ export function AnySpendStakeB3ExactIn({
|
|
|
62
67
|
recipientAddress: string;
|
|
63
68
|
stakeAmount?: string;
|
|
64
69
|
onSuccess?: (amount: string) => void;
|
|
70
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
71
|
+
senderAddress?: string;
|
|
72
|
+
slots?: AnySpendSlots;
|
|
73
|
+
content?: AnySpendContent;
|
|
74
|
+
theme?: AnySpendTheme;
|
|
65
75
|
}) {
|
|
66
76
|
const hasMounted = useHasMounted();
|
|
67
77
|
const { setB3ModalOpen } = useModalStore();
|
|
@@ -518,6 +528,10 @@ export function AnySpendStakeB3ExactIn({
|
|
|
518
528
|
customExactInConfig={customExactInConfig}
|
|
519
529
|
header={header}
|
|
520
530
|
onSuccess={onSuccess}
|
|
531
|
+
senderAddress={senderAddress}
|
|
532
|
+
slots={slots}
|
|
533
|
+
content={content}
|
|
534
|
+
theme={theme}
|
|
521
535
|
/>
|
|
522
536
|
);
|
|
523
537
|
}
|
|
@@ -6,6 +6,7 @@ import { encodeFunctionData } from "viem";
|
|
|
6
6
|
import { base } from "viem/chains";
|
|
7
7
|
import { STAKING_CONTRACT } from "../../abis/upsideStaking";
|
|
8
8
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
9
|
+
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
9
10
|
|
|
10
11
|
function generateEncodedDataForStaking(amount: string, beneficiary: string): string {
|
|
11
12
|
invariant(BigInt(amount) > 0, "Amount must be greater than zero");
|
|
@@ -25,6 +26,10 @@ export function AnySpendStakeUpside({
|
|
|
25
26
|
token,
|
|
26
27
|
onSuccess,
|
|
27
28
|
activeTab,
|
|
29
|
+
senderAddress,
|
|
30
|
+
slots,
|
|
31
|
+
content,
|
|
32
|
+
theme,
|
|
28
33
|
}: {
|
|
29
34
|
loadOrder?: string;
|
|
30
35
|
mode?: "modal" | "page";
|
|
@@ -34,6 +39,11 @@ export function AnySpendStakeUpside({
|
|
|
34
39
|
token: components["schemas"]["Token"];
|
|
35
40
|
onSuccess?: () => void;
|
|
36
41
|
activeTab?: "crypto" | "fiat";
|
|
42
|
+
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
43
|
+
senderAddress?: string;
|
|
44
|
+
slots?: AnySpendSlots;
|
|
45
|
+
content?: AnySpendContent;
|
|
46
|
+
theme?: AnySpendTheme;
|
|
37
47
|
}) {
|
|
38
48
|
const header = () => (
|
|
39
49
|
<>
|
|
@@ -80,6 +90,10 @@ export function AnySpendStakeUpside({
|
|
|
80
90
|
onSuccess={onSuccess}
|
|
81
91
|
showRecipient={true}
|
|
82
92
|
activeTab={activeTab}
|
|
93
|
+
senderAddress={senderAddress}
|
|
94
|
+
slots={slots}
|
|
95
|
+
content={content}
|
|
96
|
+
theme={theme}
|
|
83
97
|
/>
|
|
84
98
|
);
|
|
85
99
|
}
|