npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

upbit-api

v0.10.4

Published

This is an API that makes Upbit OpenAPI easy to use.

Downloads

57

Readme

upbit-api

npm npm npm npm npm npm npm

upbit-api is an API that makes Upbit OpenAPI easy to use.

This api will support the Restful API and Websocket API.

It was created with Typescript and compiled into es2017.

Coverage Table

The § symbol includes auto-update: autoMarketUpdate or autoOrderBookUpdate

WS is WebSocket.

| Method | Upbit | upbit-api | version | |--------|-----------------------|-----------------|-----------------| | GET | /ticker | ticker § | 0.0.1+ | | GET | /orderbook | orderBook § | 0.2.0+ | | GET | /trades/ticks | ticks | 0.5.0+ | | GET | /candles/minutes/unit | candlesMinutes | 0.6.0+ |
| GET | /market/all | allMarket | 0.7.0+ | | GET | /candles/days | candlesDay | 0.9.0+ | | GET | /candles/weeks | candlesWeek | 0.10.0+ | | GET | /candles/months | candlesMonth | 0.10.0+ | | GET | /accounts | Unsupported | At least 0.11.0 | | GET | /orders/chance | Unsupported | At least 0.11.0 | | GET | /order | Unsupported | At least 0.11.0 | | GET | /orders | Unsupported | At least 0.11.0 | | POST | /orders | Unsupported | At least 0.11.0 | | DELETE | /order | Unsupported | At least 0.11.0 | | GET | /withdraws | Unsupported | At least 0.11.0 | | GET | /withdraw | Unsupported | At least 0.11.0 | | GET | /withdraws/chance | Unsupported | At least 0.11.0 | | POST | /withdraws/coin | Unsupported | At least 0.11.0 | | POST | /withdraws/krw | Unsupported | At least 0.11.0 | | GET | /deposits | Unsupported | At least 0.11.0 | | WS | ticker | Unsupported | At least 0.11.0 | | WS | trade | Unsupported | At least 0.11.0 | | WS | orderbook | Unsupported | At least 0.11.0 |

ticker(market)

Create new Market object arrays.

| Parameter | Type | Description | |----------------|--------------------------- |-------------------------------------| | market | string or Array<string> | 'KRW-BTC' or ['KRW-BTC', 'KRW-XRP'] |

Market class

| Parameter | Type | Description | |-------------------|--------|--------------------------------------------| | market | string | ex) KRW, BTC, USDT ... | | coin | string | ex) BTC, ETH, XRP ... | | marketCode | string | ex) KRW-BTC, KRW-XRP ... | | tradeTime | Date | trade time | | price | number | price | | open | number | Market value | | high | number | Highest price | | low | number | Lowest price | | prevClose | number | the closing price of the previous day | | change | number | EVEN: Mixture RISE: Rise FALL: Fall | | changePrice | number | Absolute value of change amount | | changeRate | number | Absolute value of change rate | | signedChangePrice | number | signed change Price | | signedChangeRate | number | signed change rate | | tradeVolume | number | Latest volume | | accTradePrice | number | accTradePrice | | accTradePrice24 | number | accTradePrice24 | | accTradeVolume | number | Cumulative transaction amount(UTC 0) | | accTradeVolume24 | number | Cumulative transaction amount for 24 hours | | high52wPrice | number | 52 Weeks New Highest Price | | high52wDate | Date | 52 Weeks New Highest Price'Date | | low52wPrice | number | 52 Weeks New Lowest Price | | low52wDate | Date | 52 Weeks New Lowest Price's Date | | lastUpdate | Date | The time when this object updated |

autoMarketUpdate(market, time , errorHandler, callback?)

Updates object market every specified time time.

| Parameter | Type | Description | |----------------|--------------------------- |---------------------------------------| | market | Market or Array<Market> | Market object that will be updated. | | time | number | Frequency to update (in milliseconds) | | errorHandler | function, (error) => any | error handler | | callback | function, (market) => any | optional, this function called when object updated. |

OrderBook(market)

Create new OrderBook object arrays.

| Parameter | Type | Description | |----------------|--------------------------- |-------------------------------------| | market | string or Array<string> | 'KRW-BTC' or ['KRW-BTC', 'KRW-XRP'] |

