API Reference

CellKit backend endpoints

Backend base URL: https://cellkitbe.vercel.app

Health

GET /health

curl https://cellkitbe.vercel.app
/health

Response

{
  "status": "ok",
  "service": "cellkit-actions-api"
}

Action Registry

GET /api/actions

curl https://cellkitbe.vercel.app
/api/actions

Response

{
  "actions": [
    {
      "id": "ckb.transfer",
      "name": "CKB Transfer",
      "description": "Build an unsigned CKB transfer transaction for testnet wallets and apps.",
      "endpoint": "/api/actions/ckb-transfer/build",
      "limitations": [
        "Requires live cells from a CKB indexer",
        "Unsigned payload only",
        "No broadcasting"
      ],
      "requestSchema": {
        "network": "testnet",
        "fromAddress": "CKB testnet address",
        "toAddress": "CKB testnet address",
        "amountCkb": "decimal string",
        "feeRate": "positive integer string"
      },
      "sampleRequest": {
        "network": "testnet",
        "fromAddress": "ckt1...",
        "toAddress": "ckt1...",
        "amountCkb": "100",
        "feeRate": "1000"
      },
      "sampleResponse": {
        "action": "ckb.transfer",
        "network": "testnet",
        "status": "built",
        "summary": {
          "amountCkb": "100",
          "amountShannons": "10000000000"
        },
        "transaction": {
          "version": "0x0",
          "cellDeps": [],
          "headerDeps": [],
          "inputs": [],
          "outputs": [],
          "outputsData": [],
          "witnesses": []
        },
        "signing": {
          "required": true,
          "signerAddress": "ckt1...",
          "witnessPlaceholders": []
        },
        "warnings": [],
        "nextSteps": [
          "Review transaction payload",
          "Sign with compatible CKB wallet",
          "Broadcast signed transaction"
        ]
      }
    }
  ]
}

CKB Transfer

POST /api/actions/ckb-transfer/build

curl -X POST https://cellkitbe.vercel.app
/api/actions/ckb-transfer/build \
  -H 'content-type: application/json' \
  -d '{
  "network": "testnet",
  "fromAddress": "ckt1...",
  "toAddress": "ckt1...",
  "amountCkb": "100",
  "feeRate": "1000"
}'

Request

{
  "network": "testnet",
  "fromAddress": "ckt1...",
  "toAddress": "ckt1...",
  "amountCkb": "100",
  "feeRate": "1000"
}

Response

{
  "action": "ckb.transfer",
  "network": "testnet",
  "status": "built",
  "summary": {
    "amountCkb": "100",
    "amountShannons": "10000000000"
  },
  "transaction": {
    "version": "0x0",
    "cellDeps": [],
    "headerDeps": [],
    "inputs": [],
    "outputs": [],
    "outputsData": [],
    "witnesses": []
  },
  "signing": {
    "required": true,
    "signerAddress": "ckt1...",
    "witnessPlaceholders": []
  },
  "warnings": [],
  "nextSteps": [
    "Review transaction payload",
    "Sign with compatible CKB wallet",
    "Broadcast signed transaction"
  ]
}

xUDT Transfer

POST /api/actions/xudt-transfer/build

curl -X POST https://cellkitbe.vercel.app
/api/actions/xudt-transfer/build \
  -H 'content-type: application/json' \
  -d '{
  "network": "testnet",
  "fromAddress": "ckt1...",
  "toAddress": "ckt1...",
  "xudtTypeScript": {
    "codeHash": "0x...",
    "hashType": "type",
    "args": "0x..."
  },
  "amount": "1000",
  "feeRate": "1000"
}'

Request

{
  "network": "testnet",
  "fromAddress": "ckt1...",
  "toAddress": "ckt1...",
  "xudtTypeScript": {
    "codeHash": "0x...",
    "hashType": "type",
    "args": "0x..."
  },
  "amount": "1000",
  "feeRate": "1000"
}

Response

{
  "error": "missing_config",
  "message": "xUDT cell dep is not configured for this network."
}

Cell Consolidation

POST /api/actions/cell-consolidation/build

curl -X POST https://cellkitbe.vercel.app
/api/actions/cell-consolidation/build \
  -H 'content-type: application/json' \
  -d '{
  "network": "testnet",
  "ownerAddress": "ckt1...",
  "maxCells": 20,
  "feeRate": "1000"
}'

Request

{
  "network": "testnet",
  "ownerAddress": "ckt1...",
  "maxCells": 20,
  "feeRate": "1000"
}

Response

{
  "action": "cell.consolidate",
  "status": "built",
  "warnings": [
    "No fragmented cells found"
  ]
}

Capacity Lock

POST /api/actions/capacity-lock/build

curl -X POST https://cellkitbe.vercel.app
/api/actions/capacity-lock/build \
  -H 'content-type: application/json' \
  -d '{
  "network": "testnet",
  "fromAddress": "ckt1...",
  "lockAddress": "ckt1...",
  "amountCkb": "100",
  "memo": "Grant milestone reserve",
  "feeRate": "1000"
}'

Request

{
  "network": "testnet",
  "fromAddress": "ckt1...",
  "lockAddress": "ckt1...",
  "amountCkb": "100",
  "memo": "Grant milestone reserve",
  "feeRate": "1000"
}

Response

{
  "action": "capacity.lock",
  "status": "built",
  "summary": {
    "memo": "Grant milestone reserve"
  }
}

Data Cell Create

POST /api/actions/data-cell-create/build

curl -X POST https://cellkitbe.vercel.app
/api/actions/data-cell-create/build \
  -H 'content-type: application/json' \
  -d '{
  "network": "testnet",
  "fromAddress": "ckt1...",
  "data": {
    "encoding": "utf8",
    "content": "Hello CKB"
  },
  "capacityCkb": "100",
  "feeRate": "1000"
}'

Request

{
  "network": "testnet",
  "fromAddress": "ckt1...",
  "data": {
    "encoding": "utf8",
    "content": "Hello CKB"
  },
  "capacityCkb": "100",
  "feeRate": "1000"
}

Response

{
  "action": "data_cell.create",
  "status": "built",
  "summary": {
    "dataHex": "0x48656c6c6f20434b42"
  }
}

Validate Transaction

POST /api/actions/validate

curl -X POST https://cellkitbe.vercel.app
/api/actions/validate -H 'content-type: application/json' -d '{"network":"testnet","transaction":{}}'

Request

{
  "network": "testnet",
  "transaction": {
    "version": "0x0",
    "cellDeps": [],
    "headerDeps": [],
    "inputs": [],
    "outputs": [],
    "outputsData": [],
    "witnesses": []
  }
}

Response

{
  "valid": false,
  "errors": [
    "transaction.inputs must contain at least one input"
  ],
  "warnings": []
}

Estimate Fee

POST /api/actions/estimate-fee

curl -X POST https://cellkitbe.vercel.app
/api/actions/estimate-fee -H 'content-type: application/json' -d '{"network":"testnet","transaction":{},"feeRate":"1000"}'

Request

{
  "network": "testnet",
  "transaction": {
    "version": "0x0",
    "cellDeps": [],
    "headerDeps": [],
    "inputs": [],
    "outputs": [],
    "outputsData": [],
    "witnesses": []
  },
  "feeRate": "1000"
}

Response

{
  "feeRate": "1000",
  "estimatedSizeBytes": 94,
  "estimatedFeeShannons": "94",
  "estimatedFeeCkb": "0.00000094"
}