mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
fix don't check allowance when token is native
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.20.31",
|
"version": "0.20.32",
|
||||||
"description": "Orion Protocol SDK",
|
"description": "Orion Protocol SDK",
|
||||||
"main": "./lib/index.cjs",
|
"main": "./lib/index.cjs",
|
||||||
"module": "./lib/index.js",
|
"module": "./lib/index.js",
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ async function shouldUseExchangeBalance(
|
|||||||
additionalTransferAmount = amount;
|
additionalTransferAmount = amount;
|
||||||
} else {
|
} else {
|
||||||
additionalTransferAmount = exchangeBalance >= amount ? 0n : amount - exchangeBalance;
|
additionalTransferAmount = exchangeBalance >= amount ? 0n : amount - exchangeBalance;
|
||||||
if (additionalTransferAmount > exchangeAllowance) {
|
if (srcToken !== ZeroAddress && additionalTransferAmount > exchangeAllowance) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Not enough allowance to make swap, allowance - ${exchangeAllowance} needed allowance - ${additionalTransferAmount}`
|
`Not enough allowance to make swap, allowance - ${exchangeAllowance} needed allowance - ${additionalTransferAmount}`
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user