curl --request POST \
--url https://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Wallet-Auth: <x-wallet-auth>' \
--data '
{
"transaction": "0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080"
}
'import requests
url = "https://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction"
payload = { "transaction": "0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080" }
headers = {
"X-Wallet-Auth": "<x-wallet-auth>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Wallet-Auth': '<x-wallet-auth>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transaction: '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080'
})
};
fetch('https://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/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://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/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([
'transaction' => '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Wallet-Auth: <x-wallet-auth>"
],
]);
$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.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction"
payload := strings.NewReader("{\n \"transaction\": \"0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Wallet-Auth", "<x-wallet-auth>")
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://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction")
.header("X-Wallet-Auth", "<x-wallet-auth>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction\": \"0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Wallet-Auth"] = '<x-wallet-auth>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction\": \"0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080\"\n}"
response = http.request(request)
puts response.read_body{
"signedTransaction": "0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b"
}{
"errorType": "malformed_transaction",
"errorMessage": "Malformed unsigned transaction."
}{
"errorType": "unauthorized",
"errorMessage": "Wallet authentication error."
}{
"errorType": "payment_method_required",
"errorMessage": "A valid payment method is required to complete this operation. Please add a payment method to your account at https://portal.cdp.coinbase.com."
}{
"errorType": "forbidden",
"errorMessage": "Unable to sign transaction for this address."
}{
"errorType": "not_found",
"errorMessage": "EVM account with the given address not found."
}{
"errorType": "already_exists",
"errorMessage": "Another request with the same idempotency key is currently processing."
}{
"errorType": "idempotency_error",
"errorMessage": "Idempotency key '8e03978e-40d5-43e8-bc93-6894a57f9324' was already used with a different request payload. Please try again with a new idempotency key."
}{
"errorType": "internal_server_error",
"errorMessage": "An internal server error occurred. Please try again later."
}{
"errorType": "bad_gateway",
"errorMessage": "Bad gateway. Please try again later."
}{
"errorType": "service_unavailable",
"errorMessage": "Service unavailable. Please try again later."
}Sign transaction
Signs a transaction with the given EVM account. The transaction should be serialized as a hex string using RLP.
The transaction must be an EIP-1559 dynamic fee transaction. The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction.
curl --request POST \
--url https://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Wallet-Auth: <x-wallet-auth>' \
--data '
{
"transaction": "0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080"
}
'import requests
url = "https://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction"
payload = { "transaction": "0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080" }
headers = {
"X-Wallet-Auth": "<x-wallet-auth>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Wallet-Auth': '<x-wallet-auth>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transaction: '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080'
})
};
fetch('https://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/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://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/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([
'transaction' => '0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Wallet-Auth: <x-wallet-auth>"
],
]);
$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.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction"
payload := strings.NewReader("{\n \"transaction\": \"0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Wallet-Auth", "<x-wallet-auth>")
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://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction")
.header("X-Wallet-Auth", "<x-wallet-auth>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction\": \"0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cdp.coinbase.com/platform/v2/evm/accounts/{address}/sign/transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Wallet-Auth"] = '<x-wallet-auth>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction\": \"0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080\"\n}"
response = http.request(request)
puts response.read_body{
"signedTransaction": "0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b"
}{
"errorType": "malformed_transaction",
"errorMessage": "Malformed unsigned transaction."
}{
"errorType": "unauthorized",
"errorMessage": "Wallet authentication error."
}{
"errorType": "payment_method_required",
"errorMessage": "A valid payment method is required to complete this operation. Please add a payment method to your account at https://portal.cdp.coinbase.com."
}{
"errorType": "forbidden",
"errorMessage": "Unable to sign transaction for this address."
}{
"errorType": "not_found",
"errorMessage": "EVM account with the given address not found."
}{
"errorType": "already_exists",
"errorMessage": "Another request with the same idempotency key is currently processing."
}{
"errorType": "idempotency_error",
"errorMessage": "Idempotency key '8e03978e-40d5-43e8-bc93-6894a57f9324' was already used with a different request payload. Please try again with a new idempotency key."
}{
"errorType": "internal_server_error",
"errorMessage": "An internal server error occurred. Please try again later."
}{
"errorType": "bad_gateway",
"errorMessage": "Bad gateway. Please try again later."
}{
"errorType": "service_unavailable",
"errorMessage": "Service unavailable. Please try again later."
}Authorizations
A JWT signed using your CDP API Key Secret, encoded in base64. Refer to the Generate Bearer Token section of our Authentication docs for information on how to generate your Bearer Token.
Headers
A JWT signed using your Wallet Secret, encoded in base64. Refer to the Generate Wallet Token section of our Authentication docs for more details on how to generate your Wallet Token.
An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our Idempotency docs for more information on using idempotency keys.
1 - 128Path Parameters
The 0x-prefixed address of the EVM account.
^0x[0-9a-fA-F]{40}$Body
The RLP-encoded transaction to sign, as a 0x-prefixed hex string.
"0xf86b098505d21dba00830334509431415daf58e2c6b7323b4c58712fd92952145da79018080"
Response
Successfully signed transaction.
The RLP-encoded signed transaction, as a 0x-prefixed hex string.
"0x1b0c9cf8cd4554c6c6d9e7311e88f1be075d7f25b418a044f4bf2c0a42a93e212ad0a8b54de9e0b5f7e3812de3f2c6cc79aa8c3e1c02e7ad14b4a8f42012c2c01b"
Was this page helpful?