curl --request POST \
--url https://api.cdp.coinbase.com/platform/v1/wallets/{wallet_id}/addresses/{address_id}/trades/{trade_id}/broadcast \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"signed_payload": "<string>",
"approve_transaction_signed_payload": "<string>"
}
'{
"network_id": "base-sepolia",
"wallet_id": "d91d652b-d020-48d4-bf19-5c5eb5e280c7",
"address_id": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"trade_id": "d91d652b-d020-48d4-bf19-5c5eb5e280c7",
"from_amount": "12345678",
"from_asset": {
"network_id": "base-sepolia",
"asset_id": "USDC",
"decimals": 18,
"contract_address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
},
"to_amount": "12345678",
"to_asset": {
"network_id": "base-sepolia",
"asset_id": "USDC",
"decimals": 18,
"contract_address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
},
"transaction": {
"network_id": "base-sepolia",
"from_address_id": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"unsigned_payload": "<string>",
"status": "pending",
"signed_payload": "<string>",
"transaction_hash": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"transaction_link": "https://sepolia.basescan.org/tx/0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"content": {
"from": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"to": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"gas": 1000,
"gas_price": 1000,
"hash": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"input": "<string>",
"nonce": 136,
"index": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"value": 100,
"type": 2,
"max_fee_per_gas": 190,
"max_priority_fee_per_gas": 100,
"priority_fee_per_gas": 1000,
"transaction_access_list": {
"access_list": [
{
"address": "<string>",
"storage_keys": [
"<string>"
]
}
]
},
"flattened_traces": [
{
"error": "<string>",
"type": "<string>",
"from": "<string>",
"to": "<string>",
"value": "<string>",
"gas": 123,
"gas_used": 123,
"input": "<string>",
"output": "<string>",
"sub_traces": 123,
"trace_address": [
123
],
"trace_type": "<string>",
"call_type": "<string>",
"trace_id": "<string>",
"status": 123,
"block_hash": "<string>",
"block_number": 123,
"transaction_hash": "<string>",
"transaction_index": 123
}
],
"block_timestamp": "2023-04-01T12:00:00Z",
"mint": "0",
"rlp_encoded_tx": "0x02f582426882013d8502540be4008502540be41c830493e094a55416de5de61a0ac1aa8970a280e04388b1de4b6f843a4b66f1c0808080"
}
},
"approve_transaction": {
"network_id": "base-sepolia",
"from_address_id": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"unsigned_payload": "<string>",
"status": "pending",
"signed_payload": "<string>",
"transaction_hash": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"transaction_link": "https://sepolia.basescan.org/tx/0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"content": {
"from": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"to": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"gas": 1000,
"gas_price": 1000,
"hash": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"input": "<string>",
"nonce": 136,
"index": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"value": 100,
"type": 2,
"max_fee_per_gas": 190,
"max_priority_fee_per_gas": 100,
"priority_fee_per_gas": 1000,
"transaction_access_list": {
"access_list": [
{
"address": "<string>",
"storage_keys": [
"<string>"
]
}
]
},
"flattened_traces": [
{
"error": "<string>",
"type": "<string>",
"from": "<string>",
"to": "<string>",
"value": "<string>",
"gas": 123,
"gas_used": 123,
"input": "<string>",
"output": "<string>",
"sub_traces": 123,
"trace_address": [
123
],
"trace_type": "<string>",
"call_type": "<string>",
"trace_id": "<string>",
"status": 123,
"block_hash": "<string>",
"block_number": 123,
"transaction_hash": "<string>",
"transaction_index": 123
}
],
"block_timestamp": "2023-04-01T12:00:00Z",
"mint": "0",
"rlp_encoded_tx": "0x02f582426882013d8502540be4008502540be41c830493e094a55416de5de61a0ac1aa8970a280e04388b1de4b6f843a4b66f1c0808080"
}
}
}Broadcast a trade.
curl --request POST \
--url https://api.cdp.coinbase.com/platform/v1/wallets/{wallet_id}/addresses/{address_id}/trades/{trade_id}/broadcast \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"signed_payload": "<string>",
"approve_transaction_signed_payload": "<string>"
}
'{
"network_id": "base-sepolia",
"wallet_id": "d91d652b-d020-48d4-bf19-5c5eb5e280c7",
"address_id": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"trade_id": "d91d652b-d020-48d4-bf19-5c5eb5e280c7",
"from_amount": "12345678",
"from_asset": {
"network_id": "base-sepolia",
"asset_id": "USDC",
"decimals": 18,
"contract_address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
},
"to_amount": "12345678",
"to_asset": {
"network_id": "base-sepolia",
"asset_id": "USDC",
"decimals": 18,
"contract_address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
},
"transaction": {
"network_id": "base-sepolia",
"from_address_id": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"unsigned_payload": "<string>",
"status": "pending",
"signed_payload": "<string>",
"transaction_hash": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"transaction_link": "https://sepolia.basescan.org/tx/0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"content": {
"from": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"to": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"gas": 1000,
"gas_price": 1000,
"hash": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"input": "<string>",
"nonce": 136,
"index": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"value": 100,
"type": 2,
"max_fee_per_gas": 190,
"max_priority_fee_per_gas": 100,
"priority_fee_per_gas": 1000,
"transaction_access_list": {
"access_list": [
{
"address": "<string>",
"storage_keys": [
"<string>"
]
}
]
},
"flattened_traces": [
{
"error": "<string>",
"type": "<string>",
"from": "<string>",
"to": "<string>",
"value": "<string>",
"gas": 123,
"gas_used": 123,
"input": "<string>",
"output": "<string>",
"sub_traces": 123,
"trace_address": [
123
],
"trace_type": "<string>",
"call_type": "<string>",
"trace_id": "<string>",
"status": 123,
"block_hash": "<string>",
"block_number": 123,
"transaction_hash": "<string>",
"transaction_index": 123
}
],
"block_timestamp": "2023-04-01T12:00:00Z",
"mint": "0",
"rlp_encoded_tx": "0x02f582426882013d8502540be4008502540be41c830493e094a55416de5de61a0ac1aa8970a280e04388b1de4b6f843a4b66f1c0808080"
}
},
"approve_transaction": {
"network_id": "base-sepolia",
"from_address_id": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"unsigned_payload": "<string>",
"status": "pending",
"signed_payload": "<string>",
"transaction_hash": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"transaction_link": "https://sepolia.basescan.org/tx/0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"content": {
"from": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"to": "0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a",
"gas": 1000,
"gas_price": 1000,
"hash": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"input": "<string>",
"nonce": 136,
"index": "0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42",
"value": 100,
"type": 2,
"max_fee_per_gas": 190,
"max_priority_fee_per_gas": 100,
"priority_fee_per_gas": 1000,
"transaction_access_list": {
"access_list": [
{
"address": "<string>",
"storage_keys": [
"<string>"
]
}
]
},
"flattened_traces": [
{
"error": "<string>",
"type": "<string>",
"from": "<string>",
"to": "<string>",
"value": "<string>",
"gas": 123,
"gas_used": 123,
"input": "<string>",
"output": "<string>",
"sub_traces": 123,
"trace_address": [
123
],
"trace_type": "<string>",
"call_type": "<string>",
"trace_id": "<string>",
"status": 123,
"block_hash": "<string>",
"block_number": 123,
"transaction_hash": "<string>",
"transaction_index": 123
}
],
"block_timestamp": "2023-04-01T12:00:00Z",
"mint": "0",
"rlp_encoded_tx": "0x02f582426882013d8502540be4008502540be41c830493e094a55416de5de61a0ac1aa8970a280e04388b1de4b6f843a4b66f1c0808080"
}
}
}Enter your JSON Web Token (JWT) here. Refer to the Generate JWT section of our Authentication docs for information on how to generate your Bearer Token.
The ID of the wallet the address belongs to.
The onchain address the trade belongs to.
The ID of the trade to broadcast.
Success response
A trade of an asset to another asset
The ID of the blockchain network.
"base-sepolia"
The ID of the wallet that owns the from address
"d91d652b-d020-48d4-bf19-5c5eb5e280c7"
The onchain address of the sender
"0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a"
The ID of the trade
"d91d652b-d020-48d4-bf19-5c5eb5e280c7"
The amount of the from asset to be traded (in atomic units of the from asset)
"12345678"
The asset being traded
Show child attributes
The ID of the blockchain network.
"base-sepolia"
The ID for the asset on the network
"USDC"
The number of decimals the asset supports. This is used to convert from atomic units to base units.
18
The optional contract address for the asset. This will be specified for smart contract-based assets, for example ERC20s.
"0x036CbD53842c5426634e7929541eC2318f3dCF7e"
The amount of the to asset that will be received (in atomic units of the to asset)
"12345678"
The asset received from the trade
Show child attributes
The ID of the blockchain network.
"base-sepolia"
The ID for the asset on the network
"USDC"
The number of decimals the asset supports. This is used to convert from atomic units to base units.
18
The optional contract address for the asset. This will be specified for smart contract-based assets, for example ERC20s.
"0x036CbD53842c5426634e7929541eC2318f3dCF7e"
The transaction that will execute the trade onchain
Show child attributes
Blockchain network identifier.
"base-sepolia"
The onchain address of the sender
"0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a"
The unsigned payload of the transaction. This is the payload that needs to be signed by the sender.
The status of the transaction.
pending, signed, broadcast, complete, failed, unspecified The signed payload of the transaction. This is the payload that has been signed by the sender.
The hash of the transaction
"0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42"
The link to view the transaction on a block explorer. This is optional and may not be present for all transactions.
"https://sepolia.basescan.org/tx/0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42"
Show child attributes
The onchain address of the sender.
"0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a"
The onchain address of the receiver.
"0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a"
The amount of gas spent in the transaction.
1000
The price per gas spent in the transaction in atomic units of the native asset.
1000
The hash of the transaction as a hexadecimal string, prefixed with 0x.
"0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42"
The input data of the transaction.
The nonce of the transaction in the source address.
136
The index of the transaction in the block.
"0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42"
The value of the transaction in atomic units of the native asset.
100
The EIP-2718 transaction type. See https://eips.ethereum.org/EIPS/eip-2718 for more details.
2
The max fee per gas as defined in EIP-1559. https://eips.ethereum.org/EIPS/eip-1559 for more details.
190
The max priority fee per gas as defined in EIP-1559. https://eips.ethereum.org/EIPS/eip-1559 for more details.
100
The confirmed priority fee per gas as defined in EIP-1559. https://eips.ethereum.org/EIPS/eip-1559 for more details.
1000
The transaction access list as defined in EIP-2930. https://eips.ethereum.org/EIPS/eip-2930 for more details.
Show child attributes
The timestamp of the block in which the event was emitted
"2023-04-01T12:00:00Z"
This is for handling optimism rollup specific EIP-2718 transaction type field.
"0"
RLP encoded transaction as a hex string (prefixed with 0x) for native compatibility with popular eth clients such as etherjs, viem etc.
"0x02f582426882013d8502540be4008502540be41c830493e094a55416de5de61a0ac1aa8970a280e04388b1de4b6f843a4b66f1c0808080"
An optional approval transaction that will be executed before the trade transaction if present
Show child attributes
Blockchain network identifier.
"base-sepolia"
The onchain address of the sender
"0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a"
The unsigned payload of the transaction. This is the payload that needs to be signed by the sender.
The status of the transaction.
pending, signed, broadcast, complete, failed, unspecified The signed payload of the transaction. This is the payload that has been signed by the sender.
The hash of the transaction
"0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42"
The link to view the transaction on a block explorer. This is optional and may not be present for all transactions.
"https://sepolia.basescan.org/tx/0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42"
Show child attributes
The onchain address of the sender.
"0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a"
The onchain address of the receiver.
"0xfc807D1bE4997e5C7B33E4d8D57e60c5b0f02B1a"
The amount of gas spent in the transaction.
1000
The price per gas spent in the transaction in atomic units of the native asset.
1000
The hash of the transaction as a hexadecimal string, prefixed with 0x.
"0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42"
The input data of the transaction.
The nonce of the transaction in the source address.
136
The index of the transaction in the block.
"0x53e11e94ebb2438d6ddcfa07dabc9b551d2f440f8363fea941083bc397a86a42"
The value of the transaction in atomic units of the native asset.
100
The EIP-2718 transaction type. See https://eips.ethereum.org/EIPS/eip-2718 for more details.
2
The max fee per gas as defined in EIP-1559. https://eips.ethereum.org/EIPS/eip-1559 for more details.
190
The max priority fee per gas as defined in EIP-1559. https://eips.ethereum.org/EIPS/eip-1559 for more details.
100
The confirmed priority fee per gas as defined in EIP-1559. https://eips.ethereum.org/EIPS/eip-1559 for more details.
1000
The transaction access list as defined in EIP-2930. https://eips.ethereum.org/EIPS/eip-2930 for more details.
Show child attributes
The timestamp of the block in which the event was emitted
"2023-04-01T12:00:00Z"
This is for handling optimism rollup specific EIP-2718 transaction type field.
"0"
RLP encoded transaction as a hex string (prefixed with 0x) for native compatibility with popular eth clients such as etherjs, viem etc.
"0x02f582426882013d8502540be4008502540be41c830493e094a55416de5de61a0ac1aa8970a280e04388b1de4b6f843a4b66f1c0808080"
Was this page helpful?