@zebec-network/zebec-stake-sdk 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/service.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Address, AnchorProvider, BN, Program, Provider } from "@coral-xyz/anchor";
2
- import { PublicKey, TransactionInstruction } from "@solana/web3.js";
2
+ import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
3
3
  import { TransactionPayload } from "@zebec-network/solana-common";
4
4
  import { ZebecStakeIdlV1 } from "./artifacts";
5
5
  import { ReadonlyProvider } from "./providers";
@@ -78,6 +78,8 @@ export declare class StakeService {
78
78
  getAllStakesCount(lockupAddress: Address): Promise<number>;
79
79
  getStakeSignatureForStake(stakeInfo: StakeInfo): Promise<string | null>;
80
80
  getAllStakesInfo(lockupAddress: Address): Promise<StakeInfo[]>;
81
+ get programId(): PublicKey;
82
+ get connection(): Connection;
81
83
  }
82
84
  export type InitLockupInstructionData = {
83
85
  rewardSchemes: ParsedRewardScheme[];
package/dist/service.js CHANGED
@@ -126,7 +126,7 @@ class StakeService {
126
126
  return provider.wallet.signTransaction(tx);
127
127
  };
128
128
  }
129
- return new solana_common_1.TransactionPayload(this.provider.connection, errorMap, instructions, payerKey, signers, addressLookupTableAccounts, signTransaction);
129
+ return new solana_common_1.TransactionPayload(this.connection, errorMap, instructions, payerKey, signers, addressLookupTableAccounts, signTransaction);
130
130
  }
131
131
  async getInitLockupInstruction(creator, lockup, stakeToken, rewardToken, rewardVault, stakeVault, data) {
132
132
  return this.program.methods
@@ -177,7 +177,7 @@ class StakeService {
177
177
  const stakeToken = (0, anchor_1.translateAddress)(params.stakeToken);
178
178
  const rewardToken = (0, anchor_1.translateAddress)(params.rewardToken);
179
179
  const feeVault = (0, anchor_1.translateAddress)(params.feeVault);
180
- const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, stakeToken);
180
+ const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, stakeToken);
181
181
  const UNITS_PER_STAKE_TOKEN = constants_1.TEN_BIGNUM.pow(stakeTokenDecimals);
