coinbase_agentkit.action_providers package

Subpackages

Submodules

coinbase_agentkit.action_providers.action_decorator module

Decorator utilities for creating and managing actions.

class coinbase_agentkit.action_providers.action_decorator.ActionMetadata(**data)

Bases: BaseModel

Metadata for an action.

args_schema: type[BaseModel] | None
description: str
invoke: Callable
model_config: ClassVar[ConfigDict] = {}

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

name: str
wallet_provider: bool
class coinbase_agentkit.action_providers.action_decorator.WalletMetadata

Bases: TypedDict

Metadata for a wallet.

chain_id: str
network_id: str
protocol_family: str
wallet_address: str
wallet_provider: str
coinbase_agentkit.action_providers.action_decorator.create_action(name, description, schema=None)

Decorate an action with a name, description, and schema.

coinbase_agentkit.action_providers.action_provider module

Base class for action providers.

class coinbase_agentkit.action_providers.action_provider.Action(**data)

Bases: BaseModel

Represents an action that can be performed by an agent.

args_schema: type[BaseModel] | None
description: str
invoke: Callable
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

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

name: str
class coinbase_agentkit.action_providers.action_provider.ActionProvider(name, action_providers)

Bases: Generic[TWalletProvider], ABC

Base class for all action providers.

get_actions(wallet_provider)

Get all actions from this provider and its sub-providers.

Return type:

list[Action]

abstract supports_network(network)

Check if this provider supports the given network.

Return type:

bool

Module contents

Action providers for AgentKit.

class coinbase_agentkit.action_providers.Action(**data)

Bases: BaseModel

Represents an action that can be performed by an agent.

args_schema: type[BaseModel] | None
description: str
invoke: Callable
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

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

name: str
class coinbase_agentkit.action_providers.ActionProvider(name, action_providers)

Bases: Generic[TWalletProvider], ABC

Base class for all action providers.

get_actions(wallet_provider)

Get all actions from this provider and its sub-providers.

Return type:

list[Action]

abstract supports_network(network)

Check if this provider supports the given network.

Return type:

bool

class coinbase_agentkit.action_providers.AlloraActionProvider(api_key=None, chain_slug=None)

Bases: ActionProvider[WalletProvider]

Action provider for interacting with Allora Network.

get_all_topics(args)

Get all available topics from Allora Network.

Return type:

str

get_inference_by_topic_id(args)

Get inference data for a specific topic.

Return type:

str

get_price_inference(args)

Get price inference for a token/timeframe pair.

Return type:

str

supports_network(network)

Check if the provider supports a given network.

Returns:

Always returns True as Allora service is network-agnostic

Return type:

bool

class coinbase_agentkit.action_providers.BasenameActionProvider

Bases: ActionProvider[EvmWalletProvider]

Action provider for Basename registration.

register_basename(wallet_provider, args)

Register a Basename for the agent.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(network)

Check if the network is supported by the Basename action provider.

Parameters:

network (Network) – The network to check support for.

Returns:

Whether the network is supported.

Return type:

bool

class coinbase_agentkit.action_providers.CdpApiActionProvider(config=None)

Bases: ActionProvider[EvmWalletProvider]

Provides actions for interacting with CDP API.

This provider is used for any action that uses the CDP API, but does not require a CDP Wallet.

address_reputation(args)

Check the reputation of an Ethereum address.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

request_faucet_funds(wallet_provider, args)

Request test tokens from the Base Sepolia faucet.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(network)

Check if the network is supported by this action provider.

Parameters:

network (Network) – The network to check support for.

Returns:

Whether the network is supported.

Return type:

bool

class coinbase_agentkit.action_providers.CdpWalletActionProvider(config=None)

Bases: ActionProvider[CdpWalletProvider]

Action provider for CDP wallet operations.

deploy_contract(wallet_provider, args)

Deploy an arbitrary smart contract.

Parameters:
  • wallet_provider (CdpWalletProvider) – The CDP wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

deploy_nft(wallet_provider, args)

Deploy an NFT (ERC-721) smart contract.

Parameters:
  • wallet_provider (CdpWalletProvider) – The CDP wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

deploy_token(wallet_provider, args)

Deploy an ERC20 token smart contract.

Parameters:
  • wallet_provider (CdpWalletProvider) – The CDP wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(_)

Check if the CDP action provider supports the given network.

