Skip to main content

Endpoints

API Usage

Once you have access to the Staking API with a validated user and existing API keys, you can start using this service.

Try it live

tip

Every endpoint on this page can be executed from the interactive Swagger console, using your own X-API-KEY.

The machine-readable OpenAPI schema is available at:

Authentication

In order to use the Staking API endpoints you need to include your API KEY.

tip

Heads up! To obtain a valid API key required for authentication, please refer to the Authentication > Create API keys section of the documentation.

Header:

NameDescriptionExample valueRequired
X-API-KEYYour api key value<API_KEY_VALUE>
X-NETWORKBlockchain network identifier1672

X-NETWORK header

Use the X-NETWORK header to select the Pharos network. For Pharos mainnet, the chain ID is typically 1672 (confirm with the networks endpoint below).

info

If you omit the header the API falls back to the default Pharos network configured for your account.

tip

Need another Pharos environment exposed? Let us know at [email protected].

List available networks

Use this helper endpoint to obtain the list of Pharos staking networks that are currently enabled for your API key.

  • Endpoint: /api/v1/pharos/native/networks

Response payload: array of NetworkResponseDto items:

FieldTypeRequiredDescription
namestringInternal blockchain entry name
typestringBlockchain type string (typically ETHEREUM)
chain_idstringChain identifier to use as X-NETWORK
is_defaultbooleantrue when this network is used as fallback

Example

curl "https://staking-api.stakely.io/api/v1/pharos/native/networks" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672"

Response:

[
{
"name": "pharos",
"type": "ETHEREUM",
"chain_id": "1672",
"is_default": true
}
]

Delegate action

Craft a delegate transaction:

  • Endpoint: /api/v1/pharos/native/action/delegate

Description

This endpoint crafts a delegate transaction ready to be signed. The transaction delegates the specified amount (native token, 18 decimals) from address to the validator pool.

Request body parameters

FieldTypeRequiredDescription
addressstringAddress that will perform the delegation
amountnumberAmount to delegate in native token (18 decimals)

Returned

FieldTypeRequiredDescription
serialized_tx_hexstringSerialized transaction hex string ready to be signed
unsigned_tx_hash_hexstringUnsigned tx hash hex string used for offline signing integrations
payloadobjectTransaction payload object

Example

curl -X POST "https://staking-api.stakely.io/api/v1/pharos/native/action/delegate" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672" \
-H "Content-Type: application/json" \
-d '{
"address": "0xb794f5ea0ba39494ce839613fffba74279579268",
"amount": 0.1
}'

Response:

{
"serialized_tx_hex": "03b8ef9558b9a2d9f2d4c1f4f8bafce1a6df628d6c521474d6823b6e3223d9e8af",
"unsigned_tx_hash_hex": "1a6edb7358323bafca52b1755f3ad985754dc23887110b65429373ed83321500",
"payload": {
"type": "0x0",
"nonce": "0x5fe08",
"gasLimit": "0x30d40",
"to": "0x169856275ddca01b2fcdc63c4f1b0adf72a4cf10",
"value": "0x16345785d8a0000",
"data": "0x18f72950...",
"gasPrice": "0x2887734d"
}
}

Undelegate action

Craft an undelegate transaction:

  • Endpoint: /api/v1/pharos/native/action/undelegate

Description

This endpoint crafts an undelegate transaction ready to be signed. It exits the delegator’s effective stake for the given address. Principal becomes withdrawable only after the protocol 84-epoch withdraw window.

Request body parameters

FieldTypeRequiredDescription
addressstringAddress that will perform the undelegation

Returned

FieldTypeRequiredDescription
serialized_tx_hexstringSerialized transaction hex string ready to be signed
unsigned_tx_hash_hexstringUnsigned tx hash hex string used for offline signing integrations
payloadobjectTransaction payload object

Example

curl -X POST "https://staking-api.stakely.io/api/v1/pharos/native/action/undelegate" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672" \
-H "Content-Type: application/json" \
-d '{
"address": "0xb794f5ea0ba39494ce839613fffba74279579268"
}'

Response:

