{
  "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
  "title": "Assets release token persistence",
  "description": "Locks and unlocks the wallet, then proves an imported token and its management toggle persisted.",
  "paramsSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "query": { "type": "string", "default": "DAI" },
      "timeout_ms": { "type": "integer", "minimum": 1000, "default": 45000 }
    }
  },
  "workflow": {
    "entry": "open-wallet",
    "nodes": {
      "open-wallet": {
        "action": "ui.navigate",
        "page": "home",
        "intent": "Open the all-network asset list",
        "next": "assert-prestate"
      },
      "assert-prestate": {
        "action": "metamask.assets.set_token_visibility",
        "query": "{{params.query}}",
        "visible": true,
        "require_unchanged": true,
        "timeout_ms": "{{params.timeout_ms}}",
        "intent": "Prove the imported token is enabled before the lock cycle",
        "next": "capture-before"
      },
      "capture-before": {
        "action": "ui.screenshot",
        "path": "screenshots/assets-token-before-lock.png",
        "label": "Imported token before lock",
        "intent": "Preserve pre-lock token evidence",
        "next": "lock-wallet"
      },
      "lock-wallet": {
        "action": "metamask.wallet.lock",
        "intent": "Lock the wallet through the visible global menu",
        "next": "unlock-wallet"
      },
      "unlock-wallet": {
        "action": "metamask.wallet.ensure_unlocked",
        "intent": "Unlock the same persisted profile",
        "next": "open-after-unlock"
      },
      "open-after-unlock": {
        "action": "ui.navigate",
        "page": "home",
        "intent": "Reopen the token list after unlock",
        "next": "assert-persisted"
      },
      "assert-persisted": {
        "action": "metamask.assets.set_token_visibility",
        "query": "{{params.query}}",
        "visible": true,
        "require_unchanged": true,
        "timeout_ms": "{{params.timeout_ms}}",
        "intent": "Prove the token row and enabled management toggle persisted",
        "next": "capture-after"
      },
      "capture-after": {
        "action": "ui.screenshot",
        "path": "screenshots/assets-token-after-unlock.png",
        "label": "Imported token after unlock",
        "intent": "Preserve post-unlock persistence evidence",
        "next": "done"
      },
      "done": { "action": "end", "status": "pass" }
    }
  }
}
