Skip to content

Commit 087be41

Browse files
authored
pass rent for now on mainnet program as it's required (#277)
* pass rent for now on mainnet program as it's required * remove package manager
1 parent 5afc44b commit 087be41

File tree

8 files changed

+33
-8
lines changed

8 files changed

+33
-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.4.16",
5+
"version": "7.4.17",
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.4.16",
3+
"version": "7.4.17",
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.4.16",
3+
"version": "7.4.17",
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/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.4.16",
3+
"version": "7.4.17",
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.4.16",
3+
"version": "7.4.17",
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.4.16",
3+
"version": "7.4.17",
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/staking/solana/client.ts

+26-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ import {
1010
translateError,
1111
} from "@coral-xyz/anchor";
1212
import { TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync } from "@solana/spl-token";
13-
import { Commitment, Connection, ConnectionConfig, PublicKey, TransactionInstruction } from "@solana/web3.js";
13+
import {
14+
Commitment,
15+
Connection,
16+
ConnectionConfig,
17+
PublicKey,
18+
TransactionInstruction,
19+
SystemProgram,
20+
SYSVAR_RENT_PUBKEY,
21+
} from "@solana/web3.js";
1422
import { ContractError, ICluster, ITransactionResult, invariant } from "@streamflow/common";
1523
import {
1624
buildSendThrottler,
@@ -89,6 +97,8 @@ interface IInitOptions {
8997
export class SolanaStakingClient {
9098
connection: Connection;
9199

100+
private readonly cluster: ICluster;
101+
92102
private readonly commitment: Commitment | ConnectionConfig;
93103

94104
private readonly sendThrottler: PQueue;
@@ -103,6 +113,7 @@ export class SolanaStakingClient {
103113
sendRate = 1,
104114
sendThrottler,
105115
}: IInitOptions) {
116+
this.cluster = cluster;
106117
this.commitment = commitment;
107118
this.connection = new Connection(clusterUrl, this.commitment);
108119
this.sendThrottler = sendThrottler ?? buildSendThrottler(sendRate);
@@ -272,6 +283,20 @@ export class SolanaStakingClient {
272283
payer: staker,
273284
})
274285
.instruction();
286+
if (this.cluster == ICluster.Mainnet) {
287+
// TODO: remove when staking on mainnet is upgraded
288+
instruction.keys.pop();
289+
instruction.keys.push({
290+
pubkey: SYSVAR_RENT_PUBKEY,
291+
isSigner: false,
292+
isWritable: false,
293+
});
294+
instruction.keys.push({
295+
pubkey: SystemProgram.programId,
296+
isSigner: false,
297+
isWritable: false,
298+
});
299+
}
275300

276301
return { ixs: [instruction] };
277302
}

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.4.16",
3+
"version": "7.4.17",
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)