Search…
⌃K

API Routes

Jump to:

GET /staking/ethereum/regions

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

Parameters

Name
In
Type
Required
Description
Authorization
header
string
yes
The authentication token.
Sample request
curl -X GET https://api.bloq.com/staking/ethereum/regions \
-H 'Authorization: Bearer <auth-token>'

Response

Status
Description
200
The list was retrieved.
401
No authentication header found.
403
The authorization token is invalid.
Property
Type
Description
(root)
array
The response.
[]
string
The name of the region.
Sample response
["us-east-2"]

GET /staking/ethereum/{chain}/validators

List all user's Ethereum validators.

Parameters

Name
In
Type
Required
Description
chain
path
string
yes
The validators chain.
Authorization
header
string
yes
The authentication token.
Sample request
curl -X GET https://api.bloq.com/staking/ethereum/mainnet/validators \
-H 'Authorization: Bearer <auth-token>'

Response

Status
Description
200
The list was retrieved.
403
The authorization token is invalid.
Property
Type
Description
(root)
array
The response.
[].account
string
The address of the user.
[].balance
string | null
The ETH balance, expressed in Wei. Returns null if there is a failure while retrieving the balance.
[].chain
string
The validator chain.
[].feeAddress
string | undefined
The fee address of the validator.
[].depositData
string | undefined
The deposit transaction data.
[].pubkey
string
The public address of the validator.
[].region
string
The region where the validator was created.
[].status
string
The status: active_online, pending or unknown (when there is a failure getting the status).
[].withdrawalAddress
string | undefined
The withdrawal address of the validator.
Sample response
[
{
"account": "0x000000000000000000000000000000000000000",
"balance": "32000000000000000000",
"chain": "mainnet",
"feeAddress": "0x000000000000000000000000000000000000000",
"pubkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"region": "us-east-2",
"status": "active"
}
]

POST /staking/ethereum/{chain}/validators

