cw-sdk-node - v1.0.0-beta.8 › RESTClient
- RESTClient
- getAllowance
- getAsset
- getAssetByID
- getAssetBySymbol
- getExchange
- getExchangeMarkets
- getExchanges
- getMarket
- getMarketByID
- getMarketBySymbol
- getMarketDescription
- getMarkets
- getOHLC
- getOrderBookSnapshot
- getPair
- getPairsIndex
- getPrice
- getSummaries
- getSummary
- getTrades
+ new RESTClient(options?
: RESTOpts): RESTClient
Defined in src/rest/RESTClient.ts:37
Parameters:
Name | Type |
---|---|
options? |
RESTOpts |
Returns: RESTClient
▸ getAllowance(): RESTAllowance
Defined in src/rest/RESTClient.ts:77
Returns the most recently retrieved REST allowance data.
Returns: RESTAllowance
▸ 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(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(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(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(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(): 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(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(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(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(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(): 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(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(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(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(): 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(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(): 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(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(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[]›