@pump-fun/pump-sdk 1.17.4 → 1.17.5
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 +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/src/bondingCurve.ts +2 -2
- package/src/index.ts +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -4538,7 +4538,7 @@ function getBuyTokenAmountFromSolAmountQuote({
|
|
|
4538
4538
|
}) {
|
|
4539
4539
|
return inputAmount.mul(virtualTokenReserves).div(virtualSolReserves.add(inputAmount));
|
|
4540
4540
|
}
|
|
4541
|
-
function
|
|
4541
|
+
function getSellSolAmountFromTokenAmountQuote({
|
|
4542
4542
|
inputAmount,
|
|
4543
4543
|
virtualTokenReserves,
|
|
4544
4544
|
virtualSolReserves
|
|
@@ -4595,7 +4595,7 @@ function getSellSolAmountFromTokenAmount(global, bondingCurve, amount) {
|
|
|
4595
4595
|
if (bondingCurve.virtualTokenReserves.eq(new BN(0))) {
|
|
4596
4596
|
return new BN(0);
|
|
4597
4597
|
}
|
|
4598
|
-
const solCost =
|
|
4598
|
+
const solCost = getSellSolAmountFromTokenAmountQuote({
|
|
4599
4599
|
inputAmount: amount,
|
|
4600
4600
|
virtualTokenReserves: bondingCurve.virtualTokenReserves,
|
|
4601
4601
|
virtualSolReserves: bondingCurve.virtualSolReserves
|
|
@@ -5342,7 +5342,7 @@ export {
|
|
|
5342
5342
|
getBuyTokenAmountFromSolAmountQuote,
|
|
5343
5343
|
getPumpProgram,
|
|
5344
5344
|
getSellSolAmountFromTokenAmount,
|
|
5345
|
-
|
|
5345
|
+
getSellSolAmountFromTokenAmountQuote,
|
|
5346
5346
|
globalPda,
|
|
5347
5347
|
globalVolumeAccumulatorPda,
|
|
5348
5348
|
newBondingCurve,
|
package/dist/index.d.mts
CHANGED
|
@@ -9085,7 +9085,7 @@ declare function getBuyTokenAmountFromSolAmountQuote({ inputAmount, virtualToken
|
|
|
9085
9085
|
virtualTokenReserves: BN;
|
|
9086
9086
|
virtualSolReserves: BN;
|
|
9087
9087
|
}): BN;
|
|
9088
|
-
declare function
|
|
9088
|
+
declare function getSellSolAmountFromTokenAmountQuote({ inputAmount, virtualTokenReserves, virtualSolReserves, }: {
|
|
9089
9089
|
inputAmount: BN;
|
|
9090
9090
|
virtualTokenReserves: BN;
|
|
9091
9091
|
virtualSolReserves: BN;
|
|
@@ -9230,4 +9230,4 @@ declare class PumpSdk {
|
|
|
9230
9230
|
declare function totalUnclaimedTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
|
|
9231
9231
|
declare function currentDayTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
|
|
9232
9232
|
|
|
9233
|
-
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, getBuySolAmountFromTokenAmountQuote, getBuyTokenAmountFromSolAmount, getBuyTokenAmountFromSolAmountQuote, getPumpProgram, getSellSolAmountFromTokenAmount,
|
|
9233
|
+
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, getBuySolAmountFromTokenAmountQuote, getBuyTokenAmountFromSolAmount, getBuyTokenAmountFromSolAmountQuote, getPumpProgram, getSellSolAmountFromTokenAmount, getSellSolAmountFromTokenAmountQuote, globalPda, globalVolumeAccumulatorPda, newBondingCurve, pump as pumpIdl, pumpPoolAuthorityPda, totalUnclaimedTokens, userVolumeAccumulatorPda };
|
package/dist/index.d.ts
CHANGED
|
@@ -9085,7 +9085,7 @@ declare function getBuyTokenAmountFromSolAmountQuote({ inputAmount, virtualToken
|
|
|
9085
9085
|
virtualTokenReserves: BN;
|
|
9086
9086
|
virtualSolReserves: BN;
|
|
9087
9087
|
}): BN;
|
|
9088
|
-
declare function
|
|
9088
|
+
declare function getSellSolAmountFromTokenAmountQuote({ inputAmount, virtualTokenReserves, virtualSolReserves, }: {
|
|
9089
9089
|
inputAmount: BN;
|
|
9090
9090
|
virtualTokenReserves: BN;
|
|
9091
9091
|
virtualSolReserves: BN;
|
|
@@ -9230,4 +9230,4 @@ declare class PumpSdk {
|
|
|
9230
9230
|
declare function totalUnclaimedTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
|
|
9231
9231
|
declare function currentDayTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
|
|
9232
9232
|
|
|
9233
|
-
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, getBuySolAmountFromTokenAmountQuote, getBuyTokenAmountFromSolAmount, getBuyTokenAmountFromSolAmountQuote, getPumpProgram, getSellSolAmountFromTokenAmount,
|
|
9233
|
+
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, getBuySolAmountFromTokenAmountQuote, getBuyTokenAmountFromSolAmount, getBuyTokenAmountFromSolAmountQuote, getPumpProgram, getSellSolAmountFromTokenAmount, getSellSolAmountFromTokenAmountQuote, globalPda, globalVolumeAccumulatorPda, newBondingCurve, pump as pumpIdl, pumpPoolAuthorityPda, totalUnclaimedTokens, userVolumeAccumulatorPda };
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,7 @@ __export(index_exports, {
|
|
|
45
45
|
getBuyTokenAmountFromSolAmountQuote: () => getBuyTokenAmountFromSolAmountQuote,
|
|
46
46
|
getPumpProgram: () => getPumpProgram,
|
|
47
47
|
getSellSolAmountFromTokenAmount: () => getSellSolAmountFromTokenAmount,
|
|
48
|
-
|
|
48
|
+
getSellSolAmountFromTokenAmountQuote: () => getSellSolAmountFromTokenAmountQuote,
|
|
49
49
|
globalPda: () => globalPda,
|
|
50
50
|
globalVolumeAccumulatorPda: () => globalVolumeAccumulatorPda,
|
|
51
51
|
newBondingCurve: () => newBondingCurve,
|
|
@@ -4596,7 +4596,7 @@ function getBuyTokenAmountFromSolAmountQuote({
|
|
|
4596
4596
|
}) {
|
|
4597
4597
|
return inputAmount.mul(virtualTokenReserves).div(virtualSolReserves.add(inputAmount));
|
|
4598
4598
|
}
|
|
4599
|
-
function
|
|
4599
|
+
function getSellSolAmountFromTokenAmountQuote({
|
|
4600
4600
|
inputAmount,
|
|
4601
4601
|
virtualTokenReserves,
|
|
4602
4602
|
virtualSolReserves
|
|
@@ -4653,7 +4653,7 @@ function getSellSolAmountFromTokenAmount(global, bondingCurve, amount) {
|
|
|
4653
4653
|
if (bondingCurve.virtualTokenReserves.eq(new import_bn.default(0))) {
|
|
4654
4654
|
return new import_bn.default(0);
|
|
4655
4655
|
}
|
|
4656
|
-
const solCost =
|
|
4656
|
+
const solCost = getSellSolAmountFromTokenAmountQuote({
|
|
4657
4657
|
inputAmount: amount,
|
|
4658
4658
|
virtualTokenReserves: bondingCurve.virtualTokenReserves,
|
|
4659
4659
|
virtualSolReserves: bondingCurve.virtualSolReserves
|
package/package.json
CHANGED
package/src/bondingCurve.ts
CHANGED
|
@@ -64,7 +64,7 @@ export function getBuyTokenAmountFromSolAmountQuote({
|
|
|
64
64
|
.div(virtualSolReserves.add(inputAmount));
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
export function
|
|
67
|
+
export function getSellSolAmountFromTokenAmountQuote({
|
|
68
68
|
inputAmount,
|
|
69
69
|
virtualTokenReserves,
|
|
70
70
|
virtualSolReserves,
|
|
@@ -162,7 +162,7 @@ export function getSellSolAmountFromTokenAmount(
|
|
|
162
162
|
return new BN(0);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
const solCost =
|
|
165
|
+
const solCost = getSellSolAmountFromTokenAmountQuote({
|
|
166
166
|
inputAmount: amount,
|
|
167
167
|
virtualTokenReserves: bondingCurve.virtualTokenReserves,
|
|
168
168
|
virtualSolReserves: bondingCurve.virtualSolReserves,
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export {
|
|
|
4
4
|
getBuyTokenAmountFromSolAmount,
|
|
5
5
|
getBuySolAmountFromTokenAmountQuote,
|
|
6
6
|
getBuyTokenAmountFromSolAmountQuote,
|
|
7
|
-
|
|
7
|
+
getSellSolAmountFromTokenAmountQuote,
|
|
8
8
|
getBuySolAmountFromTokenAmount,
|
|
9
9
|
getSellSolAmountFromTokenAmount,
|
|
10
10
|
newBondingCurve,
|