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
| Name | Required | Description | Default |
|---|---|---|---|
| stake_transaction_requests | Yes |
Implementation Reference
- armor_crypto_mcp/armor_mcp.py:530-543 (handler)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)