Overview

The /v1/instructions/build endpoint enables direct control over contract interactions by specifying exact function calls. Users provide ABI signatures and arguments to generate MEE instructions with specific callData.

How It Works

The build endpoint creates instructions by:
  1. Accepting function signatures - ABI-formatted function definitions
  2. Processing arguments - Including support for runtime balance checks
  3. Generating callData - Creates the exact contract call data for execution
This is the direct approach where users specify exactly what contracts to call and how, rather than expressing intents.

Request Structure

POST /v1/instructions/build

Request Body

ParameterTypeDescription
functionSignaturestringFunction signature (e.g., function transfer(address to, uint256 amount))
argsarrayFunction arguments, can include runtime balance objects
tostringTarget contract address
chainIdnumberChain ID for execution
valuestringOptional: Native token value in wei (default “0”)
gasLimitstringOptional: Gas limit for the transaction

Runtime Balance Arguments

Arguments can include runtime ERC20 balance checks:
{
  "type": "runtimeErc20Balance",
  "targetAddress": "0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a",
  "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "constraints": {
    "gte": "1000000",  // Greater than or equal to
    "lte": "10000000", // Less than or equal to
    "eq": "5000000"    // Equal to
  }
}

Example Request

curl -X POST https://api.biconomy.io/v1/instructions/build \
  -H "Content-Type: application/json" \
  -d '{
    "functionSignature": "function transfer(address to, uint256 amount)",
    "args": [
      "0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a",
      {
        "type": "runtimeErc20Balance",
        "targetAddress": "0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a",
        "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "constraints": {
          "gte": "1000000"
        }
      }
    ],
    "to": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "chainId": 8453,
    "value": "0"
  }'

Response

Returns MEE instructions with the generated callData:
{
  "instructions": [
    {
      "calls": [
        {
          "to": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
          "value": "0",
          "functionSig": "transfer(address,uint256)",
          "inputParams": [...],
          "outputParams": [...]
        }
      ],
      "chainId": 8453,
      "isComposable": true
    }
  ]
}

Supported Argument Types

  • Address: EVM addresses (0x-prefixed, 40 hex characters)
  • BigInt: Large numbers as strings
  • Integer: Non-negative integers
  • Boolean: true/false values
  • Hex: Hex strings (0x-prefixed)
  • String: Regular text strings
  • Runtime Balance: Dynamic ERC20 balance checks with constraints
  • Arrays: Nested arrays of any supported type