coinbase_agentkit.wallet_providers package

Submodules

coinbase_agentkit.wallet_providers.cdp_wallet_provider module

CDP Wallet provider.

class coinbase_agentkit.wallet_providers.cdp_wallet_provider.CdpProviderConfig(**data)

Bases: BaseModel

Configuration options for CDP providers.

api_key_name: str | None
api_key_private_key: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class coinbase_agentkit.wallet_providers.cdp_wallet_provider.CdpWalletProvider(config=None)

Bases: EvmWalletProvider

A wallet provider that uses the CDP SDK.

deploy_contract(solidity_version, solidity_input_json, contract_name, constructor_args)

Deploy a smart contract.

Parameters:
  • solidity_version (str) – The version of the Solidity compiler to use

  • solidity_input_json (str) – The JSON input for the Solidity compiler

  • contract_name (str) – The name of the contract to deploy

  • constructor_args (dict[str, Any]) – Key-value map of constructor arguments

Returns:

The deployed contract instance

Return type:

Any

Raises:

Exception – If wallet is not initialized or deployment fails

deploy_nft(name, symbol, base_uri)

Deploy a new NFT (ERC-721) smart contract.

Parameters:
  • name (str) – The name of the NFT collection

  • symbol (str) – The token symbol for the collection

  • base_uri (str) – The base URI for token metadata

Returns:

The deployed NFT contract instance

Return type:

Any

Raises:

Exception – If wallet is not initialized or deployment fails

deploy_token(name, symbol, total_supply)

Deploy an ERC20 token contract.

Parameters:
  • name (str) – The name of the token

  • symbol (str) – The symbol of the token

  • total_supply (str) – The total supply of the token

Returns:

The deployed token contract instance

Return type:

Any

Raises:

Exception – If wallet is not initialized or deployment fails

export_wallet()

Export the wallet data for persistence.

Returns:

The wallet data object containing all necessary information

Return type:

WalletData

Raises:

Exception – If wallet is not initialized

get_address()

Get the wallet address.

Returns:

The wallet’s address as a hex string

Return type:

str

get_balance()

Get the wallet balance in native currency.

Returns:

The wallet’s balance in wei as a Decimal

Return type:

Decimal

Raises:

Exception – If wallet is not initialized

get_name()

Get the name of the wallet provider.

Returns:

The string ‘cdp_wallet_provider’

Return type:

str

get_network()

Get the current network.

Returns:

Network object containing protocol family, network ID, and chain ID

Return type:

Network

native_transfer(to, value)

Transfer the native asset of the network.

Parameters:
  • to (str) – The destination address to receive the transfer

  • value (Decimal) – The amount to transfer in whole units (e.g. 1.5 for 1.5 ETH)

Returns:

The transaction hash as a string

Return type:

str

Raises:

Exception – If transfer fails or wallet is not initialized

read_contract(contract_address, abi, function_name, args=None, block_identifier='latest')

Read data from a smart contract.

Parameters:
  • contract_address (ChecksumAddress) – The address of the contract to read from

  • abi (list[dict[str, Any]]) – The ABI of the contract

  • function_name (str) – The name of the function to call

  • args (list[Any] | None) – Arguments to pass to the function call, defaults to empty list

  • block_identifier (BlockIdentifier) – The block number to read from, defaults to ‘latest’

Returns:

The result of the contract function call

Return type:

Any

Raises:

Exception – If the contract call fails or wallet is not initialized

send_transaction(transaction)

Send a signed transaction to the network.

Parameters:

transaction (TxParams) – Transaction parameters including to, value, and data

Returns:

The transaction hash as a hex string

Return type:

HexStr

Raises:

Exception – If transaction preparation or sending fails

sign_message(message)

Sign a message using the wallet’s private key.

Parameters:

message (str | bytes) – The message to sign, either as a string or bytes

Returns:

The signature as a hex string

Return type:

HexStr

Raises:

Exception – If the wallet is not initialized or signing fails

sign_transaction(transaction)

