Delegates

Enable Delegate on Account

Puts request to create a delegate.

PUT /api/delegates

Request

 {
  "secret": "Secret key of account",
  "secondSecret": "Second secret of account",
  "username": "Username of delegate. String from 1 to 20 characters."
}

Response

 {  
   "success":true,
   "transaction":{  
      "type": "Type of transaction. Integer",
      "amount": "Amount. Integer",
      "senderPublicKey": "Sender public key. String",
      "requesterPublicKey": "RequesterString",
      "timestamp": "Time. Integer",
      "asset":{  
         "delegate":{  
            "username username. },
      "recipientId": "Recipient address. String",
      "signature": "Signature. String",
      "signSignature": "Sign signature. String",
      "id": "Tx ID. String",
      "fee": "Fee. Integer",
      "senderId": "Sender address. String",
      "relays": "Propagation. Integer",
      "receivedAt": "Time. String"
   }
}

Example

curl -k -H "Content-Type: application/json" \
-X PUT -d '{"secret":"<INSERT SECRET HERE>","secondSecret":"<INSERT SECOND SECRET HERE>","username":"<INSERT USERNAME HERE>" }' \
http://localhost:8000/api/delegates

Get Delegates List

Gets list of delegates by provided filter.

GET /api/delegates?limit=limit&offset=offset&orderBy=orderBy

  • limit: Limit to show. Integer. Maximum is 100. (Integer)
  • offset: Offset (Integer)
  • orderBy: Order by field (String)

Response

 {
  "success": true,
  "delegates": "delegates objects array"
}
  • Delegates Array includes: delegateId, address, publicKey, vote (#section- of votes), producedBlocks, missedBlocks, rate, productivity

Example

curl -k -X GET http://localhost:8000/api/delegates?limit=<limit>

Get Delegate

Gets delegate by public key or username.

GET /api/delegates/get?publicKey=publicKey

  • publicKey: Public key of delegate account (String)

GET /api/delegates/get?username=username

  • username: Username of delegate account (String)

Response

 {
    "success": true,
    "delegate": {
        "username": "Username. String",
        "address": "Address. String",
        "publicKey": "Public key. String",
        "vote": "Total votes. Integer",
        "producedblocks": "Produced blocks. Integer",
        "missedblocks": "Missed blocks. Integer",
        "rate": "Ranking. Integer",
        "approval": "Approval percentage. Float",
        "productivity": "Productivity percentage. Float"
    }
}

Example

curl -k -X GET http://localhost:8000/api/delegates/get?publicKey=publicKey

Search for Delegates

Search for Delegates by "fuzzy" username.

GET /api/delegates/search?q=username&orderBy=producedblocks:desc

  • q: Search criteria. (String)
  • orderBy: Order results by ascending or descending property. Valid sort fields are: username:asc, username:desc, address:asc, address:desc, publicKey:asc, publicKey:desc, vote:asc, vote:desc, missedblocks:asc, missedblocks:desc, producedblocks:asc, producedblocks:desc

Response

 {
  "success": true,
  "delegates": [
    "array of delegates"
  ]
}

Example

curl -k -X GET http://localhost:8000/api/delegates/search?q=username&orderBy=producedblocks:desc

Get Delegates Count

Get total count of registered delegates.

GET /api/delegates/count

Response

 {
  "success": true,
  "count": 101
}

Example

curl -k -X GET http://localhost:8000/api/delegates/count

Get votes of account

Get votes by account wallet address.

GET /api/accounts/delegates/?address=address

  • address: Address of account. (String)

Response

 {
  "success": true,
  "delegates": [
      "array of of delegates object (see above delegate object response)"
    ]
}
  • Delegates Array includes: delegateId, address, publicKey, vote (#section- of votes), producedBlocks, missedBlocks, rate, productivity

Example

curl -k -X GET http://localhost:8000/api/accounts/delegates/?address=<address>

Get Voters

Get voters of delegate.

GET /api/delegates/voters?publicKey=publicKey

  • publicKey: Public key of registered delegate account. (String)

Response

 {
  "success": true,
  "accounts": [
    {
      username: "Voter username. String",
      address: "Voter address. String",
      publicKey: "Voter public key. String",
      balance: "Voter balance. String"
    }
  ]
}

Example

curl -k -X GET http://localhost:8000/api/delegates/voters?publicKey=<publicKey>

Enable Forging on Delegate

Enables forging for a delegate on the client node.

POST /api/delegates/forging/enable

Request

 {
  "secret": "secret key of delegate account"
}

Response

 {
  "success": true,
  "address": "address"
}

Example

curl -k -H "Content-Type: application/json" \
-X POST -d '{"secret":"<INSERT SECRET HERE>"}' \
http://localhost:8000/api/delegates/forging/enable

Disable Forging on Delegate

Disables forging for a delegate on the client node.

POST /api/delegates/forging/disable

Request

 {
  "secret": "secret key of delegate account"
}

Response

 {
  "success": true,
  "address": "address"
}

Example

curl -k -H "Content-Type: application/json" \
-X POST -d '{"secret":"<INSERT SECRET HERE>"}' \
http://localhost:8000/api/delegates/forging/disable

Get Forged by Account

Get amount of Lisk forged by an account.

GET /api/delegates/forging/getForgedByAccount?generatorPublicKey=generatorPublicKey

Required

  • generatorPublicKey: generator id of block in hex. (String)

Optional

  • start: Sets the start time of the search - timestamp UNIX time. (String)
  • end: Sets the endtime of the search - timestamp UNIX time. (String)

Response

 {
  "success": true,
  "fees": "Forged amount. Integer",
  "rewards":"Forged amount. Integer",
  "forged":"Forged amount. Integer"
}

Example

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

Get Next Forgers

Get next delegate lining up to forge.

GET /api/delegates/getNextForgers?limit=limit

  • limit: limits the amount of delegates returned, default 10, max 101 (Integer)

Response

 {
  "success": true,
  "currentBlock": "Current block based on height. Integer",
  "currentSlot": "Current slot based on time. Integer",
  "delegates": [
          "array of publicKeys. Strings"
        ]
}

Example

curl -k -X GET http://localhost:8000/api/delegates/getNextForgers

What's next?
Apps