Web API: Transaction
The Transaction API provides endpoints for retrieving transaction information, including transaction details, address-specific queries, and block-based transaction listings.
Base URL
/api/transaction/
Endpoints
List Transactions
GET /api/transaction/
Returns a paginated list of transactions, ordered by most recent first.
Query Parameters:
search
: Search by transaction hash or addressesordering
: Order results (e.g.,-height
,timestamp
)type
: Filter by transaction typefrom_address
: Filter by sender addressto_address
: Filter by recipient address
Response:
{
"count": 1250000,
"next": "http://localhost:8000/api/transaction/?page=2",
"previous": null,
"results": [
{
"hash": "tx123456789abcdef...",
"type": "TRANSFER",
"from_address": "Rx1234567890abcdef...",
"to_address": "Rx9876543210fedcba...",
"total_amount": "100.0",
"total_fee": "0.001",
"timestamp": "2024-01-01T12:00:00Z",
"height": 12345,
"confirmations": 6,
"status": "confirmed"
}
]
}
Get Transaction Details
GET /api/transaction/{hash}/
Returns detailed information about a specific transaction.
Parameters:
hash
(string): Transaction hash
Response:
{
"hash": "tx123456789abcdef...",
"type": "TRANSFER",
"from_address": "Rx1234567890abcdef...",
"to_address": "Rx9876543210fedcba...",
"total_amount": "100.0",
"total_fee": "0.001",
"timestamp": "2024-01-01T12:00:00Z",
"height": 12345,
"block_hash": "block123...",
"confirmations": 6,
"status": "confirmed",
"size": 256,
"nonce": 42,
"data": null,
"signature": "sig123...",
"inputs": [
{
"address": "Rx1234567890abcdef...",
"amount": "100.001"
}
],
"outputs": [
{
"address": "Rx9876543210fedcba...",
"amount": "100.0"
},
{
"address": "Rx1234567890abcdef...",
"amount": "0.0",
"type": "fee"
}
],
"smart_contract_data": null
}
Get Transactions by Address
GET /api/transaction/address/{address}/
Returns transactions involving a specific address (as sender or recipient).
Parameters:
address
(string): VFX address
Query Parameters:
type
: Filter by transaction typedirection
: Filter by direction (sent
,received
,all
) - default:all
Response:
{
"count": 150,
"results": [
{
"hash": "tx123456789abcdef...",
"type": "TRANSFER",
"direction": "sent",
"counterparty_address": "Rx9876543210fedcba...",
"amount": "100.0",
"fee": "0.001",
"timestamp": "2024-01-01T12:00:00Z",
"height": 12345,
"status": "confirmed"
}
]
}
Get Transactions by Multiple Addresses
GET /api/transaction/addresses/{addresses}/
Returns transactions involving any of the specified addresses.
Parameters:
addresses
(string): Comma-separated list of VFX addresses
Get Transactions by Block
GET /api/transaction/block/{height}/
Returns all transactions in a specific block.
Parameters:
height
(integer): Block height
Response:
{
"block_height": 12345,
"block_hash": "block123...",
"timestamp": "2024-01-01T12:00:00Z",
"transaction_count": 15,
"transactions": [
{
"hash": "tx123456789abcdef...",
"type": "TRANSFER",
"from_address": "Rx1234567890abcdef...",
"to_address": "Rx9876543210fedcba...",
"total_amount": "100.0",
"total_fee": "0.001",
"position_in_block": 1
}
]
}
Transaction Types
Basic Types
- TRANSFER: Basic VFX token transfer
- SMART_CONTRACT: Smart contract deployment or execution
- NFT: NFT minting, transfer, or burn operations
- RESERVE: Reserve account operations
- STAKING: Validator staking operations
- VOTE: Governance voting transactions
NFT Subtypes
- NFT_MINT: Creating a new NFT
- NFT_TRANSFER: Transferring NFT ownership
- NFT_BURN: Destroying an NFT
- NFT_EVOLVE: Upgrading/evolving an NFT
Smart Contract Subtypes
- CONTRACT_DEPLOY: Deploying new smart contract
- CONTRACT_CALL: Calling smart contract function
- TOKEN_CREATE: Creating fungible token
Field Descriptions
Basic Transaction Data
hash
: Unique transaction identifiertype
: Category of transactionfrom_address
: Sender's VFX addressto_address
: Recipient's VFX addresstotal_amount
: Amount transferred (excluding fees)total_fee
: Transaction processing feetimestamp
: When the transaction was createdheight
: Block height containing this transactionconfirmations
: Number of blocks confirming this transactionstatus
: Current transaction status
Technical Details
size
: Transaction size in bytesnonce
: Sequence number for sender's transactionsdata
: Additional transaction data (for smart contracts)signature
: Cryptographic signature proving authenticityinputs
: Transaction inputs with amountsoutputs
: Transaction outputs and destinations
Address Query Fields
direction
: Whether address was sender or recipientcounterparty_address
: The other party in the transactionamount
: Amount relevant to the queried addressfee
: Fee paid (only for sent transactions)
Transaction Status
pending
: Transaction submitted but not yet confirmedconfirmed
: Transaction included in a blockfailed
: Transaction failed to execute properlyrejected
: Transaction rejected by network
Notes
- All monetary amounts are returned as strings to preserve precision
- Confirmations increase as new blocks are added after the transaction
- Smart contract transactions may include additional data fields
- NFT transactions reference specific token identifiers
- Fee calculations depend on transaction complexity and network congestion
- Large result sets are paginated for performance