@pump-fun/pump-sdk 1.12.0-devnet.1 → 1.13.0-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 +15 -0
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +15 -0
- package/package.json +1 -1
- package/src/index.ts +7 -1
- package/src/sdk.ts +21 -0
- package/src/state.ts +6 -0
package/dist/esm/index.js
CHANGED
|
@@ -4714,6 +4714,21 @@ var PumpSdk = class {
|
|
|
4714
4714
|
userVolumeAccumulatorPda(user)[0]
|
|
4715
4715
|
);
|
|
4716
4716
|
}
|
|
4717
|
+
async fetchUserVolumeAccumulatorTotalStats(user) {
|
|
4718
|
+
const userVolumeAccumulator = await this.fetchUserVolumeAccumulator(user);
|
|
4719
|
+
const userVolumeAccumulatorAmm = await this.pumpAmmSdk.fetchUserVolumeAccumulator(user);
|
|
4720
|
+
return {
|
|
4721
|
+
totalUnclaimedTokens: userVolumeAccumulator.totalUnclaimedTokens.add(
|
|
4722
|
+
userVolumeAccumulatorAmm.totalUnclaimedTokens
|
|
4723
|
+
),
|
|
4724
|
+
totalClaimedTokens: userVolumeAccumulator.totalClaimedTokens.add(
|
|
4725
|
+
userVolumeAccumulatorAmm.totalClaimedTokens
|
|
4726
|
+
),
|
|
4727
|
+
currentSolVolume: userVolumeAccumulator.currentSolVolume.add(
|
|
4728
|
+
userVolumeAccumulatorAmm.currentSolVolume
|
|
4729
|
+
)
|
|
4730
|
+
};
|
|
4731
|
+
}
|
|
4717
4732
|
async createInstruction({
|
|
4718
4733
|
mint,
|
|
4719
4734
|
name,
|
package/dist/index.d.mts
CHANGED
|
@@ -8988,6 +8988,11 @@ interface UserVolumeAccumulator {
|
|
|
8988
8988
|
currentSolVolume: BN;
|
|
8989
8989
|
lastUpdateTimestamp: BN;
|
|
8990
8990
|
}
|
|
8991
|
+
interface UserVolumeAccumulatorTotalStats {
|
|
8992
|
+
totalUnclaimedTokens: BN;
|
|
8993
|
+
totalClaimedTokens: BN;
|
|
8994
|
+
currentSolVolume: BN;
|
|
8995
|
+
}
|
|
8991
8996
|
|
|
8992
8997
|
declare function newBondingCurve(global: Global): BondingCurve;
|
|
8993
8998
|
declare function getBuyTokenAmountFromSolAmount(global: Global, bondingCurve: BondingCurve | null, amount: BN): BN;
|
|
@@ -9032,6 +9037,7 @@ declare class PumpSdk {
|
|
|
9032
9037
|
}>;
|
|
9033
9038
|
fetchGlobalVolumeAccumulator(): Promise<GlobalVolumeAccumulator>;
|
|
9034
9039
|
fetchUserVolumeAccumulator(user: PublicKey): Promise<UserVolumeAccumulator>;
|
|
9040
|
+
fetchUserVolumeAccumulatorTotalStats(user: PublicKey): Promise<UserVolumeAccumulatorTotalStats>;
|
|
9035
9041
|
createInstruction({ mint, name, symbol, uri, creator, user, }: {
|
|
9036
9042
|
mint: PublicKey;
|
|
9037
9043
|
name: string;
|
|
@@ -9110,4 +9116,4 @@ declare class PumpSdk {
|
|
|
9110
9116
|
declare function totalUnclaimedTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
|
|
9111
9117
|
declare function currentDayTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
|
|
9112
9118
|
|
|
9113
|
-
export { BONDING_CURVE_NEW_SIZE, type BondingCurve, CANONICAL_POOL_INDEX, type Global, PUMP_AMM_PROGRAM_ID, PUMP_PROGRAM_ID, type Pump, PumpSdk, bondingCurvePda, canonicalPumpPoolPda, creatorVaultPda, currentDayTokens, getBuySolAmountFromTokenAmount, getBuyTokenAmountFromSolAmount, getPumpProgram, getSellSolAmountFromTokenAmount, globalPda, globalVolumeAccumulatorPda, newBondingCurve, pump as pumpIdl, pumpPoolAuthorityPda, totalUnclaimedTokens, userVolumeAccumulatorPda };
|
|
9119
|
+
export { BONDING_CURVE_NEW_SIZE, type BondingCurve, CANONICAL_POOL_INDEX, type Global, type GlobalVolumeAccumulator, PUMP_AMM_PROGRAM_ID, PUMP_PROGRAM_ID, type Pump, PumpSdk, type UserVolumeAccumulator, type UserVolumeAccumulatorTotalStats, bondingCurvePda, canonicalPumpPoolPda, creatorVaultPda, currentDayTokens, getBuySolAmountFromTokenAmount, getBuyTokenAmountFromSolAmount, getPumpProgram, getSellSolAmountFromTokenAmount, globalPda, globalVolumeAccumulatorPda, newBondingCurve, pump as pumpIdl, pumpPoolAuthorityPda, totalUnclaimedTokens, userVolumeAccumulatorPda };
|
package/dist/index.d.ts
CHANGED
|
@@ -8988,6 +8988,11 @@ interface UserVolumeAccumulator {
|
|
|
8988
8988
|
currentSolVolume: BN;
|
|
8989
8989
|
lastUpdateTimestamp: BN;
|
|
8990
8990
|
}
|
|
8991
|
+
interface UserVolumeAccumulatorTotalStats {
|
|
8992
|
+
totalUnclaimedTokens: BN;
|
|
8993
|
+
totalClaimedTokens: BN;
|
|
8994
|
+
currentSolVolume: BN;
|
|
8995
|
+
}
|
|
8991
8996
|
|
|
8992
8997
|
declare function newBondingCurve(global: Global): BondingCurve;
|
|
8993
8998
|
declare function getBuyTokenAmountFromSolAmount(global: Global, bondingCurve: BondingCurve | null, amount: BN): BN;
|
|
@@ -9032,6 +9037,7 @@ declare class PumpSdk {
|
|
|
9032
9037
|
}>;
|
|
9033
9038
|
fetchGlobalVolumeAccumulator(): Promise<GlobalVolumeAccumulator>;
|
|
9034
9039
|
fetchUserVolumeAccumulator(user: PublicKey): Promise<UserVolumeAccumulator>;
|
|
9040
|
+
fetchUserVolumeAccumulatorTotalStats(user: PublicKey): Promise<UserVolumeAccumulatorTotalStats>;
|
|
9035
9041
|
createInstruction({ mint, name, symbol, uri, creator, user, }: {
|
|
9036
9042
|
mint: PublicKey;
|
|
9037
9043
|
name: string;
|
|
@@ -9110,4 +9116,4 @@ declare class PumpSdk {
|
|
|
9110
9116
|
declare function totalUnclaimedTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
|
|
9111
9117
|
declare function currentDayTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
|
|
9112
9118
|
|
|
9113
|
-
export { BONDING_CURVE_NEW_SIZE, type BondingCurve, CANONICAL_POOL_INDEX, type Global, PUMP_AMM_PROGRAM_ID, PUMP_PROGRAM_ID, type Pump, PumpSdk, bondingCurvePda, canonicalPumpPoolPda, creatorVaultPda, currentDayTokens, getBuySolAmountFromTokenAmount, getBuyTokenAmountFromSolAmount, getPumpProgram, getSellSolAmountFromTokenAmount, globalPda, globalVolumeAccumulatorPda, newBondingCurve, pump as pumpIdl, pumpPoolAuthorityPda, totalUnclaimedTokens, userVolumeAccumulatorPda };
|
|
9119
|
+
export { BONDING_CURVE_NEW_SIZE, type BondingCurve, CANONICAL_POOL_INDEX, type Global, type GlobalVolumeAccumulator, PUMP_AMM_PROGRAM_ID, PUMP_PROGRAM_ID, type Pump, PumpSdk, type UserVolumeAccumulator, type UserVolumeAccumulatorTotalStats, bondingCurvePda, canonicalPumpPoolPda, creatorVaultPda, currentDayTokens, getBuySolAmountFromTokenAmount, getBuyTokenAmountFromSolAmount, getPumpProgram, getSellSolAmountFromTokenAmount, globalPda, globalVolumeAccumulatorPda, newBondingCurve, pump as pumpIdl, pumpPoolAuthorityPda, totalUnclaimedTokens, userVolumeAccumulatorPda };
|
package/dist/index.js
CHANGED
|
@@ -4761,6 +4761,21 @@ var PumpSdk = class {
|
|
|
4761
4761
|
userVolumeAccumulatorPda(user)[0]
|
|
4762
4762
|
);
|
|
4763
4763
|
}
|
|
4764
|
+
async fetchUserVolumeAccumulatorTotalStats(user) {
|
|
4765
|
+
const userVolumeAccumulator = await this.fetchUserVolumeAccumulator(user);
|
|
4766
|
+
const userVolumeAccumulatorAmm = await this.pumpAmmSdk.fetchUserVolumeAccumulator(user);
|
|
4767
|
+
return {
|
|
4768
|
+
totalUnclaimedTokens: userVolumeAccumulator.totalUnclaimedTokens.add(
|
|
4769
|
+
userVolumeAccumulatorAmm.totalUnclaimedTokens
|
|
4770
|
+
),
|
|
4771
|
+
totalClaimedTokens: userVolumeAccumulator.totalClaimedTokens.add(
|
|
4772
|
+
userVolumeAccumulatorAmm.totalClaimedTokens
|
|
4773
|
+
),
|
|
4774
|
+
currentSolVolume: userVolumeAccumulator.currentSolVolume.add(
|
|
4775
|
+
userVolumeAccumulatorAmm.currentSolVolume
|
|
4776
|
+
)
|
|
4777
|
+
};
|
|
4778
|
+
}
|
|
4764
4779
|
async createInstruction({
|
|
4765
4780
|
mint,
|
|
4766
4781
|
name,
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -23,5 +23,11 @@ export {
|
|
|
23
23
|
BONDING_CURVE_NEW_SIZE,
|
|
24
24
|
PumpSdk,
|
|
25
25
|
} from "./sdk";
|
|
26
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
Global,
|
|
28
|
+
BondingCurve,
|
|
29
|
+
GlobalVolumeAccumulator,
|
|
30
|
+
UserVolumeAccumulator,
|
|
31
|
+
UserVolumeAccumulatorTotalStats,
|
|
32
|
+
} from "./state";
|
|
27
33
|
export { totalUnclaimedTokens, currentDayTokens } from "./tokenIncentives";
|
package/src/sdk.ts
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
Global,
|
|
33
33
|
GlobalVolumeAccumulator,
|
|
34
34
|
UserVolumeAccumulator,
|
|
35
|
+
UserVolumeAccumulatorTotalStats,
|
|
35
36
|
} from "./state";
|
|
36
37
|
import { currentDayTokens, totalUnclaimedTokens } from "./tokenIncentives";
|
|
37
38
|
|
|
@@ -172,6 +173,26 @@ export class PumpSdk {
|
|
|
172
173
|
);
|
|
173
174
|
}
|
|
174
175
|
|
|
176
|
+
async fetchUserVolumeAccumulatorTotalStats(
|
|
177
|
+
user: PublicKey,
|
|
178
|
+
): Promise<UserVolumeAccumulatorTotalStats> {
|
|
179
|
+
const userVolumeAccumulator = await this.fetchUserVolumeAccumulator(user);
|
|
180
|
+
const userVolumeAccumulatorAmm =
|
|
181
|
+
await this.pumpAmmSdk.fetchUserVolumeAccumulator(user);
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
totalUnclaimedTokens: userVolumeAccumulator.totalUnclaimedTokens.add(
|
|
185
|
+
userVolumeAccumulatorAmm.totalUnclaimedTokens,
|
|
186
|
+
),
|
|
187
|
+
totalClaimedTokens: userVolumeAccumulator.totalClaimedTokens.add(
|
|
188
|
+
userVolumeAccumulatorAmm.totalClaimedTokens,
|
|
189
|
+
),
|
|
190
|
+
currentSolVolume: userVolumeAccumulator.currentSolVolume.add(
|
|
191
|
+
userVolumeAccumulatorAmm.currentSolVolume,
|
|
192
|
+
),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
175
196
|
async createInstruction({
|
|
176
197
|
mint,
|
|
177
198
|
name,
|
package/src/state.ts
CHANGED