feat(auto-lend): implemented to swaps (#378)

* feat(auto-lend): implemented to swaps

* chore: remove unused import
This commit is contained in:
Yusuf Seyrek 2023-08-17 15:30:36 +03:00 committed by GitHub
parent 8e15ed7a19
commit 88a2c68ed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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, []),
]