Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update idls, add readme for stake mint metadata set #275

Merged
merged 2 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.4.14",
"version": "7.4.15",
"$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.4.14",
"version": "7.4.15",
"description": "Common utilities and types used by streamflow packages.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "./dist/esm/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/distributor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/distributor",
"version": "7.4.14",
"version": "7.4.15",
"description": "JavaScript SDK to interact with Streamflow Airdrop protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/esm/index.js",
Expand Down Expand Up @@ -51,4 +51,4 @@
"bs58": "5.0.0",
"p-queue": "^8.0.1"
}
}
}
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.4.14",
"version": "7.4.15",
"license": "ISC",
"main": "index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/launchpad/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/launchpad",
"version": "7.4.14",
"version": "7.4.15",
"description": "JavaScript SDK to interact with Streamflow Launchpad protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/esm/index.js",
Expand Down Expand Up @@ -46,4 +46,4 @@
"bs58": "5.0.0",
"p-queue": "^8.0.1"
}
}
}
28 changes: 28 additions & 0 deletions packages/staking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,34 @@ await client.claimRewards({
> For instance, prepareClaimRewardsInstructions.
> These APIs allow to aggregate multiple operations in a single transaction according to the app needs.

### Set Token Metadata

SolanaStakingClient also exposes original IDL of all programs, so you can use some additional instructions, that are not wrapped by the client. Currently there is no method to update Token Metadata of the Staking Mint that stakers get in return for their stake, but you can call the instructions from the original IDL like so:

```typescript
// Stake Mint Token Program matches token program of the original token, program exposes separate methods depending on the program.
import { signAndExecuteTransaction, prepareTransaction } from "@streamflow/common/solana";

const program = client.programs.stakePoolProgram;

// for SPL
let ix = await program.methods.setTokenMetadataSpl("sToken", "sTST", "https://arweave.net/VVrrcRaOYombRAzWrcDLiV5hVmQUfvp1nS8nfttQvBE").accounts({
stakePool: metadataId
}).accountsPartial({
authority: keypair.publicKey
}).instruction();
// for Token22
ix = await program.methods.setTokenMetadataT22("sToken", "sTST", "https://arweave.net/VVrrcRaOYombRAzWrcDLiV5hVmQUfvp1nS8nfttQvBE").accounts({
stakePool: metadataId
}).accountsPartial({
authority: keypair.publicKey
}).instruction();

const { tx, hash, context } = await prepareTransaction(client.connection, [ix], keypair.publicKey);
const sig = await signAndExecuteTransaction(client.connection, keypair, tx, { hash, context }, {});
console.log(sig);
```

## Appendix

Streamflow Staking protocol program IDs
Expand Down
4 changes: 2 additions & 2 deletions packages/staking/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/staking",
"version": "7.4.14",
"version": "7.4.15",
"description": "JavaScript SDK to interact with Streamflow Staking protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/esm/index.js",
Expand Down Expand Up @@ -46,4 +46,4 @@
"bs58": "5.0.0",
"p-queue": "^8.0.1"
}
}
}
2 changes: 1 addition & 1 deletion packages/staking/solana/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export class SolanaStakingClient {
const creator = extParams.invoker.publicKey;
invariant(creator, "Undefined invoker publicKey");
const createInstruction = await stakePoolProgram.methods
.createPool(nonce, maxWeight, minDuration, maxDuration, permissionless)
.createPool(nonce, maxWeight, minDuration, maxDuration, permissionless, null, null)
.accounts({
creator,
mint,
Expand Down
Loading
Loading