182
182
  const rewardSchemes = params.rewardSchemes.map((value) => {
183
183
  return {
@@ -185,9 +185,9 @@ class StakeService {
185
185
  reward: new anchor_1.BN((0, core_utils_1.percentToBps)(value.rewardRate)),
186
186
  };
187
187
  });
188
- const lockup = (0, pda_1.deriveLockupAddress)(params.name, this.program.programId);
189
- const rewardVault = (0, pda_1.deriveRewardVaultAddress)(lockup, this.program.programId);
190
- const stakeVault = (0, pda_1.deriveStakeVaultAddress)(lockup, this.program.programId);
188
+ const lockup = (0, pda_1.deriveLockupAddress)(params.name, this.programId);
189
+ const rewardVault = (0, pda_1.deriveRewardVaultAddress)(lockup, this.programId);
190
+ const stakeVault = (0, pda_1.deriveStakeVaultAddress)(lockup, this.programId);
191
191
  const fee = new anchor_1.BN((0, bignumber_js_1.BigNumber)(params.fee).times(UNITS_PER_STAKE_TOKEN).toFixed(0));
192
192
  const minimumStake = new anchor_1.BN((0, bignumber_js_1.BigNumber)(params.minimumStake).times(UNITS_PER_STAKE_TOKEN).toFixed(0));
193
193
  const instruction = await this.getInitLockupInstruction(creator, lockup, stakeToken, rewardToken, rewardVault, stakeVault, {
@@ -204,8 +204,8 @@ class StakeService {
204
204
  if (!staker) {
205
205
  throw new Error("MissingArgument: Please provide either staker address or publicKey in provider");
206
206
  }
207
- const lockup = (0, pda_1.deriveLockupAddress)(params.lockupName, this.program.programId);
208
- const lockupAccount = await this.program.account.lockup.fetchNullable(lockup, this.provider.connection.commitment);
207
+ const lockup = (0, pda_1.deriveLockupAddress)(params.lockupName, this.programId);
208
+ const lockupAccount = await this.program.account.lockup.fetchNullable(lockup, this.connection.commitment);
209
209
  if (!lockupAccount) {
210
210
  throw new Error("Lockup account does not exists for address: " + lockup);
211
211
  }
@@ -214,16 +214,16 @@ class StakeService {
214
214
  throw new Error("Invalid lockperiod. Available options are: " + lockPeriods.map((l) => l.toString()).concat(", "));
215
215
  }
216
216
  const stakeToken = lockupAccount.stakedToken.tokenAddress;
217
- const stakeVault = (0, pda_1.deriveStakeVaultAddress)(lockup, this.program.programId);
218
- const userNonce = (0, pda_1.deriveUserNonceAddress)(staker, lockup, this.program.programId);
219
- const userNonceAccount = await this.program.account.userNonce.fetchNullable(userNonce, this.provider.connection.commitment);
217
+ const stakeVault = (0, pda_1.deriveStakeVaultAddress)(lockup, this.programId);
218
+ const userNonce = (0, pda_1.deriveUserNonceAddress)(staker, lockup, this.programId);
219
+ const userNonceAccount = await this.program.account.userNonce.fetchNullable(userNonce, this.connection.commitment);
220
220
  let nonce = BigInt(0);
221
221
  if (userNonceAccount) {
222
222
  nonce = BigInt(userNonceAccount.nonce.toString());
223
223
  }
224
- const stakePda = (0, pda_1.deriveStakeAddress)(staker, lockup, nonce, this.program.programId);
224
+ const stakePda = (0, pda_1.deriveStakeAddress)(staker, lockup, nonce, this.programId);
225
225
  const stakeVaultTokenAccount = (0, solana_common_1.getAssociatedTokenAddressSync)(stakeToken, stakeVault, true);
226
- const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, stakeToken);
226
+ const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, stakeToken);
227
227
  const UNITS_PER_STAKE_TOKEN = constants_1.TEN_BIGNUM.pow(stakeTokenDecimals);
228
228
  const instruction = await this.getStakeInstruction(lockup, stakeToken, stakeVault, staker, userNonce, stakePda, stakeVaultTokenAccount, {
229
229
  amount: new anchor_1.BN((0, bignumber_js_1.BigNumber)(params.amount).times(UNITS_PER_STAKE_TOKEN).toFixed(0)),
@@ -237,28 +237,28 @@ class StakeService {
237
237
  if (!staker) {
238
238
  throw new Error("MissingArgument: Please provide either staker address or publicKey in provider");
239
239
  }
240
- const lockup = (0, pda_1.deriveLockupAddress)(params.lockupName, this.program.programId);
241
- const lockupAccount = await this.program.account.lockup.fetchNullable(lockup, this.provider.connection.commitment);
240
+ const lockup = (0, pda_1.deriveLockupAddress)(params.lockupName, this.programId);
241
+ const lockupAccount = await this.program.account.lockup.fetchNullable(lockup, this.connection.commitment);
242
242
  if (!lockupAccount) {
243
243
  throw new Error("Lockup account does not exists for address: " + lockup);
244
244
  }
245
245
  const stakeToken = lockupAccount.stakedToken.tokenAddress;
246
246
  const rewardToken = lockupAccount.rewardToken.tokenAddress;
247
247
  const feeVault = lockupAccount.feeInfo.feeVault;
248
- const stakePda = (0, pda_1.deriveStakeAddress)(staker, lockup, params.nonce, this.program.programId);
249
- const rewardVault = (0, pda_1.deriveRewardVaultAddress)(lockup, this.program.programId);
250
- const stakeVault = (0, pda_1.deriveStakeVaultAddress)(lockup, this.program.programId);
248
+ const stakePda = (0, pda_1.deriveStakeAddress)(staker, lockup, params.nonce, this.programId);
249
+ const rewardVault = (0, pda_1.deriveRewardVaultAddress)(lockup, this.programId);
250
+ const stakeVault = (0, pda_1.deriveStakeVaultAddress)(lockup, this.programId);
251
251
  const stakerTokenAccount = (0, solana_common_1.getAssociatedTokenAddressSync)(stakeToken, staker, true);
252
252
  const instruction = await this.getUnstakeInstruction(feeVault, lockup, stakePda, rewardToken, rewardVault, stakeToken, stakeVault, staker, stakerTokenAccount, new anchor_1.BN(params.nonce.toString()));
253
253
  return this._createPayload(staker, [instruction]);
254
254
  }
255
255
  async getLockupInfo(lockupAddress) {
256
- const lockupAccount = await this.program.account.lockup.fetchNullable(lockupAddress, this.provider.connection.commitment);
256
+ const lockupAccount = await this.program.account.lockup.fetchNullable(lockupAddress, this.connection.commitment);
257
257
  if (!lockupAccount) {
258
258
  return null;
259
259
  }
260
260
  const stakeTokenAddress = lockupAccount.stakedToken.tokenAddress;
261
- const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, stakeTokenAddress);
261
+ const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, stakeTokenAddress);
262
262
  const UNITS_PER_STAKE_TOKEN = constants_1.TEN_BIGNUM.pow(stakeTokenDecimals);
263
263
  return {
264
264
  address: lockupAddress.toString(),
@@ -285,17 +285,17 @@ class StakeService {
285
285
  };
286
286
  }
287
287
  async getStakeInfo(stakeAddress, lockupAddress) {
288
- const lockupAccount = await this.program.account.lockup.fetchNullable(lockupAddress, this.provider.connection.commitment);
288
+ const lockupAccount = await this.program.account.lockup.fetchNullable(lockupAddress, this.connection.commitment);
289
289
  if (!lockupAccount) {
290
290
  throw new Error("Lockup account does not exists for address: " + lockupAddress);
291
291
  }
292
292
  const stakeTokenAddress = lockupAccount.stakedToken.tokenAddress;
293
293
  const rewardTokenAddress = lockupAccount.rewardToken.tokenAddress;
294
- const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, stakeTokenAddress);
295
- const rewardTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, rewardTokenAddress);
294
+ const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, stakeTokenAddress);
295
+ const rewardTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, rewardTokenAddress);
296
296
  const UNITS_PER_STAKE_TOKEN = constants_1.TEN_BIGNUM.pow(stakeTokenDecimals);
