@silentswap/sdk 0.1.62 → 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.
Files changed (2) hide show
  1. package/dist/bridge.js +8 -2
  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.allowanceTarget || '',
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.allowanceTarget || '',
725
+ quote.tx?.allowanceTarget || '',
720
726
  ];
721
727
  }
722
728
  // Calculate new target based on overshoot
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silentswap/sdk",
3
3
  "type": "module",
4
- "version": "0.1.62",
4
+ "version": "0.1.63",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "files": [