@b3dotfun/sdk 0.1.68-alpha.0 → 0.1.68-alpha.10
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/platform/client.d.ts +35 -0
- package/dist/cjs/anyspend/platform/client.js +158 -0
- package/dist/cjs/anyspend/platform/errors.d.ts +38 -0
- package/dist/cjs/anyspend/platform/errors.js +77 -0
- package/dist/cjs/anyspend/platform/index.d.ts +87 -0
- package/dist/cjs/anyspend/platform/index.js +85 -0
- package/dist/cjs/anyspend/platform/resources/analytics.d.ts +7 -0
- package/dist/cjs/anyspend/platform/resources/analytics.js +12 -0
- package/dist/cjs/anyspend/platform/resources/checkout-sessions.d.ts +17 -0
- package/dist/cjs/anyspend/platform/resources/checkout-sessions.js +27 -0
- package/dist/cjs/anyspend/platform/resources/customers.d.ts +19 -0
- package/dist/cjs/anyspend/platform/resources/customers.js +34 -0
- package/dist/cjs/anyspend/platform/resources/discount-codes.d.ts +29 -0
- package/dist/cjs/anyspend/platform/resources/discount-codes.js +31 -0
- package/dist/cjs/anyspend/platform/resources/events.d.ts +14 -0
- package/dist/cjs/anyspend/platform/resources/events.js +16 -0
- package/dist/cjs/anyspend/platform/resources/notifications.d.ts +18 -0
- package/dist/cjs/anyspend/platform/resources/notifications.js +27 -0
- package/dist/cjs/anyspend/platform/resources/organization.d.ts +17 -0
- package/dist/cjs/anyspend/platform/resources/organization.js +15 -0
- package/dist/cjs/anyspend/platform/resources/payment-links.d.ts +21 -0
- package/dist/cjs/anyspend/platform/resources/payment-links.js +49 -0
- package/dist/cjs/anyspend/platform/resources/products.d.ts +27 -0
- package/dist/cjs/anyspend/platform/resources/products.js +31 -0
- package/dist/cjs/anyspend/platform/resources/transactions.d.ts +11 -0
- package/dist/cjs/anyspend/platform/resources/transactions.js +25 -0
- package/dist/cjs/anyspend/platform/resources/webhooks.d.ts +14 -0
- package/dist/cjs/anyspend/platform/resources/webhooks.js +33 -0
- package/dist/cjs/anyspend/platform/resources/widgets.d.ts +38 -0
- package/dist/cjs/anyspend/platform/resources/widgets.js +31 -0
- package/dist/cjs/anyspend/platform/types.d.ts +478 -0
- package/dist/cjs/anyspend/platform/types.js +5 -0
- package/dist/cjs/anyspend/platform/utils/idempotency.d.ts +4 -0
- package/dist/cjs/anyspend/platform/utils/idempotency.js +17 -0
- package/dist/cjs/anyspend/platform/utils/pagination.d.ts +12 -0
- package/dist/cjs/anyspend/platform/utils/pagination.js +22 -0
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +123 -12
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +14 -6
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +55 -8
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +1 -1
- package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.js +48 -16
- package/dist/cjs/anyspend/react/components/checkout/KycGate.d.ts +11 -0
- package/dist/cjs/anyspend/react/components/checkout/KycGate.js +203 -0
- package/dist/cjs/anyspend/react/components/checkout/VariablePricingInput.d.ts +17 -0
- package/dist/cjs/anyspend/react/components/checkout/VariablePricingInput.js +145 -0
- package/dist/cjs/anyspend/react/components/index.d.ts +1 -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/useAnyspendCreateOnrampOrder.d.ts +2 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +14 -0
- package/dist/cjs/anyspend/react/hooks/useKycStatus.d.ts +47 -0
- package/dist/cjs/anyspend/react/hooks/useKycStatus.js +124 -0
- package/dist/cjs/anyspend/services/anyspend.d.ts +4 -1
- package/dist/cjs/anyspend/services/anyspend.js +3 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +3 -3
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -5
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +21 -24
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
- package/dist/cjs/global-account/react/hooks/useAuth.js +1 -1
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +3 -1
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +82 -24
- package/dist/cjs/global-account/react/hooks/useGetAllTWSigners.js +2 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/cjs/global-account/react/stores/useModalStore.js +2 -0
- package/dist/cjs/global-account/react/utils/createWagmiConfig.d.ts +18 -0
- package/dist/cjs/global-account/react/utils/createWagmiConfig.js +17 -0
- package/dist/esm/anyspend/platform/client.d.ts +35 -0
- package/dist/esm/anyspend/platform/client.js +153 -0
- package/dist/esm/anyspend/platform/errors.d.ts +38 -0
- package/dist/esm/anyspend/platform/errors.js +67 -0
- package/dist/esm/anyspend/platform/index.d.ts +87 -0
- package/dist/esm/anyspend/platform/index.js +75 -0
- package/dist/esm/anyspend/platform/resources/analytics.d.ts +7 -0
- package/dist/esm/anyspend/platform/resources/analytics.js +8 -0
- package/dist/esm/anyspend/platform/resources/checkout-sessions.d.ts +17 -0
- package/dist/esm/anyspend/platform/resources/checkout-sessions.js +23 -0
- package/dist/esm/anyspend/platform/resources/customers.d.ts +19 -0
- package/dist/esm/anyspend/platform/resources/customers.js +30 -0
- package/dist/esm/anyspend/platform/resources/discount-codes.d.ts +29 -0
- package/dist/esm/anyspend/platform/resources/discount-codes.js +27 -0
- package/dist/esm/anyspend/platform/resources/events.d.ts +14 -0
- package/dist/esm/anyspend/platform/resources/events.js +12 -0
- package/dist/esm/anyspend/platform/resources/notifications.d.ts +18 -0
- package/dist/esm/anyspend/platform/resources/notifications.js +23 -0
- package/dist/esm/anyspend/platform/resources/organization.d.ts +17 -0
- package/dist/esm/anyspend/platform/resources/organization.js +11 -0
- package/dist/esm/anyspend/platform/resources/payment-links.d.ts +21 -0
- package/dist/esm/anyspend/platform/resources/payment-links.js +45 -0
- package/dist/esm/anyspend/platform/resources/products.d.ts +27 -0
- package/dist/esm/anyspend/platform/resources/products.js +27 -0
- package/dist/esm/anyspend/platform/resources/transactions.d.ts +11 -0
- package/dist/esm/anyspend/platform/resources/transactions.js +21 -0
- package/dist/esm/anyspend/platform/resources/webhooks.d.ts +14 -0
- package/dist/esm/anyspend/platform/resources/webhooks.js +29 -0
- package/dist/esm/anyspend/platform/resources/widgets.d.ts +38 -0
- package/dist/esm/anyspend/platform/resources/widgets.js +27 -0
- package/dist/esm/anyspend/platform/types.d.ts +478 -0
- package/dist/esm/anyspend/platform/types.js +4 -0
- package/dist/esm/anyspend/platform/utils/idempotency.d.ts +4 -0
- package/dist/esm/anyspend/platform/utils/idempotency.js +14 -0
- package/dist/esm/anyspend/platform/utils/pagination.d.ts +12 -0
- package/dist/esm/anyspend/platform/utils/pagination.js +19 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +5 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +124 -13
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +14 -6
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +55 -8
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +5 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +1 -1
- package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +5 -1
- package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.js +50 -18
- package/dist/esm/anyspend/react/components/checkout/KycGate.d.ts +11 -0
- package/dist/esm/anyspend/react/components/checkout/KycGate.js +167 -0
- package/dist/esm/anyspend/react/components/checkout/VariablePricingInput.d.ts +17 -0
- package/dist/esm/anyspend/react/components/checkout/VariablePricingInput.js +142 -0
- package/dist/esm/anyspend/react/components/index.d.ts +1 -1
- 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/useAnyspendCreateOnrampOrder.d.ts +2 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +14 -0
- package/dist/esm/anyspend/react/hooks/useKycStatus.d.ts +47 -0
- package/dist/esm/anyspend/react/hooks/useKycStatus.js +117 -0
- package/dist/esm/anyspend/services/anyspend.d.ts +4 -1
- package/dist/esm/anyspend/services/anyspend.js +3 -1
- package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -1
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +3 -3
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -5
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +21 -24
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
- package/dist/esm/global-account/react/hooks/useAuth.js +2 -2
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +3 -1
- package/dist/esm/global-account/react/hooks/useAuthentication.js +82 -24
- package/dist/esm/global-account/react/hooks/useGetAllTWSigners.js +2 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/esm/global-account/react/stores/useModalStore.js +2 -0
- package/dist/esm/global-account/react/utils/createWagmiConfig.d.ts +18 -0
- package/dist/esm/global-account/react/utils/createWagmiConfig.js +16 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/platform/client.d.ts +35 -0
- package/dist/types/anyspend/platform/errors.d.ts +38 -0
- package/dist/types/anyspend/platform/index.d.ts +87 -0
- package/dist/types/anyspend/platform/resources/analytics.d.ts +7 -0
- package/dist/types/anyspend/platform/resources/checkout-sessions.d.ts +17 -0
- package/dist/types/anyspend/platform/resources/customers.d.ts +19 -0
- package/dist/types/anyspend/platform/resources/discount-codes.d.ts +29 -0
- package/dist/types/anyspend/platform/resources/events.d.ts +14 -0
- package/dist/types/anyspend/platform/resources/notifications.d.ts +18 -0
- package/dist/types/anyspend/platform/resources/organization.d.ts +17 -0
- package/dist/types/anyspend/platform/resources/payment-links.d.ts +21 -0
- package/dist/types/anyspend/platform/resources/products.d.ts +27 -0
- package/dist/types/anyspend/platform/resources/transactions.d.ts +11 -0
- package/dist/types/anyspend/platform/resources/webhooks.d.ts +14 -0
- package/dist/types/anyspend/platform/resources/widgets.d.ts +38 -0
- package/dist/types/anyspend/platform/types.d.ts +478 -0
- package/dist/types/anyspend/platform/utils/idempotency.d.ts +4 -0
- package/dist/types/anyspend/platform/utils/pagination.d.ts +12 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +5 -1
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +14 -6
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +5 -1
- package/dist/types/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +5 -1
- package/dist/types/anyspend/react/components/checkout/KycGate.d.ts +11 -0
- package/dist/types/anyspend/react/components/checkout/VariablePricingInput.d.ts +17 -0
- package/dist/types/anyspend/react/components/index.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +2 -0
- package/dist/types/anyspend/react/hooks/useKycStatus.d.ts +47 -0
- package/dist/types/anyspend/services/anyspend.d.ts +4 -1
- package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStep.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +3 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/types/global-account/react/utils/createWagmiConfig.d.ts +18 -0
- package/package.json +7 -1
- package/src/anyspend/docs/checkout-sessions.md +20 -3
- package/src/anyspend/platform/client.ts +198 -0
- package/src/anyspend/platform/errors.ts +92 -0
- package/src/anyspend/platform/index.ts +129 -0
- package/src/anyspend/platform/resources/analytics.ts +10 -0
- package/src/anyspend/platform/resources/checkout-sessions.ts +36 -0
- package/src/anyspend/platform/resources/customers.ts +54 -0
- package/src/anyspend/platform/resources/discount-codes.ts +63 -0
- package/src/anyspend/platform/resources/events.ts +22 -0
- package/src/anyspend/platform/resources/notifications.ts +37 -0
- package/src/anyspend/platform/resources/organization.ts +24 -0
- package/src/anyspend/platform/resources/payment-links.ts +74 -0
- package/src/anyspend/platform/resources/products.ts +59 -0
- package/src/anyspend/platform/resources/transactions.ts +33 -0
- package/src/anyspend/platform/resources/webhooks.ts +47 -0
- package/src/anyspend/platform/resources/widgets.ts +63 -0
- package/src/anyspend/platform/types.ts +532 -0
- package/src/anyspend/platform/utils/idempotency.ts +15 -0
- package/src/anyspend/platform/utils/pagination.ts +32 -0
- package/src/anyspend/react/components/AnySpend.tsx +148 -14
- package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +81 -18
- package/src/anyspend/react/components/checkout/AnySpendCheckoutTrigger.tsx +4 -0
- package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +8 -0
- package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +4 -13
- package/src/anyspend/react/components/checkout/FiatCheckoutPanel.tsx +86 -17
- package/src/anyspend/react/components/checkout/KycGate.tsx +387 -0
- package/src/anyspend/react/components/checkout/VariablePricingInput.tsx +247 -0
- package/src/anyspend/react/components/index.ts +1 -0
- package/src/anyspend/react/hooks/index.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +17 -0
- package/src/anyspend/react/hooks/useKycStatus.ts +150 -0
- package/src/anyspend/services/anyspend.ts +7 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +0 -2
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +7 -7
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +1 -1
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +13 -5
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +1 -1
- package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +35 -25
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +1 -1
- package/src/global-account/react/hooks/useAuth.ts +2 -2
- package/src/global-account/react/hooks/useAuthentication.ts +80 -27
- package/src/global-account/react/hooks/useGetAllTWSigners.tsx +2 -1
- package/src/global-account/react/stores/useModalStore.ts +6 -0
- package/src/global-account/react/utils/createWagmiConfig.tsx +18 -0
|
@@ -9,16 +9,26 @@ const cn_1 = require("../../../../shared/utils/cn");
|
|
|
9
9
|
const number_1 = require("../../../../shared/utils/number");
|
|
10
10
|
const payment_utils_1 = require("../../../../shared/utils/payment.utils");
|
|
11
11
|
const react_2 = require("../../../../global-account/react");
|
|
12
|
+
const b3Chain_1 = require("../../../../shared/constants/chains/b3Chain");
|
|
12
13
|
const react_stripe_js_1 = require("@stripe/react-stripe-js");
|
|
13
14
|
const lucide_react_1 = require("lucide-react");
|
|
14
15
|
const react_3 = require("motion/react");
|
|
15
16
|
const react_4 = require("react");
|
|
16
|
-
|
|
17
|
+
const wagmi_1 = require("wagmi");
|
|
18
|
+
const KycGate_1 = require("./KycGate");
|
|
19
|
+
function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, themeColor, onSuccess, onOrderCreated, onError, callbackMetadata, classes, feeOnTop, kycEnabled = false, }) {
|
|
17
20
|
// Stable refs for callback props to avoid re-triggering effects
|
|
18
21
|
const onErrorRef = (0, react_4.useRef)(onError);
|
|
19
22
|
onErrorRef.current = onError;
|
|
23
|
+
const { address } = (0, wagmi_1.useAccount)();
|
|
24
|
+
const setB3ModalOpen = (0, react_2.useModalStore)(state => state.setB3ModalOpen);
|
|
25
|
+
const setB3ModalContentType = (0, react_2.useModalStore)(state => state.setB3ModalContentType);
|
|
20
26
|
const { data: tokenData } = (0, react_2.useTokenData)(destinationTokenChainId, destinationTokenAddress);
|
|
21
|
-
const { theme, stripePublishableKey } = (0, react_2.useB3Config)();
|
|
27
|
+
const { theme, stripePublishableKey, partnerId } = (0, react_2.useB3Config)();
|
|
28
|
+
const handleConnectWallet = (0, react_4.useCallback)(() => {
|
|
29
|
+
setB3ModalContentType({ type: "signInWithB3", showBackButton: false, chain: b3Chain_1.thirdwebB3Chain, partnerId });
|
|
30
|
+
setB3ModalOpen(true);
|
|
31
|
+
}, [setB3ModalContentType, setB3ModalOpen, partnerId]);
|
|
22
32
|
// Clean decimal string for API calls (no commas, no subscripts)
|
|
23
33
|
const formattedAmount = (0, react_4.useMemo)(() => {
|
|
24
34
|
const decimals = tokenData?.decimals || 18;
|
|
@@ -51,18 +61,12 @@ function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinat
|
|
|
51
61
|
const raw = (0, number_1.formatUnits)(anyspendQuote.data.currencyIn.amount, constants_1.USDC_BASE.decimals);
|
|
52
62
|
return parseFloat(raw).toFixed(2);
|
|
53
63
|
}, [isStablecoin, formattedAmount, anyspendQuote]);
|
|
54
|
-
// Debug: log computed values for Stripe flow diagnostics
|
|
55
|
-
(0, react_4.useEffect)(() => {
|
|
56
|
-
console.log("@@fiat-checkout:debug", {
|
|
57
|
-
totalAmount,
|
|
58
|
-
formattedAmount,
|
|
59
|
-
isStablecoin,
|
|
60
|
-
isLoadingAnyspendQuote,
|
|
61
|
-
quoteAmount: anyspendQuote?.data?.currencyIn?.amount,
|
|
62
|
-
usdAmount,
|
|
63
|
-
});
|
|
64
|
-
}, [totalAmount, formattedAmount, isStablecoin, isLoadingAnyspendQuote, anyspendQuote, usdAmount]);
|
|
65
64
|
const { geoData, stripeOnrampSupport, stripeWeb2Support, isLoading: isLoadingGeo, } = (0, react_1.useGeoOnrampOptions)(usdAmount || "0");
|
|
65
|
+
// KYC state — pre-approved when kycEnabled is false (feature flag off)
|
|
66
|
+
const [kycApproved, setKycApproved] = (0, react_4.useState)(() => !kycEnabled);
|
|
67
|
+
const handleKycResolved = (0, react_4.useCallback)((approved) => {
|
|
68
|
+
setKycApproved(approved);
|
|
69
|
+
}, []);
|
|
66
70
|
// Order state
|
|
67
71
|
const [orderId, setOrderId] = (0, react_4.useState)(null);
|
|
68
72
|
const [stripePaymentIntentId, setStripePaymentIntentId] = (0, react_4.useState)(null);
|
|
@@ -81,17 +85,33 @@ function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinat
|
|
|
81
85
|
}
|
|
82
86
|
},
|
|
83
87
|
onError: (error) => {
|
|
84
|
-
|
|
88
|
+
// Backend requires KYC even when kycEnabled=false — reset to show KycGate
|
|
89
|
+
if (error.message?.includes("KYC verification required")) {
|
|
90
|
+
setKycApproved(false);
|
|
91
|
+
orderCreatedRef.current = false;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
setOrderError(error.message || "Failed to create payment order.");
|
|
95
|
+
}
|
|
85
96
|
onErrorRef.current?.(error);
|
|
86
97
|
},
|
|
87
98
|
});
|
|
88
|
-
//
|
|
99
|
+
// Reset order error when wallet connects so the user gets a clean state
|
|
89
100
|
(0, react_4.useEffect)(() => {
|
|
90
|
-
if (
|
|
101
|
+
if (address && orderError) {
|
|
102
|
+
setOrderError(null);
|
|
103
|
+
orderCreatedRef.current = false;
|
|
104
|
+
}
|
|
105
|
+
}, [address]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
106
|
+
// Auto-create onramp order when Stripe Web2 is supported, KYC approved, and all data is ready
|
|
107
|
+
(0, react_4.useEffect)(() => {
|
|
108
|
+
if (address &&
|
|
109
|
+
!isLoadingGeo &&
|
|
91
110
|
(!isStablecoin ? !isLoadingAnyspendQuote : true) &&
|
|
92
111
|
usdAmount &&
|
|
93
112
|
parseFloat(usdAmount) > 0 &&
|
|
94
113
|
stripeWeb2Support?.isSupport &&
|
|
114
|
+
kycApproved &&
|
|
95
115
|
!orderCreatedRef.current &&
|
|
96
116
|
!orderId &&
|
|
97
117
|
!isCreatingOrder &&
|
|
@@ -123,14 +143,17 @@ function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinat
|
|
|
123
143
|
},
|
|
124
144
|
expectedDstAmount: totalAmount,
|
|
125
145
|
callbackMetadata,
|
|
146
|
+
feeOnTop,
|
|
126
147
|
});
|
|
127
148
|
}
|
|
128
149
|
}, [
|
|
150
|
+
address,
|
|
129
151
|
isLoadingGeo,
|
|
130
152
|
isStablecoin,
|
|
131
153
|
isLoadingAnyspendQuote,
|
|
132
154
|
usdAmount,
|
|
133
155
|
stripeWeb2Support,
|
|
156
|
+
kycApproved,
|
|
134
157
|
orderId,
|
|
135
158
|
isCreatingOrder,
|
|
136
159
|
orderError,
|
|
@@ -142,6 +165,7 @@ function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinat
|
|
|
142
165
|
geoData,
|
|
143
166
|
callbackMetadata,
|
|
144
167
|
createOrder,
|
|
168
|
+
feeOnTop,
|
|
145
169
|
]);
|
|
146
170
|
// Loading geo/stripe support check (and quote for non-stablecoins)
|
|
147
171
|
if (isLoadingGeo || (!isStablecoin && isLoadingAnyspendQuote)) {
|
|
@@ -153,6 +177,14 @@ function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinat
|
|
|
153
177
|
if (!hasStripeWeb2 && !hasStripeRedirect) {
|
|
154
178
|
return ((0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-fiat-unavailable py-4 text-center", classes?.fiatPanel), children: (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Card payments are not available in your region for this amount." }) }));
|
|
155
179
|
}
|
|
180
|
+
// KYC gate — shown before order creation when verification is needed
|
|
181
|
+
if (!kycApproved) {
|
|
182
|
+
return (0, jsx_runtime_1.jsx)(KycGate_1.KycGate, { themeColor: themeColor, classes: classes, enabled: true, onStatusResolved: handleKycResolved });
|
|
183
|
+
}
|
|
184
|
+
// No wallet connected — prompt to connect before attempting card payment
|
|
185
|
+
if (!address) {
|
|
186
|
+
return ((0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-fiat-connect flex flex-col items-center gap-4 py-2", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-8 w-8 text-gray-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Connect wallet to pay with card" }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-xs text-gray-500 dark:text-gray-400", children: "A wallet connection is required to complete card payment." })] }), (0, jsx_runtime_1.jsx)(react_2.ShinyButton, { accentColor: themeColor || "hsl(var(--as-brand))", className: "w-full", textClassName: "text-white", onClick: handleConnectWallet, children: (0, jsx_runtime_1.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-4 w-4" }), "Connect Wallet"] }) })] }));
|
|
187
|
+
}
|
|
156
188
|
// Order creation error - show with retry
|
|
157
189
|
if (orderError) {
|
|
158
190
|
return ((0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-fiat-error flex flex-col items-center gap-3 py-4", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm text-red-500", children: orderError }), (0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
2
|
+
interface KycGateProps {
|
|
3
|
+
themeColor?: string;
|
|
4
|
+
classes?: AnySpendCheckoutClasses;
|
|
5
|
+
/** Only fetch KYC status (and prompt wallet signature) when true. */
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
/** Called when KYC status is resolved (approved or not required) */
|
|
8
|
+
onStatusResolved: (approved: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function KycGate({ themeColor, classes, enabled, onStatusResolved }: KycGateProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.KycGate = KycGate;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const cn_1 = require("../../../../shared/utils/cn");
|
|
40
|
+
const react_1 = require("../../../../global-account/react");
|
|
41
|
+
const b3Chain_1 = require("../../../../shared/constants/chains/b3Chain");
|
|
42
|
+
const lucide_react_1 = require("lucide-react");
|
|
43
|
+
const react_2 = require("motion/react");
|
|
44
|
+
const react_3 = require("react");
|
|
45
|
+
const wagmi_1 = require("wagmi");
|
|
46
|
+
const useKycStatus_1 = require("../../hooks/useKycStatus");
|
|
47
|
+
function KycGate({ themeColor, classes, enabled = false, onStatusResolved }) {
|
|
48
|
+
const { address } = (0, wagmi_1.useAccount)();
|
|
49
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
50
|
+
// Gate the status fetch behind explicit user consent so the wallet
|
|
51
|
+
// signature prompt doesn't fire automatically on tab open.
|
|
52
|
+
const [userInitiated, setUserInitiated] = (0, react_3.useState)(false);
|
|
53
|
+
const { getHeaders: preCacheKycHeaders } = (0, useKycStatus_1.useWalletAuthHeaders)();
|
|
54
|
+
const { kycStatus, isLoadingKycStatus, refetchKycStatus } = (0, useKycStatus_1.useKycStatus)(enabled && userInitiated);
|
|
55
|
+
const { createInquiry, isCreatingInquiry } = (0, useKycStatus_1.useCreateKycInquiry)();
|
|
56
|
+
const { verifyKyc, isVerifying } = (0, useKycStatus_1.useVerifyKyc)();
|
|
57
|
+
const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
|
|
58
|
+
const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
|
|
59
|
+
const [personaOpen, setPersonaOpen] = (0, react_3.useState)(false);
|
|
60
|
+
const [personaError, setPersonaError] = (0, react_3.useState)(null);
|
|
61
|
+
const [personaCancelled, setPersonaCancelled] = (0, react_3.useState)(false);
|
|
62
|
+
const prevStatusRef = (0, react_3.useRef)(null);
|
|
63
|
+
// Reset consent gate when wallet changes so the signature prompt isn't
|
|
64
|
+
// skipped for a different (or reconnected) wallet with no cached headers.
|
|
65
|
+
(0, react_3.useEffect)(() => {
|
|
66
|
+
setUserInitiated(false);
|
|
67
|
+
}, [address]);
|
|
68
|
+
// Notify parent when status resolves
|
|
69
|
+
(0, react_3.useEffect)(() => {
|
|
70
|
+
if (!kycStatus)
|
|
71
|
+
return;
|
|
72
|
+
const currentStatus = kycStatus.status;
|
|
73
|
+
if (currentStatus === prevStatusRef.current)
|
|
74
|
+
return;
|
|
75
|
+
prevStatusRef.current = currentStatus;
|
|
76
|
+
if (!kycStatus.kycRequired || currentStatus === "approved") {
|
|
77
|
+
onStatusResolved(true);
|
|
78
|
+
}
|
|
79
|
+
}, [kycStatus, onStatusResolved]);
|
|
80
|
+
const openPersonaFlow = (0, react_3.useCallback)(async (config) => {
|
|
81
|
+
setPersonaOpen(true);
|
|
82
|
+
try {
|
|
83
|
+
// Dynamic import to keep bundle small
|
|
84
|
+
const { Client } = await Promise.resolve().then(() => __importStar(require("persona")));
|
|
85
|
+
const client = new Client({
|
|
86
|
+
inquiryId: config.inquiryId,
|
|
87
|
+
sessionToken: config.sessionToken,
|
|
88
|
+
environment: config.environment === "production" ? "production" : "sandbox",
|
|
89
|
+
onComplete: async ({ inquiryId }) => {
|
|
90
|
+
// Reopen the modal first so the user lands back in the checkout flow
|
|
91
|
+
setB3ModalOpen(true);
|
|
92
|
+
setPersonaOpen(false);
|
|
93
|
+
if (inquiryId) {
|
|
94
|
+
try {
|
|
95
|
+
const result = await verifyKyc(inquiryId);
|
|
96
|
+
if (result.status === "approved") {
|
|
97
|
+
onStatusResolved(true);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
setPersonaError(err instanceof Error ? err.message : "Verification check failed — please retry.");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
refetchKycStatus();
|
|
105
|
+
},
|
|
106
|
+
onCancel: () => {
|
|
107
|
+
// Reopen the modal so the user can retry or cancel the purchase
|
|
108
|
+
setB3ModalOpen(true);
|
|
109
|
+
setPersonaOpen(false);
|
|
110
|
+
setPersonaCancelled(true);
|
|
111
|
+
},
|
|
112
|
+
onError: error => {
|
|
113
|
+
// Reopen the modal so the user sees the error and can retry
|
|
114
|
+
setB3ModalOpen(true);
|
|
115
|
+
setPersonaOpen(false);
|
|
116
|
+
setPersonaError(error?.message || "Verification encountered an error");
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
// Close the modal before opening Persona so its overlay is fully
|
|
120
|
+
// interactive — no Radix Dialog backdrop or z-index conflicts.
|
|
121
|
+
// The modal's contentType is preserved in Zustand and restored on reopen.
|
|
122
|
+
setB3ModalOpen(false);
|
|
123
|
+
client.open();
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
setPersonaOpen(false);
|
|
127
|
+
setB3ModalOpen(true);
|
|
128
|
+
setPersonaError("Failed to load verification module");
|
|
129
|
+
}
|
|
130
|
+
}, [verifyKyc, onStatusResolved, refetchKycStatus, setB3ModalOpen]);
|
|
131
|
+
const handleStartVerification = (0, react_3.useCallback)(async () => {
|
|
132
|
+
setPersonaError(null);
|
|
133
|
+
setPersonaCancelled(false);
|
|
134
|
+
try {
|
|
135
|
+
const { inquiryId, sessionToken } = await createInquiry();
|
|
136
|
+
openPersonaFlow({
|
|
137
|
+
inquiryId,
|
|
138
|
+
sessionToken,
|
|
139
|
+
environment: kycStatus?.config?.environment,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
setPersonaError(error instanceof Error ? error.message : "Failed to start verification");
|
|
144
|
+
}
|
|
145
|
+
}, [createInquiry, kycStatus, openPersonaFlow]);
|
|
146
|
+
const handleConnectWallet = (0, react_3.useCallback)(() => {
|
|
147
|
+
setB3ModalContentType({ type: "signInWithB3", showBackButton: false, chain: b3Chain_1.thirdwebB3Chain, partnerId });
|
|
148
|
+
setB3ModalOpen(true);
|
|
149
|
+
}, [setB3ModalContentType, setB3ModalOpen, partnerId]);
|
|
150
|
+
const handleResumeVerification = (0, react_3.useCallback)(() => {
|
|
151
|
+
if (!kycStatus?.inquiry)
|
|
152
|
+
return;
|
|
153
|
+
setPersonaError(null);
|
|
154
|
+
setPersonaCancelled(false);
|
|
155
|
+
openPersonaFlow({
|
|
156
|
+
inquiryId: kycStatus.inquiry.inquiryId,
|
|
157
|
+
sessionToken: kycStatus.inquiry.sessionToken,
|
|
158
|
+
environment: kycStatus.config?.environment,
|
|
159
|
+
});
|
|
160
|
+
}, [kycStatus, openPersonaFlow]);
|
|
161
|
+
// No wallet connected — prompt to connect wallet (same pattern as crypto tab)
|
|
162
|
+
if (!address) {
|
|
163
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-kyc-auth flex flex-col items-center gap-4 py-2", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ShieldCheck, { className: "h-8 w-8 text-gray-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Connect wallet to pay with card" }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-xs text-gray-500 dark:text-gray-400", children: "A wallet connection is required to complete identity verification." })] }), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: themeColor || "hsl(var(--as-brand))", className: "w-full", textClassName: "text-white", onClick: handleConnectWallet, children: (0, jsx_runtime_1.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-4 w-4" }), "Connect Wallet"] }) })] }));
|
|
164
|
+
}
|
|
165
|
+
// Wallet connected but user hasn't kicked off the KYC check yet
|
|
166
|
+
if (!userInitiated) {
|
|
167
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-kyc-prompt flex flex-col items-center gap-4 py-2", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ShieldCheck, { className: "h-8 w-8 text-blue-500" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Identity verification required" }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-xs text-gray-500 dark:text-gray-400", children: "Card payments require a one-time identity check. This takes about 2 minutes." })] }), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: themeColor || "hsl(var(--as-brand))", className: "w-full", textClassName: "text-white", onClick: async () => {
|
|
168
|
+
// Pre-sign in user-gesture context so React Query's queryFn
|
|
169
|
+
// can reuse the cached headers without a second popup.
|
|
170
|
+
// Only enable the query on success — if the user rejects the
|
|
171
|
+
// signature, leave userInitiated=false and stay on this screen.
|
|
172
|
+
try {
|
|
173
|
+
await preCacheKycHeaders();
|
|
174
|
+
setUserInitiated(true);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// User rejected signature — stay on consent screen
|
|
178
|
+
}
|
|
179
|
+
}, children: (0, jsx_runtime_1.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ShieldCheck, { className: "h-4 w-4" }), "Continue to Verify"] }) })] }));
|
|
180
|
+
}
|
|
181
|
+
// Loading KYC status state
|
|
182
|
+
if (isLoadingKycStatus) {
|
|
183
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.2, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-kyc-loading flex flex-col items-center gap-3 py-6", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-5 w-5 animate-spin text-gray-400" }), (0, jsx_runtime_1.jsx)(react_1.TextShimmer, { duration: 1.5, className: "text-sm", children: "Checking verification status..." })] }));
|
|
184
|
+
}
|
|
185
|
+
// Not required or already approved — render nothing
|
|
186
|
+
if (!kycStatus?.kycRequired || kycStatus.status === "approved") {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
// Persona flow is open - show loading
|
|
190
|
+
if (personaOpen) {
|
|
191
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.2, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-kyc-persona flex flex-col items-center gap-3 py-6", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-5 w-5 animate-spin text-gray-400" }), (0, jsx_runtime_1.jsx)(react_1.TextShimmer, { duration: 1.5, className: "text-sm", children: "Identity verification in progress..." }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-gray-400 dark:text-gray-500", children: "Complete the verification in the popup window" })] }));
|
|
192
|
+
}
|
|
193
|
+
// Needs review or completed (submitted, awaiting Persona decision)
|
|
194
|
+
if (kycStatus.status === "needs_review" || kycStatus.status === "completed") {
|
|
195
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-kyc-review flex flex-col items-center gap-3 py-2", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "h-8 w-8 text-amber-500" }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-sm font-medium text-amber-700 dark:text-amber-300", children: "Your verification is under review" }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-xs text-amber-600 dark:text-amber-400", children: "This usually takes a few minutes. Please check back shortly." }), (0, jsx_runtime_1.jsx)("button", { onClick: () => refetchKycStatus(), className: "mt-1 text-sm font-medium text-amber-700 underline hover:text-amber-800 dark:text-amber-300", children: "Check status" })] }));
|
|
196
|
+
}
|
|
197
|
+
// Pending (started before) - offer resume
|
|
198
|
+
if (kycStatus.status === "pending" && kycStatus.inquiry) {
|
|
199
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-kyc-resume flex flex-col items-center gap-4 py-2", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ShieldCheck, { className: "h-8 w-8 text-blue-500" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Continue verification" }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-xs text-gray-500 dark:text-gray-400", children: "You have an incomplete verification. Resume to continue." })] }), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: themeColor || "hsl(var(--as-brand))", className: "w-full", textClassName: "text-white", onClick: handleResumeVerification, disabled: isCreatingInquiry, children: (0, jsx_runtime_1.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [isCreatingInquiry ? (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.ShieldCheck, { className: "h-4 w-4" }), "Resume Verification"] }) })] }));
|
|
200
|
+
}
|
|
201
|
+
// Not verified / declined / expired - show verification prompt
|
|
202
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25, ease: "easeOut" }, className: (0, cn_1.cn)("anyspend-kyc-prompt flex flex-col items-center gap-4 py-2", classes?.fiatPanel), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ShieldCheck, { className: "h-8 w-8 text-blue-500" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Identity verification required" }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-xs text-gray-500 dark:text-gray-400", children: "Card payments require a one-time identity check. This takes about 2 minutes." })] }), (0, jsx_runtime_1.jsxs)(react_2.AnimatePresence, { initial: false, children: [personaError && ((0, jsx_runtime_1.jsx)(react_2.motion.div, { initial: { opacity: 0, height: 0 }, animate: { opacity: 1, height: "auto" }, exit: { opacity: 0, height: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, className: "w-full rounded-lg border border-red-200 bg-red-50 px-3 py-2 dark:border-red-800 dark:bg-red-900/20", children: (0, jsx_runtime_1.jsx)("p", { className: "text-center text-sm text-red-600 dark:text-red-400", children: personaError }) }, "kyc-error")), personaCancelled && ((0, jsx_runtime_1.jsx)(react_2.motion.div, { initial: { opacity: 0, height: 0 }, animate: { opacity: 1, height: "auto" }, exit: { opacity: 0, height: 0 }, transition: { duration: 0.2, ease: "easeOut" }, style: { overflow: "hidden" }, className: "w-full rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 dark:border-amber-800 dark:bg-amber-900/20", children: (0, jsx_runtime_1.jsx)("p", { className: "text-center text-sm text-amber-600 dark:text-amber-400", children: "Verification cancelled. Click below to try again." }) }, "kyc-cancelled"))] }), kycStatus.status === "declined" && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 rounded-lg border border-red-200 bg-red-50 px-3 py-2 dark:border-red-800 dark:bg-red-900/20", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertTriangle, { className: "h-3.5 w-3.5 text-red-500" }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-red-600 dark:text-red-400", children: "Previous verification was declined. You may try again." })] })), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: themeColor || "hsl(var(--as-brand))", className: "w-full", textClassName: "text-white", onClick: handleStartVerification, disabled: isCreatingInquiry || isVerifying, children: (0, jsx_runtime_1.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [isCreatingInquiry ? (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.ShieldCheck, { className: "h-4 w-4" }), isCreatingInquiry ? "Starting..." : "Verify Identity"] }) })] }));
|
|
203
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface VariablePricingConfig {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
minAmount?: string;
|
|
4
|
+
maxAmount?: string;
|
|
5
|
+
suggestedAmount?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
currency?: string;
|
|
8
|
+
}
|
|
9
|
+
interface VariablePricingInputProps {
|
|
10
|
+
config: VariablePricingConfig;
|
|
11
|
+
tokenDecimals: number;
|
|
12
|
+
tokenSymbol: string;
|
|
13
|
+
themeColor?: string;
|
|
14
|
+
onChange: (amountWei: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function VariablePricingInput({ config, tokenDecimals, tokenSymbol, themeColor, onChange, }: VariablePricingInputProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.VariablePricingInput = VariablePricingInput;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const cn_1 = require("../../../../shared/utils/cn");
|
|
7
|
+
const number_1 = require("../../../../shared/utils/number");
|
|
8
|
+
const react_1 = require("motion/react");
|
|
9
|
+
const react_2 = require("react");
|
|
10
|
+
function VariablePricingInput({ config, tokenDecimals, tokenSymbol, themeColor, onChange, }) {
|
|
11
|
+
const currency = config.currency || tokenSymbol;
|
|
12
|
+
// Convert suggested amount from wei to display
|
|
13
|
+
const initialValue = (0, react_2.useMemo)(() => {
|
|
14
|
+
if (config.suggestedAmount) {
|
|
15
|
+
try {
|
|
16
|
+
return (0, number_1.formatUnits)(config.suggestedAmount, tokenDecimals);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return "";
|
|
23
|
+
}, [config.suggestedAmount, tokenDecimals]);
|
|
24
|
+
const [displayValue, setDisplayValue] = (0, react_2.useState)(initialValue);
|
|
25
|
+
const [error, setError] = (0, react_2.useState)(null);
|
|
26
|
+
// Min/max in display units
|
|
27
|
+
const minDisplay = (0, react_2.useMemo)(() => {
|
|
28
|
+
if (!config.minAmount)
|
|
29
|
+
return null;
|
|
30
|
+
try {
|
|
31
|
+
return parseFloat((0, number_1.formatUnits)(config.minAmount, tokenDecimals));
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}, [config.minAmount, tokenDecimals]);
|
|
37
|
+
const maxDisplay = (0, react_2.useMemo)(() => {
|
|
38
|
+
if (!config.maxAmount)
|
|
39
|
+
return null;
|
|
40
|
+
try {
|
|
41
|
+
return parseFloat((0, number_1.formatUnits)(config.maxAmount, tokenDecimals));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}, [config.maxAmount, tokenDecimals]);
|
|
47
|
+
// Preset amounts
|
|
48
|
+
const presetAmounts = (0, react_2.useMemo)(() => {
|
|
49
|
+
const presets = [];
|
|
50
|
+
if (config.suggestedAmount) {
|
|
51
|
+
try {
|
|
52
|
+
const suggested = parseFloat((0, number_1.formatUnits)(config.suggestedAmount, tokenDecimals));
|
|
53
|
+
const candidates = [suggested / 2, suggested, suggested * 2];
|
|
54
|
+
for (const val of candidates) {
|
|
55
|
+
if (val <= 0)
|
|
56
|
+
continue;
|
|
57
|
+
if (minDisplay !== null && val < minDisplay)
|
|
58
|
+
continue;
|
|
59
|
+
if (maxDisplay !== null && val > maxDisplay)
|
|
60
|
+
continue;
|
|
61
|
+
const display = val % 1 === 0 ? val.toString() : val.toFixed(2);
|
|
62
|
+
presets.push({ label: `${display}`, value: display });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// skip presets
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return presets;
|
|
70
|
+
}, [config.suggestedAmount, tokenDecimals, minDisplay, maxDisplay]);
|
|
71
|
+
const validate = (0, react_2.useCallback)((value) => {
|
|
72
|
+
const parsed = parseFloat(value);
|
|
73
|
+
if (!value || isNaN(parsed))
|
|
74
|
+
return "Please enter a valid number";
|
|
75
|
+
if (parsed <= 0)
|
|
76
|
+
return "Please enter an amount";
|
|
77
|
+
if (minDisplay !== null && parsed < minDisplay) {
|
|
78
|
+
const display = minDisplay % 1 === 0 ? minDisplay.toString() : minDisplay.toFixed(2);
|
|
79
|
+
return `Minimum amount is ${display} ${currency}`;
|
|
80
|
+
}
|
|
81
|
+
if (maxDisplay !== null && parsed > maxDisplay) {
|
|
82
|
+
const display = maxDisplay % 1 === 0 ? maxDisplay.toString() : maxDisplay.toFixed(2);
|
|
83
|
+
return `Maximum amount is ${display} ${currency}`;
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}, [minDisplay, maxDisplay, currency]);
|
|
87
|
+
const convertToWei = (0, react_2.useCallback)((value) => {
|
|
88
|
+
try {
|
|
89
|
+
const [whole, frac = ""] = value.split(".");
|
|
90
|
+
const paddedFrac = frac.padEnd(tokenDecimals, "0").slice(0, tokenDecimals);
|
|
91
|
+
const factor = BigInt(10) ** BigInt(tokenDecimals);
|
|
92
|
+
return (BigInt(whole || "0") * factor + BigInt(paddedFrac)).toString();
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return "0";
|
|
96
|
+
}
|
|
97
|
+
}, [tokenDecimals]);
|
|
98
|
+
const handleChange = (0, react_2.useCallback)((value) => {
|
|
99
|
+
setDisplayValue(value);
|
|
100
|
+
const validationError = validate(value);
|
|
101
|
+
setError(validationError);
|
|
102
|
+
if (!validationError && value && parseFloat(value) > 0) {
|
|
103
|
+
onChange(convertToWei(value));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
onChange("0");
|
|
107
|
+
}
|
|
108
|
+
}, [validate, convertToWei, onChange]);
|
|
109
|
+
const handlePresetClick = (0, react_2.useCallback)((value) => {
|
|
110
|
+
setDisplayValue(value);
|
|
111
|
+
setError(null);
|
|
112
|
+
onChange(convertToWei(value));
|
|
113
|
+
}, [convertToWei, onChange]);
|
|
114
|
+
// Notify parent with initial value on mount
|
|
115
|
+
(0, react_2.useEffect)(() => {
|
|
116
|
+
if (initialValue && !validate(initialValue)) {
|
|
117
|
+
onChange(convertToWei(initialValue));
|
|
118
|
+
}
|
|
119
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
120
|
+
}, []);
|
|
121
|
+
const formatHint = () => {
|
|
122
|
+
if (minDisplay !== null && maxDisplay !== null) {
|
|
123
|
+
const minStr = minDisplay % 1 === 0 ? minDisplay.toString() : minDisplay.toFixed(2);
|
|
124
|
+
const maxStr = maxDisplay % 1 === 0 ? maxDisplay.toString() : maxDisplay.toFixed(2);
|
|
125
|
+
return `${minStr} – ${maxStr} ${currency}`;
|
|
126
|
+
}
|
|
127
|
+
if (minDisplay !== null) {
|
|
128
|
+
const minStr = minDisplay % 1 === 0 ? minDisplay.toString() : minDisplay.toFixed(2);
|
|
129
|
+
return `Min: ${minStr} ${currency}`;
|
|
130
|
+
}
|
|
131
|
+
if (maxDisplay !== null) {
|
|
132
|
+
const maxStr = maxDisplay % 1 === 0 ? maxDisplay.toString() : maxDisplay.toFixed(2);
|
|
133
|
+
return `Max: ${maxStr} ${currency}`;
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
};
|
|
137
|
+
const hint = formatHint();
|
|
138
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-variable-pricing mb-6", children: [(0, jsx_runtime_1.jsx)("label", { htmlFor: "variable-pricing-amount", className: "mb-3 block text-lg font-semibold text-gray-900 dark:text-gray-100", children: config.label || "Enter amount" }), presetAmounts.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: presetAmounts.map(preset => ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => handlePresetClick(preset.value), className: (0, cn_1.cn)("rounded-full border px-4 py-2 text-sm font-medium transition-colors", displayValue === preset.value
|
|
139
|
+
? "border-transparent text-white"
|
|
140
|
+
: "border-gray-200 text-gray-700 hover:bg-gray-50 dark:border-neutral-600 dark:text-gray-300 dark:hover:bg-neutral-800"), style: displayValue === preset.value ? { backgroundColor: themeColor || "hsl(var(--as-brand))" } : undefined, children: [preset.label, " ", currency] }, preset.value))) })), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsx)("input", { id: "variable-pricing-amount", type: "text", inputMode: "decimal", value: displayValue, onChange: e => {
|
|
141
|
+
// Normalize comma decimal separators for locale compatibility
|
|
142
|
+
const normalized = e.target.value.replace(",", ".");
|
|
143
|
+
handleChange(normalized);
|
|
144
|
+
}, className: "w-full rounded-xl border border-gray-200 bg-gray-50 px-4 py-3.5 pr-16 text-lg font-semibold text-gray-900 placeholder:text-gray-300 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:border-neutral-600 dark:bg-neutral-800 dark:text-gray-100 dark:placeholder:text-neutral-600 dark:focus:border-blue-400", placeholder: "0.00" }), (0, jsx_runtime_1.jsx)("span", { className: "absolute right-4 top-1/2 -translate-y-1/2 text-sm font-medium text-gray-400 dark:text-gray-500", children: currency })] }), hint && (0, jsx_runtime_1.jsx)("p", { className: "mt-1.5 text-xs text-gray-500 dark:text-gray-400", children: hint }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { initial: false, children: error && ((0, jsx_runtime_1.jsx)(react_1.motion.p, { initial: { opacity: 0, height: 0 }, animate: { opacity: 1, height: "auto" }, exit: { opacity: 0, height: 0 }, transition: { duration: 0.15, ease: "easeOut" }, className: "mt-1.5 text-sm text-red-500", children: error }, "variable-price-error")) })] }));
|
|
145
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AnySpendCheckout } from "./checkout/AnySpendCheckout";
|
|
2
|
-
export type { AnySpendCheckoutProps, CheckoutItem, CheckoutSummaryLine, AnySpendCheckoutClasses, CheckoutFormSchema, CheckoutFormComponentProps, ShippingOption, DiscountResult, AddressData, } from "./checkout/AnySpendCheckout";
|
|
2
|
+
export type { AnySpendCheckoutProps, CheckoutItem, CheckoutSummaryLine, AnySpendCheckoutClasses, CheckoutFormSchema, CheckoutFormComponentProps, ShippingOption, DiscountResult, AddressData, VariablePricingConfig, } from "./checkout/AnySpendCheckout";
|
|
3
3
|
export { AnySpendCheckoutTrigger } from "./checkout/AnySpendCheckoutTrigger";
|
|
4
4
|
export type { AnySpendCheckoutTriggerProps } from "./checkout/AnySpendCheckoutTrigger";
|
|
5
5
|
export type { PaymentMethod } from "./checkout/CheckoutPaymentPanel";
|
|
@@ -34,3 +34,4 @@ __exportStar(require("./useSigMint"), exports);
|
|
|
34
34
|
__exportStar(require("./useStripeClientSecret"), exports);
|
|
35
35
|
__exportStar(require("./useStripeSupport"), exports);
|
|
36
36
|
__exportStar(require("./useWatchTransfer"), exports);
|
|
37
|
+
__exportStar(require("./useKycStatus"), exports);
|
|
@@ -10,6 +10,8 @@ export type OnrampOptions = {
|
|
|
10
10
|
export type CreateOnrampOrderParams = Omit<CreateOrderParams, "srcChain" | "srcToken" | "srcAmount"> & {
|
|
11
11
|
srcFiatAmount: string;
|
|
12
12
|
onramp: OnrampOptions;
|
|
13
|
+
/** When true, fees are added on top of srcAmount (payer pays more, receiver gets exact amount) */
|
|
14
|
+
feeOnTop?: boolean;
|
|
13
15
|
};
|
|
14
16
|
export type UseAnyspendCreateOnrampOrderProps = {
|
|
15
17
|
onSuccess?: (data: CreateOrderResponse) => void;
|
|
@@ -10,6 +10,8 @@ const react_query_1 = require("@tanstack/react-query");
|
|
|
10
10
|
const react_2 = require("react");
|
|
11
11
|
const viem_1 = require("viem");
|
|
12
12
|
const chains_1 = require("viem/chains");
|
|
13
|
+
const wagmi_1 = require("wagmi");
|
|
14
|
+
const useKycStatus_1 = require("./useKycStatus");
|
|
13
15
|
const useValidatedClientReferenceId_1 = require("./useValidatedClientReferenceId");
|
|
14
16
|
/**
|
|
15
17
|
* Hook for creating onramp orders in the Anyspend protocol
|
|
@@ -18,6 +20,7 @@ const useValidatedClientReferenceId_1 = require("./useValidatedClientReferenceId
|
|
|
18
20
|
function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
19
21
|
// Get B3 context values
|
|
20
22
|
const { partnerId } = (0, react_1.useB3Config)();
|
|
23
|
+
const { address } = (0, wagmi_1.useAccount)();
|
|
21
24
|
// Get validated client reference ID from B3 context
|
|
22
25
|
const createValidatedClientReferenceId = (0, useValidatedClientReferenceId_1.useValidatedClientReferenceId)();
|
|
23
26
|
// Get fingerprint data
|
|
@@ -39,6 +42,15 @@ function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
39
42
|
const srcChain = chains_1.base.id;
|
|
40
43
|
// Create order with USDC on Base as source
|
|
41
44
|
const srcAmountOnRampInWei = (0, viem_1.parseUnits)(srcFiatAmount, constants_1.USDC_BASE.decimals);
|
|
45
|
+
// For card payments, include wallet auth headers so the backend can verify
|
|
46
|
+
// KYC by the signing wallet address (may differ from the B3 JWT address).
|
|
47
|
+
// Only use already-cached headers — never trigger a fresh wallet signature
|
|
48
|
+
// here, as that would prompt the user without their explicit consent.
|
|
49
|
+
// KycGate pre-caches the headers in the "Continue to Verify" user-gesture.
|
|
50
|
+
let kycWalletHeaders;
|
|
51
|
+
if (onramp.vendor === "stripe-web2" && address) {
|
|
52
|
+
kycWalletHeaders = (0, useKycStatus_1.getCachedWalletHeaders)(address);
|
|
53
|
+
}
|
|
42
54
|
return await anyspend_1.anyspendService.createOrder({
|
|
43
55
|
recipientAddress: (0, utils_1.normalizeAddress)(recipientAddress),
|
|
44
56
|
type: orderType,
|
|
@@ -75,6 +87,8 @@ function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
75
87
|
clientReferenceId,
|
|
76
88
|
visitorData,
|
|
77
89
|
callbackMetadata: params.callbackMetadata,
|
|
90
|
+
feeOnTop: params.feeOnTop,
|
|
91
|
+
kycWalletHeaders,
|
|
78
92
|
});
|
|
79
93
|
}
|
|
80
94
|
catch (error) {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface KycStatusResponse {
|
|
2
|
+
kycRequired: boolean;
|
|
3
|
+
status: "not_verified" | "pending" | "completed" | "approved" | "declined" | "needs_review" | "expired";
|
|
4
|
+
inquiry?: {
|
|
5
|
+
inquiryId: string;
|
|
6
|
+
sessionToken: string;
|
|
7
|
+
};
|
|
8
|
+
config?: {
|
|
9
|
+
templateId: string;
|
|
10
|
+
environment: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface KycInquiryResponse {
|
|
14
|
+
inquiryId: string;
|
|
15
|
+
sessionToken: string;
|
|
16
|
+
}
|
|
17
|
+
interface KycVerifyResponse {
|
|
18
|
+
status: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns cached wallet auth headers without triggering a wallet signature prompt.
|
|
22
|
+
* Returns undefined if no valid cache exists for the given address.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getCachedWalletHeaders(address: string): Record<string, string> | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Returns a function that builds the wallet-signature auth headers.
|
|
27
|
+
* Caches signatures for 4 minutes (server allows 5-minute window).
|
|
28
|
+
*/
|
|
29
|
+
export declare function useWalletAuthHeaders(): {
|
|
30
|
+
address: `0x${string}` | undefined;
|
|
31
|
+
getHeaders: () => Promise<Record<string, string>>;
|
|
32
|
+
};
|
|
33
|
+
export declare function useKycStatus(enabled?: boolean): {
|
|
34
|
+
kycStatus: KycStatusResponse | null;
|
|
35
|
+
isLoadingKycStatus: boolean;
|
|
36
|
+
kycStatusError: Error | null;
|
|
37
|
+
refetchKycStatus: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<KycStatusResponse, Error>>;
|
|
38
|
+
};
|
|
39
|
+
export declare function useCreateKycInquiry(): {
|
|
40
|
+
createInquiry: import("@tanstack/react-query").UseMutateAsyncFunction<KycInquiryResponse, Error, void, unknown>;
|
|
41
|
+
isCreatingInquiry: boolean;
|
|
42
|
+
};
|
|
43
|
+
export declare function useVerifyKyc(): {
|
|
44
|
+
verifyKyc: import("@tanstack/react-query").UseMutateAsyncFunction<KycVerifyResponse, Error, string, unknown>;
|
|
45
|
+
isVerifying: boolean;
|
|
46
|
+
};
|
|
47
|
+
export {};
|