297
297
  const UNITS_PER_REWARD_TOKEN = constants_1.TEN_BIGNUM.pow(rewardTokenDecimals);
298
- const stakeAccount = await this.program.account.userStakeData.fetchNullable(stakeAddress, this.provider.connection.commitment);
298
+ const stakeAccount = await this.program.account.userStakeData.fetchNullable(stakeAddress, this.connection.commitment);
299
299
  if (!stakeAccount) {
300
300
  return null;
301
301
  }
@@ -312,7 +312,7 @@ class StakeService {
312
312
  };
313
313
  }
314
314
  async getUserNonceInfo(userNonceAddress) {
315
- const userNonceAccount = await this.program.account.userNonce.fetchNullable(userNonceAddress, this.provider.connection.commitment);
315
+ const userNonceAccount = await this.program.account.userNonce.fetchNullable(userNonceAddress, this.connection.commitment);
316
316
  if (!userNonceAccount) {
317
317
  return null;
318
318
  }
@@ -322,60 +322,65 @@ class StakeService {
322
322
  };
323
323
  }
324
324
  async getAllStakesInfoOfUser(userAdress, lockupAddress, options = {}) {
325
- const lockupAccount = await this.program.account.lockup.fetchNullable(lockupAddress, this.provider.connection.commitment);
325
+ const lockupAccount = await this.program.account.lockup.fetchNullable(lockupAddress, this.connection.commitment);
326
326
  if (!lockupAccount) {
327
327
  throw new Error("Lockup account does not exists for address: " + lockupAddress);
328
328
  }
329
329
  const stakeTokenAddress = lockupAccount.stakedToken.tokenAddress;
330
330
  const rewardTokenAddress = lockupAccount.rewardToken.tokenAddress;
331
- const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, stakeTokenAddress);
332
- const rewardTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, rewardTokenAddress);
331
+ const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, stakeTokenAddress);
332
+ const rewardTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, rewardTokenAddress);
333
333
  const UNITS_PER_STAKE_TOKEN = constants_1.TEN_BIGNUM.pow(stakeTokenDecimals);
334
334
  const UNITS_PER_REWARD_TOKEN = constants_1.TEN_BIGNUM.pow(rewardTokenDecimals);
335
- const userNonceAddress = (0, pda_1.deriveUserNonceAddress)(userAdress, lockupAddress, this.program.programId);
336
- const userNonceAccount = await this.program.account.userNonce.fetchNullable(userNonceAddress, this.provider.connection.commitment);
335
+ const userNonceAddress = (0, pda_1.deriveUserNonceAddress)(userAdress, lockupAddress, this.programId);
336
+ const userNonceAccount = await this.program.account.userNonce.fetchNullable(userNonceAddress, this.connection.commitment);
337
337
  if (!userNonceAccount) {
338
338
  return [];
339
339
  }
