@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.
Files changed (89) hide show
  1. package/README.md +3 -222
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +13 -14
  3. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +5 -3
  4. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +14 -15
  5. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +2 -2
  6. package/dist/cjs/anyspend/react/components/common/OrderHistoryItem.js +6 -3
  7. package/dist/cjs/anyspend/types/api.d.ts +176 -0
  8. package/dist/cjs/anyspend/utils/chain.js +1 -1
  9. package/dist/cjs/shared/react/hooks/__tests__/useCurrencyConversion.test.js +245 -0
  10. package/dist/cjs/shared/utils/index.d.ts +0 -1
  11. package/dist/cjs/shared/utils/index.js +0 -1
  12. package/dist/esm/anyspend/react/components/AnySpend.js +14 -15
  13. package/dist/esm/anyspend/react/components/AnySpendCustom.js +5 -3
  14. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +15 -16
  15. package/dist/esm/anyspend/react/components/common/OrderHistory.js +2 -2
  16. package/dist/esm/anyspend/react/components/common/OrderHistoryItem.js +8 -5
  17. package/dist/esm/anyspend/types/api.d.ts +176 -0
  18. package/dist/esm/anyspend/utils/chain.js +1 -1
  19. package/dist/esm/shared/react/hooks/__tests__/useCurrencyConversion.test.d.ts +1 -0
  20. package/dist/esm/shared/react/hooks/__tests__/useCurrencyConversion.test.js +243 -0
  21. package/dist/esm/shared/utils/index.d.ts +0 -1
  22. package/dist/esm/shared/utils/index.js +0 -1
  23. package/dist/styles/index.css +1 -1
  24. package/dist/types/anyspend/types/api.d.ts +176 -0
  25. package/dist/types/shared/react/hooks/__tests__/useCurrencyConversion.test.d.ts +1 -0
  26. package/dist/types/shared/utils/index.d.ts +0 -1
  27. package/package.json +2 -21
  28. package/src/anyspend/react/components/AnySpend.tsx +21 -19
  29. package/src/anyspend/react/components/AnySpendCustom.tsx +5 -3
  30. package/src/anyspend/react/components/AnyspendDepositHype.tsx +21 -21
  31. package/src/anyspend/react/components/common/OrderHistory.tsx +11 -11
  32. package/src/anyspend/react/components/common/OrderHistoryItem.tsx +124 -129
  33. package/src/anyspend/types/api.ts +176 -0
  34. package/src/anyspend/utils/chain.ts +1 -4
  35. package/src/shared/utils/index.ts +0 -1
  36. package/dist/cjs/anyspend/react/components/common/ErrorSection.d.ts +0 -6
  37. package/dist/cjs/anyspend/react/components/common/ErrorSection.js +0 -12
  38. package/dist/cjs/notifications/index.d.ts +0 -3
  39. package/dist/cjs/notifications/index.js +0 -25
  40. package/dist/cjs/notifications/react/hooks/index.d.ts +0 -1
  41. package/dist/cjs/notifications/react/hooks/index.js +0 -17
  42. package/dist/cjs/notifications/react/hooks/useNotifications.d.ts +0 -42
  43. package/dist/cjs/notifications/react/hooks/useNotifications.js +0 -148
  44. package/dist/cjs/notifications/react/index.d.ts +0 -1
  45. package/dist/cjs/notifications/react/index.js +0 -17
  46. package/dist/cjs/notifications/services/api.d.ts +0 -67
  47. package/dist/cjs/notifications/services/api.js +0 -184
  48. package/dist/cjs/notifications/services/index.d.ts +0 -1
  49. package/dist/cjs/notifications/services/index.js +0 -17
  50. package/dist/cjs/notifications/types/index.d.ts +0 -51
  51. package/dist/cjs/notifications/types/index.js +0 -2
  52. package/dist/cjs/shared/utils/auth-token.d.ts +0 -7
  53. package/dist/cjs/shared/utils/auth-token.js +0 -17
  54. package/dist/esm/anyspend/react/components/common/ErrorSection.d.ts +0 -6
  55. package/dist/esm/anyspend/react/components/common/ErrorSection.js +0 -9
  56. package/dist/esm/notifications/index.d.ts +0 -3
  57. package/dist/esm/notifications/index.js +0 -7
  58. package/dist/esm/notifications/react/hooks/index.d.ts +0 -1
  59. package/dist/esm/notifications/react/hooks/index.js +0 -1
  60. package/dist/esm/notifications/react/hooks/useNotifications.d.ts +0 -42
  61. package/dist/esm/notifications/react/hooks/useNotifications.js +0 -145
  62. package/dist/esm/notifications/react/index.d.ts +0 -1
  63. package/dist/esm/notifications/react/index.js +0 -1
  64. package/dist/esm/notifications/services/api.d.ts +0 -67
  65. package/dist/esm/notifications/services/api.js +0 -179
  66. package/dist/esm/notifications/services/index.d.ts +0 -1
  67. package/dist/esm/notifications/services/index.js +0 -1
  68. package/dist/esm/notifications/types/index.d.ts +0 -51
  69. package/dist/esm/shared/utils/auth-token.d.ts +0 -7
  70. package/dist/esm/shared/utils/auth-token.js +0 -11
  71. package/dist/types/anyspend/react/components/common/ErrorSection.d.ts +0 -6
  72. package/dist/types/notifications/index.d.ts +0 -3
  73. package/dist/types/notifications/react/hooks/index.d.ts +0 -1
  74. package/dist/types/notifications/react/hooks/useNotifications.d.ts +0 -42
  75. package/dist/types/notifications/react/index.d.ts +0 -1
  76. package/dist/types/notifications/services/api.d.ts +0 -67
  77. package/dist/types/notifications/services/index.d.ts +0 -1
  78. package/dist/types/notifications/types/index.d.ts +0 -51
  79. package/dist/types/shared/utils/auth-token.d.ts +0 -7
  80. package/src/anyspend/react/components/common/ErrorSection.tsx +0 -21
  81. package/src/notifications/index.ts +0 -9
  82. package/src/notifications/react/hooks/index.ts +0 -1
  83. package/src/notifications/react/hooks/useNotifications.ts +0 -153
  84. package/src/notifications/react/index.ts +0 -1
  85. package/src/notifications/services/api.ts +0 -217
  86. package/src/notifications/services/index.ts +0 -1
  87. package/src/notifications/types/index.ts +0 -58
  88. package/src/shared/utils/auth-token.ts +0 -13
  89. /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) return { text: "Creating order...", disable: true, error: false };
