Sending Transactions
The CDP SDK’s sendTransaction
method handles gas estimation, nonce management, transaction signing,
and broadcasting for EVM accounts. This means that you don’t need to specify these details when you submit
a transaction onchain. CDP’s nonce management system ensures that the nonce is set correctly for each transaction,
and the gas price is estimated to ensure that the transaction is sent at a reasonable price.
You can read more about the sendTransaction
API in the API Reference.
The SendTransaction API, which handles both signing and broadcasting, is currently supported only on Base and Ethereum networks. For other networks, use the SignTransaction API for signing and rely on your own RPC URLs to broadcast transactions as shown here.
The following code snippet demonstrates how to send a transaction using the sendTransaction
method.
You can also refer to our example code in
Typescript and
Python.