Skip to content

Api Server

Enrico Rubboli edited this page Sep 14, 2023 · 1 revision

Overview

This documentation covers the API server for the Mintlayer core. The API server is built using the Axum framework and provides various endpoints to interact with the blockchain data. Please consider this a work in progress.

License

This project is licensed under the MIT License. You can find more details in the license file.

Endpoints

Below are the available endpoints with their respective HTTP methods and descriptions:

Chain

  • GET /chain/genesis

    • Description: Retrieve the genesis block details.
    • Response: JSON object containing block ID, merkle root, and transaction IDs.
  • GET /chain/tip

    • Description: Retrieve the details of the tip of the chain.
    • Response: JSON object containing block ID and block height.
  • GET /chain/:height

    • Description: Retrieve the block details at a specific height.
    • Parameters:
      • height: The height of the block to retrieve.
    • Response: JSON object containing the block ID.

Block

  • GET /block/:id

    • Description: Retrieve the details of a specific block.
    • Parameters:
      • id: The ID of the block to retrieve.
    • Response: JSON object containing block details including previous block ID, height, timestamp, merkle root, reward, and transaction IDs.
  • GET /block/:id/header

    • Description: Retrieve the header of a specific block.
    • Parameters:
      • id: The ID of the block to retrieve the header for.
    • Response: JSON object containing the block header details.
  • GET /block/:id/reward

    • Description: Retrieve the reward details of a specific block.
    • Parameters:
      • id: The ID of the block to retrieve the reward details for.
    • Response: JSON array containing the reward details.
  • GET /block/:id/transaction-ids

    • Description: Retrieve the transaction IDs of a specific block.
    • Parameters:
      • id: The ID of the block to retrieve the transaction IDs for.
    • Response: JSON array containing the transaction IDs.

Transaction

  • GET /transaction/:id

    • Description: Retrieve the details of a specific transaction.
    • Parameters:
      • id: The ID of the transaction to retrieve.
    • Response: JSON object containing transaction details including timestamp, inputs, and outputs.
  • GET /transaction/:id/merkle-path

    • Description: Retrieve the merkle path of a specific transaction.
    • Parameters:
      • id: The ID of the transaction to retrieve the merkle path for.
    • Response: JSON array containing the merkle path.

Destination

  • GET /destination/address/:public_key_hash

    • Description: Retrieve the details of a destination address.
    • Parameters:
      • public_key_hash: The public key hash of the destination address to retrieve.
    • Response: JSON object containing balance, tokens, and history.
  • GET /destination/public-key/:public_key

    • Description: Retrieve the details of a destination based on a public key.
    • Parameters:
      • public_key: The public key of the destination to retrieve.
    • Response: JSON object containing balance, tokens, and history.
  • GET /destination/script-hash/:script_id

    • Description: Retrieve the details of a destination based on a script hash.
    • Parameters:
      • script_id: The script ID of the destination to retrieve.
    • Response: JSON object containing balance, tokens, and history.
  • GET /destination/multisig/:public_key

    • Description: Retrieve the details of a multisig destination.
    • Parameters:
      • public_key: The public key of the multisig destination to retrieve.
    • Response: JSON object containing balance, tokens, and history.

Pool

  • GET /pool/:id
    • Description: Retrieve the details of a specific pool.
    • Parameters:
      • id: The ID of the pool to retrieve.
    • Response: JSON object containing decommission destination, pledged amount, balance, delegates, and history.

Notes

  • All endpoints return data in JSON format.

Contact

For any issues or contributions, contact [email protected].

Clone this wiki locally