Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

test-npm-den

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-npm-den - npm Package Compare versions

Comparing version 1.0.27 to 1.0.28

stake-pool-sdk/.DS_Store

2

package.json
{
"name": "test-npm-den",
"version": "1.0.27",
"version": "1.0.28",
"description": "Test",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,1 +0,63 @@

# My Awesome Greeter
<div align="center">
<a href="https://eversol.one/">
![Esol logo](src/logo/esol.svg?raw=true 'Eversol')
</a>
</div>
# Eversol Stake Pool SDK
## Installation
```bash
$ npm install @eversol/eversol-ts-sdk
```
### Initialize the library
Import the main client class ESol and initialize it with the desired cluster type:
```ts
import { ESol } from '@eversol/eversol-ts-sdk';
// initializes for mainnet-beta
const eSol = new Socean('mainnet-beta');
// or for testnet
const eSol = new Socean(); // or give 'testnet' as the argument
```
### Deposit SOL Transaction
Stake SOL and get your eSOL:
```ts
...
const depositSolTransaction = await eSol.depositSolTransaction(userAddress, amountLamports)
// than sign and send the `transaction`
```
### Instant unstake eSOL Transaction
Skip the basic Solana cool-down period and undelegate stake instantly. If the feature is not available (meaning there is not enough liquidity/reserve in the pool to cover instant unstaking), please use the standard Unstake:
```ts
...
const instantUnstakeTransaction = await eSol.unDelegateSolTransaction(userAddress, amountLamports)
// than sign and send the `transaction`
```
### Classic delayed unstake eSOL Transaction
Skip the basic Solana cool-down period and undelegate stake instantly. If the feature is not available (meaning there is not enough liquidity/reserve in the pool to cover instant unstaking), please use the standard Unstake:
```ts
...
const instantUnstakeTransaction = await eSol.unDelegateSolTransaction(userAddress, amountLamports)
// than sign and send the `transaction`
```
## Learn more
- [Eversol web](https://eversol.one/)
- [Eversol docs](https://docs.eversol.one/overview/welcome-to-eversol)

@@ -6,5 +6,5 @@ import { ESolConfig, ClusterType } from './config';

constructor(clusterType?: ClusterType);
depositSol(userAddress: PublicKey, lamports: number, poolTokenReceiverAccount?: PublicKey, daoCommunityTokenReceiverAccount?: PublicKey, referrerTokenAccount?: PublicKey): Promise<Transaction>;
unDelegateSol(userAddress: PublicKey, lamports: number, solWithdrawAuthority?: PublicKey): Promise<Transaction>;
withdrawSol(userAddress: PublicKey, lamports: number, stakeReceiver?: PublicKey, poolTokenAccount?: PublicKey): Promise<Transaction>;
depositSolTransaction(userAddress: PublicKey, lamports: number, poolTokenReceiverAccount?: PublicKey, daoCommunityTokenReceiverAccount?: PublicKey, referrerTokenAccount?: PublicKey): Promise<Transaction>;
unDelegateSolTransaction(userAddress: PublicKey, solAmount: number, solWithdrawAuthority?: PublicKey): Promise<Transaction>;
withdrawSolTransaction(userAddress: PublicKey, solAmount: number, stakeReceiver?: PublicKey, poolTokenAccount?: PublicKey): Promise<Transaction>;
}

@@ -12,3 +12,3 @@ import { ESolConfig } from './config';

}
async depositSol(userAddress, lamports, poolTokenReceiverAccount, daoCommunityTokenReceiverAccount, referrerTokenAccount) {
async depositSolTransaction(userAddress, lamports, poolTokenReceiverAccount, daoCommunityTokenReceiverAccount, referrerTokenAccount) {
const CONNECTION = this.config.connection;

@@ -129,3 +129,3 @@ const userSolBalance = await CONNECTION.getBalance(userAddress, 'confirmed');

}
async unDelegateSol(userAddress, lamports, solWithdrawAuthority) {
async unDelegateSolTransaction(userAddress, solAmount, solWithdrawAuthority) {
const CONNECTION = this.config.connection;

@@ -136,3 +136,3 @@ const tokenOwner = userAddress;

const stakePool = await getStakePoolAccount(CONNECTION, stakePoolAddress);
const poolAmount = solToLamports(lamports);
const poolAmount = solToLamports(solAmount);
// dao part

@@ -257,3 +257,3 @@ const daoStateDtoInfo = await PublicKey.findProgramAddress([Buffer.from(this.config.seedPrefixDaoState), stakePoolAddress.toBuffer(), StakePoolProgram.programId.toBuffer()], StakePoolProgram.programId);

}
async withdrawSol(userAddress, lamports, stakeReceiver, poolTokenAccount) {
async withdrawSolTransaction(userAddress, solAmount, stakeReceiver, poolTokenAccount) {
var _a, _b;

@@ -263,3 +263,3 @@ const CONNECTION = this.config.connection;

const stakePool = await getStakePoolAccount(CONNECTION, stakePoolAddress);
const poolAmount = solToLamports(lamports);
const poolAmount = solToLamports(solAmount);
// dao part

@@ -266,0 +266,0 @@ const daoStateDtoInfo = await PublicKey.findProgramAddress([Buffer.from(this.config.seedPrefixDaoState), stakePoolAddress.toBuffer(), StakePoolProgram.programId.toBuffer()], StakePoolProgram.programId);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc