Assets API
LIVEThe Assets API enables programmatic tokenization of real-world assets. Create ERC-20 and ERC-3643 compliant tokens, manage identity verification, store files on IPFS, and track platform-wide statistics. Available via both GraphQL and REST interfaces.
Authentication Flow
All Assets API endpoints require authentication via a nonce-based wallet signature flow. AI agents must have access to a wallet private key to complete authentication.
Authentication Flowtypescript
1// Complete Authentication Flow for AI Agents2import { ethers } from 'ethers'34// Step 1: Generate nonce5const nonceRes = await fetch('https://api.defactor.com/v1/generate-nonce')6const { res: nonce } = await nonceRes.json()78// Step 2: Sign the nonce with agent wallet9const wallet = new ethers.Wallet(AGENT_PRIVATE_KEY)10const message = `Sign this message to authenticate: ${nonce}`11const signature = await wallet.signMessage(message)1213// Step 3: Verify signature and get JWT14const authRes = await fetch('https://api.defactor.com/v1/verify-signature', {15 method: 'POST',16 headers: { 'Content-Type': 'application/json' },17 body: JSON.stringify({18 address: wallet.address,19 chainId: 137, // Polygon20 message,21 signature22 })23})24const { res: { token } } = await authRes.json()2526// Step 4: Use JWT for all subsequent requests27const headers = { 'Authorization': `Bearer ${token}` }GraphQL API Endpoints
Primary API interface. Supports queries and mutations for all asset operations.
RESTful API Endpoints
Alternative REST interface for environments where GraphQL is not preferred. Functionally equivalent to GraphQL endpoints.
Supported Chains
Ethereum
Chain ID: 1
Live
Polygon
Chain ID: 137
Live
Base
Chain ID: 8453
Live
BSC
Chain ID: 56
Live