@b3dotfun/sdk 0.0.87 → 0.0.88-alpha.0
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/README.md +2 -1
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +5 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +77 -73
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +190 -0
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/cjs/anyspend/react/components/QRDeposit.js +146 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +17 -12
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/cjs/anyspend/react/components/common/WarningText.js +36 -0
- package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.js +6 -0
- package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.js +6 -0
- package/dist/cjs/anyspend/react/components/index.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/index.js +3 -1
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/index.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +35 -11
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +86 -0
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/anyspend/utils/format.js +28 -5
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +2 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +17 -47
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +6 -7
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -5
- package/dist/cjs/global-account/react/components/B3Provider/types.js +4 -4
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +1 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +1 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +10 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +23 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +1 -1
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +1 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.js +2 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -1
- package/dist/cjs/global-account/react/components/index.d.ts +2 -0
- package/dist/cjs/global-account/react/components/index.js +7 -3
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +3 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
- package/dist/cjs/global-account/react/hooks/useAutoSelectWallet.js +42 -0
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +6 -4
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -2
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +5 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +77 -73
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +187 -0
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/esm/anyspend/react/components/QRDeposit.js +143 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +17 -12
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/esm/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/esm/anyspend/react/components/common/WarningText.js +32 -0
- package/dist/esm/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/esm/anyspend/react/components/icons/CreditCardIcon.js +2 -0
- package/dist/esm/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/esm/anyspend/react/components/icons/QrCodeIcon.js +2 -0
- package/dist/esm/anyspend/react/components/index.d.ts +2 -0
- package/dist/esm/anyspend/react/components/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +35 -11
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +83 -0
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/anyspend/utils/format.js +28 -5
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +21 -51
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +6 -7
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -5
- package/dist/esm/global-account/react/components/B3Provider/types.js +4 -4
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +1 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +1 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +6 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +19 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +2 -2
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +2 -3
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +3 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +3 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +3 -2
- package/dist/esm/global-account/react/components/index.d.ts +2 -0
- package/dist/esm/global-account/react/components/index.js +2 -0
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +4 -3
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
- package/dist/esm/global-account/react/hooks/useAutoSelectWallet.js +39 -0
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +6 -4
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -2
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +5 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/types/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/types/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/types/anyspend/react/components/index.d.ts +2 -0
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -5
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +1 -0
- package/dist/types/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
- package/dist/types/global-account/react/components/index.d.ts +2 -0
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +105 -85
- package/src/anyspend/react/components/AnySpendCustom.tsx +0 -2
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +2 -3
- package/src/anyspend/react/components/AnySpendDeposit.tsx +578 -0
- package/src/anyspend/react/components/QRDeposit.tsx +348 -0
- package/src/anyspend/react/components/common/OrderDetails.tsx +26 -8
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +20 -8
- package/src/anyspend/react/components/common/OrderStatus.tsx +2 -2
- package/src/anyspend/react/components/common/WarningText.tsx +52 -0
- package/src/anyspend/react/components/icons/CreditCardIcon.tsx +25 -0
- package/src/anyspend/react/components/icons/QrCodeIcon.tsx +25 -0
- package/src/anyspend/react/components/icons/credit-card.svg +5 -0
- package/src/anyspend/react/components/icons/qr-code.svg +5 -0
- package/src/anyspend/react/components/index.ts +2 -0
- package/src/anyspend/react/hooks/index.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +37 -12
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +110 -0
- package/src/anyspend/utils/format.ts +33 -5
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +10 -2
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +6 -7
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +20 -71
- package/src/global-account/react/components/B3Provider/types.ts +8 -9
- package/src/global-account/react/components/B3Provider/useB3.ts +1 -0
- package/src/global-account/react/components/B3Provider/useB3Account.ts +7 -0
- package/src/global-account/react/components/B3Provider/useB3Config.ts +34 -0
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +2 -2
- package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +2 -3
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +10 -2
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +3 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +5 -2
- package/src/global-account/react/components/index.ts +2 -0
- package/src/global-account/react/hooks/useAccountWallet.tsx +4 -3
- package/src/global-account/react/hooks/useAutoSelectWallet.ts +51 -0
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +7 -5
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +2 -2
- package/src/global-account/react/stores/useModalStore.ts +4 -0
- package/src/styles/index.css +2 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
+
import { GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
3
|
+
export interface DepositContractConfig {
|
|
4
|
+
/** Custom function ABI JSON string */
|
|
5
|
+
functionAbi: string;
|
|
6
|
+
/** The function name to call */
|
|
7
|
+
functionName: string;
|
|
8
|
+
/** Custom function arguments. Use "{{amount_out}}" for the deposit amount placeholder */
|
|
9
|
+
functionArgs: string[];
|
|
10
|
+
/** The contract address to deposit to */
|
|
11
|
+
to: string;
|
|
12
|
+
/** Optional spender address if different from contract address */
|
|
13
|
+
spenderAddress?: string;
|
|
14
|
+
/** Custom action label */
|
|
15
|
+
action?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ChainConfig {
|
|
18
|
+
/** Chain ID */
|
|
19
|
+
id: number;
|
|
20
|
+
/** Display name */
|
|
21
|
+
name: string;
|
|
22
|
+
/** Optional icon URL */
|
|
23
|
+
iconUrl?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AnySpendDepositProps {
|
|
26
|
+
/** Order ID to load an existing order */
|
|
27
|
+
loadOrder?: string;
|
|
28
|
+
/** Display mode */
|
|
29
|
+
mode?: "modal" | "page";
|
|
30
|
+
/** The recipient address for the deposit */
|
|
31
|
+
recipientAddress: string;
|
|
32
|
+
/** Payment type - crypto or fiat. If not set, shows chain selection first */
|
|
33
|
+
paymentType?: "crypto" | "fiat";
|
|
34
|
+
/** Source token address to pre-select */
|
|
35
|
+
sourceTokenAddress?: string;
|
|
36
|
+
/** Source chain ID to pre-select. If not provided, shows chain selection */
|
|
37
|
+
sourceTokenChainId?: number;
|
|
38
|
+
/** The destination token to receive */
|
|
39
|
+
destinationToken: components["schemas"]["Token"];
|
|
40
|
+
/** The destination chain ID */
|
|
41
|
+
destinationChainId: number;
|
|
42
|
+
/** Callback when deposit succeeds */
|
|
43
|
+
onSuccess?: (amount: string) => void;
|
|
44
|
+
/** Callback for opening a custom modal (e.g., for special token handling) */
|
|
45
|
+
onOpenCustomModal?: () => void;
|
|
46
|
+
/** Custom footer content */
|
|
47
|
+
mainFooter?: React.ReactNode;
|
|
48
|
+
/** Called when a token is selected. Call event.preventDefault() to prevent default behavior */
|
|
49
|
+
onTokenSelect?: (token: components["schemas"]["Token"], event: {
|
|
50
|
+
preventDefault: () => void;
|
|
51
|
+
}) => void;
|
|
52
|
+
/** Custom USD input value presets for fiat payment */
|
|
53
|
+
customUsdInputValues?: string[];
|
|
54
|
+
/** Whether to prefer using connected EOA wallet */
|
|
55
|
+
preferEoa?: boolean;
|
|
56
|
+
/** Minimum destination amount required */
|
|
57
|
+
minDestinationAmount?: number;
|
|
58
|
+
/** Custom header component */
|
|
59
|
+
header?: ({ anyspendPrice, isLoadingAnyspendPrice, }: {
|
|
60
|
+
anyspendPrice: GetQuoteResponse | undefined;
|
|
61
|
+
isLoadingAnyspendPrice: boolean;
|
|
62
|
+
}) => React.JSX.Element;
|
|
63
|
+
/** Order type for the deposit */
|
|
64
|
+
orderType?: "hype_duel" | "custom_exact_in" | "swap";
|
|
65
|
+
/** Custom action label displayed on buttons */
|
|
66
|
+
actionLabel?: string;
|
|
67
|
+
/** Configuration for depositing to a custom contract.
|
|
68
|
+
* If provided, creates a custom_exact_in order that calls the contract.
|
|
69
|
+
* If not provided, creates a simple hype_duel order for direct deposits.
|
|
70
|
+
*/
|
|
71
|
+
depositContractConfig?: DepositContractConfig;
|
|
72
|
+
/** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
|
|
73
|
+
showChainSelection?: boolean;
|
|
74
|
+
/** Custom list of supported chains. If not provided, uses default chains */
|
|
75
|
+
supportedChains?: ChainConfig[];
|
|
76
|
+
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
77
|
+
minPoolSize?: number;
|
|
78
|
+
/** Custom title for chain selection step */
|
|
79
|
+
chainSelectionTitle?: string;
|
|
80
|
+
/** Custom description for chain selection step */
|
|
81
|
+
chainSelectionDescription?: string;
|
|
82
|
+
/** Number of top chains to show (default: 3) */
|
|
83
|
+
topChainsCount?: number;
|
|
84
|
+
/** Callback when close button is clicked */
|
|
85
|
+
onClose?: () => void;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A flexible deposit component that wraps AnySpendCustomExactIn with optional chain selection.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* // Simple deposit with chain selection
|
|
92
|
+
* <AnySpendDeposit
|
|
93
|
+
* recipientAddress={userAddress}
|
|
94
|
+
* destinationToken={myToken}
|
|
95
|
+
* destinationChainId={base.id}
|
|
96
|
+
* onSuccess={(amount) => console.log(`Deposited ${amount}`)}
|
|
97
|
+
* />
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* // Skip chain selection by providing sourceTokenChainId
|
|
101
|
+
* <AnySpendDeposit
|
|
102
|
+
* recipientAddress={userAddress}
|
|
103
|
+
* destinationToken={myToken}
|
|
104
|
+
* destinationChainId={base.id}
|
|
105
|
+
* sourceTokenChainId={base.id}
|
|
106
|
+
* onSuccess={(amount) => console.log(`Deposited ${amount}`)}
|
|
107
|
+
* />
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* // Deposit with custom contract
|
|
111
|
+
* <AnySpendDeposit
|
|
112
|
+
* recipientAddress={userAddress}
|
|
113
|
+
* destinationToken={myToken}
|
|
114
|
+
* destinationChainId={base.id}
|
|
115
|
+
* depositContractConfig={{
|
|
116
|
+
* contractAddress: "0x...",
|
|
117
|
+
* functionName: "depositFor",
|
|
118
|
+
* }}
|
|
119
|
+
* onSuccess={(amount) => console.log(`Deposited ${amount}`)}
|
|
120
|
+
* />
|
|
121
|
+
*/
|
|
122
|
+
export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
+
import { DepositContractConfig } from "./AnySpendDeposit";
|
|
3
|
+
export interface QRDepositProps {
|
|
4
|
+
/** Display mode */
|
|
5
|
+
mode?: "modal" | "page";
|
|
6
|
+
/** The recipient address (user's wallet) */
|
|
7
|
+
recipientAddress: string;
|
|
8
|
+
/** The source token to deposit (defaults to ETH on Base) */
|
|
9
|
+
sourceToken?: components["schemas"]["Token"];
|
|
10
|
+
/** The source chain ID (defaults to Base) */
|
|
11
|
+
sourceChainId?: number;
|
|
12
|
+
/** The destination token to receive */
|
|
13
|
+
destinationToken: components["schemas"]["Token"];
|
|
14
|
+
/** The destination chain ID */
|
|
15
|
+
destinationChainId: number;
|
|
16
|
+
/** Creator address (optional) */
|
|
17
|
+
creatorAddress?: string;
|
|
18
|
+
/** Contract config for custom execution after deposit */
|
|
19
|
+
depositContractConfig?: DepositContractConfig;
|
|
20
|
+
/** Callback when back button is clicked */
|
|
21
|
+
onBack?: () => void;
|
|
22
|
+
/** Callback when close button is clicked */
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
/** Callback when order is created successfully */
|
|
25
|
+
onOrderCreated?: (orderId: string) => void;
|
|
26
|
+
/** Callback when deposit is completed */
|
|
27
|
+
onSuccess?: (txHash?: string) => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A component for displaying QR code deposit functionality.
|
|
31
|
+
* Creates a deposit_first order on mount and shows a QR code that can be scanned to deposit tokens.
|
|
32
|
+
* Users can change the source token/chain using the TokenSelector.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <QRDeposit
|
|
36
|
+
* recipientAddress={userAddress}
|
|
37
|
+
* destinationToken={usdcArbitrumToken}
|
|
38
|
+
* destinationChainId={42161}
|
|
39
|
+
* onBack={() => setStep("select-chain")}
|
|
40
|
+
* onSuccess={(txHash) => console.log("Deposit complete:", txHash)}
|
|
41
|
+
* />
|
|
42
|
+
*/
|
|
43
|
+
export declare function QRDeposit({ mode, recipientAddress, sourceToken: sourceTokenProp, sourceChainId: sourceChainIdProp, destinationToken, destinationChainId, creatorAddress, depositContractConfig, onBack, onClose, onOrderCreated, onSuccess, }: QRDepositProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,6 +14,8 @@ interface OrderDetailsCollapsibleProps {
|
|
|
14
14
|
showTotal?: boolean;
|
|
15
15
|
totalAmount?: string;
|
|
16
16
|
points?: number;
|
|
17
|
+
isOpen?: boolean;
|
|
18
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
17
19
|
}
|
|
18
20
|
export declare const OrderDetailsCollapsible: import("react").NamedExoticComponent<OrderDetailsCollapsibleProps>;
|
|
19
21
|
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface WarningTextProps {
|
|
2
|
+
/** The warning message content */
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Additional CSS classes */
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A generic warning text component with consistent styling.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <WarningText>
|
|
12
|
+
* Custom warning message
|
|
13
|
+
* </WarningText>
|
|
14
|
+
*/
|
|
15
|
+
export declare function WarningText({ children, className }: WarningTextProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export interface ChainWarningTextProps {
|
|
17
|
+
/** The chain ID to display warning for */
|
|
18
|
+
chainId: number;
|
|
19
|
+
/** Additional CSS classes */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A chain-aware warning text component that displays chain-specific warnings.
|
|
24
|
+
* Returns null if there's no warning for the given chain.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <ChainWarningText chainId={destinationChainId} className="mt-4" />
|
|
31
|
+
*/
|
|
32
|
+
export declare function ChainWarningText({ chainId, className }: ChainWarningTextProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -4,6 +4,8 @@ export { AnySpendBuySpin } from "./AnySpendBuySpin";
|
|
|
4
4
|
export { AnySpendCollectorClubPurchase } from "./AnySpendCollectorClubPurchase";
|
|
5
5
|
export { AnySpendCustom } from "./AnySpendCustom";
|
|
6
6
|
export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
7
|
+
export { AnySpendDeposit } from "./AnySpendDeposit";
|
|
8
|
+
export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
|
|
7
9
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
|
|
8
10
|
export * from "./AnySpendFingerprintWrapper";
|
|
9
11
|
export { AnySpendNFT } from "./AnySpendNFT";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./useAnyspendCreateOnrampOrder";
|
|
2
2
|
export * from "./useAnyspendCreateOrder";
|
|
3
|
+
export * from "./useCreateDepositFirstOrder";
|
|
3
4
|
export * from "./useAnyspendOrderAndTransactions";
|
|
4
5
|
export * from "./useAnyspendOrderHistory";
|
|
5
6
|
export * from "./useAnyspendQuote";
|
|
@@ -24,9 +24,9 @@ interface UseAnyspendFlowProps {
|
|
|
24
24
|
destinationTokenChainId?: number;
|
|
25
25
|
slippage?: number;
|
|
26
26
|
disableUrlParamManagement?: boolean;
|
|
27
|
-
orderType?: "hype_duel" | "custom_exact_in";
|
|
27
|
+
orderType?: "hype_duel" | "custom_exact_in" | "swap";
|
|
28
28
|
}
|
|
29
|
-
export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrder,
|
|
29
|
+
export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrder, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, destinationTokenAddress, destinationTokenChainId, slippage, disableUrlParamManagement, orderType, }: UseAnyspendFlowProps): {
|
|
30
30
|
activePanel: PanelView;
|
|
31
31
|
setActivePanel: import("react").Dispatch<import("react").SetStateAction<PanelView>>;
|
|
32
32
|
orderId: string | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
+
import { DepositContractConfig } from "../components/AnySpendDeposit";
|
|
3
|
+
export type CreateDepositFirstOrderParams = {
|
|
4
|
+
recipientAddress: string;
|
|
5
|
+
srcChain: number;
|
|
6
|
+
dstChain: number;
|
|
7
|
+
srcToken: components["schemas"]["Token"];
|
|
8
|
+
dstToken: components["schemas"]["Token"];
|
|
9
|
+
creatorAddress?: string;
|
|
10
|
+
/** Optional contract config for custom execution after deposit */
|
|
11
|
+
contractConfig?: DepositContractConfig;
|
|
12
|
+
};
|
|
13
|
+
export type UseCreateDepositFirstOrderProps = {
|
|
14
|
+
onSuccess?: (data: any) => void;
|
|
15
|
+
onError?: (error: Error) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Hook for creating deposit_first orders in the Anyspend protocol.
|
|
19
|
+
* This order type doesn't require srcAmount - the user deposits tokens after the order is created.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useCreateDepositFirstOrder({ onSuccess, onError }?: UseCreateDepositFirstOrderProps): {
|
|
22
|
+
createOrder: import("@tanstack/react-query").UseMutateFunction<any, Error, CreateDepositFirstOrderParams, unknown>;
|
|
23
|
+
isCreatingOrder: boolean;
|
|
24
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Users } from "@b3dotfun/b3-api";
|
|
2
1
|
import { CreateOnrampOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
3
2
|
import { CreateOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOrder";
|
|
4
3
|
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
@@ -10,11 +9,7 @@ import { ClientType } from "../../../client-manager";
|
|
|
10
9
|
export interface B3ContextType {
|
|
11
10
|
account?: Account;
|
|
12
11
|
automaticallySetFirstEoa: boolean;
|
|
13
|
-
user?: Users;
|
|
14
|
-
setWallet: (wallet: Wallet) => void;
|
|
15
12
|
wallet?: Wallet;
|
|
16
|
-
setUser: (user?: Users) => void;
|
|
17
|
-
refetchUser: () => Promise<any>;
|
|
18
13
|
initialized: boolean;
|
|
19
14
|
ready: boolean;
|
|
20
15
|
environment?: "development" | "production";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useB3Account: () => import("thirdweb/wallets").Account | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const useB3Config: () => {
|
|
2
|
+
automaticallySetFirstEoa: boolean;
|
|
3
|
+
environment: "development" | "production" | undefined;
|
|
4
|
+
theme: "light" | "dark";
|
|
5
|
+
clientType: import("../../../client-manager").ClientType;
|
|
6
|
+
partnerId: string;
|
|
7
|
+
createClientReferenceId: ((params: import("../../../../anyspend/react").CreateOrderParams | import("../../../../anyspend/react").CreateOnrampOrderParams) => Promise<string>) | undefined;
|
|
8
|
+
enableTurnkey: boolean | undefined;
|
|
9
|
+
};
|
|
@@ -3,6 +3,8 @@ export { B3Provider, InnerProvider } from "./B3Provider/B3Provider";
|
|
|
3
3
|
export { RelayKitProviderWrapper } from "./B3Provider/RelayKitProviderWrapper";
|
|
4
4
|
export { B3Context, type B3ContextType } from "./B3Provider/types";
|
|
5
5
|
export { useB3 } from "./B3Provider/useB3";
|
|
6
|
+
export { useB3Account } from "./B3Provider/useB3Account";
|
|
7
|
+
export { useB3Config } from "./B3Provider/useB3Config";
|
|
6
8
|
export { StyleRoot } from "./StyleRoot";
|
|
7
9
|
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
8
10
|
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
@@ -13,8 +13,8 @@ export declare function useAuthentication(partnerId: string): {
|
|
|
13
13
|
onConnect: (_walleAutoConnectedWith: Wallet, allConnectedWallets: Wallet[]) => Promise<void>;
|
|
14
14
|
user: {
|
|
15
15
|
email?: string | undefined;
|
|
16
|
-
telNumber?: string | undefined;
|
|
17
16
|
username?: string | undefined;
|
|
17
|
+
telNumber?: string | undefined;
|
|
18
18
|
ens?: string | undefined;
|
|
19
19
|
avatar?: string | undefined;
|
|
20
20
|
preferences?: {} | undefined;
|
|
@@ -8,8 +8,8 @@ import { Users } from "@b3dotfun/b3-api";
|
|
|
8
8
|
export declare function useUserQuery(): {
|
|
9
9
|
user: {
|
|
10
10
|
email?: string | undefined;
|
|
11
|
-
telNumber?: string | undefined;
|
|
12
11
|
username?: string | undefined;
|
|
12
|
+
telNumber?: string | undefined;
|
|
13
13
|
ens?: string | undefined;
|
|
14
14
|
avatar?: string | undefined;
|
|
15
15
|
preferences?: {} | undefined;
|
|
@@ -144,6 +144,10 @@ export interface AnySpendModalProps extends BaseModalProps {
|
|
|
144
144
|
customUsdInputValues?: string[];
|
|
145
145
|
/** Client-provided reference ID for tracking orders */
|
|
146
146
|
clientReferenceId?: string;
|
|
147
|
+
/** Whether to hide the header */
|
|
148
|
+
hideHeader?: boolean;
|
|
149
|
+
/** When true, disables URL parameter management for swap configuration */
|
|
150
|
+
disableUrlParamManagement?: boolean;
|
|
147
151
|
}
|
|
148
152
|
/**
|
|
149
153
|
* Props for the AnySpend NFT modal
|