sendTransaction feature that simplifies sending onchain transactions.
For EVM, it handles gas estimation, nonce management, signing, and broadcasting automatically.
For Solana, it handles signing and broadcasting, and sets the required priority fees for optimal transaction pricing.
EVM
- React
- Node (TypeScript)
- Python
After the user logs in, use
useSendEvmTransaction from cdp-hooks to send EVM transactions from the user’s wallet.Network-scoped accounts
UseuseNetwork() to scope an account to a specific network once, avoiding the need to pass network on every call. When scoped to Base or Base Sepolia, the SDK automatically uses CDP’s managed RPC endpoints.
Node (TypeScript)
Node (TypeScript)
Solana
Solana transactions require building and serializing a transaction before sending. CDP injects the latest blockhash before broadcasting, so use the placeholder blockhash shown below.- React
- Node (TypeScript)
- Python
Use
useSendSolanaTransaction for programmatic control, or SendSolanaTransactionButton for a pre-built UI button with built-in loading and error states.Bring your own node
UsesignTransaction to sign with CDP and broadcast via a custom RPC node:
- Node (TypeScript)
- Python
Priority fees
The priority fee increases the likelihood of your transaction being included in the next block. Priority fee = Compute unit limit × Compute unit price- Node (TypeScript)
- Python
Fee sponsorship
CDP can pay the Solana network fee on behalf of your wallet. PassuseCdpSponsor: true when calling sendTransaction.
Fee sponsorship is in private preview and available to enterprise-scale integrations only. To opt in, apply for access.
- React
- Node (TypeScript)
- Python
Send USDC
USDC uses 6 decimal places, so1000000 atomic units equals 1 USDC.
- React
- Node (TypeScript)
- Python
The For Smart Accounts, pass
useSendUsdc hook from @coinbase/cdp-hooks works across all account types (EOA, Smart Account, Solana) and handles contract addresses, decimal conversion, and Associated Token Account creation automatically.useCdpPaymaster: true for gasless transactions. For Solana, pass createRecipientAta: true to create the recipient’s token account if it doesn’t exist.See the full parameter reference in the CDP Web SDK docs.Webhooks
Subscribe to transaction lifecycle events using CDP Wallet Webhooks. Thewallet.transaction.* events let you track each transaction from creation through confirmation or failure in real time.