Web API: Fungible Token
The Fungible Token API provides endpoints for retrieving information about fungible tokens, including token details, voting topics, and governance features.
Base URL
/api/fungible-token/
Endpoints
List Fungible Tokens
GET /api/fungible-token/
Returns a paginated list of all fungible tokens on the VFX blockchain.
Query Parameters:
search
: Search by token name, symbol, or smart contract identifierordering
: Order results (e.g.,name
,-created_at
)
Response:
{
"count": 150,
"next": "http://localhost:8000/api/fungible-token/?page=2",
"previous": null,
"results": [
{
"id": 1,
"smart_contract_uid": "SC123...",
"name": "VFX Utility Token",
"symbol": "VUT",
"total_supply": "1000000.0",
"decimals": 18,
"creator_address": "Rx1234567890abcdef...",
"created_at": "2024-01-01T12:00:00Z",
"is_voting_enabled": true,
"description": "A utility token for the VFX ecosystem"
}
]
}
Get Fungible Token Details
GET /api/fungible-token/{sc_identifier}/
Returns detailed information about a specific fungible token.
Parameters:
sc_identifier
(string): The smart contract identifier
Response:
{
"id": 1,
"smart_contract_uid": "SC123...",
"name": "VFX Utility Token",
"symbol": "VUT",
"total_supply": "1000000.0",
"decimals": 18,
"creator_address": "Rx1234567890abcdef...",
"created_at": "2024-01-01T12:00:00Z",
"is_voting_enabled": true,
"description": "A utility token for the VFX ecosystem",
"metadata": {
"website": "https://example.com",
"logo": "https://example.com/logo.png",
"whitepaper": "https://example.com/whitepaper.pdf"
},
"holders_count": 500,
"transfer_count": 1250
}
List Token Voting Topics
GET /api/fungible-token/{sc_identifier}/voting-topics/
Returns voting topics associated with a specific fungible token.
Parameters:
sc_identifier
(string): The smart contract identifier
Response:
{
"count": 5,
"results": [
{
"topic_id": "topic_123",
"title": "Proposal to Increase Token Supply",
"description": "Vote on whether to increase the total token supply by 20%",
"status": "active",
"created_by": "Rx1234567890abcdef...",
"start_time": "2024-01-01T12:00:00Z",
"end_time": "2024-01-08T12:00:00Z",
"votes_for": 1500,
"votes_against": 800,
"total_votes": 2300,
"participation_rate": "46%"
}
]
}
Get Voting Topic Details
GET /api/fungible-token/voting-topics/{topic_id}/
Returns detailed information about a specific voting topic.
Parameters:
topic_id
(string): The voting topic identifier
Response:
{
"topic_id": "topic_123",
"token": {
"smart_contract_uid": "SC123...",
"name": "VFX Utility Token",
"symbol": "VUT"
},
"title": "Proposal to Increase Token Supply",
"description": "Vote on whether to increase the total token supply by 20%",
"full_description": "This proposal suggests increasing the total supply...",
"status": "active",
"created_by": "Rx1234567890abcdef...",
"start_time": "2024-01-01T12:00:00Z",
"end_time": "2024-01-08T12:00:00Z",
"votes_for": 1500,
"votes_against": 800,
"abstain": 100,
"total_votes": 2400,
"participation_rate": "48%",
"quorum_required": "25%",
"quorum_met": true,
"voting_options": ["For", "Against", "Abstain"]
}
Field Descriptions
Fungible Token
smart_contract_uid
: Unique identifier for the token's smart contractname
: Full name of the tokensymbol
: Trading symbol/ticker for the tokentotal_supply
: Total number of tokens in circulationdecimals
: Number of decimal places supportedcreator_address
: Address that created the tokenis_voting_enabled
: Whether governance voting is enabledholders_count
: Number of addresses holding the tokentransfer_count
: Total number of transfers
Voting Topic
topic_id
: Unique identifier for the voting topictitle
: Short title of the proposaldescription
: Brief description of the proposalstatus
: Current status (active, completed, cancelled)start_time
: When voting beginsend_time
: When voting endsvotes_for/against
: Vote counts for each optionparticipation_rate
: Percentage of eligible voters who participatedquorum_required
: Minimum participation needed for validityquorum_met
: Whether the quorum requirement was satisfied
Voting Status Values
pending
: Voting has not yet startedactive
: Voting is currently opencompleted
: Voting has ended successfullycancelled
: Voting was cancelled before completionfailed
: Voting failed to meet quorum requirements
Notes
- Token amounts are returned as strings to preserve decimal precision
- Voting is only available for tokens with
is_voting_enabled: true
- Voting power is typically based on token holdings at a snapshot block
- Topics may have different voting mechanisms (simple majority, supermajority, etc.)
- Historical voting data is preserved for transparency and auditing