curl --request POST \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction \
--header 'Content-Type: application/json' \
--data '
{
"raw_unsigned_txn": "[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000",
"rpc": {
"skip_broadcast": false,
"url": "https://rpc.flashbots.net/fast"
},
"evm_params": {
"disable_dynamic_gas": false,
"disable_dynamic_nonce": false,
"replaced_transaction_id": "0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27",
"chain_id": "1",
"network_name": "Ethereum"
}
}
'import requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction"
payload = {
"raw_unsigned_txn": "[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080
[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000",
"rpc": {
"skip_broadcast": False,
"url": "https://rpc.flashbots.net/fast"
},
"evm_params": {
"disable_dynamic_gas": False,
"disable_dynamic_nonce": False,
"replaced_transaction_id": "0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27",
"chain_id": "1",
"network_name": "Ethereum"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
raw_unsigned_txn: '[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000',
rpc: {skip_broadcast: false, url: 'https://rpc.flashbots.net/fast'},
evm_params: {
disable_dynamic_gas: false,
disable_dynamic_nonce: false,
replaced_transaction_id: '0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27',
chain_id: '1',
network_name: 'Ethereum'
}
})
};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_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([
'raw_unsigned_txn' => '[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080
[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000',
'rpc' => [
'skip_broadcast' => false,
'url' => 'https://rpc.flashbots.net/fast'
],
'evm_params' => [
'disable_dynamic_gas' => false,
'disable_dynamic_nonce' => false,
'replaced_transaction_id' => '0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27',
'chain_id' => '1',
'network_name' => 'Ethereum'
]
]),
CURLOPT_HTTPHEADER => [
"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://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction"
payload := strings.NewReader("{\n \"raw_unsigned_txn\": \"[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000\",\n \"rpc\": {\n \"skip_broadcast\": false,\n \"url\": \"https://rpc.flashbots.net/fast\"\n },\n \"evm_params\": {\n \"disable_dynamic_gas\": false,\n \"disable_dynamic_nonce\": false,\n \"replaced_transaction_id\": \"0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27\",\n \"chain_id\": \"1\",\n \"network_name\": \"Ethereum\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction")
.header("Content-Type", "application/json")
.body("{\n \"raw_unsigned_txn\": \"[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000\",\n \"rpc\": {\n \"skip_broadcast\": false,\n \"url\": \"https://rpc.flashbots.net/fast\"\n },\n \"evm_params\": {\n \"disable_dynamic_gas\": false,\n \"disable_dynamic_nonce\": false,\n \"replaced_transaction_id\": \"0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27\",\n \"chain_id\": \"1\",\n \"network_name\": \"Ethereum\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"raw_unsigned_txn\": \"[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000\",\n \"rpc\": {\n \"skip_broadcast\": false,\n \"url\": \"https://rpc.flashbots.net/fast\"\n },\n \"evm_params\": {\n \"disable_dynamic_gas\": false,\n \"disable_dynamic_nonce\": false,\n \"replaced_transaction_id\": \"0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27\",\n \"chain_id\": \"1\",\n \"network_name\": \"Ethereum\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27"
}Create Onchain Transaction
Create an onchain transaction.
curl --request POST \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction \
--header 'Content-Type: application/json' \
--data '
{
"raw_unsigned_txn": "[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000",
"rpc": {
"skip_broadcast": false,
"url": "https://rpc.flashbots.net/fast"
},
"evm_params": {
"disable_dynamic_gas": false,
"disable_dynamic_nonce": false,
"replaced_transaction_id": "0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27",
"chain_id": "1",
"network_name": "Ethereum"
}
}
'import requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction"
payload = {
"raw_unsigned_txn": "[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080
[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000",
"rpc": {
"skip_broadcast": False,
"url": "https://rpc.flashbots.net/fast"
},
"evm_params": {
"disable_dynamic_gas": False,
"disable_dynamic_nonce": False,
"replaced_transaction_id": "0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27",
"chain_id": "1",
"network_name": "Ethereum"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
raw_unsigned_txn: '[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000',
rpc: {skip_broadcast: false, url: 'https://rpc.flashbots.net/fast'},
evm_params: {
disable_dynamic_gas: false,
disable_dynamic_nonce: false,
replaced_transaction_id: '0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27',
chain_id: '1',
network_name: 'Ethereum'
}
})
};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_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([
'raw_unsigned_txn' => '[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080
[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000',
'rpc' => [
'skip_broadcast' => false,
'url' => 'https://rpc.flashbots.net/fast'
],
'evm_params' => [
'disable_dynamic_gas' => false,
'disable_dynamic_nonce' => false,
'replaced_transaction_id' => '0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27',
'chain_id' => '1',
'network_name' => 'Ethereum'
]
]),
CURLOPT_HTTPHEADER => [
"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://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction"
payload := strings.NewReader("{\n \"raw_unsigned_txn\": \"[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000\",\n \"rpc\": {\n \"skip_broadcast\": false,\n \"url\": \"https://rpc.flashbots.net/fast\"\n },\n \"evm_params\": {\n \"disable_dynamic_gas\": false,\n \"disable_dynamic_nonce\": false,\n \"replaced_transaction_id\": \"0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27\",\n \"chain_id\": \"1\",\n \"network_name\": \"Ethereum\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction")
.header("Content-Type", "application/json")
.body("{\n \"raw_unsigned_txn\": \"[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000\",\n \"rpc\": {\n \"skip_broadcast\": false,\n \"url\": \"https://rpc.flashbots.net/fast\"\n },\n \"evm_params\": {\n \"disable_dynamic_gas\": false,\n \"disable_dynamic_nonce\": false,\n \"replaced_transaction_id\": \"0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27\",\n \"chain_id\": \"1\",\n \"network_name\": \"Ethereum\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/onchain_transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"raw_unsigned_txn\": \"[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000\",\n \"rpc\": {\n \"skip_broadcast\": false,\n \"url\": \"https://rpc.flashbots.net/fast\"\n },\n \"evm_params\": {\n \"disable_dynamic_gas\": false,\n \"disable_dynamic_nonce\": false,\n \"replaced_transaction_id\": \"0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27\",\n \"chain_id\": \"1\",\n \"network_name\": \"Ethereum\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27"
}Body
Raw unsigned transaction in Hex format (Supports EVM and Solana)
"[EVM Example]: 02f00180830f424085057db95cdf825208942225166893d26f2064a15cc84f5b897591a7e6938642a13798e59d80c0808080\n[Solana Example]: 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080010002045bae9ac3406b6ad02953cef2646a07966df84f35c0d754d5cc628d452299fcc606c34c7ae7b6d15777787f4f5217d8f2537e7efecabf3d96c39952ed2144322e00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000dc34215f010238fbe5a955301891d29cdc1ea2b1f175e36c01c7cde0126ba58303020200010c02000000364b16000000000003000903102700000000000003000502400d030000"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
A successful response.
Unique identifier for the created transaction
"0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27"
Was this page helpful?