@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
|
@@ -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 { normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
5
6
|
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
@@ -17,10 +18,11 @@ export type CreateDepositFirstOrderParams = {
|
|
|
17
18
|
creatorAddress?: string;
|
|
18
19
|
/** Optional contract config for custom execution after deposit */
|
|
19
20
|
contractConfig?: DepositContractConfig;
|
|
21
|
+
callbackMetadata?: Record<string, unknown>;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
export type UseCreateDepositFirstOrderProps = {
|
|
23
|
-
onSuccess?: (data:
|
|
25
|
+
onSuccess?: (data: CreateOrderResponse) => void;
|
|
24
26
|
onError?: (error: Error) => void;
|
|
25
27
|
};
|
|
26
28
|
|
|
@@ -84,6 +86,7 @@ export function useCreateDepositFirstOrder({ onSuccess, onError }: UseCreateDepo
|
|
|
84
86
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
85
87
|
partnerId,
|
|
86
88
|
visitorData,
|
|
89
|
+
callbackMetadata: params.callbackMetadata,
|
|
87
90
|
});
|
|
88
91
|
} catch (error: any) {
|
|
89
92
|
if (error?.data) {
|
|
@@ -92,7 +95,7 @@ export function useCreateDepositFirstOrder({ onSuccess, onError }: UseCreateDepo
|
|
|
92
95
|
throw error;
|
|
93
96
|
}
|
|
94
97
|
},
|
|
95
|
-
onSuccess: (data:
|
|
98
|
+
onSuccess: (data: CreateOrderResponse) => {
|
|
96
99
|
onSuccess?.(data);
|
|
97
100
|
},
|
|
98
101
|
onError: (error: Error) => {
|
|
@@ -20,7 +20,8 @@ import { VisitorData } from "../types/fingerprint";
|
|
|
20
20
|
// Service functions
|
|
21
21
|
export const anyspendService = {
|
|
22
22
|
getTokenList: async (chainId: number, query: string): Promise<components["schemas"]["Token"][]> => {
|
|
23
|
-
const
|
|
23
|
+
const params = new URLSearchParams({ limit: "100", term: query });
|
|
24
|
+
const response = await fetch(`${ANYSPEND_MAINNET_BASE_URL}/chains/${chainId}/tokens?${params.toString()}`);
|
|
24
25
|
const body: GetTokenListResponse = await response.json();
|
|
25
26
|
invariant(response.status === 200, `Failed to fetch token list for chain ${chainId}`);
|
|
26
27
|
return body.data;
|
|
@@ -123,6 +124,7 @@ export const anyspendService = {
|
|
|
123
124
|
invariant(orderId, "orderId is required");
|
|
124
125
|
const response = await fetch(`${ANYSPEND_MAINNET_BASE_URL}/orders/${orderId}`);
|
|
125
126
|
const data: GetOrderAndTxsResponse = await response.json();
|
|
127
|
+
invariant(response.status === 200, (data as any).message || `Failed to fetch order ${orderId}`);
|
|
126
128
|
return data;
|
|
127
129
|
},
|
|
128
130
|
|
|
@@ -140,6 +142,7 @@ export const anyspendService = {
|
|
|
140
142
|
}
|
|
141
143
|
const response = await fetch(`${ANYSPEND_MAINNET_BASE_URL}/orders?${params.toString()}`);
|
|
142
144
|
const data: GetOrderHistoryResponse = await response.json();
|
|
145
|
+
invariant(response.status === 200, (data as any).message || "Failed to fetch order history");
|
|
143
146
|
return data;
|
|
144
147
|
},
|
|
145
148
|
|
|
@@ -177,8 +180,22 @@ export const anyspendService = {
|
|
|
177
180
|
return data.data;
|
|
178
181
|
},
|
|
179
182
|
|
|
183
|
+
getCoinbaseOnrampUrl: async (
|
|
184
|
+
request: components["schemas"]["CoinbaseOnrampUrlRequest"],
|
|
185
|
+
): Promise<components["schemas"]["CoinbaseOnrampUrlResponse"]> => {
|
|
186
|
+
const response = await fetch(`${ANYSPEND_MAINNET_BASE_URL}/onramp/coinbase/onramp-url`, {
|
|
187
|
+
method: "POST",
|
|
188
|
+
headers: { "Content-Type": "application/json" },
|
|
189
|
+
body: JSON.stringify(request),
|
|
190
|
+
});
|
|
191
|
+
const data: components["schemas"]["CoinbaseOnrampUrlResponse"] = await response.json();
|
|
192
|
+
if (!response.ok) throw new Error((data as any).message || "Failed to get Coinbase onramp URL");
|
|
193
|
+
return data;
|
|
194
|
+
},
|
|
195
|
+
|
|
180
196
|
getStripeClientSecret: async (paymentIntentId: string): Promise<string | null> => {
|
|
181
|
-
const
|
|
197
|
+
const params = new URLSearchParams({ paymentIntentId });
|
|
198
|
+
const response = await fetch(`${ANYSPEND_MAINNET_BASE_URL}/stripe/clientSecret?${params.toString()}`);
|
|
182
199
|
const data: GetStripeClientSecret = await response.json();
|
|
183
200
|
invariant(response.status === 200, "Failed to get Stripe client secret");
|
|
184
201
|
return data.data;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkout form schema types
|
|
3
|
+
*
|
|
4
|
+
* Merchants define forms using a JSON schema to collect customer information
|
|
5
|
+
* during checkout (email, shipping address, discount codes, arbitrary fields).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface CheckoutFormField {
|
|
9
|
+
/** Unique field identifier */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Field type */
|
|
12
|
+
type: "text" | "email" | "phone" | "textarea" | "select" | "number" | "checkbox" | "address";
|
|
13
|
+
/** Display label */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Placeholder text */
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
/** Whether the field is required. Default: false */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** Default value */
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
/** Options for "select" type fields */
|
|
22
|
+
options?: { label: string; value: string }[];
|
|
23
|
+
/** Validation rules */
|
|
24
|
+
validation?: {
|
|
25
|
+
pattern?: string;
|
|
26
|
+
minLength?: number;
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
min?: number;
|
|
29
|
+
max?: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface CheckoutFormSchema {
|
|
34
|
+
fields: CheckoutFormField[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ShippingOption {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
/** Amount in wei */
|
|
42
|
+
amount: string;
|
|
43
|
+
/** e.g. "5-7 business days" */
|
|
44
|
+
estimated_days?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface DiscountResult {
|
|
48
|
+
valid: boolean;
|
|
49
|
+
discount_type?: "percentage" | "fixed";
|
|
50
|
+
discount_value?: string;
|
|
51
|
+
/** Computed discount amount in wei */
|
|
52
|
+
discount_amount?: string;
|
|
53
|
+
/** Final amount after discount in wei */
|
|
54
|
+
final_amount?: string;
|
|
55
|
+
error?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface AddressData {
|
|
59
|
+
street: string;
|
|
60
|
+
city: string;
|
|
61
|
+
state: string;
|
|
62
|
+
zip: string;
|
|
63
|
+
country: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Props passed to custom form components or the checkoutForm slot
|
|
68
|
+
*/
|
|
69
|
+
export interface CheckoutFormComponentProps {
|
|
70
|
+
/** Call this when the form is submitted / values change */
|
|
71
|
+
onSubmit: (data: Record<string, unknown>) => void;
|
|
72
|
+
/** Call to signal whether the form is currently valid */
|
|
73
|
+
onValidationChange: (isValid: boolean) => void;
|
|
74
|
+
/** Current form data */
|
|
75
|
+
formData: Record<string, unknown>;
|
|
76
|
+
/** Update form data */
|
|
77
|
+
setFormData: (data: Record<string, unknown>) => void;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Props for shipping selector slot
|
|
82
|
+
*/
|
|
83
|
+
export interface ShippingSelectorSlotProps {
|
|
84
|
+
options: ShippingOption[];
|
|
85
|
+
selectedId: string | null;
|
|
86
|
+
onSelect: (option: ShippingOption) => void;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Props for discount input slot
|
|
91
|
+
*/
|
|
92
|
+
export interface DiscountInputSlotProps {
|
|
93
|
+
onApply: (code: string) => Promise<DiscountResult>;
|
|
94
|
+
appliedDiscount: DiscountResult | null;
|
|
95
|
+
onRemove: () => void;
|
|
96
|
+
loading: boolean;
|
|
97
|
+
}
|
|
@@ -27,6 +27,7 @@ export const getStatusDisplay = (
|
|
|
27
27
|
return {
|
|
28
28
|
text: depositText,
|
|
29
29
|
status: "processing",
|
|
30
|
+
description: "Waiting for your deposit to be confirmed on-chain",
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
case "waiting_stripe_payment":
|
|
@@ -44,7 +45,7 @@ export const getStatusDisplay = (
|
|
|
44
45
|
};
|
|
45
46
|
|
|
46
47
|
case "sending_token_from_vault":
|
|
47
|
-
return { text: "Sending Token", status: "processing" };
|
|
48
|
+
return { text: "Sending Token", status: "processing", description: "Preparing your tokens for delivery" };
|
|
48
49
|
|
|
49
50
|
case "relay":
|
|
50
51
|
case "executing":
|
|
@@ -76,9 +77,17 @@ export const getStatusDisplay = (
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
case "refunding":
|
|
79
|
-
return {
|
|
80
|
+
return {
|
|
81
|
+
text: "Refunding Order",
|
|
82
|
+
status: "processing",
|
|
83
|
+
description: "Your funds are being returned to your wallet",
|
|
84
|
+
};
|
|
80
85
|
case "refunded":
|
|
81
|
-
return {
|
|
86
|
+
return {
|
|
87
|
+
text: "Order Refunded",
|
|
88
|
+
status: "failure",
|
|
89
|
+
description: "Your funds have been returned to your wallet.",
|
|
90
|
+
};
|
|
82
91
|
|
|
83
92
|
case "failure":
|
|
84
93
|
return {
|
package/src/app.shared.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { B3_AUTH_COOKIE_NAME } from "./shared/constants";
|
|
|
6
6
|
export const B3_API_URL =
|
|
7
7
|
process.env.EXPO_PUBLIC_B3_API || process.env.NEXT_PUBLIC_B3_API || process.env.PUBLIC_B3_API || "https://api.b3.fun";
|
|
8
8
|
|
|
9
|
+
const DEV_USER_GROUP = 4;
|
|
10
|
+
|
|
9
11
|
export const authenticate = async (
|
|
10
12
|
app: ClientApplication,
|
|
11
13
|
accessToken: string,
|
|
@@ -30,6 +32,15 @@ export const authenticate = async (
|
|
|
30
32
|
query: params || {},
|
|
31
33
|
},
|
|
32
34
|
);
|
|
35
|
+
|
|
36
|
+
// Extend cookie expiration to 30 days for dev users
|
|
37
|
+
if (response?.user?.userGroups?.includes(DEV_USER_GROUP)) {
|
|
38
|
+
const token = Cookies.get(B3_AUTH_COOKIE_NAME);
|
|
39
|
+
if (token) {
|
|
40
|
+
Cookies.set(B3_AUTH_COOKIE_NAME, token, { expires: 30 });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
33
44
|
return response;
|
|
34
45
|
} catch (error) {
|
|
35
46
|
return null;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from "@b3dotfun/sdk/anyspend/react";
|
|
13
13
|
import { AnySpendDeposit } from "@b3dotfun/sdk/anyspend/react/components/AnySpendDeposit";
|
|
14
14
|
import { AnySpendDepositHype } from "@b3dotfun/sdk/anyspend/react/components/AnyspendDepositHype";
|
|
15
|
+
import { AnySpendCheckoutTrigger } from "@b3dotfun/sdk/anyspend/react/components/checkout/AnySpendCheckoutTrigger";
|
|
15
16
|
import { AnySpendWorkflowTrigger } from "@b3dotfun/sdk/anyspend/react/components/AnySpendWorkflowTrigger";
|
|
16
17
|
import { AnySpendDepositUpside } from "@b3dotfun/sdk/anyspend/react/components/AnySpendDepositUpside";
|
|
17
18
|
import { AnySpendStakeUpside } from "@b3dotfun/sdk/anyspend/react/components/AnySpendStakeUpside";
|
|
@@ -67,6 +68,7 @@ export function B3DynamicModal() {
|
|
|
67
68
|
"notifications",
|
|
68
69
|
"anySpendDeposit",
|
|
69
70
|
"anySpendWorkflowTrigger",
|
|
71
|
+
"anySpendCheckoutTrigger",
|
|
70
72
|
];
|
|
71
73
|
|
|
72
74
|
const freestyleTypes = [
|
|
@@ -82,6 +84,9 @@ export function B3DynamicModal() {
|
|
|
82
84
|
"anySpendBondKit",
|
|
83
85
|
];
|
|
84
86
|
|
|
87
|
+
// AnySpend modal types should not show the "Global Account" branding footer
|
|
88
|
+
const isAnySpendType = contentType?.type?.toLowerCase().startsWith("anyspend") ?? false;
|
|
89
|
+
|
|
85
90
|
// Check if current content type is in freestyle types
|
|
86
91
|
const isFreestyleType = freestyleTypes.includes(contentType?.type as string);
|
|
87
92
|
// Determine if modal should be closable - defaults to true unless explicitly set to false
|
|
@@ -100,6 +105,7 @@ export function B3DynamicModal() {
|
|
|
100
105
|
contentType?.type === "send" && "p-0",
|
|
101
106
|
contentType?.type === "manageAccount" && " md:p-0 md:pt-2",
|
|
102
107
|
contentType?.type === "linkAccount" && "md:p-0",
|
|
108
|
+
contentType?.type === "anySpendCheckoutTrigger" && "p-0",
|
|
103
109
|
// Add specific styles for avatar editor
|
|
104
110
|
// contentType?.type === "avatarEditor_disabled" &&
|
|
105
111
|
// "h-[90dvh] w-[90vw] bg-black p-0 overflow-y-auto overflow-x-hidden max-md:-mt-8 max-md:rounded-t-xl",
|
|
@@ -156,6 +162,8 @@ export function B3DynamicModal() {
|
|
|
156
162
|
return <AnySpendDeposit {...contentType} mode="modal" />;
|
|
157
163
|
case "anySpendWorkflowTrigger":
|
|
158
164
|
return <AnySpendWorkflowTrigger {...contentType} mode="modal" />;
|
|
165
|
+
case "anySpendCheckoutTrigger":
|
|
166
|
+
return <AnySpendCheckoutTrigger {...contentType} mode="modal" />;
|
|
159
167
|
case "avatarEditor":
|
|
160
168
|
return <AvatarEditor onSetAvatar={contentType.onSuccess} />;
|
|
161
169
|
case "deposit":
|
|
@@ -189,8 +197,8 @@ export function B3DynamicModal() {
|
|
|
189
197
|
<ModalContent
|
|
190
198
|
className={cn(
|
|
191
199
|
contentClass,
|
|
192
|
-
"rounded-2xl bg-white shadow-xl dark:bg-
|
|
193
|
-
"border border-gray-200 dark:border-
|
|
200
|
+
"rounded-2xl bg-white shadow-xl dark:bg-neutral-900",
|
|
201
|
+
"border border-gray-200 dark:border-neutral-800",
|
|
194
202
|
(contentType?.type === "manageAccount" ||
|
|
195
203
|
contentType?.type === "deposit" ||
|
|
196
204
|
contentType?.type === "send" ||
|
|
@@ -200,6 +208,7 @@ export function B3DynamicModal() {
|
|
|
200
208
|
"mx-auto w-full max-w-md sm:max-w-lg",
|
|
201
209
|
)}
|
|
202
210
|
hideCloseButton={hideCloseButton}
|
|
211
|
+
hideGABranding={isAnySpendType}
|
|
203
212
|
onEscapeKeyDown={!isClosable ? e => e.preventDefault() : undefined}
|
|
204
213
|
onPointerDownOutside={!isClosable ? e => e.preventDefault() : undefined}
|
|
205
214
|
onInteractOutside={!isClosable ? e => e.preventDefault() : undefined}
|
|
@@ -246,7 +255,7 @@ export function B3DynamicModal() {
|
|
|
246
255
|
animate={{ height: "auto" }}
|
|
247
256
|
exit={{ height: 0 }}
|
|
248
257
|
transition={{ duration: 0.3, ease: "easeInOut" }}
|
|
249
|
-
className="toast-section relative z-10 overflow-hidden bg-white dark:border-
|
|
258
|
+
className="toast-section relative z-10 overflow-hidden bg-white dark:border-neutral-800 dark:bg-neutral-900"
|
|
250
259
|
>
|
|
251
260
|
<motion.div
|
|
252
261
|
initial={{ opacity: 0, y: -10 }}
|
|
@@ -264,7 +273,7 @@ export function B3DynamicModal() {
|
|
|
264
273
|
</ModalContent>
|
|
265
274
|
|
|
266
275
|
{/* Animate inner container margin to cover branding when toasts appear */}
|
|
267
|
-
{isOpen && (
|
|
276
|
+
{isOpen && !isAnySpendType && (
|
|
268
277
|
<style>{`
|
|
269
278
|
.modal-inner-content {
|
|
270
279
|
transition: margin-bottom 0.3s ease-in-out;
|
|
@@ -38,11 +38,13 @@ type DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;
|
|
|
38
38
|
type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
39
39
|
hideCloseButton?: boolean;
|
|
40
40
|
closeBtnClassName?: string;
|
|
41
|
+
/** Hide the "Global Account" branding footer below the modal */
|
|
42
|
+
hideGABranding?: boolean;
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<DialogContentElement>> =
|
|
44
46
|
React.forwardRef<DialogContentElement, DialogContentProps>(
|
|
45
|
-
({ className, children, hideCloseButton = true, closeBtnClassName, ...props }, ref) => {
|
|
47
|
+
({ className, children, hideCloseButton = true, closeBtnClassName, hideGABranding, ...props }, ref) => {
|
|
46
48
|
const container = typeof window !== "undefined" ? document.getElementById("b3-root") : null;
|
|
47
49
|
return (
|
|
48
50
|
<DialogPortal container={container}>
|
|
@@ -60,7 +62,12 @@ const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.
|
|
|
60
62
|
)}
|
|
61
63
|
{...props}
|
|
62
64
|
>
|
|
63
|
-
<div
|
|
65
|
+
<div
|
|
66
|
+
className={cn(
|
|
67
|
+
"modal-inner-content flex flex-1 flex-col overflow-hidden rounded-xl border border-[#D1D1D6] bg-white shadow-[0_20px_24px_-4px_rgba(10,13,18,0.08),0_8px_8px_-4px_rgba(10,13,18,0.03),0_3px_3px_-1.5px_rgba(10,13,18,0.04)] dark:border-neutral-700 dark:bg-neutral-900",
|
|
68
|
+
!hideGABranding && "mb-[23px]",
|
|
69
|
+
)}
|
|
70
|
+
>
|
|
64
71
|
{children}
|
|
65
72
|
{!hideCloseButton && (
|
|
66
73
|
<DialogPrimitive.Close
|
|
@@ -75,12 +82,14 @@ const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.
|
|
|
75
82
|
)}
|
|
76
83
|
</div>
|
|
77
84
|
{/* Global Account Footer - Absolutely positioned on outer grey layer */}
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
{!hideGABranding && (
|
|
86
|
+
<div className="b3-modal-ga-branding absolute bottom-[10px] left-0 right-0 flex items-center justify-center gap-1.5 pt-[10px]">
|
|
87
|
+
<img src="https://cdn.b3.fun/b3_logo.svg" alt="B3" className="h-4 w-4" />
|
|
88
|
+
<span className="font-neue-montreal-semibold text-xs uppercase leading-none tracking-[0.72px] text-[#0B57C2]">
|
|
89
|
+
Global Account
|
|
90
|
+
</span>
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
84
93
|
</DialogPrimitive.Content>
|
|
85
94
|
</DialogPortal>
|
|
86
95
|
);
|
|
@@ -30,8 +30,8 @@ DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
|
30
30
|
|
|
31
31
|
const DrawerContent = React.forwardRef<
|
|
32
32
|
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
33
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
34
|
-
>(({ className, children, ...props }, ref) => {
|
|
33
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & { hideGABranding?: boolean }
|
|
34
|
+
>(({ className, children, hideGABranding: _hideGABranding, ...props }, ref) => {
|
|
35
35
|
const container = typeof window !== "undefined" ? document.getElementById("b3-root") : null;
|
|
36
36
|
return (
|
|
37
37
|
<DrawerPortal container={container}>
|
|
@@ -509,6 +509,56 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
|
509
509
|
* Props for the AnySpend Workflow Trigger modal
|
|
510
510
|
* Handles payments that trigger b3os-workflow runs
|
|
511
511
|
*/
|
|
512
|
+
/**
|
|
513
|
+
* Props for the AnySpend Checkout Trigger modal
|
|
514
|
+
* Shopify-style checkout with predefined destination token and amount
|
|
515
|
+
*/
|
|
516
|
+
export interface AnySpendCheckoutTriggerModalProps extends BaseModalProps {
|
|
517
|
+
/** Modal type identifier */
|
|
518
|
+
type: "anySpendCheckoutTrigger";
|
|
519
|
+
/** Payment recipient address (hex) */
|
|
520
|
+
recipientAddress: string;
|
|
521
|
+
/** Destination token address */
|
|
522
|
+
destinationTokenAddress: string;
|
|
523
|
+
/** Destination chain ID */
|
|
524
|
+
destinationTokenChainId: number;
|
|
525
|
+
/** Line items to display in the cart (optional — if omitted, only the payment panel is shown) */
|
|
526
|
+
items?: Array<{
|
|
527
|
+
id?: string;
|
|
528
|
+
name: string;
|
|
529
|
+
description?: string;
|
|
530
|
+
imageUrl?: string;
|
|
531
|
+
amount: string;
|
|
532
|
+
quantity: number;
|
|
533
|
+
}>;
|
|
534
|
+
/** Total amount in wei — required when items are not provided */
|
|
535
|
+
totalAmount?: string;
|
|
536
|
+
/** Organization name */
|
|
537
|
+
organizationName?: string;
|
|
538
|
+
/** Organization logo URL */
|
|
539
|
+
organizationLogo?: string;
|
|
540
|
+
/** Theme color (hex) */
|
|
541
|
+
themeColor?: string;
|
|
542
|
+
/** Custom button text */
|
|
543
|
+
buttonText?: string;
|
|
544
|
+
/** Workflow ID to trigger on payment */
|
|
545
|
+
workflowId?: string;
|
|
546
|
+
/** Organization ID that owns the workflow */
|
|
547
|
+
orgId?: string;
|
|
548
|
+
/** Optional callback metadata merged into the order */
|
|
549
|
+
callbackMetadata?: {
|
|
550
|
+
inputs?: Record<string, unknown>;
|
|
551
|
+
} & Record<string, unknown>;
|
|
552
|
+
/** Called on successful payment */
|
|
553
|
+
onSuccess?: (result: { txHash?: string; orderId?: string }) => void;
|
|
554
|
+
/** Called on payment error */
|
|
555
|
+
onError?: (error: Error) => void;
|
|
556
|
+
/** URL to redirect to after payment */
|
|
557
|
+
returnUrl?: string;
|
|
558
|
+
/** Label for the return button */
|
|
559
|
+
returnLabel?: string;
|
|
560
|
+
}
|
|
561
|
+
|
|
512
562
|
export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
|
|
513
563
|
/** Modal type identifier */
|
|
514
564
|
type: "anySpendWorkflowTrigger";
|
|
@@ -629,7 +679,8 @@ export type ModalContentType =
|
|
|
629
679
|
| NotificationsModalProps
|
|
630
680
|
| AnySpendCollectorClubPurchaseProps
|
|
631
681
|
| AnySpendDepositModalProps
|
|
632
|
-
| AnySpendWorkflowTriggerModalProps
|
|
682
|
+
| AnySpendWorkflowTriggerModalProps
|
|
683
|
+
| AnySpendCheckoutTriggerModalProps;
|
|
633
684
|
|
|
634
685
|
/**
|
|
635
686
|
* State interface for the modal store
|
|
@@ -121,6 +121,18 @@ export const formatDisplayNumber = (
|
|
|
121
121
|
return formatter.format(v);
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Safely convert a string to BigInt, returning 0n for invalid values.
|
|
126
|
+
* Use this for consumer-provided amount strings that may not be valid wei values.
|
|
127
|
+
*/
|
|
128
|
+
export function safeBigInt(value: string): bigint {
|
|
129
|
+
try {
|
|
130
|
+
return BigInt(value);
|
|
131
|
+
} catch {
|
|
132
|
+
return BigInt(0);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
124
136
|
export function formatUnits(value: string, decimals = 18) {
|
|
125
137
|
const factor = BigInt(10) ** BigInt(decimals);
|
|
126
138
|
const wholePart = BigInt(value) / factor;
|
package/src/styles/index.css
CHANGED
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
--as-on-disabled: 0 0% 44%;
|
|
127
127
|
--as-shadow-lg: 220 29% 5%;
|
|
128
128
|
--as-quaternary: 240 6% 65%;
|
|
129
|
-
--as-
|
|
129
|
+
--as-tertiary: 235 6% 50%;
|
|
130
130
|
--as-success-secondary: 89 85% 89%;
|
|
131
131
|
--as-content-icon-success: 95 85% 35%;
|
|
132
132
|
--as-content-disabled: 220 6% 47%;
|
|
@@ -219,7 +219,7 @@ html[data-theme="dark"] .b3-root,
|
|
|
219
219
|
--as-on-surface-disabled: 0 0% 78%;
|
|
220
220
|
--as-on-disabled: 0 0% 44%;
|
|
221
221
|
--as-quaternary: 240 6% 65%;
|
|
222
|
-
--as-
|
|
222
|
+
--as-tertiary: 240 6% 65%;
|
|
223
223
|
--as-success-secondary: 95 85% 35%;
|
|
224
224
|
--as-content-icon-success: 89 85% 89%;
|
|
225
225
|
--as-content-disabled: 220 6% 47%;
|
|
@@ -703,3 +703,49 @@ Dark version
|
|
|
703
703
|
.tw-header {
|
|
704
704
|
display: none !important; /* Hide the TW "BSMNT" header */
|
|
705
705
|
}
|
|
706
|
+
|
|
707
|
+
/* AnySpend Checkout: modal trigger overrides */
|
|
708
|
+
.anyspend-checkout-trigger .anyspend-payment-methods {
|
|
709
|
+
border: none;
|
|
710
|
+
border-radius: 0;
|
|
711
|
+
}
|
|
712
|
+
.anyspend-checkout-trigger .anyspend-payment-title {
|
|
713
|
+
font-size: 0;
|
|
714
|
+
padding-left: 0.75rem;
|
|
715
|
+
}
|
|
716
|
+
.anyspend-checkout-trigger .anyspend-payment-title::before {
|
|
717
|
+
content: "Payment options";
|
|
718
|
+
font-size: 1.125rem;
|
|
719
|
+
}
|
|
720
|
+
.anyspend-checkout-trigger .anyspend-payment-panel {
|
|
721
|
+
gap: 0;
|
|
722
|
+
}
|
|
723
|
+
.anyspend-checkout-trigger .anyspend-payment-method-btn {
|
|
724
|
+
padding-left: 0.5rem;
|
|
725
|
+
padding-right: 0.5rem;
|
|
726
|
+
}
|
|
727
|
+
.anyspend-checkout-trigger .anyspend-payment-method-panel {
|
|
728
|
+
padding-left: 0.5rem;
|
|
729
|
+
padding-right: 0.5rem;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/* AnySpend Checkout: 2-column grid layout */
|
|
733
|
+
.anyspend-checkout-grid {
|
|
734
|
+
display: grid;
|
|
735
|
+
gap: 2rem;
|
|
736
|
+
grid-template-columns: 1fr;
|
|
737
|
+
}
|
|
738
|
+
@media (min-width: 768px) {
|
|
739
|
+
.anyspend-checkout-grid {
|
|
740
|
+
grid-template-columns: 1fr var(--anyspend-cart-width, 380px);
|
|
741
|
+
}
|
|
742
|
+
.anyspend-checkout-grid > .anyspend-payment-col {
|
|
743
|
+
order: 1;
|
|
744
|
+
}
|
|
745
|
+
.anyspend-checkout-grid > .anyspend-cart-col {
|
|
746
|
+
order: 2;
|
|
747
|
+
position: sticky;
|
|
748
|
+
top: 32px;
|
|
749
|
+
align-self: start;
|
|
750
|
+
}
|
|
751
|
+
}
|