Uniswap / v3-sdk

🛠 An SDK for building applications on top of Uniswap V3
MIT License
544 stars 416 forks source link

Undefined error using @uniswap/v3-sdk #171

Open Samboy76 opened 1 year ago

Samboy76 commented 1 year ago

Hi, When I import const { Pair, TokenAmount } = require('@uniswap/v3-sdk'); in my JS file, and attempt to perform console.log("Pair", Pair); it returns undefined. I have correctly updated npm and reinstalled @uniswap/v3-sdk packages correctly. What else could I do to resolve this problem?

Thank you

Florian-S-A-W commented 1 year ago

Hi @Samboy76

The v3-sdk does not export Pair or TokenAmount. Pair is a class that represents Uniswap V2 Pairs in the v2-sdk and TokenAmount was a class that was used in the uniswap-sdk which was renamed v2-sdk in 2021. The class has been removed and was reimplemented and updated as CurrencyAmount in the sdk-core.