Function launch_token_pumpfun

Source
pub async fn launch_token_pumpfun(
    agent: &SolanaAgentKit,
    token_name: &str,
    token_symbol: &str,
    description: &str,
    image_url: &str,
    options: Option<PumpFunTokenOptions>,
) -> Result<PumpfunTokenResponse, Box<dyn Error>>
Expand description

Launch a token on Pump.fun.

§Arguments

  • agent - An instance of SolanaAgentKit.
  • tokenName - The name of the token.
  • tokenTicker - The ticker of the token.
  • description - The description of the token.
  • imageUrl - The URL of the token image.
  • options - Optional token options which include twitter, telegram, website, initialLiquiditySOL, slippageBps, and priorityFee.

§Returns

If successful, it returns the signature of the transaction, the mint address, and the metadata URI. Otherwise, it returns an error.

To get a transaction for signing and sending with a custom RPC, send a POST request to: https://pumpportal.fun/local-trading-api/trading-api/

The request body must include the following options:

  • publicKey - Your wallet’s public key.
  • action - Either “buy” or “sell”, indicating the trading action you want to perform.
  • mint - The contract address of the token you wish to trade. This is the text that appears after the ‘/’ in the pump.fun url for the specific token.
  • amount - The quantity of SOL or tokens to be traded. When selling, the amount can be specified as a percentage of the tokens in your wallet (e.g., amount: “100%”).
  • denominatedInSol - Set to “true” if the amount is specified in SOL, and “false” if it’s specified in tokens.
  • slippage - The percentage of slippage that is allowed during the trading process.
  • priorityFee - The amount to be used as the priority fee.
  • pool - (Optional) Currently, ‘pump’ and ‘raydium’ are the supported options. The default value is ‘pump’.

https://pumpportal.fun/creation