@deframe-sdk/components 0.1.51 → 0.1.52
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 +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -953,7 +953,7 @@ interface HistoryDetailsLabels {
|
|
|
953
953
|
transactionDetailsTitle: string;
|
|
954
954
|
}
|
|
955
955
|
|
|
956
|
-
type HistoryDetailsStatus = 'SUCCESS' | 'PENDING' | 'FAILED' | 'REFUNDED';
|
|
956
|
+
type HistoryDetailsStatus = 'SUCCESS' | 'PENDING' | 'FAILED' | 'REFUNDED' | 'INITIAL';
|
|
957
957
|
|
|
958
958
|
type TransactionStepStatus = 'completed' | 'processing' | 'failed';
|
|
959
959
|
interface TransactionStep {
|
|
@@ -1771,7 +1771,7 @@ interface ChooseNetworkAndAssetViewSimpleProps {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
declare function ChooseNetworkAndAssetViewSimple({ isOpen, onClose, networks, selectedNetwork, onNetworkSelect, displayedTokens, findBalance, formatTokenAmount, formatCurrencyValue, onAssetClick, onSearch, autoFocus, hasMore, onLoadMore, isFetching, labels, }: ChooseNetworkAndAssetViewSimpleProps): react_jsx_runtime.JSX.Element;
|
|
1773
1773
|
|
|
1774
|
-
type HistoryListItemStatus = 'SUCCESS' | 'PENDING' | 'FAILED' | 'REFUNDED';
|
|
1774
|
+
type HistoryListItemStatus = 'SUCCESS' | 'PENDING' | 'FAILED' | 'REFUNDED' | 'INITIAL';
|
|
1775
1775
|
type HistoryListItemType = 'SAMECHAIN_SWAP' | 'CROSSCHAIN_SWAP' | 'TRANSFER_IN' | 'TRANSFER_OUT' | 'ON_RAMP_FIAT' | 'OFF_RAMP_FIAT' | 'SAMECHAIN_INVESTMENT_DEPOSIT' | 'SAMECHAIN_INVESTMENT_WITHDRAW' | 'CROSSCHAIN_INVESTMENT_DEPOSIT' | 'CROSSCHAIN_INVESTMENT_WITHDRAW';
|
|
1776
1776
|
interface HistoryListItemAsset {
|
|
1777
1777
|
symbol: string;
|
|
@@ -2272,6 +2272,13 @@ interface EarnHistoryItem {
|
|
|
2272
2272
|
amountInUSD?: string | null;
|
|
2273
2273
|
amountHumanized?: string;
|
|
2274
2274
|
} | null;
|
|
2275
|
+
assetOut?: {
|
|
2276
|
+
token?: {
|
|
2277
|
+
symbol?: string;
|
|
2278
|
+
};
|
|
2279
|
+
amountInUSD?: string | null;
|
|
2280
|
+
amountHumanized?: string;
|
|
2281
|
+
} | null;
|
|
2275
2282
|
};
|
|
2276
2283
|
}
|
|
2277
2284
|
interface EarnDesktopViewSimpleProps extends Partial<EarnDesktopViewProps> {
|
package/dist/index.d.ts
CHANGED
|
@@ -953,7 +953,7 @@ interface HistoryDetailsLabels {
|
|
|
953
953
|
transactionDetailsTitle: string;
|
|
954
954
|
}
|
|
955
955
|
|
|
956
|
-
type HistoryDetailsStatus = 'SUCCESS' | 'PENDING' | 'FAILED' | 'REFUNDED';
|
|
956
|
+
type HistoryDetailsStatus = 'SUCCESS' | 'PENDING' | 'FAILED' | 'REFUNDED' | 'INITIAL';
|
|
957
957
|
|
|
958
958
|
type TransactionStepStatus = 'completed' | 'processing' | 'failed';
|
|
959
959
|
interface TransactionStep {
|
|
@@ -1771,7 +1771,7 @@ interface ChooseNetworkAndAssetViewSimpleProps {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
declare function ChooseNetworkAndAssetViewSimple({ isOpen, onClose, networks, selectedNetwork, onNetworkSelect, displayedTokens, findBalance, formatTokenAmount, formatCurrencyValue, onAssetClick, onSearch, autoFocus, hasMore, onLoadMore, isFetching, labels, }: ChooseNetworkAndAssetViewSimpleProps): react_jsx_runtime.JSX.Element;
|
|
1773
1773
|
|
|
1774
|
-
type HistoryListItemStatus = 'SUCCESS' | 'PENDING' | 'FAILED' | 'REFUNDED';
|
|
1774
|
+
type HistoryListItemStatus = 'SUCCESS' | 'PENDING' | 'FAILED' | 'REFUNDED' | 'INITIAL';
|
|
1775
1775
|
type HistoryListItemType = 'SAMECHAIN_SWAP' | 'CROSSCHAIN_SWAP' | 'TRANSFER_IN' | 'TRANSFER_OUT' | 'ON_RAMP_FIAT' | 'OFF_RAMP_FIAT' | 'SAMECHAIN_INVESTMENT_DEPOSIT' | 'SAMECHAIN_INVESTMENT_WITHDRAW' | 'CROSSCHAIN_INVESTMENT_DEPOSIT' | 'CROSSCHAIN_INVESTMENT_WITHDRAW';
|
|
1776
1776
|
interface HistoryListItemAsset {
|
|
1777
1777
|
symbol: string;
|
|
@@ -2272,6 +2272,13 @@ interface EarnHistoryItem {
|
|
|
2272
2272
|
amountInUSD?: string | null;
|
|
2273
2273
|
amountHumanized?: string;
|
|
2274
2274
|
} | null;
|
|
2275
|
+
assetOut?: {
|
|
2276
|
+
token?: {
|
|
2277
|
+
symbol?: string;
|
|
2278
|
+
};
|
|
2279
|
+
amountInUSD?: string | null;
|
|
2280
|
+
amountHumanized?: string;
|
|
2281
|
+
} | null;
|
|
2275
2282
|
};
|
|
2276
2283
|
}
|
|
2277
2284
|
interface EarnDesktopViewSimpleProps extends Partial<EarnDesktopViewProps> {
|
package/dist/index.js
CHANGED
|
@@ -3922,7 +3922,7 @@ var STATUS_STYLES = {
|
|
|
3922
3922
|
}
|
|
3923
3923
|
};
|
|
3924
3924
|
function resolveStatusBadgeTone(status = "SUCCESS") {
|
|
3925
|
-
if (status === "PENDING") return "pending";
|
|
3925
|
+
if (status === "PENDING" || status === "INITIAL") return "pending";
|
|
3926
3926
|
if (status === "FAILED") return "failed";
|
|
3927
3927
|
if (status === "REFUNDED") return "refunded";
|
|
3928
3928
|
return "success";
|
|
@@ -9040,6 +9040,11 @@ var variantStyles2 = {
|
|
|
9040
9040
|
dotClass: "bg-[var(--deframe-widget-color-state-warning)]",
|
|
9041
9041
|
labelClass: "text-[color:var(--deframe-widget-color-state-warning)]"
|
|
9042
9042
|
},
|
|
9043
|
+
INITIAL: {
|
|
9044
|
+
wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-warning)_16%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-warning)_32%,transparent)]",
|
|
9045
|
+
dotClass: "bg-[var(--deframe-widget-color-state-warning)]",
|
|
9046
|
+
labelClass: "text-[color:var(--deframe-widget-color-state-warning)]"
|
|
9047
|
+
},
|
|
9043
9048
|
FAILED: {
|
|
9044
9049
|
wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_16%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_32%,transparent)]",
|
|
9045
9050
|
dotClass: "bg-[var(--deframe-widget-color-state-error)]",
|
|
@@ -9054,6 +9059,7 @@ var variantStyles2 = {
|
|
|
9054
9059
|
var STATUS_LABEL_KEY = {
|
|
9055
9060
|
SUCCESS: "success",
|
|
9056
9061
|
PENDING: "pending",
|
|
9062
|
+
INITIAL: "pending",
|
|
9057
9063
|
FAILED: "failed",
|
|
9058
9064
|
REFUNDED: "refunded"
|
|
9059
9065
|
};
|
|
@@ -10730,14 +10736,14 @@ var EarnDesktopViewSimple = ({
|
|
|
10730
10736
|
});
|
|
10731
10737
|
}, [categories, strategies, labels == null ? void 0 : labels.stablecoinsBannerDescription, labels == null ? void 0 : labels.realsBannerDescription]);
|
|
10732
10738
|
const historyByAsset = React6__namespace.default.useMemo(() => {
|
|
10733
|
-
var _a, _b, _c, _d;
|
|
10739
|
+
var _a, _b, _c, _d, _e;
|
|
10734
10740
|
const map = /* @__PURE__ */ new Map();
|
|
10735
10741
|
for (const item of historyItems) {
|
|
10736
10742
|
const isDeposit = item.type.includes("DEPOSIT");
|
|
10737
|
-
const
|
|
10738
|
-
const symbol = (
|
|
10743
|
+
const primaryAsset = isDeposit ? (_a = item.amounts) == null ? void 0 : _a.assetIn : (_b = item.amounts) == null ? void 0 : _b.assetOut;
|
|
10744
|
+
const symbol = (_e = primaryAsset && "token" in primaryAsset ? (_d = (_c = primaryAsset.token) == null ? void 0 : _c.symbol) == null ? void 0 : _d.toUpperCase() : null) != null ? _e : "";
|
|
10739
10745
|
if (!symbol) continue;
|
|
10740
|
-
const amount =
|
|
10746
|
+
const amount = primaryAsset && "amountInUSD" in primaryAsset && primaryAsset.amountInUSD ? formatCurrency(parseFloat(primaryAsset.amountInUSD)) : primaryAsset && "amountHumanized" in primaryAsset ? `${primaryAsset.amountHumanized} ${symbol}` : "";
|
|
10741
10747
|
const date = new Date(item.createdAt).toLocaleString(locale, {
|
|
10742
10748
|
day: "2-digit",
|
|
10743
10749
|
month: "2-digit",
|