{
  "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
  "title": "Custom network balance stability",
  "description": "Adds or selects one supported network through visible UI and proves its token row and balance persist through a settle window.",
  "paramsSchema": {
    "type": "object",
    "additionalProperties": false,
    "required": ["network", "chain_id", "symbols"],
    "properties": {
      "network": { "type": "string" },
      "chain_id": { "type": "integer", "minimum": 1 },
      "symbols": { "type": "array", "items": { "type": "string" } },
      "add_if_missing": { "type": "boolean", "default": true },
      "settle_ms": { "type": "integer", "minimum": 0, "default": 30000 },
      "timeout_ms": { "type": "integer", "minimum": 1000, "default": 60000 }
    }
  },
  "workflow": {
    "entry": "select-network",
    "nodes": {
      "select-network": {
        "action": "ui.navigate",
        "page": "network",
        "network": "{{params.network}}",
        "chain_id": "{{params.chain_id}}",
        "add_if_missing": "{{params.add_if_missing}}",
        "timeout_ms": "{{params.timeout_ms}}",
        "intent": "Add when needed and select the requested network through supported visible controls",
        "next": "assert-stability"
      },
      "assert-stability": {
        "action": "metamask.networks.read_visible_state",
        "network": "{{params.network}}",
        "chain_id": "{{params.chain_id}}",
        "require_symbols": "{{params.symbols}}",
        "minimum_asset_count": 1,
        "settle_ms": "{{params.settle_ms}}",
        "intent": "Prove the selected network and its balance rows persist across the settle window without a price API error",
        "next": "capture-network"
      },
      "capture-network": {
        "action": "ui.screenshot",
        "path": "screenshots/network-balance-stability.png",
        "label": "Custom network balance stability",
        "intent": "Preserve reviewer-visible proof of the stable network balance row",
        "next": "done"
      },
      "done": { "action": "end", "status": "pass" }
    }
  }
}
