Compose multiple instructions and intents for your supertransaction
Overview
The/v1/instructions/compose
endpoint enables developers to combine multiple operations (intent
, intent-simple
, and build
) into a single composable supertransaction. This allows for complex multi-step workflows across different chains and protocols.
How It Works
The compose endpoint enables complex workflows by:- Accepting multiple operations - Combine up to 10 operations in a single request
- Supporting all operation types - Mix
intent
,intent-simple
, andbuild
calls - Batching control - Optional batching of instructions for efficiency
- Cross-chain execution - Seamlessly coordinate operations across different chains
Request Structure
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
ownerAddress | string | Yes | EOA wallet address (owner of orchestrator accounts) |
mode | string | Yes | Execution mode: smart-account , eoa , or eoa-7702 |
composeFlows | array | Yes | Array of operations (1-10 items) |
ComposeFlow Structure
Each item incomposeFlows
contains:
Parameter | Type | Required | Description |
---|---|---|---|
type | string | Yes | Operation type: /instructions/build , /instructions/intent-simple , or /instructions/intent |
data | object | Yes | Operation-specific data matching the respective endpoint |
batch | boolean | No | Enable/disable instruction batching (default: true) |
Example Request - Swap and Supply
Response
Returns composed MEE instructions ready for execution:Response Fields
Field | Type | Description |
---|---|---|
instructions | array | Array of composed MEE instructions |
returnedData | array | Additional data returned from composition |
Supported Operation Types
1. Build Operation (/instructions/build
)
Direct contract calls with custom function signatures:
2. Intent-Simple Operation (/instructions/intent-simple
)
Cross-chain token swaps:
3. Intent Operation (/instructions/intent
)
Complex multi-asset rebalancing:
Complex Workflow Examples
DeFi Strategy: Swap → Approve → Supply
Cross-Chain Portfolio Rebalancing
Authentication
All requests require an API key to be passed in the header:Error Responses
400 Bad Request
500 Internal Server Error
Best Practices
- Order matters: Operations are executed in the order specified
- Chain coordination: Ensure operations on dependent chains are properly sequenced
- Gas optimization: Use batching where appropriate to reduce gas costs
- Error handling: Implement proper error handling for each operation type
- Testing: Test complex compositions on testnets first
- Limits: Keep within the 10-operation limit per request