Skip to content

Commit

Permalink
add new fields to distributor accounts (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolley authored Oct 24, 2024
1 parent 0467645 commit 4c1a6ee
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 29 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": "7.0.0-alpha.15",
"version": "7.0.0-alpha.16",
"$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": "7.0.0-alpha.15",
"version": "7.0.0-alpha.16",
"description": "Common utilities and types used by streamflow packages.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "./dist/esm/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": "7.0.0-alpha.15",
"version": "7.0.0-alpha.16",
"description": "JavaScript SDK to interact with Streamflow Airdrop protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/esm/index.js",
Expand Down
22 changes: 11 additions & 11 deletions packages/distributor/solana/generated/accounts/ClaimStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export interface ClaimStatusFields {
lastAmountPerUnlock: BN;
/** Whether claim is closed */
closed: boolean;
/** Buffer for additional fields */
buffer1: Array<number>;
/** Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts */
distributor: PublicKey;
/** Buffer for additional fields */
buffer2: Array<number>;
}
Expand All @@ -40,8 +40,8 @@ export interface ClaimStatusJSON {
lastAmountPerUnlock: string;
/** Whether claim is closed */
closed: boolean;
/** Buffer for additional fields */
buffer1: Array<number>;
/** Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts */
distributor: string;
/** Buffer for additional fields */
buffer2: Array<number>;
}
Expand Down Expand Up @@ -69,8 +69,8 @@ export class ClaimStatus {
/** Whether claim is closed */
readonly closed: boolean;

/** Buffer for additional fields */
readonly buffer1: Array<number>;
/** Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts */
readonly distributor: PublicKey;

/** Buffer for additional fields */
readonly buffer2: Array<number>;
Expand All @@ -85,7 +85,7 @@ export class ClaimStatus {
borsh.u64("lastClaimTs"),
borsh.u64("lastAmountPerUnlock"),
borsh.bool("closed"),
borsh.array(borsh.u8(), 32, "buffer1"),
borsh.publicKey("distributor"),
borsh.array(borsh.u8(), 32, "buffer2"),
]);

Expand All @@ -97,7 +97,7 @@ export class ClaimStatus {
this.lastClaimTs = fields.lastClaimTs;
this.lastAmountPerUnlock = fields.lastAmountPerUnlock;
this.closed = fields.closed;
this.buffer1 = fields.buffer1;
this.distributor = fields.distributor;
this.buffer2 = fields.buffer2;
}

Expand Down Expand Up @@ -152,7 +152,7 @@ export class ClaimStatus {
lastClaimTs: dec.lastClaimTs,
lastAmountPerUnlock: dec.lastAmountPerUnlock,
closed: dec.closed,
buffer1: dec.buffer1,
distributor: dec.distributor,
buffer2: dec.buffer2,
});
}
Expand All @@ -166,7 +166,7 @@ export class ClaimStatus {
lastClaimTs: this.lastClaimTs.toString(),
lastAmountPerUnlock: this.lastAmountPerUnlock.toString(),
closed: this.closed,
buffer1: this.buffer1,
distributor: this.distributor.toString(),
buffer2: this.buffer2,
};
}
Expand All @@ -180,7 +180,7 @@ export class ClaimStatus {
lastClaimTs: new BN(obj.lastClaimTs),
lastAmountPerUnlock: new BN(obj.lastAmountPerUnlock),
closed: obj.closed,
buffer1: obj.buffer1,
distributor: new PublicKey(obj.distributor),
buffer2: obj.buffer2,
});
}
Expand Down
84 changes: 72 additions & 12 deletions packages/distributor/solana/generated/accounts/MerkleDistributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@ export interface MerkleDistributorFields {
clawedBack: boolean;
/** Whether claims are closable by the admin or not */
claimsClosable: boolean;
/** Buffer for additional fields */
buffer1: Array<number>;
/** Whether admin can update vesting duration */
canUpdateDuration: boolean;
/** Total amount of funds unlocked (cliff/instant) */
totalAmountUnlocked: BN;
/** Total amount of funds locked (vested) */
totalAmountLocked: BN;
/** Timestamp when update was last called */
lastDurationUpdateTs: BN;
/** Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update */
totalClaimablePreUpdate: BN;
/** Timestamp when funds were clawed back */
clawedBackTs: BN;
/** Buffer for additional fields */
buffer2: Array<number>;
/** Buffer for additional fields */
Expand Down Expand Up @@ -82,8 +92,18 @@ export interface MerkleDistributorJSON {
clawedBack: boolean;
/** Whether claims are closable by the admin or not */
claimsClosable: boolean;
/** Buffer for additional fields */
buffer1: Array<number>;
/** Whether admin can update vesting duration */
canUpdateDuration: boolean;
/** Total amount of funds unlocked (cliff/instant) */
totalAmountUnlocked: string;
/** Total amount of funds locked (vested) */
totalAmountLocked: string;
/** Timestamp when update was last called */
lastDurationUpdateTs: string;
/** Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update */
totalClaimablePreUpdate: string;
/** Timestamp when funds were clawed back */
clawedBackTs: string;
/** Buffer for additional fields */
buffer2: Array<number>;
/** Buffer for additional fields */
Expand Down Expand Up @@ -143,8 +163,23 @@ export class MerkleDistributor {
/** Whether claims are closable by the admin or not */
readonly claimsClosable: boolean;

/** Buffer for additional fields */
readonly buffer1: Array<number>;
/** Whether admin can update vesting duration */
readonly canUpdateDuration: boolean;

/** Total amount of funds unlocked (cliff/instant) */
readonly totalAmountUnlocked: BN;

/** Total amount of funds locked (vested) */
readonly totalAmountLocked: BN;

/** Timestamp when update was last called */
readonly lastDurationUpdateTs: BN;

/** Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update */
readonly totalClaimablePreUpdate: BN;

/** Timestamp when funds were clawed back */
readonly clawedBackTs: BN;

/** Buffer for additional fields */
readonly buffer2: Array<number>;
Expand Down Expand Up @@ -172,8 +207,13 @@ export class MerkleDistributor {
borsh.publicKey("admin"),
borsh.bool("clawedBack"),
borsh.bool("claimsClosable"),
borsh.array(borsh.u8(), 32, "buffer1"),
borsh.array(borsh.u8(), 32, "buffer2"),
borsh.bool("canUpdateDuration"),
borsh.u64("totalAmountUnlocked"),
borsh.u64("totalAmountLocked"),
borsh.u64("lastDurationUpdateTs"),
borsh.u64("totalClaimablePreUpdate"),
borsh.u64("clawedBackTs"),
borsh.array(borsh.u8(), 23, "buffer2"),
borsh.array(borsh.u8(), 32, "buffer3"),
]);

Expand All @@ -195,7 +235,12 @@ export class MerkleDistributor {
this.admin = fields.admin;
this.clawedBack = fields.clawedBack;
this.claimsClosable = fields.claimsClosable;
this.buffer1 = fields.buffer1;
this.canUpdateDuration = fields.canUpdateDuration;
this.totalAmountUnlocked = fields.totalAmountUnlocked;
this.totalAmountLocked = fields.totalAmountLocked;
this.lastDurationUpdateTs = fields.lastDurationUpdateTs;
this.totalClaimablePreUpdate = fields.totalClaimablePreUpdate;
this.clawedBackTs = fields.clawedBackTs;
this.buffer2 = fields.buffer2;
this.buffer3 = fields.buffer3;
}
Expand Down Expand Up @@ -261,7 +306,12 @@ export class MerkleDistributor {
admin: dec.admin,
clawedBack: dec.clawedBack,
claimsClosable: dec.claimsClosable,
buffer1: dec.buffer1,
canUpdateDuration: dec.canUpdateDuration,
totalAmountUnlocked: dec.totalAmountUnlocked,
totalAmountLocked: dec.totalAmountLocked,
lastDurationUpdateTs: dec.lastDurationUpdateTs,
totalClaimablePreUpdate: dec.totalClaimablePreUpdate,
clawedBackTs: dec.clawedBackTs,
buffer2: dec.buffer2,
buffer3: dec.buffer3,
});
Expand All @@ -286,7 +336,12 @@ export class MerkleDistributor {
admin: this.admin.toString(),
clawedBack: this.clawedBack,
claimsClosable: this.claimsClosable,
buffer1: this.buffer1,
canUpdateDuration: this.canUpdateDuration,
totalAmountUnlocked: this.totalAmountUnlocked.toString(),
totalAmountLocked: this.totalAmountLocked.toString(),
lastDurationUpdateTs: this.lastDurationUpdateTs.toString(),
totalClaimablePreUpdate: this.totalClaimablePreUpdate.toString(),
clawedBackTs: this.clawedBackTs.toString(),
buffer2: this.buffer2,
buffer3: this.buffer3,
};
Expand All @@ -311,7 +366,12 @@ export class MerkleDistributor {
admin: new PublicKey(obj.admin),
clawedBack: obj.clawedBack,
claimsClosable: obj.claimsClosable,
buffer1: obj.buffer1,
canUpdateDuration: obj.canUpdateDuration,
totalAmountUnlocked: new BN(obj.totalAmountUnlocked),
totalAmountLocked: new BN(obj.totalAmountLocked),
lastDurationUpdateTs: new BN(obj.lastDurationUpdateTs),
totalClaimablePreUpdate: new BN(obj.totalClaimablePreUpdate),
clawedBackTs: new BN(obj.clawedBackTs),
buffer2: obj.buffer2,
buffer3: obj.buffer3,
});
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": "7.0.0-alpha.15",
"version": "7.0.0-alpha.16",
"license": "ISC",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/staking/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/staking",
"version": "7.0.0-alpha.15",
"version": "7.0.0-alpha.16",
"description": "JavaScript SDK to interact with Streamflow Staking protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/esm/index.js",
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": "7.0.0-alpha.15",
"version": "7.0.0-alpha.16",
"description": "JavaScript SDK to interact with Streamflow protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "./dist/esm/index.js",
Expand Down

0 comments on commit 4c1a6ee

Please sign in to comment.