https://github.com/pfed-prog/evmexplorer-uniswap
https://github.com/pfed-prog/evmexplorer-uniswap
dspyt evmexplorer
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/pfed-prog/evmexplorer-uniswap
- Owner: Pfed-prog
- License: mit
- Created: 2024-10-11T15:37:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T01:36:13.000Z (over 1 year ago)
- Last Synced: 2025-04-12T10:13:50.862Z (over 1 year ago)
- Topics: dspyt, evmexplorer
- Language: TypeScript
- Homepage:
- Size: 1 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EVMExplorer-Uniswap
[EVM Explorer](evmexplorer.com) TypeScript Uniswap v3 SDK.
## 📚 Install
```bash
npm install @evmexplorer/uniswap
```
or
```bash
yarn add @evmexplorer/uniswap
```
## Example usage
To get a quote of [AAVE token](https://evmexplorer.com/contracts/mainnet/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9) price in USD from Uniswap V3:
```ts
import { getQuoteUniswapUSD } from '@evmexplorer/uniswap';
import { AlchemyProvider } from 'ethers';
import dotenv from 'dotenv';
dotenv.config();
const api = process.env.API;
const provider = new AlchemyProvider('mainnet', api);
const tokenData = {
address: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9',
decimals: 18,
chainId: 1,
};
const exchangeRateWETH = '3920.84';
const result = await getQuoteUniswapUSD(tokenData, provider, exchangeRateWETH);
```
## More information
[EVM Explorer - Tracking Smart Contract Transaction Data](https://dspyt.com/evmexplorer)
[Explanation of Slot0 Data](https://stackoverflow.com/a/79280489/13943679)