{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-agent-lightning-wallet-schema.json",
  "title": "AgentLightningWallet",
  "description": "An agent principal's Lightning wallet: a budgeted, isolated sub-wallet on Run402's Hub. `pairing` appears exactly once, on the response that first hands it out.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-billing-api-openapi.yml#/components/schemas/AgentLightningWallet",
  "type": "object",
  "required": [
    "wallet_id",
    "status",
    "network",
    "custody",
    "budget_sats",
    "starter_sats",
    "has_pairing",
    "created_at",
    "next_actions"
  ],
  "properties": {
    "wallet_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "minting",
        "active",
        "revoking",
        "revoked",
        "failed"
      ]
    },
    "network": {
      "type": "string",
      "enum": [
        "regtest",
        "signet",
        "mainnet"
      ]
    },
    "custody": {
      "type": "string",
      "enum": [
        "run402_hub"
      ]
    },
    "custody_note": {
      "type": "string"
    },
    "lightning_address": {
      "type": [
        "string",
        "null"
      ]
    },
    "budget_sats": {
      "type": "integer"
    },
    "starter_sats": {
      "type": "integer"
    },
    "has_pairing": {
      "type": "boolean"
    },
    "pairing": {
      "type": "string",
      "description": "The NWC pairing URI. Present exactly once; store it in the local profile and never send it to Run402."
    },
    "pairing_claimed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "failure_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "activated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "revoked_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "next_actions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/NextAction"
      }
    }
  },
  "$defs": {
    "NextAction": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Advisory machine-readable action type such as retry, authenticate, submit_payment, fund_wallet, renew_tier, check_usage, resume_deploy, edit_request, edit_migration, contact_support, upgrade_client, poll (poll the project events feed — appended when the envelope carries a correlated_platform_incident), or hand_to_member (on a commit/promote response that just activated a public site: show the human urls.site and urls.console, relay Run402's offer to promote the build on @run402com, and ask yes or no — see `credited_as` below). create_app_repo (APP_REPO_NOT_FOUND: POST /projects/v1/:project_id/app-repos { repo_name } before reading, committing or pushing a named repo)."
        },
        "method": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "auth": {
          "type": "string"
        },
        "why": {
          "type": "string"
        },
        "credited_as": {
          "type": [
            "string",
            "null"
          ],
          "description": "`hand_to_member` only. The caller's own live presence name in the project's default room, else that room's most recently active live presence, else `null` — in which case `why` tells the agent that joining the room with a name (`run402 rooms join --name ...`) is how the promotion credits it."
        },
        "body": {
          "type": "object",
          "description": "`hand_to_member` only. A ready-to-send `POST /feedback/v1` template: `{ project_id, message: \"promote: yes\", handle? }`."
        }
      },
      "additionalProperties": true
    }
  }
}