Skip to content

Commit

Permalink
support different distributors in getClaims (#146)
Browse files Browse the repository at this point in the history
* support different distributors in getClaims
  • Loading branch information
Yolley authored Mar 20, 2024
1 parent bfb144b commit b58e612
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"packages": [
"packages/*"
],
"version": "6.0.0-alpha.5",
"version": "6.0.0-alpha.6",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/common",
"version": "6.0.0-alpha.5",
"version": "6.0.0-alpha.6",
"description": "Common utilities and types used by streamflow packages.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/distributor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/distributor",
"version": "6.0.0-alpha.5",
"version": "6.0.0-alpha.6",
"description": "JavaScript SDK to interact with Streamflow Airdrop protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/index.js",
Expand Down
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
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/eslint-config",
"version": "6.0.0-alpha.5",
"version": "6.0.0-alpha.6",
"license": "ISC",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/stream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/stream",
"version": "6.0.0-alpha.5",
"version": "6.0.0-alpha.6",
"description": "JavaScript SDK to interact with Streamflow protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/index.js",
Expand Down

0 comments on commit b58e612

Please sign in to comment.