340
340
  const currentNonce = userNonceAccount.nonce.toNumber();
341
341
  const nonces = Array.from({ length: currentNonce }, (_, i) => BigInt(i));
342
- const stakeAddresses = nonces.map((nonce) => (0, pda_1.deriveStakeAddress)(userAdress, lockupAddress, nonce, this.program.programId));
343
- const accountInfos = await this.provider.connection.getMultipleAccountsInfo(stakeAddresses, {
344
- commitment: "finalized",
345
- });
346
- const stakeAccountsInfo = accountInfos.map((value, i) => {
347
- (0, assert_1.default)(value, "Account does not exists for stake address: " + stakeAddresses[i] + " at nonce: " + nonces[i]);
348
- const stakeAccount = this.program.coder.accounts.decode(this.program.idl.accounts[2].name, value.data);
349
- const info = {
350
- address: stakeAddresses[i].toString(),
351
- nonce: BigInt(stakeAccount.nonce.toString()),
352
- createdTime: stakeAccount.createdTime.toNumber(),
353
- stakedAmount: (0, bignumber_js_1.BigNumber)(stakeAccount.stakedAmount.toString()).div(UNITS_PER_STAKE_TOKEN).toFixed(),
354
- rewardAmount: (0, bignumber_js_1.BigNumber)(stakeAccount.rewardAmount.toString()).div(UNITS_PER_REWARD_TOKEN).toFixed(),
355
- stakeClaimed: stakeAccount.stakeClaimed,
356
- lockPeriod: stakeAccount.lockPeriod.toNumber(),
357
- lockup: stakeAccount.lockup.toString(),
358
- staker: stakeAccount.staker.toString(),
359
- };
360
- return info;
361
- });
362
- let stakesWithHash = new Array(stakeAccountsInfo.length);
363
- const { maxConcurrent = 3, minDelayMs = 400 } = options;
364
- const queue = new rateLimitQueue_1.RateLimitedQueue(maxConcurrent, minDelayMs); // Max 3 concurrent, 300ms between requests
365
- const promises = stakeAccountsInfo.map((stakeInfo, index) => queue.add(async () => {
366
- const signature = await this.getStakeSignatureForStake(stakeInfo);
367
- stakesWithHash[index] = {
368
- hash: signature ? signature : "",
369
- ...stakeInfo,
370
- };
371
- }));
372
- await Promise.all(promises);
373
- return stakesWithHash;
342
+ const stakeAddresses = nonces.map((nonce) => (0, pda_1.deriveStakeAddress)(userAdress, lockupAddress, nonce, this.programId));
343
+ const stakeAddressesChunks = (0, utils_1.chunkArray)(stakeAddresses, 100);
344
+ let stakeWithHash2D = [];
345
+ for (const stakeAddresses of stakeAddressesChunks) {
346
+ const accountInfos = await this.connection.getMultipleAccountsInfo(stakeAddresses, {
347
+ commitment: this.connection.commitment,
348
+ });
349
+ const stakeAccountsInfo = accountInfos.map((value, i) => {
350
+ (0, assert_1.default)(value, "Account does not exists for stake address: " + stakeAddresses[i] + " at nonce: " + nonces[i]);
351
+ const stakeAccount = this.program.coder.accounts.decode(this.program.idl.accounts[2].name, value.data);
352
+ const info = {
353
+ address: stakeAddresses[i].toString(),
354
+ nonce: BigInt(stakeAccount.nonce.toString()),
355
+ createdTime: stakeAccount.createdTime.toNumber(),
356
+ stakedAmount: (0, bignumber_js_1.BigNumber)(stakeAccount.stakedAmount.toString()).div(UNITS_PER_STAKE_TOKEN).toFixed(),
357
+ rewardAmount: (0, bignumber_js_1.BigNumber)(stakeAccount.rewardAmount.toString()).div(UNITS_PER_REWARD_TOKEN).toFixed(),
358
+ stakeClaimed: stakeAccount.stakeClaimed,
359
+ lockPeriod: stakeAccount.lockPeriod.toNumber(),
360
+ lockup: stakeAccount.lockup.toString(),
361
+ staker: stakeAccount.staker.toString(),
362
+ };
363
+ return info;
364
+ });
365
+ let stakesWithHash = new Array(stakeAccountsInfo.length);
366
+ const { maxConcurrent = 3, minDelayMs = 400 } = options;
367
+ const queue = new rateLimitQueue_1.RateLimitedQueue(maxConcurrent, minDelayMs); // Max 3 concurrent, 300ms between requests
368
+ const promises = stakeAccountsInfo.map((stakeInfo, index) => queue.add(async () => {
369
+ const signature = await this.getStakeSignatureForStake(stakeInfo);
370
+ stakesWithHash[index] = {
371
+ hash: signature ? signature : "",
372
+ ...stakeInfo,
373
+ };
374
+ }));
375
+ await Promise.all(promises);
376
+ stakeWithHash2D.push(stakesWithHash);
377
+ }
378
+ return stakeWithHash2D.flat();
374
379
  }
