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/chain identifier1

X-NETWORK header

Set the X-NETWORK header to the StakeWise chain you want to target.

warning

Supported values: 1 (Ethereum Mainnet) and 560048 (Ethereum Hoodi).

When omitted the API falls back to the default StakeWise network configured for your account.

List available networks

Use this helper endpoint to discover which StakeWise networks are currently enabled for your API key.

  • Endpoint: /api/v1/ethereum/stakewise/networks

Response payload fields:

FieldTypeRequiredDescription
namestringInternal blockchain entry name
typestringBlockchain type string (always ETHEREUM)
chain_idstringChain identifier such as 1 or 560048
is_defaultbooleantrue when the network is used as fallback

Example

curl "https://staking-api.stakely.io/api/v1/ethereum/stakewise/networks" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1"

Response:

[
{
"name": "ethereum",
"type": "ETHEREUM",
"chain_id": "1",
"is_default": true
}
]

Stake into stakewise vault

Craft a stake transaction:

  • Endpoint: /api/v1/ethereum/stakewise/action/stake

Description

This endpoint will craft a stake transaction ready to be signed.

Request body parameters

FieldTypeRequiredDescription
addressstringEth address that will perform the staking action
amountnumberAmount of stake to perform in eth units

Returned

FieldTypeRequiredDescription
serialized_tx_hexstringSerialized transaction hex string ready to be signed
unsigned_tx_hash_hexstringUnasigned tx hash hex string, ready to be signed by external integrations
payloadobjectPayload object

Example

curl -X POST "https://staking-api.stakely.io/api/v1/ethereum/stakewise/action/stake" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1" \
-H "Content-Type: application/json" \
-d '{
"address": "0x0e79065B5F11b5BD1e62B935A600976ffF3754B9",
"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": "0x18f729500000000000000000000000000e7906...1d1c666802bd",
"gasPrice": "0x2887734d"
}
}

Unstake action

Craft a unstake transaction

  • Endpoint: /api/v1/ethereum/stakewise/action/unstake

Description

This endpoint will build an "enter exit queue" unstake transaction ready to be signed. The exited assets needs to mature for a given period before there are claimable

Request param

FieldTypeRequiredDescription
addressstringEth address that will perform the staking action
amountnumberAmount of stake to perform in eth units

Returned

FieldTypeRequiredDescription
serialized_tx_hexstringSerialized transaction hex string ready to be signed
unsigned_tx_hash_hexstringUnasigned tx hash hex string, ready to be signed by external integrations
payloadobjectPayload object

Example

curl -X POST "https://staking-api.stakely.io/api/v1/ethereum/stakewise/action/unstake" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1" \
-H "Content-Type: application/json" \
-d '{
"address": "0x0e79065B5F11b5BD1e62B935A600976ffF3754B9",
"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": "0x18f729500000000000000000000000000e7906...1d1c666802bd",
"gasPrice": "0x2887734d"
}
}

Withdraw action

Craft a withdraw transaction

  • Endpoint: /api/v1/ethereum/stakewise/action/withdraw

Description

Once the assets in queue are ready to be claimable you can claim them. This action will craft a withdraw transaction of the withdrawable assets.

FieldTypeRequiredDescription
addressstringEth address that will perform the staking action

Returned

FieldTypeRequiredDescription
serialized_tx_hexstringSerialized transaction hex string ready to be signed
unsigned_tx_hash_hexstringUnasigned tx hash hex string, ready to be signed by external integrations
payloadobjectPayload object

Example

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

Response:

{
"address": "0x0e79065B5F11b5BD1e62B935A600976ffF3754B9",
"amount": 0.1
}

Prepare action

Gathers signature and unsigned tx:

  • Endpoint: /api/v1/ethereum/stakewise/action/prepare

Description

Prepare a signed transaction by gathering the provided signatures with the unsigned transaction hex string:

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/ethereum/stakewise/action/prepare" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1" \
-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 a signed transaction

  • Endpoint: /api/v1/ethereum/stakewise/action/broadcast

Description

Broadcast a signed transaction. Usually you will brodcast the signed transaction returned in prepare previous 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/ethereum/stakewise/action/broadcast" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1" \
-H "Content-Type: application/json" \
-d '{
"signed_tx_hex": "0xf9014b1f8455bd900c83030d4094169856275d...ad908c2b5b15"
}'

