{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vibekast-xyz/json-schema/vibekast-xyz-wallet-schema.json",
  "title": "Wallet",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vibekast-xyz-openapi.json#/components/schemas/Wallet",
  "type": "object",
  "properties": {
    "wallet": {
      "$ref": "#/$defs/Address"
    },
    "market": {
      "description": "The newest market, which balances and positions refer to.",
      "$ref": "#/$defs/Address"
    },
    "eth": {
      "description": "Base Sepolia ETH for gas.",
      "$ref": "#/$defs/Decimal"
    },
    "tUsdc": {
      "description": "Balance of this week's collateral.",
      "$ref": "#/$defs/Decimal"
    },
    "allowance": {
      "description": "tUSDC the market may spend from this wallet.",
      "$ref": "#/$defs/Decimal"
    },
    "positions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "label": {
            "type": "string"
          },
          "shares": {
            "$ref": "#/$defs/Decimal"
          },
          "probability": {
            "$ref": "#/$defs/Decimal"
          }
        },
        "required": [
          "index",
          "label",
          "shares",
          "probability"
        ],
        "additionalProperties": false
      }
    },
    "agent": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "url": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "name",
            "url"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when the wallet is a registered agent."
    },
    "agentLookup": {
      "type": "string",
      "enum": [
        "ok",
        "unavailable"
      ],
      "description": "unavailable: the agent registry couldn't be read, so agent is unknown."
    },
    "nextSteps": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "wallet",
    "market",
    "eth",
    "tUsdc",
    "allowance",
    "positions",
    "agent",
    "agentLookup",
    "nextSteps"
  ],
  "additionalProperties": false,
  "$defs": {
    "Address": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$",
      "description": "0x-prefixed 20-byte address."
    },
    "Decimal": {
      "type": "string",
      "pattern": "^-?\\d+(\\.\\d+)?$",
      "description": "Exact decimal number as a string, e.g. \"0.0279\" or \"77000\". Converted directly from the 18-decimal on-chain integer, never through a float."
    }
  }
}