Token Modeli
Token modeli, token bilgilerini temsil eden ana veri yapısıdır. Bu sayfa, token modelinin tüm alanlarını ve yapısını detaylı olarak açıklamaktadır.
TokenResponse
Token yanıt modeli, API yanıtlarında kullanılan ana token veri yapısıdır.
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
id | string | Token'ın benzersiz kimliği (UUID) |
node_id | string | Token'ın bağlı olduğu node'un kimliği |
node | NodeResponse | Node bilgileri (opsiyonel, detaylı yanıtlarda dahil edilir) |
distributor_id | string | Token'ın bağlı olduğu distributor'ın kimliği |
currency_token_id | string | Ödeme için kullanılan currency token'ın kimliği |
currency_token | CurrencyToken | Currency token bilgileri (opsiyonel) |
chain_id | int | Blockchain ağ kimliği (örn: 1 = Ethereum Mainnet, 56 = BSC) |
name | string | Token'ın adı |
description | string | Token hakkında açıklama |
symbol | string | Token sembolü (örn: BTC, ETH, USDT) |
value | float64 | Token'ın değeri |
supply | int | Token'ın toplam arzı (supply) |
external_id | string | Harici sistemdeki token kimliği |
contract | TokenContract | Token contract bilgileri |
rules | TokenRules | Token kuralları (satın alma limitleri) |
status | int | Token durumu (1: Pending, 2: Listed, 3: Rejected, vb.) |
integration | TokenIntegration | Harici entegrasyon bilgileri |
meta | TokenMeta | Token metadata (görseller, dokümanlar) |
created_at | time.Time | Token'ın oluşturulma tarihi |
updated_at | time.Time | Token'ın son güncellenme tarihi |
deleted_at | *time.Time | Token'ın silinme tarihi (soft delete, opsiyonel) |
TokenContract
Token contract bilgilerini temsil eder.
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
address | string | Token contract adresi (blockchain adresi) |
hash | string | Contract hash değeri |
Örnek
{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"hash": "0x1234567890abcdef1234567890abcdef12345678"
}
TokenRules
Token için satın alma kurallarını temsil eder.
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
max_purchase_limit | int | Maksimum satın alma limiti |
min_purchase_limit | int | Minimum satın alma limiti |
Örnek
{
"max_purchase_limit": 10000,
"min_purchase_limit": 100
}
TokenIntegration
Harici entegrasyon sistemleri için token entegrasyon parametrelerini temsil eder.
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
chain_id | int | Blockchain ağ kimliği |
abi | string | Contract ABI (Application Binary Interface) |
contract_address | string | Entegrasyon contract adresi |
function_name | string | Çağrılacak fonksiyon adı |
currency_token_address | string | Ödeme için kullanılan currency token adresi |
is_approved | bool | Token'ın onay durumu |
args | TokenIntegrationArgs | Entegrasyon fonksiyonu için argümanlar |
Örnek
{
"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
Entegrasyon fonksiyonu için argüman bilgilerini temsil eder.
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
type | string | Argüman tipi (örn: address, uint256, string) |
value | string | Argüman değeri |
description | string | Argüman açıklaması |
TokenMeta
Token metadata bilgilerini temsil eder (görseller ve dokümanlar).
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
images | []Image | Token ile ilişkili görseller |
documents | []Document | Token ile ilişkili dokümanlar |
Image
Token görsel bilgilerini temsil eder.
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
id | string | Görselin benzersiz kimliği |
url | string | Görselin URL adresi |
is_default | bool | Varsayılan görsel olup olmadığı |
hash | string | Görsel hash değeri |
created_at | time.Time | Oluşturulma tarihi |
deleted_at | *time.Time | Silinme tarihi (opsiyonel) |
Document
Token doküman bilgilerini temsil eder.
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
id | string | Dokümanın benzersiz kimliği |
name | string | Doküman adı |
url | string | Dokümanın URL adresi |
type | DocumentType | Doküman tipi (1-9 arası değer) |
hash | string | Doküman hash değeri |
created_at | time.Time | Oluşturulma tarihi |
deleted_at | *time.Time | Silinme tarihi (opsiyonel) |
DocumentType Değerleri
| Değer | Tip | Açıklama |
|---|---|---|
1 | Standard | Standart doküman |
2 | Whitepaper | Whitepaper dokümanı |
3 | TermsOfService | Kullanım şartları |
4 | PrivacyPolicy | Gizlilik politikası |
5 | LegalAgreement | Yasal anlaşma |
6 | Prospectus | Prospektüs |
7 | AuditReport | Denetim raporu |
8 | License | Lisans belgesi |
9 | Certificate | Sertifika |
CurrencyToken
Ödeme için kullanılan currency token bilgilerini temsil eder.
Alanlar
| Alan | Tip | Açıklama |
|---|---|---|
id | string | Currency token'ın benzersiz kimliği |
name | string | Currency token adı (örn: USD Coin) |
symbol | string | Currency token sembolü (örn: USDC) |
decimals | int | Currency token ondalık basamak sayısı |
address | string | Currency token contract adresi |
chain_id | int | Blockchain ağ kimliği |
Örnek
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1
}
Tam Token Örneği
Aşağıda, tüm alanları içeren eksiksiz bir token yanıt örneği bulunmaktadır:
{
"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
}
]
},
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"deleted_at": null
}
Token Durumları (Status)
Token durumları aşağıdaki gibidir:
| Değer | Durum | Açıklama |
|---|---|---|
1 | Pending Approval | Onay bekliyor |
2 | Listed | Listelenmiş (aktif) |
3 | Rejected | Reddedilmiş |
4 | Delisted | Listeden çıkarılmış |
Webhook Token Formatı
Webhook'larda gönderilen token formatı (TokenWebhook) temel olarak TokenResponse ile aynıdır, ancak node ve currency_token gibi nested objeler yerine sadece ID'ler gönderilir:
{
"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": []
},
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}