{
  "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
  "title": "Perps release funds flows",
  "description": "Opens the live Perps deposit and withdraw forms, records the currently rendered preview fields, proves zero withdrawal is disabled, and dismisses both without submission.",
  "workflow": {
    "entry": "open-perps-deposit",
    "nodes": {
      "open-perps-deposit": {
        "action": "ui.navigate",
        "page": "perps",
        "intent": "Show Perps home before opening Add funds",
        "next": "open-deposit"
      },
      "open-deposit": {
        "action": "metamask.perps.open_balance_action",
        "balance_action": "add-funds",
        "intent": "Open the Perps Add funds confirmation",
        "next": "read-deposit"
      },
      "read-deposit": {
        "action": "metamask.perps.read_funds_confirmation",
        "mode": "deposit",
        "intent": "Prove the deposit form loaded and record any rendered preview fields",
        "next": "dismiss-deposit"
      },
      "dismiss-deposit": {
        "action": "ui.press",
        "test_id": "wallet-initiated-header-back-button",
        "intent": "Dismiss the deposit without submitting funds",
        "next": "open-perps-withdraw"
      },
      "open-perps-withdraw": {
        "action": "ui.navigate",
        "page": "perps",
        "intent": "Show Perps home before opening Withdraw",
        "next": "open-withdraw"
      },
      "open-withdraw": {
        "action": "metamask.perps.open_balance_action",
        "balance_action": "withdraw",
        "intent": "Open the Perps Withdraw confirmation",
        "next": "read-withdraw"
      },
      "read-withdraw": {
        "action": "metamask.perps.read_funds_confirmation",
        "mode": "withdraw",
        "intent": "Prove the withdraw form loaded and record any rendered preview fields",
        "next": "enter-zero"
      },
      "enter-zero": {
        "action": "ui.set_input",
        "test_id": "custom-amount-input",
        "value": "0",
        "intent": "Enter zero to exercise withdrawal validation",
        "next": "assert-zero"
      },
      "assert-zero": {
        "action": "metamask.perps.read_funds_confirmation",
        "mode": "withdraw",
        "expected_submit_enabled": false,
        "intent": "Prove zero remains non-submittable",
        "next": "dismiss-withdraw"
      },
      "dismiss-withdraw": {
        "action": "ui.press",
        "test_id": "wallet-initiated-header-back-button",
        "intent": "Dismiss the withdrawal without submitting funds",
        "next": "done"
      },
      "done": {
        "action": "end",
        "status": "pass"
      }
    }
  }
}
