Skip to main content

Contract

Smart contract operations and state queries

Validate WASM contract

Validate a WASM contract bytecode before deployment

{"openapi":"3.0.3","info":{"title":"Amadeus Blockchain API","version":"1.5.0"},"tags":[{"name":"Contract","description":"Smart contract operations and state queries"}],"servers":[{"url":"https://nodes.amadeus.bot","description":"Mainnet"},{"url":"https://testnet-rpc.ama.one","description":"Testnet"}],"paths":{"/api/contract/validate":{"post":{"tags":["Contract"],"summary":"Validate WASM contract","description":"Validate a WASM contract bytecode before deployment","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"WASM bytecode"}}}},"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"valid":{"type":"boolean"}}}}}}}}}}}

Get contract state by key

Retrieve a value from contract state storage

{"openapi":"3.0.3","info":{"title":"Amadeus Blockchain API","version":"1.5.0"},"tags":[{"name":"Contract","description":"Smart contract operations and state queries"}],"servers":[{"url":"https://nodes.amadeus.bot","description":"Mainnet"},{"url":"https://testnet-rpc.ama.one","description":"Testnet"}],"paths":{"/api/contract/get":{"post":{"tags":["Contract"],"summary":"Get contract state by key","description":"Retrieve a value from contract state storage","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"Storage key (raw bytes)"}}}},"responses":{"200":{"description":"Contract state value","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}

Get contract state by prefix

Retrieve all key-value pairs from contract state with a given prefix

{"openapi":"3.0.3","info":{"title":"Amadeus Blockchain API","version":"1.5.0"},"tags":[{"name":"Contract","description":"Smart contract operations and state queries"}],"servers":[{"url":"https://nodes.amadeus.bot","description":"Mainnet"},{"url":"https://testnet-rpc.ama.one","description":"Testnet"}],"paths":{"/api/contract/get_prefix":{"post":{"tags":["Contract"],"summary":"Get contract state by prefix","description":"Retrieve all key-value pairs from contract state with a given prefix","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"Storage key prefix (raw bytes)"}}}},"responses":{"200":{"description":"Contract state entries (vecpak encoded)","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}}}}}

Execute contract view function (GET)

Execute a read-only contract function with no arguments

{"openapi":"3.0.3","info":{"title":"Amadeus Blockchain API","version":"1.5.0"},"tags":[{"name":"Contract","description":"Smart contract operations and state queries"}],"servers":[{"url":"https://nodes.amadeus.bot","description":"Mainnet"},{"url":"https://testnet-rpc.ama.one","description":"Testnet"}],"paths":{"/api/contract/view":{"get":{"tags":["Contract"],"summary":"Execute contract view function (GET)","description":"Execute a read-only contract function with no arguments","parameters":[{"name":"contract","in":"path","required":true,"description":"Contract address (Base58 encoded)","schema":{"type":"string"}},{"name":"function","in":"path","required":true,"description":"Function name","schema":{"type":"string"}},{"name":"pk","in":"query","required":false,"description":"Caller public key (Base58 encoded)","schema":{"type":"string"}}],"responses":{"200":{"description":"Function execution result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"result":{"type":"string"},"logs":{"type":"array","items":{"type":"string"}}}}}}}}}}}}

Execute contract view function (vecpak)

Execute a read-only contract function using vecpak encoding

{"openapi":"3.0.3","info":{"title":"Amadeus Blockchain API","version":"1.5.0"},"tags":[{"name":"Contract","description":"Smart contract operations and state queries"}],"servers":[{"url":"https://nodes.amadeus.bot","description":"Mainnet"},{"url":"https://testnet-rpc.ama.one","description":"Testnet"}],"paths":{"/api/contract/view":{"post":{"tags":["Contract"],"summary":"Execute contract view function (vecpak)","description":"Execute a read-only contract function using vecpak encoding","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"Vecpak encoded map with fields:\n- contract: Contract address (48 bytes)\n- function: Function name (string)\n- args: Function arguments (array)\n- pk: Optional caller public key (48 bytes)\n"}}}},"responses":{"200":{"description":"Function execution result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"result":{"type":"string","description":"Execution result (ASCII dump)"},"logs":{"type":"array","items":{"type":"string"},"description":"Execution logs"}}}}}}}}}}}

Get richlist

Retrieve the list of top AMA token holders

{"openapi":"3.0.3","info":{"title":"Amadeus Blockchain API","version":"1.5.0"},"tags":[{"name":"Contract","description":"Smart contract operations and state queries"}],"servers":[{"url":"https://nodes.amadeus.bot","description":"Mainnet"},{"url":"https://testnet-rpc.ama.one","description":"Testnet"}],"paths":{"/api/contract/richlist":{"get":{"tags":["Contract"],"summary":"Get richlist","description":"Retrieve the list of top AMA token holders","responses":{"200":{"description":"Richlist","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"richlist":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"balance":{"type":"string"}}}}}}}}}}}}}}