{
  "openapi": "3.2.0",
  "info": {
    "title": "getSlot",
    "version": "1",
    "description": "Read the edge's highest observed slot with getSlot; params and commitment do not affect the result."
  },
  "servers": [
    {
      "url": "https://ams.tpu.supanode.xyz"
    },
    {
      "url": "https://fra.tpu.supanode.xyz"
    },
    {
      "url": "https://la.tpu.supanode.xyz"
    },
    {
      "url": "https://lon.tpu.supanode.xyz"
    },
    {
      "url": "https://ny.tpu.supanode.xyz"
    },
    {
      "url": "https://toy.tpu.supanode.xyz"
    }
  ],
  "security": [
    {
      "apiKeyHeader": []
    },
    {
      "apiKeyQuery": []
    },
    {
      "bearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKeyHeader": {
        "$ref": "#/x-ext/b08d7c8/components/securitySchemes/apiKeyHeader"
      },
      "apiKeyQuery": {
        "$ref": "#/x-ext/b08d7c8/components/securitySchemes/apiKeyQuery"
      },
      "bearer": {
        "$ref": "#/x-ext/b08d7c8/components/securitySchemes/bearer"
      }
    }
  },
  "paths": {
    "/": {
      "post": {
        "operationId": "getSlot",
        "summary": "getSlot",
        "description": "Read the edge's highest observed slot with getSlot; params and commitment do not affect the result.",
        "requestBody": {
          "required": true,
          "description": "One JSON object using the [shared request conventions](https://supanode.xyz/docs/solana/sender/reference/json-rpc#request). The method takes no params.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcVersion"
                  },
                  "id": {
                    "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcId"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "getSlot"
                    ]
                  },
                  "params": {
                    "description": "Ignored when present, so a commitment has no effect."
                  }
                }
              },
              "examples": {
                "Request": {
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "getSlot"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns the highest slot the edge has observed, as an integer. It may not be committed yet. Use your Solana RPC provider for confirmation and block heights.\n\nRefusals with HTTP 200, by `error.data.reason`:\n\n- [`invalid_request`](https://supanode.xyz/docs/solana/sender/reference/errors#invalid_request): invalid JSON-RPC body.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "jsonrpc",
                        "result",
                        "id"
                      ],
                      "properties": {
                        "jsonrpc": {
                          "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcVersion"
                        },
                        "result": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "The highest slot the edge has observed. It may not be committed yet."
                        },
                        "id": {
                          "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcId"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcErrorEnvelope"
                    }
                  ]
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": {
                      "jsonrpc": "2.0",
                      "result": 123456789,
                      "id": 1
                    }
                  },
                  "ParseError": {
                    "$ref": "#/x-ext/b08d7c8/components/examples/ParseError"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/x-ext/b08d7c8/components/responses/Unauthorized"
          },
          "421": {
            "$ref": "#/x-ext/b08d7c8/components/responses/MisdirectedRequest"
          }
        },
        "x-codeSamples": [
          {
            "lang": "rust",
            "id": "rust",
            "label": "Rust",
            "source": "// Builds on the example project (https://supanode.xyz/docs/solana/sender/reference/json-rpc#example-project).\nuse swqos_examples::swqos::{Result, SwqosError, call};\n\n#[tokio::main]\nasync fn main() -> Result<()> {\n    match call::<String>(\"getHealth\", None).await {\n        Ok(health) => println!(\"health {health}\"),\n        Err(error) => {\n            if error\n                .downcast_ref::<SwqosError>()\n                .is_some_and(|error| error.code == -32005)\n            {\n                println!(\"edge not ready\");\n            } else {\n                return Err(error);\n            }\n        }\n    }\n    let slot: u64 = call(\"getSlot\", None).await?;\n    println!(\"slot {slot}\");\n    Ok(())\n}"
          },
          {
            "lang": "go",
            "id": "go",
            "label": "Go",
            "source": "// Builds on the example project (https://supanode.xyz/docs/solana/sender/reference/json-rpc#example-project).\npackage swqos\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\nfunc PrintSlot(ctx context.Context) error {\n\thealth, err := Call[string](ctx, \"getHealth\")\n\tif err != nil {\n\t\tvar refusal *SwqosError\n\t\tif !errors.As(err, &refusal) || refusal.Code != -32005 {\n\t\t\treturn err\n\t\t}\n\t\tfmt.Println(\"edge not ready\")\n\t} else {\n\t\tfmt.Println(\"health\", health)\n\t}\n\tslot, err := Call[uint64](ctx, \"getSlot\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(\"slot\", slot)\n\treturn nil\n}"
          },
          {
            "lang": "ts",
            "id": "ts",
            "label": "TypeScript",
            "source": "// Builds on the example project (https://supanode.xyz/docs/solana/sender/reference/json-rpc#example-project).\nimport { call, SwqosError } from './swqos.ts'\n\ntry {\n  console.log('health', await call<string>('getHealth'))\n} catch (error) {\n  if (error instanceof SwqosError && error.code === -32005) console.log('edge not ready')\n  else throw error\n}\nconsole.log('slot', await call<number>('getSlot'))"
          }
        ]
      }
    }
  },
  "x-ext": {
    "b08d7c8": {
      "components": {
        "schemas": {
          "Rejection": {
            "type": "object",
            "required": [
              "reason",
              "message",
              "retryable"
            ],
            "properties": {
              "reason": {
                "type": "string",
                "description": "Stable snake_case reason. Match on this; `message` wording can change, and the numeric codes are shared with Solana's RPC.",
                "examples": [
                  "missing_tip"
                ]
              },
              "message": {
                "type": "string",
                "description": "What happened and what to change. Wording can change.",
                "examples": [
                  "tip too small: the tip transfers add up to 123 lamports, the minimum is 1,000,000; raise the transfer to one of the tip accounts to at least 1,000,000 lamports"
                ]
              },
              "retryable": {
                "type": "boolean",
                "description": "Whether the unchanged request can succeed later. Wait before retrying, and check that the transaction has not expired.",
                "examples": [
                  false
                ]
              },
              "docs": {
                "type": "string",
                "format": "uri",
                "description": "Optional error documentation URL followed by the reason anchor. Supanode endpoints omit this field.",
                "examples": [
                  "https://supanode.xyz/docs/solana/sender/reference/errors#missing_tip"
                ]
              }
            },
            "additionalProperties": true,
            "description": "Reason-specific fields are included alongside these members, such as minimum, found, declared, available, unpaid_lamports, index, per_second and retry_after_ms. Failed preflight also includes Solana simulation fields such as err, logs and unitsConsumed.",
            "examples": [
              {
                "reason": "missing_tip",
                "minimum": 1000000,
                "found": 123,
                "message": "tip too small: the tip transfers add up to 123 lamports, the minimum is 1,000,000; raise the transfer to one of the tip accounts to at least 1,000,000 lamports",
                "retryable": false,
                "docs": "https://supanode.xyz/docs/solana/sender/reference/errors#missing_tip"
              }
            ]
          },
          "JsonRpcVersion": {
            "type": "string",
            "enum": [
              "2.0"
            ],
            "examples": [
              "2.0"
            ]
          },
          "JsonRpcError": {
            "type": "object",
            "required": [
              "code",
              "message",
              "data"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "enum": [
                  -32700,
                  -32600,
                  -32601,
                  -32602,
                  -32603,
                  -32000,
                  -32001,
                  -32002,
                  -32003
                ],
                "description": "[Status codes](https://supanode.xyz/docs/solana/sender/reference/json-rpc#status-codes) maps reasons and problems to codes. Match on `data.reason`.",
                "examples": [
                  -32602
                ]
              },
              "message": {
                "type": "string",
                "description": "The same sentence as data.message."
              },
              "data": {
                "$ref": "#/x-ext/b08d7c8/components/schemas/Rejection"
              }
            },
            "additionalProperties": false
          },
          "JsonRpcId": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read.",
            "examples": [
              1,
              "request-1",
              null
            ]
          },
          "JsonRpcErrorEnvelope": {
            "type": "object",
            "required": [
              "jsonrpc",
              "error",
              "id"
            ],
            "properties": {
              "jsonrpc": {
                "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcVersion"
              },
              "error": {
                "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcError"
              },
              "id": {
                "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcId"
              }
            },
            "additionalProperties": false
          }
        },
        "securitySchemes": {
          "apiKeyHeader": {
            "type": "apiKey",
            "in": "header",
            "name": "x-api-key",
            "description": "Send the SWQoS API key in this header. See the [authentication reference](https://supanode.xyz/docs/solana/sender/reference/json-rpc#authentication) for compatibility forms and precedence."
          },
          "apiKeyQuery": {
            "type": "apiKey",
            "in": "query",
            "name": "api-key",
            "description": "Compatibility authentication. See the [authentication reference](https://supanode.xyz/docs/solana/sender/reference/json-rpc#authentication) for precedence and the URL logging warning. Prefer x-api-key."
          },
          "bearer": {
            "type": "http",
            "scheme": "bearer",
            "description": "SWQoS API key sent as Authorization: Bearer YOUR_KEY. The prefix `Bearer ` is case-sensitive. Prefer x-api-key. See the [authentication reference](https://supanode.xyz/docs/solana/sender/reference/json-rpc#authentication) for precedence."
          }
        },
        "examples": {
          "ParseError": {
            "summary": "Invalid JSON",
            "value": {
              "jsonrpc": "2.0",
              "error": {
                "code": -32700,
                "message": "the body is not valid JSON",
                "data": {
                  "reason": "invalid_request",
                  "problem": "parse_error",
                  "message": "the body is not valid JSON",
                  "retryable": false,
                  "docs": "https://supanode.xyz/docs/solana/sender/reference/errors#invalid_request"
                }
              },
              "id": null
            }
          }
        },
        "responses": {
          "Unauthorized": {
            "description": "[`unauthorized`](https://supanode.xyz/docs/solana/sender/reference/errors#unauthorized): missing, unknown or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/x-ext/b08d7c8/components/schemas/JsonRpcErrorEnvelope"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "jsonrpc": "2.0",
                      "error": {
                        "code": -32000,
                        "message": "API key missing or not recognized; pass it as the api-key query parameter, an x-api-key header or Authorization: Bearer",
                        "data": {
                          "reason": "unauthorized",
                          "message": "API key missing or not recognized; pass it as the api-key query parameter, an x-api-key header or Authorization: Bearer",
                          "retryable": false,
                          "docs": "https://supanode.xyz/docs/solana/sender/reference/errors#unauthorized"
                        }
                      },
                      "id": null
                    }
                  }
                }
              }
            }
          },
          "MisdirectedRequest": {
            "description": "Unknown or removed TLS SNI or HTTP Host/:authority. Returns plain text without a JSON-RPC envelope or rejection object. The current hostname policy also applies to existing connections and resumed TLS sessions.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "UnknownHost": {
                    "value": "This hostname is not served here. Check the endpoint address"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
