Create Token

Create tokens with configurable parameters like name, symbol, liquidity, and distribution functionality.


POSTapi.metal.build/merchant/create-token

Create a token

This endpoint allows you to create a new token with optional liquidity and distribution capabilities.


Required attributes

  • Name
    name
    Type
    string
    Description

    The name for your token (e.g., "Test Token").

  • Name
    symbol
    Type
    string
    Description

    The ticker symbol for your token (e.g., "TEST").

Optional attributes

  • Name
    canDistribute
    Type
    boolean
    Description

    Enable distribution functionality for this token. This is equivalent to toggling on the Reward Allocation in the Metal web app.

  • Name
    canLP
    Type
    boolean
    Description

    Enable liquidity pool creation for this token.

  • Name
    merchantAddress
    Type
    string
    Description

    The address to receive the merchant token allocation. If a merchant address is provided, the merchant allocation will be fixed at 5% of the total supply.

  • Name
    startingValuation
    Type
    string
    Description

    The initial valuation of the token. Set to 10k by default.

    Available options are 10k or 100k.

Request

POST
api.metal.build/merchant/create-token
const response = await fetch('https://api.metal.build/merchant/create-token', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_SECRET_API_KEY',
  },
  body: JSON.stringify({
    name: 'Test Token',
    symbol: 'TEST',
    merchantAddress: '0x1234567890abcdef1234567890abcdef12345678',
    canDistribute: true,
    canLP: true,
    startingValuation: '100k'
  }),
})

const token = await response.json()

Response

{ jobId: "48384e4e-0da0-5932-8fd7-b95e84b45530" }

GETapi.metal.build/jobs/:jobId

Status

This endpoint will return the status of your token creation.


Required attributes

  • Name
    jobId
    Type
    string
    Description

    Job ID of the token creation.

Request

GET
api.metal.build/jobs/:jobId
const statusUrl = `https://api.metal.build/jobs/${jobId}`;

const response = await fetch(statusUrl, {
  headers: { 'x-api-key': 'YOUR_SECRET_API_KEY' },
});

const statusResponse = await response.json();

return statusResponse;

Pending Response

{
  jobId: "e20b21ec-10ca-5756-938c-855e78add351",
  status: "pending",
  data: {}
}

Successful Response

{
"success": true,
"status": "success",
"jobId": "96e514ec-8a40-5368-91e1-5cadf280181f",
"data": {
    "txHash": "0xb5b7312aef4a1b441ea93affe6031c438117f453cd7500a12019058524bf8cd9",
    "address": "0x1d801eedd2a53a21192d5f40ae39e4653143bf58"
  }
}

Was this page helpful?