@uniswap/token-list-bridge-utils 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/tokens.d.ts +2 -0
- package/dist/constants/types.d.ts +7 -0
- package/dist/fixtures/index.d.ts +10 -0
- package/dist/providers/BnbMappingProvider.d.ts +2 -2
- package/dist/providers/MappingProvider.d.ts +2 -2
- package/dist/token-list-bridge-utils.cjs.development.js +3445 -863
- package/dist/token-list-bridge-utils.cjs.development.js.map +1 -1
- package/dist/token-list-bridge-utils.cjs.production.min.js +1 -1
- package/dist/token-list-bridge-utils.cjs.production.min.js.map +1 -1
- package/dist/token-list-bridge-utils.esm.js +3445 -863
- package/dist/token-list-bridge-utils.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/tokens.ts +16 -0
- package/src/constants/types.ts +7 -0
- package/src/fixtures/index.ts +42 -0
- package/src/index.test.ts +18 -1
- package/src/local_mappings/bnb.json +3436 -857
- package/src/providers/BnbMappingProvider.ts +3 -3
- package/src/providers/MappingProvider.ts +6 -2
- package/src/providers/index.ts +21 -2
package/src/index.test.ts
CHANGED
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
bnbedSampleTokenList,
|
|
16
16
|
sampleL1TokenList,
|
|
17
17
|
Tokens,
|
|
18
|
+
sampleL1TokenList_2,
|
|
19
|
+
bnbedSampleTokenList_2,
|
|
18
20
|
} from './fixtures'
|
|
19
21
|
|
|
20
22
|
jest.setTimeout(15000)
|
|
@@ -87,7 +89,6 @@ describe(chainifyTokenList, () => {
|
|
|
87
89
|
|
|
88
90
|
it('outputs bnb list correctly', async () => {
|
|
89
91
|
const tokenList = await chainifyTokenList([ChainId.BNB], sampleL1TokenList)
|
|
90
|
-
console.log('heeeeeeee', JSON.stringify(tokenList.tokens, null, 2))
|
|
91
92
|
expect(tokenList).toBeDefined()
|
|
92
93
|
expect(tokenList?.version).toEqual(bnbedSampleTokenList.version)
|
|
93
94
|
expect(
|
|
@@ -98,6 +99,22 @@ it('outputs bnb list correctly', async () => {
|
|
|
98
99
|
)
|
|
99
100
|
})
|
|
100
101
|
|
|
102
|
+
it('outputs bnb list correctly with different decimals', async () => {
|
|
103
|
+
const tokenList = await chainifyTokenList([ChainId.BNB], sampleL1TokenList_2)
|
|
104
|
+
expect(tokenList).toBeDefined()
|
|
105
|
+
expect(tokenList?.version).toEqual(bnbedSampleTokenList_2.version)
|
|
106
|
+
expect(
|
|
107
|
+
tokenList?.tokens.map((t) => [t.address, t.chainId, t.extensions])
|
|
108
|
+
).toEqual(
|
|
109
|
+
// ignores other metadata
|
|
110
|
+
bnbedSampleTokenList_2.tokens.map((t) => [
|
|
111
|
+
t.address,
|
|
112
|
+
t.chainId,
|
|
113
|
+
t.extensions,
|
|
114
|
+
])
|
|
115
|
+
)
|
|
116
|
+
})
|
|
117
|
+
|
|
101
118
|
describe(mergeTokenLists, () => {
|
|
102
119
|
it('correctly deduplicates', () => {
|
|
103
120
|
const merged = mergeTokenLists(sampleL1TokenList, sampleL1TokenList)
|