Skip to content

Commit f2bcaac

Browse files
add xlayer (#2283)
1 parent 13d2bca commit f2bcaac

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/buildList.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ const zora = require("./tokens/zora.json");
2020
const solana = require("./tokens/solana.json");
2121
const bridgeUtils = require("@uniswap/token-list-bridge-utils");
2222
const unichain = require("./tokens/unichain.json");
23+
const xlayer = require("./tokens/xlayer.json");
2324

2425
module.exports = async function buildList() {
2526
const parsed = version.split(".");
26-
27+
2728
// EVM chains only for bridgeUtils.chainify (which validates Ethereum addresses)
2829
const evmTokens = [
2930
...mainnet,
@@ -45,6 +46,7 @@ module.exports = async function buildList() {
4546
...worldchain,
4647
...zora,
4748
...unichain,
49+
...xlayer,
4850
]
4951
// sort them by symbol for easy readability
5052
.sort((t1, t2) => {
@@ -53,7 +55,7 @@ module.exports = async function buildList() {
5355
}
5456
return t1.chainId < t2.chainId ? -1 : 1;
5557
});
56-
58+
5759
const l1List = {
5860
name: "Uniswap Labs Default",
5961
timestamp: new Date().toISOString(),
@@ -67,19 +69,19 @@ module.exports = async function buildList() {
6769
keywords: ["uniswap", "default"],
6870
tokens: evmTokens,
6971
};
70-
72+
7173
// Apply bridge utils to EVM chains only
7274
const listWithBridgeInfo = await bridgeUtils.chainify(l1List);
73-
75+
7476
listWithBridgeInfo.tokens.push(...solana);
75-
77+
7678
// Re-sort all tokens by chainId first, then symbol
7779
listWithBridgeInfo.tokens.sort((t1, t2) => {
7880
if (t1.chainId === t2.chainId) {
7981
return t1.symbol.toLowerCase() < t2.symbol.toLowerCase() ? -1 : 1;
8082
}
8183
return t1.chainId < t2.chainId ? -1 : 1;
8284
});
83-
85+
8486
return listWithBridgeInfo;
8587
};

src/tokens/xlayer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"chainId": 196,
4+
"address": "0x4ae46a509F6b1D9056937BA4500cb143933D2dc8",
5+
"name": "Global Dollar",
6+
"symbol": "USDG",
7+
"decimals": 6,
8+
"logoURI": "https://coin-images.coingecko.com/coins/images/51281/large/GDN_USDG_Token_200x200.png?1730484111"
9+
}
10+
]
11+

0 commit comments

Comments
 (0)