Sell a token
The PumpFunAPI class provides quickSellToken function to buy a token on pump.fun instantly without any timeouts.
quickSellToken(seller, tokenAddresses, buyAmount)
Parameters
seller (string): seller's private key.
mint (string): token addresses.
sellAmount (number): Amount to sell.
How to sell a token on pump.fun using api?
the below example will show how to sell a token using pumpfunapi.xyz
const PumpFunAPI = require('pumpfunapi.xyz');
const client = new PumpFunAPI('https://api.mainnet-beta.solana.com', 'your-private-key');
//private key mentioned in client is only used to pay fees of the api
//keep this wallet loaded with sol. fee of 0.002 SOL will be deducted after successfull execution
client.quickBuyToken(
'seller-private-key',
'token-address',
"50" //token amount
);