@deframe-sdk/components 0.1.67 → 0.1.68

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/index.d.mts CHANGED
@@ -2269,6 +2269,10 @@ interface EarnStrategyInfo {
2269
2269
  assetName: string;
2270
2270
  network: string;
2271
2271
  logourl: string;
2272
+ metadata?: {
2273
+ displayName?: string;
2274
+ displayLogo?: string;
2275
+ } | null;
2272
2276
  }
2273
2277
  interface EarnSpotPosition {
2274
2278
  underlyingBalanceUSD: number;
@@ -2297,6 +2301,10 @@ interface EarnStrategy {
2297
2301
  logourl: string;
2298
2302
  apy: number;
2299
2303
  apyFormatted: string;
2304
+ metadata?: {
2305
+ displayName?: string;
2306
+ displayLogo?: string;
2307
+ } | null;
2300
2308
  }
2301
2309
  interface EarnDesktopViewSimpleProps extends Partial<EarnDesktopViewProps> {
2302
2310
  /** Positions data — mirrors WalletPositionsResponse */
package/dist/index.d.ts CHANGED
@@ -2269,6 +2269,10 @@ interface EarnStrategyInfo {
2269
2269
  assetName: string;
2270
2270
  network: string;
2271
2271
  logourl: string;
2272
+ metadata?: {
2273
+ displayName?: string;
2274
+ displayLogo?: string;
2275
+ } | null;
2272
2276
  }
2273
2277
  interface EarnSpotPosition {
2274
2278
  underlyingBalanceUSD: number;
@@ -2297,6 +2301,10 @@ interface EarnStrategy {
2297
2301
  logourl: string;
2298
2302
  apy: number;
2299
2303
  apyFormatted: string;
2304
+ metadata?: {
2305
+ displayName?: string;
2306
+ displayLogo?: string;
2307
+ } | null;
2300
2308
  }
2301
2309
  interface EarnDesktopViewSimpleProps extends Partial<EarnDesktopViewProps> {
2302
2310
  /** Positions data — mirrors WalletPositionsResponse */
package/dist/index.js CHANGED
@@ -10408,6 +10408,24 @@ var GroupedStrategyListView = ({
10408
10408
  ] })
10409
10409
  ] });
10410
10410
  };
10411
+
10412
+ // src/utils/strategyDisplayName.ts
10413
+ function getNormalizedMetadataString(value) {
10414
+ if (typeof value !== "string") return "";
10415
+ return value.trim();
10416
+ }
10417
+ function getStrategyDisplayName(strategy) {
10418
+ var _a, _b;
10419
+ const displayName = getNormalizedMetadataString((_a = strategy == null ? void 0 : strategy.metadata) == null ? void 0 : _a.displayName);
10420
+ if (displayName) return displayName;
10421
+ return (_b = strategy == null ? void 0 : strategy.assetName) != null ? _b : "";
10422
+ }
10423
+ function getStrategyDisplayLogo(strategy) {
10424
+ var _a, _b;
10425
+ const displayLogo = getNormalizedMetadataString((_a = strategy == null ? void 0 : strategy.metadata) == null ? void 0 : _a.displayLogo);
10426
+ if (displayLogo) return displayLogo;
10427
+ return (_b = strategy == null ? void 0 : strategy.logourl) != null ? _b : "";
10428
+ }
10411
10429
  var wrapperBaseClasses = [
10412
10430
  "w-full max-w-[900px] mx-auto flex flex-col",
10413
10431
  "gap-[var(--deframe-widget-size-gap-md)]",
@@ -10517,24 +10535,27 @@ var GroupedStrategyListViewSimple = ({
10517
10535
  {
10518
10536
  "data-test-id": "grouped-strategy-list-view-simple-items",
10519
10537
  className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]",
10520
- children: filteredStrategies.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
10521
- StrategyGridCardSimple,
10522
- {
10523
- logoUrl: s.logourl,
10524
- title: s.assetName,
10525
- subtitle: s.assetName,
10526
- chainName: s.network,
10527
- apyFormatted: s.apyFormatted,
10528
- apyLabel: yieldLabel,
10529
- riskLevel: "low",
10530
- onInvestClick: onDeposit ? () => onDeposit(s.id) : () => {
10531
- },
10532
- onWithdrawClick: onWithdraw ? () => onWithdraw(s.id) : () => {
10538
+ children: filteredStrategies.map((s) => {
10539
+ const displayName = getStrategyDisplayName(s);
10540
+ return /* @__PURE__ */ jsxRuntime.jsx(
10541
+ StrategyGridCardSimple,
10542
+ {
10543
+ logoUrl: getStrategyDisplayLogo(s),
10544
+ title: displayName,
10545
+ subtitle: displayName,
10546
+ chainName: s.network,
10547
+ apyFormatted: s.apyFormatted,
10548
+ apyLabel: yieldLabel,
10549
+ riskLevel: "low",
10550
+ onInvestClick: onDeposit ? () => onDeposit(s.id) : () => {
10551
+ },
10552
+ onWithdrawClick: onWithdraw ? () => onWithdraw(s.id) : () => {
10553
+ },
10554
+ labels: { investLabel, riskLow, riskMedium, riskHigh }
10533
10555
  },
10534
- labels: { investLabel, riskLow, riskMedium, riskHigh }
10535
- },
10536
- s.id
10537
- ))
10556
+ s.id
10557
+ );
10558
+ })
10538
10559
  }
10539
10560
  )
10540
10561
  ] });
@@ -11318,7 +11339,7 @@ var EARN_CATEGORY_DEFINITIONS = [
11318
11339
  {
11319
11340
  id: "dolar",
11320
11341
  imageUrl: mascotUsdUrl,
11321
- assetFilter: ["USDC", "USDT", "DAI", "thbill"]
11342
+ assetFilter: ["USDC", "USDT", "DAI", "thbill", "podsUSDCy"]
11322
11343
  },
11323
11344
  {
11324
11345
  id: "real",
@@ -11459,9 +11480,10 @@ var EarnDesktopViewSimple = ({
11459
11480
  const strategyRows = React6__namespace.default.useMemo(() => {
11460
11481
  return formattedPositions.positions.filter((p) => p.spotPosition.underlyingBalanceUSD > 0.01).map((p) => {
11461
11482
  var _a, _b;
11483
+ const strategyDisplayName = getStrategyDisplayName(p.strategy);
11462
11484
  return {
11463
- logoUrl: p.strategy.logourl,
11464
- assetName: p.strategy.assetName,
11485
+ logoUrl: getStrategyDisplayLogo(p.strategy),
11486
+ assetName: strategyDisplayName,
11465
11487
  network: p.strategy.network,
11466
11488
  investedFormatted: p.spotPosition.investedFormatted,
11467
11489
  earningsFormatted: `${(p.spotPosition.apy * 100).toFixed(2)}%`,