COOK N/A
Last Block- HealthChecking Treasury0 COOK Head-
BT--:--
PoSOFF PoW0 H/s Nodes0/0
Gas- COOK
Cookchain Explorer

Cookchain RPC / Node API

Token Deploy Documentation

This page describes how third-party providers can build token templates, deploy Cookchain tokens through a node or RPC endpoint, and expose their own hosted token deployment service without embedding operator keys in a browser.

Explorer v2026.06.30.25 RPC base: http://127.0.0.1:9000

Concept

Cookchain tokens are deployed by sending structured JSON to the RPC/node. The RPC creates a token record with a contract address, metadata, supply limits, mint rules and ownership flags. Minting is a separate command so templates can deploy a token first and mint initial balances only after validation, payment or approval.

The model is intentionally close to an Ethereum/Solidity workflow: a template defines the token parameters, a deploy call creates the contract record, and later calls interact with that contract. The current native runtime is API-driven rather than Solidity bytecode-driven.

Base URLs

Token Deploy RPChttps://rpc.ldbl.net
Fullnode / Validatorhttps://rpc.mainnet.cookscan.net
Local nodehttp://127.0.0.1:9000
This explorer proxy/api/* forwards to the configured node

Token deploy tools should call https://rpc.ldbl.net or their own backend first. That backend validates input, signs or authorizes the operation, then calls the RPC. The fullnode remains the validator/source node for chain data.

Core Endpoints

MethodPathUse
GET/api/tokens?offset=0&limit=20List deployed tokens.
GET/api/token/info/:contractLoad one token contract.
GET/api/token/holders/:contractList holders and balances.
POST/api/token/createCreate/deploy a token record.
POST/api/token/mintMint raw units to an address.
POST/api/token/renounceRenounce token ownership.
GET/api/stream/tokensServer-sent token updates.
POST/x/token/deployLegacy explorer compatibility proxy where enabled.

Create Token

The token create payload is the equivalent of a deploy constructor. Keep the values deterministic so the same template always produces the same expected token configuration.

curl -X POST "http://127.0.0.1:9000/api/token/create" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_OPERATOR_TOKEN" \
  -d '{
    "contract": "Co0000000000000000000000000000000000000000",
    "name": "Example Token",
    "symbol": "EXT",
    "decimals": 18,
    "max_supply": 1000000000000000000000000000,
    "mintable": true,
    "merged": false,
    "description": "Token deployed by an external provider template.",
    "logo": "https://example.com/ext.png",
    "kind": "Value",
    "upgradeable": false
  }'
FieldTypeExpected value
contractstringCookchain contract/address with the configured wallet prefix.
namestringHuman readable token name.
symbolstringShort ticker, usually uppercase.
decimalsnumberDisplay precision. Common values are 6, 8 or 18.
max_supplyinteger/nullMaximum raw supply. Use null for uncapped minting.
mintablebooleanWhether owner-controlled minting is allowed.
mergedbooleanWhether merged mining metadata is enabled for this token.
descriptionstringPublic description shown by explorers and deploy tools.
logostringLogo URL or node-local path.
kindstringValue, Game or Stable.
upgradeablebooleanTemplate flag for future upgrade handling.

Mint Token

Supply and balances are stored in raw units. Convert human units with: raw = amount * 10^decimals. A token with 18 decimals and 1,000 display units mints 1000000000000000000000 raw units.

curl -X POST "http://127.0.0.1:9000/api/token/mint" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_OPERATOR_TOKEN" \
  -d '{
    "contract": "Co0000000000000000000000000000000000000000",
    "caller": "Co1111111111111111111111111111111111111111",
    "to": "Co2222222222222222222222222222222222222222",
    "amount_raw": "1000000000000000000000"
  }'

The node rejects minting when the token is renounced, not mintable, above max supply, or when caller is not the token owner.

JavaScript Template

const template = {
  name: "Example Token",
  symbol: "EXT",
  decimals: 18,
  maxSupply: "1000000000",
  mintable: true,
  kind: "Value"
};

function toRaw(amount, decimals) {
  const [whole, fraction = ""] = String(amount).split(".");
  return BigInt(whole + fraction.padEnd(decimals, "0")).toString();
}

async function deployToken(baseUrl, token, operatorToken) {
  const body = {
    contract: token.contract,
    name: token.name,
    symbol: token.symbol,
    decimals: token.decimals,
    max_supply: token.maxSupply ? toRaw(token.maxSupply, token.decimals) : null,
    mintable: token.mintable,
    merged: false,
    description: token.description || "",
    logo: token.logo || "",
    kind: token.kind || "Value",
    upgradeable: false
  };

  const res = await fetch(`${baseUrl}/api/token/create`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": `Bearer ${operatorToken}`
    },
    body: JSON.stringify(body)
  });
  return res.json();
}

Provider Workflow

  1. Collect name, symbol, decimals, supply, owner, logo and token kind.
  2. Validate symbol length, reserved names, owner address and supply limits.
  3. Convert every amount to raw units before calling RPC.
  4. Call /api/token/create from your backend.
  5. Mint initial supply with /api/token/mint if the template requires it.
  6. Poll /api/token/info/:contract and link the contract in the explorer.
  7. Subscribe to /api/stream/tokens for realtime deploy status.

Security Checklist