{
"serialized_tx_hex": "03b8ef9558b9a2d9f2d4c1f4f8bafce1a6df628d6c521474d6823b6e3223d9e8af",
"unsigned_tx_hash_hex": "1a6edb7358323bafca52b1755f3ad985754dc23887110b65429373ed83321500",
"payload": {
"type": "0x0",
"nonce": "0x5fe08",
"gasLimit": "0x30d40",
"to": "0x169856275ddca01b2fcdc63c4f1b0adf72a4cf10",
"value": "0x16345785d8a0000",
"data": "0x18f72950...",
"gasPrice": "0x2887734d"
}
}

Withdraw action

Craft a withdraw (claimStake) transaction:

  • Endpoint: /api/v1/pharos/native/action/withdraw

Description

Once principal has passed the unlock period, this action crafts a transaction to withdraw completed unstake back to the wallet. If nothing is withdrawable or funds are still locked, the API returns a validation error.

Request body parameters

FieldTypeRequiredDescription
addressstringAddress that will withdraw completed unstake

Returned

FieldTypeRequiredDescription
serialized_tx_hexstringSerialized transaction hex string ready to be signed
unsigned_tx_hash_hexstringUnsigned tx hash hex string used for offline signing integrations
payloadobjectTransaction payload object

Example

curl -X POST "https://staking-api.stakely.io/api/v1/pharos/native/action/withdraw" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672" \
-H "Content-Type: application/json" \
-d '{
"address": "0xb794f5ea0ba39494ce839613fffba74279579268"
}'

Response:

{
"serialized_tx_hex": "03b8ef9558b9a2d9f2d4c1f4f8bafce1a6df628d6c521474d6823b6e3223d9e8af",
"unsigned_tx_hash_hex": "1a6edb7358323bafca52b1755f3ad985754dc23887110b65429373ed83321500",
"payload": {
"type": "0x0",
"nonce": "0x5fe08",
"gasLimit": "0x30d40",
"to": "0x169856275ddca01b2fcdc63c4f1b0adf72a4cf10",
"value": "0x16345785d8a0000",
"data": "0x18f72950...",
"gasPrice": "0x2887734d"
}
}

Claim rewards action

Craft a claim rewards transaction:

  • Endpoint: /api/v1/pharos/native/action/claim-rewards

Description

This endpoint crafts a claim rewards transaction ready to be signed. It transfers accumulated staking rewards for the delegator address.

Request body parameters

FieldTypeRequiredDescription
addressstringAddress that will claim rewards

Returned

FieldTypeRequiredDescription
serialized_tx_hexstringSerialized transaction hex string ready to be signed
unsigned_tx_hash_hexstringUnsigned tx hash hex string used for offline signing integrations
payloadobjectTransaction payload object

Example

curl -X POST "https://staking-api.stakely.io/api/v1/pharos/native/action/claim-rewards" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672" \
-H "Content-Type: application/json" \
-d '{
"address": "0xb794f5ea0ba39494ce839613fffba74279579268"
}'

Response:

{
"serialized_tx_hex": "03b8ef9558b9a2d9f2d4c1f4f8bafce1a6df628d6c521474d6823b6e3223d9e8af",
"unsigned_tx_hash_hex": "1a6edb7358323bafca52b1755f3ad985754dc23887110b65429373ed83321500",
"payload": {
"type": "0x0",
"nonce": "0x5fe08",
"gasLimit": "0x30d40",
"to": "0x169856275ddca01b2fcdc63c4f1b0adf72a4cf10",
"value": "0x16345785d8a0000",
"data": "0x18f72950...",
"gasPrice": "0x2887734d"
}
}

Compound rewards action

Craft a compound rewards transaction:

  • Endpoint: /api/v1/pharos/native/action/compound-rewards

Description

This endpoint crafts a compound rewards transaction ready to be signed. It reinvests claimable rewards into the active stake for the delegator address.

Request body parameters

FieldTypeRequiredDescription
addressstringAddress that will compound rewards

Returned

FieldTypeRequiredDescription
serialized_tx_hexstringSerialized transaction hex string ready to be signed
unsigned_tx_hash_hexstringUnsigned tx hash hex string used for offline signing integrations
payloadobjectTransaction payload object

Example

