Skip to main content

Type Aliases

AccountActions

Defined in: src/actions/evm/types.ts:148

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

Actions

Defined in: src/actions/evm/types.ts:42

Properties

fund()
Defined in: src/actions/evm/types.ts:126 Funds an EVM account with the specified token amount.
Parameters
options
Omit<EvmFundOptions, "address"> The options for the fund operation.
Returns
Promise<FundOperationResult> A promise that resolves to the fund operation result containing the transfer details.
Example
listTokenBalances()
Defined in: src/actions/evm/types.ts:58 List the token balances of an account.
Parameters
options
Omit<ListTokenBalancesOptions, "address"> The options for the list token balances.
Returns
Promise<ListTokenBalancesResult> The result of the list token balances.
Example
quoteFund()
Defined in: src/actions/evm/types.ts:103 Gets a quote to fund an EVM account.
Parameters
options
Omit<EvmQuoteFundOptions, "address"> The options for the quote fund.
Returns
Promise<EvmQuote> A promise that resolves to a Quote object containing details about the funding operation.
Example
requestFaucet()
Defined in: src/actions/evm/types.ts:80 Requests funds from an EVM faucet.
Parameters
options
Omit<RequestFaucetOptions, "address"> Parameters for requesting funds from the EVM faucet.
Returns
Promise<RequestFaucetResult> A promise that resolves to the transaction hash.
Example

Methods

waitForFundOperationReceipt()
Defined in: src/actions/evm/types.ts:143 Waits for a fund operation to complete and returns the transfer receipt.
Parameters
options
WaitForFundOperationOptions The options for the wait for fund operation.
Returns
Promise<WaitForFundOperationResult> A promise that resolves to the completed transfer receipt containing details about the funding operation.
Example

SmartAccountActions

Defined in: src/actions/evm/types.ts:399

Type declaration

getUserOperation()
Gets a user operation by its hash.
Parameters
options
Omit<GetUserOperationOptions, "smartAccount"> Parameters for getting the user operation.
Returns
Promise<UserOperation> A promise that resolves to the user operation.
Example
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 smart account’s address.
Parameters
options
SmartAccountQuoteSwapOptions Configuration options for creating the swap quote.
Returns
Promise<SmartAccountQuoteSwapResult> A promise that resolves to the swap quote or a response indicating that liquidity is unavailable.
Example
sendUserOperation()
Sends a user operation.
Parameters
options
Omit<SendUserOperationOptions<unknown[]>, "smartAccount"> Parameters for sending the user operation.
Returns
Promise<SendUserOperationReturnType> A promise that resolves to an object containing the smart account address, the user operation hash, and the status of the user operation.
Example
signTypedData()
Signs a typed data message.
Parameters
options
Omit<SignTypedDataOptions, "address"> & { network: KnownEvmNetworks; } Configuration options for signing the typed data.
Returns
Promise<Hex> A promise that resolves to the signature.
Example
swap()
Executes a token swap on the specified network via a user operation. This method handles all the steps required for a swap, including Permit2 signatures if needed. The taker is automatically set to the smart account’s address.
Parameters
options
SmartAccountSwapOptions Configuration options for the swap.
Returns
Promise<SmartAccountSwapResult> A promise that resolves to the user operation result.
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
SmartAccountTransferOptions The options for the transfer.
Returns
Promise<SendUserOperationReturnType> The user operation result.
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 via user operation. This allows the smart account to spend tokens that have been approved via a spend permission.
Parameters
options
UseSpendPermissionOptions Configuration options for using the spend permission.
Returns
Promise<SendUserOperationReturnType> A promise that resolves to the user operation result.
Throws
If the network doesn’t support spend permissions via CDP API.
Example
waitForUserOperation()
Waits for a user operation to complete or fail.
Parameters
options
Omit<WaitForUserOperationOptions, "smartAccountAddress"> Parameters for waiting for the user operation.
Returns
Promise<WaitForUserOperationReturnType> A promise that resolves to the transaction receipt.
Example