> For the complete documentation index, see [llms.txt](https://titan-exchange.gitbook.io/titan/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titan-exchange.gitbook.io/titan/developer-doc/swap-api/reference/direct/get-info.md).

# GetInfo

Read the server's protocol version and default settings before opening streams.

**`GetInfo` returns the server's protocol version and the default/min/max values for all configurable settings.** Call it after connecting to confirm the server is reachable and to read the bounds you'll need for stream configuration.

## Request

`GetInfoRequest` is an empty object — no parameters. The server ignores any unknown fields.

```typescript
// Empty request — no parameters needed
await sendRequest(ws, requestId++, { GetInfo: {} });
```

See [Connection & Negotiation](/titan/developer-doc/swap-api/reference/direct/connection.md#sending-a-request) for `sendRequest` and `decodeMessage` setup.

## Response

The server responds with a [`ServerInfo`](/titan/developer-doc/swap-api/reference/types.md) object containing the protocol version and all server settings with their defaults and bounds.

```typescript
ws.on('message', async (raw: Buffer) => {
  const msg = await decodeMessage(raw);

  if ('Response' in msg && 'GetInfo' in msg.Response.data) {
    const info = msg.Response.data.GetInfo;

    // Protocol version — major changes are backwards-incompatible
    console.log('Protocol version:', info.protocolVersion);
    // { major: 1, minor: 9, patch: 0 }

    // Quote stream settings — use these bounds when configuring NewSwapQuoteStream
    console.log('Update interval — min/max/default (ms):',
      info.settings.quoteUpdate.intervalMs.min,
      info.settings.quoteUpdate.intervalMs.max,
      info.settings.quoteUpdate.intervalMs.default,
    );

    console.log('Max quotes per update — default:',
      info.settings.quoteUpdate.numQuotes.default
    );

    // How many streams you can open simultaneously on this connection
    console.log('Concurrent streams allowed:',
      info.settings.connection.concurrentStreams
    );
  }
});
```

## ServerInfo

{% tabs %}
{% tab title="Rust" %}

```rust
struct ServerInfo {
  /// Server protocol version information.
  protocolVersion: VersionInfo,
  /// Server settings and parameter bounds.
  settings: ServerSettings,
}

struct VersionInfo {
  /// Major version — incremented for backwards-incompatible changes.
  major: u16,
  /// Minor version — incremented for backwards-compatible changes.
  minor: u16,
  /// Patch version — informational, no data format changes.
  patch: u16,
}

struct ServerSettings {
  /// Settings and parameter bounds for quote updates.
  quoteUpdate: QuoteUpdateSettings,
  /// Settings and parameter bounds for swaps.
  swap: SwapSettings,
  /// Settings and parameter bounds for transaction generation.
  transaction: TransactionSettings,
  /// Settings and limits for the connection.
  connection: ConnectionSettings,
}

struct BoundedValueWithDefault<T> {
  /// Minimum allowed value.
  min: T,
  /// Maximum allowed value.
  max: T,
  /// Default value when not specified in request.
  default: T,
}

struct QuoteUpdateSettings {
  /// Bounds and default for the `intervalMs` parameter.
  intervalMs: BoundedValueWithDefault<u64>,
  /// Bounds and default for the `numQuotes` parameter.
  numQuotes: BoundedValueWithDefault<u32>,
}

struct SwapSettings {
  /// Default and bounds for `slippageBps`.
  slippageBps: BoundedValueWithDefault<u16>,
  /// Default value for `onlyDirectRoutes`.
  onlyDirectRoutes: bool,
  /// Default value for `addSizeConstraint`.
  addSizeConstraint: bool,
}

struct TransactionSettings {
  /// Default value for `closeInputTokenAccount`.
  closeInputTokenAccount: bool,
  /// Default value for `createOutputTokenAccount`.
  createOutputTokenAccount: bool,
}

struct ConnectionSettings {
  /// Number of concurrent streams the user is allowed.
  concurrentStreams: u32,
}
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
interface ServerInfo {
  // Server protocol version information.
  protocolVersion: VersionInfo;
  // Server settings and parameter bounds.
  settings: ServerSettings;
}

interface VersionInfo {
  // Major version — incremented for backwards-incompatible changes.
  major: number;
  // Minor version — incremented for backwards-compatible changes.
  minor: number;
  // Patch version — informational, no data format changes.
  patch: number;
}

interface ServerSettings {
  // Settings and parameter bounds for quote updates.
  quoteUpdate: QuoteUpdateSettings;
  // Settings and parameter bounds for swaps.
  swap: SwapSettings;
  // Settings and parameter bounds for transaction generation.
  transaction: TransactionSettings;
  // Settings and limits for the connection.
  connection: ConnectionSettings;
}

interface QuoteUpdateSettings {
  // Bounds and default for `intervalMs` parameter.
  intervalMs: { min: number; max: number; default: number };
  // Bounds and default for `numQuotes` parameter.
  numQuotes: { min: number; max: number; default: number };
}

interface SwapSettings {
  // Default and bounds for `slippageBps`.
  slippageBps: { min: number; max: number; default: number };
  // Default value for `onlyDirectRoutes`.
  onlyDirectRoutes: boolean;
  // Default value for `addSizeConstraint`.
  addSizeConstraint: boolean;
}

interface TransactionSettings {
  // Default value for `closeInputTokenAccount`.
  closeInputTokenAccount: boolean;
  // Default value for `createOutputTokenAccount`.
  createOutputTokenAccount: boolean;
}

interface ConnectionSettings {
  // Number of concurrent streams the user is allowed.
  concurrentStreams: number;
}
```

{% endtab %}
{% endtabs %}

## Related pages

* [Connection & Negotiation](/titan/developer-doc/swap-api/reference/direct/connection.md) — WebSocket setup, authentication, and the `sendRequest`/`decodeMessage` helpers used above
* [NewSwapQuoteStream](/titan/developer-doc/swap-api/reference/direct/new-swap-quote-stream.md) — open a streaming swap quote using the settings from GetInfo
* [Wire Protocol](/titan/developer-doc/swap-api/reference/wire-protocol.md) — MessagePack encoding and serialization details
