@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 +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +42 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10384,6 +10384,24 @@ var GroupedStrategyListView = ({
|
|
|
10384
10384
|
] })
|
|
10385
10385
|
] });
|
|
10386
10386
|
};
|
|
10387
|
+
|
|
10388
|
+
// src/utils/strategyDisplayName.ts
|
|
10389
|
+
function getNormalizedMetadataString(value) {
|
|
10390
|
+
if (typeof value !== "string") return "";
|
|
10391
|
+
return value.trim();
|
|
10392
|
+
}
|
|
10393
|
+
function getStrategyDisplayName(strategy) {
|
|
10394
|
+
var _a, _b;
|
|
10395
|
+
const displayName = getNormalizedMetadataString((_a = strategy == null ? void 0 : strategy.metadata) == null ? void 0 : _a.displayName);
|
|
10396
|
+
if (displayName) return displayName;
|
|
10397
|
+
return (_b = strategy == null ? void 0 : strategy.assetName) != null ? _b : "";
|
|
10398
|
+
}
|
|
10399
|
+
function getStrategyDisplayLogo(strategy) {
|
|
10400
|
+
var _a, _b;
|
|
10401
|
+
const displayLogo = getNormalizedMetadataString((_a = strategy == null ? void 0 : strategy.metadata) == null ? void 0 : _a.displayLogo);
|
|
10402
|
+
if (displayLogo) return displayLogo;
|
|
10403
|
+
return (_b = strategy == null ? void 0 : strategy.logourl) != null ? _b : "";
|
|
10404
|
+
}
|
|
10387
10405
|
var wrapperBaseClasses = [
|
|
10388
10406
|
"w-full max-w-[900px] mx-auto flex flex-col",
|
|
10389
10407
|
"gap-[var(--deframe-widget-size-gap-md)]",
|
|
@@ -10493,24 +10511,27 @@ var GroupedStrategyListViewSimple = ({
|
|
|
10493
10511
|
{
|
|
10494
10512
|
"data-test-id": "grouped-strategy-list-view-simple-items",
|
|
10495
10513
|
className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]",
|
|
10496
|
-
children: filteredStrategies.map((s) =>
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10514
|
+
children: filteredStrategies.map((s) => {
|
|
10515
|
+
const displayName = getStrategyDisplayName(s);
|
|
10516
|
+
return /* @__PURE__ */ jsx(
|
|
10517
|
+
StrategyGridCardSimple,
|
|
10518
|
+
{
|
|
10519
|
+
logoUrl: getStrategyDisplayLogo(s),
|
|
10520
|
+
title: displayName,
|
|
10521
|
+
subtitle: displayName,
|
|
10522
|
+
chainName: s.network,
|
|
10523
|
+
apyFormatted: s.apyFormatted,
|
|
10524
|
+
apyLabel: yieldLabel,
|
|
10525
|
+
riskLevel: "low",
|
|
10526
|
+
onInvestClick: onDeposit ? () => onDeposit(s.id) : () => {
|
|
10527
|
+
},
|
|
10528
|
+
onWithdrawClick: onWithdraw ? () => onWithdraw(s.id) : () => {
|
|
10529
|
+
},
|
|
10530
|
+
labels: { investLabel, riskLow, riskMedium, riskHigh }
|
|
10509
10531
|
},
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
))
|
|
10532
|
+
s.id
|
|
10533
|
+
);
|
|
10534
|
+
})
|
|
10514
10535
|
}
|
|
10515
10536
|
)
|
|
10516
10537
|
] });
|
|
@@ -11294,7 +11315,7 @@ var EARN_CATEGORY_DEFINITIONS = [
|
|
|
11294
11315
|
{
|
|
11295
11316
|
id: "dolar",
|
|
11296
11317
|
imageUrl: mascotUsdUrl,
|
|
11297
|
-
assetFilter: ["USDC", "USDT", "DAI", "thbill"]
|
|
11318
|
+
assetFilter: ["USDC", "USDT", "DAI", "thbill", "podsUSDCy"]
|
|
11298
11319
|
},
|
|
11299
11320
|
{
|
|
11300
11321
|
id: "real",
|
|
@@ -11435,9 +11456,10 @@ var EarnDesktopViewSimple = ({
|
|
|
11435
11456
|
const strategyRows = React6__default.useMemo(() => {
|
|
11436
11457
|
return formattedPositions.positions.filter((p) => p.spotPosition.underlyingBalanceUSD > 0.01).map((p) => {
|
|
11437
11458
|
var _a, _b;
|
|
11459
|
+
const strategyDisplayName = getStrategyDisplayName(p.strategy);
|
|
11438
11460
|
return {
|
|
11439
|
-
logoUrl: p.strategy
|
|
11440
|
-
assetName:
|
|
11461
|
+
logoUrl: getStrategyDisplayLogo(p.strategy),
|
|
11462
|
+
assetName: strategyDisplayName,
|
|
11441
11463
|
network: p.strategy.network,
|
|
11442
11464
|
investedFormatted: p.spotPosition.investedFormatted,
|
|
11443
11465
|
earningsFormatted: `${(p.spotPosition.apy * 100).toFixed(2)}%`,
|