{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/enjin/json-schema/enjin-staking-info-response-schema.json",
  "title": "StakingInfoResponse",
  "description": "Response for GET /accounts/{accountId}/staking-info",
  "x-generated": "2026-12-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/enjin-openapi-openapi.json#/components/schemas/StakingInfoResponse",
  "type": "object",
  "required": [
    "at",
    "controller",
    "rewardDestination",
    "numSlashingSpans",
    "staking"
  ],
  "properties": {
    "ahTimestamp": {
      "type": [
        "string",
        "null"
      ]
    },
    "at": {
      "$ref": "#/$defs/BlockInfo"
    },
    "controller": {
      "type": "string",
      "description": "Controller address"
    },
    "nominations": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/NominationsInfo",
          "description": "Nomination info (null if not a nominator)"
        }
      ]
    },
    "numSlashingSpans": {
      "type": "string",
      "description": "Number of slashing spans"
    },
    "rcBlockHash": {
      "type": [
        "string",
        "null"
      ]
    },
    "rcBlockNumber": {
      "type": [
        "string",
        "null"
      ]
    },
    "rewardDestination": {
      "$ref": "#/$defs/RewardDestination",
      "description": "Reward destination configuration"
    },
    "staking": {
      "$ref": "#/$defs/StakingLedger",
      "description": "Staking ledger information"
    }
  },
  "$defs": {
    "BlockInfo": {
      "type": "object",
      "description": "Block information",
      "required": [
        "hash",
        "height"
      ],
      "properties": {
        "hash": {
          "type": "string"
        },
        "height": {
          "type": "string"
        }
      }
    },
    "ClaimedReward": {
      "type": "object",
      "description": "Claimed reward status for a specific era",
      "required": [
        "era",
        "status"
      ],
      "properties": {
        "era": {
          "type": "string",
          "description": "Era index"
        },
        "status": {
          "type": "string",
          "description": "Claim status (\"claimed\" or \"unclaimed\")"
        }
      }
    },
    "NominationsInfo": {
      "type": "object",
      "description": "Nominations information for a nominator",
      "required": [
        "targets",
        "submittedIn",
        "suppressed"
      ],
      "properties": {
        "submittedIn": {
          "type": "string",
          "description": "Era in which nomination was submitted"
        },
        "suppressed": {
          "type": "boolean",
          "description": "Whether nominations are suppressed"
        },
        "targets": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of validator addresses being nominated"
        }
      }
    },
    "RewardDestination": {
      "oneOf": [
        {
          "type": "object",
          "description": "Rewards are automatically re-staked",
          "required": [
            "staked"
          ],
          "properties": {
            "staked": {
              "default": null
            }
          }
        },
        {
          "type": "object",
          "description": "Rewards are sent to the stash account",
          "required": [
            "stash"
          ],
          "properties": {
            "stash": {
              "default": null
            }
          }
        },
        {
          "type": "object",
          "description": "Rewards are sent to the controller account",
          "required": [
            "controller"
          ],
          "properties": {
            "controller": {
              "default": null
            }
          }
        },
        {
          "type": "object",
          "description": "No reward destination",
          "required": [
            "none"
          ],
          "properties": {
            "none": {
              "default": null
            }
          }
        },
        {
          "type": "object",
          "description": "Rewards are sent to a specific account",
          "required": [
            "account"
          ],
          "properties": {
            "account": {
              "type": "string",
              "description": "Rewards are sent to a specific account"
            }
          }
        }
      ],
      "description": "Reward destination - e.g. { \"staked\": null }, { \"stash\": null }, { \"account\": \"...\" }"
    },
    "StakingLedger": {
      "type": "object",
      "description": "Staking ledger information",
      "required": [
        "stash",
        "total",
        "active",
        "unlocking"
      ],
      "properties": {
        "active": {
          "type": "string",
          "description": "Active staked balance"
        },
        "claimedRewards": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/ClaimedReward"
          },
          "description": "Claimed rewards per era (only when includeClaimedRewards=true)"
        },
        "stash": {
          "type": "string",
          "description": "Stash account address"
        },
        "total": {
          "type": "string",
          "description": "Total locked balance (active + unlocking)"
        },
        "unlocking": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UnlockingChunk"
          },
          "description": "Unlocking chunks with value and era"
        }
      }
    },
    "UnlockingChunk": {
      "type": "object",
      "description": "Unlocking chunk with value and era when funds become available",
      "required": [
        "value",
        "era"
      ],
      "properties": {
        "era": {
          "type": "string",
          "description": "Era when funds become available"
        },
        "value": {
          "type": "string",
          "description": "Amount being unlocked"
        }
      }
    }
  }
}