forked from piecesofeightcoin/pancakeswap-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.test.ts
20 lines (17 loc) · 828 Bytes
/
data.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { ChainId, WETH, Token, Fetcher } from '../src'
// TODO: replace the provider in these tests
describe.skip('data', () => {
it('Token', async () => {
const token = await Fetcher.fetchTokenData(ChainId.MAINNET, '0x6B175474E89094C44Da98b954EedeAC495271d0F') // DAI
expect(token.decimals).toEqual(18)
})
it('Token:CACHE', async () => {
const token = await Fetcher.fetchTokenData(ChainId.MAINNET, '0xE0B7927c4aF23765Cb51314A0E0521A9645F0E2A') // DGD
expect(token.decimals).toEqual(9)
})
it('Pair', async () => {
const token = new Token(ChainId.BSCTESTNET, '0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735', 18) // DAI
const pair = await Fetcher.fetchPairData(WETH[ChainId.BSCTESTNET], token)
expect(pair.liquidityToken.address).toEqual('0x8B22F85d0c844Cf793690F6D9DFE9F11Ddb35449')
})
})