react-use-bitbank
v0.2.4
Published
React Hook for bitbank.cc public data
Downloads
8
Maintainers
Readme
react-use-bitbank
React hooks to easily integrate bitbank.cc public data into your React application.
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