@b3dotfun/sdk 0.0.87-alpha.0 → 0.0.87-alpha.1
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/react/components/AnySpend.d.ts +5 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +59 -49
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +190 -0
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/cjs/anyspend/react/components/QRDeposit.js +146 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +17 -12
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/cjs/anyspend/react/components/common/WarningText.js +36 -0
- package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.js +6 -0
- package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.js +6 -0
- package/dist/cjs/anyspend/react/components/index.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/index.js +3 -1
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/index.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +35 -11
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +86 -0
- package/dist/cjs/anyspend/utils/format.js +28 -5
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +5 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +59 -49
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +187 -0
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/esm/anyspend/react/components/QRDeposit.js +143 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +17 -12
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/esm/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/esm/anyspend/react/components/common/WarningText.js +32 -0
- package/dist/esm/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/esm/anyspend/react/components/icons/CreditCardIcon.js +2 -0
- package/dist/esm/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/esm/anyspend/react/components/icons/QrCodeIcon.js +2 -0
- package/dist/esm/anyspend/react/components/index.d.ts +2 -0
- package/dist/esm/anyspend/react/components/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +35 -11
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +83 -0
- package/dist/esm/anyspend/utils/format.js +28 -5
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +5 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +43 -0
- package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/WarningText.d.ts +32 -0
- package/dist/types/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
- package/dist/types/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
- package/dist/types/anyspend/react/components/index.d.ts +2 -0
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
- package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +68 -45
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +2 -3
- package/src/anyspend/react/components/AnySpendDeposit.tsx +578 -0
- package/src/anyspend/react/components/QRDeposit.tsx +348 -0
- package/src/anyspend/react/components/common/OrderDetails.tsx +26 -8
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +20 -8
- package/src/anyspend/react/components/common/OrderStatus.tsx +2 -2
- package/src/anyspend/react/components/common/WarningText.tsx +52 -0
- package/src/anyspend/react/components/icons/CreditCardIcon.tsx +25 -0
- package/src/anyspend/react/components/icons/QrCodeIcon.tsx +25 -0
- package/src/anyspend/react/components/icons/credit-card.svg +5 -0
- package/src/anyspend/react/components/icons/qr-code.svg +5 -0
- package/src/anyspend/react/components/index.ts +2 -0
- package/src/anyspend/react/hooks/index.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +37 -12
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +110 -0
- package/src/anyspend/utils/format.ts +33 -5
- package/src/global-account/react/stores/useModalStore.ts +4 -0
- package/src/styles/index.css +2 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8 0.5H32C36.1421 0.5 39.5 3.85786 39.5 8V32C39.5 36.1421 36.1421 39.5 32 39.5H8C3.85786 39.5 0.5 36.1421 0.5 32V8C0.5 3.85786 3.85786 0.5 8 0.5Z" fill="#F4F4F5"/>
|
|
3
|
+
<path d="M8 0.5H32C36.1421 0.5 39.5 3.85786 39.5 8V32C39.5 36.1421 36.1421 39.5 32 39.5H8C3.85786 39.5 0.5 36.1421 0.5 32V8C0.5 3.85786 3.85786 0.5 8 0.5Z" stroke="#E4E4E7"/>
|
|
4
|
+
<path d="M15 20H20V25M11.01 20H11M16.01 25H16M20.01 29H20M29.01 20H29M11 25H12.5M23.5 20H25.5M11 29H16M20 10V16M25.6 29H27.4C27.9601 29 28.2401 29 28.454 28.891C28.6422 28.7951 28.7951 28.6422 28.891 28.454C29 28.2401 29 27.9601 29 27.4V25.6C29 25.0399 29 24.7599 28.891 24.546C28.7951 24.3578 28.6422 24.2049 28.454 24.109C28.2401 24 27.9601 24 27.4 24H25.6C25.0399 24 24.7599 24 24.546 24.109C24.3578 24.2049 24.2049 24.3578 24.109 24.546C24 24.7599 24 25.0399 24 25.6V27.4C24 27.9601 24 28.2401 24.109 28.454C24.2049 28.6422 24.3578 28.7951 24.546 28.891C24.7599 29 25.0399 29 25.6 29ZM25.6 16H27.4C27.9601 16 28.2401 16 28.454 15.891C28.6422 15.7951 28.7951 15.6422 28.891 15.454C29 15.2401 29 14.9601 29 14.4V12.6C29 12.0399 29 11.7599 28.891 11.546C28.7951 11.3578 28.6422 11.2049 28.454 11.109C28.2401 11 27.9601 11 27.4 11H25.6C25.0399 11 24.7599 11 24.546 11.109C24.3578 11.2049 24.2049 11.3578 24.109 11.546C24 11.7599 24 12.0399 24 12.6V14.4C24 14.9601 24 15.2401 24.109 15.454C24.2049 15.6422 24.3578 15.7951 24.546 15.891C24.7599 16 25.0399 16 25.6 16ZM12.6 16H14.4C14.9601 16 15.2401 16 15.454 15.891C15.6422 15.7951 15.7951 15.6422 15.891 15.454C16 15.2401 16 14.9601 16 14.4V12.6C16 12.0399 16 11.7599 15.891 11.546C15.7951 11.3578 15.6422 11.2049 15.454 11.109C15.2401 11 14.9601 11 14.4 11H12.6C12.0399 11 11.7599 11 11.546 11.109C11.3578 11.2049 11.2049 11.3578 11.109 11.546C11 11.7599 11 12.0399 11 12.6V14.4C11 14.9601 11 15.2401 11.109 15.454C11.2049 15.6422 11.3578 15.7951 11.546 15.891C11.7599 16 12.0399 16 12.6 16Z" stroke="#51525C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
</svg>
|
|
@@ -5,6 +5,8 @@ export { AnySpendBuySpin } from "./AnySpendBuySpin";
|
|
|
5
5
|
export { AnySpendCollectorClubPurchase } from "./AnySpendCollectorClubPurchase";
|
|
6
6
|
export { AnySpendCustom } from "./AnySpendCustom";
|
|
7
7
|
export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
8
|
+
export { AnySpendDeposit } from "./AnySpendDeposit";
|
|
9
|
+
export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
|
|
8
10
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
|
|
9
11
|
export * from "./AnySpendFingerprintWrapper";
|
|
10
12
|
export { AnySpendNFT } from "./AnySpendNFT";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./useAnyspendCreateOnrampOrder";
|
|
2
2
|
export * from "./useAnyspendCreateOrder";
|
|
3
|
+
export * from "./useCreateDepositFirstOrder";
|
|
3
4
|
export * from "./useAnyspendOrderAndTransactions";
|
|
4
5
|
export * from "./useAnyspendOrderHistory";
|
|
5
6
|
export * from "./useAnyspendQuote";
|
|
@@ -21,6 +21,7 @@ import { useEffect, useMemo, useState } from "react";
|
|
|
21
21
|
import { parseUnits } from "viem";
|
|
22
22
|
import { base, mainnet } from "viem/chains";
|
|
23
23
|
import { components } from "../../types/api";
|
|
24
|
+
import { GetQuoteRequest } from "../../types/api_req_res";
|
|
24
25
|
import { CryptoPaymentMethodType } from "../components/common/CryptoPaymentMethod";
|
|
25
26
|
import { FiatPaymentMethod } from "../components/common/FiatPaymentMethod";
|
|
26
27
|
import { useAutoSelectCryptoPaymentMethod } from "./useAutoSelectCryptoPaymentMethod";
|
|
@@ -52,7 +53,7 @@ interface UseAnyspendFlowProps {
|
|
|
52
53
|
destinationTokenChainId?: number;
|
|
53
54
|
slippage?: number;
|
|
54
55
|
disableUrlParamManagement?: boolean;
|
|
55
|
-
orderType?: "hype_duel" | "custom_exact_in";
|
|
56
|
+
orderType?: "hype_duel" | "custom_exact_in" | "swap";
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
// This hook serves for order hype_duel and custom_exact_in
|
|
@@ -60,7 +61,6 @@ export function useAnyspendFlow({
|
|
|
60
61
|
paymentType = "crypto",
|
|
61
62
|
recipientAddress,
|
|
62
63
|
loadOrder,
|
|
63
|
-
isDepositMode = false,
|
|
64
64
|
onOrderSuccess,
|
|
65
65
|
onTransactionSuccess,
|
|
66
66
|
sourceTokenAddress,
|
|
@@ -199,16 +199,41 @@ export function useAnyspendFlow({
|
|
|
199
199
|
// For fiat payments, always use USDC decimals (6) regardless of selectedSrcToken
|
|
200
200
|
const effectiveDecimals = paymentType === "fiat" ? USDC_BASE.decimals : selectedSrcToken.decimals;
|
|
201
201
|
const activeInputAmountInWei = parseUnits(srcAmount.replace(/,/g, ""), effectiveDecimals).toString();
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
202
|
+
|
|
203
|
+
// Build quote request based on order type
|
|
204
|
+
const quoteRequest: GetQuoteRequest = (() => {
|
|
205
|
+
const baseParams = {
|
|
206
|
+
srcChain: paymentType === "fiat" ? base.id : selectedSrcChainId,
|
|
207
|
+
dstChain: selectedDstChainId ?? base.id,
|
|
208
|
+
srcTokenAddress: paymentType === "fiat" ? USDC_BASE.address : selectedSrcToken.address,
|
|
209
|
+
dstTokenAddress: selectedDstToken.address,
|
|
210
|
+
recipientAddress: effectiveRecipientAddress,
|
|
211
|
+
onrampVendor: paymentType === "fiat" ? getOnrampVendor(selectedFiatPaymentMethod) : undefined,
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
if (orderType === "swap") {
|
|
215
|
+
return {
|
|
216
|
+
...baseParams,
|
|
217
|
+
type: "swap" as const,
|
|
218
|
+
tradeType: "EXACT_INPUT" as const,
|
|
219
|
+
amount: activeInputAmountInWei,
|
|
220
|
+
};
|
|
221
|
+
} else if (orderType === "hype_duel") {
|
|
222
|
+
return {
|
|
223
|
+
...baseParams,
|
|
224
|
+
type: "hype_duel" as const,
|
|
225
|
+
amount: activeInputAmountInWei,
|
|
226
|
+
};
|
|
227
|
+
} else {
|
|
228
|
+
return {
|
|
229
|
+
...baseParams,
|
|
230
|
+
type: "custom_exact_in" as const,
|
|
231
|
+
amount: activeInputAmountInWei,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
})();
|
|
235
|
+
|
|
236
|
+
const { anyspendQuote, isLoadingAnyspendQuote, getAnyspendQuoteError } = useAnyspendQuote(quoteRequest);
|
|
212
237
|
|
|
213
238
|
// Get geo options for fiat
|
|
214
239
|
const { geoData, coinbaseAvailablePaymentMethods, stripeWeb2Support } = useGeoOnrampOptions(
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { anyspendService } from "@b3dotfun/sdk/anyspend/services/anyspend";
|
|
2
|
+
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
3
|
+
import { VisitorData } from "@b3dotfun/sdk/anyspend/types/fingerprint";
|
|
4
|
+
import { normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
5
|
+
import { useB3 } from "@b3dotfun/sdk/global-account/react";
|
|
6
|
+
import { useVisitorData } from "@fingerprintjs/fingerprintjs-pro-react";
|
|
7
|
+
import { useMutation } from "@tanstack/react-query";
|
|
8
|
+
import { useMemo } from "react";
|
|
9
|
+
import { DepositContractConfig } from "../components/AnySpendDeposit";
|
|
10
|
+
|
|
11
|
+
export type CreateDepositFirstOrderParams = {
|
|
12
|
+
recipientAddress: string;
|
|
13
|
+
srcChain: number;
|
|
14
|
+
dstChain: number;
|
|
15
|
+
srcToken: components["schemas"]["Token"];
|
|
16
|
+
dstToken: components["schemas"]["Token"];
|
|
17
|
+
creatorAddress?: string;
|
|
18
|
+
/** Optional contract config for custom execution after deposit */
|
|
19
|
+
contractConfig?: DepositContractConfig;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type UseCreateDepositFirstOrderProps = {
|
|
23
|
+
onSuccess?: (data: any) => void;
|
|
24
|
+
onError?: (error: Error) => void;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Hook for creating deposit_first orders in the Anyspend protocol.
|
|
29
|
+
* This order type doesn't require srcAmount - the user deposits tokens after the order is created.
|
|
30
|
+
*/
|
|
31
|
+
export function useCreateDepositFirstOrder({ onSuccess, onError }: UseCreateDepositFirstOrderProps = {}) {
|
|
32
|
+
const { partnerId } = useB3();
|
|
33
|
+
|
|
34
|
+
const { data: fpData } = useVisitorData({ extendedResult: true }, { immediate: true });
|
|
35
|
+
const visitorData: VisitorData | undefined = fpData && {
|
|
36
|
+
requestId: fpData.requestId,
|
|
37
|
+
visitorId: fpData.visitorId,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const { mutate: createOrder, isPending } = useMutation({
|
|
41
|
+
mutationFn: async (params: CreateDepositFirstOrderParams) => {
|
|
42
|
+
const { recipientAddress, srcChain, dstChain, srcToken, dstToken, creatorAddress, contractConfig } = params;
|
|
43
|
+
|
|
44
|
+
// Build payload based on whether we have a contract config
|
|
45
|
+
const payload = contractConfig
|
|
46
|
+
? {
|
|
47
|
+
functionAbi: contractConfig.functionAbi,
|
|
48
|
+
functionName: contractConfig.functionName,
|
|
49
|
+
functionArgs: contractConfig.functionArgs,
|
|
50
|
+
to: normalizeAddress(contractConfig.to),
|
|
51
|
+
spenderAddress: contractConfig.spenderAddress ? normalizeAddress(contractConfig.spenderAddress) : undefined,
|
|
52
|
+
action: contractConfig.action,
|
|
53
|
+
}
|
|
54
|
+
: {};
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
return await anyspendService.createOrder({
|
|
58
|
+
recipientAddress: normalizeAddress(recipientAddress),
|
|
59
|
+
type: "deposit_first",
|
|
60
|
+
srcChain,
|
|
61
|
+
dstChain,
|
|
62
|
+
srcTokenAddress: normalizeAddress(srcToken.address),
|
|
63
|
+
dstTokenAddress: normalizeAddress(dstToken.address),
|
|
64
|
+
srcAmount: "", // Not required for deposit_first
|
|
65
|
+
payload,
|
|
66
|
+
metadata: {
|
|
67
|
+
srcToken: {
|
|
68
|
+
chainId: srcToken.chainId,
|
|
69
|
+
address: srcToken.address,
|
|
70
|
+
symbol: srcToken.symbol,
|
|
71
|
+
name: srcToken.name,
|
|
72
|
+
decimals: srcToken.decimals,
|
|
73
|
+
metadata: srcToken.metadata || {},
|
|
74
|
+
},
|
|
75
|
+
dstToken: {
|
|
76
|
+
chainId: dstToken.chainId,
|
|
77
|
+
address: dstToken.address,
|
|
78
|
+
symbol: dstToken.symbol,
|
|
79
|
+
name: dstToken.name,
|
|
80
|
+
decimals: dstToken.decimals,
|
|
81
|
+
metadata: dstToken.metadata || {},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
85
|
+
partnerId,
|
|
86
|
+
visitorData,
|
|
87
|
+
});
|
|
88
|
+
} catch (error: any) {
|
|
89
|
+
if (error?.data) {
|
|
90
|
+
throw error.data;
|
|
91
|
+
}
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
onSuccess: (data: any) => {
|
|
96
|
+
onSuccess?.(data);
|
|
97
|
+
},
|
|
98
|
+
onError: (error: Error) => {
|
|
99
|
+
onError?.(error);
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return useMemo(
|
|
104
|
+
() => ({
|
|
105
|
+
createOrder,
|
|
106
|
+
isCreatingOrder: isPending,
|
|
107
|
+
}),
|
|
108
|
+
[createOrder, isPending],
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
|
+
import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
|
|
2
3
|
|
|
3
4
|
export const getStatusDisplay = (
|
|
4
5
|
order: components["schemas"]["Order"],
|
|
5
6
|
): { text: string; status: "processing" | "success" | "failure"; description?: string } => {
|
|
7
|
+
const srcToken = order.metadata?.srcToken;
|
|
8
|
+
const dstToken = order.metadata?.dstToken;
|
|
9
|
+
const formattedSrcAmount = srcToken ? formatTokenAmount(BigInt(order.srcAmount), srcToken.decimals) : undefined;
|
|
10
|
+
const actualDstAmount = order.settlement?.actualDstAmount;
|
|
11
|
+
const formattedActualDstAmount =
|
|
12
|
+
actualDstAmount && dstToken ? formatTokenAmount(BigInt(actualDstAmount), dstToken.decimals) : undefined;
|
|
13
|
+
|
|
6
14
|
switch (order.status) {
|
|
7
|
-
case "scanning_deposit_transaction":
|
|
15
|
+
case "scanning_deposit_transaction": {
|
|
16
|
+
const depositText =
|
|
17
|
+
formattedSrcAmount && srcToken
|
|
18
|
+
? `Awaiting ${formattedSrcAmount} ${srcToken.symbol}`
|
|
19
|
+
: order.onrampMetadata
|
|
20
|
+
? "Awaiting Payment"
|
|
21
|
+
: "Awaiting Deposit";
|
|
8
22
|
return {
|
|
9
|
-
text:
|
|
23
|
+
text: depositText,
|
|
10
24
|
status: "processing",
|
|
11
25
|
};
|
|
26
|
+
}
|
|
12
27
|
case "waiting_stripe_payment":
|
|
13
28
|
return {
|
|
14
29
|
text: "Awaiting Payment",
|
|
@@ -34,16 +49,18 @@ export const getStatusDisplay = (
|
|
|
34
49
|
description: "It will take approximately one minute to complete.",
|
|
35
50
|
};
|
|
36
51
|
case "executed": {
|
|
52
|
+
const receivedText =
|
|
53
|
+
formattedActualDstAmount && dstToken ? `Received ${formattedActualDstAmount} ${dstToken.symbol}` : undefined;
|
|
37
54
|
const { text, description } =
|
|
38
55
|
order.type === "swap"
|
|
39
|
-
? { text: "Swap Complete", description: "Your swap has been completed successfully." }
|
|
56
|
+
? { text: receivedText || "Swap Complete", description: "Your swap has been completed successfully." }
|
|
40
57
|
: order.type === "mint_nft"
|
|
41
58
|
? { text: "NFT Minted", description: "Your NFT has been minted" }
|
|
42
59
|
: order.type === "join_tournament"
|
|
43
60
|
? { text: "Tournament Joined", description: "You have joined the tournament" }
|
|
44
61
|
: order.type === "fund_tournament"
|
|
45
62
|
? { text: "Tournament Funded", description: "You have funded the tournament" }
|
|
46
|
-
: { text: "Order Complete", description: "Your order has been completed" };
|
|
63
|
+
: { text: receivedText || "Order Complete", description: "Your order has been completed" };
|
|
47
64
|
return { text, status: "success", description };
|
|
48
65
|
}
|
|
49
66
|
|
|
@@ -59,8 +76,19 @@ export const getStatusDisplay = (
|
|
|
59
76
|
description: "This order has failed. Please try again or contact support.",
|
|
60
77
|
};
|
|
61
78
|
|
|
79
|
+
case "quoting_after_deposit": {
|
|
80
|
+
return {
|
|
81
|
+
text: "Quoting After Deposit",
|
|
82
|
+
status: "processing",
|
|
83
|
+
description: "Getting quote for the order",
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
62
87
|
default:
|
|
63
|
-
|
|
88
|
+
return {
|
|
89
|
+
text: order.status,
|
|
90
|
+
status: "processing",
|
|
91
|
+
};
|
|
64
92
|
}
|
|
65
93
|
};
|
|
66
94
|
|
|
@@ -151,6 +151,10 @@ export interface AnySpendModalProps extends BaseModalProps {
|
|
|
151
151
|
customUsdInputValues?: string[];
|
|
152
152
|
/** Client-provided reference ID for tracking orders */
|
|
153
153
|
clientReferenceId?: string;
|
|
154
|
+
/** Whether to hide the header */
|
|
155
|
+
hideHeader?: boolean;
|
|
156
|
+
/** When true, disables URL parameter management for swap configuration */
|
|
157
|
+
disableUrlParamManagement?: boolean;
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
/**
|
package/src/styles/index.css
CHANGED
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
--red-100: #fde6d7;
|
|
153
153
|
--green-100: #dff9e8;
|
|
154
154
|
--border-brand: #2a9fff;
|
|
155
|
+
--border-primary: #d1d1d6;
|
|
155
156
|
--yellow-100: #fee6c7;
|
|
156
157
|
--purple-100: #f5edfa;
|
|
157
158
|
--purple-300: #ddc3ef;
|
|
@@ -249,6 +250,7 @@ html[data-theme="dark"] .b3-root,
|
|
|
249
250
|
--red-100: #6a5550;
|
|
250
251
|
--green-100: rgba(68, 90, 76, 0.57);
|
|
251
252
|
--border-brand: #2a9fff;
|
|
253
|
+
--border-primary: #d1d1d6;
|
|
252
254
|
--yellow-100: #957a6c;
|
|
253
255
|
--purple-100: rgba(113, 88, 126, 0.38);
|
|
254
256
|
--purple-300: #a375c3;
|