Skip to main content
Defined in: actions/evm/types.ts:75

Type Declaration

quoteSwap()

Creates a swap quote without executing the transaction. This is useful when you need to get swap details before executing the swap. The taker is automatically set to the account’s address.

Parameters

options
AccountQuoteSwapOptions Configuration options for creating the swap quote.

Returns

Promise<AccountQuoteSwapResult> A promise that resolves to the swap quote or a response indicating that liquidity is unavailable.

Example

sendTransaction()

Signs an EVM transaction and sends it to the specified network using the Coinbase API. This method handles nonce management and gas estimation automatically.

Parameters

options
Omit<SendTransactionOptions, "address"> Configuration options for sending the transaction.

Returns

Promise<TransactionResult> A promise that resolves to the transaction hash.

Examples

Sending an RLP-encoded transaction
Sending an EIP-1559 transaction request object

swap()

Executes a token swap on the specified network. This method handles all the steps required for a swap, including Permit2 signatures if needed. The taker is automatically set to the account’s address.

Parameters

options
AccountSwapOptions Configuration options for the swap.

Returns

Promise<AccountSwapResult> A promise that resolves to the transaction hash.

Throws

If liquidity is not available when using inline options.

Examples

transfer()

Transfer an amount of a token from an account to another account.

Parameters

options
TransferOptions The options for the transfer.

Returns

Promise<{ transactionHash: Hex; }> An object containing the transaction hash.

Examples

Using parseUnits to specify USDC amount
Transfer ETH
Using a contract address
Transfer to another account

useSpendPermission()

Uses a spend permission to execute a transaction. This allows the account to spend tokens that have been approved via a spend permission.

Parameters

options
UseSpendPermissionOptions Configuration options for using the spend permission.

Returns

Promise<TransactionResult> A promise that resolves to the transaction result.

Throws

If the network doesn’t support spend permissions via CDP API.

Example