Skip to main content

Get Input

Example Request

{
"jsonrpc": "2.0",
"method": "cartesi_getInput",
"params": {
"application": "<name-or-address>",
"input_index": "<hex-encoded-index>"
},
"id": 1
}

The cartesi_getInput method retrieves detailed information about a specific input by its application and index.

Parameters

NameTypeRequiredDescription
applicationstringYesThe application's name or hex encoded address
input_indexstringYesThe index of the input to be retrieved (hex encoded)

Response

{
"jsonrpc": "2.0",
"result": {
"data": {
"epoch_index": "0x1",
"index": "0x1",
"block_number": "0x1",
"raw_data": "0x48656c6c6f",
"decoded_data": {
"chain_id": "0x1",
"application_contract": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"sender": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"block_number": "0x1",
"block_timestamp": "0x1234567890",
"prev_randao": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"index": "0x1",
"payload": "0x48656c6c6f"
},
"status": "ACCEPTED",
"machine_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"outputs_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"transaction_reference": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
},
"id": 1
}

Response Fields

NameTypeDescription
epoch_indexstringThe epoch index this input belongs to (hex encoded)
indexstringThe input index (hex encoded)
block_numberstringThe block number when the input was created (hex encoded)
raw_datastringThe raw input data in hexadecimal format
decoded_dataobjectThe decoded input data (null if not decodable)
statusstringCurrent status of the input
machine_hashstringThe machine hash after processing this input
outputs_hashstringThe outputs hash after processing this input
transaction_referencestringThe transaction reference
created_atstringTimestamp when the input was created
updated_atstringTimestamp when the input was last updated

Decoded Data Fields

NameTypeDescription
chain_idstringThe chain ID (hex encoded)
application_contractstringThe application contract address
senderstringThe sender address
block_numberstringThe block number (hex encoded)
block_timestampstringThe block timestamp (hex encoded)
prev_randaostringThe previous RANDAO value
indexstringThe input index (hex encoded)
payloadstringThe input payload in hexadecimal format

Error Codes

CodeMessageDescription
-32602Invalid paramsInvalid parameter values
-32000Application not foundThe specified application does not exist
-32002Input not foundThe specified input does not exist
-32603Internal errorAn internal error occurred
We use cookies to ensure that we give you the best experience on our website. By using the website, you agree to the use of cookies.