Skip to main content

Input Endpoints

addInput

function addInput(bytes _input) external returns (bytes32)

Adds an input to the accumulating epoch's inbox

There is a maximum size for the input data that is defined by the dApp

Parameters

NameTypeDescription
_inputbytesbytes array of input

Return Values

NameTypeDescription
[0]bytes32hash of the input

getInput

function getInput(uint256 _index) external view returns (bytes32)

Returns the hash of the input at the provided input index, for the current sealed epoch

Parameters

NameTypeDescription
_indexuint256position of the input on inbox

Return Values

NameTypeDescription
[0]bytes32hash of the input

getNumberOfInputs

function getNumberOfInputs() external view returns (uint256)

Returns the number of inputs on the current sealed epoch's inbox

Return Values

NameTypeDescription
[0]uint256number of inputs of non active inbox

getCurrentInbox

function getCurrentInbox() external view returns (uint256)

Returns the internal index of the current accumulating inbox

Return Values

NameTypeDescription
[0]uint256index of current accumulating inbox

InputAdded

event InputAdded(uint256 epochNumber, uint256 inputIndex, address sender, uint256 timestamp, bytes input)

Indicates that an input was added to the accumulating epoch's inbox

Parameters

NameTypeDescription
epochNumberuint256which epoch this input belongs to
inputIndexuint256index of the input just added
senderaddressmsg.sender address
timestampuint256block timestamp
inputbytesinput data

On this page

© 2024 Cartesi Foundation Ltd. All rights reserved.

The Cartesi Project is commissioned by the Cartesi Foundation.

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.