@b3dotfun/sdk 0.1.69-test.0 → 0.1.70-alpha.1
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 +2 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +12 -4
- 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 +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +7 -3
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +6 -5
- package/dist/cjs/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/cjs/anyspend/react/components/checkout/CartSummary.js +13 -11
- package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.js +5 -4
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.js +3 -6
- package/dist/cjs/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/cjs/anyspend/react/components/checkout/PriceSkeleton.js +9 -0
- package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.js +3 -2
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +5 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +17 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +3 -2
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.js +31 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +6 -5
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +4 -2
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +36 -4
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +4 -1
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +5 -3
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +3 -1
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +25 -14
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +3 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +6 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +15 -5
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.js +85 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +14 -4
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/components/PasswordInput.js +10 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +8 -5
- package/dist/cjs/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/cjs/global-account/react/components/UserAvatar/UserAvatar.js +27 -0
- package/dist/cjs/global-account/react/components/index.d.ts +3 -0
- package/dist/cjs/global-account/react/components/index.js +10 -3
- package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +19 -17
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/cjs/shared/constants/index.d.ts +1 -0
- package/dist/cjs/shared/constants/index.js +2 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +12 -4
- 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 +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +7 -3
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +6 -5
- package/dist/esm/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/esm/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/esm/anyspend/react/components/checkout/CartSummary.js +13 -11
- package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.js +5 -4
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.js +3 -6
- package/dist/esm/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/esm/anyspend/react/components/checkout/PriceSkeleton.js +6 -0
- package/dist/esm/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/ShippingSelector.js +3 -2
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -1
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +5 -1
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +17 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +3 -2
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.js +27 -0
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +4 -3
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +5 -3
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +37 -5
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +4 -1
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +7 -1
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +6 -4
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +5 -3
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +25 -14
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +4 -3
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +6 -1
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +16 -6
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.js +82 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +15 -5
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/esm/global-account/react/components/SignInWithB3/components/PasswordInput.js +7 -0
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +8 -5
- package/dist/esm/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/esm/global-account/react/components/UserAvatar/UserAvatar.js +21 -0
- package/dist/esm/global-account/react/components/index.d.ts +3 -0
- package/dist/esm/global-account/react/components/index.js +4 -0
- package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +12 -10
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/esm/shared/constants/index.d.ts +1 -0
- package/dist/esm/shared/constants/index.js +1 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/types/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/types/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/types/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +5 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +17 -1
- package/dist/types/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- package/dist/types/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +6 -1
- package/dist/types/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/types/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/types/global-account/react/components/index.d.ts +3 -0
- package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/types/shared/constants/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +24 -12
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +6 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +12 -2
- package/src/anyspend/react/components/AnySpendDeposit.tsx +38 -31
- package/src/anyspend/react/components/AnySpendNFT.tsx +4 -0
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +4 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +10 -4
- package/src/anyspend/react/components/checkout/CartItemRow.tsx +2 -1
- package/src/anyspend/react/components/checkout/CartSummary.tsx +24 -20
- package/src/anyspend/react/components/checkout/CheckoutCartPanel.tsx +12 -3
- package/src/anyspend/react/components/checkout/CheckoutFormPanel.tsx +5 -0
- package/src/anyspend/react/components/checkout/DiscountCodeInput.tsx +15 -5
- package/src/anyspend/react/components/checkout/PriceSkeleton.tsx +19 -0
- package/src/anyspend/react/components/checkout/ShippingSelector.tsx +5 -1
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +3 -1
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +6 -0
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +36 -15
- package/src/global-account/react/components/B3Provider/BetterAuthClientProvider.tsx +40 -0
- package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +4 -3
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +18 -14
- package/src/global-account/react/components/ManageAccount/Header.tsx +71 -4
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +25 -19
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +13 -0
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +14 -7
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +15 -32
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +29 -20
- package/src/global-account/react/components/SignInWithB3/BetterAuthResetPassword.tsx +6 -7
- package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +27 -7
- package/src/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.tsx +155 -0
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +42 -13
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +8 -1
- package/src/global-account/react/components/SignInWithB3/components/PasswordInput.tsx +62 -0
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +13 -6
- package/src/global-account/react/components/UserAvatar/UserAvatar.tsx +45 -0
- package/src/global-account/react/components/index.ts +9 -0
- package/src/global-account/react/hooks/useBetterAuth.ts +12 -10
- package/src/global-account/react/stores/useModalStore.ts +4 -0
- package/src/shared/constants/index.ts +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
2
|
import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
|
|
3
|
-
export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, senderAddress, slots, content, theme, }: {
|
|
3
|
+
export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, senderAddress, slots, content, theme, showFiatOption, }: {
|
|
4
4
|
loadOrder?: string;
|
|
5
5
|
mode?: "modal" | "page";
|
|
6
6
|
beneficiaryAddress: string;
|
|
@@ -14,4 +14,6 @@ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddres
|
|
|
14
14
|
slots?: AnySpendSlots;
|
|
15
15
|
content?: AnySpendContent;
|
|
16
16
|
theme?: AnySpendTheme;
|
|
17
|
+
/** Whether to show the "Pay with fiat" tab. Defaults to true. */
|
|
18
|
+
showFiatOption?: boolean;
|
|
17
19
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import type { CheckoutItem, AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
2
3
|
interface CartItemRowProps {
|
|
3
4
|
item: CheckoutItem;
|
|
4
|
-
formattedPrice:
|
|
5
|
+
formattedPrice: ReactNode;
|
|
5
6
|
classes?: AnySpendCheckoutClasses;
|
|
6
7
|
}
|
|
7
8
|
export declare function CartItemRow({ item, formattedPrice, classes }: CartItemRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { CheckoutSummaryLine } from "./AnySpendCheckout";
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { AnySpendCheckoutClasses, CheckoutSummaryLine } from "./AnySpendCheckout";
|
|
3
3
|
interface CartSummaryProps {
|
|
4
4
|
/** Formatted total (final amount after all adjustments) */
|
|
5
|
-
total:
|
|
5
|
+
total: ReactNode;
|
|
6
6
|
tokenSymbol?: string;
|
|
7
7
|
classes?: AnySpendCheckoutClasses;
|
|
8
8
|
/** Formatted subtotal (sum of items only — shown when adjustments exist) */
|
|
@@ -25,6 +25,8 @@ interface CartSummaryProps {
|
|
|
25
25
|
summaryLines?: CheckoutSummaryLine[];
|
|
26
26
|
/** Formatted USD equivalent (e.g. "$5.56") — shown for non-stablecoin tokens */
|
|
27
27
|
usdEquivalent?: string | null;
|
|
28
|
+
/** When true, hide adjustment rows and USD equivalent (caller passes a skeleton as `total`). */
|
|
29
|
+
pricesLoading?: boolean;
|
|
28
30
|
}
|
|
29
|
-
export declare function CartSummary({ total, tokenSymbol, classes, subtotal, tokenDecimals, shipping, tax, discount, summaryLines, usdEquivalent, }: CartSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function CartSummary({ total, tokenSymbol, classes, subtotal, tokenDecimals, shipping, tax, discount, summaryLines, usdEquivalent, pricesLoading, }: CartSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
30
32
|
export {};
|
|
@@ -5,6 +5,8 @@ interface CheckoutCartPanelProps {
|
|
|
5
5
|
totalAmount: string;
|
|
6
6
|
tokenSymbol?: string;
|
|
7
7
|
tokenDecimals?: number;
|
|
8
|
+
/** True while token decimals/symbol are still loading — prevents rendering mis-decimalized prices. */
|
|
9
|
+
pricesLoading?: boolean;
|
|
8
10
|
organizationName?: string;
|
|
9
11
|
organizationLogo?: string;
|
|
10
12
|
classes?: AnySpendCheckoutClasses;
|
|
@@ -28,5 +30,5 @@ interface CheckoutCartPanelProps {
|
|
|
28
30
|
/** Formatted USD equivalent (e.g. "$5.56") — shown for non-stablecoin tokens */
|
|
29
31
|
usdEquivalent?: string | null;
|
|
30
32
|
}
|
|
31
|
-
export declare function CheckoutCartPanel({ items, totalAmount, tokenSymbol, tokenDecimals, organizationName, organizationLogo, classes, footer, shipping, tax, discount, summaryLines, usdEquivalent, }: CheckoutCartPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function CheckoutCartPanel({ items, totalAmount, tokenSymbol, tokenDecimals, pricesLoading, organizationName, organizationLogo, classes, footer, shipping, tax, discount, summaryLines, usdEquivalent, }: CheckoutCartPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
32
34
|
export {};
|
|
@@ -16,6 +16,8 @@ interface CheckoutFormPanelProps {
|
|
|
16
16
|
/** Token info for display */
|
|
17
17
|
tokenSymbol?: string;
|
|
18
18
|
tokenDecimals?: number;
|
|
19
|
+
/** True while token decimals/symbol are still loading — prevents rendering mis-decimalized prices. */
|
|
20
|
+
pricesLoading?: boolean;
|
|
19
21
|
/** CSS class overrides */
|
|
20
22
|
classes?: AnySpendCheckoutClasses;
|
|
21
23
|
/** Current form data (lifted state) */
|
|
@@ -35,5 +37,5 @@ interface CheckoutFormPanelProps {
|
|
|
35
37
|
/** Slot overrides */
|
|
36
38
|
checkoutFormSlot?: (props: CheckoutFormComponentProps) => React.ReactNode;
|
|
37
39
|
}
|
|
38
|
-
export declare function CheckoutFormPanel({ formSchema, formComponent: FormComponent, shippingOptions, collectShippingAddress, enableDiscountCode, validateDiscount, tokenSymbol, tokenDecimals, classes, formData, onFormDataChange, selectedShipping, onShippingChange, appliedDiscount, onDiscountApplied, onDiscountRemoved, shippingAddress, onShippingAddressChange, checkoutFormSlot, }: CheckoutFormPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
40
|
+
export declare function CheckoutFormPanel({ formSchema, formComponent: FormComponent, shippingOptions, collectShippingAddress, enableDiscountCode, validateDiscount, tokenSymbol, tokenDecimals, pricesLoading, classes, formData, onFormDataChange, selectedShipping, onShippingChange, appliedDiscount, onDiscountApplied, onDiscountRemoved, shippingAddress, onShippingAddressChange, checkoutFormSlot, }: CheckoutFormPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
39
41
|
export {};
|
|
@@ -6,7 +6,9 @@ interface DiscountCodeInputProps {
|
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
tokenSymbol?: string;
|
|
8
8
|
tokenDecimals?: number;
|
|
9
|
+
/** True while token decimals/symbol are still loading — renders applied amount as skeleton. */
|
|
10
|
+
pricesLoading?: boolean;
|
|
9
11
|
className?: string;
|
|
10
12
|
}
|
|
11
|
-
export declare function DiscountCodeInput({ onApply, appliedDiscount, onRemove, loading, tokenSymbol, tokenDecimals, className, }: DiscountCodeInputProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function DiscountCodeInput({ onApply, appliedDiscount, onRemove, loading, tokenSymbol, tokenDecimals, pricesLoading, className, }: DiscountCodeInputProps): import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -5,7 +5,9 @@ interface ShippingSelectorProps {
|
|
|
5
5
|
onSelect: (option: ShippingOption) => void;
|
|
6
6
|
tokenSymbol?: string;
|
|
7
7
|
tokenDecimals?: number;
|
|
8
|
+
/** True while token decimals/symbol are still loading — renders price as skeleton. */
|
|
9
|
+
pricesLoading?: boolean;
|
|
8
10
|
className?: string;
|
|
9
11
|
}
|
|
10
|
-
export declare function ShippingSelector({ options, selectedId, onSelect, tokenSymbol, tokenDecimals, className, }: ShippingSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export declare function ShippingSelector({ options, selectedId, onSelect, tokenSymbol, tokenDecimals, pricesLoading, className, }: ShippingSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
13
|
export {};
|
|
@@ -15,8 +15,10 @@ export interface B3ConfigContextType {
|
|
|
15
15
|
stripePublishableKey?: string;
|
|
16
16
|
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
17
17
|
authStrategy: AuthStrategy;
|
|
18
|
+
/** Override the API base URL for all auth operations (Better Auth client, Feathers JWT exchange). */
|
|
19
|
+
apiUrl?: string;
|
|
18
20
|
}
|
|
19
|
-
export declare function B3ConfigProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, stripePublishableKey, createClientReferenceId, authStrategy, }: {
|
|
21
|
+
export declare function B3ConfigProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, stripePublishableKey, createClientReferenceId, authStrategy, apiUrl, }: {
|
|
20
22
|
children: React.ReactNode;
|
|
21
23
|
accountOverride?: Account;
|
|
22
24
|
environment?: "development" | "production";
|
|
@@ -28,5 +30,7 @@ export declare function B3ConfigProvider({ children, accountOverride, environmen
|
|
|
28
30
|
stripePublishableKey?: string;
|
|
29
31
|
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
30
32
|
authStrategy?: AuthStrategy;
|
|
33
|
+
/** Override the API base URL for all auth operations (Better Auth client, Feathers JWT exchange). */
|
|
34
|
+
apiUrl?: string;
|
|
31
35
|
}): import("react/jsx-runtime").JSX.Element;
|
|
32
36
|
export declare function useB3Config(): B3ConfigContextType;
|
|
@@ -10,7 +10,7 @@ import { ClientType } from "../../../client-manager";
|
|
|
10
10
|
/**
|
|
11
11
|
* Main B3Provider component
|
|
12
12
|
*/
|
|
13
|
-
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider, simDuneApiKey, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication, queryClient, authStrategy, }: {
|
|
13
|
+
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider, simDuneApiKey, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication, queryClient, authStrategy, apiUrl, }: {
|
|
14
14
|
theme: "light" | "dark";
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
accountOverride?: Account;
|
|
@@ -39,4 +39,20 @@ export declare function B3Provider({ theme, children, accountOverride, environme
|
|
|
39
39
|
queryClient?: QueryClient;
|
|
40
40
|
/** Auth strategy: "thirdweb" (default, ecosystem wallet) or "better-auth" (email/password via Better Auth) */
|
|
41
41
|
authStrategy?: AuthStrategy;
|
|
42
|
+
/**
|
|
43
|
+
* Override the API base URL for Better Auth operations.
|
|
44
|
+
*
|
|
45
|
+
* When set, the Better Auth client (signIn, signUp, signOut, getSession) will
|
|
46
|
+
* target this URL instead of the default `B3_API_URL` / `NEXT_PUBLIC_B3_API`.
|
|
47
|
+
*
|
|
48
|
+
* Useful for local development where the frontend runs on localhost:3003 and
|
|
49
|
+
* the b3-api runs on localhost:3031 — keeps the entire OAuth flow local so
|
|
50
|
+
* sessions, cookies, and token exchange all hit the same server.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <B3Provider apiUrl="http://localhost:3031" ... />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
apiUrl?: string;
|
|
42
58
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type B3BetterAuthClient } from "../../../better-auth-client";
|
|
2
|
+
/**
|
|
3
|
+
* Provides a Better Auth client instance to the subtree.
|
|
4
|
+
*
|
|
5
|
+
* When `apiUrl` is supplied, a custom client targeting that URL is created
|
|
6
|
+
* (e.g. `http://localhost:3031` for local development). Otherwise, the
|
|
7
|
+
* default singleton (which uses `B3_API_URL` / `NEXT_PUBLIC_B3_API`) is used.
|
|
8
|
+
*/
|
|
9
|
+
export declare function BetterAuthClientProvider({ children, apiUrl, }: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
apiUrl?: string;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the Better Auth client from the nearest `BetterAuthClientProvider`.
|
|
15
|
+
* Falls back to the default singleton if no provider is present.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useBetterAuthClient(): B3BetterAuthClient;
|
|
@@ -10,6 +10,11 @@ export interface BetterAuthSignInProps {
|
|
|
10
10
|
showEmail?: boolean;
|
|
11
11
|
/** URL to redirect to after password reset link is clicked. Token is appended as ?token=... */
|
|
12
12
|
passwordResetRedirectTo?: string;
|
|
13
|
+
/**
|
|
14
|
+
* URL Better Auth redirects to after server-side email verification. Render
|
|
15
|
+
* `BetterAuthVerifyEmail` at this route so the user gets a confirmation page.
|
|
16
|
+
*/
|
|
17
|
+
verifyEmailRedirectTo?: string;
|
|
13
18
|
/** Called after successful authentication */
|
|
14
19
|
onSuccess?: () => void;
|
|
15
20
|
/** Called on authentication error */
|
|
@@ -31,4 +36,4 @@ export interface BetterAuthSignInProps {
|
|
|
31
36
|
* />
|
|
32
37
|
* ```
|
|
33
38
|
*/
|
|
34
|
-
export declare function BetterAuthSignIn({ title, subtitle, socialProviders, showEmail, passwordResetRedirectTo, onSuccess, onError, className, }: BetterAuthSignInProps): import("react/jsx-runtime").JSX.Element | null;
|
|
39
|
+
export declare function BetterAuthSignIn({ title, subtitle, socialProviders, showEmail, passwordResetRedirectTo, verifyEmailRedirectTo, onSuccess, onError, className, }: BetterAuthSignInProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type BetterAuthVerifyEmailState = "success" | "expired" | "invalid" | "already-verified" | "error";
|
|
2
|
+
export interface BetterAuthVerifyEmailProps {
|
|
3
|
+
/**
|
|
4
|
+
* Error code from the callback URL's `?error=` query param. Pass `null` /
|
|
5
|
+
* `undefined` when the user landed here cleanly (successful verification).
|
|
6
|
+
* Better Auth appends this param when server-side verification fails.
|
|
7
|
+
*/
|
|
8
|
+
errorCode?: string | null;
|
|
9
|
+
/** Called when the user clicks the "Go to sign in" button. */
|
|
10
|
+
onGoToSignIn?: () => void;
|
|
11
|
+
/** Fallback href used when `onGoToSignIn` is not provided. Defaults to "/login". */
|
|
12
|
+
signInHref?: string;
|
|
13
|
+
/** Optional override for the success headline. */
|
|
14
|
+
successTitle?: string;
|
|
15
|
+
/** Optional override for the success body text. */
|
|
16
|
+
successMessage?: string;
|
|
17
|
+
/** Optional class name for the root container. */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Standalone email-verification confirmation page. Render on the route you
|
|
22
|
+
* set as `callbackURL` when calling `betterAuthClient.sendVerificationEmail`
|
|
23
|
+
* (or the `verifyCallbackURL` arg on `useBetterAuth().signUpWithEmail`).
|
|
24
|
+
*
|
|
25
|
+
* Better Auth verifies the token server-side before redirecting here. This
|
|
26
|
+
* component only displays the outcome based on the `?error=` query param.
|
|
27
|
+
*
|
|
28
|
+
* Usage:
|
|
29
|
+
* ```tsx
|
|
30
|
+
* const error = new URLSearchParams(window.location.search).get("error");
|
|
31
|
+
* <BetterAuthVerifyEmail
|
|
32
|
+
* errorCode={error}
|
|
33
|
+
* onGoToSignIn={() => router.push("/login")}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function BetterAuthVerifyEmail({ errorCode, onGoToSignIn, signInHref, successTitle, successMessage, className, }: BetterAuthVerifyEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { SignInWithB3ModalProps } from "@b3dotfun/sdk/global-account/react";
|
|
|
3
3
|
* Component that manages the authentication flow for Sign In With B3
|
|
4
4
|
* Handles different login providers, authentication steps, and session key management
|
|
5
5
|
*/
|
|
6
|
-
export declare function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onError, chain, sessionKeyAddress, partnerId, closeAfterLogin, source, signersEnabled, }: SignInWithB3ModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export declare function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onError, chain, sessionKeyAddress, partnerId, closeAfterLogin, source, signersEnabled, verifyEmailRedirectTo, }: SignInWithB3ModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface PasswordInputProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function PasswordInput({ value, onChange, disabled, placeholder, onKeyDown, className, }: PasswordInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
interface LoginStepBetterAuthProps {
|
|
2
2
|
onSuccess?: () => void;
|
|
3
3
|
onError?: (error: Error) => Promise<void>;
|
|
4
|
+
/** URL Better Auth redirects to after server-side email verification. */
|
|
5
|
+
verifyEmailRedirectTo?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare function LoginStepBetterAuth({ onSuccess, onError }: LoginStepBetterAuthProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function LoginStepBetterAuth({ onSuccess, onError, verifyEmailRedirectTo }: LoginStepBetterAuthProps): import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface UserAvatarProps {
|
|
2
|
+
/** Direct avatar URL (IPFS or HTTP). Resolved and validated internally. */
|
|
3
|
+
avatarUrl?: string | null;
|
|
4
|
+
/** Seed for the generated fallback avatar + alt text. Use email, username, or address. */
|
|
5
|
+
name?: string;
|
|
6
|
+
/** Avatar size in pixels (square). */
|
|
7
|
+
size?: number;
|
|
8
|
+
/** Additional className for the outer container. */
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders a user avatar with IPFS support and boring-avatars fallback.
|
|
13
|
+
*
|
|
14
|
+
* - If `avatarUrl` is provided and valid, renders via IPFSMediaRenderer.
|
|
15
|
+
* - On load failure or missing URL, falls back to a deterministic boring-avatars beam.
|
|
16
|
+
*/
|
|
17
|
+
export declare function UserAvatar({ avatarUrl, name, size, className }: UserAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -5,9 +5,11 @@ export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper";
|
|
|
5
5
|
export { useB3 } from "./B3Provider/useB3";
|
|
6
6
|
export { useB3Account } from "./B3Provider/useB3Account";
|
|
7
7
|
export { useB3Config } from "./B3Provider/useB3Config";
|
|
8
|
+
export { useBetterAuthClient } from "./B3Provider/BetterAuthClientProvider";
|
|
8
9
|
export { StyleRoot } from "./StyleRoot";
|
|
9
10
|
export { BetterAuthResetPassword, type BetterAuthResetPasswordProps } from "./SignInWithB3/BetterAuthResetPassword";
|
|
10
11
|
export { BetterAuthSignIn, type BetterAuthSignInProps } from "./SignInWithB3/BetterAuthSignIn";
|
|
12
|
+
export { BetterAuthVerifyEmail, type BetterAuthVerifyEmailProps, type BetterAuthVerifyEmailState, } from "./SignInWithB3/BetterAuthVerifyEmail";
|
|
11
13
|
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
12
14
|
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
13
15
|
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
@@ -17,6 +19,7 @@ export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
|
|
|
17
19
|
export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep";
|
|
18
20
|
export { getConnectOptionsFromStrategy, isWalletType, type AllowedStrategy } from "./SignInWithB3/utils/signInUtils";
|
|
19
21
|
export { ManageAccount } from "./ManageAccount/ManageAccount";
|
|
22
|
+
export { UserAvatar } from "./UserAvatar/UserAvatar";
|
|
20
23
|
export { Deposit } from "./Deposit/Deposit";
|
|
21
24
|
export { Send } from "./Send/Send";
|
|
22
25
|
export { IPFSMediaRenderer } from "./IPFSMediaRenderer/IPFSMediaRenderer";
|
|
@@ -13,7 +13,7 @@ export declare class EmailVerificationRequiredError extends Error {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function useBetterAuth(): {
|
|
15
15
|
signInWithEmail: (email: string, password: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
16
|
-
signUpWithEmail: (email: string, password: string, name: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
16
|
+
signUpWithEmail: (email: string, password: string, name: string, verifyCallbackURL?: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
17
17
|
signInWithSocial: (provider: BetterAuthSocialProvider) => Promise<void>;
|
|
18
18
|
requestPasswordReset: (email: string, redirectTo?: string) => Promise<{
|
|
19
19
|
data: {
|
|
@@ -41,6 +41,8 @@ export interface SignInWithB3ModalProps extends BaseModalProps {
|
|
|
41
41
|
source?: "signInWithB3Button" | "requestPermissions";
|
|
42
42
|
/** Whether to show the signers enabled modal */
|
|
43
43
|
signersEnabled?: boolean;
|
|
44
|
+
/** URL Better Auth redirects to after server-side email verification. */
|
|
45
|
+
verifyEmailRedirectTo?: string;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Props for the Request Permissions modal
|
|
@@ -609,6 +611,8 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
609
611
|
actionLabel?: string;
|
|
610
612
|
/** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
|
|
611
613
|
showChainSelection?: boolean;
|
|
614
|
+
/** Whether to show the "Fund with Fiat" option in the deposit options list. Defaults to true */
|
|
615
|
+
showFiatOption?: boolean;
|
|
612
616
|
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
613
617
|
minPoolSize?: number;
|
|
614
618
|
/** Custom title for chain selection step */
|
|
@@ -16,3 +16,4 @@ export declare const CLIENT_APP_BUNDLE_ID: string;
|
|
|
16
16
|
export declare const B3_AUTH_COOKIE_NAME = "b3-auth";
|
|
17
17
|
export declare const ENS_GATEWAY_URL = "https://ens-gateway.b3.fun/";
|
|
18
18
|
export declare const PUBLIC_BASE_RPC_URL = "https://base-rpc.publicnode.com";
|
|
19
|
+
export declare const AVATAR_COLORS: string[];
|
package/package.json
CHANGED
|
@@ -148,6 +148,8 @@ export function AnySpend(props: {
|
|
|
148
148
|
theme?: AnySpendTheme;
|
|
149
149
|
/** When true, shows a KYC gate before Stripe Web2 (credit card) payments. Default false. */
|
|
150
150
|
kycEnabled?: boolean;
|
|
151
|
+
/** Whether to show the "Pay with Fiat" tab. Defaults to true. When false, the fiat tab is hidden and activeTab is forced to "crypto". */
|
|
152
|
+
showFiatOption?: boolean;
|
|
151
153
|
}) {
|
|
152
154
|
const fingerprintConfig = getFingerprintConfig();
|
|
153
155
|
|
|
@@ -184,6 +186,7 @@ function AnySpendInner({
|
|
|
184
186
|
callbackMetadata,
|
|
185
187
|
senderAddress,
|
|
186
188
|
kycEnabled = false,
|
|
189
|
+
showFiatOption = true,
|
|
187
190
|
}: {
|
|
188
191
|
sourceChainId?: number;
|
|
189
192
|
destinationTokenAddress?: string;
|
|
@@ -211,6 +214,7 @@ function AnySpendInner({
|
|
|
211
214
|
content?: AnySpendContent;
|
|
212
215
|
theme?: AnySpendTheme;
|
|
213
216
|
kycEnabled?: boolean;
|
|
217
|
+
showFiatOption?: boolean;
|
|
214
218
|
}) {
|
|
215
219
|
const { slots, content } = useAnySpendCustomization();
|
|
216
220
|
const searchParams = useSearchParamsSSR();
|
|
@@ -253,6 +257,7 @@ function AnySpendInner({
|
|
|
253
257
|
const previousPanel = useRef<PanelView>(PanelView.MAIN);
|
|
254
258
|
|
|
255
259
|
const [activeTab, setActiveTab] = useState<"crypto" | "fiat">(() => {
|
|
260
|
+
if (!showFiatOption) return "crypto";
|
|
256
261
|
if (typeof window !== "undefined") {
|
|
257
262
|
const stored = sessionStorage.getItem("anyspend_active_tab") as "crypto" | "fiat" | null;
|
|
258
263
|
if (stored === "crypto" || stored === "fiat") return stored;
|
|
@@ -261,8 +266,13 @@ function AnySpendInner({
|
|
|
261
266
|
});
|
|
262
267
|
|
|
263
268
|
useEffect(() => {
|
|
269
|
+
if (!showFiatOption && activeTab === "fiat") setActiveTab("crypto");
|
|
270
|
+
}, [showFiatOption, activeTab]);
|
|
271
|
+
|
|
272
|
+
useEffect(() => {
|
|
273
|
+
if (!showFiatOption) return;
|
|
264
274
|
sessionStorage.setItem("anyspend_active_tab", activeTab);
|
|
265
|
-
}, [activeTab]);
|
|
275
|
+
}, [activeTab, showFiatOption]);
|
|
266
276
|
|
|
267
277
|
const [orderId, setOrderId] = useState<string | undefined>(loadOrder);
|
|
268
278
|
const [directTransferTxHash, setDirectTransferTxHash] = useState<string | undefined>();
|
|
@@ -1312,17 +1322,19 @@ function AnySpendInner({
|
|
|
1312
1322
|
)}
|
|
1313
1323
|
|
|
1314
1324
|
{/* Tab section */}
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
setActiveTab
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1325
|
+
{showFiatOption && (
|
|
1326
|
+
<TabSection
|
|
1327
|
+
activeTab={activeTab}
|
|
1328
|
+
setActiveTab={tab => {
|
|
1329
|
+
setActiveTab(tab);
|
|
1330
|
+
// Reset payment methods when switching tabs
|
|
1331
|
+
resetPaymentMethods();
|
|
1332
|
+
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
1333
|
+
}}
|
|
1334
|
+
setSelectedCryptoPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
1335
|
+
setSelectedFiatPaymentMethod={setSelectedFiatPaymentMethod}
|
|
1336
|
+
/>
|
|
1337
|
+
)}
|
|
1326
1338
|
|
|
1327
1339
|
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
1328
1340
|
{/* Send section */}
|
|
@@ -119,6 +119,10 @@ export interface AnySpendCollectorClubPurchaseProps {
|
|
|
119
119
|
* Force fiat payment
|
|
120
120
|
*/
|
|
121
121
|
forceFiatPayment?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Whether to show the "Pay with fiat" tab. Defaults to true.
|
|
124
|
+
*/
|
|
125
|
+
showFiatOption?: boolean;
|
|
122
126
|
/**
|
|
123
127
|
* Optional discount code to apply to the purchase.
|
|
124
128
|
* When provided, validates on-chain and adjusts the price accordingly.
|
|
@@ -146,6 +150,7 @@ export function AnySpendCollectorClubPurchase({
|
|
|
146
150
|
vendingMachineId,
|
|
147
151
|
packType,
|
|
148
152
|
forceFiatPayment,
|
|
153
|
+
showFiatOption = true,
|
|
149
154
|
discountCode,
|
|
150
155
|
slots,
|
|
151
156
|
content,
|
|
@@ -398,6 +403,7 @@ export function AnySpendCollectorClubPurchase({
|
|
|
398
403
|
showRecipient={showRecipient}
|
|
399
404
|
srcFiatAmount={srcFiatAmount}
|
|
400
405
|
forceFiatPayment={forceFiatPayment}
|
|
406
|
+
showFiatOption={showFiatOption}
|
|
401
407
|
slots={slots}
|
|
402
408
|
content={content}
|
|
403
409
|
theme={theme}
|
|
@@ -178,6 +178,8 @@ export function AnySpendCustom(props: {
|
|
|
178
178
|
dstToken: components["schemas"]["Token"];
|
|
179
179
|
dstAmount: string;
|
|
180
180
|
forceFiatPayment?: boolean;
|
|
181
|
+
/** Whether to show the "Pay with fiat" tab. Defaults to true. When false, the fiat tab is hidden and activeTab is forced to "crypto". */
|
|
182
|
+
showFiatOption?: boolean;
|
|
181
183
|
contractAddress: string;
|
|
182
184
|
encodedData: string;
|
|
183
185
|
metadata: any;
|
|
@@ -232,6 +234,7 @@ function AnySpendCustomInner({
|
|
|
232
234
|
onShowPointsDetail,
|
|
233
235
|
srcFiatAmount: srcFiatAmountProps,
|
|
234
236
|
forceFiatPayment,
|
|
237
|
+
showFiatOption = true,
|
|
235
238
|
senderAddress,
|
|
236
239
|
}: {
|
|
237
240
|
loadOrder?: string;
|
|
@@ -258,6 +261,7 @@ function AnySpendCustomInner({
|
|
|
258
261
|
onShowPointsDetail?: () => void;
|
|
259
262
|
srcFiatAmount?: string;
|
|
260
263
|
forceFiatPayment?: boolean;
|
|
264
|
+
showFiatOption?: boolean;
|
|
261
265
|
senderAddress?: string;
|
|
262
266
|
slots?: AnySpendSlots;
|
|
263
267
|
content?: AnySpendContent;
|
|
@@ -271,7 +275,13 @@ function AnySpendCustomInner({
|
|
|
271
275
|
const [activePanel, setActivePanel] = useState<PanelView>(
|
|
272
276
|
loadOrder ? PanelView.ORDER_DETAILS : PanelView.CONFIRM_ORDER,
|
|
273
277
|
);
|
|
274
|
-
const [activeTab, setActiveTab] = useState<"crypto" | "fiat">(
|
|
278
|
+
const [activeTab, setActiveTab] = useState<"crypto" | "fiat">(
|
|
279
|
+
!showFiatOption ? "crypto" : forceFiatPayment ? "fiat" : activeTabProps,
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
useEffect(() => {
|
|
283
|
+
if (!showFiatOption && activeTab === "fiat") setActiveTab("crypto");
|
|
284
|
+
}, [showFiatOption, activeTab]);
|
|
275
285
|
|
|
276
286
|
// Payment method state with dual-state system (auto + explicit user selection)
|
|
277
287
|
// Note: AnySpendCustom doesn't use auto-selection, only explicit user selection
|
|
@@ -867,7 +877,7 @@ function AnySpendCustomInner({
|
|
|
867
877
|
onValueChange={value => setActiveTab(value as "crypto" | "fiat")}
|
|
868
878
|
className="bg-b3-react-background max-h-[60dvh] w-full overflow-y-auto p-5"
|
|
869
879
|
>
|
|
870
|
-
{!forceFiatPayment && (
|
|
880
|
+
{!forceFiatPayment && showFiatOption && (
|
|
871
881
|
<div className="w-full">
|
|
872
882
|
<div className="bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl">
|
|
873
883
|
<div
|
|
@@ -95,6 +95,8 @@ export interface AnySpendDepositProps {
|
|
|
95
95
|
depositContractConfig?: DepositContractConfig;
|
|
96
96
|
/** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
|
|
97
97
|
showChainSelection?: boolean;
|
|
98
|
+
/** Whether to show the "Fund with Fiat" option in the deposit options list. Defaults to true */
|
|
99
|
+
showFiatOption?: boolean;
|
|
98
100
|
/** Custom list of supported chains. If not provided, uses default chains */
|
|
99
101
|
supportedChains?: ChainConfig[];
|
|
100
102
|
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
@@ -248,6 +250,7 @@ export function AnySpendDeposit({
|
|
|
248
250
|
orderType,
|
|
249
251
|
depositContractConfig,
|
|
250
252
|
showChainSelection,
|
|
253
|
+
showFiatOption = true,
|
|
251
254
|
supportedChains = DEFAULT_SUPPORTED_CHAINS,
|
|
252
255
|
minPoolSize = DEFAULT_MIN_POOL_SIZE,
|
|
253
256
|
topChainsCount = 3,
|
|
@@ -585,39 +588,43 @@ export function AnySpendDeposit({
|
|
|
585
588
|
</button>
|
|
586
589
|
|
|
587
590
|
{/* Fund with Fiat */}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
<div
|
|
596
|
-
className={depositClasses?.optionContent || "anyspend-deposit-option-content flex items-center gap-3"}
|
|
591
|
+
{showFiatOption && (
|
|
592
|
+
<button
|
|
593
|
+
onClick={handleSelectFiat}
|
|
594
|
+
className={
|
|
595
|
+
depositClasses?.fiatButton ||
|
|
596
|
+
"anyspend-deposit-option-button anyspend-deposit-fiat-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left transition-all"
|
|
597
|
+
}
|
|
597
598
|
>
|
|
598
|
-
<
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
599
|
+
<div
|
|
600
|
+
className={depositClasses?.optionContent || "anyspend-deposit-option-content flex items-center gap-3"}
|
|
601
|
+
>
|
|
602
|
+
<CreditCardIcon className={depositClasses?.optionIcon || "anyspend-deposit-option-icon h-10 w-10"} />
|
|
603
|
+
<div className={depositClasses?.optionInfo || "anyspend-deposit-option-info"}>
|
|
604
|
+
<span
|
|
605
|
+
className={
|
|
606
|
+
depositClasses?.optionTitle || "anyspend-deposit-option-title text-as-primary font-medium"
|
|
607
|
+
}
|
|
608
|
+
>
|
|
609
|
+
Fund with Fiat
|
|
610
|
+
</span>
|
|
611
|
+
<p
|
|
612
|
+
className={
|
|
613
|
+
depositClasses?.optionDescription ||
|
|
614
|
+
"anyspend-deposit-option-description text-as-secondary text-xs"
|
|
615
|
+
}
|
|
616
|
+
>
|
|
617
|
+
Pay with card or bank transfer
|
|
618
|
+
</p>
|
|
619
|
+
</div>
|
|
615
620
|
</div>
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
+
<ChevronRight
|
|
622
|
+
className={
|
|
623
|
+
depositClasses?.optionChevron || "anyspend-deposit-option-chevron text-as-secondary h-5 w-5"
|
|
624
|
+
}
|
|
625
|
+
/>
|
|
626
|
+
</button>
|
|
627
|
+
)}
|
|
621
628
|
</div>
|
|
622
629
|
|
|
623
630
|
{/* Chain-specific warning */}
|
|
@@ -42,6 +42,7 @@ export function AnySpendNFT({
|
|
|
42
42
|
slots,
|
|
43
43
|
content,
|
|
44
44
|
theme,
|
|
45
|
+
showFiatOption = true,
|
|
45
46
|
}: {
|
|
46
47
|
loadOrder?: string;
|
|
47
48
|
mode?: "modal" | "page";
|
|
@@ -54,6 +55,8 @@ export function AnySpendNFT({
|
|
|
54
55
|
slots?: AnySpendSlots;
|
|
55
56
|
content?: AnySpendContent;
|
|
56
57
|
theme?: AnySpendTheme;
|
|
58
|
+
/** Whether to show the "Pay with fiat" tab. Defaults to true. */
|
|
59
|
+
showFiatOption?: boolean;
|
|
57
60
|
}) {
|
|
58
61
|
const [imageUrlWithFallback, setFallbackImageUrl] = useState<string | null>(nftContract.imageUrl);
|
|
59
62
|
const hasFetchedRef = useRef(false);
|
|
@@ -164,6 +167,7 @@ export function AnySpendNFT({
|
|
|
164
167
|
loadOrder={loadOrder}
|
|
165
168
|
mode={mode}
|
|
166
169
|
activeTab="fiat"
|
|
170
|
+
showFiatOption={showFiatOption}
|
|
167
171
|
recipientAddress={recipientAddress}
|
|
168
172
|
orderType={"mint_nft"}
|
|
169
173
|
dstChainId={nftContract.chainId}
|