import type { Address } from "@solana/kit"; import { fetchVault, type Vault } from "../generated"; import type { GetAccountInfoRpc } from "./rpc"; async function loadVault( rpc: GetAccountInfoRpc, vault: Address, ): Promise { const account = await fetchVault(rpc, vault); return account.data; } export async function getAccumulatedAdminFeesForVault( rpc: GetAccountInfoRpc, vault: Address, ): Promise { const data = await loadVault(rpc, vault); return data.feeState.accumulatedLpAdminFees; } export async function getAccumulatedManagerFeesForVault( rpc: GetAccountInfoRpc, vault: Address, ): Promise { const data = await loadVault(rpc, vault); return data.feeState.accumulatedLpManagerFees; } export async function getAccumulatedProtocolFeesForVault( rpc: GetAccountInfoRpc, vault: Address, ): Promise { const data = await loadVault(rpc, vault); return data.feeState.accumulatedLpProtocolFees; }