Sign an EVM transaction.

Parameters:

transaction (TxParams) – Transaction parameters including to, value, and data

Returns:

The transaction signature as a hex string

Return type:

HexStr

Raises:

Exception – If wallet is not initialized or signing fails

sign_typed_data(typed_data)

Sign typed data according to EIP-712 standard.

Parameters:

typed_data (dict[str, Any]) – The typed data to sign following EIP-712 format

Returns:

The signature as a hex string

Return type:

HexStr

Raises:

Exception – If the wallet is not initialized or signing fails

trade(amount, from_asset_id, to_asset_id)

Trade a specified amount of one asset for another.

Parameters:
  • amount (str) – The amount of the from asset to trade, e.g. 15, 0.000001.

  • from_asset_id (str) – The from asset ID to trade (e.g., “eth”, “usdc”, or a valid contract address).

  • to_asset_id (str) – The to asset ID to trade (e.g., “eth”, “usdc”, or a valid contract address).

Returns:

A message containing the trade details and transaction information

Return type:

str

Raises:

Exception – If trade fails or wallet is not initialized

wait_for_transaction_receipt(tx_hash, timeout=120, poll_latency=0.1)

Wait for transaction confirmation and return receipt.

Parameters:
  • tx_hash (HexStr) – The transaction hash to wait for

  • timeout (float) – Maximum time to wait in seconds, defaults to 120

  • poll_latency (float) – Time between polling attempts in seconds, defaults to 0.1

Returns:

The transaction receipt as a dictionary

Return type:

dict[str, Any]

Raises:

TimeoutError – If transaction is not mined within timeout period

class coinbase_agentkit.wallet_providers.cdp_wallet_provider.CdpWalletProviderConfig(**data)

Bases: CdpProviderConfig

Configuration options for CDP wallet provider.

api_key_name: str | None
api_key_private_key: str | None
gas: EvmGasConfig | None
mnemonic_phrase: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_id: str | None
wallet_data: str | None

coinbase_agentkit.wallet_providers.eth_account_wallet_provider module

Eth account wallet provider.

class coinbase_agentkit.wallet_providers.eth_account_wallet_provider.EthAccountWalletProvider(config)

Bases: EvmWalletProvider

A wallet provider that uses eth-account and web3.py for EVM chain interactions.

estimate_fees()

Estimate gas fees for a transaction, applying the configured fee multipliers.

Returns:

Tuple of (max_priority_fee_per_gas, max_fee_per_gas) in wei

Return type:

tuple[int, int]

get_address()

Get the wallet address.

Returns:

The wallet’s address as a hex string.

Return type:

str

get_balance()

Get the wallet balance in native currency.

Returns:

The wallet’s balance in wei as a Decimal

Return type:

Decimal

get_name()

Get the name of the wallet provider.

Returns:

The string ‘eth_account_wallet_provider’

Return type:

str

get_network()

Get the current network.

Returns:

Network object containing protocol family, network ID, and chain ID.

Return type:

Network

native_transfer(to, value)

Transfer the native asset of the network.

Parameters:
  • to (str) – The destination address to receive the transfer

  • value (Decimal) – The amount to transfer in whole units (e.g. 1.5 for 1.5 ETH)

Returns:

The transaction hash as a string

Return type:

str

Raises:

Exception – If transfer fails

read_contract(contract_address, abi, function_name, args=None, block_identifier='latest')

Read data from a smart contract.

Parameters:
  • contract_address (ChecksumAddress) – The address of the contract to read from

  • abi (list[dict[str, Any]]) – The ABI of the contract

  • function_name (str) – The name of the function to call

  • args (list[Any] | None) – Arguments to pass to the function call, defaults to empty list

  • block_identifier (BlockIdentifier) – The block number to read from, defaults to ‘latest’

Returns:

The result of the contract function call

Return type:

Any

send_transaction(transaction)

Send a signed transaction to the network.

Parameters:

transaction (TxParams) – Transaction parameters including to, value, and data

