# DPOPS

Note zachys (atomic units) are 10^6 in X-Cash

## Stats <a href="#stats" id="stats"></a>

This method gets the stats

**URL**: <https://api.xcash.foundation/v1/xcash/dpops/unauthorized/stats/>

**Method**: GET

**Inputs**: *None*.

**Results**:

* *mostTotalRoundsDelegateName* - string; The delegate name that has participated in the most X-Cash DPOPS rounds.
* *mostTotalRounds* - unsigned int; The most total rounds.
* *bestBlockVerifierOnlinePercentageDelegateName* - string; The delegate with the best online percentage.
* *bestBlockVerifierOnlinePercentage* - unsigned int; The best online percentage.
* *mostBlockProducerTotalRoundsDelegateName* - string; The delegate will the most block producer rounds.
* *mostBlockProducerTotalRounds* - unsigned int; Total most block producer rounds.
* *totalVotes* - unsigned long long; Total votes in zachys (atomic units).
* *totalVoters* - unsigned int; Total voters.
* *averageVote* - unsigned int; Average vote amount in zachys (atomic units).
* *votePercentage* - unsigned int; The percentage of the amount of xcash ciruclating compared to how much is being voted.
* *roundNumber* - unsigned int; The round number of X-Cash DPOPS.
* *totalRegisteredDelegates* - unsigned int; Total registered delegates.
* *totalOnlineDelegates* - unsigned int; Total online delegates.
* *currentBlockVerifiersMaximumAmount* - unsigned int; The current amount of delegates that the system will use.
* *currentBlockVerifiersValidAmount* - unsigned int; The current amount of delegates that is needed for verification.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xpayment-twitter/twitter/unauthorized/stats/ -H 'Accept: application/json'
{
  "mostTotalRoundsDelegateName": "europe3_xcash_foundation",
  "mostTotalRounds": 121528,
  "bestBlockVerifierOnlinePercentageDelegateName": "OnlyOne",
  "bestBlockVerifierOnlinePercentage": 100,
  "mostBlockProducerTotalRoundsDelegateName": "snakeway",
  "mostBlockProducerTotalRounds": 2899,
  "totalVotes": 38436931311445482,
  "totalVoters": 1000,
  "averageVote": 38436931311445,
  "votePercentage": 57,
  "roundNumber": 131677,
  "totalRegisteredDelegates": 150,
  "totalOnlineDelegates": 100,
  "currentBlockVerifiersMaximumAmount": 50,
  "currentBlockVerifiersValidAmount": 27
}
```

## Registered Delegates <a href="#registered-delegates" id="registered-delegates"></a>

This method gets all of the registered delegates

**URL**: <https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/registered>

**Method**: GET

**Inputs**: *None*.

**Results**:

Array of objects with the following structure:

* *votes* - unsigned long long; Total votes in zachys (atomic units).
* *voters* - unsigned int; Total voters.
* *IPAdress* - string; The IP address or domain name.
* *delegateName* - string; The delegate name.
* *sharedDelegate* - bool;
* *seedNode* - bool;
* *online* - bool;
* *fee* - unsigned int; The fee.
* *totalRounds* - unsigned int; Total rounds.
* *totalBlockProducerRounds* - unsigned int; Total block producer rounds.
* *onlinePercentage* - unsigned int; The online percentage.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/registered/ -H 'Accept: application/json'
[
  {
    "votes": 100000000,
    "voters": 10,
    "IPAdress": "us1.xcash.foundation",
    "delegateName": "us1_xcash_foundation",
    "sharedDelegate": false,
    "seedNode": true,
    "online": true,
    "fee": 0,
    "totalRounds": 100,
    "totalBlockProducerRounds": 10,
    "onlinePercentage": 67
  },
  {
    "votes": 0,
    "voters": 10,
    "IPAdress": "europe1.xcash.foundation",
    "delegateName": "europe1_xcash_foundation",
    "sharedDelegate": true,
    "seedNode": false,
    "online": true,
    "fee": 5,
    "totalRounds": 100,
    "totalBlockProducerRounds": 10,
    "onlinePercentage": 99
  }
]
```

## Online Delegates <a href="#online-delegates" id="online-delegates"></a>

This method gets all of the online delegates

**URL**: <https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/online>

**Method**: GET

**Inputs**: *None*.

**Results**:

Array of objects with the following structure:

* *votes* - unsigned long long; Total votes in zachys (atomic units).
* *voters* - unsigned int; Total voters.
* *IPAdress* - string; The IP address or domain name.
* *delegateName* - string; The delegate name.
* *sharedDelegate* - bool;
* *seedNode* - bool;
* *online* - bool;
* *fee* - unsigned int; The fee.
* *totalRounds* - unsigned int; Total rounds.
* *totalBlockProducerRounds* - unsigned int; Total block producer rounds.
* *onlinePercentage* - unsigned int; The online percentage.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/online/ -H 'Accept: application/json'
[
  {
    "votes": 100000000,
    "voters": 10,
    "IPAdress": "us1.xcash.foundation",
    "delegateName": "us1_xcash_foundation",
    "sharedDelegate": false,
    "seedNode": true,
    "online": true,
    "fee": 0,
    "totalRounds": 100,
    "totalBlockProducerRounds": 10,
    "onlinePercentage": 67
  },
  {
    "votes": 0,
    "voters": 10,
    "IPAdress": "europe1.xcash.foundation",
    "delegateName": "europe1_xcash_foundation",
    "sharedDelegate": true,
    "seedNode": false,
    "online": true,
    "fee": 5,
    "totalRounds": 100,
    "totalBlockProducerRounds": 10,
    "onlinePercentage": 99
  }
]
```

## Active Delegates <a href="#active-delegates" id="active-delegates"></a>

This method gets the current active delegates (top 50) during the round

**URL**: <https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/active>

**Method**: GET

**Inputs**: *None*.

**Results**:

Array of objects with the following structure:

* *votes* - unsigned long long; Total votes in zachys (atomic units).
* *voters* - unsigned int; Total voters.
* *IPAdress* - string; The IP address or domain name.
* *delegateName* - string; The delegate name.
* *sharedDelegate* - bool;
* *seedNode* - bool;
* *online* - bool;
* *fee* - unsigned int; The fee.
* *totalRounds* - unsigned int; Total rounds.
* *totalBlockProducerRounds* - unsigned int; Total block producer rounds.
* *onlinePercentage* - unsigned int; The online percentage.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/active/ -H 'Accept: application/json'
[
  {
    "votes": 100000000,
    "voters": 10,
    "IPAdress": "us1.xcash.foundation",
    "delegateName": "us1_xcash_foundation",
    "sharedDelegate": false,
    "seedNode": true,
    "online": true,
    "fee": 0,
    "totalRounds": 100,
    "totalBlockProducerRounds": 10,
    "onlinePercentage": 67
  },
  {
    "votes": 0,
    "voters": 10,
    "IPAdress": "europe1.xcash.foundation",
    "delegateName": "europe1_xcash_foundation",
    "sharedDelegate": true,
    "seedNode": false,
    "online": true,
    "fee": 5,
    "totalRounds": 100,
    "totalBlockProducerRounds": 10,
    "onlinePercentage": 99
  }
]
```

## Delegates <a href="#delegates" id="delegates"></a>

This method gets the delegates data

**URL**: [https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/{delegateName}](https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/%7BdelegateName%7D)

**Method**: GET

**Resources**:

* *delegateName* - **Required** - The delegates name.

**Inputs**: *None*.

**Results**:

* *votes* - unsigned long long; Total votes in zachys (atomic units).
* *voters* - unsigned int; Total voters.
* *IPAdress* - string; The IP address or domain name.
* *delegateName* - string; The delegate name.
* *publicAddress* - string; The public address.
* *about* - string; about.
* *website* - string; website.
* *team* - string; team.
* *specifications* - string; server Specifications.
* *sharedDelegate* - bool;
* *seedNode* - bool;
* *online* - bool;
* *fee* - unsigned int; The fee.
* *totalRounds* - unsigned int; Total rounds.
* *totalBlockProducerRounds* - unsigned int; Total block producer rounds.
* *onlinePercentage* - unsigned int; The online percentage.
* *rank* - unsigned int; The delegates current rank.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/us1_xcash_foundation/ -H 'Accept: application/json'
{
  "votes": 100000000,
  "voters": 10,
  "IPAdress": "us1.xcash.foundation",
  "delegateName": "us1_xcash_foundation",
  "publicAddress": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
  "about": "",
  "website": "",
  "team": "",
  "specifications": "",
  "sharedDelegate": false,
  "seedNode": true,
  "online": true,
  "fee": 0,
  "totalRounds": 100,
  "totalBlockProducerRounds": 10,
  "onlinePercentage": 67,
  "rank": 1
}
```

## Delegate Rounds Stats <a href="#delegate-round-stats" id="delegate-round-stats"></a>

This method gets the stats about the blocks the delegate produced

**URL**: [https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/rounds/{delegateName}](https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/rounds/%7BdelegateName%7D)

**Method**: GET

**Resources**:

* *delegateName* - **Required** - The delegate name.

**Inputs**: *None*.

**Results**:

* *totalBlocksProduced* - unsigned int; The total blocks produced by the delegate
* *totalBlockRewards* - unsigned long long; The total xcash from the blocks produced in zachys (atomic units).
* *averagePercentage* - unsigned int; The average the delegate has produced a block. (100 is average, 200 is twice as good etc etc)
* *averageTime* - unsigned int; The average time (in minutes) it takes for the delegate to produce a block.
* *blocksProduced* - an arrray with the following structure:
  * *blockHeight* - unsigned int; The block height.
  * *blockReward* - unsigned long long; The block reward in zachys (atomic units).
  * *time* - unsigned int; The time stamp.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/rounds/us1_xcash_foundation/ -H 'Accept: application/json'
{
  "totalBlocksProduced": 100,
  "totalBlockRewards": 1000000000,
  "averagePercentage": 100,
  "averageTime": 500,
  "blocksProduced": [
    {
      "blockHeight": 810000,
      "blockReward": 100000000,
      "time": 1654228489 
    },
    {
      "blockHeight": 811000,
      "blockReward": 100000000,
      "time": 1654228489
    }
  ]
}
```