curl -X POST "https://staking-api.stakely.io/api/v1/pharos/native/action/compound-rewards" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672" \
-H "Content-Type: application/json" \
-d '{
"address": "0xb794f5ea0ba39494ce839613fffba74279579268"
}'

Response:

{
"serialized_tx_hex": "03b8ef9558b9a2d9f2d4c1f4f8bafce1a6df628d6c521474d6823b6e3223d9e8af",
"unsigned_tx_hash_hex": "1a6edb7358323bafca52b1755f3ad985754dc23887110b65429373ed83321500",
"payload": {
"type": "0x0",
"nonce": "0x5fe08",
"gasLimit": "0x30d40",
"to": "0x169856275ddca01b2fcdc63c4f1b0adf72a4cf10",
"value": "0x16345785d8a0000",
"data": "0x18f72950...",
"gasPrice": "0x2887734d"
}
}

Prepare action

After signing unsigned_tx_hash_hex, call the Pharos prepare endpoint:

  • Endpoint: /api/v1/pharos/native/action/prepare

Description

Prepare a signed transaction by combining the provided signatures (r, s, v) with the unsigned transaction hex from the crafting response.

Request body parameters

FieldTypeRequiredDescription
serialized_tx_hexstringUnsigned serialized transaction hex string ready to be signed
rstringr part of the ECDSA signature in hex
sstrings part of the ECDSA signature in hex
vnumberv part of the ECDSA signature

Returned

FieldTypeRequiredDescription
signed_tx_hexstringSigned transaction hex string ready to be broadcasted

Example

curl -X POST "https://staking-api.stakely.io/api/v1/pharos/native/action/prepare" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672" \
-H "Content-Type: application/json" \
-d '{
"serialized_tx_hex": "03b8ef9558b9a2d9f2d4c1f4f8bafce1a6df628d6c521474d6823b6e3223d9e8af",
"r": "6da2b6fe309b629720bc3d1d3a8befb3f461e3b53ccee85c55d10b11d3a3d263",
"s": "085fe4bb8ff0c04e4e41a2ba44609f894b9a70f4330de726d1403ee21b65e685",
"v": 34035
}'

Response:

{
"signed_tx_hex": "0xf9014b1f8455bd900c83030d4094169856275d...ad908c2b5b15"
}

Broadcast action

Broadcast the signed transaction:

  • Endpoint: /api/v1/pharos/native/action/broadcast

Description

Broadcast a signed transaction. Typically you broadcast the hex returned from the prepare step.

Request body parameters

FieldTypeRequiredDescription
signed_tx_hexstringSigned transaction hex string ready to be broadcasted

Returned

FieldTypeRequiredDescription
tx_hashstringTransaction hash of the broadcasted transaction

Example

curl -X POST "https://staking-api.stakely.io/api/v1/pharos/native/action/broadcast" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672" \
-H "Content-Type: application/json" \
-d '{
"signed_tx_hex": "0xf9014b1f8455bd900c83030d4094169856275d...ad908c2b5b15"
}'

Response:

{
"tx_hash": "0x23273dacef9d64fdb2c790e9f9f4c13574125078a272059dac2473bc8bfba163"
}

Stake balance

Get stake balance for the given address:

  • Endpoint: /api/v1/pharos/native/stake-balance/{address}

Description

Returns a breakdown of stake and rewards for the delegator. All numeric fields are decimal strings in native token units (18 decimals).

Request parameters

ParameterInTypeRequiredDescription
addresspathstringDelegator EVM address to query

Returned

FieldTypeRequiredDescription
pendingStakestringPending stake (activation), decimal string
stakestringActive stake (including eligible pending activation), decimal string
pendingUnstakestringAmount in undelegation / lock period (84 epochs by default), decimal string
pendingWithdrawStakestringAmount withdrawable after unlock epoch, decimal string
rewardsstringClaimable rewards, decimal string

Example

curl "https://staking-api.stakely.io/api/v1/pharos/native/stake-balance/0xb794f5ea0ba39494ce839613fffba74279579268" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1672"

Response:

{
"pendingStake": "0.0",
"stake": "1.5",
"pendingUnstake": "0.0",
"pendingWithdrawStake": "0.0",
"rewards": "0.01"
}