Skip to content

Commit

Permalink
support different distributors in getClaims
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolley committed Mar 20, 2024
1 parent bfb144b commit d9ef795
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions packages/distributor/solana/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
IClawbackData,
ICreateDistributorData,
ICreateDistributorResult,
IGetClaimsData,
IGetClaimData,
IGetDistributors,
ICreateSolanaExt,
IInteractSolanaExt,
Expand Down Expand Up @@ -223,10 +223,9 @@ export default class SolanaDistributorClient {
return { ixs, txId: signature };
}

public async getClaims(data: IGetClaimsData): Promise<(ClaimStatus | null)[]> {
const distributorPublicKey = new PublicKey(data.id);
const claimStatusPublicKeys = data.recipients.map((recipient) => {
return getClaimantStatusPda(this.programId, distributorPublicKey, new PublicKey(recipient));
public async getClaims(data: IGetClaimData[]): Promise<(ClaimStatus | null)[]> {
const claimStatusPublicKeys = data.map(({ id, recipient }) => {
return getClaimantStatusPda(this.programId, new PublicKey(id), new PublicKey(recipient));
});
return ClaimStatus.fetchMultiple(this.connection, claimStatusPublicKeys, this.programId);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/distributor/solana/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export interface IClawbackData {
id: string;
}

export interface IGetClaimsData {
export interface IGetClaimData {
id: string;

recipients: string[];
recipient: string;
}

export interface IGetDistributors {
Expand Down

0 comments on commit d9ef795

Please sign in to comment.