POST
/
construction
/
metadata
curl --request POST \
  --url https://example.com/construction/metadata \
  --header 'Content-Type: application/json' \
  --data '{
  "network_identifier": {
    "blockchain": "bitcoin",
    "network": "mainnet",
    "sub_network_identifier": {
      "network": "shard 1",
      "metadata": {
        "producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
      }
    }
  },
  "options": {},
  "public_keys": [
    {
      "hex_bytes": "<string>",
      "curve_type": "secp256k1"
    }
  ]
}'
{
  "metadata": {
    "account_sequence": 23,
    "recent_block_hash": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
  },
  "suggested_fee": [
    {
      "value": "1238089899992",
      "currency": {
        "symbol": "BTC",
        "decimals": 8,
        "metadata": {
          "Issuer": "Satoshi"
        }
      },
      "metadata": {}
    }
  ]
}

Body

application/json

A ConstructionMetadataRequest is utilized to get information required to construct a transaction. The Options object used to specify which metadata to return is left purposely unstructured to allow flexibility for implementers. Options is not required in the case that there is network-wide metadata of interest. Optionally, the request can also include an array of PublicKeys associated with the AccountIdentifiers returned in ConstructionPreprocessResponse.

Response

200
application/json

Expected response to a valid request

The ConstructionMetadataResponse returns network-specific metadata used for transaction construction. Optionally, the implementer can return the suggested fee associated with the transaction being constructed. The caller may use this info to adjust the intent of the transaction or to create a transaction with a different account that can pay the suggested fee. Suggested fee is an array in case fee payment must occur in multiple currencies.