chore: added more coins and updated formatting
97a2ed0c
1 file(s) · +24 −2
| 39 | 39 | ||
| 40 | 40 | if (records.coins && records.coins.length > 0) { |
|
| 41 | 41 | console.log(`\n${colors.blue("Coin Records:")}`); |
|
| 42 | + | ||
| 43 | + | const maxCoinNameLength = Math.max( |
|
| 44 | + | ...records.coins |
|
| 45 | + | .filter((coin: any) => coin.value) |
|
| 46 | + | .map((coin: any) => coin.name.toUpperCase().length), |
|
| 47 | + | ); |
|
| 48 | + | ||
| 42 | 49 | for (const coin of records.coins) { |
|
| 43 | 50 | if (coin.value) { |
|
| 51 | + | const coinName = coin.name.toUpperCase(); |
|
| 52 | + | const padding = " ".repeat( |
|
| 53 | + | Math.max(1, maxCoinNameLength + 1 - coinName.length), |
|
| 54 | + | ); |
|
| 44 | 55 | console.log( |
|
| 45 | - | `${colors.blue(`${coin.name.toUpperCase()}:`)} ${coin.value}`, |
|
| 56 | + | `${colors.blue(`${coinName}:`)}${padding} ${coin.value}`, |
|
| 46 | 57 | ); |
|
| 47 | 58 | } |
|
| 48 | 59 | } |
|
| 120 | 131 | }); |
|
| 121 | 132 | const records = await getRecords(ensClient, { |
|
| 122 | 133 | name: name as string, |
|
| 123 | - | coins: ["ETH", "BTC", "LTC", "DOGE", "SOL"], |
|
| 134 | + | coins: [ |
|
| 135 | + | "ETH", |
|
| 136 | + | "BTC", |
|
| 137 | + | "LTC", |
|
| 138 | + | "DOGE", |
|
| 139 | + | "SOL", |
|
| 140 | + | "OP", |
|
| 141 | + | "BASE", |
|
| 142 | + | "SCR", |
|
| 143 | + | "MATIC", |
|
| 144 | + | "LINEA", |
|
| 145 | + | ], |
|
| 124 | 146 | texts: [ |
|
| 125 | 147 | ...(subgraphRecords?.texts || []), |
|
| 126 | 148 | // ENSIP-5 Global Keys |
|