Returns:

The transaction hash as a hex string

Return type:

HexStr

Raises:

Exception – If transaction preparation or sending fails

sign_message(message)

Sign a message using the wallet’s private key.

Parameters:

message (str | bytes) – The message to sign, either as a string or bytes

Returns:

The signature as a hex string

Return type:

HexStr

sign_transaction(transaction)

Sign an EVM transaction.

Parameters:

transaction (TxParams) – Transaction parameters including to, value, and data.

Returns:

The signed transaction object

Return type:

SignedTransaction

sign_typed_data(typed_data)

Sign typed data according to EIP-712 standard.

Parameters:

typed_data (dict[str, Any]) – The typed data to sign following EIP-712 format

Returns:

The signature as a hex string

Return type:

HexStr

wait_for_transaction_receipt(tx_hash, timeout=120, poll_latency=0.1)

Wait for transaction confirmation and return receipt.

Parameters:
  • tx_hash (HexStr) – The transaction hash to wait for

  • timeout (float) – Maximum time to wait in seconds, defaults to 120

  • poll_latency (float) – Time between polling attempts in seconds, defaults to 0.1

Returns:

The transaction receipt as a dictionary

Return type:

dict[str, Any]

Raises:

TimeoutError – If transaction is not mined within timeout period

class coinbase_agentkit.wallet_providers.eth_account_wallet_provider.EthAccountWalletProviderConfig(**data)

Bases: BaseModel

Configuration for EthAccountWalletProvider.

class Config

Bases: object

Configuration for EthAccountWalletProvider.

arbitrary_types_allowed = True
account: LocalAccount
chain_id: str
gas: EvmGasConfig | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

rpc_url: str | None

coinbase_agentkit.wallet_providers.evm_wallet_provider module

Base class for EVM-compatible wallet providers.

class coinbase_agentkit.wallet_providers.evm_wallet_provider.EvmGasConfig(**data)

Bases: BaseModel

Configuration for gas multipliers.

fee_per_gas_multiplier: float | None
gas_limit_multiplier: float | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class coinbase_agentkit.wallet_providers.evm_wallet_provider.EvmWalletProvider(*args, **kwargs)

Bases: WalletProvider, ABC

Abstract base class for all EVM wallet providers.

abstract read_contract(contract_address, abi, function_name, args=None, block_identifier='latest')

Read data from a smart contract.

Return type:

Any

abstract send_transaction(transaction)

Send a signed transaction to the network.

Return type:

NewType(HexStr, str)

abstract sign_message(message)

Sign a message using the wallet’s private key.

Return type:

NewType(HexStr, str)

abstract sign_transaction(transaction)

Sign an EVM transaction.

Return type:

SignedTransaction

abstract sign_typed_data(typed_data)

Sign typed data according to EIP-712 standard.

Return type:

NewType(HexStr, str)

abstract wait_for_transaction_receipt(tx_hash, timeout=120, poll_latency=0.1)

Wait for transaction confirmation and return receipt.

Return type:

dict[str, Any]

coinbase_agentkit.wallet_providers.smart_wallet_provider module

class coinbase_agentkit.wallet_providers.smart_wallet_provider.SmartWalletProvider(config)

Bases: EvmWalletProvider

A wallet provider that uses the Coinbase Smart Wallet SDK.

get_address()

Get the smart wallet address.

Return type:

str

get_balance()

Get the balance of the smart wallet.

Return type:

Decimal

get_name()

Get the name of the wallet provider.

Return type:

str

get_network()

Get the network information.

Return type:

Network

native_transfer(to, value)

Transfer native assets using the smart wallet.

Return type:

NewType(HexStr, str)

read_contract(contract_address, abi, function_name, args=None, block_identifier='latest')

Read data from a smart contract.

Return type:

Any

send_transaction(transaction)

Send a transaction using the smart wallet.

Unlike traditional Ethereum transactions, this method submits a User Operation instead of directly broadcasting a transaction. The smart wallet handles execution, but a standard transaction hash is still returned upon completion.

