@b3dotfun/sdk 0.0.46 → 0.0.47-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/README.md +3 -222
- package/dist/cjs/anyspend/react/components/AnySpend.js +13 -14
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +5 -3
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +14 -15
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderHistoryItem.js +6 -3
- package/dist/cjs/anyspend/types/api.d.ts +176 -0
- package/dist/cjs/anyspend/utils/chain.js +1 -1
- package/dist/cjs/shared/react/hooks/__tests__/useCurrencyConversion.test.js +245 -0
- package/dist/cjs/shared/utils/index.d.ts +0 -1
- package/dist/cjs/shared/utils/index.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +14 -15
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +5 -3
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +15 -16
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderHistoryItem.js +8 -5
- package/dist/esm/anyspend/types/api.d.ts +176 -0
- package/dist/esm/anyspend/utils/chain.js +1 -1
- package/dist/esm/shared/react/hooks/__tests__/useCurrencyConversion.test.d.ts +1 -0
- package/dist/esm/shared/react/hooks/__tests__/useCurrencyConversion.test.js +243 -0
- package/dist/esm/shared/utils/index.d.ts +0 -1
- package/dist/esm/shared/utils/index.js +0 -1
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/types/api.d.ts +176 -0
- package/dist/types/shared/react/hooks/__tests__/useCurrencyConversion.test.d.ts +1 -0
- package/dist/types/shared/utils/index.d.ts +0 -1
- package/package.json +2 -21
- package/src/anyspend/react/components/AnySpend.tsx +21 -19
- package/src/anyspend/react/components/AnySpendCustom.tsx +5 -3
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +21 -21
- package/src/anyspend/react/components/common/OrderHistory.tsx +11 -11
- package/src/anyspend/react/components/common/OrderHistoryItem.tsx +124 -129
- package/src/anyspend/types/api.ts +176 -0
- package/src/anyspend/utils/chain.ts +1 -4
- package/src/shared/utils/index.ts +0 -1
- package/dist/cjs/anyspend/react/components/common/ErrorSection.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/common/ErrorSection.js +0 -12
- package/dist/cjs/notifications/index.d.ts +0 -3
- package/dist/cjs/notifications/index.js +0 -25
- package/dist/cjs/notifications/react/hooks/index.d.ts +0 -1
- package/dist/cjs/notifications/react/hooks/index.js +0 -17
- package/dist/cjs/notifications/react/hooks/useNotifications.d.ts +0 -42
- package/dist/cjs/notifications/react/hooks/useNotifications.js +0 -148
- package/dist/cjs/notifications/react/index.d.ts +0 -1
- package/dist/cjs/notifications/react/index.js +0 -17
- package/dist/cjs/notifications/services/api.d.ts +0 -67
- package/dist/cjs/notifications/services/api.js +0 -184
- package/dist/cjs/notifications/services/index.d.ts +0 -1
- package/dist/cjs/notifications/services/index.js +0 -17
- package/dist/cjs/notifications/types/index.d.ts +0 -51
- package/dist/cjs/notifications/types/index.js +0 -2
- package/dist/cjs/shared/utils/auth-token.d.ts +0 -7
- package/dist/cjs/shared/utils/auth-token.js +0 -17
- package/dist/esm/anyspend/react/components/common/ErrorSection.d.ts +0 -6
- package/dist/esm/anyspend/react/components/common/ErrorSection.js +0 -9
- package/dist/esm/notifications/index.d.ts +0 -3
- package/dist/esm/notifications/index.js +0 -7
- package/dist/esm/notifications/react/hooks/index.d.ts +0 -1
- package/dist/esm/notifications/react/hooks/index.js +0 -1
- package/dist/esm/notifications/react/hooks/useNotifications.d.ts +0 -42
- package/dist/esm/notifications/react/hooks/useNotifications.js +0 -145
- package/dist/esm/notifications/react/index.d.ts +0 -1
- package/dist/esm/notifications/react/index.js +0 -1
- package/dist/esm/notifications/services/api.d.ts +0 -67
- package/dist/esm/notifications/services/api.js +0 -179
- package/dist/esm/notifications/services/index.d.ts +0 -1
- package/dist/esm/notifications/services/index.js +0 -1
- package/dist/esm/notifications/types/index.d.ts +0 -51
- package/dist/esm/shared/utils/auth-token.d.ts +0 -7
- package/dist/esm/shared/utils/auth-token.js +0 -11
- package/dist/types/anyspend/react/components/common/ErrorSection.d.ts +0 -6
- package/dist/types/notifications/index.d.ts +0 -3
- package/dist/types/notifications/react/hooks/index.d.ts +0 -1
- package/dist/types/notifications/react/hooks/useNotifications.d.ts +0 -42
- package/dist/types/notifications/react/index.d.ts +0 -1
- package/dist/types/notifications/services/api.d.ts +0 -67
- package/dist/types/notifications/services/index.d.ts +0 -1
- package/dist/types/notifications/types/index.d.ts +0 -51
- package/dist/types/shared/utils/auth-token.d.ts +0 -7
- package/src/anyspend/react/components/common/ErrorSection.tsx +0 -21
- package/src/notifications/index.ts +0 -9
- package/src/notifications/react/hooks/index.ts +0 -1
- package/src/notifications/react/hooks/useNotifications.ts +0 -153
- package/src/notifications/react/index.ts +0 -1
- package/src/notifications/services/api.ts +0 -217
- package/src/notifications/services/index.ts +0 -1
- package/src/notifications/types/index.ts +0 -58
- package/src/shared/utils/auth-token.ts +0 -13
- /package/dist/{esm/notifications/types/index.js → cjs/shared/react/hooks/__tests__/useCurrencyConversion.test.d.ts} +0 -0
|
@@ -12,13 +12,12 @@ import { AnySpendFingerprintWrapper, getFingerprintConfig } from "./AnySpendFing
|
|
|
12
12
|
import { CryptoPaySection } from "./common/CryptoPaySection";
|
|
13
13
|
import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPaymentMethod";
|
|
14
14
|
import { CryptoReceiveSection } from "./common/CryptoReceiveSection";
|
|
15
|
-
import { ErrorSection } from "./common/ErrorSection";
|
|
16
15
|
import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod";
|
|
17
16
|
import { OrderDetails } from "./common/OrderDetails";
|
|
18
17
|
import { PointsDetailPanel } from "./common/PointsDetailPanel";
|
|
19
18
|
import { RecipientSelection } from "./common/RecipientSelection";
|
|
20
19
|
|
|
21
|
-
import { ArrowDown } from "lucide-react";
|
|
20
|
+
import { ArrowDown, Loader2 } from "lucide-react";
|
|
22
21
|
import { PanelOnramp } from "./common/PanelOnramp";
|
|
23
22
|
|
|
24
23
|
const SLIPPAGE_PERCENT = 3;
|
|
@@ -92,7 +91,6 @@ function AnySpendDepositHypeInner({
|
|
|
92
91
|
globalAddress,
|
|
93
92
|
anyspendQuote,
|
|
94
93
|
isLoadingAnyspendQuote,
|
|
95
|
-
getAnyspendQuoteError,
|
|
96
94
|
activeInputAmountInWei,
|
|
97
95
|
geoData,
|
|
98
96
|
coinbaseAvailablePaymentMethods,
|
|
@@ -114,13 +112,15 @@ function AnySpendDepositHypeInner({
|
|
|
114
112
|
});
|
|
115
113
|
|
|
116
114
|
// Button state logic
|
|
117
|
-
const btnInfo: { text: string; disable: boolean; error: boolean } = useMemo(() => {
|
|
118
|
-
if (activeInputAmountInWei === "0") return { text: "Enter an amount", disable: true, error: false };
|
|
119
|
-
if (isLoadingAnyspendQuote) return { text: "Loading quote...", disable: true, error: false };
|
|
120
|
-
if (isCreatingOrder || isCreatingOnrampOrder)
|
|
121
|
-
|
|
122
|
-
if (!
|
|
123
|
-
if (!
|
|
115
|
+
const btnInfo: { text: string; disable: boolean; error: boolean; loading: boolean } = useMemo(() => {
|
|
116
|
+
if (activeInputAmountInWei === "0") return { text: "Enter an amount", disable: true, error: false, loading: false };
|
|
117
|
+
if (isLoadingAnyspendQuote) return { text: "Loading quote...", disable: true, error: false, loading: true };
|
|
118
|
+
if (isCreatingOrder || isCreatingOnrampOrder)
|
|
119
|
+
return { text: "Creating order...", disable: true, error: false, loading: true };
|
|
120
|
+
if (!selectedRecipientAddress) return { text: "Select recipient", disable: false, error: false, loading: false };
|
|
121
|
+
if (!anyspendQuote || !anyspendQuote.success)
|
|
122
|
+
return { text: "Get quote error", disable: true, error: true, loading: false };
|
|
123
|
+
if (!dstAmount) return { text: "No quote available", disable: true, error: true, loading: false };
|
|
124
124
|
|
|
125
125
|
// Check minimum deposit amount (10 HYPE)
|
|
126
126
|
// Use the raw amount from the quote instead of the formatted display string
|
|
@@ -130,25 +130,25 @@ function AnySpendDepositHypeInner({
|
|
|
130
130
|
const actualAmount = parseFloat(rawAmountInWei) / Math.pow(10, decimals);
|
|
131
131
|
|
|
132
132
|
if (actualAmount < 10) {
|
|
133
|
-
return { text: "Minimum 10 HYPE deposit", disable: true, error: true };
|
|
133
|
+
return { text: "Minimum 10 HYPE deposit", disable: true, error: true, loading: false };
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
if (paymentType === "crypto") {
|
|
138
138
|
if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.NONE) {
|
|
139
|
-
return { text: "Choose payment method", disable: false, error: false };
|
|
139
|
+
return { text: "Choose payment method", disable: false, error: false, loading: false };
|
|
140
140
|
}
|
|
141
|
-
return { text: "Continue to deposit", disable: false, error: false };
|
|
141
|
+
return { text: "Continue to deposit", disable: false, error: false, loading: false };
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
if (paymentType === "fiat") {
|
|
145
145
|
if (selectedFiatPaymentMethod === FiatPaymentMethod.NONE) {
|
|
146
|
-
return { text: "Select payment method", disable: false, error: false };
|
|
146
|
+
return { text: "Select payment method", disable: false, error: false, loading: false };
|
|
147
147
|
}
|
|
148
|
-
return { text: "Buy", disable: false, error: false };
|
|
148
|
+
return { text: "Buy", disable: false, error: false, loading: false };
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
return { text: "Continue to deposit", disable: false, error: false };
|
|
151
|
+
return { text: "Continue to deposit", disable: false, error: false, loading: false };
|
|
152
152
|
}, [
|
|
153
153
|
activeInputAmountInWei,
|
|
154
154
|
isLoadingAnyspendQuote,
|
|
@@ -283,15 +283,12 @@ function AnySpendDepositHypeInner({
|
|
|
283
283
|
</div>
|
|
284
284
|
</div>
|
|
285
285
|
|
|
286
|
-
{/* Error message section */}
|
|
287
|
-
<ErrorSection error={getAnyspendQuoteError} />
|
|
288
|
-
|
|
289
286
|
{/* Main button section */}
|
|
290
287
|
<motion.div
|
|
291
288
|
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
292
289
|
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
293
290
|
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
294
|
-
className={cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"
|
|
291
|
+
className={cn("mt-4 flex w-full max-w-[460px] flex-col gap-2")}
|
|
295
292
|
>
|
|
296
293
|
<ShinyButton
|
|
297
294
|
accentColor={"hsl(var(--as-brand))"}
|
|
@@ -303,7 +300,10 @@ function AnySpendDepositHypeInner({
|
|
|
303
300
|
)}
|
|
304
301
|
textClassName={cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white")}
|
|
305
302
|
>
|
|
306
|
-
|
|
303
|
+
<div className="flex items-center justify-center gap-2">
|
|
304
|
+
{btnInfo.loading && <Loader2 className="h-4 w-4 animate-spin" />}
|
|
305
|
+
{btnInfo.text}
|
|
306
|
+
</div>
|
|
307
307
|
</ShinyButton>
|
|
308
308
|
</motion.div>
|
|
309
309
|
|
|
@@ -17,37 +17,37 @@ export function OrderHistory({ mode, onBack, onSelectOrder }: OrderHistoryProps)
|
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<>
|
|
20
|
-
<div className="mb-
|
|
21
|
-
<Button onClick={onBack} variant="ghost" size="icon">
|
|
22
|
-
<ArrowLeft className="h-
|
|
20
|
+
<div className="mb-8 flex w-full items-center gap-3">
|
|
21
|
+
<Button onClick={onBack} variant="ghost" size="icon" className="hover:bg-as-surface-secondary">
|
|
22
|
+
<ArrowLeft className="h-5 w-5" />
|
|
23
23
|
</Button>
|
|
24
24
|
<div className="flex-1">
|
|
25
|
-
<h3 className="text-
|
|
26
|
-
<p className="text-as-primary/30 text-sm">View your past transactions</p>
|
|
25
|
+
<h3 className="text-as-primary text-2xl font-bold">Order History</h3>
|
|
27
26
|
</div>
|
|
28
27
|
<Button
|
|
29
28
|
variant="ghost"
|
|
30
29
|
size="icon"
|
|
30
|
+
className="hover:bg-as-surface-secondary"
|
|
31
31
|
onClick={() => {
|
|
32
32
|
refetchOrderHistory();
|
|
33
33
|
}}
|
|
34
34
|
>
|
|
35
|
-
<RefreshCcw className="text-as-
|
|
35
|
+
<RefreshCcw className="text-as-secondary hover:text-as-primary h-5 w-5 cursor-pointer transition-all hover:rotate-180" />
|
|
36
36
|
</Button>
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
39
|
{isLoadingOrderHistory ? (
|
|
40
|
-
<div className="w-full space-y-
|
|
40
|
+
<div className="w-full space-y-3">
|
|
41
41
|
{[1, 2, 3].map(i => (
|
|
42
|
-
<Skeleton key={i} className="h-[
|
|
42
|
+
<Skeleton key={i} className="h-[180px] w-full rounded-2xl" />
|
|
43
43
|
))}
|
|
44
44
|
</div>
|
|
45
45
|
) : !orderHistory?.length ? (
|
|
46
|
-
<div className="bg-as-
|
|
47
|
-
<p className="text-
|
|
46
|
+
<div className="bg-as-surface-secondary w-full rounded-2xl p-12 text-center">
|
|
47
|
+
<p className="text-as-secondary text-sm">No order history found</p>
|
|
48
48
|
</div>
|
|
49
49
|
) : (
|
|
50
|
-
<div className="mb-12 w-full space-y-
|
|
50
|
+
<div className="mb-12 w-full space-y-3">
|
|
51
51
|
{[...orderHistory]
|
|
52
52
|
.sort((a, b) => b.createdAt - a.createdAt)
|
|
53
53
|
.map(order => (
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ALL_CHAINS, getChainName, getStatusDisplay } from "@b3dotfun/sdk/anyspend";
|
|
2
|
-
import { Badge,
|
|
2
|
+
import { Badge, useIsMobile } from "@b3dotfun/sdk/global-account/react";
|
|
3
3
|
import { cn } from "@b3dotfun/sdk/shared/utils";
|
|
4
4
|
import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
|
|
5
|
-
import {
|
|
5
|
+
import { getVendorDisplayName } from "@b3dotfun/sdk/shared/utils/payment.utils";
|
|
6
|
+
import { ArrowRight } from "lucide-react";
|
|
6
7
|
import TimeAgo from "react-timeago";
|
|
7
|
-
import { b3 } from "viem/chains";
|
|
8
8
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
9
9
|
|
|
10
10
|
interface OrderHistoryItemProps {
|
|
@@ -31,153 +31,148 @@ export function OrderHistoryItem({ order, onSelectOrder, mode }: OrderHistoryIte
|
|
|
31
31
|
|
|
32
32
|
const isSmallView = useIsMobile() || mode === "modal";
|
|
33
33
|
|
|
34
|
+
// Check if this is a one-click payment order
|
|
35
|
+
const isOneClickPayment = !!order.oneClickBuyUrl;
|
|
36
|
+
const vendorName = order.onrampMetadata?.vendor ? getVendorDisplayName(order.onrampMetadata.vendor) : null;
|
|
37
|
+
|
|
34
38
|
return (
|
|
35
39
|
<div
|
|
36
40
|
key={`anyspend-${order.id}`}
|
|
37
41
|
className={cn(
|
|
38
|
-
"bg-as-
|
|
39
|
-
onSelectOrder && "
|
|
42
|
+
"bg-as-surface-secondary hover:bg-as-surface-tertiary rounded-xl p-4 transition-all",
|
|
43
|
+
onSelectOrder && "cursor-pointer",
|
|
40
44
|
)}
|
|
41
45
|
onClick={() => onSelectOrder?.(order.id)}
|
|
42
46
|
>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
className={cn(
|
|
46
|
-
"px-3 py-1 text-xs",
|
|
47
|
-
orderDisplayStatus === "processing" && "bg-yellow-500/10 text-yellow-500",
|
|
48
|
-
orderDisplayStatus === "success" && "bg-green-500/10 text-green-500",
|
|
49
|
-
orderDisplayStatus === "failure" && "bg-red-500/10 text-red-500",
|
|
50
|
-
)}
|
|
51
|
-
>
|
|
52
|
-
{orderStatusText}
|
|
53
|
-
</Badge>
|
|
54
|
-
|
|
47
|
+
{/* Header: Status and Time */}
|
|
48
|
+
<div className="mb-3 flex items-center justify-between">
|
|
55
49
|
<div className="flex items-center gap-2">
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
<div
|
|
51
|
+
className={cn(
|
|
52
|
+
"text-xs font-semibold",
|
|
53
|
+
orderDisplayStatus === "processing" && "text-yellow-600",
|
|
54
|
+
orderDisplayStatus === "success" && "text-green-600",
|
|
55
|
+
orderDisplayStatus === "failure" && "text-red-600",
|
|
56
|
+
)}
|
|
57
|
+
>
|
|
58
|
+
{orderStatusText}
|
|
59
|
+
</div>
|
|
60
|
+
{isOneClickPayment && vendorName && (
|
|
61
|
+
<Badge variant="outline" className="text-as-secondary px-2 py-0.5 text-[10px]">
|
|
62
|
+
{vendorName}
|
|
63
|
+
</Badge>
|
|
64
|
+
)}
|
|
65
|
+
</div>
|
|
66
|
+
<div className="text-as-secondary text-[10px] font-medium uppercase tracking-wide">
|
|
67
|
+
<TimeAgo date={new Date(order.createdAt)} />
|
|
59
68
|
</div>
|
|
60
69
|
</div>
|
|
61
70
|
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<img src={dstToken.metadata.logoURI} alt={dstToken.symbol} className="h-6 w-6" />
|
|
81
|
-
)}
|
|
82
|
-
{nft ? nft.name : tournament ? tournament.name : dstToken.symbol}
|
|
83
|
-
</span>
|
|
84
|
-
|
|
85
|
-
<span className="flex items-center gap-2">
|
|
86
|
-
{` on `}
|
|
87
|
-
<span className="text-as-primary flex items-center gap-2">
|
|
88
|
-
<img src={ALL_CHAINS[order.dstChain]?.logoUrl} alt={getChainName(order.dstChain)} className="h-4" />
|
|
89
|
-
{order.dstChain !== b3.id && getChainName(order.dstChain)}
|
|
90
|
-
</span>
|
|
91
|
-
</span>
|
|
92
|
-
</h3>
|
|
93
|
-
|
|
94
|
-
<p className="label-style text-as-primary/30 mt-1 flex items-center gap-2 text-xs">
|
|
95
|
-
Paying via{" "}
|
|
96
|
-
<img src="https://cdn.b3.fun/coinbase-wordmark-blue.svg" alt="Coinbase" className="-mt-1 h-3" />
|
|
97
|
-
</p>
|
|
71
|
+
{/* Main Content: From -> To */}
|
|
72
|
+
<div className={cn("flex items-center", isSmallView ? "gap-2" : "gap-4")}>
|
|
73
|
+
{/* From Section */}
|
|
74
|
+
<div className={cn("flex min-w-0 flex-1 items-center", isSmallView ? "gap-1.5" : "gap-2")}>
|
|
75
|
+
<img
|
|
76
|
+
src={order.metadata.srcToken.metadata.logoURI}
|
|
77
|
+
alt={order.metadata.srcToken.symbol}
|
|
78
|
+
className={cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8")}
|
|
79
|
+
/>
|
|
80
|
+
<div className="min-w-0 flex-1">
|
|
81
|
+
<div className={cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm")}>
|
|
82
|
+
{formatTokenAmount(BigInt(order.srcAmount), order.metadata.srcToken.decimals)}{" "}
|
|
83
|
+
{order.metadata.srcToken.symbol}
|
|
84
|
+
</div>
|
|
85
|
+
<div className={cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs")}>
|
|
86
|
+
<img src={ALL_CHAINS[order.srcChain]?.logoUrl} alt={getChainName(order.srcChain)} className="h-3 w-3" />
|
|
87
|
+
<span className="truncate">{getChainName(order.srcChain)}</span>
|
|
88
|
+
</div>
|
|
98
89
|
</div>
|
|
99
90
|
</div>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
91
|
+
|
|
92
|
+
{/* Arrow */}
|
|
93
|
+
<ArrowRight className={cn("text-as-secondary shrink-0 opacity-30", isSmallView ? "h-4 w-4" : "h-5 w-5")} />
|
|
94
|
+
|
|
95
|
+
{/* To Section */}
|
|
96
|
+
<div className={cn("flex min-w-0 flex-1 items-center", isSmallView ? "gap-1.5" : "gap-2")}>
|
|
97
|
+
{nft ? (
|
|
98
|
+
<>
|
|
104
99
|
<img
|
|
105
|
-
src={
|
|
106
|
-
alt={
|
|
107
|
-
className="h-
|
|
100
|
+
src={nft.imageUrl}
|
|
101
|
+
alt={nft.name}
|
|
102
|
+
className={cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8")}
|
|
108
103
|
/>
|
|
109
|
-
<div className="
|
|
110
|
-
{
|
|
111
|
-
|
|
104
|
+
<div className="min-w-0 flex-1">
|
|
105
|
+
<div className={cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm")}>
|
|
106
|
+
{nft.name}
|
|
107
|
+
</div>
|
|
108
|
+
<div
|
|
109
|
+
className={cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs")}
|
|
110
|
+
>
|
|
111
|
+
<img
|
|
112
|
+
src={ALL_CHAINS[order.dstChain]?.logoUrl}
|
|
113
|
+
alt={getChainName(order.dstChain)}
|
|
114
|
+
className="h-3 w-3"
|
|
115
|
+
/>
|
|
116
|
+
<span className="truncate">{getChainName(order.dstChain)}</span>
|
|
117
|
+
</div>
|
|
112
118
|
</div>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
from
|
|
119
|
+
</>
|
|
120
|
+
) : tournament ? (
|
|
121
|
+
<>
|
|
117
122
|
<img
|
|
118
|
-
src={
|
|
119
|
-
alt={
|
|
120
|
-
className={cn("
|
|
123
|
+
src={tournament.imageUrl}
|
|
124
|
+
alt={tournament.name}
|
|
125
|
+
className={cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8")}
|
|
121
126
|
/>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<>
|
|
141
|
-
<img src={tournament.imageUrl} alt={tournament.name} className="h-6 w-6 rounded-full" />
|
|
142
|
-
<div className="text-as-primary overflow-hidden text-ellipsis whitespace-nowrap text-xl font-semibold">
|
|
143
|
-
{tournament.name}
|
|
144
|
-
</div>
|
|
145
|
-
</>
|
|
146
|
-
) : (
|
|
147
|
-
<>
|
|
148
|
-
<img src={dstToken.metadata.logoURI} alt={dstToken.symbol} className="h-6 w-6 rounded-full" />
|
|
149
|
-
<div className="text-as-primary overflow-hidden text-ellipsis whitespace-nowrap text-xl font-semibold">
|
|
150
|
-
{formatTokenAmount(
|
|
151
|
-
actualDstAmount
|
|
152
|
-
? BigInt(actualDstAmount)
|
|
153
|
-
: expectedDstAmount
|
|
154
|
-
? BigInt(expectedDstAmount)
|
|
155
|
-
: BigInt(0),
|
|
156
|
-
dstToken.decimals,
|
|
157
|
-
)}{" "}
|
|
158
|
-
{dstToken.symbol}
|
|
159
|
-
</div>
|
|
160
|
-
</>
|
|
161
|
-
)}
|
|
162
|
-
</div>
|
|
163
|
-
<div className="label-style text-as-primary/50 flex items-center gap-2 text-sm">
|
|
164
|
-
to
|
|
127
|
+
<div className="min-w-0 flex-1">
|
|
128
|
+
<div className={cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm")}>
|
|
129
|
+
{tournament.name}
|
|
130
|
+
</div>
|
|
131
|
+
<div
|
|
132
|
+
className={cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs")}
|
|
133
|
+
>
|
|
134
|
+
<img
|
|
135
|
+
src={ALL_CHAINS[order.dstChain]?.logoUrl}
|
|
136
|
+
alt={getChainName(order.dstChain)}
|
|
137
|
+
className="h-3 w-3"
|
|
138
|
+
/>
|
|
139
|
+
<span className="truncate">{getChainName(order.dstChain)}</span>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</>
|
|
143
|
+
) : (
|
|
144
|
+
<>
|
|
165
145
|
<img
|
|
166
|
-
src={
|
|
167
|
-
alt={
|
|
168
|
-
className={cn("
|
|
146
|
+
src={dstToken.metadata.logoURI}
|
|
147
|
+
alt={dstToken.symbol}
|
|
148
|
+
className={cn("shrink-0 rounded-full", isSmallView ? "h-7 w-7" : "h-8 w-8")}
|
|
169
149
|
/>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
150
|
+
<div className="min-w-0 flex-1">
|
|
151
|
+
<div className={cn("text-as-primary truncate font-bold", isSmallView ? "text-xs" : "text-sm")}>
|
|
152
|
+
{formatTokenAmount(
|
|
153
|
+
actualDstAmount
|
|
154
|
+
? BigInt(actualDstAmount)
|
|
155
|
+
: expectedDstAmount
|
|
156
|
+
? BigInt(expectedDstAmount)
|
|
157
|
+
: BigInt(0),
|
|
158
|
+
dstToken.decimals,
|
|
159
|
+
)}{" "}
|
|
160
|
+
{dstToken.symbol}
|
|
161
|
+
</div>
|
|
162
|
+
<div
|
|
163
|
+
className={cn("text-as-secondary flex items-center gap-1", isSmallView ? "text-[10px]" : "text-xs")}
|
|
164
|
+
>
|
|
165
|
+
<img
|
|
166
|
+
src={ALL_CHAINS[order.dstChain]?.logoUrl}
|
|
167
|
+
alt={getChainName(order.dstChain)}
|
|
168
|
+
className="h-3 w-3"
|
|
169
|
+
/>
|
|
170
|
+
<span className="truncate">{getChainName(order.dstChain)}</span>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
</>
|
|
174
|
+
)}
|
|
173
175
|
</div>
|
|
174
|
-
)}
|
|
175
|
-
|
|
176
|
-
<div className="flex items-center justify-end">
|
|
177
|
-
<Button variant="link" size="sm" className="h-auto" onClick={() => onSelectOrder?.(order.id)}>
|
|
178
|
-
{orderDisplayStatus === "processing" ? "Proceed with payment" : "Details"}{" "}
|
|
179
|
-
<ArrowRight className="ml-2 h-3 w-3" />
|
|
180
|
-
</Button>
|
|
181
176
|
</div>
|
|
182
177
|
</div>
|
|
183
178
|
);
|