Create a new Ethereum validator.
To create a mainnet validator using the Ethereum 1.0 withdrawal address (#1), 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.
To create a mainnet validator using the mnemonic and Ethereum 2.0 addresses (#2), the validator keystore and the validator keystore password are required. Those two are created by the user with i.e. the staking_deposit-cli. Note that the deposit of 32 ETH into the Ethereum 2.0 deposit contract should have been done in advance.
If both the withdrawal address and the validator keystore are specified, the request will be considered invalid.

Request

Name
In
Type
Required
Description
chain
path
path
yes
The validator chain.
Authorization
header
string
yes
The authentication token.
.feeAddress
body
string
no
The fee address of the validator.
.keystore
body
object
yes (#2)
The validator keystore object.
.password
body
string
yes (#2)
The validator keystore password.
.region
body
string
no
The AWS region. Defaults to us-east-2.
.withdrawalAddress
body
string
yes (#1)
The withdrawal address of the validator.
Sample requests
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"
}'
To use the mnemonic and Ethereum 2.0 addresses (#2) method:
curl -X POST https://api.bloq.com/staking/ethereum/mainnet/validators \
-H 'Authorization: Bearer <auth-token>' \
-H 'Content-Type: application/json' \
-d '{
"keystore": {
"crypto": {...},
"path": "m/12381/3600/0/0/0",
"pubkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"version": 4
},
"password": "xxxx"
}'

Response

Status
Description
200
The validator was created.
400
The validator type, chain or call payload is incorrect.
403
The authorization token is invalid.
409
Another validator with the same pubkey already exists.
Property
Type
Description
(root)
object
The validator data.
.balance
string | null
The ETH balance.
.chain
string
The validator chain.
.depositData
string | undefined
The deposit transaction data when using method #1.
.feeAddress
string | undefined
The fee address of the validator.
.pubkey
string
The public address of the validator.
.region
string
The validator region.
.status
string
The status: deposited, pending, active, exited.
.withdrawalAddress
string | undefined
The withdrawal address of the validator.
Sample responses
Successful response:
{
"balance": "32000000000000000000",
"chain": "mainnet",
"pubkey": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"region": "us-east-2",
"status": "pending",
"depositData": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000008000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000008000000000"
}

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."
}

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

List performance metrics of the validator.

Parameters

Name
In
Type
Required
Description
chain
path
string
yes
The validators chain.
pubkey
path
string
yes
The public address of the validator.
Authorization
header
string
yes
The authentication token.
includeServiceFee
query string
bool
no
Whether to include the service fee or not to calculate the metrics.
Sample request
curl -X GET https://api.bloq.com/staking/ethereum/mainnet/validators/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/performance \
-H 'Authorization: Bearer <auth-token>'

Response

Status
Description
200
The list was retrieved.
403
The authorization token is invalid.
404
The validator was not found.
Property
Type
Description
(root)
object
The response.
.apr
string
The APR of the validator, real or annualized if the validator is less than one year. Formatted in 2 decimals.
.balance
string | null
The ETH balance, expressed in Wei. Returns null if there is a failure while retrieving the balance.
.chain
string
The validator chain.
.effectiveBalance
string | null
The ETH balance, expressed in Wei, that is used to calculate rewards. Returns null if there is a failure while retrieving this value.
.performance1d
string | undefined
The rewards in the last day, expressed in Wei. Available if the validator is older than 1 day.
.performance7d
string | undefined
The rewards in the last 7 days, expressed in Wei. Available if the validator is older than 7 days.
.performance31d
string | undefined
The rewards in the last 31 days, expressed in Wei. Available if the validator is older than 31 days.
.performance365d
string | undefined
The rewards in the last 365 days, expressed in Wei. Available if the validator is older than 365 days.
.pubkey
string
The public address of the validator.
Sample response
{
"apr": "3.42",
"balance": "32277007585000000000",
"chain": "mainnet",
"effectiveBalance": "32000000000000000000",
"performance1d": "3291254000000000",
"performance7d": "23097603000000000",
"pubkey": "9426757d7db19ce59bd7936bde95a97607199dbb412a5708fdf2f1da029c59d7d72ca1d3c01f05c96f9270df59083bff"
}

GET /staking/ethereum/{chain}/stats

Return stats for a specific chain.

Parameters

Name
In
Type
Required
Description
chain
path
string
yes
The validators chain.
Authorization
header
string
yes
The authentication token.
includeServiceFee
query string
bool
no
Whether to include the service fee or not to calculate the metrics.
Sample request
curl -X GET https://api.bloq.com/staking/ethereum/mainnet/stats
-H 'Authorization: Bearer <auth-token>'

Response

Status
Description
200
The stats were retrieved.
403
The authorization token is invalid.
Property
Type
Description
(root)
object
The response.
.apr
string
The APR of the chain. Formatted in 2 decimals
.chain
string
The chain.
Sample response
{
"apr": "3.42",
"chain": "mainnet"
}

GET staking/ethereum/validators/report

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

Parameters

Name
In
Type
Required
Description
Authorization
header
string
yes
The authentication token.
curl -X GET https://api.bloq.com/staking/ethereum/validators/report
-H 'Authorization: Bearer <auth-token>'

Response

Status
Description
200
The stats were retrieved.
403
The authorization token is invalid.
The content type of the response is text/csv. The headers are:
Property
Type
Description
account
string
The address of the user
apr
string
APR of the validator
balance
string
The ETH balance, expressed in Wei.
chain
string
The validators chain
effectiveBalance
string
The ETH balance, expressed in Wei, that is used to calculate rewards.
feeAddress
string
The fee address of the validator.
performance1d
string
The rewards in the last day, expressed in Wei.
performance7d
string
The rewards in the last 7 days, expressed in Wei.
performance31d
string
The rewards in the last 31 days, expressed in Wei.
performance365d
string
The rewards in the last 365 days, expressed in Wei.
pubkey
string
The public address of the validator.
region
string
The AWS region of the validator
status
string
The status: active_online, pending or unknown (when there is a failure getting the status).

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."
}