Skip to main content
Glama
armorwallet
by armorwallet

stake_transaction

Execute stake transactions on Armor Crypto MCP by processing StakeTransactionRequestContainer inputs and generating SwapTransactionRequestContainer outputs for blockchain operations.

Instructions

Execute a stake transaction.

Expects a StakeTransactionRequestContainer, returns a SwapTransactionRequestContainer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stake_transaction_requestsYes

Implementation Reference

  • The primary handler and registration (@mcp.tool()) for the 'stake_transaction' tool. Proxies requests to the ArmorWalletAPIClient.stake_transaction method, handling authentication check and errors.
    @mcp.tool()
    async def stake_transaction(stake_transaction_requests: StakeTransactionRequestContainer) -> SwapTransactionRequestContainer:
        """
        Execute a stake transaction.
        
        Expects a StakeTransactionRequestContainer, returns a SwapTransactionRequestContainer.
        """
        if not armor_client:
            return [{"error": "Not logged in"}]
        try:
            result: SwapTransactionRequestContainer = await armor_client.stake_transaction(stake_transaction_requests)
            return result
        except Exception as e:
            return [{"error": str(e)}]
  • Pydantic model defining the input schema for a single stake transaction request, containing the transaction_id from a prior stake quote.
    class StakeTransactionRequest(BaseModel):
        transaction_id: str = Field(description="unique id of the generated stake quote")
  • Pydantic container model wrapping a list of StakeTransactionRequest for batch input to the stake_transaction tool.
    class StakeTransactionRequestContainer(BaseModel):
        stake_transaction_requests: List[StakeTransactionRequest]
  • Helper method in ArmorWalletAPIClient that performs the actual API call to execute stake transactions via the /transactions/swap/ endpoint.
    async def stake_transaction(self, data: StakeTransactionRequestContainer) -> StakeTransactionRequestContainer:
        """Execute the stake transactions."""
        payload = data.model_dump(exclude_none=True)['stake_transaction_requests']
        return await self._api_call("POST", "transactions/swap/", payload)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/armorwallet/armor-crypto-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server