Skip to content

Commit a3e6d60

Browse files
Add fee instruction to claim transactions (#280)
* add fee instruction to claim transaction * fix versions
1 parent a17f597 commit a3e6d60

File tree

9 files changed

+28
-8
lines changed

9 files changed

+28
-8
lines changed

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "7.5.0",
5+
"version": "7.5.1",
66
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
77
}

packages/common/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/common",
3-
"version": "7.5.0",
3+
"version": "7.5.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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/distributor",
3-
"version": "7.5.0",
3+
"version": "7.5.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

+17-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ import {
3030
} from "@solana/spl-token";
3131
import bs58 from "bs58";
3232

33-
import { DISTRIBUTOR_ADMIN_OFFSET, DISTRIBUTOR_MINT_OFFSET, DISTRIBUTOR_PROGRAM_ID } from "../constants";
33+
import {
34+
AIRDROP_CLAIM_FEE,
35+
DISTRIBUTOR_ADMIN_OFFSET,
36+
DISTRIBUTOR_MINT_OFFSET,
37+
DISTRIBUTOR_PROGRAM_ID,
38+
STREAMFLOW_TREASURY_PUBLIC_KEY,
39+
} from "../constants";
3440
import {
3541
IClaimData,
3642
IClawbackData,
@@ -298,6 +304,8 @@ export default abstract class BaseDistributorClient {
298304
ixs.push(claimLocked(accounts, this.programId));
299305
}
300306

307+
ixs.push(this.prepareClaimFeeInstruction(extParams.invoker.publicKey));
308+
301309
return ixs;
302310
}
303311

@@ -462,6 +470,14 @@ export default abstract class BaseDistributorClient {
462470
}));
463471
}
464472

473+
protected prepareClaimFeeInstruction(payer: PublicKey): TransactionInstruction {
474+
return SystemProgram.transfer({
475+
fromPubkey: payer,
476+
toPubkey: STREAMFLOW_TREASURY_PUBLIC_KEY,
477+
lamports: AIRDROP_CLAIM_FEE,
478+
});
479+
}
480+
465481
protected getNewDistributorArgs(data: ICreateDistributorData): NewDistributorArgs {
466482
const args = {
467483
version: new BN(data.version),

packages/distributor/solana/constants.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { PublicKey } from "@solana/web3.js";
12
import { ICluster } from "@streamflow/common";
23

34
export const ANCHOR_DISCRIMINATOR_OFFSET = 8;
@@ -10,6 +11,9 @@ export const TEST_ORACLE_PREFIX = Buffer.from("test-oracle", "utf-8");
1011
export const CLAIM_STATUS_PREFIX = Buffer.from("ClaimStatus", "utf-8");
1112
export const ALIGNED_PRECISION_FACTOR_POW = 9;
1213

14+
export const AIRDROP_CLAIM_FEE = BigInt(5_200_000);
15+
export const STREAMFLOW_TREASURY_PUBLIC_KEY = new PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
16+
1317
export const ONE_IN_BASIS_POINTS = BigInt(10_000);
1418

1519
export const ALIGNED_DISTRIBUTOR_PROGRAM_ID = {

packages/eslint-config/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/eslint-config",
3-
"version": "7.5.0",
3+
"version": "7.5.1",
44
"license": "ISC",
55
"main": "index.js",
66
"files": [

packages/launchpad/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/launchpad",
3-
"version": "7.5.0",
3+
"version": "7.5.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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/staking",
3-
"version": "7.5.0",
3+
"version": "7.5.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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/stream",
3-
"version": "7.5.0",
3+
"version": "7.5.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)