Skip to main content

Token Layer Action Guide

Use this guide for practical integration with POST /token-layer.

Decision Flow

  1. New wallet with no user_wallets mapping: call action.type=register.
  2. Registered wallet: call action.type=createToken.
  3. If you get IDENTITY_NOT_REGISTERED, run register first, then retry your action.

Register (Web3, Single Step)

Use this action to bootstrap identity for wallets that are not registered yet. Requirements:
  • Authorization: Bearer 0x... (wallet address)
  • signature: EIP-712 signature for register action
  • nonce: timestamp in ms
  • action.message + action.signature
  • action.message must include a 13-digit timestamp in ms
  • message timestamp must match nonce and be inside expiresAfter

Create Token

Use this action after wallet registration. Requirements:
  • Authorization: Bearer 0x... for wallet-signed mode
  • signature: EIP-712 signature for createToken payload
  • nonce: timestamp in ms

Common Errors

  • IDENTITY_NOT_REGISTERED: wallet signature is valid but wallet has no user mapping.
  • REPLAY_DETECTED: same (wallet, nonce, actionHash) was already used.
  • ACTION_EXPIRED: nonce + expiresAfter is invalid.
  • INVALID_ACTION_SIGNATURE: EIP-712 signature does not match payload.

API Reference

For full schema and interactive testing, see: