Skip to content

Commit 074fa58

Browse files
Claim limit fixes - optional params (#255)
* address PR comments * fix comment * make close claim data parameters optional * fix passing undefined to newDistributor * remove leftover console logs * fix for closeClaim optionals as well
1 parent 7c307d2 commit 074fa58

File tree

10 files changed

+17
-16
lines changed

10 files changed

+17
-16
lines changed

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/common",
3-
"version": "7.4.0",
3+
"version": "7.4.1",
44
"description": "Common utilities and types used by streamflow packages.",
55
"homepage": "https://github.com/streamflow-finance/js-sdk/",
66
"main": "./dist/esm/index.js",

packages/distributor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/distributor",
3-
"version": "7.4.0",
3+
"version": "7.4.1",
44
"description": "JavaScript SDK to interact with Streamflow Airdrop protocol.",
55
"homepage": "https://github.com/streamflow-finance/js-sdk/",
66
"main": "dist/esm/index.js",

packages/distributor/solana/clients/BaseDistributorClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ export default abstract class BaseDistributorClient {
348348
};
349349

350350
const closeClaimArgs: CloseClaimArgs = {
351-
amountLocked: new BN(data.amountLocked),
352-
amountUnlocked: new BN(data.amountUnlocked),
351+
amountLocked: data.amountLocked ? new BN(data.amountLocked) : undefined,
352+
amountUnlocked: data.amountUnlocked ? new BN(data.amountUnlocked) : undefined,
353353
proof: data.proof,
354354
};
355355

packages/distributor/solana/generated/instructions/closeClaim.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ export function closeClaim(args: CloseClaimArgs, accounts: CloseClaimAccounts, p
4444
const buffer = Buffer.alloc(1000);
4545
const len = layout.encode(
4646
{
47-
amountUnlocked: args.amountUnlocked,
48-
amountLocked: args.amountLocked,
49-
proof: args.proof,
47+
amountUnlocked: args.amountUnlocked ?? null,
48+
amountLocked: args.amountLocked ?? null,
49+
proof: args.proof ?? null,
5050
},
5151
buffer,
5252
);

packages/distributor/solana/generated/instructions/newDistributor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export interface NewDistributorArgs {
1515
endVestingTs: BN;
1616
clawbackStartTs: BN;
1717
claimsClosableByAdmin: boolean;
18-
claimsClosableByClaimant?: boolean;
19-
claimsLimit?: number;
18+
claimsClosableByClaimant?: boolean | null;
19+
claimsLimit?: number | null;
2020
}
2121

2222
export interface NewDistributorAccounts {
@@ -113,8 +113,8 @@ export function newDistributor(
113113
canUpdateDuration: null,
114114
totalAmountUnlocked: null,
115115
totalAmountLocked: null,
116-
claimsClosableByClaimant: args.claimsClosableByClaimant,
117-
claimsLimit: args.claimsLimit,
116+
claimsClosableByClaimant: args.claimsClosableByClaimant ?? null,
117+
claimsLimit: args.claimsLimit ?? null,
118118
},
119119
buffer,
120120
);

packages/distributor/solana/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ export interface IClaimData {
8181
proof: Array<Array<number>>;
8282
}
8383

84-
export interface ICloseClaimData extends IClaimData {
84+
export interface ICloseClaimData extends Partial<Omit<IClaimData, "id">> {
85+
id: string;
8586
claimant: string | PublicKey;
8687
}
8788

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/eslint-config",
3-
"version": "7.4.0",
3+
"version": "7.4.1",
44
"license": "ISC",
55
"main": "index.js",
66
"files": [

packages/launchpad/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/launchpad",
3-
"version": "7.4.0",
3+
"version": "7.4.1",
44
"description": "JavaScript SDK to interact with Streamflow Launchpad protocol.",
55
"homepage": "https://github.com/streamflow-finance/js-sdk/",
66
"main": "dist/esm/index.js",

packages/staking/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/staking",
3-
"version": "7.4.0",
3+
"version": "7.4.1",
44
"description": "JavaScript SDK to interact with Streamflow Staking protocol.",
55
"homepage": "https://github.com/streamflow-finance/js-sdk/",
66
"main": "dist/esm/index.js",

packages/stream/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/stream",
3-
"version": "7.4.0",
3+
"version": "7.4.1",
44
"description": "JavaScript SDK to interact with Streamflow protocol.",
55
"homepage": "https://github.com/streamflow-finance/js-sdk/",
66
"main": "./dist/esm/index.js",

0 commit comments

Comments
 (0)