Skip to content

Commit

Permalink
chore: readme up
Browse files Browse the repository at this point in the history
  • Loading branch information
dalechyn committed Oct 12, 2024
1 parent 3f58aac commit 3fa16a5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ console.log(
)
```

Better tree shaking version:
```ts
import { getUniswapV3Price, getUniswapV3EthPrice } from 'viem-quoter/actions'
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'

const publicClient = createPublicClient({
chain: mainnet,
transport: http(),
})

console.log('ETH/USD Price is:', await getUniswapV3EthPrice(publicClient))

console.log(
'WBTC/ETH Price is:',
await getUniswapV3Price(publicClient, {
tokenToQuote: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', // WBTC
otherToken: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
}),
)
```

## Authors

- [@dalechyn](https://github.com/dalechyn) (dalechyn.eth [Twitter](https://twitter.com/dalechyn) [Warpcast](https://warpcast.com/dalechyn.eth))
Expand Down

0 comments on commit 3fa16a5

Please sign in to comment.