Create Stake
curl --request POST \
--url https://api.dfns.io/staking/stakes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DFNS-USERACTION: <api-key>' \
--data '
{
"externalId": "ext-123",
"walletId": "wa-4g991-s29to-9hrq4nbuto6ih33b",
"protocol": "Ethereum",
"provider": "Figment",
"amount": "32000000000000000000"
}
'import requests
url = "https://api.dfns.io/staking/stakes"
payload = {
"externalId": "ext-123",
"walletId": "wa-4g991-s29to-9hrq4nbuto6ih33b",
"protocol": "Ethereum",
"provider": "Figment",
"amount": "32000000000000000000"
}
headers = {
"Authorization": "Bearer <token>",
"X-DFNS-USERACTION": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-DFNS-USERACTION': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
externalId: 'ext-123',
walletId: 'wa-4g991-s29to-9hrq4nbuto6ih33b',
protocol: 'Ethereum',
provider: 'Figment',
amount: '32000000000000000000'
})
};
fetch('https://api.dfns.io/staking/stakes', 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.dfns.io/staking/stakes",
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([
'externalId' => 'ext-123',
'walletId' => 'wa-4g991-s29to-9hrq4nbuto6ih33b',
'protocol' => 'Ethereum',
'provider' => 'Figment',
'amount' => '32000000000000000000'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-DFNS-USERACTION: <api-key>"
],
]);
$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://api.dfns.io/staking/stakes"
payload := strings.NewReader("{\n \"externalId\": \"ext-123\",\n \"walletId\": \"wa-4g991-s29to-9hrq4nbuto6ih33b\",\n \"protocol\": \"Ethereum\",\n \"provider\": \"Figment\",\n \"amount\": \"32000000000000000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-DFNS-USERACTION", "<api-key>")
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://api.dfns.io/staking/stakes")
.header("Authorization", "Bearer <token>")
.header("X-DFNS-USERACTION", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"ext-123\",\n \"walletId\": \"wa-4g991-s29to-9hrq4nbuto6ih33b\",\n \"protocol\": \"Ethereum\",\n \"provider\": \"Figment\",\n \"amount\": \"32000000000000000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dfns.io/staking/stakes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-DFNS-USERACTION"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalId\": \"ext-123\",\n \"walletId\": \"wa-4g991-s29to-9hrq4nbuto6ih33b\",\n \"protocol\": \"Ethereum\",\n \"provider\": \"Figment\",\n \"amount\": \"32000000000000000000\"\n}"
response = http.request(request)
puts response.read_body{
"id": "stk-0pmu3-tog2k-fdtn0teii2i4r13f",
"walletId": "wa-5pfuu-9euek-h0odgb6snva8ph3k",
"status": "Active",
"requester": {
"userId": "us-6b58p-r53sr-rlrd3l5cj3uc4ome",
"tokenId": "to-202a0-cdo33-o65mbt6q758lvvnt"
},
"requestBody": {
"protocol": "Babylon",
"walletId": "wa-5pfuu-9euek-h0odgb6snva8ph3k",
"provider": "Figment",
"amount": "<string>",
"duration": 123,
"externalId": "<string>"
},
"dateCreated": "2023-04-14T20:41:28.715Z",
"protocol": "Babylon",
"data": {
"finalityProviders": [
"<string>"
],
"covenantPubkeys": [
"<string>"
],
"magicBytes": "<string>",
"covenantThreshold": 123,
"minUnbondingTime": 123,
"lockHeight": 123
},
"actions": [
{
"id": "stka-567ui-9g9b7-ftgvpstk8qfa71b4",
"stakeId": "stk-0pmu3-tog2k-fdtn0teii2i4r13f",
"status": "PendingPolicyApproval",
"kind": "Stake",
"requester": {
"userId": "us-6b58p-r53sr-rlrd3l5cj3uc4ome",
"tokenId": "to-202a0-cdo33-o65mbt6q758lvvnt"
},
"requestBody": {
"protocol": "Babylon",
"walletId": "wa-5pfuu-9euek-h0odgb6snva8ph3k",
"provider": "Figment",
"amount": "<string>",
"duration": 123,
"externalId": "<string>"
},
"dateCreated": "2023-04-14T20:41:28.715Z",
"transactionId": "tx-583hu-sp2p7-slvb9nqpa3hd8bus",
"signatureId": "sig-4sfvl-f4iha-umighfi3hk4t54dr",
"transactionHash": "<string>",
"failureReason": "<string>"
}
],
"provider": "Figment"
}Create Stake
Create a new stake.
POST
/
staking
/
stakes
Create Stake
curl --request POST \
--url https://api.dfns.io/staking/stakes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DFNS-USERACTION: <api-key>' \
--data '
{
"externalId": "ext-123",
"walletId": "wa-4g991-s29to-9hrq4nbuto6ih33b",
"protocol": "Ethereum",
"provider": "Figment",
"amount": "32000000000000000000"
}
'import requests
url = "https://api.dfns.io/staking/stakes"
payload = {
"externalId": "ext-123",
"walletId": "wa-4g991-s29to-9hrq4nbuto6ih33b",
"protocol": "Ethereum",
"provider": "Figment",
"amount": "32000000000000000000"
}
headers = {
"Authorization": "Bearer <token>",
"X-DFNS-USERACTION": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-DFNS-USERACTION': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
externalId: 'ext-123',
walletId: 'wa-4g991-s29to-9hrq4nbuto6ih33b',
protocol: 'Ethereum',
provider: 'Figment',
amount: '32000000000000000000'
})
};
fetch('https://api.dfns.io/staking/stakes', 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.dfns.io/staking/stakes",
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([
'externalId' => 'ext-123',
'walletId' => 'wa-4g991-s29to-9hrq4nbuto6ih33b',
'protocol' => 'Ethereum',
'provider' => 'Figment',
'amount' => '32000000000000000000'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-DFNS-USERACTION: <api-key>"
],
]);
$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://api.dfns.io/staking/stakes"
payload := strings.NewReader("{\n \"externalId\": \"ext-123\",\n \"walletId\": \"wa-4g991-s29to-9hrq4nbuto6ih33b\",\n \"protocol\": \"Ethereum\",\n \"provider\": \"Figment\",\n \"amount\": \"32000000000000000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-DFNS-USERACTION", "<api-key>")
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://api.dfns.io/staking/stakes")
.header("Authorization", "Bearer <token>")
.header("X-DFNS-USERACTION", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"ext-123\",\n \"walletId\": \"wa-4g991-s29to-9hrq4nbuto6ih33b\",\n \"protocol\": \"Ethereum\",\n \"provider\": \"Figment\",\n \"amount\": \"32000000000000000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dfns.io/staking/stakes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-DFNS-USERACTION"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalId\": \"ext-123\",\n \"walletId\": \"wa-4g991-s29to-9hrq4nbuto6ih33b\",\n \"protocol\": \"Ethereum\",\n \"provider\": \"Figment\",\n \"amount\": \"32000000000000000000\"\n}"
response = http.request(request)
puts response.read_body{
"id": "stk-0pmu3-tog2k-fdtn0teii2i4r13f",
"walletId": "wa-5pfuu-9euek-h0odgb6snva8ph3k",
"status": "Active",
"requester": {
"userId": "us-6b58p-r53sr-rlrd3l5cj3uc4ome",
"tokenId": "to-202a0-cdo33-o65mbt6q758lvvnt"
},
"requestBody": {
"protocol": "Babylon",
"walletId": "wa-5pfuu-9euek-h0odgb6snva8ph3k",
"provider": "Figment",
"amount": "<string>",
"duration": 123,
"externalId": "<string>"
},
"dateCreated": "2023-04-14T20:41:28.715Z",
"protocol": "Babylon",
"data": {
"finalityProviders": [
"<string>"
],
"covenantPubkeys": [
"<string>"
],
"magicBytes": "<string>",
"covenantThreshold": 123,
"minUnbondingTime": 123,
"lockHeight": 123
},
"actions": [
{
"id": "stka-567ui-9g9b7-ftgvpstk8qfa71b4",
"stakeId": "stk-0pmu3-tog2k-fdtn0teii2i4r13f",
"status": "PendingPolicyApproval",
"kind": "Stake",
"requester": {
"userId": "us-6b58p-r53sr-rlrd3l5cj3uc4ome",
"tokenId": "to-202a0-cdo33-o65mbt6q758lvvnt"
},
"requestBody": {
"protocol": "Babylon",
"walletId": "wa-5pfuu-9euek-h0odgb6snva8ph3k",
"provider": "Figment",
"amount": "<string>",
"duration": 123,
"externalId": "<string>"
},
"dateCreated": "2023-04-14T20:41:28.715Z",
"transactionId": "tx-583hu-sp2p7-slvb9nqpa3hd8bus",
"signatureId": "sig-4sfvl-f4iha-umighfi3hk4t54dr",
"transactionHash": "<string>",
"failureReason": "<string>"
}
],
"provider": "Figment"
}Authorizations
Bearer Token: Used to authenticate API requests. More details how to generate the token: Authentication flows
User Action Signature: Used to sign the change-inducing API requests. More details how to generate the token: User Action Signing flows
Body
application/json
- Ethereum
- Iota
- Xdc
Available options:
Ethereum Id of the Dfns wallet making the deposit.
Required string length:
1 - 64Pattern:
^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$Example:
"wa-5pfuu-9euek-h0odgb6snva8ph3k"
Staking Provider
Available options:
Figment Transaction amount denominated in min units
Pattern:
^\d+$Response
200 - application/json
Success
- Babylon
- Iota
- Ethereum
- Xdc
Required string length:
1 - 64Pattern:
^stk-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$Example:
"stk-0pmu3-tog2k-fdtn0teii2i4r13f"
Wallet id.
Required string length:
1 - 64Pattern:
^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$Example:
"wa-5pfuu-9euek-h0odgb6snva8ph3k"
Status of the stake position.
| Status | Definition |
|---|---|
Staking | The stake is being created and funds are being delegated to the validator. |
Active | The stake is active and earning rewards. |
Unbonding | The stake is in the process of being unbonded (cooldown period). |
Unbond | The stake has been unbonded and is ready for withdrawal. |
Withdrawing | The staked funds are in the process of being withdrawn. |
Withdrawn | The staked funds have been fully withdrawn. |
Failed | The staking operation failed. |
Available options:
Active, Failed, Staking, Unbonding, Unbond, Withdrawing, Withdrawn The user who initiated the request.
Show child attributes
Show child attributes
- Babylon
- Ethereum
- Iota
- Xdc
Show child attributes
Show child attributes
Available options:
Babylon Show child attributes
Show child attributes
Show child attributes
Show child attributes
The staking infrastructure provider used to manage the stake.
Available options:
Figment Last modified on September 3, 2026
Was this page helpful?