like-pump
v1.5.1
Published
Dual Pumpfun and Pumpswap for simpler buy and sell
Readme
like-pump
Dual Pumpfun and Pumpswap for simpler buy and sell
npm i like-pumpIt automatically handles migrated tokens.
Usage
const Pump = require('like-pump')
const pump = new Pump({ key: '<... base58 private key>' })
const mint = '2fWkVf417bfxEgUemymkYNagXVitnmNxvq7dhUwnpump'
const sigBuy = await pump.buy(mint, 0.00001)
console.log(sigBuy)
const sigSell = await pump.sell(mint, Infinity)
console.log(sigBuy)API
pump = new Pump(options)
Creates a dual Pumpfun and Pumpswap instance.
Options:
{
rpc: new SOL.RPC(),
keyPair: new SOL.Keypair(key),
key, // Can be a base58 string, otherwise a buffer
recentBlockhash: null // E.g. new SOL.recentBlockhash()
}The keyPair option takes priority over the key option.
Better to simply use the key option by passing the private key.
reserves = await pump.getReserves(mint)
Returns:
{
curve, // Can be null or have the bonding curve
pool // Can be null or have the pool reserves
}mcap = await pump.marketCap(mint)
Calculates the market cap.
availableFees = await pump.availableFees([creator])
Gets the pending creator fees from the vaults.
The creator by default is pump.keyPair.publicKey.
signature = await pump.collect()
Collects the vault fees that are pending.
collectedFees = await pump.collectedFees([creator])
Get the already claimed creator fees.
The creator by default is pump.keyPair.publicKey.
totalFees = await pump.totalFees([creator])
Get the total creator fees.
The creator by default is pump.keyPair.publicKey.
sig = await pump.buy(mint, quoteIn[, options])
Buy a pump token.
Options:
{
reserves: null, // Useful for batch concurrent buys, e.g. pump.getReserves(mint)
slippage: 0.05, // 5% slippage
transact: true, // Set to false to return instructions instead of sending the tx
}sig = await pump.sell(mint, baseIn[, options])
Sell a pump token.
The baseIn amount can be Infinity to sell all tokens.
Options:
{
reserves: null, // Useful for batch concurrent buys, e.g. pump.getReserves(mint)
slippage: 0.05, // 5% slippage
transact: true, // Set to false to return instructions instead of sending the tx
}The transact option can also be an object e.g. { unitPrice: 0.001 }.
signature = await pump.transact(tx[, options])
Sign and send a transaction.
Options:
{
recentBlockhash: null, // Optional but recommended to optimize by avoiding a request
signers: [pump.keyPair], // The `signers` option takes priority over the below `keyPair` option
keyPair: pump.keyPair,
unitPrice: 0.0, // E.g. 0.0001 for buys and 0.001 for sells
payer: null, // Payer of tx fees (First signer by default)
confirmed: false,
finalized: false
}user = await pump.user(address)
Get the user profile.
Returns:
{
address: '...',
likes_received: 1,
unread_notifs_count: 3,
mentions_received: 1,
username: null, // E.g. string with the username
profile_image: null,
last_username_update_timestamp: 0,
following: 0,
followers: 6,
bio: null,
x_username: null,
x_id: null
}License
MIT
