feat(auto-lend): implemented to borrow (#379)

This commit is contained in:
Yusuf Seyrek 2023-08-17 15:30:27 +03:00 committed by GitHub
parent d63c7f100a
commit 8e15ed7a19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,16 @@ export default function createBroadcastSlice(
},
}
if (
!options.borrowToWallet &&
checkAutoLendEnabled(options.accountId) &&
getAssetByDenom(options.coin.denom)?.isAutoLendEnabled
) {
msg.update_credit_account.actions.push({
lend: { denom: options.coin.denom, amount: 'account_balance' },
})
}
const response = await get().executeMsg({
messages: [generateExecutionMessage(get().address, ENV.ADDRESS_CREDIT_MANAGER, msg, [])],
})