test-npm-den
Advanced tools
Comparing version 1.0.14 to 1.0.15
import { PublicKey, Connection } from '@solana/web3.js'; | ||
export declare type ClusterType = "mainnet-beta" | "testnet"; | ||
export declare class ESolConfig { | ||
@@ -11,3 +12,3 @@ eSOLProgramId: PublicKey; | ||
publicKey: PublicKey | null; | ||
constructor(configOverrides?: Partial<ESolConfig>); | ||
constructor(clusterType: ClusterType); | ||
} |
import { PublicKey, Connection } from '@solana/web3.js'; | ||
const DEFAULT_PROVIDER_URL = 'https://api.testnet.solana.com'; | ||
const TESTNET_STAKEPOOL_ACCOUNT = "4QRsVADHap1AgtpryYB2vz4htG3ysJcaXFkcFqkGjaF1"; | ||
const MAINNET_STAKEPOOL_ACCOUNT = "GUAMR8ciiaijraJeLDEDrFVaueLm9YzWWY9R7CBPL9rA"; | ||
const TESTNET_STAKEPOOL_PROGRAM_ID = "CgymamZFh5aVZhoSRtV2QrEZ58X4N1o2H5ZQPF4L5jj8"; | ||
const MAINNET_STAKEPOOL_PROGRAM_ID = "EverSFw9uN5t1V8kS3ficHUcKffSjwpGzUSGd7mgmSks"; | ||
export class ESolConfig { | ||
constructor(configOverrides = {}) { | ||
this.eSOLProgramId = new PublicKey('CgymamZFh5aVZhoSRtV2QrEZ58X4N1o2H5ZQPF4L5jj8'); | ||
this.eSOLStakePoolAddress = new PublicKey('4QRsVADHap1AgtpryYB2vz4htG3ysJcaXFkcFqkGjaF1'); | ||
constructor(clusterType) { | ||
this.seedPrefixDaoState = 'dao_state'; | ||
@@ -13,4 +15,15 @@ this.seedPrefixCommunityToken = 'community_token'; | ||
this.publicKey = null; | ||
Object.assign(this, configOverrides); | ||
switch (clusterType) { | ||
case "testnet": | ||
this.eSOLStakePoolAddress = new PublicKey(TESTNET_STAKEPOOL_ACCOUNT); | ||
this.eSOLProgramId = new PublicKey(TESTNET_STAKEPOOL_PROGRAM_ID); | ||
break; | ||
case "mainnet-beta": | ||
this.eSOLStakePoolAddress = new PublicKey(MAINNET_STAKEPOOL_ACCOUNT); | ||
this.eSOLProgramId = new PublicKey(MAINNET_STAKEPOOL_PROGRAM_ID); | ||
break; | ||
default: | ||
throw new Error("clusterType must be specified"); | ||
} | ||
} | ||
} |
@@ -1,7 +0,7 @@ | ||
import { ESolConfig } from './config'; | ||
import { ESolConfig, ClusterType } from './config'; | ||
import { PublicKey, Transaction } from '@solana/web3.js'; | ||
export declare class ESol { | ||
readonly config: ESolConfig; | ||
constructor(config?: ESolConfig); | ||
constructor(clusterType?: ClusterType); | ||
depositSol(userAddress: PublicKey, lamports: number, poolTokenReceiverAccount?: PublicKey, daoCommunityTokenReceiverAccount?: PublicKey, referrerTokenAccount?: PublicKey): Promise<Transaction>; | ||
} |
@@ -8,4 +8,4 @@ import { ESolConfig } from './config'; | ||
export class ESol { | ||
constructor(config = new ESolConfig()) { | ||
this.config = config; | ||
constructor(clusterType = 'testnet') { | ||
this.config = new ESolConfig(clusterType); | ||
} | ||
@@ -24,4 +24,4 @@ async depositSol(userAddress, lamports, poolTokenReceiverAccount, daoCommunityTokenReceiverAccount, referrerTokenAccount) { | ||
// Check user balance | ||
const feeCostInBlockchain = 3000000; | ||
let needForTransaction = feeCostInBlockchain; | ||
const lamportsToLeftInWallet = 3000000; | ||
let needForTransaction = lamportsToLeftInWallet; | ||
const daoCommunityTokenReceiverAccountRentSpace = await CONNECTION.getMinimumBalanceForRentExemption(165); | ||
@@ -28,0 +28,0 @@ if (!daoCommunityTokenReceiverAccount) { |
{ | ||
"name": "test-npm-den", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "Test", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
126811
2810