Vest
1. Get Vault's Vest Information List
Get vest information for multiple vaults.
const vestInfoList = await sdk.Vest.getVaultsVestInfoList([vaultId])
2. Get Single Vault's Vest Information
Get vest information for a specific vault.
async getVaultsVestInfo(vault_id: string, force_refresh = true): Promise<VaultsVestInfo>
3. Get User's Vault Vest NFT List
Get all Vault Vest NFTs owned by the specified address. Each NFT contains the following information:
id: NFT ID
index: Index
vault_id: Vault ID
lp_amount: LP token amount
redeemed_amount: Redeemed amount
impaired_a: Token A impairment
impaired_b: Token B impairment
period_infos: Period information
url: NFT URL
name: NFT name
vester_id: Vester ID
const vestNFTList = await sdk.Vest.getOwnerVaultVestNFT(senderAddress)
4. Build Redeem Transaction
Build the redeem transaction payload.
Parameter description:
options: Array of redeem options, each option contains:
vault_id: Vault ID
vesting_nft_id: Vesting NFT ID
period: Period
coin_type_a: Token A type
coin_type_b: Token B type
tx: Optional transaction object
const vestInfo = await sdk.Vest.getVaultsVestInfo(vaultId)
const tx = await sdk.Vest.buildRedeemPayload([
{
vault_id: vaultId,
vesting_nft_id: '0x...',
period: 1,
coin_type_a: vestInfo.coin_type_a,
coin_type_b: vestInfo.coin_type_b,
}
])
// Execute transaction
const transferTxn = await sdk.FullClient.executeTx(send_key_pair, tx, false)
Last updated