diff --git a/package.json b/package.json index 033ae51..476e451 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.20.31", + "version": "0.20.32", "description": "Orion Protocol SDK", "main": "./lib/index.cjs", "module": "./lib/index.js", diff --git a/src/Unit/Exchange/generateSwapCalldata.ts b/src/Unit/Exchange/generateSwapCalldata.ts index f5cacde..cefce17 100644 --- a/src/Unit/Exchange/generateSwapCalldata.ts +++ b/src/Unit/Exchange/generateSwapCalldata.ts @@ -357,7 +357,7 @@ async function shouldUseExchangeBalance( additionalTransferAmount = amount; } else { additionalTransferAmount = exchangeBalance >= amount ? 0n : amount - exchangeBalance; - if (additionalTransferAmount > exchangeAllowance) { + if (srcToken !== ZeroAddress && additionalTransferAmount > exchangeAllowance) { throw new Error( `Not enough allowance to make swap, allowance - ${exchangeAllowance} needed allowance - ${additionalTransferAmount}` );