It's easy to use the Blockdaemon Staking API. Follow the steps in this page to get started.
The Blockdaemon Staking API provides developers with a unified platform to interact with blockchain networks and perform various staking-related operations. These operations include provisioning validators, delegating and undelegating tokens, and more. The Staking API leverages smart contracts and batching to reduce manual effort.
Follow the steps below to get started with the Staking API.
Step 1. Get an API Key
You need to get an API key to start using the Staking API. If you don't have one, you can get it by contacting our sales team and registering for a Staking account.
Need a Staking API key?
Simplify Institutional Crypto Staking with the Blockdaemon Staking API.
Step 2. Generate Your Staking API Key
- Select Staking APIs from the app's left-hand menu.
- Click the Create API Key button to initiate key creation.
- A pop-up window will appear, enter a "Key Name".
- Key names must be unique.
- Key names must be at least 3 characters long and max 30 characters.
- Only alphanumeric characters and spaces are allowed.
Info:
This key will not be able to exit ETH validators.
- Click Create to generate your new API key.
- A new API key will be generated. Copy and store the key.
Step 3. Authenticate Your Request
After you get your API key, you can use it to authenticate your requests. There are three methods to authenticate Staking API requests. Here’s a quick overview of each.
3.1. Using Your API Key as a Query Parameter
To authenticate a Staking API request, you can use your API key as a query parameter:
- parameter:
apiKey
- value:
YOUR_API_KEY
Add ?apiKey=YOUR_API_KEY
to the end of the Staking API endpoint. For example, to retrieve details of a stake by stake ID, use:
https://svc.blockdaemon.com/boss/v1/stakes/{stake_id}?apiKey=YOUR_API_KEY
You can use this method with any tool without needing extra steps.
Info:
If the URL already has other parameters, replace
?
with&
.
3.2. Using Your API Key as a Bearer Token
You can authenticate DeFi API requests by using YOUR_API_KEY
as a bearer token in the authorization header. Here’s how to do it in cURL and Postman.
- Bearer Token in cURL
To set your API key as a bearer token in cURL, use this command:
--header 'Authorization: Bearer YOUR_API_KEY'
For example, to get details of a stake, use the following code:
curl --request GET 'https://svc.blockdaemon.com/boss/v1/stakes/{stake_id}' \
--header 'Authorization: Bearer YOUR_API_KEY'
Alternatively, with short options:
curl -X GET 'https://svc.blockdaemon.com/boss/v1/stakes/{stake_id}' \
-H 'Authorization: Bearer YOUR_API_KEY'
- Bearer Token in Postman
To use your API key as a bearer token in Postman:
- Go to the Authorization or Auth tab.
- Select Bearer Token from the Type drop-down menu.
- Paste your API key into the Token field.
3.3. Using Your API Key as an X-API-Key
You can authenticate DeFi API requests by including your API key in the X-API-Key
header. Here’s how to do it in cURL and Postman.
- X-API-Key in cURL
To set your API key as an X-API-Key
in cURL, use:
--header 'X-API-Key: YOUR_API_KEY'
For example, to retrieve details of a stake using, use the following code:
curl --request GET 'https://svc.blockdaemon.com/boss/v1/stakes/{stake_id}' \
--header 'X-API-KEY: YOUR_API_KEY'
Alternatively, with short options:
curl -X GET 'https://svc.blockdaemon.com/boss/v1/stakes/{stake_id}' \
-H 'X-API-KEY: YOUR_API_KEY'
- X-API-Key in Postman
To use your API key as an X-API-Key
in Postman:
- Go to the Authorization or Auth tab.
- Select API Key from the Type drop-down menu.
- Paste your API key into the Value field.
- Ensure the Add to option is set to Header.
Step 4. Start Staking Using the API
Check out our Staking APIs docs to access staking information across multiple protocols and streamline institutional staking.
Copy the code snippet to the terminal of your choice or any API platform such as Postman and start staking.
Note:
You can't run the Staking endpoints directly in the docs but can view its details.
Step 5. Get the Result
Your request will be authorized if your API key is correct. For example, the requests from the Solana - Post Stake Intent returns the details of the stake ID as shown below.
{
"stake_intent_id": "stake_intent_Wgx98Rbi8nQuL9ddn3mTk1",
"customer_id": "SatoshiNakamoto-xUYJbPw9hw",
"plan_id": "plan_Wgx98Rbi8nQuL9ddn3mTk1",
"protocol": "solana",
"network": "mainnet",
"solana": {
"stake_id": "stake_Wgx98Rbi8nQuL9ddn3mTk1",
"amount": "100",
"validator_public_key": "0xa1d1ad0714035353258038e964ae9675dc0252ee22cea896825c01458e1807bfad2f9969338798548d9858a571f7425c",
"staking_authority": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
"withdrawal_authority": "0xa1d1ad0714035353258038e964ae9675dc0252ee22cea896825c01458e1807bfad2f9969338798548d9858a571f7425c",
"stake_account_public_key": "5xot9PVkphiX2adznghwrAuxGs2zeWisNSxMW6hU6Hkj",
"unsigned_transaction": "0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120087fed394b43849eebef1e88873cd9efdbe33136656e5148e659b8b2f33625d40000000000000000000000000000000000000000000000000000000000000030b81748644e23c4d950f9dd709f3eb73d5eacd9657997e1d9dde7c4ebd8a6519ecb9d0a7fb603d3b68e023278f9650122000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020010000000000000000000000c509bb854c526af4cee5e037089f7aa8e091d8870000000000000000000000000000000000000000000000000000000000000060b36b79b4b206c0310472c117fa40c05342b5dc3e89f98f42c9da3ce6450d4c603cad55248017fd4eca3ab277cca64569193e4d487f5b2ea78a2bcdc81926c313c05842a3af318967a775783bba22519e8b8886587efa99aa7dab5784f792b187\n",
"expiration_time": 1689939023
}
}
If the key is incorrect or missing, you will get this error:
{
"status": 401,
"type": "unauthorized",
"title": "Invalid Token"
}
👋 Need Help?
Contact us through email or our support page for any issues, bugs, or assistance you may need.