Rosetta

Build Once. Integrate Your Blockchain Everywhere.

block 2

Description

Get a block by its Block Identifier. If transactions are returned in the same call to the node as fetching the block, the response should include these transactions in the Block object. If not, an array of Transaction Identifiers should be returned so /block/transaction fetches can be done to get all transaction information.

When requesting a block by the hash component of the BlockIdentifier, this request MUST be idempotent: repeated invocations for the same hash-identified block must return the exact same block contents.

No such restriction is imposed when requesting a block by height, given that a chain reorg event might cause the specific block at height n to be set to a different one.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "cillum consectetur", "network": "voluptate qui sint", "sub_network_identifier": { "network": "Lorem qui", "metadata": "eu id quis eiusmod" } }, "block_identifier": { "index": "<long>", "hash": "<string>" } }

Description

Get a transaction in a block by its Transaction Identifier. This endpoint should only be used when querying a node for a block does not return all transactions contained within it.

All transactions returned by this endpoint must be appended to any transactions returned by the /block method by consumers of this data. Fetching a transaction by hash is considered an Explorer Method (which is classified under the Future Work section).

This method can be used to let consumers to paginate results when the block trasactions count is too big to be returned in a single BlockResponse.

Calling this endpoint requires reference to a BlockIdentifier because transaction parsing can change depending on which block contains the transaction. For example, in Bitcoin it is necessary to know which block contains a transaction to determine the destination of fee payments. Without specifying a block identifier, the node would have to infer which block to use (which could change during a re-org).

Implementations that require fetching previous transactions to populate the response (ex: Previous UTXOs in Bitcoin) may find it useful to run a cache within the Rosetta server in the /data directory (on a path that does not conflict with the node).

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "magna", "network": "ipsum", "sub_network_identifier": { "network": "deserunt commodo aliquip eu", "metadata": "qui consequat aute" } }, "block_identifier": { "index": -76927274, "hash": "ullamco in ut" }, "transaction_identifier": { "hash": "sunt do commodo ut" } }

construction 8

Description

Combine creates a network-specific transaction from an unsigned transaction and an array of provided signatures.

The signed transaction returned from this method will be sent to the /construction/submit endpoint by the caller.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "incididunt laboris", "network": "in", "sub_network_identifier": { "network": "sit do aliquip in eu", "metadata": "quis officia" } }, "unsigned_transaction": "<string>", "signatures": [ { "signing_payload": { "address": "ipsum deserunt cillum velit", "hex_bytes": "commodo dolore deserunt aliqua irure", "signature_type": "ecdsa_recovery" }, "public_key": { "hex_bytes": "<string>", "curve_type": "<string>" }, "signature_type": "ed25519", "hex_bytes": "<string>" }, { "signing_payload": { "address": "dolor laborum nulla exercitation", "hex_bytes": "cupidatat culpa sit labore irure", "signature_type": "ecdsa" }, "public_key": { "hex_bytes": "<string>", "curve_type": "<string>" }, "signature_type": "ecdsa_recovery", "hex_bytes": "<string>" } ] }

Description

Preprocess is called prior to /construction/payloads to construct a request for any metadata that is needed for transaction construction given (i.e. account nonce).

The options object returned from this endpoint will be sent to the /construction/metadata endpoint UNMODIFIED by the caller (in an offline execution environment). If your Construction API implementation has configuration options, they MUST be specified in the /construction/preprocess request (in the metadata field).

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "ut officia veniam dolor", "network": "consequat magna", "sub_network_identifier": { "network": "sunt eu veniam qui ea", "metadata": "amet dolore incididunt" } }, "operations": [ { "operation_identifier": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "type": "culpa nulla consequat", "status": "dolore", "related_operations": [ { "value": "<Error: Too many levels of nesting to fake this schema>" }, { "value": "<Error: Too many levels of nesting to fake this schema>" } ], "account": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "amount": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "coin_change": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "metadata": "proident aute ut" }, { "operation_identifier": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "type": "dolor", "status": "eu", "related_operations": [ { "value": "<Error: Too many levels of nesting to fake this schema>" }, { "value": "<Error: Too many levels of nesting to fake this schema>" } ], "account": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "amount": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "coin_change": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "metadata": "consequat occaecat" } ], "metadata": "<object>", "max_fee": [ { "value": "fugiat in", "currency": { "symbol": "ad dolore fugiat sunt", "decimals": 17470611, "metadata": "incididunt aliqua magna id" }, "metadata": "elit adipisicing aute aliqua Duis" }, { "value": "sed labore", "currency": { "symbol": "ut quis sed", "decimals": 72202407, "metadata": "occaecat " }, "metadata": "sunt Duis veniam fugiat" } ], "suggested_fee_multiplier": "<double>" }

Description

Derive returns the network-specific address associated with a public key.

Blockchains that require an on-chain action to create an account should not implement this method.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "incididunt officia", "network": "voluptate", "sub_network_identifier": { "network": "in ex est", "metadata": "Duis reprehenderit" } }, "public_key": { "hex_bytes": "<string>", "curve_type": "<string>" }, "metadata": "<object>" }

Description

Payloads is called with an array of operations and the response from /construction/metadata. It returns an unsigned transaction blob and a collection of payloads that must be signed by particular addresses using a certain SignatureType.

