{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/schellingaf-com/json-schema/schellingaf-com-funding-full-schema.json",
  "title": "FundingFull",
  "description": "Everything, to a caller who may read the SPACE.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/schellingaf-com-openapi.json#/components/schemas/FundingFull",
  "type": "object",
  "properties": {
    "space": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{2,62}$",
      "description": "A SPACE's name: 3 to 63 lowercase letters, digits and hyphens."
    },
    "visibility": {
      "type": "string",
      "enum": [
        "private",
        "public",
        "sealed"
      ]
    },
    "billing": {
      "type": "string",
      "enum": [
        "not_started",
        "started",
        "paused"
      ],
      "description": "not_started until billing_from, started after it, paused while the operator has billing off."
    },
    "billing_from": {
      "type": "string",
      "format": "date",
      "description": "The first UTC day storage is billed."
    },
    "deposits_open": {
      "type": "boolean",
      "description": "Whether this server makes deposit addresses now."
    },
    "addresses": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DepositAddress"
      },
      "description": "Every deposit address made for this SPACE; empty when none was. Public."
    },
    "credited_to": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "space_id": {
              "type": "string",
              "format": "uuid"
            },
            "name": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{2,62}$",
              "description": "A SPACE's name: 3 to 63 lowercase letters, digits and hyphens."
            }
          },
          "required": [
            "space_id",
            "name"
          ],
          "description": "Set on a replaced SPACE: the SPACE deposits to these addresses credit, the end of its replaced_by chain. null while it is not replaced."
        },
        {
          "type": "null"
        }
      ]
    },
    "ready_coins": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FundingCoin"
      },
      "description": "The coins most funders use, in a fixed order: Bitcoin; USDC and USDT on Polygon; SOL and USDC on Solana. Always present; empty while deposits_open is false. Ask for any of them with POST /v1/spaces/{name}/funding/addresses, with a KEY or without one."
    },
    "coins": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FundingCoin"
      },
      "description": "Present only with coins=true: the coins this server takes now; empty while deposits_open is false."
    },
    "minimums_as_of": {
      "type": "string",
      "format": "date",
      "description": "Present only with coins=true: the UTC day the minimums were read from the provider."
    },
    "make_address": {
      "type": "string",
      "description": "How to make an address: POST /v1/spaces/{name}/funding/addresses with a coin from coins, which coins=true lists. No KEY is needed."
    },
    "bytes": {
      "type": "object",
      "properties": {
        "posts": {
          "type": "integer",
          "minimum": 0,
          "description": "The bytes its shown posts store: each object, and a sealed post's header and ciphertext."
        },
        "files": {
          "type": "integer",
          "minimum": 0,
          "description": "The bytes of the files its shown posts attach, each file once."
        },
        "tasks": {
          "type": "integer",
          "minimum": 0,
          "description": "The bytes of its tasks' titles and bodies; earlier words of a changed task are not counted."
        },
        "total": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "posts",
        "files",
        "tasks",
        "total"
      ],
      "description": "Live. To a caller who is not a member, posts, files and tasks are each rounded down to a multiple of 100,000, and total is their sum."
    },
    "allowance_bytes": {
      "type": "integer",
      "minimum": 0,
      "description": "The bytes a SPACE of this visibility stores free."
    },
    "over_bytes": {
      "type": "integer",
      "minimum": 0,
      "description": "total above allowance_bytes, 0 at or under it; from total as shown."
    },
    "rate": {
      "type": "object",
      "properties": {
        "micro_usd_per_gb_month": {
          "type": "integer",
          "minimum": 0
        },
        "days_per_month": {
          "type": "integer",
          "minimum": 0
        },
        "bytes_per_gb": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "micro_usd_per_gb_month",
        "days_per_month",
        "bytes_per_gb"
      ],
      "description": "The rate billing uses, in micro-dollars, a millionth of a dollar: a day is a thirtieth of the monthly rate."
    },
    "free_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "The first day this SPACE's own bytes are billed, when it was given free days; null otherwise."
        },
        {
          "type": "null"
        }
      ]
    },
    "per_day_micro_usd": {
      "type": "integer",
      "minimum": 0,
      "description": "What a day costs at the present measure, rounded down: this SPACE's bytes over the allowance, 0 on a free day or when it is not billed, and each SPACE it pays for. A replaced SPACE: its own day, which credited_to pays."
    },
    "pays_for": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "space": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{2,62}$",
            "description": "A SPACE's name: 3 to 63 lowercase letters, digits and hyphens."
          },
          "per_day_micro_usd": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "space",
          "per_day_micro_usd"
        ]
      },
      "description": "Present only when not empty: each SPACE this one replaced whose day costs more than 0, and that cost, which per_day_micro_usd includes."
    },
    "would_be_billed_per_day_micro_usd": {
      "type": "integer",
      "minimum": 0,
      "deprecated": true,
      "description": "Deprecated, removed in 0.10: what over_bytes costs a day at the rate shown, free days and SPACES paid for aside. Read per_day_micro_usd."
    },
    "last_day": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "day": {
              "type": "string",
              "format": "date",
              "description": "The latest UTC day the billing job finished."
            },
            "over_allowance": {
              "type": "boolean"
            },
            "billable_bytes": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Posts, files and tasks that day, when over. To a caller who is not a member, their sum rounded down once to a multiple of 100,000; bytes rounds each."
                },
                {
                  "type": "null"
                }
              ]
            },
            "billed_micro_usd": {
              "type": "integer",
              "minimum": 0,
              "description": "What billable_bytes as shown cost that day, at that day's allowance and rate."
            },
            "taken_micro_usd": {
              "type": "integer",
              "minimum": 0,
              "description": "What the bill took from the balance: less than billed when the balance was short, 0 on a free or shadow day. To a caller who is not a member, rounded toward zero to the cent."
            },
            "free": {
              "type": "boolean",
              "description": "One of this SPACE's free days: the cost recorded, nothing taken."
            },
            "shadow": {
              "type": "boolean",
              "description": "Recorded before billing_from or while billing was paused: nothing taken."
            },
            "would_be_billed_micro_usd": {
              "type": "integer",
              "minimum": 0,
              "deprecated": true,
              "description": "Deprecated, removed in 0.10: equals billed_micro_usd."
            }
          },
          "required": [
            "day",
            "over_allowance",
            "billable_bytes",
            "billed_micro_usd",
            "taken_micro_usd",
            "free",
            "shadow",
            "would_be_billed_micro_usd"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "balance_micro_usd": {
      "type": "integer",
      "minimum": 0,
      "description": "The SPACE's credit, in micro-dollars: what its confirmed deposits credited, less its bills, plus or minus its adjustments, such as a balance a recovery moved. Each day's bill is taken from it. To a caller who is not a member, rounded down to the cent."
    },
    "days_left": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "description": "The balance over per_day_micro_usd, rounded down; null while that is 0 or the SPACE is replaced."
        },
        {
          "type": "null"
        }
      ]
    },
    "read_only": {
      "type": "boolean",
      "description": "true while the credit that pays this SPACE's storage cannot pay a day: a storing write there is refused CREDIT_NEEDED. A replaced SPACE: whether the SPACE that pays for it is."
    },
    "read_only_since": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "When a bill that could not take its whole cost made it read-only; null when it is not read-only, or is read-only at zero credit with no bill short yet."
        },
        {
          "type": "null"
        }
      ]
    },
    "deposits": {
      "type": "object",
      "properties": {
        "pending": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "coin": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The coin paid, as base/usdc when the coin table has it, else as the provider named it: 64 characters at most."
              },
              "txid_in": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "The transaction that paid it, public on its chain: 200 characters at most."
              },
              "value_coin": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The amount, in the coin's units, when the provider sent one."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seen_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "coin",
              "txid_in",
              "value_coin",
              "seen_at"
            ]
          },
          "maxItems": 20,
          "description": "Incoming, not yet confirmed: never credited until then. Newest first."
        },
        "held": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "coin": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The coin paid, as base/usdc when the coin table has it, else as the provider named it: 64 characters at most."
              },
              "txid_in": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "The transaction that paid it, public on its chain: 200 characters at most."
              },
              "value_forwarded_coin": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "usd_micro": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "description": "What it would credit, when that could be worked out."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reason": {
                "type": "string",
                "description": "unknown_coin, wrong_family, no_usd_value, zero_value, txid_credited, review or conflict."
              },
              "seen_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "coin",
              "txid_in",
              "value_forwarded_coin",
              "usd_micro",
              "reason",
              "seen_at"
            ]
          },
          "maxItems": 20,
          "description": "Confirmed and not credited. Newest first."
        },
        "rejected": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "coin": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The coin paid, as base/usdc when the coin table has it, else as the provider named it: 64 characters at most."
              },
              "txid_in": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "The transaction that paid it, public on its chain: 200 characters at most."
              },
              "reason": {
                "type": "string",
                "description": "address_in_mismatch or address_out_mismatch."
              },
              "seen_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "coin",
              "txid_in",
              "reason",
              "seen_at"
            ]
          },
          "maxItems": 20,
          "description": "A notice that named an address or wallet other than this SPACE's. Newest first."
        },
        "pending_count": {
          "type": "integer",
          "minimum": 0
        },
        "held_count": {
          "type": "integer",
          "minimum": 0
        },
        "rejected_count": {
          "type": "integer",
          "minimum": 0
        },
        "credited_count": {
          "type": "integer",
          "minimum": 0,
          "description": "Deposits credited to this SPACE."
        }
      },
      "required": [
        "pending",
        "held",
        "rejected",
        "pending_count",
        "held_count",
        "rejected_count",
        "credited_count"
      ],
      "description": "The deposits to this SPACE's addresses not credited: 20 of each at most."
    },
    "history": {
      "type": "string",
      "description": "Where its credit entries are: GET /v1/spaces/{name}/funding/history."
    },
    "notice": {
      "type": "string",
      "description": "A sentence from the service: what the answer is and what it is not."
    }
  },
  "required": [
    "space",
    "visibility",
    "billing",
    "billing_from",
    "deposits_open",
    "addresses",
    "credited_to",
    "ready_coins",
    "make_address",
    "bytes",
    "allowance_bytes",
    "over_bytes",
    "rate",
    "free_until",
    "per_day_micro_usd",
    "would_be_billed_per_day_micro_usd",
    "last_day",
    "balance_micro_usd",
    "days_left",
    "read_only",
    "read_only_since",
    "deposits",
    "history",
    "notice"
  ],
  "$defs": {
    "DepositAddress": {
      "type": "object",
      "properties": {
        "coin": {
          "type": "string",
          "description": "The ticker it was made for."
        },
        "symbol": {
          "anyOf": [
            {
              "type": "string",
              "description": "The coin's own ticker, as USDC."
            },
            {
              "type": "null"
            }
          ]
        },
        "network": {
          "anyOf": [
            {
              "type": "string",
              "description": "The network it moves on, as Base."
            },
            {
              "type": "null"
            }
          ]
        },
        "family": {
          "type": "string",
          "enum": [
            "evm",
            "solana",
            "btc",
            "tron"
          ]
        },
        "address": {
          "type": "string",
          "description": "Where to send it."
        },
        "minimum": {
          "anyOf": [
            {
              "type": "string",
              "description": "The smallest deposit credited, in the coin's units, as a decimal, as read on minimums_as_of."
            },
            {
              "type": "null"
            }
          ]
        },
        "cheap": {
          "type": "boolean",
          "description": "The provider's estimate of the network fee to forward a deposit was below $0.50 on minimums_as_of."
        },
        "stable": {
          "type": "boolean",
          "description": "A US dollar stablecoin, credited one for one."
        },
        "current": {
          "type": "boolean",
          "description": "It forwards to the wallet this server uses now."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "coin",
        "symbol",
        "network",
        "family",
        "address",
        "minimum",
        "cheap",
        "stable",
        "current",
        "created_at"
      ],
      "description": "A SPACE's deposit address for one coin. It is public."
    },
    "FundingCoin": {
      "type": "object",
      "properties": {
        "coin": {
          "type": "string",
          "description": "The ticker to send as coin: base/usdc, sol/usdc, btc."
        },
        "symbol": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "The provider's name for the coin."
        },
        "network": {
          "type": "string"
        },
        "family": {
          "type": "string",
          "enum": [
            "evm",
            "solana",
            "btc",
            "tron"
          ]
        },
        "minimum": {
          "type": "string",
          "description": "The smallest deposit credited, in the coin's units, as a decimal, as read on minimums_as_of."
        },
        "cheap": {
          "type": "boolean",
          "description": "The provider's estimate of the network fee to forward a deposit was below $0.50 on minimums_as_of."
        },
        "stable": {
          "type": "boolean",
          "description": "A US dollar stablecoin, credited one for one."
        }
      },
      "required": [
        "coin",
        "symbol",
        "name",
        "network",
        "family",
        "minimum",
        "cheap",
        "stable"
      ],
      "description": "A coin a SPACE can be funded with on this server now."
    }
  }
}