The RestPublicClient is used to make public requests to the Katana Perps API. It does not require any special options to access.

  • An apiKey can be provided to increase rate limits.
  • Optionally, a sandbox option can be set to true in order to point to the Katana Perps Sandbox API.

Example

import { RestPublicClient } from '@katanaperps/katana-perps-sdk';

// works without any options
// const publicClient = new RestPublicClient();

const publicClient = new RestPublicClient({
sandbox: true,
// Optionally provide an API key to increase rate limits
apiKey: '1f7c4f52-4af7-4e1b-aa94-94fac8d931aa',
});

const tickers = await publicClient.getTickers('ETH-USD');
console.log('Tickers: ', tickers);


See

Constructor

  • The RestPublicClient is used to make public requests to the Katana Perps API. It does not require any special options to access.

    • An apiKey can be provided to increase rate limits.
    • Optionally, a sandbox option can be set to true in order to point to the Katana Perps Sandbox API.

    Parameters

    Returns RestPublicClient

    Example

    import { RestPublicClient } from '@katanaperps/katana-perps-sdk';

    // works without any options
    // const publicClient = new RestPublicClient();

    const publicClient = new RestPublicClient({
    sandbox: true,
    // Optionally provide an API key to increase rate limits
    apiKey: '1f7c4f52-4af7-4e1b-aa94-94fac8d931aa',
    });

    const tickers = await publicClient.getTickers('ETH-USD');
    console.log('Tickers: ', tickers);


    See

Exchange Data

  • Returns basic information about the exchange.

    • Some of the returned parmeters can be used to configure contract calls required for other methods.

    Endpoint Parameters

    • HTTP Request: GET /v1/exchange
    • Endpoint Security: Public
    • API Key Scope: None

    Returns Promise<KatanaPerpsExchange>

    An object matching katanaperps.KatanaPerpsExchange KatanaPerpsExchange providing properties relating to the exchange.


    See

  • Returns candle (OHLCV) data for a market

    • For autocompletion and inline documentation, use the katanaperps.CandleInterval CandleInterval enum when specifying the interval property (see example)
    • TIP: Automatic candle updates are avilable via the WebSocket API candles subscription, which is both faster and more efficient than polling this endpoint!

    Endpoint Parameters

    • HTTP Request: GET /v1/candles
    • Endpoint Security: Public
    • API Key Scope: None
    • Pagination: katanaperps.RestRequestPagination.start start, katanaperps.RestRequestPagination.end end, katanaperps.RestRequestPagination.limit limit

    Parameters

    Returns Promise<RestResponseGetCandles>

    Example

    import { RestPublicClient, CandleInterval } from '@katanaperps/katana-perps-sdk';

    const client = new RestPublicClient();

    const candles = await client.getCandles({
    market: 'ETH-USD',
    interval: CandleInterval.ONE_MINUTE
    })


    See

    • typedoc Reference Documentation
    • request katanaperps.RestRequestGetCandles RestRequestGetCandles
    • response katanaperps.RestResponseGetCandles RestResponseGetCandles
    • type katanaperps.KatanaPerpsCandle KatanaPerpsCandle
  • Returns trade data for a market. In this documentation, "trades" refers to public information about trades, whereas "fills" refers to detailed non-public information about trades resulting from orders placed by the API account.

    • TIP: Automatic trades updates are available via the WebSocket API trades subscription, which is both faster and more efficient than polling this endpoint!
    • TIP: There is also a call on the authenticated client RestAuthenticatedClient.getFills which includes the katanaperps.KatanaPerpsFill KatanaPerpsFill properties, if required.

    Endpoint Parameters

    • HTTP Request: GET /v1/trades
    • Endpoint Security: Public
    • API Key Scope: None
    • Pagination: katanaperps.RestRequestPaginationWithFromId.start start, katanaperps.RestRequestPaginationWithFromId.end end, katanaperps.RestRequestPaginationWithFromId.limit limit, katanaperps.RestRequestPaginationWithFromId.fromId fromId

    Parameters

    Returns Promise<RestResponseGetTrades>

    See

Utility