@pump-fun/pump-sdk 1.6.0-devnet.1 → 1.6.1-devnet.1

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/src/sdk.ts CHANGED
@@ -547,33 +547,35 @@ export class PumpSdk {
547
547
  return new BN(accountInfo.lamports - rentExemptionLamports);
548
548
  }
549
549
 
550
- async adminUpdatePumpIncentives(
551
- admin: PublicKey,
550
+ async adminUpdateTokenIncentives(
552
551
  startTime: BN,
553
552
  endTime: BN,
554
553
  dayNumber: BN,
555
- pumpTokenSupplyPerDay: BN,
554
+ tokenSupplyPerDay: BN,
555
+ secondsInADay: BN = new BN(86400),
556
556
  mint: PublicKey = PUMP_TOKEN_MINT,
557
557
  tokenProgram: PublicKey = TOKEN_2022_PROGRAM_ID,
558
558
  ): Promise<TransactionInstruction> {
559
+ const global = await this.fetchGlobal();
560
+
559
561
  return await this.offlinePumpProgram.methods
560
- .updatePumpIncentives(
562
+ .adminUpdateTokenIncentives(
561
563
  startTime,
562
564
  endTime,
563
- dayNumber.toNumber(),
564
- pumpTokenSupplyPerDay,
565
+ secondsInADay,
566
+ dayNumber,
567
+ tokenSupplyPerDay,
565
568
  )
566
569
  .accountsPartial({
567
- admin,
568
- globalVolumeAccumulator: this.globalVolumeAccumulatorPda()[0],
569
- globalConfig: this.globalPda(),
570
+ global: this.globalPda(),
571
+ authority: global.authority,
570
572
  mint,
571
573
  tokenProgram,
572
574
  })
573
575
  .instruction();
574
576
  }
575
577
 
576
- async claimPumpIncentives(
578
+ async claimTokenIncentives(
577
579
  user: PublicKey,
578
580
  payer: PublicKey,
579
581
  mint: PublicKey = PUMP_TOKEN_MINT,
@@ -595,11 +597,10 @@ export class PumpSdk {
595
597
  tokenProgram,
596
598
  ),
597
599
  await this.offlinePumpProgram.methods
598
- .claimPumpIncentives()
600
+ .claimTokenIncentives()
599
601
  .accountsPartial({
600
602
  user,
601
603
  payer,
602
- globalVolumeAccumulator: this.globalVolumeAccumulatorPda()[0],
603
604
  mint,
604
605
  tokenProgram,
605
606
  })
package/src/state.ts CHANGED
@@ -34,13 +34,17 @@ export interface BondingCurve {
34
34
  export interface GlobalVolumeAccumulator {
35
35
  startTime: BN;
36
36
  endTime: BN;
37
- totalPumpTokenSupply: BN[];
37
+ secondsInADay: BN;
38
+ mint: PublicKey;
39
+ totalTokenSupply: BN[];
38
40
  solVolumes: BN[];
39
41
  }
40
42
 
41
43
  export interface UserVolumeAccumulator {
42
- lastUpdateTimestamp: BN;
44
+ user: PublicKey;
45
+ needsClaim: boolean;
46
+ totalUnclaimedTokens: BN;
47
+ totalClaimedTokens: BN;
43
48
  currentSolVolume: BN;
44
- totalUnclaimedPumpTokens: BN;
45
- totalClaimedPumpTokens: BN;
49
+ lastUpdateTimestamp: BN;
46
50
  }