All phases of Avail's unification drop have now ended, 👉👉 check out this page 👈👈 for more information.

API reference
Fetch the appdata of a specific block

Fetch the appdata of a specific block

Given a block number, it retrieves the hex-encoded extrinsics for the specified block, if available. Alternatively, if specified by a query parameter, the retrieved extrinsic is decoded and returned as a base64-encoded string.

Params:

  • block_number - block number (required)
  • decode - true if decoded extrinsics are requested (boolean, optional, default is false)
curl "https://api.lightclient.mainnet.avail.so/v1/appdata/1?decode=true"

To get a decoded extrinsic with plain appdata:

curl -s "https://api.lightclient.mainnet.avail.so/v1/appdata/1?decode=true" | jq -r '.extrinsics[-1]' | base64 -d
Sample Response:
{
  "block": 46,
  "extrinsics": ["ZXhhbXBsZQ=="]
}
  • If application data is available, and decode is false or unspecified:
{
  "block": 1,
  "extrinsics": [
    "0xc5018400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01308e88ca257b65514b7b44fc1913a6a9af6abc34c3d22761b0e425674d68df7de26be1c8533a7bbd01fdb3a8daa5af77df6d3fb0a67cde8241f461f4fe16f188000000041d011c6578616d706c65"
  ]
}

If application data is available, and decode is true:

{ "block": 1, "extrinsics": ["ZXhhbXBsZQ=="] }

if application data is available, decode is true, and the base64 extrinsic is decoded

"example"

If application data is not available, and specified block is the latest block:

"Processing block"

If application data is not available, and specified block is not the latest block:

"Not found"