1.0.0 • Published 2 years ago

use-traderjoe v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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