Agent Context Properties
| Property | Type | Description |
|---|---|---|
sessionId | number | Unique session identifier |
sessionWalletAddress | string | Wallet address for this session |
currentPositions | CurrentPosition[] | Assets allocated at execution start |
executionMode | string | "auto" or "manual" |
Core Methods
| Method (TS) | Method (Python) | Description |
|---|---|---|
log(message, options?) | log(message, error=False, debug=False) | Send log messages. error: true for error logs, debug: true for console-only. |
getCurrentPositions() | get_current_positions() | Get live positions with pending tx status |
transactions() | transactions() | Get transaction history for the session |
clearSuggestedTransactions() | clear_suggested_transactions() | Clear pending manual mode suggestions |
Memory
| Method (TS) | Method (Python) | Description |
|---|---|---|
memory.set(key, value) | memory.set(key, value) | Store a string value |
memory.get(key) | memory.get(key) | Retrieve a value (returns { value } in data) |
memory.delete(key) | memory.delete(key) | Delete a key |
memory.list() | memory.list() | List all keys |
Swap and Bridge (agent.swidge)
| Method (TS) | Method (Python) | Description |
|---|---|---|
swidge.quote(request) | swidge.quote(request) | Get swap/bridge quote with routing |
swidge.execute(quoteData) | swidge.execute(quote_data) | Execute a quote (or array of quotes) |
from, to, amount, fromToken?, toToken?, slippage?
Custom Transactions
| Method (TS) | Method (Python) | Description |
|---|---|---|
signAndSend(request) | sign_and_send(request) | Sign and broadcast a transaction |
signMessage(request) | sign_message(request) | Sign a message (EVM only, EIP-191/712) |
network, request.toAddress, request.data, request.value, request.gas?, request.maxFeePerGas?, request.maxPriorityFeePerGas?, request.enforceTransactionSuccess?, message?, expiresAt?
signAndSend fields (Solana): network, request.hexTransaction, message?, expiresAt?
Hyperliquid (agent.platforms.hyperliquid)
| Method (TS) | Method (Python) | Description |
|---|---|---|
placeOrder(request) | place_order(request) | Place a perp or spot order |
balances() | balances() | Get perp account value + spot balances |
positions() | positions() | Get open perpetual positions |
order(orderId) | order(order_id) | Get order info by ID |
deleteOrder(orderId, symbol) | delete_order(order_id, symbol) | Cancel an order |
openOrders() | open_orders() | Get all open orders |
orders() | orders() | Get historical orders |
orderFills() | order_fills() | Get fill history |
transfer(request) | transfer(request) | Transfer between spot and perp accounts |
liquidations(startTime?) | liquidations(start_time?) | Get liquidation events |
symbol, side, size, price, market, type?, triggerPrice?, reduceOnly?, postOnly?, expiresAt?
Symbols: Perps use "BTC", spot uses "BTC/USDC".
Polymarket (agent.platforms.polymarket)
| Method (TS) | Method (Python) | Description |
|---|---|---|
marketOrder(request) | market_order(request) | Buy or sell prediction market shares |
redeemPositions(request?) | redeem_positions(request?) | Redeem settled positions |
tokenId, size, side, expiresAt?
Size meaning: BUY = USD to spend, SELL = shares to sell.
Manual Mode Parameters
All transactional methods (signAndSend, swidge.execute, placeOrder, transfer, marketOrder) accept:
| Parameter | Type | Description |
|---|---|---|
expiresAt | string | null | ISO 8601 expiry for suggestions. Default: next run cycle. |
Response Pattern
Every method returns:success before using data. See Error Handling for patterns.