Parameters:

_ – The network to check.

Return type:

bool

Returns:

True

trade(wallet_provider, args)

Trade assets using the CDP wallet provider.

Parameters:
  • wallet_provider (CdpWalletProvider) – The CDP wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

class coinbase_agentkit.action_providers.CompoundActionProvider

Bases: ActionProvider[EvmWalletProvider]

Provides actions for interacting with Compound protocol.

borrow(wallet_provider, args)

Borrow base assets from Compound.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet to use for the borrow operation.

  • args (dict[str, Any]) – The input arguments for the borrow operation.

Returns:

A message containing the result of the borrow operation.

Return type:

str

get_portfolio(wallet_provider, args)

Get portfolio details from Compound.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet to use for getting details.

  • args (dict[str, Any]) – The input arguments containing comet_address and account.

Returns:

A markdown formatted string with portfolio details.

Return type:

str

repay(wallet_provider, args)

Repay borrowed assets to Compound.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet to use for the repay operation.

  • args (dict[str, Any]) – The input arguments for the repay operation.

Returns:

A message containing the result of the repay operation.

Return type:

str

supply(wallet_provider, args)

Supply collateral assets to Compound.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet to use for the supply operation.

  • args (dict[str, Any]) – The input arguments for the supply operation.

Returns:

A message containing the result of the supply operation.

Return type:

str

supports_network(network)

Check if network is supported by Compound.

Return type:

bool

withdraw(wallet_provider, args)

Withdraw collateral assets from Compound.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet to use for the withdraw operation.

  • args (dict[str, Any]) – The input arguments for the withdraw operation.

Returns:

A message containing the result of the withdraw operation.

Return type:

str

class coinbase_agentkit.action_providers.ERC20ActionProvider

Bases: ActionProvider[EvmWalletProvider]

Action provider for ERC20 tokens.

get_balance(wallet_provider, args)

Get the balance of an ERC20 token for the wallet’s address.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(network)

Check if the network is supported by this action provider.

Parameters:

network (Network) – The network to check support for.

Returns:

Whether the network is supported.

Return type:

bool

transfer(wallet_provider, args)

Transfer ERC20 tokens to a destination address.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

class coinbase_agentkit.action_providers.HyperbolicActionProvider(api_key=None)

Bases: ActionProvider

Provides unified access to all Hyperbolic platform services.

This provider aggregates functionality from all Hyperbolic action providers: - ai: text, image, and audio generation - billing: balance, spending history - marketplace: GPU compute resources - settings: account settings management

It requires an API key which can be provided directly or through the HYPERBOLIC_API_KEY environment variable.

supports_network(network)

Check if network is supported by Hyperbolic actions.

Parameters:

network (Network) – The network to check.

Returns:

True, as Hyperbolic actions don’t require any specific network.

Return type:

bool

class coinbase_agentkit.action_providers.MorphoActionProvider

Bases: ActionProvider[EvmWalletProvider]

Provides actions for interacting with Morpho Vaults.

deposit(wallet_provider, args)

Deposit assets into a Morpho Vault.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(network)

Check if the network is supported by this action provider.

Parameters:

network (Network) – The network to check support for.

Returns:

Whether the network is supported.

Return type:

bool

withdraw(wallet_provider, args)

Withdraw assets from a Morpho Vault.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

class coinbase_agentkit.action_providers.PythActionProvider

Bases: ActionProvider[WalletProvider]

Provides actions for interacting with Pyth price feeds.

fetch_price(args)

Fetch price from Pyth for the given price feed ID.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

fetch_price_feed_id(args)

Fetch the price feed ID for a given token symbol from Pyth.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(network)

Check if network is supported by Pyth.

Return type:

bool

class coinbase_agentkit.action_providers.SshActionProvider(max_connections=10)

Bases: ActionProvider

SshActionProvider provides actions for SSH operations.

This provider enables connecting to remote servers via SSH and executing commands. It supports managing multiple concurrent SSH connections.

list_connections(args)

List all SSH connections in the pool.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

remote_shell(args)

Execute a command on the remote server.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

ssh_add_host_key(args)

Add an SSH host key to the known_hosts file.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

ssh_connect(args)

Establish SSH connection to remote server.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

ssh_disconnect(args)

Disconnects from an active SSH session.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

ssh_download(args)

Download a file from the remote server.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

ssh_status(args)

