JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q48281F
  • License MIT

This is React Custom Hook for upbit api

Package Exports

  • use-upbit-api
  • use-upbit-api/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-upbit-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

use-upbit-api

GitHub Workflow Status Weekly Downloads version types

The use-upbit-api custom hook for Upbit API (Korea crypto exchange). In the previous, Upbit API's Websocket usage in React is difficult for developer who is unfamiliar with websocket in React, but this React Custom Hook solve the problem. Let's use this awesome custom hooks!

npm

Git Repository

View Demo

TOTALEXAMPLE


Install

npm install --save use-upbit-api

Hooks

REST API

useFetchMarketCode

WEBSOCKET API

useWsTicker

useWsOrderbook

useWsTrade


useFetchMarketCode

useFetchMarketCode hook is used to fetch market codes from upbit api

const {isLoading, marketCodes} = useFetchMarketCode(
  (options = {throttle_time: 400, debug: false}), // default option, can be modified.
);

useWsTicker

useWsTicker is a custom hook that connects to a WebSocket API and retrieves real-time ticker data for a given market code.

const {socket, isConnected, socketData} = useWsTicker(
  targetMarketCode,
  (options = {throttle_time: 400, debug: false}), // default option, can be modified.
);

useWsOrderbook

useWsOrderbook is a custom hook that connects to a WebSocket API and retrieves real-time order book data for a given market code.

const {socket, isConnected, socketData} = useWsOrderbook(
  targetMarketCode,
  (options = {throttle_time: 400, debug: false}), // default option, can be modified.
);

useWsTrade

useWsTrade is a custom hook that connects to a WebSocket API and retrieves real-time trade data for a given market code.

const {socket, isConnected, socketData} = useWsTrade(
  targetMarketCode,
  (options = {throttle_time: 400, max_length_queue: 100, debug: false}), // default option, can be modified.
);

Contributing

If you want to contribute to use-upbit-api, please contact me rkdalsgur032@unist.ac.kr

License

Licensed under the MIT License, Copyright © 2022-present MinHyeok Kang.