@pump-fun/pump-sdk 1.3.5-devnet.1 → 1.3.6-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 +2 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -5
- package/package.json +1 -1
- package/src/sdk.ts +2 -1
package/dist/esm/index.js
CHANGED
|
@@ -2725,7 +2725,7 @@ function canonicalPumpPoolPda(pumpProgramId, pumpAmmProgramId, mint) {
|
|
|
2725
2725
|
}
|
|
2726
2726
|
|
|
2727
2727
|
// src/sdk.ts
|
|
2728
|
-
import { AnchorProvider,
|
|
2728
|
+
import { AnchorProvider, Program } from "@coral-xyz/anchor";
|
|
2729
2729
|
import { PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
|
|
2730
2730
|
import {
|
|
2731
2731
|
createAssociatedTokenAccountIdempotentInstruction,
|
|
@@ -2735,6 +2735,7 @@ import {
|
|
|
2735
2735
|
import {
|
|
2736
2736
|
PublicKey as PublicKey3
|
|
2737
2737
|
} from "@solana/web3.js";
|
|
2738
|
+
import BN2 from "bn.js";
|
|
2738
2739
|
function getPumpProgram(connection, programId) {
|
|
2739
2740
|
const pumpIdlAddressOverride = { ...pump_default };
|
|
2740
2741
|
pumpIdlAddressOverride.address = programId.toString();
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BN from 'bn.js';
|
|
2
2
|
import { PublicKey, PublicKeyInitData, Connection, AccountInfo, TransactionInstruction } from '@solana/web3.js';
|
|
3
|
-
import { Program
|
|
3
|
+
import { Program } from '@coral-xyz/anchor';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -5667,14 +5667,14 @@ declare class PumpSdk {
|
|
|
5667
5667
|
fetchGlobal(): Promise<Global>;
|
|
5668
5668
|
fetchBondingCurve(mint: PublicKeyInitData): Promise<BondingCurve>;
|
|
5669
5669
|
createInstruction(mint: PublicKey, name: string, symbol: string, uri: string, creator: PublicKey, user: PublicKey): Promise<TransactionInstruction>;
|
|
5670
|
-
buyInstructions(global: Global, bondingCurveAccountInfo: AccountInfo<Buffer> | null, bondingCurve: BondingCurve, mint: PublicKey, user: PublicKey, amount: BN
|
|
5671
|
-
sellInstructions(global: Global, bondingCurveAccountInfo: AccountInfo<Buffer> | null, mint: PublicKey, user: PublicKey, amount: BN
|
|
5670
|
+
buyInstructions(global: Global, bondingCurveAccountInfo: AccountInfo<Buffer> | null, bondingCurve: BondingCurve, mint: PublicKey, user: PublicKey, amount: BN, solAmount: BN, slippage: number, newCoinCreator: PublicKey): Promise<TransactionInstruction[]>;
|
|
5671
|
+
sellInstructions(global: Global, bondingCurveAccountInfo: AccountInfo<Buffer> | null, mint: PublicKey, user: PublicKey, amount: BN, solAmount: BN, slippage: number): Promise<TransactionInstruction[]>;
|
|
5672
5672
|
fixExistingBondingCurve(mint: PublicKey, bondingCurveAccountInfo: AccountInfo<Buffer> | null, user: PublicKey): Promise<TransactionInstruction[]>;
|
|
5673
5673
|
private withFixBondingCurve;
|
|
5674
5674
|
extendAccount(account: PublicKey, user: PublicKey): Promise<TransactionInstruction>;
|
|
5675
5675
|
migrateInstruction(mint: PublicKey, user: PublicKey): Promise<TransactionInstruction>;
|
|
5676
5676
|
collectCoinCreatorFeeInstructions(coinCreator: PublicKey): Promise<TransactionInstruction[]>;
|
|
5677
|
-
getCreatorVaultBalance(creator: PublicKey): Promise<BN
|
|
5677
|
+
getCreatorVaultBalance(creator: PublicKey): Promise<BN>;
|
|
5678
5678
|
}
|
|
5679
5679
|
|
|
5680
5680
|
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, getBuySolAmountFromTokenAmount, getBuyTokenAmountFromSolAmount, getPumpProgram, getSellSolAmountFromTokenAmount, globalPda, pump as pumpIdl, pumpPoolAuthorityPda };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BN from 'bn.js';
|
|
2
2
|
import { PublicKey, PublicKeyInitData, Connection, AccountInfo, TransactionInstruction } from '@solana/web3.js';
|
|
3
|
-
import { Program
|
|
3
|
+
import { Program } from '@coral-xyz/anchor';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -5667,14 +5667,14 @@ declare class PumpSdk {
|
|
|
5667
5667
|
fetchGlobal(): Promise<Global>;
|
|
5668
5668
|
fetchBondingCurve(mint: PublicKeyInitData): Promise<BondingCurve>;
|
|
5669
5669
|
createInstruction(mint: PublicKey, name: string, symbol: string, uri: string, creator: PublicKey, user: PublicKey): Promise<TransactionInstruction>;
|
|
5670
|
-
buyInstructions(global: Global, bondingCurveAccountInfo: AccountInfo<Buffer> | null, bondingCurve: BondingCurve, mint: PublicKey, user: PublicKey, amount: BN
|
|
5671
|
-
sellInstructions(global: Global, bondingCurveAccountInfo: AccountInfo<Buffer> | null, mint: PublicKey, user: PublicKey, amount: BN
|
|
5670
|
+
buyInstructions(global: Global, bondingCurveAccountInfo: AccountInfo<Buffer> | null, bondingCurve: BondingCurve, mint: PublicKey, user: PublicKey, amount: BN, solAmount: BN, slippage: number, newCoinCreator: PublicKey): Promise<TransactionInstruction[]>;
|
|
5671
|
+
sellInstructions(global: Global, bondingCurveAccountInfo: AccountInfo<Buffer> | null, mint: PublicKey, user: PublicKey, amount: BN, solAmount: BN, slippage: number): Promise<TransactionInstruction[]>;
|
|
5672
5672
|
fixExistingBondingCurve(mint: PublicKey, bondingCurveAccountInfo: AccountInfo<Buffer> | null, user: PublicKey): Promise<TransactionInstruction[]>;
|
|
5673
5673
|
private withFixBondingCurve;
|
|
5674
5674
|
extendAccount(account: PublicKey, user: PublicKey): Promise<TransactionInstruction>;
|
|
5675
5675
|
migrateInstruction(mint: PublicKey, user: PublicKey): Promise<TransactionInstruction>;
|
|
5676
5676
|
collectCoinCreatorFeeInstructions(coinCreator: PublicKey): Promise<TransactionInstruction[]>;
|
|
5677
|
-
getCreatorVaultBalance(creator: PublicKey): Promise<BN
|
|
5677
|
+
getCreatorVaultBalance(creator: PublicKey): Promise<BN>;
|
|
5678
5678
|
}
|
|
5679
5679
|
|
|
5680
5680
|
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, getBuySolAmountFromTokenAmount, getBuyTokenAmountFromSolAmount, getPumpProgram, getSellSolAmountFromTokenAmount, globalPda, pump as pumpIdl, pumpPoolAuthorityPda };
|
package/dist/index.js
CHANGED
|
@@ -2779,6 +2779,7 @@ var import_anchor = require("@coral-xyz/anchor");
|
|
|
2779
2779
|
var import_pump_swap_sdk2 = require("@pump-fun/pump-swap-sdk");
|
|
2780
2780
|
var import_spl_token2 = require("@solana/spl-token");
|
|
2781
2781
|
var import_web33 = require("@solana/web3.js");
|
|
2782
|
+
var import_bn2 = __toESM(require("bn.js"));
|
|
2782
2783
|
function getPumpProgram(connection, programId) {
|
|
2783
2784
|
const pumpIdlAddressOverride = { ...pump_default };
|
|
2784
2785
|
pumpIdlAddressOverride.address = programId.toString();
|
|
@@ -2874,7 +2875,7 @@ var PumpSdk = class {
|
|
|
2874
2875
|
await this.pumpProgram.methods.buy(
|
|
2875
2876
|
amount,
|
|
2876
2877
|
solAmount.add(
|
|
2877
|
-
solAmount.mul(new
|
|
2878
|
+
solAmount.mul(new import_bn2.default(Math.floor(slippage * 10))).div(new import_bn2.default(1e3))
|
|
2878
2879
|
)
|
|
2879
2880
|
).accountsPartial({
|
|
2880
2881
|
feeRecipient: getFeeRecipient(global),
|
|
@@ -2900,7 +2901,7 @@ var PumpSdk = class {
|
|
|
2900
2901
|
await this.pumpProgram.methods.sell(
|
|
2901
2902
|
amount,
|
|
2902
2903
|
solAmount.sub(
|
|
2903
|
-
solAmount.mul(new
|
|
2904
|
+
solAmount.mul(new import_bn2.default(Math.floor(slippage * 10))).div(new import_bn2.default(1e3))
|
|
2904
2905
|
)
|
|
2905
2906
|
).accountsPartial({
|
|
2906
2907
|
feeRecipient: getFeeRecipient(global),
|
|
@@ -2953,15 +2954,15 @@ var PumpSdk = class {
|
|
|
2953
2954
|
const creatorVault = this.creatorVaultPda(creator);
|
|
2954
2955
|
const accountInfo = await this.connection.getAccountInfo(creatorVault);
|
|
2955
2956
|
if (accountInfo === null) {
|
|
2956
|
-
return new
|
|
2957
|
+
return new import_bn2.default(0);
|
|
2957
2958
|
}
|
|
2958
2959
|
const rentExemptionLamports = await this.connection.getMinimumBalanceForRentExemption(
|
|
2959
2960
|
accountInfo.data.length
|
|
2960
2961
|
);
|
|
2961
2962
|
if (accountInfo.lamports < rentExemptionLamports) {
|
|
2962
|
-
return new
|
|
2963
|
+
return new import_bn2.default(0);
|
|
2963
2964
|
}
|
|
2964
|
-
return new
|
|
2965
|
+
return new import_bn2.default(accountInfo.lamports - rentExemptionLamports);
|
|
2965
2966
|
}
|
|
2966
2967
|
};
|
|
2967
2968
|
function getFeeRecipient(global) {
|
package/package.json
CHANGED
package/src/sdk.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnchorProvider,
|
|
1
|
+
import { AnchorProvider, Program } from "@coral-xyz/anchor";
|
|
2
2
|
import { PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
|
|
3
3
|
import {
|
|
4
4
|
createAssociatedTokenAccountIdempotentInstruction,
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from "@solana/web3.js";
|
|
15
15
|
import pumpIdl from "./idl/pump.json";
|
|
16
16
|
import { Pump } from "./idl/pump";
|
|
17
|
+
import BN from "bn.js";
|
|
17
18
|
|
|
18
19
|
import {
|
|
19
20
|
bondingCurvePda,
|