OrderBook class

| Name | Type | Description | |----------------|------- |-------------| | market | string | ex) KRW, BTC, USDT ... | | coin | string | ex) BTC, ETH, XRP ... | | marketCode | string | ex) KRW-BTC, KRW-XRP ... | | lastUpdate | Date | The time when this object updated | | askList | Array<Order> | Ask order list | | bidList | Array<Order> | Bid order list | | totalAsk |number | total ask | | totalBid |number | total bid |

Order class

| Name | Type | Description | |----------------|------- |-------------| | price | number | price of order| | size | number | size of order |

autoOrderBookUpDate(orderBook, time , errorHandler, callback?)

Updates object OrderBook every specified time time.

| Parameter | Type | Description | |----------------|--------------------------- |---------------------------------------| | orderBook | OrderBook or Array<OrderBook> | OrderBook object that will be updated. | | time | number | Frequency to update (in milliseconds) | | errorHandler | function, (error) => any | error handler | | callback | function, (orderBook) => any | optional, this function called when object updated. |

ticks(market, count?, to?, cursor?)

Create new Trade object arrays.

| Parameter | Type | Description | |----------------|--------------------------- |-------------------------------------| | market | string or Array<string> | 'KRW-BTC' or ['KRW-BTC', 'KRW-XRP'] | | count | number | count | | to | string | HHmmss or HH:mm:ss | | cursor | number | sequential_id |

Trade class

| Name | Type | Description | |--------------------|------- |-------------| | market | string | ex) KRW, BTC, USDT ... | | coin | string | ex) BTC, ETH, XRP ... | | marketCode | string | ex) KRW-BTC, KRW-XRP ... | | lastUpdate | Date | The time when this object updated | | tradeTime | Date | The time when traded | | price | number | price of this trade | | volume | number | volume of this trade | | prev_closing_price | number | prev_closing_price | | change_price | number | price - prev_closing_price | | isAsk | boolean | Trade type | | sequential_id | number | Transaction Number(Unique) |

candlesMinutes(market, unit?, count?, to?)

Create Candle object arrays.

| Parameter | Type | Description | |----------------|--------------------------- |-------------------------------------| | market | string or Array<string> | 'KRW-BTC' or ['KRW-BTC', 'KRW-XRP'] | | unit | number | 1, 3, 5, 15, 10, 30, 60, 240 | | count | number | count | | to | string | yyyy-MM-dd'T'HH:mm:ssXXX |

Candle class

| Name | Type | Description | |-------------------|--------|-----------------------------------------------------------| | market | string | ex) KRW, BTC, USDT ... | | coin | string | ex) BTC, ETH, XRP ... | | marketCode | string | ex) KRW-BTC, KRW-XRP ... | | timestamp | number | The time at which the last tick was stored in the candle. | | candleDateTimeUTC | Date | Standard time of the candle (UTC basis) | | candleDateTimeKST | Date | Standard time of the candle (KST basis) | | open | number | Market value | | high | number | Highest price | | low | number | Lowest price | | accTradePrice | number | Candle's accTradePrice | | accTradeVolume | number | Candle's cumulative transaction amount | | lastUpdate | Date | The time when this object updated |

MinutesCandle class

MinutesCandle extends Candle

| Name | Type | Description | |-------------------|--------|-----------------------------------------------------------| | unit | number | minutes. Possible values: 1, 3, 5, 15, 10, 30, 60, 240 |

DayCandle class

DayCandle extends Candle

| Name | Type | Description | |---------------------|--------|---------------------------------------| | prevClosingPrice | number | the closing price of the previous day | | convertedTradePrice | number | a price converted into denominations | | changePrice | number | value of change amount | | changeRate | number | value of change rate |

WeekMonthCandle class

WeekMonthCandle extends Candle

| Name | Type | Description | |---------------------|--------|---------------------------------------| | firstDayOfPeriod | number | first day of period |

allMarket()

List of markets that can be traded at Upbit.

| Name | Type | Description | |--------------|--------|---------------------------------------------------| | market | string | Market information provided by Upbit, ex) BTC-XRP | | korean_name | string | Korean name ex) 비트코인 | | english_name | string | English name ex) Bitcoin |