Staking API Reference
Stake Transaction
Supplies a transaction that, once signed and broadcasted, facilitates the creation of stake validators.
POST
/
v1
/
api
/
ethereum
/
{network}
/
stake_transaction
cURL
curl --request POST \
--url https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"num_validators": 1,
"wallet_address": 9.88865096163011e+49,
"transaction_type": 2
}
'import requests
url = "https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction"
payload = {
"num_validators": 1,
"wallet_address": 9.88865096163011e+49,
"transaction_type": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({num_validators: 1, wallet_address: 9.88865096163011e+49, transaction_type: 2})
};
fetch('https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'num_validators' => 1,
'wallet_address' => 9.88865096163011e+49,
'transaction_type' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction"
payload := strings.NewReader("{\n \"num_validators\": 1,\n \"wallet_address\": 9.88865096163011e+49,\n \"transaction_type\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"num_validators\": 1,\n \"wallet_address\": 9.88865096163011e+49,\n \"transaction_type\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"num_validators\": 1,\n \"wallet_address\": 9.88865096163011e+49,\n \"transaction_type\": 2\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"data": "0x4f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030b6f69f0e68fbbf1512af9c2b7d983be5adc6737212426ca97eb4e773858bcab8989712a927c8ee2f238ceb839dd4ba67000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000004cec5c275f89f6e091f0af5272b2a205a39a61b8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060ab3b820d0df8e892c54caa268c7bd9536c8889674999bd2f247ece9a893c2a047ff188f463d5ba89747f2f13dbf83c430f55b715a80975117a513fe7903683303e389eb610ff207e13e29df382f0e9a1e019e25980c9d227a44998ec13f589f600000000000000000000000000000000000000000000000000000000000000010714268a0278aff8c0a6f65a3125b920020450c02f63bb46475413b354c6444a",
"gas": 87936,
"gas_price": "27",
"nonce": 35,
"to": "0x0ab8792f74261e83b1a3fe41c89017c359dcd52b",
"transaction_serialized": "0xf904b61e8459682f0a8301fb7594053508a6967c54b7a3b8efadeaf6e9979890006a8903782dace9d9000000b904444f498c73000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000003e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000030a420a76ff09e2fc3f068a5759a560f5b9eaca8cf85dd73e697cdc49014be23c8b468426d719a5cc84dcbcdda0a1abf6f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030a0f09e0e9230ab68a1f488969b14c584cff1479fe34a348dd84d6c4194366d3d5b569ea7e72cfa2e2b06bac60452cb9b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000200100000000000000000000005a920ec8ca81f53709a3f7bda0fa5911c905721800000000000000000000000000000000000000000000000000000000000000200100000000000000000000005a920ec8ca81f53709a3f7bda0fa5911c90572180000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000060842a230f68819ede9099c9cfa33c3def570323a9c8417a28c3b3db1a6af11d4903998b889be33a14848f89e1fad858af0adadc92f051c68dddf410d7b1cc875970fc4630dd47f375517c4336cfd75b9a8e5a92e96a2b54c0306d82336650f7c1000000000000000000000000000000000000000000000000000000000000006089e1449c9d81135d19c2f66a823837d18f4dda1d26276bd66e99a048e28cb513b10d776c1636a8f37d133c8558e019560f86d88c5625d5acf9af05902703a14b5dbbd50975c8ea3e480db59a8930b95713cba4b65d9a41cbc1ac27bcbe36d1470000000000000000000000000000000000000000000000000000000000000002252f2f9e049cee403ec2201a878309b7f448e228097c2a4b09b145057d8e1ff60921ddabd3905a3bad998ae97092a8f2815246f156cc884242f1841f55895dd1831e84a3a0e1ce9dbebe355eba4aea58da6de44f2a34e150cd5fd9cb00245384fb420e5591a03da5fd33679a2923ac5a22a696a69a456ec73efdeec88b8a5d9527b171fe7771",
"value": "32000000000000000000"
},
"validator_keys": [
{
"public_key": "0x134dea3b9a72b811ef33e63977c78ea11da9b5a7d8409384f9349739821d84af1a7988e4c30cd05db21410cdc5c020c90eaca75aaff6c50a5c0b06b411699008"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The network
Available options:
mainnet, hoodi Body
application/json
The number of validators that will be created.
Example:
1
The address of the wallet that will be used to pay for the transaction. The deposit and exit transactions for the validators must be signed by this wallet. Make absolutely sure not to lose possession of it.
Type of the returned transaction. 0 for legacy transactions. 2 for EIP-1559 transactions.
Example:
2
cURL
curl --request POST \
--url https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"num_validators": 1,
"wallet_address": 9.88865096163011e+49,
"transaction_type": 2
}
'import requests
url = "https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction"
payload = {
"num_validators": 1,
"wallet_address": 9.88865096163011e+49,
"transaction_type": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({num_validators: 1, wallet_address: 9.88865096163011e+49, transaction_type: 2})
};
fetch('https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'num_validators' => 1,
'wallet_address' => 9.88865096163011e+49,
'transaction_type' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction"
payload := strings.NewReader("{\n \"num_validators\": 1,\n \"wallet_address\": 9.88865096163011e+49,\n \"transaction_type\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"num_validators\": 1,\n \"wallet_address\": 9.88865096163011e+49,\n \"transaction_type\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ethereum-staking.sprd.validationcloud.io/v1/api/ethereum/{network}/stake_transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"num_validators\": 1,\n \"wallet_address\": 9.88865096163011e+49,\n \"transaction_type\": 2\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"data": "0x4f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030b6f69f0e68fbbf1512af9c2b7d983be5adc6737212426ca97eb4e773858bcab8989712a927c8ee2f238ceb839dd4ba67000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000004cec5c275f89f6e091f0af5272b2a205a39a61b8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060ab3b820d0df8e892c54caa268c7bd9536c8889674999bd2f247ece9a893c2a047ff188f463d5ba89747f2f13dbf83c430f55b715a80975117a513fe7903683303e389eb610ff207e13e29df382f0e9a1e019e25980c9d227a44998ec13f589f600000000000000000000000000000000000000000000000000000000000000010714268a0278aff8c0a6f65a3125b920020450c02f63bb46475413b354c6444a",
"gas": 87936,
"gas_price": "27",
"nonce": 35,
"to": "0x0ab8792f74261e83b1a3fe41c89017c359dcd52b",
"transaction_serialized": "0xf904b61e8459682f0a8301fb7594053508a6967c54b7a3b8efadeaf6e9979890006a8903782dace9d9000000b904444f498c73000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000003e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000030a420a76ff09e2fc3f068a5759a560f5b9eaca8cf85dd73e697cdc49014be23c8b468426d719a5cc84dcbcdda0a1abf6f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030a0f09e0e9230ab68a1f488969b14c584cff1479fe34a348dd84d6c4194366d3d5b569ea7e72cfa2e2b06bac60452cb9b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000200100000000000000000000005a920ec8ca81f53709a3f7bda0fa5911c905721800000000000000000000000000000000000000000000000000000000000000200100000000000000000000005a920ec8ca81f53709a3f7bda0fa5911c90572180000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000060842a230f68819ede9099c9cfa33c3def570323a9c8417a28c3b3db1a6af11d4903998b889be33a14848f89e1fad858af0adadc92f051c68dddf410d7b1cc875970fc4630dd47f375517c4336cfd75b9a8e5a92e96a2b54c0306d82336650f7c1000000000000000000000000000000000000000000000000000000000000006089e1449c9d81135d19c2f66a823837d18f4dda1d26276bd66e99a048e28cb513b10d776c1636a8f37d133c8558e019560f86d88c5625d5acf9af05902703a14b5dbbd50975c8ea3e480db59a8930b95713cba4b65d9a41cbc1ac27bcbe36d1470000000000000000000000000000000000000000000000000000000000000002252f2f9e049cee403ec2201a878309b7f448e228097c2a4b09b145057d8e1ff60921ddabd3905a3bad998ae97092a8f2815246f156cc884242f1841f55895dd1831e84a3a0e1ce9dbebe355eba4aea58da6de44f2a34e150cd5fd9cb00245384fb420e5591a03da5fd33679a2923ac5a22a696a69a456ec73efdeec88b8a5d9527b171fe7771",
"value": "32000000000000000000"
},
"validator_keys": [
{
"public_key": "0x134dea3b9a72b811ef33e63977c78ea11da9b5a7d8409384f9349739821d84af1a7988e4c30cd05db21410cdc5c020c90eaca75aaff6c50a5c0b06b411699008"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}