
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@solrise-finance/staking-sdk
Advanced tools
Solrise.finance SLRS token staking SDK.
This SDK allows easy fetching, parsing and staking/unstaking your SLRS tokens
Contents:
$ npm install @solrise-finance/staking-sdk
import { SolriseStaking } from '@solrise-finance/staking-sdk';
const solrise = new SolriseStaking({ publicKey: wallet.publicKey })
import { SolriseStaking } from '@solrise-finance/staking-sdk';
const solrise = new SolriseStaking({
publicKey: wallet.publicKey,
connection: web3connection
})
Get aggregate staking account (shows sum of all your stakes):
const aggregate = await solrise.getAggregateStakeAccount();
aggregate = {
pubkey: publicKey, // account public key
isInitialized: true, // account initialized
accountType: 2, // 2 means its aggregate account
version: 1, // version
owner: publicKey, // your wallet
count: 5, // number of your stake accounts
totalStake: '5000000' // total SLRS staked in your stake accounts
}
Get all staking accounts:
const accounts = await solrise.getStakingAccounts();
accounts = [
{
pubkey: publicKey, // account public key
isInitialized: true, // account initialized
accountType: 1, // 1 means its staking account
version: 1, // version
owner: publicKey, // your wallet
tier: 2, // see tiers explanation
amount: '1000000', // amount of SLRS tokens
amountUi: 1, // amount but divided by decimals
calculatedRewards: '13120', // SLRS rewards when lockup is finished
createdAt: 1652624509, // account created
lastUpdated: 1652624509, // account updated (harvest, topup, withdraw)
state: 1, // state ?
apy: 16, // APY
canWithdraw: false, // if true - you can withdraw principal + reward
pendingReward: '13120', // pending reward for harvest when tier is 1
pendingRewardUi: 0.01312, // same as above but divided with decimals
unlocksInSeconds: 2583705 // lockup expiration in seconds for tiers 2-5
},
// ...
]
Create a new staking account:
const { transaction, signers } = await solrise.createStakingAccount(
tier, // tier is number 1 - 5
amount, // number of SLRS
yourSlrsTokenPublicKey // SLRS token account owned by your wallet
);
const signature = await signAndSendTransaction(transaction, signers)
Harvest reward (for tier 1 staking accounts only):
const { transaction, signers } = await solrise.harvestStakingAccount(
stakingAccountPublicKey, // publicKey of staking account you are harvesting
yourSlrsTokenPublicKey // SLRS token account owned by your wallet
);
const signature = await signAndSendTransaction(transaction, signers)
Topup account (+ harvest reward if any):
const { transaction, signers } = await solrise.topupStakingAccount(
amount, // number of SLRS to add to staking account
stakingAccountPublicKey, // publicKey of staking account you are harvesting
yourSlrsTokenPublicKey // SLRS token account owned by your wallet
);
const signature = await signAndSendTransaction(transaction, signers)
Withdraw principal (+ harvest reward if any):
const { transaction, signers } = await solrise.withdrawPrincipal(
amount, // number of SLRS to withdraw
stakingAccountPublicKey, // publicKey of staking account you are harvesting
yourSlrsTokenPublicKey // SLRS token account owned by your wallet
);
const signature = await signAndSendTransaction(transaction, signers)
FAQs
# solrise-staking-sdk
We found that @solrise-finance/staking-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.