v1

latestOpenAPI 3.1.02026-07-243035381.4 MB
Cardano - Rosetta

getTransactionConstructionMetadata

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.

post/construction/metadata

Request body

optionsobject

Some blockchains require different metadata for different types of transaction construction (ex: delegation versus a transfer). Instead of requiring a blockchain node to return all possible types of metadata for construction (which may require multiple node fetches), the client can populate an options object to limit the metadata returned to only the subset required.

Example request

{
  "network_identifier": {
    "blockchain": "bitcoin",
    "network": "mainnet",
    "sub_network_identifier": {
      "network": "shard 1",
      "metadata": {
        "producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
      }
    }
  }
}

Response

Expected response to a valid request

metadataobject required

Example response

{
  "metadata": {
    "account_sequence": 23,
    "recent_block_hash": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
  },
  "suggested_fee": [
    {
      "value": "1238089899992",
      "currency": {
        "symbol": "BTC",
        "decimals": 8,
        "metadata": {
          "Issuer": "Satoshi"
        }
      }
    }
  ]
}