API Routes

Jump to:

DELETE /staking/ethereum/{chain}/validators/{pubkey}

Deletes a validator

Parameters

Sample request

curl -X DELETE https://api.bloq.com/staking/ethereum/mainnet/validators/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \
  -H 'Authorization: Bearer <auth-token>'

Response

Sample response

Successful response: HTTP 204 No content

GET /staking/ethereum/chains

Retrieves all the chains that are enabled for the protocol

Parameters

curl -X GET https://api.bloq.com/staking/ethereum/chains \
  -H 'Authorization: Bearer <auth-token>'

Response

Sample response

["mainnet"]

GET /staking/ethereum/regions

Retrieves all the regions where validators can be created by the user.

Parameters

Sample request

curl -X GET https://api.bloq.com/staking/ethereum/regions \
  -H 'Authorization: Bearer <auth-token>'

Response

Sample response

["us-east-2"]

GET /staking/ethereum/{chain}/validators

List all user's Ethereum validators.

Parameters

Sample request

curl -X GET https://api.bloq.com/staking/ethereum/mainnet/validators \
  -H 'Authorization: Bearer <auth-token>'

Response

Sample response

[
  {
    "balance": "32000000000000000000",
    "chain": "mainnet",
    "feeAddress": "0x000000000000000000000000000000000000000",
    "id": "mainnet:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "pubkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "region": "us-east-2",
    "startedAt": "2022-11-01T03:56:43.000Z",
    "status": "active",
    "user": "user-00000000-0000-0000-0000-000000000000"
  }
]

GET /staking/ethereum/{chain}/validators/{pubkey}

Returns one validator

Parameters

Sample request

curl -X GET https://api.bloq.com/staking/ethereum/mainnet/validators/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \
  -H 'Authorization: Bearer <auth-token>'

Response

Sample response

{
  "balance": "32000000000000000000",
  "chain": "mainnet",
  "feeAddress": "0x000000000000000000000000000000000000000",
  "id": "mainnet:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "pubkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "region": "us-east-2",
  "startedAt": "2022-11-01T03:56:43.000Z",
  "status": "active",
  "user": "user-00000000-0000-0000-0000-000000000000"
}

PUT /staking/ethereum/{chain}/validators/{pubkey}

Updates the fee address of the validator

Parameters

Sample request

curl -X PUT https://api.bloq.com/staking/ethereum/mainnet/validators/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \
  -H 'Authorization: Bearer <auth-token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "feeAddress": "0x000000000000000000000000000000000000000"
  }'

Response

Sample response

Successful response: HTTP 204 No content

POST /staking/ethereum/{chain}/validators

Create a new Ethereum validator.

To create a mainnet validator using the Ethereum 1.0 withdrawal address, that address shall be supplied. The response will include the data required to create the transaction to deposit the 32 ETH in the Ethereum 2.0 deposit contract.

Request

Sample request

To use the the Ethereum 1.0 withdrawal address (#1) method:

curl -X POST https://api.bloq.com/staking/ethereum/mainnet/validators \
  -H 'Authorization: Bearer <auth-token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "withdrawalAddress": "0x000000000000000000000000000000000000000"
  }'

Response

Sample response

Successful response:

{
  "balance": "32000000000000000000",
  "chain": "mainnet",
  "pubkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "region": "us-east-2",
  "status": "pending",
  "depositData": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000008000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000008000000000"
}

GET /staking/ethereum/{chain}/validators/{pubkey}/performance

List performance metrics of the validator.

Parameters

Sample request

curl -X GET https://api.bloq.com/staking/ethereum/mainnet/validators/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/performance \
  -H 'Authorization: Bearer <auth-token>'

Response

Sample response

{
  "apr": 3.42,
  "balance": "32277007585000000000",
  "chain": "mainnet",
  "consensusApr": 3.3,
  "effectiveBalance": "32000000000000000000",
  "executionApr": 0.12,
  "pubkey": "9426757d7db19ce59bd7936bde95a97607199dbb412a5708fdf2f1da029c59d7d72ca1d3c01f05c96f9270df59083bff"
}

POST /staking/ethereum/{chain}/validators/{pubkey}/validatorExit

Initiates the validator exit process to withdraw the staked balance of the validator. Initiating an exit operation is not a "formal transaction" on the Ethereum network. The exit request is sent via Bloq API (using your Bloq authentication keys), and the exit operation starts immediately.