Retrieve status of a specific SSH connection.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

ssh_upload(args)

Upload a file to the remote server.

Parameters:

args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(network)

Check if this provider supports the specified network.

Parameters:

network (Network) – The network to check.

Returns:

Always True as SSH is network-agnostic.

Return type:

bool

class coinbase_agentkit.action_providers.SuperfluidActionProvider

Bases: ActionProvider[EvmWalletProvider]

Provides actions for interacting with Superfluid protocol.

create_flow(wallet_provider, args)

Create a money flow using Superfluid.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

delete_flow(wallet_provider, args)

Delete an existing money flow using Superfluid.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(network)

Check if network is supported by Superfluid actions.

Parameters:

network (Network) – The network to check support for.

Returns:

Whether the network is supported.

Return type:

bool

update_flow(wallet_provider, args)

Update an existing money flow using Superfluid.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider instance.

  • args (dict[str, Any]) – Input arguments for the action.

Returns:

A message containing the action response or error details.

Return type:

str

class coinbase_agentkit.action_providers.TwitterActionProvider(api_key=None, api_secret=None, access_token=None, access_token_secret=None, bearer_token=None)

Bases: ActionProvider

Provides actions for interacting with Twitter.

account_details(args)

Get the authenticated Twitter user account details.

Parameters:

args (dict[str, Any]) – Empty dictionary, no arguments needed.

Returns:

A message containing the action response or error details.

Return type:

str

account_mentions(args)

Get mentions for a specified Twitter user.

Parameters:

args (dict[str, Any]) – Arguments containing user_id to get mentions for.

Returns:

A message containing the action response or error details.

Return type:

str

post_tweet(args)

Post a tweet on Twitter.

Parameters:

args (dict[str, Any]) – Arguments containing tweet text to post.

Returns:

A message containing the action response or error details.

Return type:

str

post_tweet_reply(args)

Post a reply to a tweet on Twitter.

Parameters:

args (dict[str, Any]) – Arguments containing tweet_reply text and tweet_id to reply to.

Returns:

A message containing the action response or error details.

Return type:

str

supports_network(network)

Check if network is supported by Twitter actions.

Returns:

Always True as Twitter actions don’t depend on blockchain networks.

Return type:

bool

class coinbase_agentkit.action_providers.WalletActionProvider

Bases: ActionProvider[WalletProvider]

Provides actions for interacting with wallet functionality.

get_balance(wallet_provider, args)

Get the native currency balance for the connected wallet.

Parameters:
  • wallet_provider (WalletProvider) – The wallet provider to get the balance from.

  • args (dict[str, Any]) – The input arguments.

Returns:

A message containing the wallet address and balance information.

Return type:

str

get_wallet_details(wallet_provider, args)

Get details about the connected wallet.

Parameters:
  • wallet_provider (WalletProvider) – The wallet provider to get details from.

  • args (dict[str, Any]) – The input arguments.

Returns:

A formatted string containing wallet details and network information.

Return type:

str

native_transfer(wallet_provider, args)

Transfer native tokens from the connected wallet to a destination address.

Parameters:
  • wallet_provider (WalletProvider) – The wallet provider to transfer tokens from.

  • args (dict[str, Any]) – Arguments containing destination address and transfer amount.

Returns:

A message containing the transfer details and transaction hash.

Return type:

str

supports_network(network)

Check if network is supported by wallet actions.

Parameters:

network (Network) – The network to check support for.

Returns:

True if the network is supported.

Return type:

bool

class coinbase_agentkit.action_providers.WethActionProvider

Bases: ActionProvider[EvmWalletProvider]

Provides actions for interacting with WETH.

supports_network(network)

Check if network is supported by WETH actions.

Parameters:

network (Network) – The network to check support for.

Returns:

True if the network is supported, False otherwise.

Return type:

bool

wrap_eth(wallet_provider, args)

Wrap ETH to WETH by calling the deposit function on the WETH contract.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider to wrap ETH from.

  • args (dict[str, Any]) – Arguments containing amount_to_wrap in wei.

Returns:

A message containing the wrap details or error message.

Return type:

str

class coinbase_agentkit.action_providers.WowActionProvider

Bases: ActionProvider[EvmWalletProvider]

Provides actions for interacting with WOW protocol.

buy_token(wallet_provider, args)

