@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.
Files changed (175) hide show
  1. package/README.md +2 -1
  2. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +5 -0
  3. package/dist/cjs/anyspend/react/components/AnySpend.js +77 -73
  4. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +0 -1
  5. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  6. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
  7. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
  8. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +190 -0
  9. package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +43 -0
  10. package/dist/cjs/anyspend/react/components/QRDeposit.js +146 -0
  11. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +17 -12
  12. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  13. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
  14. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
  15. package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +32 -0
  16. package/dist/cjs/anyspend/react/components/common/WarningText.js +36 -0
  17. package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
  18. package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.js +6 -0
  19. package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
  20. package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.js +6 -0
  21. package/dist/cjs/anyspend/react/components/index.d.ts +2 -0
  22. package/dist/cjs/anyspend/react/components/index.js +3 -1
  23. package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
  24. package/dist/cjs/anyspend/react/hooks/index.js +1 -0
  25. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  26. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +35 -11
  27. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
  28. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +86 -0
  29. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
  30. package/dist/cjs/anyspend/utils/format.js +28 -5
  31. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +2 -1
  32. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +17 -47
  33. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +6 -7
  34. package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -5
  35. package/dist/cjs/global-account/react/components/B3Provider/types.js +4 -4
  36. package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +1 -0
  37. package/dist/cjs/global-account/react/components/B3Provider/useB3.js +1 -0
  38. package/dist/cjs/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
  39. package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +10 -0
  40. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
  41. package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +23 -0
  42. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +1 -1
  43. package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +1 -2
  44. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
  45. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +2 -1
  46. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.js +2 -1
  47. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -1
  48. package/dist/cjs/global-account/react/components/index.d.ts +2 -0
  49. package/dist/cjs/global-account/react/components/index.js +7 -3
  50. package/dist/cjs/global-account/react/hooks/useAccountWallet.js +3 -2
  51. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
  52. package/dist/cjs/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
  53. package/dist/cjs/global-account/react/hooks/useAutoSelectWallet.js +42 -0
  54. package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +6 -4
  55. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -2
  56. package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +1 -1
  57. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
  58. package/dist/esm/anyspend/react/components/AnySpend.d.ts +5 -0
  59. package/dist/esm/anyspend/react/components/AnySpend.js +77 -73
  60. package/dist/esm/anyspend/react/components/AnySpendCustom.js +0 -1
  61. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  62. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
  63. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
  64. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +187 -0
  65. package/dist/esm/anyspend/react/components/QRDeposit.d.ts +43 -0
  66. package/dist/esm/anyspend/react/components/QRDeposit.js +143 -0
  67. package/dist/esm/anyspend/react/components/common/OrderDetails.js +17 -12
  68. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  69. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
  70. package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
  71. package/dist/esm/anyspend/react/components/common/WarningText.d.ts +32 -0
  72. package/dist/esm/anyspend/react/components/common/WarningText.js +32 -0
  73. package/dist/esm/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
  74. package/dist/esm/anyspend/react/components/icons/CreditCardIcon.js +2 -0
  75. package/dist/esm/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
  76. package/dist/esm/anyspend/react/components/icons/QrCodeIcon.js +2 -0
  77. package/dist/esm/anyspend/react/components/index.d.ts +2 -0
  78. package/dist/esm/anyspend/react/components/index.js +1 -0
  79. package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
  80. package/dist/esm/anyspend/react/hooks/index.js +1 -0
  81. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  82. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +35 -11
  83. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
  84. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +83 -0
  85. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
  86. package/dist/esm/anyspend/utils/format.js +28 -5
  87. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -2
  88. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +21 -51
  89. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +6 -7
  90. package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -5
  91. package/dist/esm/global-account/react/components/B3Provider/types.js +4 -4
  92. package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +1 -0
  93. package/dist/esm/global-account/react/components/B3Provider/useB3.js +1 -0
  94. package/dist/esm/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
  95. package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +6 -0
  96. package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
  97. package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +19 -0
  98. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +2 -2
  99. package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +2 -3
  100. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
  101. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +3 -2
  102. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +3 -2
  103. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +3 -2
  104. package/dist/esm/global-account/react/components/index.d.ts +2 -0
  105. package/dist/esm/global-account/react/components/index.js +2 -0
  106. package/dist/esm/global-account/react/hooks/useAccountWallet.js +4 -3
  107. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
  108. package/dist/esm/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
  109. package/dist/esm/global-account/react/hooks/useAutoSelectWallet.js +39 -0
  110. package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +6 -4
  111. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -2
  112. package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +1 -1
  113. package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
  114. package/dist/styles/index.css +1 -1
  115. package/dist/types/anyspend/react/components/AnySpend.d.ts +5 -0
  116. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  117. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
  118. package/dist/types/anyspend/react/components/QRDeposit.d.ts +43 -0
  119. package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  120. package/dist/types/anyspend/react/components/common/WarningText.d.ts +32 -0
  121. package/dist/types/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
  122. package/dist/types/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
  123. package/dist/types/anyspend/react/components/index.d.ts +2 -0
  124. package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
  125. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  126. package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
  127. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
  128. package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -5
  129. package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +1 -0
  130. package/dist/types/global-account/react/components/B3Provider/useB3Account.d.ts +1 -0
  131. package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +9 -0
  132. package/dist/types/global-account/react/components/index.d.ts +2 -0
  133. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
  134. package/dist/types/global-account/react/hooks/useAutoSelectWallet.d.ts +7 -0
  135. package/dist/types/global-account/react/hooks/useUserQuery.d.ts +1 -1
  136. package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
  137. package/package.json +1 -1
  138. package/src/anyspend/react/components/AnySpend.tsx +105 -85
  139. package/src/anyspend/react/components/AnySpendCustom.tsx +0 -2
  140. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +2 -3
  141. package/src/anyspend/react/components/AnySpendDeposit.tsx +578 -0
  142. package/src/anyspend/react/components/QRDeposit.tsx +348 -0
  143. package/src/anyspend/react/components/common/OrderDetails.tsx +26 -8
  144. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +20 -8
  145. package/src/anyspend/react/components/common/OrderStatus.tsx +2 -2
  146. package/src/anyspend/react/components/common/WarningText.tsx +52 -0
  147. package/src/anyspend/react/components/icons/CreditCardIcon.tsx +25 -0
  148. package/src/anyspend/react/components/icons/QrCodeIcon.tsx +25 -0
  149. package/src/anyspend/react/components/icons/credit-card.svg +5 -0
  150. package/src/anyspend/react/components/icons/qr-code.svg +5 -0
  151. package/src/anyspend/react/components/index.ts +2 -0
  152. package/src/anyspend/react/hooks/index.ts +1 -0
  153. package/src/anyspend/react/hooks/useAnyspendFlow.ts +37 -12
  154. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +110 -0
  155. package/src/anyspend/utils/format.ts +33 -5
  156. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +10 -2
  157. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +6 -7
  158. package/src/global-account/react/components/B3Provider/B3Provider.tsx +20 -71
  159. package/src/global-account/react/components/B3Provider/types.ts +8 -9
  160. package/src/global-account/react/components/B3Provider/useB3.ts +1 -0
  161. package/src/global-account/react/components/B3Provider/useB3Account.ts +7 -0
  162. package/src/global-account/react/components/B3Provider/useB3Config.ts +34 -0
  163. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +2 -2
  164. package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +2 -3
  165. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +10 -2
  166. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +3 -2
  167. package/src/global-account/react/components/SignInWithB3/SignInWithB3.tsx +2 -2
  168. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +5 -2
  169. package/src/global-account/react/components/index.ts +2 -0
  170. package/src/global-account/react/hooks/useAccountWallet.tsx +4 -3
  171. package/src/global-account/react/hooks/useAutoSelectWallet.ts +51 -0
  172. package/src/global-account/react/hooks/useTurnkeyAuth.ts +7 -5
  173. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +2 -2
  174. package/src/global-account/react/stores/useModalStore.ts +4 -0
  175. 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;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface CreditCardIconProps {
3
+ className?: string;
4
+ }
5
+ export declare const CreditCardIcon: React.FC<CreditCardIconProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface QrCodeIconProps {
3
+ className?: string;
4
+ }
5
+ export declare const QrCodeIcon: React.FC<QrCodeIconProps>;
6
+ export {};
@@ -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, isDepositMode, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, destinationTokenAddress, destinationTokenChainId, slippage, disableUrlParamManagement, orderType, }: UseAnyspendFlowProps): {
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
+ };
@@ -48,8 +48,8 @@ export declare const useGenerateSigMintData: ({ recipientAddress, contractAddres
48
48
  creatorMap?: {} | undefined;
49
49
  chainId: number;
50
50
  address: string;
51
- _id: string | {};
52
51
  title: string;
52
+ _id: string | {};
53
53
  };
54
54
  } | null;
55
55
  error: Error | null;
@@ -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";
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Hook to access the B3 context
3
3
  * @throws Error if used outside a B3Provider
4
+ * @deprecated Use useB3Config or useB3Account instead
4
5
  */
5
6
  export declare function useB3(): import("./types").B3ContextType;
@@ -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;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Hook to automatically select the first EOA wallet when user is authenticated
3
+ * Only auto-selects if the last auth was via wallet or no previous auth provider
4
+ */
5
+ export declare function useAutoSelectWallet({ enabled }: {
6
+ enabled: boolean;
7
+ }): void;
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.87",
3
+ "version": "0.0.88-alpha.0",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",