* implemented max borrow for borrow page setup basic useHealthComputer * finish up healthcomputer * updated tests
15 lines
405 B
TypeScript
15 lines
405 B
TypeScript
import { getVaultQueryClient } from 'api/cosmwasm-client'
|
|
|
|
export async function getVaultTokenFromLp(
|
|
vaultAddress: string,
|
|
lpAmount: string,
|
|
): Promise<{ vaultAddress: string; amount: string }> {
|
|
try {
|
|
const client = await getVaultQueryClient(vaultAddress)
|
|
|
|
return client.previewDeposit({ amount: lpAmount }).then((amount) => ({ vaultAddress, amount }))
|
|
} catch (ex) {
|
|
throw ex
|
|
}
|
|
}
|