Create a new stake-wrap
curl --request POST \
--url https://api.exchange.coinbase.com/wrapped-assets/stake-wrap \
--header 'Content-Type: application/json' \
--header 'cb-access-key: <api-key>' \
--header 'cb-access-passphrase: <api-key>' \
--header 'cb-access-sign: <api-key>' \
--header 'cb-access-timestamp: <api-key>' \
--data '
{
"from_currency": "<string>",
"to_currency": "<string>",
"amount": "<string>"
}
'import requests
url = "https://api.exchange.coinbase.com/wrapped-assets/stake-wrap"
payload = {
"from_currency": "<string>",
"to_currency": "<string>",
"amount": "<string>"
}
headers = {
"cb-access-key": "<api-key>",
"cb-access-passphrase": "<api-key>",
"cb-access-sign": "<api-key>",
"cb-access-timestamp": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'cb-access-key': '<api-key>',
'cb-access-passphrase': '<api-key>',
'cb-access-sign': '<api-key>',
'cb-access-timestamp': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({from_currency: '<string>', to_currency: '<string>', amount: '<string>'})
};
fetch('https://api.exchange.coinbase.com/wrapped-assets/stake-wrap', 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.exchange.coinbase.com/wrapped-assets/stake-wrap",
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([
'from_currency' => '<string>',
'to_currency' => '<string>',
'amount' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"cb-access-key: <api-key>",
"cb-access-passphrase: <api-key>",
"cb-access-sign: <api-key>",
"cb-access-timestamp: <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.exchange.coinbase.com/wrapped-assets/stake-wrap"
payload := strings.NewReader("{\n \"from_currency\": \"<string>\",\n \"to_currency\": \"<string>\",\n \"amount\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cb-access-key", "<api-key>")
req.Header.Add("cb-access-passphrase", "<api-key>")
req.Header.Add("cb-access-sign", "<api-key>")
req.Header.Add("cb-access-timestamp", "<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.exchange.coinbase.com/wrapped-assets/stake-wrap")
.header("cb-access-key", "<api-key>")
.header("cb-access-passphrase", "<api-key>")
.header("cb-access-sign", "<api-key>")
.header("cb-access-timestamp", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from_currency\": \"<string>\",\n \"to_currency\": \"<string>\",\n \"amount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exchange.coinbase.com/wrapped-assets/stake-wrap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cb-access-key"] = '<api-key>'
request["cb-access-passphrase"] = '<api-key>'
request["cb-access-sign"] = '<api-key>'
request["cb-access-timestamp"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_currency\": \"<string>\",\n \"to_currency\": \"<string>\",\n \"amount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c5aaf125-d99e-41fe-82ea-ad068038b278",
"from_amount": "11.00000000",
"to_amount": "11.00000000",
"from_account_id": "5dcc143c-fb96-4f72-aebf-a165e3d29b53",
"to_account_id": "6100247f-90fc-4335-ac17-d99839f0c909",
"from_currency": "USDC",
"to_currency": "USD",
"status": "pending",
"conversion_rate": "1.006",
"created_at": "2019-06-11T22:11:56.382Z",
"completed_at": "2019-06-11T22:11:56.382Z",
"canceled_at": "2019-06-11T22:11:56.382Z"
}{
"message": "<string>"
}{
"message": "<string>"
}Wrapped Assets
Create a new stake-wrap
Stakes and wraps from_currency to to_currency. Funds are stake-wrapped in the profile associated with the API key.
POST
/
wrapped-assets
/
stake-wrap
Create a new stake-wrap
curl --request POST \
--url https://api.exchange.coinbase.com/wrapped-assets/stake-wrap \
--header 'Content-Type: application/json' \
--header 'cb-access-key: <api-key>' \
--header 'cb-access-passphrase: <api-key>' \
--header 'cb-access-sign: <api-key>' \
--header 'cb-access-timestamp: <api-key>' \
--data '
{
"from_currency": "<string>",
"to_currency": "<string>",
"amount": "<string>"
}
'import requests
url = "https://api.exchange.coinbase.com/wrapped-assets/stake-wrap"
payload = {
"from_currency": "<string>",
"to_currency": "<string>",
"amount": "<string>"
}
headers = {
"cb-access-key": "<api-key>",
"cb-access-passphrase": "<api-key>",
"cb-access-sign": "<api-key>",
"cb-access-timestamp": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'cb-access-key': '<api-key>',
'cb-access-passphrase': '<api-key>',
'cb-access-sign': '<api-key>',
'cb-access-timestamp': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({from_currency: '<string>', to_currency: '<string>', amount: '<string>'})
};
fetch('https://api.exchange.coinbase.com/wrapped-assets/stake-wrap', 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.exchange.coinbase.com/wrapped-assets/stake-wrap",
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([
'from_currency' => '<string>',
'to_currency' => '<string>',
'amount' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"cb-access-key: <api-key>",
"cb-access-passphrase: <api-key>",
"cb-access-sign: <api-key>",
"cb-access-timestamp: <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.exchange.coinbase.com/wrapped-assets/stake-wrap"
payload := strings.NewReader("{\n \"from_currency\": \"<string>\",\n \"to_currency\": \"<string>\",\n \"amount\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cb-access-key", "<api-key>")
req.Header.Add("cb-access-passphrase", "<api-key>")
req.Header.Add("cb-access-sign", "<api-key>")
req.Header.Add("cb-access-timestamp", "<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.exchange.coinbase.com/wrapped-assets/stake-wrap")
.header("cb-access-key", "<api-key>")
.header("cb-access-passphrase", "<api-key>")
.header("cb-access-sign", "<api-key>")
.header("cb-access-timestamp", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from_currency\": \"<string>\",\n \"to_currency\": \"<string>\",\n \"amount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exchange.coinbase.com/wrapped-assets/stake-wrap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cb-access-key"] = '<api-key>'
request["cb-access-passphrase"] = '<api-key>'
request["cb-access-sign"] = '<api-key>'
request["cb-access-timestamp"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_currency\": \"<string>\",\n \"to_currency\": \"<string>\",\n \"amount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c5aaf125-d99e-41fe-82ea-ad068038b278",
"from_amount": "11.00000000",
"to_amount": "11.00000000",
"from_account_id": "5dcc143c-fb96-4f72-aebf-a165e3d29b53",
"to_account_id": "6100247f-90fc-4335-ac17-d99839f0c909",
"from_currency": "USDC",
"to_currency": "USD",
"status": "pending",
"conversion_rate": "1.006",
"created_at": "2019-06-11T22:11:56.382Z",
"completed_at": "2019-06-11T22:11:56.382Z",
"canceled_at": "2019-06-11T22:11:56.382Z"
}{
"message": "<string>"
}{
"message": "<string>"
}API Key Permissions
This endpoint requires the “trade” permission.Response
A successful stake-wrap is assigned a stake-wrap ID. The corresponding ledger entries for a stake-wrap reference this stake-wrap ID.More DetailsFor more information on stake-wrapping ETH (
from_currency) to CBETH (to_currency), see How to stake/wrap ETH to CBETH.Authorizations
Response
Was this page helpful?
⌘I