Skip to content

Commit

Permalink
fix: update param
Browse files Browse the repository at this point in the history
  • Loading branch information
00xSam committed Aug 19, 2024
1 parent f3f4b89 commit ac755b5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions ts-client/src/vault/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const getAllVaultStateByPda = async (vaultsPda: Array<PublicKey>, program: Vault
vaultPda: vaultAccountPda,
tokenVaultPda: vaultState.tokenVault,
lpMintPda: vaultState.lpMint,
tokenAddress: vaultState.tokenMint,
vaultAccountPda,
vaultState,
lpSupply,
Expand Down Expand Up @@ -278,7 +279,7 @@ export default class VaultImpl implements VaultImplementation {

public static async createMultipleWithPda(
connection: Connection,
vaultsPda: Array<PdaInfo>,
vaultsPda: Array<PublicKey>,
opt?: {
seedBaseKey?: PublicKey;
allowOwnerOffCurve?: boolean;
Expand All @@ -291,14 +292,10 @@ export default class VaultImpl implements VaultImplementation {
const provider = new AnchorProvider(connection, {} as any, AnchorProvider.defaultOptions());
const program = new Program<VaultIdl>(IDL as VaultIdl, opt?.programId || PROGRAM_ID, provider);

const vaultsStateInfo = await getAllVaultStateByPda(
vaultsPda.map(({ vaultPda }) => vaultPda),
program,
);
const vaultsStateInfo = await getAllVaultStateByPda(vaultsPda, program);

return Promise.all(
vaultsStateInfo.map(async ({ vaultPda, tokenVaultPda, lpMintPda, vaultState, lpSupply }, index) => {
const { tokenAddress } = vaultsPda[index];
vaultsStateInfo.map(async ({ vaultPda, tokenVaultPda, lpMintPda, vaultState, lpSupply, tokenAddress }, index) => {
const tokenMint = await getMint(connection, tokenAddress);
return new VaultImpl(
program,
Expand Down

0 comments on commit ac755b5

Please sign in to comment.