pumpdotfun-sdk-repumped
Version:
Pumpfun SDK — create, buy, sell tokens with support for Jito bundles and multiple relayer integrations. Rebuilt and fixed pumpdotfun-sdk.
41 lines (37 loc) • 1.88 kB
JavaScript
;
var web3_js = require('@solana/web3.js');
var pumpFun_consts = require('../pumpFun.consts.cjs');
class PdaModule {
sdk;
constructor(sdk) {
this.sdk = sdk;
}
getCreatorVaultPda(creator) {
return web3_js.PublicKey.findProgramAddressSync([Buffer.from("creator-vault"), creator.toBuffer()], this.sdk.program.programId)[0];
}
getGlobalAccountPda() {
return web3_js.PublicKey.findProgramAddressSync([Buffer.from(pumpFun_consts.GLOBAL_ACCOUNT_SEED)], this.sdk.program.programId)[0];
}
getEventAuthorityPda() {
return web3_js.PublicKey.findProgramAddressSync([Buffer.from(pumpFun_consts.EVENT_AUTHORITY_SEED)], this.sdk.program.programId)[0];
}
getBondingCurvePDA(mint) {
return web3_js.PublicKey.findProgramAddressSync([Buffer.from(pumpFun_consts.BONDING_CURVE_SEED), mint.toBuffer()], this.sdk.program.programId)[0];
}
getMintAuthorityPDA() {
return web3_js.PublicKey.findProgramAddressSync([Buffer.from(pumpFun_consts.MINT_AUTHORITY_SEED)], this.sdk.program.programId)[0];
}
getMetadataPDA(mint) {
const metadataProgram = new web3_js.PublicKey(pumpFun_consts.MPL_TOKEN_METADATA_PROGRAM_ID);
const [metadataPDA] = web3_js.PublicKey.findProgramAddressSync([Buffer.from(pumpFun_consts.METADATA_SEED), metadataProgram.toBuffer(), mint.toBuffer()], metadataProgram);
return metadataPDA;
}
getGlobalVolumeAccumulatorPda() {
return web3_js.PublicKey.findProgramAddressSync([Buffer.from(pumpFun_consts.GLOBAL_VOLUME_SEED)], this.sdk.program.programId)[0];
}
getUserVolumeAccumulatorPda(user) {
return web3_js.PublicKey.findProgramAddressSync([Buffer.from(pumpFun_consts.USER_VOLUME_SEED), user.toBuffer()], this.sdk.program.programId)[0];
}
}
exports.PdaModule = PdaModule;
//# sourceMappingURL=PdaModule.cjs.map