Blocks

Get Blocks

Gets all blocks by provided filter(s).

GET /api/blocks?generatorPublicKey=generatorPublicKey&height=height&previousBlock=previousBlock&totalAmount=totalAmount&totalFee=totalFee&limit=limit&offset=offset&orderBy=orderBy

All parameters joins by OR.

Example
/api/blocks?height=100&totalAmount=10000 looks like: height=100 OR totalAmount=10000

  • totalFee: total fee of block. (Integer)
  • totalAmount: total amount of block. (Integer)
  • previousBlock: previous block of need block. (String)
  • height: height of block. (Integer)
  • generatorPublicKey: generator id of block in hex. (String)
  • limit: limit of blocks to add to response. Default to 20. (Integer)
  • offset: offset to load blocks. (Integer)
  • orderBy: field name to order by. Format: fieldname:orderType. Example: height:desc, timestamp:asc (String)

Response

 {
  "success": true,
  "blocks": [
    "array of blocks (see below block object response)"
  ]
}

Example

curl -k -X GET http://localhost:8000/api/blocks?generatorPublicKey=<generatorPublicKey>

Get Block

Gets block by provided id.

GET /api/blocks/get?id=id

  • id: Id of block.

Response

 {
    "success": true,
    "block": {
        "id": "Id of block. String",
        "version": "Version of block. Integer",
        "timestamp": "Timestamp of block. Integer",
        "height": "Height of block. Integer",
        "previousBlock": "Previous block id. String",
        "numberOfTransactions": "Number of transactions. Integer",
        "totalAmount": "Total amount of block. Integer",
        "totalFee": "Total fee of block. Integer",
        "reward": "Reward block. Integer",
        "payloadLength": "Payload length of block. Integer",
        "payloadHash": "Payload hash of block. Integer",
        "generatorPublicKey": "Generator public key. Hex",
        "generatorId": "Generator id. String.",
        "blockSignature": "Block signature. Hex",
        "confirmations": "Block confirmations. Integer",
        "totalForged": "Total block forged. Integer"
    }
}

Example

curl -k -X GET http://localhost:8000/api/blocks/get?id=<id>

Get Blockchain Fee

Get transaction fee for sending "normal" transactions.

GET /api/blocks/getFee

Response

 {
  "success": true,
  "fee": Integer
}

Example

curl -k -X GET http://localhost:8000/api/blocks/getFee

Get Blockchain Fees Schedule

Get transaction fee for all types of transactions.

GET /api/blocks/getFees

Response

 {
  "success": true,
  "fees":{
    "send": Integer,
    "vote": Integer,
    "secondsignature": Integer,
    "delegate": Integer,
    "multisignature": Integer,
    "dapp": Integer
  }
}

Example

curl -k -X GET http://localhost:8000/api/blocks/getFees

Get Blockchain Reward Schedule

Gets the forging reward for blocks.

GET /api/blocks/getReward

Response

 {
  "success": true,
  "reward": Integer
}

Example

curl -k -X GET http://localhost:8000/api/blocks/getReward

Get Total Supply of Lisk Tokens (LSK)

Gets the total amount of Lisk in circulation

GET /api/blocks/getSupply

Response

 {
  "success": true,
  "supply": Integer
}

Example

curl -k -X GET http://localhost:8000/api/blocks/getSupply

Get Blockchain Height

Gets the blockchain height of the client.

GET /api/blocks/getHeight

Response

 {
  "success": true,
  "height": "Height of blockchain. Integer"
}

Example

curl -k -X GET http://localhost:8000/api/blocks/getHeight

Get Status of Height, Fee, Milestone, Blockreward and Supply

Gets status of height, fee, milestone, blockreward and supply

GET /api/blocks/getStatus

Response

 {
  "success": true,
  "height": Integer
  "fee": Integer
  "milestone": Integer
  "reward": Integer
  "supply": Integer
}

Example

curl -k -X GET http://localhost:8000/api/blocks/getStatus

Get Blockchain Nethash

Gets the nethash of the blockchain on a client.

GET /api/blocks/getNethash

Response

 {
  "success": true,
  "nethash": "Nethash of the Blockchain. String"
}

Example

curl -k -X GET http://localhost:8000/api/blocks/getNethash

Get Blockchain Milestone

Gets the milestone of the blockchain on a client.

GET /api/blocks/getMilestone

Response

 {
  "success": true,
  "milestone": Integer
}

Example

curl -k -X GET http://localhost:8000/api/blocks/getMilestone

What's next?
Signatures