NOTE: The API call is not stored and cannot be reversed.

Parameters

curl -X POST https://api.bloq.com/staking/ethereum/mainnet/validators/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/validatorExit \
  -H "Authorization: Bearer <AUTH_TOKEN>" \
  -H 'Content-Type: application/json' \
  -d '{
        "confirmationDate": "2023-02-01T09:08:07.060Z",
        "confirmationSignature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      }'

Response

Sample response

Successful response: HTTP 204 No content

GET /staking/ethereum/{chain}/stats

Return stats for a specific chain.

Parameters

Sample request

curl -X GET https://api.bloq.com/staking/ethereum/mainnet/stats \
  -H 'Authorization: Bearer <auth-token>'

Response

Sample response

{
  "apr": 3.42,
  "chain": "mainnet",
  "consensusApr": 3.4,
  "executionApr": 0.02
}

GET staking/ethereum/validators/report

Returns a csv report with all the validators associated to the account.

Parameters

curl -X GET "https://api.bloq.com/staking/ethereum/validators/report" \
  -H 'Authorization: Bearer <auth-token>'

Response

The content type of the response is text/csv. The headers are:

GET /staking/ethereum/billing/report

Returns billing data for all the validators of the organization, grouped per user, in a date range. Requires the role auditor or billing.

Parameters

Sample request

curl -X GET "https://api.bloq.com/staking/ethereum/billing/report?fromDate=0000-00-00&toDate=0000-00-00" \
  -H 'Authorization: Bearer <auth_token>'

Response

If the accept header is application/json

Sample response

[
  {
    "organization": "org-0000000-0000-0000-0000-000000000000",
    "organizationName": "My organization",
    "reportFrom": "2023-01-17",
    "reportTo": "2023-02-16",
    "user": "user-00000000-0000-0000-0000-000000000000",
    "userEmail": "user@bloq.com",
    "userName": "user name",
    "validatorsPerChain": [
      {
        "chain": "mainnet",
        "consensusPenalties": "0",
        "consensusRewards": "2114557999950000",
        "executionPenalties": "5000",
        "executionRewards": "55000",
        "fees": "169164640000000",
        "penalties": "5000",
        "rewards": "2114558000000000",
        "rewardsAfterFees": "1945393360000000",
        "totalActiveValidators": 1,
        "totalCurrentValidators": 1,
        "totalInactiveValidators": 1,
        "totalWeightedValidators": 1,
        "validatorsActive": [
          {
            "activeDays": 30,
            "balance": "32119059422000000000",
            "consensusPenalties": "0",
            "consensusRewards": "2114557999950000",
            "createdAt": "2022-09-02T00:00:00.000Z",
            "effectiveBalance": "32000000000000000000",
            "executionPenalties": "5000",
            "executionRewards": "55000",
            "fees": "169164640000000",
            "penalties": "5000",
            "pubkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "rewards": "2114558000000000",
            "rewardsAfterFees": "1945393360000000",
            "runningDays": 125,
            "slashed": false
          }
        ],
        "validatorsInactive": [
          {
            "balance": "1",
            "createdAt": "2022-10-10T00:00:00.000Z",
            "pubkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
            "runningDays": 87,
            "slashed": false
          }
        ]
      }
    ]
  }
]

If the accept header is text/csv

Sample response

activeDays,balance,chain,consensusPenalties,consensusRewards,createdAt,effectiveBalance,executionPenalties,executionRewards,fees,organization,organizationName,penalties,pubkey,reportFrom,reportTo,rewards,rewardsAfterFees,runningDays,slashed,user,userEmail,userName
30,32119059422000000000,mainnet,0,2114557999950000,2022-09-02T00:00:00.000Z,32000000000000000000,5000,55000,169164640000000,org-0000000-0000-0000-0000-000000000000,My organization,5000,000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,2023-01-17,2023-02-16,2114558000000000,1945393360000000,125,false,user-00000000-0000-0000-0000-000000000000,user@bloq.com,user name
,1,mainnet,,,2022-10-10T00:00:00.000Z,,,,,org-0000000-0000-0000-0000-000000000000,My organization,,000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,2023-01-17,2023-02-16,,,87,false,user-00000000-0000-0000-0000-000000000000,user@bloq.com,user name

Error responses

All error responses are JSON objects that loosely follow the RFC 7807 specification.

{
  "status": 403,
  "title": "Forbidden",
  "detail": "The authorization token is expired."
}

Last updated