Skip to main content
This instruction type enables contract interactions using pre-encoded calldata. Provide raw hex-encoded function calls for maximum control over the exact calldata being executed.

How It Works

The build-raw flow:
  1. Accepts pre-encoded calldata - Raw hex strings representing complete function calls
  2. Validates calldata format - Ensures proper hex encoding
  3. Generates instructions - Creates executable MEE instructions
  4. Enables composition - Combines with other flow types seamlessly

When to Use BuildRaw

✅ Use BuildRaw When

  • You have pre-generated calldata from another system
  • You need exact control over the calldata format
  • You’re migrating from a system that already encodes calldata
  • You want to avoid ABI parsing overhead client-side

❌ Use /instructions/build Instead

  • You need runtime balance injection
  • You want the API to handle encoding
  • You prefer working with function signatures
  • You want more readable code

Key Differences from Build

Critical Limitation: BuildRaw does NOT support runtime balance injection. The calldata must be fully encoded client-side with concrete values. If you need runtime balance (e.g., transferring all remaining tokens), use /instructions/build instead.

Parameters

When using /instructions/build-raw in your composeFlows array:

Complete Workflow Examples

Transfer tokens using pre-encoded calldata

BuildRaw vs Build Decision Guide

Best Practices

Always validate your encoded calldata before sending:
Override gas limits for complex operations:
Use /instructions/build when you need:
  • Runtime balance injection for dynamic amounts
  • Better code readability with function signatures
  • API-side encoding to reduce client complexity
Use /instructions/build-raw when you need:
  • Pre-encoded calldata from external systems
  • Exact control over calldata format
  • Migration from existing systems with encoded data
Always test your encoded calldata with small amounts:

Common Use Cases

Pre-generated Transaction Data

Multicall Operations

Troubleshooting

Ensure your calldata:
  • Starts with 0x
  • Is a valid hex string
  • Has even length (excluding 0x)
  • Matches the expected function selector
Common causes:
  • Incorrect calldata encoding
  • Wrong function parameters or order
  • Insufficient balance for operation
  • Missing approvals for token operations
  • Gas limit too low
BuildRaw does NOT support runtime balance injection. If you need dynamic amounts:
Verify your encoding matches the contract ABI:

/instructions/build

Use when you need runtime balance or prefer function signatures

/instructions/intent-simple

For simple swaps and bridges with automatic routing