@silentswap/sdk 0.1.70 → 0.1.72
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 +11 -1
- 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) {
|