Return type:

NewType(HexStr, str)

send_user_operation(calls)

Send a user operation directly.

This method directly exposes the sendUserOperation functionality, allowing SmartWallet-aware tools to fully leverage its capabilities, including batching multiple calls. Unlike send_transaction, which wraps calls in a single operation, this method allows direct execution of arbitrary operations within a User Operation.

Return type:

NewType(HexStr, str)

sign_message(message)

Smart wallets cannot sign raw messages.

Raises:

NotImplementedError – Always, since smart wallets do not support signing raw messages.

Return type:

NewType(HexStr, str)

sign_transaction(transaction)

Smart wallets cannot sign transactions.

Raises:

NotImplementedError – Always, since smart wallets do not support signing transactions.

Return type:

SignedTransaction

sign_typed_data(typed_data)

Smart wallets cannot sign typed data.

Raises:

NotImplementedError – Always, since smart wallets do not support signing typed data.

Return type:

NewType(HexStr, str)

wait_for_transaction_receipt(tx_hash, timeout=120, poll_latency=0.1)

Wait for a transaction receipt.

Return type:

dict[str, Any]

class coinbase_agentkit.wallet_providers.smart_wallet_provider.SmartWalletProviderConfig(**data)

Bases: BaseModel

Configuration for SmartWalletProvider.

class Config

Bases: object

Configuration for SmartWalletProvider.

arbitrary_types_allowed = True
cdp_api_key_name: str | None
cdp_api_key_private_key: str | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_id: str
paymaster_url: str | None
signer: LocalAccount
smart_wallet_address: str | None

coinbase_agentkit.wallet_providers.wallet_provider module

Base class for wallet providers.

class coinbase_agentkit.wallet_providers.wallet_provider.WalletProvider(*args, **kwargs)

Bases: ABC

Base class for all wallet providers.

abstract get_address()

Get the wallet address.

Return type:

str

abstract get_balance()

Get the wallet balance in native currency.

Return type:

Decimal

abstract get_name()

Get the name of the wallet provider.

Return type:

str

abstract get_network()

Get the current network.

Return type:

Network

abstract native_transfer(to, value)

Transfer the native asset of the network.

Return type:

str

abstract sign_message(message)

Sign a message with the wallet.

Return type:

str

track_initialization()

Track the initialization of the wallet provider.

Return type:

None

class coinbase_agentkit.wallet_providers.wallet_provider.WalletProviderMeta(name, bases, namespace, **kwargs)

Bases: ABCMeta

Metaclass for WalletProvider to handle initialization tracking.

Module contents

Wallet providers for AgentKit.

class coinbase_agentkit.wallet_providers.CdpProviderConfig(**data)

Bases: BaseModel

Configuration options for CDP providers.

api_key_name: str | None
api_key_private_key: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class coinbase_agentkit.wallet_providers.CdpWalletProvider(config=None)

Bases: EvmWalletProvider

A wallet provider that uses the CDP SDK.

deploy_contract(solidity_version, solidity_input_json, contract_name, constructor_args)

Deploy a smart contract.

Parameters:
  • solidity_version (str) – The version of the Solidity compiler to use

  • solidity_input_json (str) – The JSON input for the Solidity compiler

  • contract_name (str) – The name of the contract to deploy

  • constructor_args (dict[str, Any]) – Key-value map of constructor arguments

Returns:

The deployed contract instance

Return type:

Any

Raises:

Exception – If wallet is not initialized or deployment fails

deploy_nft(name, symbol, base_uri)

Deploy a new NFT (ERC-721) smart contract.

Parameters:
  • name (str) – The name of the NFT collection

  • symbol (str) – The token symbol for the collection

  • base_uri (str) – The base URI for token metadata

Returns:

The deployed NFT contract instance

Return type:

Any

Raises:

Exception – If wallet is not initialized or deployment fails

deploy_token(name, symbol, total_supply)

Deploy an ERC20 token contract.

