@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/dist/esm/index.js +396 -336
- package/dist/index.d.mts +729 -607
- package/dist/index.d.ts +729 -607
- package/dist/index.js +396 -336
- package/package.json +1 -1
- package/src/idl/pump.json +387 -327
- package/src/idl/pump.ts +387 -327
- package/src/sdk.ts +13 -12
- package/src/state.ts +8 -4
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
|
|
551
|
-
admin: PublicKey,
|
|
550
|
+
async adminUpdateTokenIncentives(
|
|
552
551
|
startTime: BN,
|
|
553
552
|
endTime: BN,
|
|
554
553
|
dayNumber: BN,
|
|
555
|
-
|
|
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
|
-
.
|
|
562
|
+
.adminUpdateTokenIncentives(
|
|
561
563
|
startTime,
|
|
562
564
|
endTime,
|
|
563
|
-
|
|
564
|
-
|
|
565
|
+
secondsInADay,
|
|
566
|
+
dayNumber,
|
|
567
|
+
tokenSupplyPerDay,
|
|
565
568
|
)
|
|
566
569
|
.accountsPartial({
|
|
567
|
-
|
|
568
|
-
|
|
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
|
|
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
|
-
.
|
|
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
|
-
|
|
37
|
+
secondsInADay: BN;
|
|
38
|
+
mint: PublicKey;
|
|
39
|
+
totalTokenSupply: BN[];
|
|
38
40
|
solVolumes: BN[];
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export interface UserVolumeAccumulator {
|
|
42
|
-
|
|
44
|
+
user: PublicKey;
|
|
45
|
+
needsClaim: boolean;
|
|
46
|
+
totalUnclaimedTokens: BN;
|
|
47
|
+
totalClaimedTokens: BN;
|
|
43
48
|
currentSolVolume: BN;
|
|
44
|
-
|
|
45
|
-
totalClaimedPumpTokens: BN;
|
|
49
|
+
lastUpdateTimestamp: BN;
|
|
46
50
|
}
|