375
380
  async getAllStakesCount(lockupAddress) {
376
381
  const dataSize = this.program.account.userStakeData.size;
377
- const accountInfos = await this.provider.connection.getProgramAccounts(this.program.programId, {
378
- commitment: "finalized",
382
+ const accountInfos = await this.connection.getProgramAccounts(this.programId, {
383
+ commitment: this.connection.commitment,
379
384
  dataSlice: {
380
385
  length: 0,
381
386
  offset: 0,
@@ -395,7 +400,8 @@ class StakeService {
395
400
  return accountInfos.length;
396
401
  }
397
402
  async getStakeSignatureForStake(stakeInfo) {
398
- const signatures = await (0, utils_1.callWithEnhancedBackoff)(async () => this.provider.connection.getSignaturesForAddress((0, anchor_1.translateAddress)(stakeInfo.address), {}, "finalized"));
403
+ const commitment = this.connection.commitment === "finalized" ? "finalized" : "confirmed";
404
+ const signatures = await (0, utils_1.callWithEnhancedBackoff)(async () => this.connection.getSignaturesForAddress((0, anchor_1.translateAddress)(stakeInfo.address), {}, commitment));
399
405
  const stakeSignatures = signatures.filter((s) => {
400
406
  return !s.err && (s.blockTime ?? 0) === stakeInfo.createdTime;
401
407
  });
@@ -403,18 +409,18 @@ class StakeService {
403
409
  return signatureInfo ? signatureInfo.signature : null;
404
410
  }
405
411
  async getAllStakesInfo(lockupAddress) {
406
- const lockupAccount = await this.program.account.lockup.fetchNullable(lockupAddress, this.provider.connection.commitment);
412
+ const lockupAccount = await this.program.account.lockup.fetchNullable(lockupAddress, this.connection.commitment);
407
413
  if (!lockupAccount) {
408
414
  throw new Error("Lockup account does not exists for address: " + lockupAddress);
409
415
  }
410
416
  const stakeTokenAddress = lockupAccount.stakedToken.tokenAddress;
411
417
  const rewardTokenAddress = lockupAccount.rewardToken.tokenAddress;
412
- const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, stakeTokenAddress);
413
- const rewardTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.provider.connection, rewardTokenAddress);
418
+ const stakeTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, stakeTokenAddress);
419
+ const rewardTokenDecimals = await (0, solana_common_1.getMintDecimals)(this.connection, rewardTokenAddress);
414
420
  const UNITS_PER_STAKE_TOKEN = constants_1.TEN_BIGNUM.pow(stakeTokenDecimals);
415
421
  const UNITS_PER_REWARD_TOKEN = constants_1.TEN_BIGNUM.pow(rewardTokenDecimals);
416
422
  const dataSize = this.program.account.userStakeData.size;
417
- const accountInfos = await this.provider.connection.getProgramAccounts(this.program.programId, {
423
+ const accountInfos = await this.connection.getProgramAccounts(this.programId, {
418
424
  commitment: "finalized",
419
425
  filters: [
420
426
  {
@@ -444,5 +450,11 @@ class StakeService {
444
450
  return info;
445
451
  });
446
452
  }
453
+ get programId() {
454
+ return this.program.programId;
455
+ }
456
+ get connection() {
457
+ return this.provider.connection;
458
+ }
447
459
  }
448
460
  exports.StakeService = StakeService;
package/dist/utils.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare function callWithEnhancedBackoff<T>(fn: () => Promise<T>, maxRetries?: number, backoffFactor?: number, baseDelay?: number, maxDelay?: number): Promise<T>;
2
+ export declare function chunkArray<T>(arr: T[], size: number): T[][];
package/dist/utils.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.callWithEnhancedBackoff = callWithEnhancedBackoff;
4
+ exports.chunkArray = chunkArray;
4
5
  const core_utils_1 = require("@zebec-network/core-utils");
5
6
  // Set your backoff parameters
6
7
  const MAX_RETRIES = 5;
@@ -29,3 +30,10 @@ async function callWithEnhancedBackoff(fn, maxRetries = MAX_RETRIES, backoffFact
29
30
  }
30
31
  throw new Error("Max retries exceeded");
31
32
  }
33
+ function chunkArray(arr, size) {
34
+ const result = [];
35
+ for (let i = 0; i < arr.length; i += size) {
36
+ result.push(arr.slice(i, i + size));
37
+ }
38
+ return result;
39
+ }
package/package.json CHANGED
@@ -1,46 +1,47 @@
1
- {
2
- "name": "@zebec-network/zebec-stake-sdk",
3
- "version": "1.0.10",
4
- "description": "An SDK for zebec network stake solana program",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "author": "Ashish Sapkota",
8
- "license": "MIT",
9
- "files": [
10
- "dist"
11
- ],
12
- "keywords": [
13
- "solana",
14
- "zebec",
15
- "zebec network",
16
- "stake",
17
- "staking"
18
- ],
19
- "scripts": {
20
- "build": "npm run clean && tsc",
21
- "clean": "rimraf ./dist",
22
- "format": "prettier --write .",
23
- "start": "ts-node src/index.ts",
24
- "test": "ts-mocha -p ./tsconfig.json -t 1000000000"
25
- },
26
- "dependencies": {
27
- "@coral-xyz/anchor": "^0.31.1",
28
- "@solana/web3.js": "1.98.2",
29
- "@zebec-network/core-utils": "^1.0.4",
30
- "@zebec-network/solana-common": "^1.5.0",
31
- "bignumber.js": "^9.3.0",
32
- "buffer": "^6.0.3",
33
- "dotenv": "^16.5.0"
34
- },
35
- "devDependencies": {
36
- "@types/bn.js": "^5.1.6",
37
- "@types/mocha": "^10.0.10",
38
- "@types/node": "^22.14.1",
39
- "mocha": "^11.1.0",
40
- "prettier": "^3.5.3",
41
- "rimraf": "^6.0.1",
42
- "ts-mocha": "^11.1.0",
43
- "ts-node": "^10.9.2",
44
- "typescript": "^5.8.3"
45
- }
1
+ {
2
+ "name": "@zebec-network/zebec-stake-sdk",
3
+ "version": "1.0.12",
4
+ "description": "An SDK for zebec network stake solana program",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "author": "Ashish Sapkota",
8
+ "license": "MIT",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "keywords": [
13
+ "solana",
14
+ "zebec",
15
+ "zebec network",
16
+ "stake",
17
+ "staking"
18
+ ],
19
+ "scripts": {
20
+ "build": "npm run clean && tsc",
21
+ "clean": "rimraf ./dist",
22
+ "format": "prettier --write .",
23
+ "start": "ts-node src/index.ts",
24
+ "test": "ts-mocha -p ./tsconfig.json -t 1000000000 test/**/*.test.ts",
25
+ "test:single": "ts-mocha -p ./tsconfig.json -t 1000000000"
26
+ },
27
+ "dependencies": {
28
+ "@coral-xyz/anchor": "^0.31.1",
29
+ "@solana/web3.js": "1.98.2",
30
+ "@zebec-network/core-utils": "^1.0.4",
31
+ "@zebec-network/solana-common": "^1.5.0",
32
+ "bignumber.js": "^9.3.0",
33
+ "buffer": "^6.0.3",
34
+ "dotenv": "^16.5.0"
35
+ },
36
+ "devDependencies": {
37
+ "@types/bn.js": "^5.1.6",
38
+ "@types/mocha": "^10.0.10",
39
+ "@types/node": "^22.14.1",
40
+ "mocha": "^11.1.0",
41
+ "prettier": "^3.5.3",
42
+ "rimraf": "^6.0.1",
43
+ "ts-mocha": "^11.1.0",
44
+ "ts-node": "^10.9.2",
45
+ "typescript": "^5.8.3"
46
+ }
46
47
  }