Parameters:
  • name (str) – The name of the token

  • symbol (str) – The symbol of the token

  • total_supply (str) – The total supply of the token

Returns:

The deployed token contract instance

Return type:

Any

Raises:

Exception – If wallet is not initialized or deployment fails

export_wallet()

Export the wallet data for persistence.

Returns:

The wallet data object containing all necessary information

Return type:

WalletData

Raises:

Exception – If wallet is not initialized

get_address()

Get the wallet address.

Returns:

The wallet’s address as a hex string

Return type:

str

get_balance()

Get the wallet balance in native currency.

Returns:

The wallet’s balance in wei as a Decimal

Return type:

Decimal

Raises:

Exception – If wallet is not initialized

get_name()

Get the name of the wallet provider.

Returns:

The string ‘cdp_wallet_provider’

Return type:

str

get_network()

Get the current network.

Returns:

Network object containing protocol family, network ID, and chain ID

Return type:

Network

native_transfer(to, value)

Transfer the native asset of the network.

Parameters:
  • to (str) – The destination address to receive the transfer

  • value (Decimal) – The amount to transfer in whole units (e.g. 1.5 for 1.5 ETH)

Returns:

The transaction hash as a string

Return type:

str

Raises:

Exception – If transfer fails or wallet is not initialized

read_contract(contract_address, abi, function_name, args=None, block_identifier='latest')

Read data from a smart contract.

Parameters:
  • contract_address (ChecksumAddress) – The address of the contract to read from

  • abi (list[dict[str, Any]]) – The ABI of the contract

  • function_name (str) – The name of the function to call

  • args (list[Any] | None) – Arguments to pass to the function call, defaults to empty list

  • block_identifier (BlockIdentifier) – The block number to read from, defaults to ‘latest’

Returns:

The result of the contract function call

Return type:

Any

Raises:

Exception – If the contract call fails or wallet is not initialized

send_transaction(transaction)

Send a signed transaction to the network.

Parameters:

transaction (TxParams) – Transaction parameters including to, value, and data

Returns:

The transaction hash as a hex string

Return type:

HexStr

Raises:

Exception – If transaction preparation or sending fails

sign_message(message)

Sign a message using the wallet’s private key.

Parameters:

message (str | bytes) – The message to sign, either as a string or bytes

Returns:

The signature as a hex string

Return type:

HexStr

Raises:

Exception – If the wallet is not initialized or signing fails

sign_transaction(transaction)

Sign an EVM transaction.

Parameters:

transaction (TxParams) – Transaction parameters including to, value, and data

Returns:

The transaction signature as a hex string

Return type:

HexStr

Raises:

Exception – If wallet is not initialized or signing fails

sign_typed_data(typed_data)

Sign typed data according to EIP-712 standard.

Parameters:

typed_data (dict[str, Any]) – The typed data to sign following EIP-712 format

Returns:

The signature as a hex string

Return type:

HexStr

Raises:

Exception – If the wallet is not initialized or signing fails

trade(amount, from_asset_id, to_asset_id)

Trade a specified amount of one asset for another.

Parameters:
  • amount (str) – The amount of the from asset to trade, e.g. 15, 0.000001.

  • from_asset_id (str) – The from asset ID to trade (e.g., “eth”, “usdc”, or a valid contract address).

  • to_asset_id (str) – The to asset ID to trade (e.g., “eth”, “usdc”, or a valid contract address).

Returns:

A message containing the trade details and transaction information

Return type:

str

Raises:

Exception – If trade fails or wallet is not initialized

wait_for_transaction_receipt(tx_hash, timeout=120, poll_latency=0.1)

Wait for transaction confirmation and return receipt.

Parameters:
  • tx_hash (HexStr) – The transaction hash to wait for

  • timeout (float) – Maximum time to wait in seconds, defaults to 120

  • poll_latency (float) – Time between polling attempts in seconds, defaults to 0.1

Returns:

The transaction receipt as a dictionary

Return type:

dict[str, Any]

Raises:

