@b3dotfun/sdk 0.1.68-alpha.6 → 0.1.68-alpha.7

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.
@@ -66,4 +66,6 @@ export declare function AnySpend(props: {
66
66
  content?: AnySpendContent;
67
67
  /** Structured color/theme configuration */
68
68
  theme?: AnySpendTheme;
69
+ /** When true, shows a KYC gate before Stripe Web2 (credit card) payments. Default false. */
70
+ kycEnabled?: boolean;
69
71
  }): import("react/jsx-runtime").JSX.Element;
@@ -68,7 +68,7 @@ function AnySpend(props) {
68
68
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
69
69
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendCustomizationContext_1.AnySpendCustomizationProvider, { slots: props.slots, content: props.content, theme: props.theme, children: (0, jsx_runtime_1.jsx)(AnySpendInner, { ...props }) }) }));
70
70
  }
71
- function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, allowDirectTransfer = false, destinationTokenAmount, callbackMetadata, senderAddress, }) {
71
+ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, allowDirectTransfer = false, destinationTokenAmount, callbackMetadata, senderAddress, kycEnabled = false, }) {
72
72
  const { slots, content } = (0, AnySpendCustomizationContext_1.useAnySpendCustomization)();
73
73
  const searchParams = (0, react_2.useSearchParamsSSR)();
74
74
  const router = (0, react_2.useRouter)();
@@ -80,7 +80,8 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
80
80
  // signature when the user actually clicks Buy, not on panel mount.
81
81
  // useRef so handleFiatOrder can read the updated value synchronously
82
82
  // in the same frame that onStatusResolved sets it (setState is async).
83
- const kycApprovedRef = (0, react_4.useRef)(false);
83
+ // When kycEnabled is false (default), pre-approve so the KYC gate is skipped.
84
+ const kycApprovedRef = (0, react_4.useRef)(!kycEnabled);
84
85
  // Pre-warm wallet auth headers inside user-gesture context (button click)
85
86
  // so the signing prompt fires before we navigate away — browsers block
86
87
  // wallet popups triggered from async/non-gesture contexts (React Query queryFn).
@@ -66,4 +66,6 @@ export declare function AnySpend(props: {
66
66
  content?: AnySpendContent;
67
67
  /** Structured color/theme configuration */
68
68
  theme?: AnySpendTheme;
69
+ /** When true, shows a KYC gate before Stripe Web2 (credit card) payments. Default false. */
70
+ kycEnabled?: boolean;
69
71
  }): import("react/jsx-runtime").JSX.Element;
@@ -61,7 +61,7 @@ export function AnySpend(props) {
61
61
  const fingerprintConfig = getFingerprintConfig();
62
62
  return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomizationProvider, { slots: props.slots, content: props.content, theme: props.theme, children: _jsx(AnySpendInner, { ...props }) }) }));
63
63
  }
64
- function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, allowDirectTransfer = false, destinationTokenAmount, callbackMetadata, senderAddress, }) {
64
+ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, allowDirectTransfer = false, destinationTokenAmount, callbackMetadata, senderAddress, kycEnabled = false, }) {
65
65
  const { slots, content } = useAnySpendCustomization();
66
66
  const searchParams = useSearchParamsSSR();
67
67
  const router = useRouter();
@@ -73,7 +73,8 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
73
73
  // signature when the user actually clicks Buy, not on panel mount.
74
74
  // useRef so handleFiatOrder can read the updated value synchronously
75
75
  // in the same frame that onStatusResolved sets it (setState is async).
76
- const kycApprovedRef = useRef(false);
76
+ // When kycEnabled is false (default), pre-approve so the KYC gate is skipped.
77
+ const kycApprovedRef = useRef(!kycEnabled);
77
78
  // Pre-warm wallet auth headers inside user-gesture context (button click)
78
79
  // so the signing prompt fires before we navigate away — browsers block
79
80
  // wallet popups triggered from async/non-gesture contexts (React Query queryFn).
@@ -66,4 +66,6 @@ export declare function AnySpend(props: {
66
66
  content?: AnySpendContent;
67
67
  /** Structured color/theme configuration */
68
68
  theme?: AnySpendTheme;
69
+ /** When true, shows a KYC gate before Stripe Web2 (credit card) payments. Default false. */
70
+ kycEnabled?: boolean;
69
71
  }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.1.68-alpha.6",
3
+ "version": "0.1.68-alpha.7",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -147,6 +147,8 @@ export function AnySpend(props: {
147
147
  content?: AnySpendContent;
148
148
  /** Structured color/theme configuration */
149
149
  theme?: AnySpendTheme;
150
+ /** When true, shows a KYC gate before Stripe Web2 (credit card) payments. Default false. */
151
+ kycEnabled?: boolean;
150
152
  }) {
151
153
  const fingerprintConfig = getFingerprintConfig();
152
154
 
@@ -182,6 +184,7 @@ function AnySpendInner({
182
184
  destinationTokenAmount,
183
185
  callbackMetadata,
184
186
  senderAddress,
187
+ kycEnabled = false,
185
188
  }: {
186
189
  sourceChainId?: number;
187
190
  destinationTokenAddress?: string;
@@ -208,6 +211,7 @@ function AnySpendInner({
208
211
  slots?: AnySpendSlots;
209
212
  content?: AnySpendContent;
210
213
  theme?: AnySpendTheme;
214
+ kycEnabled?: boolean;
211
215
  }) {
212
216
  const { slots, content } = useAnySpendCustomization();
213
217
  const searchParams = useSearchParamsSSR();
@@ -221,7 +225,8 @@ function AnySpendInner({
221
225
  // signature when the user actually clicks Buy, not on panel mount.
222
226
  // useRef so handleFiatOrder can read the updated value synchronously
223
227
  // in the same frame that onStatusResolved sets it (setState is async).
224
- const kycApprovedRef = useRef(false);
228
+ // When kycEnabled is false (default), pre-approve so the KYC gate is skipped.
229
+ const kycApprovedRef = useRef(!kycEnabled);
225
230
  // Pre-warm wallet auth headers inside user-gesture context (button click)
226
231
  // so the signing prompt fires before we navigate away — browsers block
227
232
  // wallet popups triggered from async/non-gesture contexts (React Query queryFn).