React hooks to easily integrate bitbank.cc public data into your React application.
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>
)
}
- useTicker
- useDepth
- useTransactions
You can check it in the demo application code.