fix not zero eth value when srcToken not eth

This commit is contained in:
Steam Deck User
2023-12-08 16:05:41 +04:00
parent 2698434ab1
commit 99d02a42cd
2 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.29-rc0",
"version": "0.20.29-rc1",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -128,7 +128,7 @@ export async function generateSwapCalldata({
if (singleSwap.assetOut == ethers.ZeroAddress) singleSwap.assetOut = wethAddress;
return singleSwap;
});
let calls: BytesLike[];
({ swapDescription, calls } = await processSwaps(
swapDescription,
@@ -151,8 +151,8 @@ export async function generateSwapCalldata({
if (useExchangeBalance) {
swapDescription.flags = 1n << 255n;
}
return { swapDescription, calldata, value: additionalTransferAmount };
const value = srcToken == ZeroAddress ? additionalTransferAmount : 0n;
return { swapDescription, calldata, value };
}
async function processSwaps(