import { WNEAR_ASSET_ID as I, NATIVE_NEAR_DUMB_ASSET_ID as p } from "../../constants/tokens.js";
const A = (t, e, o) => {
  const T = "refundTo" in e ? e.refundTo : void 0, f = "refundType" in e ? e.refundType : void 0, { recipient: u } = e, s = o === "source" ? e.originAsset : e.destinationAsset, a = o === "source" ? e.depositType === "INTENTS" : e.recipientType === "INTENTS", c = t.filter((n) => n.blockchain === "aurora"), i = t.filter((n) => n.blockchain !== "aurora");
  if (o === "source" && T === "aurora") {
    const n = c.find(
      (r) => r.assetId === s && r.isIntent === (f !== "ORIGIN_CHAIN")
    );
    if (n)
      return n;
  }
  if (o === "destination" && u === "aurora") {
    const n = c.find(
      (r) => r.assetId === s && r.isIntent === (e.recipientType === "INTENTS")
    );
    if (n)
      return n;
  }
  if (!a && s === I) {
    const n = i.find(
      (r) => r.assetId === p && !r.isIntent
    );
    if (n)
      return n;
  }
  const d = i.find(
    (n) => n.assetId === s && n.isIntent === a
  );
  if (d)
    return d;
  if (s.startsWith("nep141:")) {
    const n = s.replace("nep141:", "nep245:");
    return i.find((r) => r.assetId === n);
  }
};
export {
  A as findTransactionToken
};
//# sourceMappingURL=findTransactionToken.js.map
