{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fiatdock-com/json-schema/fiatdock-com-wallet-portfolio-schema.json",
  "title": "WalletPortfolio",
  "description": "Paid. Wallet portfolio on Base (every token, priced).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fiatdock-com-chain-api-openapi.yml#/components/schemas/WalletPortfolio",
  "type": "object",
  "properties": {
    "network": {
      "type": "string",
      "description": "Chain (base)"
    },
    "address": {
      "type": "string",
      "description": "The address read"
    },
    "eth": {
      "type": "object",
      "properties": {
        "wei": {
          "type": "string"
        },
        "eth": {
          "type": "string"
        },
        "priceUsd": {
          "type": [
            "number",
            "null"
          ]
        },
        "valueUsd": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "wei",
        "eth",
        "priceUsd",
        "valueUsd"
      ],
      "description": "The native ETH balance (read from the chain), its price and USD value"
    },
    "tokens": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "decimals": {
            "type": "number"
          },
          "balance": {
            "type": "string"
          },
          "priceUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "valueUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "flagged": {
            "type": "boolean"
          }
        },
        "required": [
          "contract",
          "symbol",
          "name",
          "decimals",
          "balance",
          "priceUsd",
          "valueUsd",
          "flagged"
        ]
      },
      "description": "ERC-20 holdings, highest USD value first (up to 100)"
    },
    "tokenCount": {
      "type": "number",
      "description": "ERC-20 tokens held"
    },
    "pricedTokenCount": {
      "type": "number",
      "description": "Tokens counted in the total: priced AND not flagged"
    },
    "flaggedTokenCount": {
      "type": "number",
      "description": "Tokens flagged as likely airdropped spam (a well-known Base ticker from another contract, or a link or claim bait in the name) — listed, never counted"
    },
    "totalValueUsd": {
      "type": [
        "number",
        "null"
      ],
      "description": "ETH + every priced, unflagged ERC-20, in USD"
    },
    "truncated": {
      "type": "boolean",
      "description": "True when more than 100 tokens were held, or more than one call reads (300); the counts and the total then cover the tokens read"
    },
    "source": {
      "type": "string",
      "description": "Where the data came from"
    },
    "asOf": {
      "type": "string",
      "description": "ISO time the token-balance index and the prices were read (the oldest of them)"
    },
    "note": {
      "type": "string",
      "description": "What the total counts, and its limits"
    },
    "defaulted": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "field",
        "to",
        "value",
        "note"
      ],
      "description": "Present only when the body was empty: which subject the answer is for, and why"
    }
  },
  "required": [
    "network",
    "address",
    "eth",
    "tokens",
    "tokenCount",
    "pricedTokenCount",
    "flaggedTokenCount",
    "totalValueUsd",
    "truncated",
    "source",
    "asOf",
    "note"
  ]
}