TimeoutError – If transaction is not mined within timeout period

class coinbase_agentkit.wallet_providers.CdpWalletProviderConfig(**data)

Bases: CdpProviderConfig

Configuration options for CDP wallet provider.

api_key_name: str | None
api_key_private_key: str | None
gas: EvmGasConfig | None
mnemonic_phrase: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_id: str | None
wallet_data: str | None
class coinbase_agentkit.wallet_providers.EthAccountWalletProvider(config)

Bases: EvmWalletProvider

A wallet provider that uses eth-account and web3.py for EVM chain interactions.

estimate_fees()

Estimate gas fees for a transaction, applying the configured fee multipliers.

Returns:

Tuple of (max_priority_fee_per_gas, max_fee_per_gas) in wei

Return type:

tuple[int, int]

get_address()

Get the wallet address.

Returns:

The wallet’s address as a hex string.

Return type:

str

get_balance()

Get the wallet balance in native currency.

Returns:

The wallet’s balance in wei as a Decimal

Return type:

Decimal

get_name()

Get the name of the wallet provider.

Returns:

The string ‘eth_account_wallet_provider’

Return type:

str

get_network()

Get the current network.

Returns:

Network object containing protocol family, network ID, and chain ID.

Return type:

Network

native_transfer(to, value)

Transfer the native asset of the network.

Parameters:
  • to (str) – The destination address to receive the transfer

  • value (Decimal) – The amount to transfer in whole units (e.g. 1.5 for 1.5 ETH)

Returns:

The transaction hash as a string

Return type:

str

Raises:

Exception – If transfer fails

read_contract(contract_address, abi, function_name, args=None, block_identifier='latest')

Read data from a smart contract.

Parameters:
  • contract_address (ChecksumAddress) – The address of the contract to read from

  • abi (list[dict[str, Any]]) – The ABI of the contract

  • function_name (str) – The name of the function to call

  • args (list[Any] | None) – Arguments to pass to the function call, defaults to empty list

  • block_identifier (BlockIdentifier) – The block number to read from, defaults to ‘latest’

Returns:

The result of the contract function call

Return type:

Any

send_transaction(transaction)

Send a signed transaction to the network.

Parameters:

transaction (TxParams) – Transaction parameters including to, value, and data

Returns:

The transaction hash as a hex string

Return type:

HexStr

Raises:

Exception – If transaction preparation or sending fails

sign_message(message)

Sign a message using the wallet’s private key.

Parameters:

message (str | bytes) – The message to sign, either as a string or bytes

Returns:

The signature as a hex string

Return type:

HexStr

sign_transaction(transaction)

Sign an EVM transaction.

Parameters:

transaction (TxParams) – Transaction parameters including to, value, and data.

Returns:

The signed transaction object

Return type:

SignedTransaction

sign_typed_data(typed_data)

Sign typed data according to EIP-712 standard.

Parameters:

typed_data (dict[str, Any]) – The typed data to sign following EIP-712 format

Returns:

The signature as a hex string

Return type:

HexStr

wait_for_transaction_receipt(tx_hash, timeout=120, poll_latency=0.1)

Wait for transaction confirmation and return receipt.

Parameters:
  • tx_hash (HexStr) – The transaction hash to wait for

  • timeout (float) – Maximum time to wait in seconds, defaults to 120

  • poll_latency (float) – Time between polling attempts in seconds, defaults to 0.1

Returns:

The transaction receipt as a dictionary

Return type:

dict[str, Any]

Raises:

TimeoutError – If transaction is not mined within timeout period

class coinbase_agentkit.wallet_providers.EthAccountWalletProviderConfig(**data)

Bases: BaseModel

Configuration for EthAccountWalletProvider.

class Config

Bases: object

Configuration for EthAccountWalletProvider.

arbitrary_types_allowed = True
account: LocalAccount
chain_id: str
gas: EvmGasConfig | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

rpc_url: str | None
class coinbase_agentkit.wallet_providers.EvmWalletProvider(*args, **kwargs)

