Contract
Smart contract operations and state queries
Validate a WASM contract bytecode before deployment
WASM bytecode
Validation result
POST /api/contract/validate HTTP/1.1
Host: nodes.amadeus.bot
Content-Type: application/octet-stream
Accept: */*
Content-Length: 8
"binary"Validation result
{
"error": "text",
"valid": true
}Retrieve a value from contract state storage
Storage key (raw bytes)
Contract state value
POST /api/contract/get HTTP/1.1
Host: nodes.amadeus.bot
Content-Type: application/octet-stream
Accept: */*
Content-Length: 8
"binary"Contract state value
{}Retrieve all key-value pairs from contract state with a given prefix
Storage key prefix (raw bytes)
Contract state entries (vecpak encoded)
POST /api/contract/get_prefix HTTP/1.1
Host: nodes.amadeus.bot
Content-Type: application/octet-stream
Accept: */*
Content-Length: 8
"binary"Contract state entries (vecpak encoded)
binaryExecute a read-only contract function with no arguments
Contract address (Base58 encoded)
Function name
Caller public key (Base58 encoded)
Function execution result
GET /api/contract/view HTTP/1.1
Host: nodes.amadeus.bot
Accept: */*
Function execution result
{
"success": true,
"result": "text",
"logs": [
"text"
]
}Execute a read-only contract function using vecpak encoding
Vecpak encoded map with fields:
- contract: Contract address (48 bytes)
- function: Function name (string)
- args: Function arguments (array)
- pk: Optional caller public key (48 bytes)
Function execution result
Execution result (ASCII dump)
Execution logs
POST /api/contract/view HTTP/1.1
Host: nodes.amadeus.bot
Content-Type: application/octet-stream
Accept: */*
Content-Length: 8
"binary"Function execution result
{
"success": true,
"result": "text",
"logs": [
"text"
]
}Retrieve the list of top AMA token holders
Richlist
okGET /api/contract/richlist HTTP/1.1
Host: nodes.amadeus.bot
Accept: */*
Richlist
{
"error": "ok",
"richlist": [
{
"address": "text",
"balance": "text"
}
]
}Last updated