All pages
Powered by GitBook
1 of 3

Loading...

Loading...

Loading...

Delegation

The Delegation entity represents a record of a delegation transaction in the context of Casper Network Staking vs. Delegating process

Properties

The Delegation entity has the following properties:

Property
Type
Description

Example

Optional properties

Depending on the endpoint some of the following optional properties may be included in the Delegation entity:

Property
Type
Description

Relations

The Delegation entity has the following relations with other entities:

Entity
Mapping property
Description

Endpoints

The Delegation entity has the following endpoints:

Relation endpoints

None

public_key

string(68)

Public key of the delegator represented as a hexadecimal string

validator_public_key

string(68)

Public key of the validator represented as a hexadecimal string

stake

string

Delegation amount in motes. The type is string to avoid overflow in languages that don't support uint64, which is the correct type.

bonding_purse

string(72)

URef of the purse from which the delegation was made in the uref-dead...beef-007 format

account_info

AccountInfo

Account info provided by the delegator

validator_account_info

AccountInfo

Account info provided by the validator

cspr_name

string

Primary CSPR.name of the account

Account

public_key

Delegations are made by accounts

Validator

validator_public_key

Validators can be delegated to

Get account delegations
Get validator delegations
{
  "public_key": "01a0e7b7b2b1b2b3b4b5b6b7b8b9b0b1b2b3b4b5b6b7b8b9b0b1b2b3b4b5",
  "validator_public_key": "01a0e7b7b2b1b2b3b4b5b6b7b8b9b0b1b2b3b4b5b6b7b8b9b0b1b2b3b4b5",
  "stake": "1000000",
  "bonding_purse": "uref-550c01b27069f943c354364c49a496b5013ee5bdf61d8644e4f0712cf22410f1-000"
}

Get account delegations

Get paginated list of delegations made by an account.

Query params

None

Sorting

Property
Description

Default sorting is stake DESC

Optional properties

Property
Type
Description

Response

Example

Get validator delegations

Get paginated list of delegations made to a validator.

Query params

None

GET /accounts/{public_key}/delegations

stake

Sort by stake amount

account_info

AccountInfo

Account info provided by the delegator

validator_account_info

AccountInfo

Account info provided by the validator

centralized_account_info

CentralizedAccountInfo

Account information available for known accounts provided by CSPR.cloud team

cspr_name

string

PaginatedResponse
<Delegation>

Primary CSPR.name of the account

curl -X 'GET' \
  'https://api.testnet.cspr.cloud/accounts/018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02/delegations?limit=2&offset=0' \
  -H 'Accept: application/json' \
  -H 'Authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "item_count": 129,
  "page_count": 13,
  "data": [
    {
      "bonding_purse": "uref-0ac1ba0100574729337b63b11e1f933b91d1d0f220823bef502bd8957305976b-007",
      "public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02",
      "stake": "55342872342594023",
      "validator_public_key": "017d96b9a63abcb61c870a4f55187a0a7ac24096bdb5fc585c12a686a4d892009e"
    },
    {
      "bonding_purse": "uref-917e1aeba7e7d3a322e89069e88b6e0877a59d781840c0ce8223e990e0342d42-007",
      "public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02",
      "stake": "55334239891699578",
      "validator_public_key": "0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca"
    },
    ...
    {
      "bonding_purse": "uref-64b18eba7bea61163415e728cc8aec51208e14c7abf29d1ce4d50d317ca43053-007",
      "public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02",
      "stake": "10101529405231091",
      "validator_public_key": "01aea86e5fccdf72daa7c65cc8b3d2ca96a006a0dcd70d3617f85fef00b9d78464"
    }
  ]
}
Sorting
Property
Description

stake

Sort by stake amount

Default sorting is stake DESC

Optional properties

Property
Type
Description

account_info

provided by the delegator

validator_account_info

provided by the validator

centralized_account_info

Account information available for known accounts provided by CSPR.cloud team

cspr_name

string

Response

PaginatedResponse<Delegation>

Example

GET /validators/{public_key}/delegations
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/validators/0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca/delegations?limit=2&offset=0' \
  -H 'Accept: application/json' \
  -H 'Authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "item_count": 1200,
  "page_count": 120,
  "data": [
    {
      "bonding_purse": "uref-917e1aeba7e7d3a322e89069e88b6e0877a59d781840c0ce8223e990e0342d42-007",
      "public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02",
      "stake": "55334239891699578",
      "validator_public_key": "0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca"
    },
    {
      "bonding_purse": "uref-ee8e4e63ee02f7cd38838b07bdd591cc8986bf6e8e5724dd0d54328e76b8dda0-007",
      "public_key": "011b5b2e370411b6df3a3d8ac0063b35e2003994a634dba48dd5422247fc1e7c41",
      "stake": "148999666957527",
      "validator_public_key": "0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca"
    },
    ...
    {
      "bonding_purse": "uref-0979efcbf321998cd0c65a755a668f555be56ad1c0a063fe289fbdc4467f7519-007",
      "public_key": "0111dad2c2c4769e5fb723fa4fdb432a7d39c48a575a361dca1ff8693e715642df",
      "stake": "3545802984166",
      "validator_public_key": "0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca"
    }
  ]
}

Primary CSPR.name of the account

AccountInfo
Account info
AccountInfo
Account info
CentralizedAccountInfo