## Delegates Votes <a href="#delegates-votes" id="delegates-votes"></a>

This method gets the vote data for a delegate

**URL**: [https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/votes/{delegateName}/{start}/{limit}](https://api.xcash.foundation/v1/xcash/dpops/delegates/votes/%7BdelegateName%7D/%7Bstart%7D/%7Blimit%7D)

**Method**: GET

**Resources**:

* *delegateName* - **Required** - The delegate name.
* *start* - **Required** - The start item to return data (0 is the first item).
* *limit* - **Required** - The maximum amount of items to return (Maximum of 1000).

**Inputs**: *None*.

**Results**:

An array of objects with the following structure:

* *publicAddress* - string; The public address who created the vote.
* *amount* - unsigned long long; The vote amount in zachys (atomic units).
* *reserveProof* - string; The reserve proof.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/delegates/votes/us1_xcash_foundation/1/2/ -H 'Accept: application/json'
[
  {
    "publicAddress": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
    "amount": 1000000000,
    "reserveProof": "ReserveProofV1"
  },
  {
    "publicAddress": "XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf",
    "amount": 1000000000,
    "reserveProof": "ReserveProofV1"
  }
]
```

## Vote Details <a href="#vote-details" id="vote-details"></a>

This method gets the vote data from a specific address

**URL**: [https://api.xcash.foundation/v1/xcash/dpops/unauthorized/votes/{address}](https://api.xcash.foundation/v1/xcash/dpops/unauthorized/votes/%7Baddress%7D)

**Method**: GET

**Resources**:

* *address* - **Required** - The public address.

**Inputs**: *None*.

**Results**:

* *delegateName* - string; The delegate name voted for.
* *amount* - unsigned long long; The vote amount in zachys (atomic units).

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/votes/XCA1a9usG2UKajV1Dqzp8fL1BbN3hzuaaJMYjCo7qDoC4C3Vvc5owiLAqKbVw2cRbwRqx3mgrau1Z7LkX6cxR2NC4ZmFBLe2Mf/ -H 'Accept: application/json'
{
  "delegateName": "us1_xcash_foundation",
  "amount": 1000000000
}
```

## Round Details <a href="#round-details" id="round-details"></a>

This method gets the round details

**URL**: [https://api.xcash.foundation/v1/xcash/dpops/unauthorized/rounds/{blockHeight}](https://api.xcash.foundation/v1/xcash/dpops/unauthorized/rounds/%7BblockHeight%7D)

**Method**: GET

**Resources**:

* *blockHeight* - **Required** - The block height for the round.

**Inputs**: *None*.

**Results**:

An array of delegate names that verified the block

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/rounds/810000/ -H 'Accept: application/json'
{
  "delegates": [
    "us1_xcash_foundation",
    "europe1_xcash_foundation"
  ]
}
```

## Last Block Producer <a href="#last-block-producer" id="last-block-producer"></a>

This method gets the last block producer

**URL**: <https://api.xcash.foundation/v1/xcash/dpops/unauthorized/lastBlockProducer>

**Method**: GET

**Inputs**: *None*.

**Results**:

* *lastBlockProducer* - The last block producer.

```bash
$ curl -X GET https://api.xcash.foundation/v1/xcash/dpops/unauthorized/lastBlockProducer/ -H 'Accept: application/json'
{
  "lastBlockProducer": "us1_xcash_foundation"
}
```
