feat: add yellow.pro trading tools (auth, balances, orders, deposits, withdrawals)#2
Open
calj wants to merge 2 commits into
Open
feat: add yellow.pro trading tools (auth, balances, orders, deposits, withdrawals)#2calj wants to merge 2 commits into
calj wants to merge 2 commits into
Conversation
Two new MCP tools for off-chain message signing: sign_message(wallet_name, message): EIP-191 personal_sign. Returns address + hex signature. Use case: web3 authentication challenges, proof of ownership. sign_typed_data(wallet_name, domain, types, primary_type, message): EIP-712 structured data signing (signTypedData_v4 compatible). Use case: permits, gasless approvals, order signatures. Both tools use the existing wallet.derive_account() infrastructure. No new dependencies — eth_account (transitive dep of web3) provides encode_defunct and encode_typed_data. 17 integration tests covering signature generation, recovery, wallet name formats, and complex EIP-712 structures (ERC20 Permit).
…, withdrawals 14 new MCP tools for direct yellow.pro integration: Auth: yellow_auth(wallet_name) — full challenge→sign→verify in one call yellow_auth_status() — check session yellow_logout() — clear session Market data (public): yellow_exchange_info() — trading pairs, fees, filters yellow_klines(symbol, interval) — OHLCV candles Account: yellow_balances() — available, locked, USD value Trading: yellow_place_order(market, side, amount, price) yellow_cancel_order(order_id, market) yellow_open_orders(), yellow_order_history(), yellow_trades() Deposits (on-chain): yellow_deposit_prepare(asset, amount) — build unsigned tx steps yellow_deposit(wallet, asset, amount) — sign + broadcast all-in-one Withdrawals: yellow_withdraw(asset, amount) — request via API yellow_withdrawals() — history Architecture: - beehive/yellow_pro.py: API client, session management, ABI encoding - beehive/tools/yellow.py: MCP tool definitions - Session stored in-process memory (JWT from auth_verify) - Deposit flow: approve→wait→deposit→wait (ERC20) or deposit (ETH) - Custody contract: 0x3a9624f9BB2Dc43E90c0699DDc4A9b6BEc147Cde - Supported: ETH, USDT (6 dec), WBTC (8 dec), YELLOW (18 dec) - httpx added as dependency for yellow.pro API calls 28 new tests, 196 total (all passing).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
14 new MCP tools for direct yellow.pro exchange integration. The agent handles trading, deposits, and withdrawals entirely through mcp-beehive — no tower proxy needed.
New Tools
Auth
yellow_auth(wallet_name)yellow_auth_status()yellow_logout()Market Data (public, no auth)
yellow_exchange_info()yellow_klines(symbol, interval)Account
yellow_balances()Trading
yellow_place_order(market, side, amount, price)yellow_cancel_order(order_id, market)yellow_open_orders()yellow_order_history()yellow_trades()Deposits (on-chain)
yellow_deposit_prepare(asset, amount)yellow_deposit(wallet, asset, amount)Withdrawals
yellow_withdraw(asset, amount)yellow_withdrawals()Architecture
beehive/yellow_pro.py— API client, session management (in-memory JWT), ABI encoding for custody contractbeehive/tools/yellow.py— 14@mcp.tooldefinitionshttpxadded as dependency for HTTP callsKey design decisions
yellow_auth()is a single tool — the agent calls it once and the entire challenge→sign→verify flow happens internally. No multi-step orchestration needed.yellow_deposit()is all-in-one — builds calldata, signs approve tx, waits for confirmation, signs deposit tx, waits again. Returns success/failure with all tx hashes.yellow_auth()again).0x3a9624f9BB2Dc43E90c0699DDc4A9b6BEc147Cde(Ethereum mainnet)Tests
28 new integration tests covering:
All 196 tests pass (151 existing + 17 signing PR + 28 new).
Dependencies
httpx>=0.27for yellow.pro API calls