Class OrderbookV1

Hierarchy

  • OrderbookV1

Constructors

Properties

apiKey: string

The API key to use for fetching data from the Premia API.

See

https://docs.premia.finance/api/authentication

chainId: number

This is the chain id of where orders will SETTLE (ie Arbitrum or Arbitrum Goerli)

uri: string

The base URI to use for fetching data from the Premia API.

See

https://docs.premia.finance/api

ws?: WebSocket
wsUri: string

The base websocket URI to use for streaming data from the Premia API.

See

https://docs.premia.finance/api

Methods

  • Parameters

    • messageBody: {
          chainId: string;
          poolKey: PoolKey;
          side: "bid" | "ask";
          size: string;
          taker: string;
      }
      • chainId: string
      • poolKey: PoolKey
      • side: "bid" | "ask"
      • size: string
      • taker: string
    • Optional callback: ((data) => void)

    Returns Promise<void>

  • Waits for the websocket to connect

    Parameters

    • timeout: number = 10000

      timeout in milliseconds (default 10 seconds)

    Returns Promise<unknown>

    a promise that resolves to true if connected, false if not connected

Generated using TypeDoc