mirror of
				https://github.com/Instadapp/trustwallet-assets.git
				synced 2024-07-29 22:37:31 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			866 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			866 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const { execSync } = require('child_process');
 | |
| const path = require('path')
 | |
| const axios = require('axios')
 | |
| import { readDirSync } from "../src/test/helpers";
 | |
| 
 | |
| const assetsPath = path.resolve(`${__dirname}/../blockchains/tron/assets`) 
 | |
| const chainAddresses = readDirSync(assetsPath)
 | |
| 
 | |
| chainAddresses.forEach(async addr => {
 | |
|     const trc20Info = await axios.get(`https://apilist.tronscan.org/api/token_trc20?contract=${addr}&showAll=1`).then(({ data }) => data)
 | |
| 
 | |
|     if (!isChecksum) {
 | |
|         console.log(`Address ${addr} not in checksum`)
 | |
|         const checksum = web3.utils.toChecksumAddress(addr)
 | |
|         const moveToChecksum = `git mv ${addr} ${checksum}-temp && git mv ${checksum}-temp ${checksum}`
 | |
|         const renamed = execSync(`cd ${assetsPath} && ${moveToChecksum}`, {encoding: "utf-8"})
 | |
|         console.log(`Result renaming ${addr} : ${renamed}`)
 | |
|     }
 | |
| }) | 
