react-use-bitbank
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

react-use-bitbank

npm github pages

React hooks to easily integrate bitbank.cc public data into your React application.

demo

Getting Started

npm install react-use-bitbank
import React from 'react'
import ReactDOM from 'react-dom'
import { WebsocketProvider } from 'react-use-bitbank'

import App from './App'

ReactDOM.render(
  <React.StrictMode>
    <WebsocketProvider>
      <App />
    </WebsocketProvider>
  </React.StrictMode>,
  document.getElementById('root'),
)
import { useTicker } from 'react-use-bitbank'

const MyComponent = () => {
  const pair = 'btc_jpy'
  const ticker = useTicker(pair)

  return (
    <div>
      <p>last: {ticker?.last}</p>
      <p>vol: {ticker?.vol}</p>
    </div>
  )
}

Hooks

  • useTicker
  • useDepth
  • useTransactions

Example

You can check it in the demo application code.

Documentation

https://github.com/bitbankinc/bitbank-api-docs

Package Sidebar

Install

npm i react-use-bitbank

Weekly Downloads

24

Version

0.2.4

License

MIT

Unpacked Size

42.4 kB

Total Files

45

Last publish

Collaborators

  • daikiojm