121
- if (!selectedRecipientAddress) return { text: "Select recipient", disable: false, error: false };
122
- if (!anyspendQuote || !anyspendQuote.success) return { text: "Get quote error", disable: true, error: true };
123
- if (!dstAmount) return { text: "No quote available", disable: true, error: true };
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", getAnyspendQuoteError && "mt-0")}
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
- {btnInfo.text}
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-6 flex w-full items-center gap-4">
21
- <Button onClick={onBack} variant="ghost" size="icon">
22
- <ArrowLeft className="h-4 w-4" />
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-xl font-semibold">Order History</h3>
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-primary/30 hover:text-as-primary h-4 w-4 cursor-pointer transition-all hover:rotate-180" />
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-4">
40
+ <div className="w-full space-y-3">
41
41
  {[1, 2, 3].map(i => (
42
- <Skeleton key={i} className="h-[160px] w-full rounded-lg" />
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-light-brand w-full rounded-lg border p-8 text-center">
47
- <p className="text-b3-react-muted-foreground">No order history found</p>
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-4">
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, Button, useIsMobile } from "@b3dotfun/sdk/global-account/react";
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 { ArrowRight, ChevronDown } from "lucide-react";
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-light-brand/20 rounded-lg border p-4",
39
- onSelectOrder && "hover:bg-as-light-brand/30 hover:border-as-brand cursor-pointer transition-colors",
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
- <div className="flex items-center justify-between">
44
- <Badge
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
- <span className="text-nano label-style text-as-primary/30">
57
- <TimeAgo date={new Date(order.createdAt)} />
58
- </span>
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
- {order.oneClickBuyUrl ? (
63
- <div className="mb-3 mt-4 flex items-center gap-1">
64
- <div className="bg-b3-react-background flex flex-1 flex-col gap-1 rounded-lg border p-4 px-5">
65
- <h3 className="text-as-primary/50 flex items-center gap-2 text-xl font-semibold">
66
- <span>
67
- {"Buy "}
68
- <span className="text-as-primary">
69
- ${formatTokenAmount(BigInt(order.srcAmount), order.metadata.srcToken.decimals)}
70
- </span>
71
- {` of`}
72
- </span>
73
-
74
- <span className="text-as-primary flex items-center gap-2">
75
- {nft ? (
76
- <img src={nft.imageUrl} alt={nft.name} className="h-6 w-6" />
77
- ) : tournament ? (
78
- <img src={tournament.imageUrl} alt={tournament.name} className="h-6 w-6" />
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
- <div className={cn("mb-3 mt-4 flex items-center gap-1", isSmallView && "flex-col")}>
102
- <div className="bg-b3-react-background flex w-full flex-1 flex-col gap-1 overflow-hidden rounded-lg border p-4 px-5">
103
- <div className="flex items-center gap-2">
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={order.metadata.srcToken.metadata.logoURI}
106
- alt={order.metadata.srcToken.symbol}
107
- className="h-6 w-6 rounded-full"
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="text-as-primary flex items-center gap-2 overflow-hidden text-ellipsis whitespace-nowrap text-xl font-semibold">
110
- {formatTokenAmount(BigInt(order.srcAmount), order.metadata.srcToken.decimals)}{" "}
111
- {order.metadata.srcToken.symbol}
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
- </div>
114
-
115
- <div className="label-style text-as-primary/50 flex items-center gap-2 text-sm">
116
- from
119
+ </>
120
+ ) : tournament ? (
121
+ <>
117
122
  <img
118
- src={ALL_CHAINS[order.srcChain]?.logoUrl}
119
- alt={getChainName(order.srcChain)}
120
- className={cn("h-4", order.srcChain !== b3.id && "w-4 rounded-full", order.srcChain === b3.id && "h-3")}
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
- {getChainName(order.srcChain)}
123
- </div>
124
- </div>
125
-
126
- <div className={cn("h-8 w-8 shrink-0 -rotate-90 opacity-30", isSmallView && "rotate-0")}>
127
- <ChevronDown className="h-8 w-8" />
128
- </div>
129
-
130
- <div className="bg-b3-react-background flex w-full flex-1 flex-col gap-1 overflow-hidden rounded-lg border p-4 px-5">
131
- <div className="flex items-center gap-2">
132
- {nft ? (
133
- <>
134
- <img src={nft.imageUrl} alt={nft.name} className="h-6 w-6 rounded-full" />
135
- <div className="text-as-primary overflow-hidden text-ellipsis whitespace-nowrap text-xl font-semibold">
136
- {nft.name}
137
- </div>
138
- </>
139
- ) : tournament ? (
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={ALL_CHAINS[order.dstChain]?.logoUrl}
167
- alt={getChainName(order.dstChain)}
168
- className={cn("h-4", order.dstChain !== b3.id && "w-4 rounded-full", order.dstChain === b3.id && "h-3")}
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
- {getChainName(order.dstChain)}
171
- </div>
172
- </div>
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
  );