Skip to content

Commit

Permalink
fix: naming convension
Browse files Browse the repository at this point in the history
  • Loading branch information
00xSam committed Aug 19, 2024
1 parent f72a6df commit b25c80c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ts-client/src/vault/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ type WithdrawOpt = {
};

const getAllVaultState = async (
tokensMint: Array<PublicKey>,
tokensAddress: Array<PublicKey>,
program: VaultProgram,
seedBaseKey?: PublicKey,
): Promise<Array<VaultStateAndLp>> => {
const vaultAccountPdas = tokensMint.map((tokenMint) =>
const vaultAccountPdas = tokensAddress.map((tokenMint) =>
getVaultPdas(tokenMint, new PublicKey(program.programId), seedBaseKey),
);

const vaultsPda = vaultAccountPdas.map(({ vaultPda }) => vaultPda);
const vaultsState = (await chunkedFetchMultipleVaultAccount(program, vaultsPda)) as Array<VaultState>;

if (vaultsState.length !== tokensMint.length) {
if (vaultsState.length !== tokensAddress.length) {
throw new Error('Some of the vault state cannot be fetched');
}

Expand Down Expand Up @@ -114,11 +114,11 @@ const getAllVaultStateByPda = async (
};

const getVaultState = async (
vaultPublicKey: PublicKey,
tokenAddress: PublicKey,
program: VaultProgram,
seedBaseKey?: PublicKey,
): Promise<VaultStateAndLp> => {
const { vaultPda } = getVaultPdas(vaultPublicKey, new PublicKey(program.programId), seedBaseKey);
const { vaultPda } = getVaultPdas(tokenAddress, new PublicKey(program.programId), seedBaseKey);
const vaultState = (await program.account.vault.fetchNullable(vaultPda)) as VaultState;

if (!vaultState) {
Expand Down

0 comments on commit b25c80c

Please sign in to comment.