EvmServerAccount
An EVM server account managed by the CDP API. Provides async methods for signing messages and transactions.Constructor
This constructor is typically not called directly. Use
CdpClient.evm.create_account() instead.Properties
address
The EVM account address (0x-prefixed hex string).
name
The name of the EVM account, or None if not set.
policies
The list of Policy IDs.
Methods
sign_message
The encoded message, ready for signing.
Optional idempotency key for safe retryable requests.
The signed message with signature components (r, s, v).
unsafe_sign_hash
32 byte hash of the message to sign.
Optional idempotency key.
The signed message with signature components.
sign_transaction
Transaction with all fields specified.
Optional idempotency key.
The signed transaction.
transfer
The account or 0x-prefixed address to transfer the token to.
The amount of the token to transfer, represented as an atomic unit (e.g. 10000 for 0.01 USDC). The cdp module exports a
parse_units util to convert to atomic units.The token to transfer (e.g., “usdc”, “eth”).
The network to transfer the token on (e.g., “base-sepolia”, “base”).
The result of the transfer.
swap
The swap options containing network, tokens, amounts, and optional quote.
The result containing the transaction hash.
quote_swap
The contract address of the token to swap from.
The contract address of the token to swap to.
The amount to swap from (in smallest unit).
The network to execute the swap on.
Maximum slippage in basis points (100 = 1%).
The address that will sign the transaction (for smart accounts).
Optional idempotency key for safe retryable requests.
The swap quote with transaction data.
request_faucet
The network to request the faucet for.
The token to request the faucet for.
The transaction hash of the faucet request.
sign_typed_data
The domain of the message.
The types of the message.
The primary type of the message.
The message to sign.
Optional idempotency key.
The signature.
list_token_balances
The network to list the token balances for.
The number of token balances to return per page.
The token for the next page of token balances, if any.
The token balances for the account on the network.
send_transaction
The transaction to send. This can be either an RLP-encoded transaction to sign and send (as a 0x-prefixed hex string), or an EIP-1559 transaction request object.Use
TransactionRequestEIP1559 if you would like Coinbase to manage the nonce and gas parameters.These are the fields that can be contained in the transaction object:to: (Required) The address of the contract or account to send the transaction to.value: (Optional) The amount of ETH, in wei, to send with the transaction.data: (Optional) The data to send with the transaction; only used for contract calls.gas: (Optional) The amount of gas to use for the transaction.nonce: (Optional) The nonce to use for the transaction.maxFeePerGas: (Optional) The maximum fee per gas.maxPriorityFeePerGas: (Optional) The maximum priority fee per gas.accessList: (Optional) The access list to use for the transaction.
The network.
Optional idempotency key.
The transaction hash.
use_spend_permission
The spend permission object containing authorization details.
The amount to spend (must not exceed the permission’s allowance).
The network to execute the transaction on.
The transaction hash.