@b3dotfun/sdk 0.0.15 → 0.0.16
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/constants/index.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +3 -3
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.d.ts +16 -2
- package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.js +5 -4
- package/dist/cjs/anyspend/react/hooks/useStripeSupport.d.ts +9 -2
- package/dist/cjs/anyspend/react/hooks/useStripeSupport.js +1 -1
- package/dist/cjs/anyspend/services/anyspend.d.ts +1 -1
- package/dist/cjs/anyspend/types/api.d.ts +31 -6
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +1 -0
- package/dist/esm/anyspend/constants/index.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +3 -3
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +3 -3
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.d.ts +16 -2
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.js +5 -4
- package/dist/esm/anyspend/react/hooks/useStripeSupport.d.ts +9 -2
- package/dist/esm/anyspend/react/hooks/useStripeSupport.js +1 -1
- package/dist/esm/anyspend/services/anyspend.d.ts +1 -1
- package/dist/esm/anyspend/types/api.d.ts +31 -6
- package/dist/esm/global-account/react/hooks/useAuthentication.js +1 -0
- package/dist/types/anyspend/constants/index.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useGeoOnrampOptions.d.ts +16 -2
- package/dist/types/anyspend/react/hooks/useStripeSupport.d.ts +9 -2
- package/dist/types/anyspend/services/anyspend.d.ts +1 -1
- package/dist/types/anyspend/types/api.d.ts +31 -6
- package/package.json +1 -1
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +3 -3
- package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +3 -7
- package/src/anyspend/react/hooks/useGeoOnrampOptions.ts +10 -5
- package/src/anyspend/react/hooks/useStripeSupport.ts +1 -1
- package/src/anyspend/services/anyspend.ts +1 -1
- package/src/anyspend/types/api.ts +33 -6
- package/src/global-account/react/hooks/useAuthentication.ts +1 -0
|
@@ -30,7 +30,7 @@ function PanelOnrampPaymentInner(props) {
|
|
|
30
30
|
hasInitialized.current = true;
|
|
31
31
|
}
|
|
32
32
|
}, [srcAmountOnRamp]);
|
|
33
|
-
const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, isStripeOnrampSupported,
|
|
33
|
+
const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, isStripeOnrampSupported, stripeWeb2Support, isLoading: isLoadingGeoOnramp, } = (0, react_1.useGeoOnrampOptions)(isMainnet, stableAmountForGeo);
|
|
34
34
|
const isLoading = isLoadingGeoOnramp;
|
|
35
35
|
const { createOrder, isCreatingOrder } = (0, react_1.useAnyspendCreateOnrampOrder)({
|
|
36
36
|
onSuccess: data => {
|
|
@@ -60,7 +60,7 @@ function PanelOnrampPaymentInner(props) {
|
|
|
60
60
|
sonner_1.toast.error("Stripe onramp not available");
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
if (vendor === "stripe-web2" && !
|
|
63
|
+
if (vendor === "stripe-web2" && !stripeWeb2Support.isSupport) {
|
|
64
64
|
sonner_1.toast.error("Stripe credit card not available");
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
@@ -125,5 +125,5 @@ function PanelOnrampPaymentInner(props) {
|
|
|
125
125
|
(() => {
|
|
126
126
|
const method = coinbaseAvailablePaymentMethods[0];
|
|
127
127
|
return ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handlePaymentMethodClick("coinbase", method.id), disabled: isCreatingOrder, className: "bg-b3-react-background border-b3-react-border hover:border-as-brand disabled:hover:border-b3-react-border group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-blue-50", children: (0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/coinbase-wordmark-blue.svg", alt: "Coinbase", className: "h-6" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-b3-react-foreground text-lg font-semibold", children: "Coinbase Pay" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-b3-react-foreground/60 text-sm", children: [method.id === "CARD" && "Debit card, bank account, or Coinbase Account", method.id === "FIAT_WALLET" && "Pay with your Coinbase account balance", method.id === "APPLE_PAY" && "Quick payment with Apple Pay", method.id === "ACH_BANK_ACCOUNT" && "Direct bank account transfer"] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-1 flex items-center gap-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-medium text-green-600", children: "Free" }) })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] }));
|
|
128
|
-
})(),
|
|
128
|
+
})(), stripeWeb2Support.isSupport && ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handlePaymentMethodClick("stripe-web2"), className: "bg-b3-react-background border-b3-react-border hover:border-as-brand group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-purple-50", children: (0, jsx_runtime_1.jsx)("img", { src: "https://raw.githubusercontent.com/stripe/stripe.github.io/455f506a628dc3f6c505e3001db45a64e29e9fc3/images/stripe-logo.svg", alt: "Stripe", className: "h-5" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-b3-react-foreground text-lg font-semibold", children: "Stripe" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-foreground/60 text-sm", children: "Credit or debit card payment" }), (0, jsx_runtime_1.jsx)("div", { className: "mt-1 flex items-center gap-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-medium text-orange-600", children: "Fee Applied" }) })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] })), (0, jsx_runtime_1.jsxs)(react_2.Button, { variant: "link", onClick: onBack, className: "text-b3-react-foreground/70 hover:text-b3-react-foreground/90 mt-2 w-full", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "mr-2 h-4 w-4" }), "Back"] })] })] }))] }));
|
|
129
129
|
}
|
|
@@ -102,7 +102,7 @@ function WebviewOnrampPaymentInner({ srcAmountOnRamp, recipientAddress, destinat
|
|
|
102
102
|
hasInitialized.current = true;
|
|
103
103
|
}
|
|
104
104
|
}, [srcAmountOnRamp]);
|
|
105
|
-
const { geoData,
|
|
105
|
+
const { geoData, stripeWeb2Support, isLoading: isLoadingGeoOnramp } = (0, react_1.useGeoOnrampOptions)(true, stableAmountForGeo);
|
|
106
106
|
const { createOrder, isCreatingOrder } = (0, react_1.useAnyspendCreateOnrampOrder)({
|
|
107
107
|
onSuccess: data => {
|
|
108
108
|
setCreatedOrder(data.data);
|
|
@@ -120,7 +120,7 @@ function WebviewOnrampPaymentInner({ srcAmountOnRamp, recipientAddress, destinat
|
|
|
120
120
|
recipientAddress &&
|
|
121
121
|
srcAmountOnRamp &&
|
|
122
122
|
parseFloat(srcAmountOnRamp) > 0 &&
|
|
123
|
-
|
|
123
|
+
stripeWeb2Support.isSupport &&
|
|
124
124
|
anyspendQuote &&
|
|
125
125
|
geoData) {
|
|
126
126
|
orderCreationAttempted.current = true;
|
|
@@ -160,13 +160,13 @@ function WebviewOnrampPaymentInner({ srcAmountOnRamp, recipientAddress, destinat
|
|
|
160
160
|
}, [
|
|
161
161
|
recipientAddress,
|
|
162
162
|
srcAmountOnRamp,
|
|
163
|
-
isStripeWeb2Supported,
|
|
164
163
|
anyspendQuote,
|
|
165
164
|
geoData,
|
|
166
165
|
createOrder,
|
|
167
166
|
destinationToken,
|
|
168
167
|
userId,
|
|
169
168
|
partnerId,
|
|
169
|
+
stripeWeb2Support.isSupport,
|
|
170
170
|
]);
|
|
171
171
|
// Check if all required data is loaded
|
|
172
172
|
const isLoading = isLoadingGeoOnramp || !anyspendQuote || !destinationToken.metadata?.logoURI;
|
|
@@ -31,8 +31,22 @@ export declare function useGeoOnrampOptions(isMainnet: boolean, srcFiatAmount: s
|
|
|
31
31
|
max?: string;
|
|
32
32
|
}[];
|
|
33
33
|
isStripeOnrampSupported: boolean;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
stripeWeb2Support: {
|
|
35
|
+
isSupport: false;
|
|
36
|
+
} | {
|
|
37
|
+
isSupport: true;
|
|
38
|
+
formattedTotalUsd: string;
|
|
39
|
+
formattedOnrampUsd: string;
|
|
40
|
+
formattedFeeUsd: string;
|
|
41
|
+
};
|
|
42
|
+
isOnrampSupported: true | {
|
|
43
|
+
isSupport: false;
|
|
44
|
+
} | {
|
|
45
|
+
isSupport: true;
|
|
46
|
+
formattedTotalUsd: string;
|
|
47
|
+
formattedOnrampUsd: string;
|
|
48
|
+
formattedFeeUsd: string;
|
|
49
|
+
};
|
|
36
50
|
isLoading: boolean | undefined;
|
|
37
51
|
isLoadingGeo: boolean;
|
|
38
52
|
isLoadingCoinbaseOnrampOptions: boolean;
|
|
@@ -16,7 +16,7 @@ function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
|
|
|
16
16
|
// Use existing hooks
|
|
17
17
|
const { geoData, loading: isLoadingGeo, error: geoError } = (0, useGetGeo_1.useGetGeo)();
|
|
18
18
|
const { coinbaseOnrampOptions, isLoadingCoinbaseOnrampOptions, coinbaseOnrampOptionsError } = (0, useCoinbaseOnrampOptions_1.useCoinbaseOnrampOptions)(isMainnet, geoData?.country, visitorData);
|
|
19
|
-
const { isStripeOnrampSupported,
|
|
19
|
+
const { isStripeOnrampSupported, stripeWeb2Support, isLoadingStripeSupport, stripeSupportError } = (0, useStripeSupport_1.useStripeSupport)(isMainnet, geoData?.ip || "", srcFiatAmount, visitorData);
|
|
20
20
|
// Calculate available payment methods based on the amount
|
|
21
21
|
const coinbaseAvailablePaymentMethods = (0, react_1.useMemo)(() => {
|
|
22
22
|
if (!coinbaseOnrampOptions?.paymentCurrencies?.[0]?.limits || !srcFiatAmount)
|
|
@@ -35,8 +35,8 @@ function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
|
|
|
35
35
|
coinbaseOnrampOptions,
|
|
36
36
|
coinbaseAvailablePaymentMethods,
|
|
37
37
|
isStripeOnrampSupported,
|
|
38
|
-
|
|
39
|
-
isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || isStripeOnrampSupported ||
|
|
38
|
+
stripeWeb2Support,
|
|
39
|
+
isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || isStripeOnrampSupported || stripeWeb2Support,
|
|
40
40
|
isLoading: isLoadingGeo || isLoadingCoinbaseOnrampOptions || isLoadingStripeSupport || isLoadingVisitorData,
|
|
41
41
|
isLoadingGeo,
|
|
42
42
|
isLoadingCoinbaseOnrampOptions,
|
|
@@ -49,10 +49,11 @@ function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
|
|
|
49
49
|
coinbaseOnrampOptions,
|
|
50
50
|
coinbaseAvailablePaymentMethods,
|
|
51
51
|
isStripeOnrampSupported,
|
|
52
|
-
|
|
52
|
+
stripeWeb2Support,
|
|
53
53
|
isLoadingGeo,
|
|
54
54
|
isLoadingCoinbaseOnrampOptions,
|
|
55
55
|
isLoadingStripeSupport,
|
|
56
|
+
isLoadingVisitorData,
|
|
56
57
|
geoError,
|
|
57
58
|
coinbaseOnrampOptionsError,
|
|
58
59
|
stripeSupportError,
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { VisitorData } from "../../../anyspend/types/fingerprint";
|
|
2
2
|
export declare function useStripeSupport(isMainnet: boolean, ipAddress: string, usdAmount?: string, visitorData?: VisitorData, isLoadingVisitorData?: boolean): {
|
|
3
3
|
isStripeOnrampSupported: boolean;
|
|
4
|
-
|
|
4
|
+
stripeWeb2Support: {
|
|
5
|
+
isSupport: false;
|
|
6
|
+
} | {
|
|
7
|
+
isSupport: true;
|
|
8
|
+
formattedTotalUsd: string;
|
|
9
|
+
formattedOnrampUsd: string;
|
|
10
|
+
formattedFeeUsd: string;
|
|
11
|
+
};
|
|
5
12
|
isLoadingStripeSupport: boolean;
|
|
6
13
|
stripeSupportError: Error | null;
|
|
7
14
|
refetchStripeSupport: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
|
|
8
15
|
stripeOnramp: boolean;
|
|
9
|
-
stripeWeb2:
|
|
16
|
+
stripeWeb2: import("../..").components["schemas"]["StripeWeb2Support"];
|
|
10
17
|
}, Error>>;
|
|
11
18
|
};
|
|
@@ -12,7 +12,7 @@ function useStripeSupport(isMainnet, ipAddress, usdAmount, visitorData, isLoadin
|
|
|
12
12
|
});
|
|
13
13
|
return (0, react_1.useMemo)(() => ({
|
|
14
14
|
isStripeOnrampSupported: data?.stripeOnramp || false,
|
|
15
|
-
|
|
15
|
+
stripeWeb2Support: data?.stripeWeb2 || { isSupport: false },
|
|
16
16
|
isLoadingStripeSupport: isLoading,
|
|
17
17
|
stripeSupportError: error,
|
|
18
18
|
refetchStripeSupport: refetch,
|
|
@@ -32,7 +32,7 @@ export declare const anyspendService: {
|
|
|
32
32
|
getCoinbaseOnrampOptions: (isMainnet: boolean, country: string, visitorData?: VisitorData) => Promise<GetCoinbaseOnrampOptionsResponse>;
|
|
33
33
|
checkStripeSupport: (isMainnet: boolean, ipAddress: string, usdAmount?: string, visitorData?: VisitorData) => Promise<{
|
|
34
34
|
stripeOnramp: boolean;
|
|
35
|
-
stripeWeb2:
|
|
35
|
+
stripeWeb2: components["schemas"]["StripeWeb2Support"];
|
|
36
36
|
}>;
|
|
37
37
|
getStripeClientSecret: (isMainnet: boolean, paymentIntentId: string) => Promise<string | null>;
|
|
38
38
|
};
|
|
@@ -266,11 +266,8 @@ export interface paths {
|
|
|
266
266
|
* @example true
|
|
267
267
|
*/
|
|
268
268
|
stripeOnramp: boolean;
|
|
269
|
-
/**
|
|
270
|
-
|
|
271
|
-
* @example false
|
|
272
|
-
*/
|
|
273
|
-
stripeWeb2: boolean;
|
|
269
|
+
/** @description Stripe Web2 support details */
|
|
270
|
+
stripeWeb2: components["schemas"]["StripeWeb2Support"];
|
|
274
271
|
};
|
|
275
272
|
/** @example 200 */
|
|
276
273
|
statusCode: number;
|
|
@@ -1646,6 +1643,34 @@ export interface components {
|
|
|
1646
1643
|
*/
|
|
1647
1644
|
createdAt: number;
|
|
1648
1645
|
};
|
|
1646
|
+
StripeWeb2Support: {
|
|
1647
|
+
/**
|
|
1648
|
+
* @example false
|
|
1649
|
+
* @constant
|
|
1650
|
+
*/
|
|
1651
|
+
isSupport: false;
|
|
1652
|
+
} | {
|
|
1653
|
+
/**
|
|
1654
|
+
* @example true
|
|
1655
|
+
* @constant
|
|
1656
|
+
*/
|
|
1657
|
+
isSupport: true;
|
|
1658
|
+
/**
|
|
1659
|
+
* @description Total payment amount formatted in USD
|
|
1660
|
+
* @example 10.00
|
|
1661
|
+
*/
|
|
1662
|
+
formattedTotalUsd: string;
|
|
1663
|
+
/**
|
|
1664
|
+
* @description Onramp amount formatted in USD
|
|
1665
|
+
* @example 9.50
|
|
1666
|
+
*/
|
|
1667
|
+
formattedOnrampUsd: string;
|
|
1668
|
+
/**
|
|
1669
|
+
* @description Stripe fee formatted in USD
|
|
1670
|
+
* @example 0.50
|
|
1671
|
+
*/
|
|
1672
|
+
formattedFeeUsd: string;
|
|
1673
|
+
};
|
|
1649
1674
|
/** @description NFT contract details */
|
|
1650
1675
|
NftContract: {
|
|
1651
1676
|
/**
|
|
@@ -1673,7 +1698,7 @@ export interface components {
|
|
|
1673
1698
|
* @description NFT image URL
|
|
1674
1699
|
* @example https://example.com/nft.png
|
|
1675
1700
|
*/
|
|
1676
|
-
imageUrl: string
|
|
1701
|
+
imageUrl: string;
|
|
1677
1702
|
/**
|
|
1678
1703
|
* @description NFT name
|
|
1679
1704
|
* @example Cool NFT Collection
|
|
@@ -24,7 +24,7 @@ function PanelOnrampPaymentInner(props) {
|
|
|
24
24
|
hasInitialized.current = true;
|
|
25
25
|
}
|
|
26
26
|
}, [srcAmountOnRamp]);
|
|
27
|
-
const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, isStripeOnrampSupported,
|
|
27
|
+
const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, isStripeOnrampSupported, stripeWeb2Support, isLoading: isLoadingGeoOnramp, } = useGeoOnrampOptions(isMainnet, stableAmountForGeo);
|
|
28
28
|
const isLoading = isLoadingGeoOnramp;
|
|
29
29
|
const { createOrder, isCreatingOrder } = useAnyspendCreateOnrampOrder({
|
|
30
30
|
onSuccess: data => {
|
|
@@ -54,7 +54,7 @@ function PanelOnrampPaymentInner(props) {
|
|
|
54
54
|
toast.error("Stripe onramp not available");
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
if (vendor === "stripe-web2" && !
|
|
57
|
+
if (vendor === "stripe-web2" && !stripeWeb2Support.isSupport) {
|
|
58
58
|
toast.error("Stripe credit card not available");
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
@@ -119,5 +119,5 @@ function PanelOnrampPaymentInner(props) {
|
|
|
119
119
|
(() => {
|
|
120
120
|
const method = coinbaseAvailablePaymentMethods[0];
|
|
121
121
|
return (_jsxs("button", { onClick: () => handlePaymentMethodClick("coinbase", method.id), disabled: isCreatingOrder, className: "bg-b3-react-background border-b3-react-border hover:border-as-brand disabled:hover:border-b3-react-border group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-blue-50", children: _jsx("img", { src: "https://cdn.b3.fun/coinbase-wordmark-blue.svg", alt: "Coinbase", className: "h-6" }) }), _jsxs("div", { className: "flex flex-col items-start text-left", children: [_jsx("h4", { className: "text-b3-react-foreground text-lg font-semibold", children: "Coinbase Pay" }), _jsxs("p", { className: "text-b3-react-foreground/60 text-sm", children: [method.id === "CARD" && "Debit card, bank account, or Coinbase Account", method.id === "FIAT_WALLET" && "Pay with your Coinbase account balance", method.id === "APPLE_PAY" && "Quick payment with Apple Pay", method.id === "ACH_BANK_ACCOUNT" && "Direct bank account transfer"] }), _jsx("div", { className: "mt-1 flex items-center gap-1", children: _jsx("span", { className: "text-xs font-medium text-green-600", children: "Free" }) })] })] }), _jsx(ChevronRight, { className: "text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] }));
|
|
122
|
-
})(),
|
|
122
|
+
})(), stripeWeb2Support.isSupport && (_jsxs("button", { onClick: () => handlePaymentMethodClick("stripe-web2"), className: "bg-b3-react-background border-b3-react-border hover:border-as-brand group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-purple-50", children: _jsx("img", { src: "https://raw.githubusercontent.com/stripe/stripe.github.io/455f506a628dc3f6c505e3001db45a64e29e9fc3/images/stripe-logo.svg", alt: "Stripe", className: "h-5" }) }), _jsxs("div", { className: "flex flex-col items-start text-left", children: [_jsx("h4", { className: "text-b3-react-foreground text-lg font-semibold", children: "Stripe" }), _jsx("p", { className: "text-b3-react-foreground/60 text-sm", children: "Credit or debit card payment" }), _jsx("div", { className: "mt-1 flex items-center gap-1", children: _jsx("span", { className: "text-xs font-medium text-orange-600", children: "Fee Applied" }) })] })] }), _jsx(ChevronRight, { className: "text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] })), _jsxs(Button, { variant: "link", onClick: onBack, className: "text-b3-react-foreground/70 hover:text-b3-react-foreground/90 mt-2 w-full", children: [_jsx(ChevronLeft, { className: "mr-2 h-4 w-4" }), "Back"] })] })] }))] }));
|
|
123
123
|
}
|
|
@@ -96,7 +96,7 @@ function WebviewOnrampPaymentInner({ srcAmountOnRamp, recipientAddress, destinat
|
|
|
96
96
|
hasInitialized.current = true;
|
|
97
97
|
}
|
|
98
98
|
}, [srcAmountOnRamp]);
|
|
99
|
-
const { geoData,
|
|
99
|
+
const { geoData, stripeWeb2Support, isLoading: isLoadingGeoOnramp } = useGeoOnrampOptions(true, stableAmountForGeo);
|
|
100
100
|
const { createOrder, isCreatingOrder } = useAnyspendCreateOnrampOrder({
|
|
101
101
|
onSuccess: data => {
|
|
102
102
|
setCreatedOrder(data.data);
|
|
@@ -114,7 +114,7 @@ function WebviewOnrampPaymentInner({ srcAmountOnRamp, recipientAddress, destinat
|
|
|
114
114
|
recipientAddress &&
|
|
115
115
|
srcAmountOnRamp &&
|
|
116
116
|
parseFloat(srcAmountOnRamp) > 0 &&
|
|
117
|
-
|
|
117
|
+
stripeWeb2Support.isSupport &&
|
|
118
118
|
anyspendQuote &&
|
|
119
119
|
geoData) {
|
|
120
120
|
orderCreationAttempted.current = true;
|
|
@@ -154,13 +154,13 @@ function WebviewOnrampPaymentInner({ srcAmountOnRamp, recipientAddress, destinat
|
|
|
154
154
|
}, [
|
|
155
155
|
recipientAddress,
|
|
156
156
|
srcAmountOnRamp,
|
|
157
|
-
isStripeWeb2Supported,
|
|
158
157
|
anyspendQuote,
|
|
159
158
|
geoData,
|
|
160
159
|
createOrder,
|
|
161
160
|
destinationToken,
|
|
162
161
|
userId,
|
|
163
162
|
partnerId,
|
|
163
|
+
stripeWeb2Support.isSupport,
|
|
164
164
|
]);
|
|
165
165
|
// Check if all required data is loaded
|
|
166
166
|
const isLoading = isLoadingGeoOnramp || !anyspendQuote || !destinationToken.metadata?.logoURI;
|
|
@@ -31,8 +31,22 @@ export declare function useGeoOnrampOptions(isMainnet: boolean, srcFiatAmount: s
|
|
|
31
31
|
max?: string;
|
|
32
32
|
}[];
|
|
33
33
|
isStripeOnrampSupported: boolean;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
stripeWeb2Support: {
|
|
35
|
+
isSupport: false;
|
|
36
|
+
} | {
|
|
37
|
+
isSupport: true;
|
|
38
|
+
formattedTotalUsd: string;
|
|
39
|
+
formattedOnrampUsd: string;
|
|
40
|
+
formattedFeeUsd: string;
|
|
41
|
+
};
|
|
42
|
+
isOnrampSupported: true | {
|
|
43
|
+
isSupport: false;
|
|
44
|
+
} | {
|
|
45
|
+
isSupport: true;
|
|
46
|
+
formattedTotalUsd: string;
|
|
47
|
+
formattedOnrampUsd: string;
|
|
48
|
+
formattedFeeUsd: string;
|
|
49
|
+
};
|
|
36
50
|
isLoading: boolean | undefined;
|
|
37
51
|
isLoadingGeo: boolean;
|
|
38
52
|
isLoadingCoinbaseOnrampOptions: boolean;
|
|
@@ -13,7 +13,7 @@ export function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
|
|
|
13
13
|
// Use existing hooks
|
|
14
14
|
const { geoData, loading: isLoadingGeo, error: geoError } = useGetGeo();
|
|
15
15
|
const { coinbaseOnrampOptions, isLoadingCoinbaseOnrampOptions, coinbaseOnrampOptionsError } = useCoinbaseOnrampOptions(isMainnet, geoData?.country, visitorData);
|
|
16
|
-
const { isStripeOnrampSupported,
|
|
16
|
+
const { isStripeOnrampSupported, stripeWeb2Support, isLoadingStripeSupport, stripeSupportError } = useStripeSupport(isMainnet, geoData?.ip || "", srcFiatAmount, visitorData);
|
|
17
17
|
// Calculate available payment methods based on the amount
|
|
18
18
|
const coinbaseAvailablePaymentMethods = useMemo(() => {
|
|
19
19
|
if (!coinbaseOnrampOptions?.paymentCurrencies?.[0]?.limits || !srcFiatAmount)
|
|
@@ -32,8 +32,8 @@ export function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
|
|
|
32
32
|
coinbaseOnrampOptions,
|
|
33
33
|
coinbaseAvailablePaymentMethods,
|
|
34
34
|
isStripeOnrampSupported,
|
|
35
|
-
|
|
36
|
-
isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || isStripeOnrampSupported ||
|
|
35
|
+
stripeWeb2Support,
|
|
36
|
+
isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || isStripeOnrampSupported || stripeWeb2Support,
|
|
37
37
|
isLoading: isLoadingGeo || isLoadingCoinbaseOnrampOptions || isLoadingStripeSupport || isLoadingVisitorData,
|
|
38
38
|
isLoadingGeo,
|
|
39
39
|
isLoadingCoinbaseOnrampOptions,
|
|
@@ -46,10 +46,11 @@ export function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
|
|
|
46
46
|
coinbaseOnrampOptions,
|
|
47
47
|
coinbaseAvailablePaymentMethods,
|
|
48
48
|
isStripeOnrampSupported,
|
|
49
|
-
|
|
49
|
+
stripeWeb2Support,
|
|
50
50
|
isLoadingGeo,
|
|
51
51
|
isLoadingCoinbaseOnrampOptions,
|
|
52
52
|
isLoadingStripeSupport,
|
|
53
|
+
isLoadingVisitorData,
|
|
53
54
|
geoError,
|
|
54
55
|
coinbaseOnrampOptionsError,
|
|
55
56
|
stripeSupportError,
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { VisitorData } from "../../../anyspend/types/fingerprint";
|
|
2
2
|
export declare function useStripeSupport(isMainnet: boolean, ipAddress: string, usdAmount?: string, visitorData?: VisitorData, isLoadingVisitorData?: boolean): {
|
|
3
3
|
isStripeOnrampSupported: boolean;
|
|
4
|
-
|
|
4
|
+
stripeWeb2Support: {
|
|
5
|
+
isSupport: false;
|
|
6
|
+
} | {
|
|
7
|
+
isSupport: true;
|
|
8
|
+
formattedTotalUsd: string;
|
|
9
|
+
formattedOnrampUsd: string;
|
|
10
|
+
formattedFeeUsd: string;
|
|
11
|
+
};
|
|
5
12
|
isLoadingStripeSupport: boolean;
|
|
6
13
|
stripeSupportError: Error | null;
|
|
7
14
|
refetchStripeSupport: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
|
|
8
15
|
stripeOnramp: boolean;
|
|
9
|
-
stripeWeb2:
|
|
16
|
+
stripeWeb2: import("../..").components["schemas"]["StripeWeb2Support"];
|
|
10
17
|
}, Error>>;
|
|
11
18
|
};
|
|
@@ -9,7 +9,7 @@ export function useStripeSupport(isMainnet, ipAddress, usdAmount, visitorData, i
|
|
|
9
9
|
});
|
|
10
10
|
return useMemo(() => ({
|
|
11
11
|
isStripeOnrampSupported: data?.stripeOnramp || false,
|
|
12
|
-
|
|
12
|
+
stripeWeb2Support: data?.stripeWeb2 || { isSupport: false },
|
|
13
13
|
isLoadingStripeSupport: isLoading,
|
|
14
14
|
stripeSupportError: error,
|
|
15
15
|
refetchStripeSupport: refetch,
|
|
@@ -32,7 +32,7 @@ export declare const anyspendService: {
|
|
|
32
32
|
getCoinbaseOnrampOptions: (isMainnet: boolean, country: string, visitorData?: VisitorData) => Promise<GetCoinbaseOnrampOptionsResponse>;
|
|
33
33
|
checkStripeSupport: (isMainnet: boolean, ipAddress: string, usdAmount?: string, visitorData?: VisitorData) => Promise<{
|
|
34
34
|
stripeOnramp: boolean;
|
|
35
|
-
stripeWeb2:
|
|
35
|
+
stripeWeb2: components["schemas"]["StripeWeb2Support"];
|
|
36
36
|
}>;
|
|
37
37
|
getStripeClientSecret: (isMainnet: boolean, paymentIntentId: string) => Promise<string | null>;
|
|
38
38
|
};
|
|
@@ -266,11 +266,8 @@ export interface paths {
|
|
|
266
266
|
* @example true
|
|
267
267
|
*/
|
|
268
268
|
stripeOnramp: boolean;
|
|
269
|
-
/**
|
|
270
|
-
|
|
271
|
-
* @example false
|
|
272
|
-
*/
|
|
273
|
-
stripeWeb2: boolean;
|
|
269
|
+
/** @description Stripe Web2 support details */
|
|
270
|
+
stripeWeb2: components["schemas"]["StripeWeb2Support"];
|
|
274
271
|
};
|
|
275
272
|
/** @example 200 */
|
|
276
273
|
statusCode: number;
|
|
@@ -1646,6 +1643,34 @@ export interface components {
|
|
|
1646
1643
|
*/
|
|
1647
1644
|
createdAt: number;
|
|
1648
1645
|
};
|
|
1646
|
+
StripeWeb2Support: {
|
|
1647
|
+
/**
|
|
1648
|
+
* @example false
|
|
1649
|
+
* @constant
|
|
1650
|
+
*/
|
|
1651
|
+
isSupport: false;
|
|
1652
|
+
} | {
|
|
1653
|
+
/**
|
|
1654
|
+
* @example true
|
|
1655
|
+
* @constant
|
|
1656
|
+
*/
|
|
1657
|
+
isSupport: true;
|
|
1658
|
+
/**
|
|
1659
|
+
* @description Total payment amount formatted in USD
|
|
1660
|
+
* @example 10.00
|
|
1661
|
+
*/
|
|
1662
|
+
formattedTotalUsd: string;
|
|
1663
|
+
/**
|
|
1664
|
+
* @description Onramp amount formatted in USD
|
|
1665
|
+
* @example 9.50
|
|
1666
|
+
*/
|
|
1667
|
+
formattedOnrampUsd: string;
|
|
1668
|
+
/**
|
|
1669
|
+
* @description Stripe fee formatted in USD
|
|
1670
|
+
* @example 0.50
|
|
1671
|
+
*/
|
|
1672
|
+
formattedFeeUsd: string;
|
|
1673
|
+
};
|
|
1649
1674
|
/** @description NFT contract details */
|
|
1650
1675
|
NftContract: {
|
|
1651
1676
|
/**
|
|
@@ -1673,7 +1698,7 @@ export interface components {
|
|
|
1673
1698
|
* @description NFT image URL
|
|
1674
1699
|
* @example https://example.com/nft.png
|
|
1675
1700
|
*/
|
|
1676
|
-
imageUrl: string
|
|
1701
|
+
imageUrl: string;
|
|
1677
1702
|
/**
|
|
1678
1703
|
* @description NFT name
|
|
1679
1704
|
* @example Cool NFT Collection
|
|
@@ -31,8 +31,22 @@ export declare function useGeoOnrampOptions(isMainnet: boolean, srcFiatAmount: s
|
|
|
31
31
|
max?: string;
|
|
32
32
|
}[];
|
|
33
33
|
isStripeOnrampSupported: boolean;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
stripeWeb2Support: {
|
|
35
|
+
isSupport: false;
|
|
36
|
+
} | {
|
|
37
|
+
isSupport: true;
|
|
38
|
+
formattedTotalUsd: string;
|
|
39
|
+
formattedOnrampUsd: string;
|
|
40
|
+
formattedFeeUsd: string;
|
|
41
|
+
};
|
|
42
|
+
isOnrampSupported: true | {
|
|
43
|
+
isSupport: false;
|
|
44
|
+
} | {
|
|
45
|
+
isSupport: true;
|
|
46
|
+
formattedTotalUsd: string;
|
|
47
|
+
formattedOnrampUsd: string;
|
|
48
|
+
formattedFeeUsd: string;
|
|
49
|
+
};
|
|
36
50
|
isLoading: boolean | undefined;
|
|
37
51
|
isLoadingGeo: boolean;
|
|
38
52
|
isLoadingCoinbaseOnrampOptions: boolean;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { VisitorData } from "@b3dotfun/sdk/anyspend/types/fingerprint";
|
|
2
2
|
export declare function useStripeSupport(isMainnet: boolean, ipAddress: string, usdAmount?: string, visitorData?: VisitorData, isLoadingVisitorData?: boolean): {
|
|
3
3
|
isStripeOnrampSupported: boolean;
|
|
4
|
-
|
|
4
|
+
stripeWeb2Support: {
|
|
5
|
+
isSupport: false;
|
|
6
|
+
} | {
|
|
7
|
+
isSupport: true;
|
|
8
|
+
formattedTotalUsd: string;
|
|
9
|
+
formattedOnrampUsd: string;
|
|
10
|
+
formattedFeeUsd: string;
|
|
11
|
+
};
|
|
5
12
|
isLoadingStripeSupport: boolean;
|
|
6
13
|
stripeSupportError: Error | null;
|
|
7
14
|
refetchStripeSupport: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
|
|
8
15
|
stripeOnramp: boolean;
|
|
9
|
-
stripeWeb2:
|
|
16
|
+
stripeWeb2: import("../..").components["schemas"]["StripeWeb2Support"];
|
|
10
17
|
}, Error>>;
|
|
11
18
|
};
|
|
@@ -32,7 +32,7 @@ export declare const anyspendService: {
|
|
|
32
32
|
getCoinbaseOnrampOptions: (isMainnet: boolean, country: string, visitorData?: VisitorData) => Promise<GetCoinbaseOnrampOptionsResponse>;
|
|
33
33
|
checkStripeSupport: (isMainnet: boolean, ipAddress: string, usdAmount?: string, visitorData?: VisitorData) => Promise<{
|
|
34
34
|
stripeOnramp: boolean;
|
|
35
|
-
stripeWeb2:
|
|
35
|
+
stripeWeb2: components["schemas"]["StripeWeb2Support"];
|
|
36
36
|
}>;
|
|
37
37
|
getStripeClientSecret: (isMainnet: boolean, paymentIntentId: string) => Promise<string | null>;
|
|
38
38
|
};
|
|
@@ -266,11 +266,8 @@ export interface paths {
|
|
|
266
266
|
* @example true
|
|
267
267
|
*/
|
|
268
268
|
stripeOnramp: boolean;
|
|
269
|
-
/**
|
|
270
|
-
|
|
271
|
-
* @example false
|
|
272
|
-
*/
|
|
273
|
-
stripeWeb2: boolean;
|
|
269
|
+
/** @description Stripe Web2 support details */
|
|
270
|
+
stripeWeb2: components["schemas"]["StripeWeb2Support"];
|
|
274
271
|
};
|
|
275
272
|
/** @example 200 */
|
|
276
273
|
statusCode: number;
|
|
@@ -1646,6 +1643,34 @@ export interface components {
|
|
|
1646
1643
|
*/
|
|
1647
1644
|
createdAt: number;
|
|
1648
1645
|
};
|
|
1646
|
+
StripeWeb2Support: {
|
|
1647
|
+
/**
|
|
1648
|
+
* @example false
|
|
1649
|
+
* @constant
|
|
1650
|
+
*/
|
|
1651
|
+
isSupport: false;
|
|
1652
|
+
} | {
|
|
1653
|
+
/**
|
|
1654
|
+
* @example true
|
|
1655
|
+
* @constant
|
|
1656
|
+
*/
|
|
1657
|
+
isSupport: true;
|
|
1658
|
+
/**
|
|
1659
|
+
* @description Total payment amount formatted in USD
|
|
1660
|
+
* @example 10.00
|
|
1661
|
+
*/
|
|
1662
|
+
formattedTotalUsd: string;
|
|
1663
|
+
/**
|
|
1664
|
+
* @description Onramp amount formatted in USD
|
|
1665
|
+
* @example 9.50
|
|
1666
|
+
*/
|
|
1667
|
+
formattedOnrampUsd: string;
|
|
1668
|
+
/**
|
|
1669
|
+
* @description Stripe fee formatted in USD
|
|
1670
|
+
* @example 0.50
|
|
1671
|
+
*/
|
|
1672
|
+
formattedFeeUsd: string;
|
|
1673
|
+
};
|
|
1649
1674
|
/** @description NFT contract details */
|
|
1650
1675
|
NftContract: {
|
|
1651
1676
|
/**
|
|
@@ -1673,7 +1698,7 @@ export interface components {
|
|
|
1673
1698
|
* @description NFT image URL
|
|
1674
1699
|
* @example https://example.com/nft.png
|
|
1675
1700
|
*/
|
|
1676
|
-
imageUrl: string
|
|
1701
|
+
imageUrl: string;
|
|
1677
1702
|
/**
|
|
1678
1703
|
* @description NFT name
|
|
1679
1704
|
* @example Cool NFT Collection
|
package/package.json
CHANGED
|
@@ -81,7 +81,7 @@ function PanelOnrampPaymentInner(props: PanelOnrampPaymentProps) {
|
|
|
81
81
|
coinbaseOnrampOptions,
|
|
82
82
|
coinbaseAvailablePaymentMethods,
|
|
83
83
|
isStripeOnrampSupported,
|
|
84
|
-
|
|
84
|
+
stripeWeb2Support,
|
|
85
85
|
isLoading: isLoadingGeoOnramp,
|
|
86
86
|
} = useGeoOnrampOptions(isMainnet, stableAmountForGeo);
|
|
87
87
|
|
|
@@ -123,7 +123,7 @@ function PanelOnrampPaymentInner(props: PanelOnrampPaymentProps) {
|
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
if (vendor === "stripe-web2" && !
|
|
126
|
+
if (vendor === "stripe-web2" && !stripeWeb2Support.isSupport) {
|
|
127
127
|
toast.error("Stripe credit card not available");
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
@@ -323,7 +323,7 @@ function PanelOnrampPaymentInner(props: PanelOnrampPaymentProps) {
|
|
|
323
323
|
})()}
|
|
324
324
|
|
|
325
325
|
{/* Stripe Option - Show if supported */}
|
|
326
|
-
{
|
|
326
|
+
{stripeWeb2Support.isSupport && (
|
|
327
327
|
<button
|
|
328
328
|
onClick={() => handlePaymentMethodClick("stripe-web2")}
|
|
329
329
|
className="bg-b3-react-background border-b3-react-border hover:border-as-brand group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md"
|
|
@@ -172,11 +172,7 @@ function WebviewOnrampPaymentInner({
|
|
|
172
172
|
}
|
|
173
173
|
}, [srcAmountOnRamp]);
|
|
174
174
|
|
|
175
|
-
const {
|
|
176
|
-
geoData,
|
|
177
|
-
isStripeWeb2Supported,
|
|
178
|
-
isLoading: isLoadingGeoOnramp,
|
|
179
|
-
} = useGeoOnrampOptions(true, stableAmountForGeo);
|
|
175
|
+
const { geoData, stripeWeb2Support, isLoading: isLoadingGeoOnramp } = useGeoOnrampOptions(true, stableAmountForGeo);
|
|
180
176
|
|
|
181
177
|
const { createOrder, isCreatingOrder } = useAnyspendCreateOnrampOrder({
|
|
182
178
|
onSuccess: data => {
|
|
@@ -201,7 +197,7 @@ function WebviewOnrampPaymentInner({
|
|
|
201
197
|
recipientAddress &&
|
|
202
198
|
srcAmountOnRamp &&
|
|
203
199
|
parseFloat(srcAmountOnRamp) > 0 &&
|
|
204
|
-
|
|
200
|
+
stripeWeb2Support.isSupport &&
|
|
205
201
|
anyspendQuote &&
|
|
206
202
|
geoData
|
|
207
203
|
) {
|
|
@@ -244,13 +240,13 @@ function WebviewOnrampPaymentInner({
|
|
|
244
240
|
}, [
|
|
245
241
|
recipientAddress,
|
|
246
242
|
srcAmountOnRamp,
|
|
247
|
-
isStripeWeb2Supported,
|
|
248
243
|
anyspendQuote,
|
|
249
244
|
geoData,
|
|
250
245
|
createOrder,
|
|
251
246
|
destinationToken,
|
|
252
247
|
userId,
|
|
253
248
|
partnerId,
|
|
249
|
+
stripeWeb2Support.isSupport,
|
|
254
250
|
]);
|
|
255
251
|
|
|
256
252
|
// Check if all required data is loaded
|
|
@@ -20,8 +20,12 @@ export function useGeoOnrampOptions(isMainnet: boolean, srcFiatAmount: string) {
|
|
|
20
20
|
const { geoData, loading: isLoadingGeo, error: geoError } = useGetGeo();
|
|
21
21
|
const { coinbaseOnrampOptions, isLoadingCoinbaseOnrampOptions, coinbaseOnrampOptionsError } =
|
|
22
22
|
useCoinbaseOnrampOptions(isMainnet, geoData?.country, visitorData);
|
|
23
|
-
const { isStripeOnrampSupported,
|
|
24
|
-
|
|
23
|
+
const { isStripeOnrampSupported, stripeWeb2Support, isLoadingStripeSupport, stripeSupportError } = useStripeSupport(
|
|
24
|
+
isMainnet,
|
|
25
|
+
geoData?.ip || "",
|
|
26
|
+
srcFiatAmount,
|
|
27
|
+
visitorData,
|
|
28
|
+
);
|
|
25
29
|
|
|
26
30
|
// Calculate available payment methods based on the amount
|
|
27
31
|
const coinbaseAvailablePaymentMethods = useMemo(() => {
|
|
@@ -42,8 +46,8 @@ export function useGeoOnrampOptions(isMainnet: boolean, srcFiatAmount: string) {
|
|
|
42
46
|
coinbaseOnrampOptions,
|
|
43
47
|
coinbaseAvailablePaymentMethods,
|
|
44
48
|
isStripeOnrampSupported,
|
|
45
|
-
|
|
46
|
-
isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || isStripeOnrampSupported ||
|
|
49
|
+
stripeWeb2Support,
|
|
50
|
+
isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || isStripeOnrampSupported || stripeWeb2Support,
|
|
47
51
|
isLoading: isLoadingGeo || isLoadingCoinbaseOnrampOptions || isLoadingStripeSupport || isLoadingVisitorData,
|
|
48
52
|
isLoadingGeo,
|
|
49
53
|
isLoadingCoinbaseOnrampOptions,
|
|
@@ -57,10 +61,11 @@ export function useGeoOnrampOptions(isMainnet: boolean, srcFiatAmount: string) {
|
|
|
57
61
|
coinbaseOnrampOptions,
|
|
58
62
|
coinbaseAvailablePaymentMethods,
|
|
59
63
|
isStripeOnrampSupported,
|
|
60
|
-
|
|
64
|
+
stripeWeb2Support,
|
|
61
65
|
isLoadingGeo,
|
|
62
66
|
isLoadingCoinbaseOnrampOptions,
|
|
63
67
|
isLoadingStripeSupport,
|
|
68
|
+
isLoadingVisitorData,
|
|
64
69
|
geoError,
|
|
65
70
|
coinbaseOnrampOptionsError,
|
|
66
71
|
stripeSupportError,
|
|
@@ -19,7 +19,7 @@ export function useStripeSupport(
|
|
|
19
19
|
return useMemo(
|
|
20
20
|
() => ({
|
|
21
21
|
isStripeOnrampSupported: data?.stripeOnramp || false,
|
|
22
|
-
|
|
22
|
+
stripeWeb2Support: data?.stripeWeb2 || { isSupport: false },
|
|
23
23
|
isLoadingStripeSupport: isLoading,
|
|
24
24
|
stripeSupportError: error,
|
|
25
25
|
refetchStripeSupport: refetch,
|
|
@@ -173,7 +173,7 @@ export const anyspendService = {
|
|
|
173
173
|
ipAddress: string,
|
|
174
174
|
usdAmount?: string,
|
|
175
175
|
visitorData?: VisitorData,
|
|
176
|
-
): Promise<{ stripeOnramp: boolean; stripeWeb2:
|
|
176
|
+
): Promise<{ stripeOnramp: boolean; stripeWeb2: components["schemas"]["StripeWeb2Support"] }> => {
|
|
177
177
|
const params = new URLSearchParams({
|
|
178
178
|
ipAddress,
|
|
179
179
|
usdAmount: usdAmount || "",
|
|
@@ -267,11 +267,8 @@ export interface paths {
|
|
|
267
267
|
* @example true
|
|
268
268
|
*/
|
|
269
269
|
stripeOnramp: boolean;
|
|
270
|
-
/**
|
|
271
|
-
|
|
272
|
-
* @example false
|
|
273
|
-
*/
|
|
274
|
-
stripeWeb2: boolean;
|
|
270
|
+
/** @description Stripe Web2 support details */
|
|
271
|
+
stripeWeb2: components["schemas"]["StripeWeb2Support"];
|
|
275
272
|
};
|
|
276
273
|
/** @example 200 */
|
|
277
274
|
statusCode: number;
|
|
@@ -1671,6 +1668,36 @@ export interface components {
|
|
|
1671
1668
|
*/
|
|
1672
1669
|
createdAt: number;
|
|
1673
1670
|
};
|
|
1671
|
+
StripeWeb2Support:
|
|
1672
|
+
| {
|
|
1673
|
+
/**
|
|
1674
|
+
* @example false
|
|
1675
|
+
* @constant
|
|
1676
|
+
*/
|
|
1677
|
+
isSupport: false;
|
|
1678
|
+
}
|
|
1679
|
+
| {
|
|
1680
|
+
/**
|
|
1681
|
+
* @example true
|
|
1682
|
+
* @constant
|
|
1683
|
+
*/
|
|
1684
|
+
isSupport: true;
|
|
1685
|
+
/**
|
|
1686
|
+
* @description Total payment amount formatted in USD
|
|
1687
|
+
* @example 10.00
|
|
1688
|
+
*/
|
|
1689
|
+
formattedTotalUsd: string;
|
|
1690
|
+
/**
|
|
1691
|
+
* @description Onramp amount formatted in USD
|
|
1692
|
+
* @example 9.50
|
|
1693
|
+
*/
|
|
1694
|
+
formattedOnrampUsd: string;
|
|
1695
|
+
/**
|
|
1696
|
+
* @description Stripe fee formatted in USD
|
|
1697
|
+
* @example 0.50
|
|
1698
|
+
*/
|
|
1699
|
+
formattedFeeUsd: string;
|
|
1700
|
+
};
|
|
1674
1701
|
/** @description NFT contract details */
|
|
1675
1702
|
NftContract: {
|
|
1676
1703
|
/**
|
|
@@ -1698,7 +1725,7 @@ export interface components {
|
|
|
1698
1725
|
* @description NFT image URL
|
|
1699
1726
|
* @example https://example.com/nft.png
|
|
1700
1727
|
*/
|
|
1701
|
-
imageUrl: string
|
|
1728
|
+
imageUrl: string;
|
|
1702
1729
|
/**
|
|
1703
1730
|
* @description NFT name
|
|
1704
1731
|
* @example Cool NFT Collection
|