Skip to main content
POST
/
create-token-transaction
Create new token transaction
curl --request POST \
  --url https://api.tokenlayer.network/functions/v1/create-token-transaction \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My Cool Token",
  "symbol": "MCT",
  "description": "A revolutionary new token",
  "image": "https://example.com/logo.png or data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
  "chainSlug": "base-sepolia",
  "banner": "https://example.com/banner.png or data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
  "video": "https://example.com/promo.mp4 or data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC",
  "links": {
    "website": "https://example.com",
    "twitter": "https://twitter.com/example",
    "youtube": "https://youtube.com/@example",
    "discord": "https://discord.gg/example",
    "telegram": "https://t.me/example"
  },
  "destinationChains": [
    "base-sepolia",
    "bnb-testnet",
    "solana-devnet"
  ],
  "poolType": "meme",
  "userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "builder": {
    "code": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "fee": 50
  },
  "token_referral": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "tags": [
    "defi",
    "meme"
  ],
  "type": "coin",
  "amountIn": 10,
  "tokensOut": 1000,
  "maxAmountIn": 15.5
}
'
{
  "success": true,
  "executed": true,
  "transactionHash": "<string>",
  "chainId": 84532,
  "transaction": {
    "to": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>"
  },
  "transactions": [
    {
      "to": "<string>",
      "data": "<string>",
      "value": "<string>",
      "gasLimit": "<string>",
      "description": "<string>",
      "chainId": 123,
      "chainType": "<string>",
      "chainSlug": "<string>",
      "transactionDelay": 123
    }
  ],
  "metadata": {
    "tokenUri": "<string>",
    "tokenId": "<string>",
    "name": "<string>",
    "symbol": "<string>",
    "slug": "<string>",
    "description": "<string>",
    "hubUrl": "https://app.tokenlayer.network/token/my-cool-token",
    "addresses": {
      "evm": "<string>",
      "solana": "<string>"
    },
    "token_layer_id": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }
}

Authorizations

Authorization
string
header
required

JWT token or API key

Body

application/json
name
string
required

Token name

Minimum string length: 1
Example:

"My Cool Token"

symbol
string
required

Token symbol (ticker)

Required string length: 1 - 10
Example:

"MCT"

description
string
required

Token description

Minimum string length: 1
Example:

"A revolutionary new token"

image
string
required

Token logo image - can be either a URL or base64-encoded image data (data:image/...)

Minimum string length: 1
Example:

"https://example.com/logo.png or data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="

chainSlug
enum<string>
required

Blockchain identifier. Supported chains: solana, solana-devnet, arbitrum, base, base-sepolia, avalanche, op-bnb, bnb, bnb-testnet, ethereum, monad, unichain, unichain-testnet, abstract, polygon, zksync, zksync-testnet

Available options:
solana,
solana-devnet,
arbitrum,
base,
base-sepolia,
avalanche,
op-bnb,
bnb,
bnb-testnet,
ethereum,
monad,
unichain,
unichain-testnet,
abstract,
polygon,
zksync,
zksync-testnet
Example:

"base-sepolia"

banner
string

Banner image - can be either a URL or base64-encoded image data (data:image/...)

Minimum string length: 1
Example:

"https://example.com/banner.png or data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="

video
string

Promotional video - can be either a URL or base64-encoded video data (data:video/...)

Minimum string length: 1
Example:

"https://example.com/promo.mp4 or data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC"

Optional social media and website links

destinationChains
enum<string>[]

Optional array of destination chain slugs for cross-chain token deployment and migration endpoints. Defaults to [base-sepolia, bnb-testnet, solana-devnet]. The initial chain will be automatically excluded from migration endpoints.

Blockchain identifier. Supported chains: solana, solana-devnet, arbitrum, base, base-sepolia, avalanche, op-bnb, bnb, bnb-testnet, ethereum, monad, unichain, unichain-testnet, abstract, polygon, zksync, zksync-testnet

Available options:
solana,
solana-devnet,
arbitrum,
base,
base-sepolia,
avalanche,
op-bnb,
bnb,
bnb-testnet,
ethereum,
monad,
unichain,
unichain-testnet,
abstract,
polygon,
zksync,
zksync-testnet
Example:
[
"base-sepolia",
"bnb-testnet",
"solana-devnet"
]
poolType
enum<string>

Type of token pool. Defaults to "meme". Maps to: meme=7, startup-preseed=8

Available options:
meme,
startup-preseed,
test
Example:

"meme"

userAddress
string

User wallet address (optional - if not provided, will use user's Privy wallet from user_wallets table)

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"

builder
object

Builder attribution information (optional). Includes address and fee in bps.

token_referral
string

Token referral address for attribution (optional - defaults to zero address). Used to attribute referral fees to a specific address.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"

tags
string[]

Optional hashtags/tags for the token

Example:
["defi", "meme"]
type
enum<string>
default:coin

Transaction type (currently only "coin" is supported - placeholder for future integration)

Available options:
coin
Example:

"coin"

amountIn
number

Optional USD amount to spend on initial token purchase (in USD). Use 0 or omit to skip initial purchase.

Required range: x >= 0
Example:

10

tokensOut
number

Optional number of tokens to purchase initially. Use 0 or omit to skip initial purchase. If both amountIn and tokensOut are provided, tokensOut takes priority.

Required range: x >= 0
Example:

1000

maxAmountIn
number

Maximum USD amount willing to spend when tokensOut is specified. This value comes from the Quoter contract quote and includes slippage protection. Required when tokensOut is provided.

Required range: x >= 0
Example:

15.5

Response

Successful response

success
enum<boolean>
required
Available options:
true
executed
boolean
transactionHash
string
chainId
integer

Numeric chain ID for the transaction

Example:

84532

transaction
object

Deprecated: Use transactions array instead. Single transaction object for backwards compatibility.

transactions
object[]

Array of transactions to execute. May include USDC approval transaction if initial purchase is requested.

metadata
object