@agg-build/ui 1.2.3 → 1.2.5

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.
@@ -1103,18 +1103,20 @@ var formatChainIdLabel = (chainId) => {
1103
1103
 
1104
1104
  // src/pages/user-profile/components/available-balance-card.tsx
1105
1105
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1106
- var CHAIN_ID_TO_ICON = {
1107
- "1": "ethereum",
1108
- "10": "ethereum",
1109
- // Optimism (EVM)
1110
- "56": "ethereum",
1111
- // BNB Chain (EVM)
1112
- "137": "polygon",
1113
- "324": "ethereum",
1114
- // zkSync (EVM)
1115
- "8453": "base",
1116
- "42161": "arbitrum",
1117
- "792703809": "solana"
1106
+ var BASE_URL = "https://assets.snagsolutions.io";
1107
+ var CHAIN_ID_TO_ICON_URL = {
1108
+ "1": `${BASE_URL}/public/prediction-markets/logos/ETH.svg`,
1109
+ "10": `${BASE_URL}/public/prediction-markets/logos/ETH.svg`,
1110
+ // Optimism
1111
+ "56": `${BASE_URL}/public/prediction-markets/logos/BNB.svg`,
1112
+ "137": `${BASE_URL}/public/prediction-markets/logos/Polygon.svg`,
1113
+ "324": `${BASE_URL}/public/web/icons/chains/zksync/colored.svg`,
1114
+ // zkSync (no new logo)
1115
+ "747": `${BASE_URL}/public/prediction-markets/logos/Flow.svg`,
1116
+ "8453": `${BASE_URL}/public/prediction-markets/logos/Base.svg`,
1117
+ "42161": `${BASE_URL}/public/prediction-markets/logos/Arbitrum.svg`,
1118
+ "2741": `${BASE_URL}/public/prediction-markets/logos/Abstract.svg`,
1119
+ "792703809": `${BASE_URL}/public/prediction-markets/logos/Solana.svg`
1118
1120
  };
1119
1121
  var CHAIN_VENUE_MAP = {
1120
1122
  "137": ["polymarket"],
@@ -1124,17 +1126,19 @@ var CHAIN_VENUE_MAP = {
1124
1126
  "56": ["limitless", "opinion"]
1125
1127
  // BNB
1126
1128
  };
1127
- var chainIconName = (label, key) => {
1128
- if (key && CHAIN_ID_TO_ICON[key]) return CHAIN_ID_TO_ICON[key];
1129
+ var chainIconUrl = (label, key) => {
1130
+ if (key && CHAIN_ID_TO_ICON_URL[key]) return CHAIN_ID_TO_ICON_URL[key];
1129
1131
  const k = label.trim().toLowerCase();
1130
- if (k.includes("polygon")) return "polygon";
1131
- if (k.includes("solana")) return "solana";
1132
- if (k.includes("base")) return "base";
1133
- if (k.includes("arbitrum")) return "arbitrum";
1134
- if (k.includes("optimism")) return "ethereum";
1135
- if (k.includes("bnb")) return "ethereum";
1136
- if (k.includes("zksync")) return "ethereum";
1137
- if (k.includes("ethereum") || k.includes("eth")) return "ethereum";
1132
+ if (k.includes("polygon")) return CHAIN_ID_TO_ICON_URL["137"];
1133
+ if (k.includes("solana")) return CHAIN_ID_TO_ICON_URL["792703809"];
1134
+ if (k.includes("base")) return CHAIN_ID_TO_ICON_URL["8453"];
1135
+ if (k.includes("arbitrum")) return CHAIN_ID_TO_ICON_URL["42161"];
1136
+ if (k.includes("bnb")) return CHAIN_ID_TO_ICON_URL["56"];
1137
+ if (k.includes("flow")) return CHAIN_ID_TO_ICON_URL["747"];
1138
+ if (k.includes("abstract")) return CHAIN_ID_TO_ICON_URL["2741"];
1139
+ if (k.includes("optimism")) return CHAIN_ID_TO_ICON_URL["10"];
1140
+ if (k.includes("zksync")) return CHAIN_ID_TO_ICON_URL["324"];
1141
+ if (k.includes("ethereum") || k.includes("eth")) return CHAIN_ID_TO_ICON_URL["1"];
1138
1142
  return void 0;
1139
1143
  };
1140
1144
  var AvailableBalanceCard = ({
@@ -1186,7 +1190,7 @@ var AvailableBalanceCard = ({
1186
1190
  /* @__PURE__ */ jsx3("div", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: "Balance by network" }),
1187
1191
  /* @__PURE__ */ jsx3("div", { role: "list", className: "agg-balance-list flex flex-col gap-3 w-full", children: chains.map((row) => {
1188
1192
  var _a;
1189
- const icon = chainIconName(row.label, row.key);
1193
+ const iconUrl = chainIconUrl(row.label, row.key);
1190
1194
  return /* @__PURE__ */ jsxs3(
1191
1195
  "div",
1192
1196
  {
@@ -1194,7 +1198,15 @@ var AvailableBalanceCard = ({
1194
1198
  className: "agg-balance-row flex items-center justify-between self-stretch gap-3 w-full",
1195
1199
  children: [
1196
1200
  /* @__PURE__ */ jsxs3("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
1197
- icon ? /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx3(Icon, { name: icon, size: "small", className: "text-agg-foreground" }) }) : /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 items-center justify-center rounded-[4px] border border-agg-separator text-[10px] leading-3 text-agg-muted-foreground", children: row.label.slice(0, 2).toUpperCase() }),
1201
+ iconUrl ? /* @__PURE__ */ jsx3("span", { className: "overflow-clip flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx3(
1202
+ "img",
1203
+ {
1204
+ src: iconUrl,
1205
+ alt: "",
1206
+ "aria-hidden": true,
1207
+ className: "size-full object-contain"
1208
+ }
1209
+ ) }) : /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-agg-separator text-[10px] leading-3 text-agg-muted-foreground", children: row.label.slice(0, 2).toUpperCase() }),
1198
1210
  /* @__PURE__ */ jsx3("span", { className: "truncate font-agg-sans text-agg-sm leading-5 font-agg-normal text-agg-foreground", children: row.label })
1199
1211
  ] }),
1200
1212
  /* @__PURE__ */ jsx3("span", { className: "w-[100px] shrink-0 whitespace-nowrap text-right tabular-nums font-agg-sans text-agg-sm leading-agg-5 font-agg-bold text-agg-foreground", children: row.balance.toLocaleString("en-US", {
@@ -1227,24 +1239,24 @@ var AvailableBalanceCard = ({
1227
1239
  className: "agg-balance-trigger flex min-h-[20px] min-w-[20px] items-center gap-1 rounded-[6px] border-0 bg-agg-secondary-hover p-1.5",
1228
1240
  children: [
1229
1241
  (chains.slice(0, 4).length > 0 ? chains.slice(0, 4) : [{ key: "placeholder", label: "", balance: 0, accountCount: 0 }]).map((row) => {
1230
- const icon = chainIconName(row.label, row.key);
1231
- return icon ? /* @__PURE__ */ jsx3(
1242
+ const iconUrl = chainIconUrl(row.label, row.key);
1243
+ return iconUrl ? /* @__PURE__ */ jsx3(
1232
1244
  "span",
1233
1245
  {
1234
- className: "relative z-0 flex h-4 w-4 items-center justify-center rounded-[4px] bg-agg-secondary",
1235
- children: /* @__PURE__ */ jsx3(Icon, { name: icon, size: "small", className: "text-agg-foreground" })
1246
+ className: "overflow-clip relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary",
1247
+ children: /* @__PURE__ */ jsx3("img", { src: iconUrl, alt: row.label, className: "size-full object-contain" })
1236
1248
  },
1237
1249
  `icon-${row.key}`
1238
1250
  ) : /* @__PURE__ */ jsx3(
1239
1251
  "span",
1240
1252
  {
1241
- className: "relative z-0 flex h-4 w-4 items-center justify-center rounded-[4px] bg-agg-secondary text-[10px] leading-3 text-agg-muted-foreground",
1253
+ className: "relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary text-[10px] leading-3 text-agg-muted-foreground",
1242
1254
  children: row.label ? row.label.slice(0, 2).toUpperCase() : ""
1243
1255
  },
1244
1256
  `icon-${row.key}`
1245
1257
  );
1246
1258
  }),
1247
- chains.length > 4 ? /* @__PURE__ */ jsxs3("span", { className: "relative z-0 flex h-4 w-4 items-center justify-center rounded-[4px] bg-agg-secondary font-agg-sans text-[10px] leading-3 text-agg-muted-foreground", children: [
1259
+ chains.length > 4 ? /* @__PURE__ */ jsxs3("span", { className: "relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary font-agg-sans text-[10px] leading-3 text-agg-muted-foreground", children: [
1248
1260
  "+",
1249
1261
  chains.length - 4
1250
1262
  ] }) : null
@@ -3449,7 +3461,7 @@ var UserProfilePage = ({
3449
3461
  const currentPriceCents = typeof displayCurrentPrice === "number" ? Math.round(displayCurrentPrice * 100) : null;
3450
3462
  const pnlPrefix = (displayPnlValue != null ? displayPnlValue : 0) >= 0 ? "+" : "";
3451
3463
  const pnlPercent = displayPnlPercent == null ? null : displayPnlPercent.toFixed(2);
3452
- const winningOutcomeIds = outcome.winner === true ? outcome.venueBreakdown.map((breakdown) => breakdown.venueMarketOutcomeId).filter((id) => !!id) : [];
3464
+ const winningOutcomeIds = outcome.winner === true ? outcome.venueBreakdown.map((breakdown) => breakdown.venueMarketOutcomeId) : [];
3453
3465
  return {
3454
3466
  id: `${group.targetMarketId}-${outcome.label}-${(_a2 = outcome.title) != null ? _a2 : ""}`,
3455
3467
  eventId,
@@ -1,9 +1,6 @@
1
1
  "use client";
2
2
  import {
3
- ArbitrumIcon,
4
- BaseIcon,
5
3
  BestPricesIcon,
6
- BnbIcon,
7
4
  BoltIcon,
8
5
  Button,
9
6
  CheckCircleIcon,
@@ -14,18 +11,15 @@ import {
14
11
  CreateAccountIcon,
15
12
  CreditCardIcon,
16
13
  DocumentIcon,
17
- EthereumIcon,
18
14
  ExternalLinkIcon,
19
15
  Icon,
20
16
  LinkAccountsIcon,
21
17
  LoadingIcon,
22
18
  Modal,
23
19
  PlaySquareIcon,
24
- PolygonIcon,
25
20
  ProfileIcon,
26
21
  RemoteImage,
27
22
  Select,
28
- SolanaIcon,
29
23
  StayInControlIcon,
30
24
  SuccessCheckIcon,
31
25
  UsdcIcon,
@@ -48,35 +42,46 @@ import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useL
48
42
  import { SVM_CHAIN_IDS, useDepositFlow } from "@agg-build/hooks/deposit";
49
43
 
50
44
  // src/shared/constants.ts
51
- import React from "react";
52
45
  var USDC = {
53
46
  value: "USDC",
54
47
  label: "USDC",
55
48
  iconUrl: "https://assets.snagsolutions.io/public/web/icons/usdc.svg"
56
49
  };
57
50
  var SUPPORTED_NETWORKS = [
51
+ {
52
+ value: "abstract",
53
+ label: "Abstract",
54
+ iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Abstract.svg",
55
+ tokens: [USDC]
56
+ },
58
57
  {
59
58
  value: "arbitrum",
60
59
  label: "Arbitrum One",
61
- iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/arbitrum/colored.svg",
60
+ iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Arbitrum.svg",
62
61
  tokens: [USDC]
63
62
  },
64
63
  {
65
64
  value: "base",
66
65
  label: "Base",
67
- iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/base/colored.svg",
66
+ iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Base.svg",
68
67
  tokens: [USDC]
69
68
  },
70
69
  {
71
70
  value: "bnb",
72
71
  label: "BNB Chain",
73
- iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/bnb/colored.svg",
72
+ iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/BNB.svg",
73
+ tokens: [USDC]
74
+ },
75
+ {
76
+ value: "flow",
77
+ label: "Flow",
78
+ iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Flow.svg",
74
79
  tokens: [USDC]
75
80
  },
76
81
  {
77
82
  value: "mainnet",
78
83
  label: "Ethereum",
79
- iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/eth/colored.svg",
84
+ iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/ETH.svg",
80
85
  tokens: [USDC]
81
86
  },
82
87
  {
@@ -88,13 +93,13 @@ var SUPPORTED_NETWORKS = [
88
93
  {
89
94
  value: "polygon",
90
95
  label: "Polygon Mainnet",
91
- iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/polygon/colored.svg",
96
+ iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Polygon.svg",
92
97
  tokens: [USDC]
93
98
  },
94
99
  {
95
100
  value: "solana",
96
101
  label: "Solana",
97
- iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/solana/dark.svg",
102
+ iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Solana.svg",
98
103
  tokens: [USDC]
99
104
  },
100
105
  {
@@ -105,15 +110,11 @@ var SUPPORTED_NETWORKS = [
105
110
  }
106
111
  ];
107
112
  var mapNetworksToOptions = () => {
108
- return SUPPORTED_NETWORKS.map((n) => {
109
- const Component = CHAIN_ICON_COMPONENTS[n.value];
110
- return {
111
- value: n.value,
112
- label: n.label,
113
- iconUrl: n.iconUrl,
114
- icon: Component ? React.createElement(Component) : void 0
115
- };
116
- });
113
+ return SUPPORTED_NETWORKS.map((n) => ({
114
+ value: n.value,
115
+ label: n.label,
116
+ iconUrl: n.iconUrl
117
+ }));
117
118
  };
118
119
  var DEFAULT_CURRENCY_OPTIONS = [
119
120
  {
@@ -168,27 +169,19 @@ var CHAIN_ID_TO_SLUG = {
168
169
  "56": "bnb",
169
170
  "137": "polygon",
170
171
  "324": "zksync",
172
+ "747": "flow",
171
173
  "8453": "base",
172
174
  "42161": "arbitrum",
175
+ "2741": "abstract",
173
176
  "792703809": "solana"
174
177
  };
175
- var CHAIN_ICON_COMPONENTS = {
176
- mainnet: EthereumIcon,
177
- polygon: PolygonIcon,
178
- base: BaseIcon,
179
- arbitrum: ArbitrumIcon,
180
- solana: SolanaIcon,
181
- bnb: BnbIcon
182
- };
183
178
  var withNetworkIcons = (options) => {
184
179
  const bySlug = new Map(SUPPORTED_NETWORKS.map((n) => [n.value, n.iconUrl]));
185
180
  return options.map((o) => {
186
- var _a, _b, _c;
181
+ var _a, _b;
187
182
  const slug = (_a = CHAIN_ID_TO_SLUG[o.value]) != null ? _a : o.value;
188
- const Component = CHAIN_ICON_COMPONENTS[slug];
189
183
  return __spreadProps(__spreadValues({}, o), {
190
- iconUrl: (_b = o.iconUrl) != null ? _b : bySlug.get(slug),
191
- icon: (_c = o.icon) != null ? _c : Component ? React.createElement(Component) : void 0
184
+ iconUrl: (_b = o.iconUrl) != null ? _b : bySlug.get(slug)
192
185
  });
193
186
  });
194
187
  };
@@ -211,13 +204,29 @@ var mergeSelectOptionsUnique = (base, fill) => {
211
204
  };
212
205
 
213
206
  // src/deposit/deposit-modal.constants.ts
214
- import React2 from "react";
207
+ var BASE_URL = "https://assets.snagsolutions.io";
215
208
  var CARD_NETWORK_OPTIONS = [
216
- { value: "ethereum", label: "Ethereum", icon: React2.createElement(EthereumIcon) },
217
- { value: "arbitrum", label: "Arbitrum", icon: React2.createElement(ArbitrumIcon) },
218
- { value: "base", label: "Base", icon: React2.createElement(BaseIcon) },
219
- { value: "solana", label: "Solana", icon: React2.createElement(SolanaIcon) },
220
- { value: "polygon", label: "Polygon", icon: React2.createElement(PolygonIcon) }
209
+ {
210
+ value: "ethereum",
211
+ label: "Ethereum",
212
+ iconUrl: `${BASE_URL}/public/prediction-markets/logos/ETH.svg`
213
+ },
214
+ {
215
+ value: "arbitrum",
216
+ label: "Arbitrum",
217
+ iconUrl: `${BASE_URL}/public/prediction-markets/logos/Arbitrum.svg`
218
+ },
219
+ { value: "base", label: "Base", iconUrl: `${BASE_URL}/public/prediction-markets/logos/Base.svg` },
220
+ {
221
+ value: "solana",
222
+ label: "Solana",
223
+ iconUrl: `${BASE_URL}/public/prediction-markets/logos/Solana.svg`
224
+ },
225
+ {
226
+ value: "polygon",
227
+ label: "Polygon",
228
+ iconUrl: `${BASE_URL}/public/prediction-markets/logos/Polygon.svg`
229
+ }
221
230
  ];
222
231
  var NETWORK_TO_CURRENCY_CODE = {
223
232
  ethereum: "USDC",