The array of operations provided in transaction construction often times can not specify all “effects” of a transaction (consider invoked transactions in Ethereum). However, they can deterministically specify the “intent” of the transaction, which is sufficient for construction. For this reason, parsing the corresponding transaction in the Data API (when it lands on chain) will contain a superset of whatever operations were provided during construction.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "occaecat veniam", "network": "sunt qui", "sub_network_identifier": { "network": "occaecat quis", "metadata": "" } }, "operations": [ { "operation_identifier": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "type": "anim", "status": "proident veniam", "related_operations": [ { "value": "<Error: Too many levels of nesting to fake this schema>" }, { "value": "<Error: Too many levels of nesting to fake this schema>" } ], "account": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "amount": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "coin_change": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "metadata": "ma" }, { "operation_identifier": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "type": "tempor", "status": "et", "related_operations": [ { "value": "<Error: Too many levels of nesting to fake this schema>" }, { "value": "<Error: Too many levels of nesting to fake this schema>" } ], "account": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "amount": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "coin_change": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "metadata": "elit eu" } ], "metadata": "<object>" }

Description

Get any information required to construct a transaction for a specific network. Metadata returned here could be a recent hash to use, an account sequence number, or even arbitrary chain state. The request used when calling this endpoint is created by calling /construction/preprocess in an offline environment.

You should NEVER assume that the request sent to this endpoint will be created by the caller or populated with any custom parameters. This must occur in /construction/preprocess.

It is important to clarify that this endpoint should not pre-construct any transactions for the client (this should happen in /construction/payloads). This endpoint is left purposely unstructured because of the wide scope of metadata that could be required.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "pariatur deserunt", "network": "Excepteur sunt minim", "sub_network_identifier": { "network": "Excepteur reprehenderit ut", "metadata": "dolore magna " } }, "options": "<object>" }

Description

TransactionHash returns the network-specific transaction hash for a signed transaction.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "nulla Ut", "network": "do ipsum", "sub_network_identifier": { "network": "tempor quis", "metadata": "Lorem dolore" } }, "signed_transaction": "<string>" }

Description

Parse is called on both unsigned and signed transactions to understand the intent of the formulated transaction.

This is run as a sanity check before signing (after /construction/payloads) and before broadcast (after /construction/combine).

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "proident adipisicing", "network": "nulla", "sub_network_identifier": { "network": "adipisicing ut", "metadata": "do dolore amet" } }, "signed": "<boolean>", "transaction": "<string>" }

Description

Submit a pre-signed transaction to the node. This call should not block on the transaction being included in a block. Rather, it should return immediately with an indication of whether or not the transaction was included in the mempool.

The transaction submission response should only return a 200 status if the submitted transaction could be included in the mempool. Otherwise, it should return an error.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "est aute quis", "network": "dolor ex Duis veniam", "sub_network_identifier": { "network": "magna", "metadata": "laborum" } }, "signed_transaction": "<string>" }

mempool 2

Description

Get all Transaction Identifiers in the mempool

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "cupidatat", "network": "magna consequat quis", "sub_network_identifier": { "network": "ea occaecat et ut", "metadata": "esse qui do sit eiusmod" } }, "metadata": "<object>" }

Description

Get a transaction in the mempool by its Transaction Identifier. This is a separate request than fetching a block transaction (/block/transaction) because some blockchain nodes need to know that a transaction query is for something in the mempool instead of a transaction in a block.

Transactions may not be fully parsable until they are in a block (ex: may not be possible to determine the fee to pay before a transaction is executed). On this endpoint, it is ok that returned transactions are only estimates of what may actually be included in a block.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "ipsum", "network": "aliquip quis Lorem", "sub_network_identifier": { "network": "voluptate est dolore irure", "metadata": "ea occaecat in deserunt qui" } }, "transaction_identifier": { "hash": "anim adipisicing" } }

network 3

Description

This endpoint returns a list of NetworkIdentifiers that the Rosetta server supports.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "metadata": "<object>" }

Description

This endpoint returns the version information and allowed network-specific types for a NetworkIdentifier. Any NetworkIdentifier returned by /network/list should be accessible here.

Because options are retrievable in the context of a NetworkIdentifier, it is possible to define unique options for each network.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "cupidatat", "network": "magna consequat quis", "sub_network_identifier": { "network": "ea occaecat et ut", "metadata": "esse qui do sit eiusmod" } }, "metadata": "<object>" }

Description

This endpoint returns the current status of the network requested. Any NetworkIdentifier returned by /network/list should be accessible here.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "cupidatat", "network": "magna consequat quis", "sub_network_identifier": { "network": "ea occaecat et ut", "metadata": "esse qui do sit eiusmod" } }, "metadata": "<object>" }

Ungrouped 1

Description

Get an array of all AccountBalances for an AccountIdentifier and the BlockIdentifier at which the balance lookup was performed. The BlockIdentifier must always be returned because some consumers of account balance data need to know specifically at which block the balance was calculated to compare balances they compute from operations with the balance returned by the node.

It is important to note that making a balance request for an account without populating the SubAccountIdentifier should not result in the balance of all possible SubAccountIdentifiers being returned. Rather, it should result in the balance pertaining to no SubAccountIdentifiers being returned (sometimes called the liquid balance). To get all balances associated with an account, it may be necessary to perform multiple balance requests with unique AccountIdentifiers.

It is also possible to perform a historical balance lookup (if the server supports it) by passing in an optional BlockIdentifier.

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "network_identifier": { "blockchain": "mollit ad", "network": "consequat do", "sub_network_identifier": { "network": "incididunt officia tempor sed", "metadata": "sit ut irure" } }, "account_identifier": { "address": "<string>", "sub_account": { "address": "<string>", "metadata": "<object>" }, "metadata": "<object>" }, "block_identifier": { "index": "<long>", "hash": "<string>" } }

Available Variables 1

KeyValueType
baseUrl/string