test-npm-den
Advanced tools
Comparing version 1.0.27 to 1.0.28
{ | ||
"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); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
104039
25
63