File tree Expand file tree Collapse file tree 5 files changed +2339
-20
lines changed
Expand file tree Collapse file tree 5 files changed +2339
-20
lines changed Original file line number Diff line number Diff line change 44 "description" : " ◦ The Uniswap default token list" ,
55 "main" : " build/uniswap-default.tokenlist.json" ,
66 "scripts" : {
7- "test" : " mocha" ,
7+ "test" : " mocha --timeout 10000 " ,
88 "build" : " rimraf build && mkdir -p build && node src/write.js > build/uniswap-default.tokenlist.json" ,
99 "prepublishOnly" : " npm test && npm run build"
1010 },
3434 "chai" : " ^4.2.0" ,
3535 "mocha" : " ^8.0.1" ,
3636 "rimraf" : " ^3.0.2"
37+ },
38+ "dependencies" : {
39+ "@uniswap/token-list-bridge-utils" : " ^1.0.7"
3740 }
3841}
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ const goerli = require("./tokens/goerli.json");
66const kovan = require ( "./tokens/kovan.json" ) ;
77const polygon = require ( "./tokens/polygon.json" ) ;
88const mumbai = require ( "./tokens/mumbai.json" ) ;
9+ const bridgeUtils = require ( '@uniswap/token-list-bridge-utils' ) ;
910
10- module . exports = function buildList ( ) {
11+ module . exports = async function buildList ( ) {
1112 const parsed = version . split ( "." ) ;
12- return {
13+ const l1List = {
1314 name : "Uniswap Labs Default List" ,
1415 timestamp : new Date ( ) . toISOString ( ) ,
1516 version : {
@@ -29,4 +30,5 @@ module.exports = function buildList() {
2930 return t1 . chainId < t2 . chainId ? - 1 : 1 ;
3031 } ) ,
3132 } ;
33+ return await bridgeUtils . chainify ( l1List )
3234} ;
Original file line number Diff line number Diff line change 11const buildList = require ( './buildList' ) ;
2- console . log ( JSON . stringify ( buildList ( ) , null , 2 ) ) ;
2+
3+ ( async ( ) => {
4+ console . log ( JSON . stringify ( await buildList ( ) , null , 2 ) ) ;
5+ } ) ( ) ;
Original file line number Diff line number Diff line change @@ -7,9 +7,13 @@ const buildList = require('../src/buildList');
77
88const ajv = new Ajv ( { allErrors : true , format : 'full' } ) ;
99const validator = ajv . compile ( schema ) ;
10+ let defaultTokenList ;
11+
12+ before ( async function ( ) {
13+ defaultTokenList = await buildList ( ) ;
14+ } ) ;
1015
1116describe ( 'buildList' , ( ) => {
12- const defaultTokenList = buildList ( ) ;
1317
1418 it ( 'validates' , ( ) => {
1519 expect ( validator ( defaultTokenList ) ) . to . equal ( true ) ;
You can’t perform that action at this time.
0 commit comments