{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "as_of": {
          "type": [
            "string",
            "null"
          ]
        },
        "balance_gate_passed": {
          "type": "boolean"
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "current_balance": {
          "type": "number"
        },
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "outstanding_mcp_commitment_amount": {
          "type": "number"
        },
        "spend_policy_allowed_action_codes": {
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "spend_policy_allowed_currencies": {
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "spend_policy_max_per_day": {
          "type": [
            "number",
            "null"
          ]
        },
        "spend_policy_max_per_month": {
          "type": [
            "number",
            "null"
          ]
        },
        "spend_policy_max_per_operation": {
          "type": [
            "number",
            "null"
          ]
        },
        "spend_policy_require_confirmation": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "spend_policy_valid_from": {
          "type": [
            "string",
            "null"
          ]
        },
        "spend_policy_valid_until": {
          "type": [
            "string",
            "null"
          ]
        },
        "unavailable_reason_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "wallet_available": {
          "type": "boolean"
        }
      },
      "required": [
        "ok",
        "wallet_available",
        "current_balance",
        "balance_gate_passed",
        "outstanding_mcp_commitment_amount"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "error": {
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "correlation_id": {
              "type": "string"
            },
            "retryable": {
              "type": "boolean"
            }
          },
          "required": [
            "code",
            "retryable",
            "correlation_id"
          ],
          "type": "object"
        },
        "ok": {
          "const": false,
          "type": "boolean"
        }
      },
      "required": [
        "ok",
        "error"
      ],
      "type": "object"
    }
  ],
  "properties": {
    "as_of": {
      "type": [
        "string",
        "null"
      ]
    },
    "balance_gate_passed": {
      "type": "boolean"
    },
    "currency": {
      "type": [
        "string",
        "null"
      ]
    },
    "current_balance": {
      "type": "number"
    },
    "error": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "correlation_id": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        }
      },
      "required": [
        "code",
        "retryable",
        "correlation_id"
      ],
      "type": "object"
    },
    "ok": {
      "type": "boolean"
    },
    "outstanding_mcp_commitment_amount": {
      "type": "number"
    },
    "spend_policy_allowed_action_codes": {
      "items": {
        "type": "string"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "spend_policy_allowed_currencies": {
      "items": {
        "type": "string"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "spend_policy_max_per_day": {
      "type": [
        "number",
        "null"
      ]
    },
    "spend_policy_max_per_month": {
      "type": [
        "number",
        "null"
      ]
    },
    "spend_policy_max_per_operation": {
      "type": [
        "number",
        "null"
      ]
    },
    "spend_policy_require_confirmation": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "spend_policy_valid_from": {
      "type": [
        "string",
        "null"
      ]
    },
    "spend_policy_valid_until": {
      "type": [
        "string",
        "null"
      ]
    },
    "unavailable_reason_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "wallet_available": {
      "type": "boolean"
    }
  },
  "type": "object"
}