Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PublicClient

Hierarchy

  • PublicClient

Index

Constructors

constructor

  • new PublicClient(__namedParameters: { url: string | URL }): PublicClient

Properties

Readonly url

url: URL

Methods

fetch

  • fetch(url: string | URL, __namedParameters?: { headers: undefined | Headers | Record<string, string> | Iterable<[string, string]> | Iterable<Iterable<string>>; options: options }): Promise<unknown>
  • Make a request and parse the body as JSON

    Parameters

    • url: string | URL
    • Default value __namedParameters: { headers: undefined | Headers | Record<string, string> | Iterable<[string, string]> | Iterable<Iterable<string>>; options: options } = {}
      • headers: undefined | Headers | Record<string, string> | Iterable<[string, string]> | Iterable<Iterable<string>>
      • options: options

    Returns Promise<unknown>

getAssets

getCandles

  • getCandles(__namedParameters: { instrument: string; qs: qs }): Promise<ICandlesResponse>

getInstruments

getListOfInstruments

  • getListOfInstruments(): Promise<string[]>
  • Get the list of all supported instruments

    Returns Promise<string[]>

getOrderBookSnapshot

  • getOrderBookSnapshot(__namedParameters: { instrument: string }): Promise<IOrderBookSnapshot>

getRootAsset

getTiers

Private resolveURL

  • resolveURL(path: string): URL

Static fetch

  • fetch(url: string | URL, options?: RequestInit): Promise<unknown>
  • Make a request and parse the body as JSON

    Parameters

    • url: string | URL
    • Default value options: RequestInit = {}

    Returns Promise<unknown>

Static setQuery

  • setQuery(url: URL, query: Record<string, string | number | boolean | undefined>): void
  • Add query to URL

    Parameters

    • url: URL
    • query: Record<string, string | number | boolean | undefined>

    Returns void