{
  "openapi": "3.1.0",
  "info": {
    "title": "MagicBlock Router API",
    "description": "JSON-RPC method getDelegationStatus on MagicBlock Router endpoints.",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://devnet-router.magicblock.app",
      "description": "Devnet - RPC Magic Router"
    },
    {
      "url": "https://router.magicblock.app",
      "description": "Mainnet - RPC Magic Router"
    }
  ],
  "paths": {
    "/": {
      "post": {
        "summary": "getDelegationStatus",
        "description": "Get delegation status for a single account from Magic Router.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": [
                      "2.0"
                    ],
                    "default": "2.0"
                  },
                  "id": {
                    "type": "integer",
                    "default": 1
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "getDelegationStatus"
                    ],
                    "default": "getDelegationStatus"
                  },
                  "params": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 1,
                    "description": "Single account address",
                    "default": [
                      "5RgeA5P8bRaynJovch3zQURfJxXL3QK2JYg1YamSvyLb"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "id",
                  "method",
                  "params"
                ]
              },
              "examples": {
                "default": {
                  "summary": "Default getDelegationStatus request",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "getDelegationStatus",
                    "params": [
                      "5RgeA5P8bRaynJovch3zQURfJxXL3QK2JYg1YamSvyLb"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string",
                      "enum": [
                        "2.0"
                      ],
                      "default": "2.0"
                    },
                    "id": {
                      "oneOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "isDelegated": {
                          "type": "boolean",
                          "description": "Whether the account is delegated"
                        },
                        "fqdn": {
                          "type": "string",
                          "description": "Fully qualified domain name"
                        },
                        "delegationRecord": {
                          "type": "object",
                          "properties": {
                            "authority": {
                              "type": "string",
                              "description": "The authority address"
                            },
                            "owner": {
                              "type": "string",
                              "description": "The owner address"
                            },
                            "delegationSlot": {
                              "type": "integer",
                              "description": "The delegation slot"
                            },
                            "lamports": {
                              "type": "integer",
                              "description": "The amount in lamports"
                            }
                          },
                          "required": [
                            "authority",
                            "owner",
                            "delegationSlot",
                            "lamports"
                          ]
                        }
                      },
                      "required": [
                        "isDelegated",
                        "delegationRecord"
                      ]
                    },
                    "error": {
                      "type": "object",
                      "default": null
                    }
                  }
                },
                "example": {
                  "jsonrpc": "2.0",
                  "id": 1,
                  "result": {
                    "isDelegated": true,
                    "fqdn": "https://devnet-as.magicblock.app/",
                    "delegationRecord": {
                      "authority": "MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57",
                      "owner": "3JnJ727jWEmPVU8qfXwtH63sCNDX7nMgsLbg8qy8aaPX",
                      "delegationSlot": 388473478,
                      "lamports": 15144960
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
