Skip to content

Latest commit

 

History

History
415 lines (237 loc) · 12.1 KB

restclient.md

File metadata and controls

415 lines (237 loc) · 12.1 KB

cw-sdk-node - v1.0.0-beta.9RESTClient

Class: RESTClient

Hierarchy

  • RESTClient

Index

Constructors

Methods

Constructors

constructor

+ new RESTClient(options?: RESTOpts): RESTClient

Defined in src/rest/RESTClient.ts:37

Parameters:

Name Type
options? RESTOpts

Returns: RESTClient

Methods

getAllowance

getAllowance(): RESTAllowance

Defined in src/rest/RESTClient.ts:77

Returns the most recently retrieved REST allowance data.

Returns: RESTAllowance


getAsset

getAsset(assetSelector: number | string): Promise‹Asset

Defined in src/rest/RESTClient.ts:201

Returns a single asset.

Parameters:

Name Type Description
assetSelector number | string number

Returns: Promise‹Asset


getAssetByID

getAssetByID(assetId: number): Promise‹Asset

Defined in src/rest/RESTClient.ts:221

Returns a single market, with associated routes.

Parameters:

Name Type Description
assetId number number id of specific asset

Returns: Promise‹Asset


getAssetBySymbol

getAssetBySymbol(assetSymbol: string): Promise‹Asset

Defined in src/rest/RESTClient.ts:213

Returns a single asset, with associated routes.

Parameters:

Name Type Description
assetSymbol string string symbol for specific requested asset (Examples: 'btc', 'usd', 'eth', 'jpy', etc...)

Returns: Promise‹Asset


getExchange

getExchange(exchangeSymbol: string): Promise‹ExchangeDescription

Defined in src/rest/RESTClient.ts:98

Returns a single exchange, with associated routes.

see https://cryptowat.ch/docs/api#exchange-details

Parameters:

Name Type Description
exchangeSymbol string string (example: 'kraken')

Returns: Promise‹ExchangeDescription


getExchangeMarkets

getExchangeMarkets(exchangeSymbol: string): Promise‹MarketDescription[]›

Defined in src/rest/RESTClient.ts:150

Returns a list of supported markets for a specific exchange.

see https://cryptowat.ch/docs/api#market-index

Parameters:

Name Type Description
exchangeSymbol string string (Example: 'kraken')

Returns: Promise‹MarketDescription[]›


getExchanges

getExchanges(): Promise‹ExchangeBrief[]›

Defined in src/rest/RESTClient.ts:89

Returns a list of all supported exchanges.

see https://cryptowat.ch/docs/api#pairs-index

Returns: Promise‹ExchangeBrief[]›


getMarket

getMarket(marketSelector: MarketSelector): Promise‹Market

Defined in src/rest/RESTClient.ts:172

Returns a single market.

Parameters:

Name Type Description
marketSelector MarketSelector MarketSelector id of market (number) or MarketSymbol (Example: {exchange: 'kraken', base: 'btc', quote:'usd'})

Returns: Promise‹Market


getMarketByID

getMarketByID(marketID: number): Promise‹Market

Defined in src/rest/RESTClient.ts:192

Returns a single market.

Parameters:

Name Type Description
marketID number number id of specific market.

Returns: Promise‹Market


getMarketBySymbol

getMarketBySymbol(marketSymbol: MarketSymbol): Promise‹Market

Defined in src/rest/RESTClient.ts:184

Returns a single market.

Parameters:

Name Type Description
marketSymbol MarketSymbol MarketSymbol (Example: {exchange: 'kraken', base: 'btc', quote:'usd'})

Returns: Promise‹Market


getMarketDescription

getMarketDescription(exchangeSymbol: string, pairSymbol: string): Promise‹MarketDescription

Defined in src/rest/RESTClient.ts:160

Returns a single market, with associated routes.

see https://cryptowat.ch/docs/api#market-details

Parameters:

Name Type Description
exchangeSymbol string string (Example: 'kraken')
pairSymbol string string (Example: 'btcusd')

Returns: Promise‹MarketDescription


getMarkets

getMarkets(): Promise‹MarketBrief[]›

Defined in src/rest/RESTClient.ts:123

Returns a list of all supported markets.

see https://cryptowat.ch/docs/api#market-index

Returns: Promise‹MarketBrief[]›


getOHLC

getOHLC(exchangeSymbol: string, pairSymbol: string, options: OHLCOptions): Promise‹MarketOHLC

Defined in src/rest/RESTClient.ts:232

Returns a market's OHLC candlestick data.

see https://cryptowat.ch/docs/api#market-ohlc

Parameters:

Name Type Default Description
exchangeSymbol string - string (Example: 'kraken')
pairSymbol string - string (Example: 'btcusd')
options OHLCOptions {} Optional - see API documentation

Returns: Promise‹MarketOHLC


getOrderBookSnapshot

getOrderBookSnapshot(exchangeSymbol: string, pairSymbol: string): Promise‹OrderBookSnapshot

Defined in src/rest/RESTClient.ts:259

Returns a market's order book.

see https://cryptowat.ch/docs/api#market-orderbook

Parameters:

Name Type Description
exchangeSymbol string string (Example: 'kraken')
pairSymbol string string (Example: 'btcusd')

Returns: Promise‹OrderBookSnapshot


getPair

getPair(pairSymbol: string): Promise‹PairDetails

Defined in src/rest/RESTClient.ts:115

Returns a single pair. Lists all markets for this pair.

see https://cryptowat.ch/docs/api#pair-details

Parameters:

Name Type Description
pairSymbol string string (example: 'btcusd')

Returns: Promise‹PairDetails


getPairsIndex

getPairsIndex(): Promise‹PairBrief[]›

Defined in src/rest/RESTClient.ts:106

Returns all pairs (in no particular order).

see https://cryptowat.ch/docs/api#pairs-index

Returns: Promise‹PairBrief[]›


getPrice

getPrice(exchangeSymbol: string, pairSymbol: string): Promise‹Price

Defined in src/rest/RESTClient.ts:274

Returns a market's last price.

see https://cryptowat.ch/docs/api#market-price

Parameters:

Name Type Description
exchangeSymbol string string (Example: 'kraken')
pairSymbol string string (Example: 'btcusd')

Returns: Promise‹Price


getSummaries

getSummaries(): Promise‹Summaries

Defined in src/rest/RESTClient.ts:131

Returns the market summary for all supported markets. Some values may be out of date by a few seconds.

see https://cryptowat.ch/docs/api#summaries

Returns: Promise‹Summaries


getSummary

getSummary(exchangeSymbol: string, pairSymbol: string): Promise‹Summary

Defined in src/rest/RESTClient.ts:141

Returns a single market summary.

see https://cryptowat.ch/docs/api#market-summary

Parameters:

Name Type Description
exchangeSymbol string string (Example: 'kraken')
pairSymbol string string (Example: 'btcusd')

Returns: Promise‹Summary


getTrades

getTrades(exchangeSymbol: string, pairSymbol: string): Promise‹Trade[]›

Defined in src/rest/RESTClient.ts:284

Returns a market's most recent trades, incrementing chronologically.

see https://cryptowat.ch/docs/api#market-trades

Parameters:

Name Type Description
exchangeSymbol string string (Example: 'kraken')
pairSymbol string string (Example: 'btcusd')

Returns: Promise‹Trade[]›