@anywalletkit/protocol-swap2-relay 0.1.3 → 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/{chunk-JTPYU26F.js → chunk-BCY6ZEAE.js} +3 -2
- package/dist/chunk-BCY6ZEAE.js.map +1 -0
- package/dist/{chunk-TBFD7BPZ.js → chunk-YJD4ZYLK.js} +2 -2
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/protocol.cjs +2 -1
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.js +2 -2
- package/dist/provider.cjs +2 -1
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-JTPYU26F.js.map +0 -1
- /package/dist/{chunk-TBFD7BPZ.js.map → chunk-YJD4ZYLK.js.map} +0 -0
package/dist/protocol.js
CHANGED
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
|
|
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}`;
|