From 88a2c68ed5fa7cd33f0e93d2956e6e69cc037413 Mon Sep 17 00:00:00 2001 From: Yusuf Seyrek Date: Thu, 17 Aug 2023 15:30:36 +0300 Subject: [PATCH] feat(auto-lend): implemented to swaps (#378) * feat(auto-lend): implemented to swaps * chore: remove unused import --- src/store/slices/broadcast.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/store/slices/broadcast.ts b/src/store/slices/broadcast.ts index efcf2cf9..150727a9 100644 --- a/src/store/slices/broadcast.ts +++ b/src/store/slices/broadcast.ts @@ -394,6 +394,15 @@ export default function createBroadcastSlice( }, } + if ( + checkAutoLendEnabled(options.accountId) && + getAssetByDenom(options.denomOut)?.isAutoLendEnabled + ) { + msg.update_credit_account.actions.push({ + lend: { denom: options.denomOut, amount: 'account_balance' }, + }) + } + const messages = [ generateExecutionMessage(get().address, ENV.ADDRESS_CREDIT_MANAGER, msg, []), ]