Buy WOW tokens with ETH.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider to buy tokens from.

  • args (dict[str, Any]) – Input arguments containing contract_address and amount_eth_in_wei.

Returns:

A message containing the purchase details or error message.

Return type:

str

create_token(wallet_provider, args)

Create a new WOW token using the factory contract.

Parameters:
  • wallet_provider (EvmWalletProvider) – Provider for wallet operations.

  • args (dict[str, Any]) – Input arguments containing name, symbol, and optional token_uri.

Returns:

A message containing the creation details or error message.

Return type:

str

sell_token(wallet_provider, args)

Sell WOW tokens for ETH.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider to sell tokens from.

  • args (dict[str, Any]) – Input arguments containing contract_address and amount_tokens_in_wei.

Returns:

A message containing the sell details or error message.

Return type:

str

supports_network(network)

Check if network is supported by WOW protocol.

Parameters:

network (Network) – The network to check support for.

Returns:

True if network is supported, False otherwise.

Return type:

bool

coinbase_agentkit.action_providers.allora_action_provider(api_key=None, chain_slug=None)

Create a new Allora action provider.

Returns:

A new Allora action provider instance.

Return type:

AlloraActionProvider

coinbase_agentkit.action_providers.basename_action_provider()

Create a new Basename action provider.

Returns:

A new Basename action provider instance.

Return type:

BasenameActionProvider

coinbase_agentkit.action_providers.cdp_api_action_provider(config=None)

Create a new CDP API action provider.

Parameters:

config (CdpProviderConfig | None) – Configuration for the CDP API provider.

Returns:

A new CDP API action provider instance.

Return type:

CdpApiActionProvider

coinbase_agentkit.action_providers.cdp_wallet_action_provider(config=None)

Create a new CDP wallet action provider.

Parameters:

config (CdpProviderConfig | None) – Configuration for the CDP wallet provider.

Returns:

A new CDP wallet action provider instance.

Return type:

CdpWalletActionProvider

coinbase_agentkit.action_providers.compound_action_provider()

Create a new CompoundActionProvider instance.

Return type:

CompoundActionProvider

coinbase_agentkit.action_providers.create_action(name, description, schema=None)

Decorate an action with a name, description, and schema.

coinbase_agentkit.action_providers.erc20_action_provider()

Create a new instance of the ERC20 action provider.

Return type:

ERC20ActionProvider

Returns:

A new ERC20 action provider instance.

coinbase_agentkit.action_providers.hyperbolic_action_provider(api_key=None)

Create a new instance of the HyperbolicActionProvider.

Parameters:

api_key (Optional[str]) – Optional API key for authentication. If not provided, will attempt to read from HYPERBOLIC_API_KEY environment variable.

Return type:

HyperbolicActionProvider

Returns:

A new Hyperbolic action provider instance.

coinbase_agentkit.action_providers.morpho_action_provider()

Create a new Morpho action provider.

Returns:

A new Morpho action provider instance.

Return type:

MorphoActionProvider

coinbase_agentkit.action_providers.pyth_action_provider()

Create a new Pyth action provider.

Returns:

A new Pyth action provider instance.

Return type:

PythActionProvider

coinbase_agentkit.action_providers.ssh_action_provider(max_connections=10)

Create a new instance of the SshActionProvider.

Parameters:

max_connections (int) – Maximum number of concurrent SSH connections (default: 10)

Return type:

SshActionProvider

Returns:

An initialized SshActionProvider

coinbase_agentkit.action_providers.superfluid_action_provider()

Create a new Superfluid action provider.

Returns:

A new Superfluid action provider instance.

Return type:

SuperfluidActionProvider

coinbase_agentkit.action_providers.twitter_action_provider(api_key=None, api_secret=None, access_token=None, access_token_secret=None, bearer_token=None)

Create and return a new TwitterActionProvider instance.

Return type:

TwitterActionProvider

coinbase_agentkit.action_providers.wallet_action_provider()

Create a new WalletActionProvider instance.

Returns:

A new wallet action provider instance.

Return type:

WalletActionProvider

coinbase_agentkit.action_providers.weth_action_provider()

Create a new WethActionProvider instance.

Returns:

A new instance of the WETH action provider.

Return type:

WethActionProvider

coinbase_agentkit.action_providers.wow_action_provider()

Create a new WowActionProvider instance.

Return type:

WowActionProvider