API methods
Every sequencer node provides endpoints through a REST API that allows querying the network state or sending new interactions. Below are listed the methods directly related to the functionality of the sequencer.
In addition to the methods listed below, sequencer nodes offer endpoints related to the framework and consensus algorithm. For example, a list of these methods for the testnet network can be found at: https://sequencer-0.testnet.warp.cc.
Submits a new interaction to the sequencer
/api/v1/data-item
This method is used to submit a new interaction to the sequencer. The request payload should contain the interaction in the form of a DataItem, conforming to the ANS-104 format. Upon receiving such a request, the node validates the interaction. If it is valid, the node encapsulates it in a message, adds a sequencer transaction to its mempool, and broadcasts it to the other nodes in the network.
Possible responses
Code | Description | Example value |
---|---|---|
200 | The interaction was successfully submitted |
|
400 | The request was invalid |
|
409 | Invalid Nonce value for the given sender |
|
503 | Mempool is full |
|
Expected nonce value
/api/v1/nonce
This method returns the expected next nonce value for a given sender.
Request
The request body should be in the form of JSON:
{
"signature_type":1,
"owner":"..."
}
Where:
signature_type
- the integer that specifies the type of signature that the sender uses. Possible values that are currently supported by the sequencer:1
- Arweave signature3
- Ethereum signature
owner
- the public key of the owner
Possible responses
Code | Description | Example value |
---|---|---|
200 | The nonce was successfully returned |
|
400 | The request was invalid |
|
Get transaction by data item id
/api/v1/tx-data-item-id
This method returns the hash of the sequencer transaction that contains interactions with the given ID. The request body must contain JSON with the following field:
data_item_id
- the ID of the interaction.
The response body contains the following field:
tx_hash
- the hash of the sequencer transaction.
Possible responses
Code | Description | Example value |
---|---|---|
200 | The transaction hash was successfully returned |
|
400 | The request was invalid |
|
404 | No transaction found |
|
With the hash of a transaction, querying the sequencer node for transaction details is possible using the following endpoint: /cosmos/tx/v1beta1/txs/{hash}
.
Get transaction by sender and nonce
/api/v1/tx-sender-nonce
This method returns the hash of the sequencer transaction for a given sender address and nonce. The request body must contain JSON with the following fields:
sender
- the address of the sender.nonce
- the nonce of the interaction.
The response body contains the following field:
tx_hash
- the hash of the sequencer transaction.
Possible responses
Code | Description | Example value |
---|---|---|
200 | The transaction hash was successfully returned |
|
400 | The request was invalid |
|
404 | No transaction found |
|