1.0.0 • Published 2 years ago
use-traderjoe v1.0.0
TraderJoe React Client
Getting data from the new (TraderJoe API)https://github.com/lukerhoads/traderjoe-api is easier than ever!
Check out (example)example
Getting Started
Installation
npm install use-traderjoe
# or
yarn add use-traderjoe
Usage
Get TraderJoe TVL
import { useTvl } from 'use-traderjoe'
const component = () => {
const tvl = useTvl()
return (
<p>TraderJoe TVL: {tvl}</p>
)
}
Passing options
import { useTvl } from 'use-traderjoe'
const component = () => {
const tvl = useTvl({
version: "v2"
})
return (
<p>TraderJoe TVL: {tvl}</p>
)
}
Passing params
import { useTvl } from 'use-traderjoe'
const component = () => {
const poolApr = usePoolApr(poolAddress, "1w")
return (
<p>{poolAddress} APR: {poolApr}</p>
)
}
Defaults
- Network: mainnet
- API url: https://api.traderjoexyz.com
- API version: v1
- Request timeout: 10s
1.0.0
2 years ago