Bases: WalletProvider, ABC

Abstract base class for all EVM wallet providers.

abstract read_contract(contract_address, abi, function_name, args=None, block_identifier='latest')

Read data from a smart contract.

Return type:

Any

abstract send_transaction(transaction)

Send a signed transaction to the network.

Return type:

NewType(HexStr, str)

abstract sign_message(message)

Sign a message using the wallet’s private key.

Return type:

NewType(HexStr, str)

abstract sign_transaction(transaction)

Sign an EVM transaction.

Return type:

SignedTransaction

abstract sign_typed_data(typed_data)

Sign typed data according to EIP-712 standard.

Return type:

NewType(HexStr, str)

abstract wait_for_transaction_receipt(tx_hash, timeout=120, poll_latency=0.1)

Wait for transaction confirmation and return receipt.

Return type:

dict[str, Any]

class coinbase_agentkit.wallet_providers.SmartWalletProvider(config)

Bases: EvmWalletProvider

A wallet provider that uses the Coinbase Smart Wallet SDK.

get_address()

Get the smart wallet address.

Return type:

str

get_balance()

Get the balance of the smart wallet.

Return type:

Decimal

get_name()

Get the name of the wallet provider.

Return type:

str

get_network()

Get the network information.

Return type:

Network

native_transfer(to, value)

Transfer native assets using the smart wallet.

Return type:

NewType(HexStr, str)

read_contract(contract_address, abi, function_name, args=None, block_identifier='latest')

Read data from a smart contract.

Return type:

Any

send_transaction(transaction)

Send a transaction using the smart wallet.

Unlike traditional Ethereum transactions, this method submits a User Operation instead of directly broadcasting a transaction. The smart wallet handles execution, but a standard transaction hash is still returned upon completion.

Return type:

NewType(HexStr, str)

send_user_operation(calls)

Send a user operation directly.

This method directly exposes the sendUserOperation functionality, allowing SmartWallet-aware tools to fully leverage its capabilities, including batching multiple calls. Unlike send_transaction, which wraps calls in a single operation, this method allows direct execution of arbitrary operations within a User Operation.

Return type:

NewType(HexStr, str)

sign_message(message)

Smart wallets cannot sign raw messages.

Raises:

NotImplementedError – Always, since smart wallets do not support signing raw messages.

Return type:

NewType(HexStr, str)

sign_transaction(transaction)

Smart wallets cannot sign transactions.

Raises:

NotImplementedError – Always, since smart wallets do not support signing transactions.

Return type:

SignedTransaction

sign_typed_data(typed_data)

Smart wallets cannot sign typed data.

Raises:

NotImplementedError – Always, since smart wallets do not support signing typed data.

Return type:

NewType(HexStr, str)

wait_for_transaction_receipt(tx_hash, timeout=120, poll_latency=0.1)

Wait for a transaction receipt.

Return type:

dict[str, Any]

class coinbase_agentkit.wallet_providers.SmartWalletProviderConfig(**data)

Bases: BaseModel

Configuration for SmartWalletProvider.

class Config

Bases: object

Configuration for SmartWalletProvider.

arbitrary_types_allowed = True
cdp_api_key_name: str | None
cdp_api_key_private_key: str | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_id: str
paymaster_url: str | None
signer: LocalAccount
smart_wallet_address: str | None
class coinbase_agentkit.wallet_providers.WalletProvider(*args, **kwargs)

Bases: ABC

Base class for all wallet providers.

abstract get_address()

Get the wallet address.

Return type:

str

abstract get_balance()

Get the wallet balance in native currency.

Return type:

Decimal

abstract get_name()

Get the name of the wallet provider.

Return type:

str

abstract get_network()

Get the current network.

Return type:

Network

abstract native_transfer(to, value)

Transfer the native asset of the network.

Return type:

str

abstract sign_message(message)

Sign a message with the wallet.

Return type:

str

track_initialization()

Track the initialization of the wallet provider.

Return type:

None