@anywalletkit/protocol-swap2-relay 0.1.2 → 0.1.4

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/protocol.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RelaySwap2Protocol
3
- } from "./chunk-TBFD7BPZ.js";
4
- import "./chunk-JTPYU26F.js";
3
+ } from "./chunk-YJD4ZYLK.js";
4
+ import "./chunk-BCY6ZEAE.js";
5
5
  import "./chunk-C3I2XYSW.js";
6
6
  import "./chunk-MDXHT7HY.js";
7
7
  import "./chunk-K5F3BEUO.js";
package/dist/provider.cjs CHANGED
@@ -844,7 +844,8 @@ function relayProvider(config = {}) {
844
844
  const relayer = body.fees?.relayer;
845
845
  const usd = typeof relayer?.amountUsd === "string" && /^\d{1,12}(?:\.\d{1,18})?$/.test(relayer.amountUsd) ? parseFloat(relayer.amountUsd) : 0;
846
846
  const feeToken = relayer?.currency?.address;
847
- const fees = typeof relayer?.amount === "string" && /^[1-9]\d{0,77}$/.test(relayer.amount) && typeof feeToken === "string" && /^0x[0-9a-fA-F]{40}$/.test(feeToken) ? [{ type: "protocol", amount: relayer.amount, token: feeToken.toLowerCase(), included: true, description: "Relay fee" }] : [];
847
+ const sameChain = relayer?.currency?.chainId === v.deposit.chainId;
848
+ const fees = sameChain && typeof relayer?.amount === "string" && /^[1-9]\d{0,77}$/.test(relayer.amount) && typeof feeToken === "string" && /^0x[0-9a-fA-F]{40}$/.test(feeToken) ? [{ type: "protocol", amount: relayer.amount, token: feeToken.toLowerCase(), included: true, description: "Relay fee" }] : [];
848
849
  const eta = body.details?.timeEstimate;
849
850
  const etaSeconds = typeof eta === "number" && Number.isFinite(eta) && eta > 0 ? Math.min(Math.ceil(eta), 86400) : 60;
850
851
  const intentId = `${INTENT_PREFIX}${step.requestId}`;