mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
fix not zero eth value when srcToken not eth
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user