@deframe-sdk/components 0.1.53 → 0.1.54

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.js CHANGED
@@ -8749,11 +8749,16 @@ function historyResolveLabel(item, labels) {
8749
8749
  };
8750
8750
  return labelMap[item.type]();
8751
8751
  }
8752
- function historyResolveAmounts(item) {
8752
+ function resolveDisplayAsset(item) {
8753
8753
  var _a, _b;
8754
- const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8755
- const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8756
- const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8754
+ const assetIn = (_a = item.amounts) == null ? void 0 : _a.assetIn;
8755
+ const assetOut = (_b = item.amounts) == null ? void 0 : _b.assetOut;
8756
+ if (item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT") return assetIn;
8757
+ if (item.type === "SAMECHAIN_INVESTMENT_DEPOSIT" || item.type === "CROSSCHAIN_INVESTMENT_DEPOSIT") return assetIn;
8758
+ return assetOut;
8759
+ }
8760
+ function historyResolveAmounts(item) {
8761
+ const displayAsset = resolveDisplayAsset(item);
8757
8762
  if (!displayAsset) return { primary: "\u2014", secondary: "" };
8758
8763
  if (isAssetAmount(displayAsset)) {
8759
8764
  const primary = `${displayAsset.amountHumanized} ${displayAsset.symbol}`;
@@ -8790,18 +8795,13 @@ function historyIsDeposit(type) {
8790
8795
  return DEPOSIT_TYPES.includes(type);
8791
8796
  }
8792
8797
  function historyResolveIconUrl(item) {
8793
- var _a, _b, _c, _d;
8794
- const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8795
- const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8796
- const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8797
- if (displayAsset && isAssetAmount(displayAsset)) return (_d = (_c = displayAsset.token) == null ? void 0 : _c.logoURI) != null ? _d : "";
8798
+ var _a, _b;
8799
+ const displayAsset = resolveDisplayAsset(item);
8800
+ if (displayAsset && isAssetAmount(displayAsset)) return (_b = (_a = displayAsset.token) == null ? void 0 : _a.logoURI) != null ? _b : "";
8798
8801
  return "";
8799
8802
  }
8800
8803
  function historyResolveIconAlt(item) {
8801
- var _a, _b;
8802
- const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8803
- const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8804
- const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8804
+ const displayAsset = resolveDisplayAsset(item);
8805
8805
  if (displayAsset && isAssetAmount(displayAsset)) return displayAsset.symbol;
8806
8806
  if (displayAsset && isFiatAmount(displayAsset)) return displayAsset.currency;
8807
8807
  return "";
@@ -9159,7 +9159,7 @@ var SwapHistoryViewSimple = ({
9159
9159
  "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
9160
9160
  "flex flex-col gap-[var(--deframe-widget-size-gap-md)] h-[calc(100vh-48px)]",
9161
9161
  "font-[var(--deframe-widget-font-family)]",
9162
- `w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] shrink-0 box-border`,
9162
+ "w-full max-w-[900px] mx-auto shrink-0 box-border",
9163
9163
  className
9164
9164
  ),
9165
9165
  children: [