Response:

{
"tx_hash": "0x23273dacef9d64fdb2c790e9f9f4c13574125078a272059dac2473bc8bfba163"
}

Action history

Get the StakeWise action history for the given address

  • Endpoint: /api/v1/ethereum/stakewise/historic/{address}

Description

Get the StakeWise action history for the given address. It returns all past actions of the different action kinds.

Request parameters

ParameterInTypeRequiredDescription
addresspathstringAddress to retrieve action history for

Returned

Array of StakewiseGetActionResponseDto items:

FieldTypeRequiredDescription
idstringEvent identifier
assetsstringTransaction amount assets in eth units
sharesstringTransaction amount shares in eth units
actionTypestringStakewise vault action type
linkstringTransaction explorer link
createdAtnumberTransaction date in unix timestamp format (ms)

Example

curl "https://staking-api.stakely.io/api/v1/ethereum/stakewise/historic/0xb794f5ea0ba39494ce839613fffba74279579268" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1"

Response:

[
{
"id": "0xe08ff6b0c57162c32feebde105af11c7ad14f8aa068140271d393128eee5076e-53",
"assets": "0.01",
"shares": "0.009990742171519222",
"actionType": "03b8ef9558b9a2d9f2d4c1f4f8bafce1a6df628d6c521474d6823b6e3223d9e8af",
"link": "https://holesky.etherscan.io/tx/0xe08ff6...3128eee5076e",
"createdAt": 1713279456000
}
]

Stake balance

Get stakewise stake balance for the given address

  • Endpoint: /api/v1/ethereum/stakewise/stake-balance/{address}

Description

Get stakewise stake balance for the given address.

Request parameters

ParameterInTypeRequiredDescription
addresspathstringAddress to query stake balance for

Returned

FieldTypeRequiredDescription
sharesnumberBalance in vault tokens in ETH
assetsnumberBalance in ETH

Example

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

Response:

{
"shares": 0.445154555310375,
"assets": 0.4465649642705789
}

Exited balance

Get stakewise exited balance for the given address

  • Endpoint: /api/v1/ethereum/stakewise/exited-balance/{address}

Description

Get stakewise exited balance for the given address.

Request parameters

ParameterInTypeRequiredDescription
addresspathstringAddress to query exited balance for

Returned

FieldTypeRequiredDescription
totalnumberTotal withdrawal amount (in ETH) by address in the vault
withdrawablenumberAmount available for withdrawal (in ETH) by address in the vault

Example

curl "https://staking-api.stakely.io/api/v1/ethereum/stakewise/exited-balance/0xb794f5ea0ba39494ce839613fffba74279579268" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1"

Response:

{
"total": 0.5,
"withdrawable": 0.1
}

Vault info

Get stakewise vault info such as APY and balance for the current time

  • Endpoint: /api/v1/ethereum/stakewise/vault

Description

Get vault details, as current APY

Returned

FieldTypeRequiredDescription
vaultAddressstringVault address
apynumberCurrent APY of the vault

Example

curl "https://staking-api.stakely.io/api/v1/ethereum/stakewise/vault" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1"

Response:

{
"vaultAddress": "0x1234567890123456789012345678901234567890",
"apy": 5.6
}

User Stats

Get user stats for the StakeWise vault over the last N days

  • Endpoint: /api/v1/ethereum/stakewise/stats/{address}

Description

Get historical user stats for the StakeWise vault over the last N days. Use the days query parameter to set the window.

Request parameters

ParameterInTypeRequiredDescription
addresspathstringAddress to query stats for
daysquerynumberNumber of days to retrieve stats for, if not provided 7 days will be used as default

Returned

Array of StakewiseGetUserStatsResponseDto items:

FieldTypeRequiredDescription
timenumberDate and time for each data point
balancenumberTotal assets by the user in current vault at the moment of time
apynumberCurrent APY based on time, rewards and balance
rewardsnumberNumber of assets earned by the user in current vault during the interval

Example

curl "https://staking-api.stakely.io/api/v1/ethereum/stakewise/stats/0xb794f5ea0ba39494ce839613fffba74279579268" \
-H "X-API-KEY: $STAKELY_API_KEY" \
-H "X-NETWORK: 1"

Response:

[
{
"time": 1713279456000,
"balance": 10.5,
"apy": 5.6,
"rewards": 0.01
}
]