• Custodial API
  • Create Token

Create Token

To get a transaction for signing and sending, you need to make a POST request to the REST API entry point

https://pumpzone.fun/api/v2/trade


Include a JSON payload in the body of your request:

  • api_key — Your API key
  • action — «create»
  • amount_sol — The amount of SOL to buy a token. It's mutually exclusive with the amount_tokens field
  • amount_tokens — The amount of tokens to buy. It's mutually exclusive with the amount_sol field
  • slippage — The percent slippage allowed in percent (by default 25%)
  • priority_fee — Amount used to enhance transaction speed
  • token_meta — Token metadata:
    • name — Token name
    • symbol — Token symbol
    • description — Token description
    • twitter — Twitter(X) link
    • telegram — Telegram link
    • website — Website link
    • show_name — «true» or «false»
    • image_type — «image/png» or «image/jpeg»
    • image_data — Token image (base64 encoded)

Examples

import requests
import json

from solders.keypair import Keypair
from solders.transaction import VersionedTransaction
from solders.message import from_bytes_versioned
from solders.commitment_config import CommitmentLevel
from solders.rpc.requests import SendVersionedTransaction
from solders.rpc.config import RpcSendTransactionConfig

image_data = None
with open('image.png', 'rb') as fd:
    image_data = b64encode(fd.read()).decode('utf-8')

res = requests.post('https://pumpzone.fun/api/v2/trade',
    headers = {"Content-Type": "application/json"},
    json = {
        'api_key'        : 'Your API key here',
        'action'         : 'create',
        'token_meta'     : {
            'name'        : 'SmileToke',
            'symbol'      : '😜',
            'description' : 'This is an example token created',
            'twitter'     : 'https://x.com/smiletoken',
            'telegram'    : 'https://t.me/smiletoken',
            'website'     : 'https://simpletoken.com',
            'show_name'   : 'true',
            'image_type'  : 'image/png',                 # image/png, image/jpeg
            'image_data'  : image_data                   # base64 image
        },
        'amount_sol'    : 0.5,                          # The amount of SOL (as Dev)
        # 'amount_tokens' : 10**6,                      # or the amount of tokens to buy
        'slippage'      : 25,                           # The percent slippage allowed (1 .. 100)
        'priority_fee'  : 0.0005                        # Amount to use as priority fee
})

if res.status_code != 200:
    print(res.text)
    exit()

response = res.json()
print('mint: ', response['result']['mint'])
print('signature: ', response['result']['signature'])
print('signature url:', response['result']['signature_url'])
import { VersionedTransaction, Connection, Keypair, MessageV0 } from '@solana/web3.js';
import fs from 'fs'
import bs58 from 'bs58';
import axios from 'axios';

const RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; // Your RPC entrypoint
const rpc_client = new Connection(
    RPC_ENDPOINT,
    'confirmed',
);

async function custodial_create_token() {
   const image_blob = await fs.openAsBlob('image.png');
   const image_data = Buffer.from(await image_blob.arrayBuffer()).toString('base64');

   const res = await axios.post('https://pumpzone.fun/api/v2/trade',
       JSON.stringify({
           api_key       : 'Your API key here',
           action        : 'create',
           token_meta    :
           {
               name        : 'SmileToke',
               symbol      : '😜',
               description : 'This is an example token created',
               twitter     : 'https://x.com/smiletoken',
               telegram    : 'https://t.me/smiletoken',
               website     : 'https://simpletoken.com',
               show_name   : 'true',
               image_type  : 'image/png',                                    // image/png, image/jpeg
               image_data  : image_data                                      // base64 image
           },
           amount_sol    : 0.5,                                              // The amount of SOL
           // amount_tokens' : 10**6,                                        // or the amount of tokens to buy
           slippage      : 25,                                               // The percent slippage allowed (1 .. 100)
           priority_fee  : 0.0005                                            // Amount to use as priority fee
       }),
       {headers: { 'Content-Type': 'application/json' }}
   );

   if(res.status != 200) {
       console.log(res.data);
       return;
   }

   console.log('mint: ', res.data.result.mint);
   console.log('signature: ', res.data.result.signature);
   console.log('signature url: ', res.data.result.signature_url);
}
# status_code == 200
{
  "version" : "v2",
  "result"  : {
    "mint" : "AUzhSbffqakA16FmYYgdVnDLMdM1n8cnS8yxsk1Gpump",
    "signature" : "3nYzkvjpGrmLfGYx4r8rWS3AJcWXZV5Xh3gjbeTbKxyFHpSrHFk5guQwLXUSmBh8jUMnFNoETPVr64SRk6dEZBxR",
    "signurure_url" : "https://solscan.io/tx/3nYzkvjpGrmLfGYx4r8rWS3AJcWXZV5Xh3gjbeTbKxyFHpSrHFk5guQwLXUSmBh8jUMnFNoETPVr64SRk6dEZBxR"
  }
}

# status_code != 200
{
  "version" : "v2",
  "errors"  : [ "Internal error, service is unavailable at now moment" ]
}