From 555e26f842cf22294659c7103908e2d7f40d70a2 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Wed, 20 Mar 2024 13:47:40 +0000 Subject: [PATCH] feat: get from wallet first fix --- package.json | 2 +- src/Unit/Exchange/generateSwapCalldata.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b92b6e2..01262dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.20.74", + "version": "0.20.75-rc0", "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 91f3fe6..fd7fe08 100644 --- a/src/Unit/Exchange/generateSwapCalldata.ts +++ b/src/Unit/Exchange/generateSwapCalldata.ts @@ -397,7 +397,7 @@ async function shouldUseExchangeBalance( let useExchangeBalance = true; let additionalTransferAmount = 0n; - if (exchangeBalance == 0n) { + if (walletBalance >= amount || exchangeBalance == 0n) { useExchangeBalance = false; additionalTransferAmount = amount; } else {