Token Model
The token model is the main data structure that represents token information. This page explains all fields and structure of the token model in detail.
TokenResponse
The token response model is the main token data structure used in API responses.
Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the token (UUID) |
node_id | string | ID of the node the token is associated with |
node | NodeResponse | Node information (optional, included in detailed responses) |
distributor_id | string | ID of the distributor the token is associated with |
currency_token_id | string | ID of the currency token used for payment |
currency_token | CurrencyToken | Currency token information (optional) |
chain_id | int | Blockchain network ID (e.g., 1 = Ethereum Mainnet, 56 = BSC) |
name | string | Token name |
description | string | Description about the token |
symbol | string | Token symbol (e.g., BTC, ETH, USDT) |
value | float64 | Token value |
supply | int | Total token supply |
external_id | string | Token ID in external system |
contract | TokenContract | Token contract information |
rules | TokenRules | Token rules (purchase limits) |
status | int | Token status (1: Pending, 2: Listed, 3: Rejected, etc.) |
integration | TokenIntegration | External integration information |
meta | TokenMeta | Token metadata (images, documents) |
seller_address | string | Address of the seller's related contract |
created_at | time.Time | Token creation date |
updated_at | time.Time | Token last update date |
deleted_at | *time.Time | Token deletion date (soft delete, optional) |
TokenContract
Represents token contract information.
Fields
| Field | Type | Description |
|---|---|---|
address | string | Token contract address (blockchain address) |
hash | string | Contract hash value |
Example
{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"hash": "0x1234567890abcdef1234567890abcdef12345678"
}
TokenRules
Represents purchase rules for a token.
Fields
| Field | Type | Description |
|---|---|---|
max_purchase_limit | int | Maximum purchase limit |
min_purchase_limit | int | Minimum purchase limit |
Example
{
"max_purchase_limit": 10000,
"min_purchase_limit": 100
}
TokenIntegration
Represents token integration parameters for external integration systems.
Fields
| Field | Type | Description |
|---|---|---|
chain_id | int | Blockchain network ID |
abi | string | Contract ABI (Application Binary Interface) |
contract_address | string | Integration contract address |
function_name | string | Function name to call |
currency_token_address | string | Currency token address used for payment |
is_approved | bool | Token approval status |
args | TokenIntegrationArgs | Arguments for integration function |
Example
{
"chain_id": 1,
"abi": "[{\"type\":\"function\",\"name\":\"mint\",\"inputs\":[...]}]",
"contract_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"function_name": "mint",
"currency_token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"is_approved": true,
"args": [
{
"type": "address",
"value": "0x123...",
"description": "Recipient address"
}
]
}
TokenIntegrationArg
Represents argument information for integration function.
Fields
| Field | Type | Description |
|---|---|---|
type | string | Argument type (e.g., address, uint256, string) |
value | string | Argument value |
description | string | Argument description |
TokenMeta
Represents token metadata information (images and documents).
Fields
| Field | Type | Description |
|---|---|---|
images | []Image | Images associated with the token |
documents | []Document | Documents associated with the token |
Image
Represents token image information.
Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the image |
url | string | Image URL address |
is_default | bool | Whether this is the default image |
hash | string | Image hash value |
created_at | time.Time | Creation date |
deleted_at | *time.Time | Deletion date (optional) |
Document
Represents token document information.
Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the document |
name | string | Document name |
url | string | Document URL address |
type | DocumentType | Document type (value between 1-9) |
hash | string | Document hash value |
created_at | time.Time | Creation date |
deleted_at | *time.Time | Deletion date (optional) |
DocumentType Values
| Value | Type | Description |
|---|---|---|
1 | Standard | Standard document |
2 | Whitepaper | Whitepaper document |
3 | TermsOfService | Terms of service |
4 | PrivacyPolicy | Privacy policy |
5 | LegalAgreement | Legal agreement |
6 | Prospectus | Prospectus |
7 | AuditReport | Audit report |
8 | License | License document |
9 | Certificate | Certificate |
CurrencyToken
Represents currency token information used for payment.
Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the currency token |
name | string | Currency token name (e.g., USD Coin) |
symbol | string | Currency token symbol (e.g., USDC) |
decimals | int | Currency token decimal places |
address | string | Currency token contract address |
chain_id | int | Blockchain network ID |
Example
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1
}
Complete Token Example
Below is a complete token response example with all fields:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"node_id": "550e8400-e29b-41d4-a716-446655440001",
"node": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "Example Node",
"status": 1
},
"distributor_id": "550e8400-e29b-41d4-a716-446655440002",
"currency_token_id": "550e8400-e29b-41d4-a716-446655440003",
"currency_token": {
"id": "550e8400-e29b-41d4-a716-446655440003",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1
},
"chain_id": 1,
"name": "My Token",
"description": "This is an example token with comprehensive metadata",
"symbol": "MTK",
"value": 1.5,
"supply": 1000000,
"external_id": "EXT-12345",
"contract": {
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"hash": "0x1234567890abcdef1234567890abcdef12345678"
},
"rules": {
"max_purchase_limit": 10000,
"min_purchase_limit": 100
},
"status": 2,
"integration": {
"chain_id": 1,
"abi": "[{\"type\":\"function\",\"name\":\"mint\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}]}]",
"contract_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"function_name": "mint",
"currency_token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"is_approved": true,
"args": [
{
"type": "address",
"value": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"description": "Recipient address for token minting"
},
{
"type": "uint256",
"value": "1000000000000000000",
"description": "Amount to mint in wei"
}
]
},
"meta": {
"images": [
{
"id": "550e8400-e29b-41d4-a716-446655440004",
"url": "https://example.com/images/token-logo.png",
"is_default": true,
"hash": "abc123def456",
"created_at": "2024-01-01T00:00:00Z",
"deleted_at": null
},
{
"id": "550e8400-e29b-41d4-a716-446655440005",
"url": "https://example.com/images/token-banner.png",
"is_default": false,
"hash": "def456ghi789",
"created_at": "2024-01-01T00:00:00Z",
"deleted_at": null
}
],
"documents": [
{
"id": "550e8400-e29b-41d4-a716-446655440006",
"name": "Token Whitepaper",
"url": "https://example.com/documents/whitepaper.pdf",
"type": 2,
"hash": "whitepaper123",
"created_at": "2024-01-01T00:00:00Z",
"deleted_at": null
},
{
"id": "550e8400-e29b-41d4-a716-446655440007",
"name": "Terms of Service",
"url": "https://example.com/documents/terms.pdf",
"type": 3,
"hash": "terms456",
"created_at": "2024-01-01T00:00:00Z",
"deleted_at": null
}
]
},
"seller_address": "0x1234567890123456789012345678901234567890",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"deleted_at": null
}
Token Statuses
Token statuses are as follows:
| Value | Status | Description |
|---|---|---|
1 | Pending Approval | Pending approval |
2 | Listed | Listed (active) |
3 | Rejected | Rejected |
4 | Delisted | Delisted |
Webhook Token Format
The token format sent in webhooks (TokenWebhook) is essentially the same as TokenResponse, but only IDs are sent instead of nested objects like node and currency_token:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"currency_token_id": "550e8400-e29b-41d4-a716-446655440003",
"chain_id": 1,
"node_id": "550e8400-e29b-41d4-a716-446655440001",
"distributor_id": "550e8400-e29b-41d4-a716-446655440002",
"name": "My Token",
"symbol": "MTK",
"description": "Token description",
"value": 1.5,
"supply": 1000000,
"external_id": "EXT-12345",
"contract": {
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"hash": "0x1234567890abcdef1234567890abcdef12345678"
},
"rules": {
"max_purchase_limit": 10000,
"min_purchase_limit": 100
},
"status": 2,
"integration": {
"chain_id": 1,
"abi": "[...]",
"contract_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"function_name": "mint",
"currency_token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"is_approved": true,
"args": []
},
"meta": {
"images": [],
"documents": []
},
"seller_address": "0x1234567890123456789012345678901234567890",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}