Merge pull request #249 from orionprotocol/get-from-wallet-first

feat: get from wallet first fix
This commit is contained in:
Mikhail Gladchenko
2024-03-20 14:01:59 +00:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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",

View File

@@ -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 {