Ethereum
Prepare Staking Proxy Transaction
Construct a serialized transaction to deposit ETH to the proxy smart contract. For validators using 0x02 type of withdrawal credentials.
GET
/
api
/
v1
/
eth
/
staking
/
direct
/
p2p
/
deposit
Prepare Staking Proxy Transaction
curl --request GET \
--url https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit', 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://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"serializeTx": "0x02f902d70580830167...",
"to": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"gasLimit": "0",
"data": "",
"value": "0",
"chainId": "0",
"type": "0",
"maxFeePerGas": "0",
"maxPriorityFeePerGas": "0"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Amount of tokens in ETH to deposit.
Example:
32
Amount of tokens in Gwei to stake per validator.
Example:
"32000000000"
Withdrawal credentials type.
Available options:
0x01, 0x02 Example:
"0x02"
Withdrawal address for the validators.
Pattern:
^0x[a-fA-F0-9]{40}$Example:
"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb"
Controller address for the validators.
Pattern:
^0x[a-fA-F0-9]{40}$Example:
"0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb"
Fee recipient address.
Pattern:
^0x[a-fA-F0-9]{40}$Example:
"0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585"
Prepare Staking Proxy Transaction
curl --request GET \
--url https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit', 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://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/eth/staking/direct/p2p/deposit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"serializeTx": "0x02f902d70580830167...",
"to": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb",
"gasLimit": "0",
"data": "",
"value": "0",
"chainId": "0",
"type": "0",
"maxFeePerGas": "0",
"maxPriorityFeePerGas": "0"
}
}