{
  "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
  "title": "Import or reuse a MetaMask wallet",
  "description": "Make a Mobile or Extension wallet ready through its selected setup method; Extension method=ui uses visible onboarding or proves the exact selected account in the existing visible session.",
  "paramsSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "method": {
        "type": "string",
        "enum": ["auto", "profile", "ui"],
        "default": "auto",
        "description": "Choose automatically from visible wallet state, require an existing profile, or require visible UI. Extension ui imports a fresh wallet or proves the exact account in an existing session; Mobile ui requires fresh onboarding."
      },
      "credential_source": {
        "type": "string",
        "enum": ["auto", "environment", "fixture"],
        "default": "auto",
        "description": "Read secrets from the named environment variables first, or require one source explicitly."
      },
      "srp_env": {
        "type": "string",
        "default": "MM_HARNESS_WALLET_SRP",
        "description": "Environment variable containing the Secret Recovery Phrase; the value is never stored in the recipe or evidence."
      },
      "password_env": {
        "type": "string",
        "default": "MM_HARNESS_WALLET_PASSWORD",
        "description": "Environment variable containing the wallet password; the value is never stored in the recipe or evidence."
      },
      "metametrics": {
        "type": "boolean",
        "default": false,
        "description": "Enable MetaMetrics during visible onboarding; defaults off."
      },
      "biometrics": {
        "type": "boolean",
        "enum": [false],
        "default": false,
        "description": "Keep Mobile biometric authentication disabled for unattended validation."
      },
      "notifications": {
        "type": "boolean",
        "default": false,
        "description": "Enable Mobile push notifications during onboarding; defaults off."
      },
      "skip_wallet_tour": {
        "type": "boolean",
        "default": true,
        "description": "Skip the Mobile wallet-home tour so the recipe ends at a usable wallet."
      },
      "interests": {
        "type": "array",
        "items": {
          "type": "string",
          "enum": ["swap_tokens", "trade_perpetuals", "prediction_markets", "send_receive_crypto", "earn_and_spend", "use_other_crypto_apps"]
        },
        "default": [],
        "description": "Mobile-only onboarding interests; an empty list skips the optional questionnaire."
      },
      "timeout_ms": {
        "type": "number",
        "default": 300000,
        "description": "Maximum time for each onboarding transition and final wallet readiness."
      }
    }
  },
  "workflow": {
    "entry": "import",
    "nodes": {
      "import": {
        "action": "metamask.wallet.import",
        "method": "{{params.method}}",
        "credential_source": "{{params.credential_source}}",
        "srp_env": "{{params.srp_env}}",
        "password_env": "{{params.password_env}}",
        "metametrics": "{{params.metametrics}}",
        "biometrics": "{{params.biometrics}}",
        "notifications": "{{params.notifications}}",
        "skip_wallet_tour": "{{params.skip_wallet_tour}}",
        "interests": "{{params.interests}}",
        "timeout_ms": "{{params.timeout_ms}}",
        "intent": "Make the wallet ready and prove the selected account through the requested setup method",
        "next": "done"
      },
      "done": {
        "action": "end",
        "status": "pass"
      }
    }
  }
}
