@silentswap/sdk 0.1.70 → 0.1.71

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 +11 -1
  2. package/package.json +1 -1
package/dist/bridge.js CHANGED
@@ -812,8 +812,18 @@ forceProvider) {
812
812
  // userAddress is the source chain address (for user parameter)
813
813
  // evmSignerAddress is the EVM address (for recipient parameter on the destination EVM chain)
814
814
  const recipientAddress = isNonEvmChain && evmSignerAddress ? evmSignerAddress : userAddress;
815
+ // deBridge routes srcChainId === dstChainId orders through its
816
+ // /v1.0/chain/transaction endpoint, which SILENTLY DROPS the dlnHook.
817
+ // depositProxy2 then never executes, the bridged USDC sits orphaned at
818
+ // the shared depositor address, and the next swap's depositProxy2 sweeps
819
+ // it — crediting the wrong user and tripping the backend solver's
820
+ // deposited-vs-approved guard. Disable deBridge ONLY when both src and
821
+ // dst are Avalanche; relay.link's same-chain path bundles the deposit
822
+ // tx atomically, so it stays usable.
823
+ const dstChainIdForBridge = NI_CHAIN_ID_AVALANCHE; // SilentSwap always bridges into USDC on Avalanche
824
+ const isSrcAndDstAvalanche = srcChainId === NI_CHAIN_ID_AVALANCHE && dstChainIdForBridge === NI_CHAIN_ID_AVALANCHE;
815
825
  const useRelay = forceProvider !== 'debridge';
816
- const useDebridge = forceProvider !== 'relay';
826
+ const useDebridge = forceProvider !== 'relay' && !isSrcAndDstAvalanche;
817
827
  // Build promise array only for enabled providers to avoid creating unnecessary promises
818
828
  const promises = [];
819
829
  if (useRelay) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silentswap/sdk",
3
3
  "type": "module",
4
- "version": "0.1.70",
4
+ "version": "0.1.71",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "main": "dist/index.js",