coinbase_agentkit.action_providers.morpho package

Submodules

coinbase_agentkit.action_providers.morpho.constants module

Constants for Morpho action provider.

coinbase_agentkit.action_providers.morpho.morpho_action_provider module

Morpho action provider.

class coinbase_agentkit.action_providers.morpho.morpho_action_provider.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

coinbase_agentkit.action_providers.morpho.morpho_action_provider.morpho_action_provider()

Create a new Morpho action provider.

Returns:

A new Morpho action provider instance.

Return type:

MorphoActionProvider

coinbase_agentkit.action_providers.morpho.schemas module

Schemas for Morpho action provider.

class coinbase_agentkit.action_providers.morpho.schemas.MorphoDepositSchema(**data)

Bases: BaseModel

Input schema for Morpho Vault deposit action.

assets: str
model_config: ClassVar[ConfigDict] = {}

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

receiver: str
token_address: str
vault_address: str
class coinbase_agentkit.action_providers.morpho.schemas.MorphoWithdrawSchema(**data)

Bases: BaseModel

Input schema for Morpho Vault withdraw action.

assets: str
model_config: ClassVar[ConfigDict] = {}

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

receiver: str
vault_address: str

coinbase_agentkit.action_providers.morpho.utils module

coinbase_agentkit.action_providers.morpho.utils.approve(wallet, token_address, spender_address, amount)

Approve a spender to spend tokens on behalf of the owner.

Parameters:
  • wallet (EvmWalletProvider) – The wallet provider to use for the transaction

  • token_address (str) – The address of the token contract to approve

  • spender_address (str) – The address of the spender to approve

  • amount (int) – The amount of tokens to approve in atomic units (wei)

Returns:

The transaction receipt if successful, or an error message string if failed

Return type:

dict | str

Raises:

Exception – If the approval transaction fails

Module contents

Morpho action provider for lending protocol interactions.