@silentswap/sdk 0.1.61 → 0.1.63
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/bridge.js +8 -2
- package/package.json +1 -1
package/dist/bridge.js
CHANGED
|
@@ -624,10 +624,13 @@ async function solveDebridgeUsdcAmount(srcChainId, srcToken, srcAmount, userAddr
|
|
|
624
624
|
const amountIn = BigInt(quote.estimation.srcChainTokenIn.amount);
|
|
625
625
|
// Amount in is within our budget
|
|
626
626
|
if (amountIn <= BigInt(srcAmount)) {
|
|
627
|
+
// quote.tx can be undefined when DeBridge returns an estimation-only response
|
|
628
|
+
// (e.g. unroutable edge cases, takers without capacity for the route, or non-EVM
|
|
629
|
+
// sources like Solana/Tron where no ERC-20 allowance is needed at all).
|
|
627
630
|
return [
|
|
628
631
|
BigInt(quote.estimation.dstChainTokenOut.amount),
|
|
629
632
|
amountIn,
|
|
630
|
-
quote.tx
|
|
633
|
+
quote.tx?.allowanceTarget || '',
|
|
631
634
|
];
|
|
632
635
|
}
|
|
633
636
|
// Calculate new target based on overshoot
|
|
@@ -713,10 +716,13 @@ async function solveDebridgeSingleChainUsdcAmount(chainId, srcToken, srcAmount,
|
|
|
713
716
|
const amountIn = BigInt(quote.estimation.srcChainTokenIn.amount);
|
|
714
717
|
// Amount in is within our budget
|
|
715
718
|
if (amountIn <= BigInt(srcAmount)) {
|
|
719
|
+
// quote.tx can be undefined when DeBridge returns an estimation-only response
|
|
720
|
+
// (e.g. unroutable edge cases, takers without capacity for the route, or non-EVM
|
|
721
|
+
// sources like Solana/Tron where no ERC-20 allowance is needed at all).
|
|
716
722
|
return [
|
|
717
723
|
BigInt(quote.estimation.dstChainTokenOut.amount),
|
|
718
724
|
amountIn,
|
|
719
|
-
quote.tx
|
|
725
|
+
quote.tx?.allowanceTarget || '',
|
|
720
726
|
];
|
|
721
727
|
}
|
|
722
728
|
// Calculate new target based on overshoot
|