Skip to content

Commit 02529cd

Browse files
committed
add monad support
1 parent 86ce1cd commit 02529cd

File tree

5 files changed

+311
-1
lines changed

5 files changed

+311
-1
lines changed

src/common/utils/contractBook.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const contractBook: any = {
1818
[chains.arbitrum.id]: "0x6eE488A00A2ef1E2764cD7245F8a77C40060A7C7",
1919
[chains.linea.id]: "0x1480Cfff566f27BbB2AEAd6eeABEc4BA068e5405",
2020
[9745]: "0x419730b755c6e76B42D2CaD9a2674a8DC748dA38",
21+
[143]: "0xB6D7194fD09F27890279caB08d565A6424fb525D",
2122
},
2223
},
2324
swapVerifier: {
@@ -37,6 +38,7 @@ const contractBook: any = {
3738
[chains.arbitrum.id]: "0x7b16DAaFa76CfeC8C08D7a68aF31949B37ebfdF5",
3839
[chains.linea.id]: "0x77C9B0E7Ac0405797F04E5230Ed0A54DB39f98f0",
3940
[9745]: "0xB695C0aC484F46dD8f279452209b8C53674974bD",
41+
[143]: "0x65bF068c88e0f006f76b871396B4DB1150dd9EAD",
4042
},
4143
},
4244
}

src/common/utils/tokenList.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ const loadTokenlistsFromFiles = () => {
5656
Object.keys(RPC_URLS).map(async (chainId) => {
5757
const response = await fetch(`${tokenlistURL}?chainId=${chainId}`)
5858
if (!response.ok) {
59-
throw new Error(`Failed fetching tokenlist for chain ${chainId}`)
59+
cache[Number(chainId)] = []
60+
return
61+
}
62+
const res = await response.json()
63+
if (!res.success) {
64+
cache[Number(chainId)] = []
65+
return
6066
}
6167
cache[Number(chainId)] = (await response.json()) as TokenListItem[]
6268
}),

src/swapService/strategies/balmySDK/sources/ensoQuoteSource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export class CustomEnsoQuoteSource
9595
}
9696

9797
const response = await fetchService.fetch(url, { timeout, headers })
98+
console.log("response: ", response)
9899

99100
if (!response.ok) {
100101
failed(ENSO_METADATA, chainId, sellToken, buyToken, await response.text())

src/swapService/strategies/balmySDK/sources/magpieQuoteSource.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export class CustomMagpieQuoteSource extends AlwaysValidConfigAndContextSource<
142142
config: { timeout },
143143
customData: { quoteId },
144144
},
145+
config,
145146
}: BuildTxParams<MagpieConfig, MagpieData>): Promise<SourceQuoteTransaction> {
146147
const transactionQueryParams = {
147148
quoteId,
@@ -151,9 +152,14 @@ export class CustomMagpieQuoteSource extends AlwaysValidConfigAndContextSource<
151152
skipNulls: true,
152153
arrayFormat: "comma",
153154
})
155+
const headers: Record<string, string> = {}
156+
if (config.apiKey) {
157+
headers["apikey"] = config.apiKey
158+
}
154159
const transactionUrl = `https://api.magpiefi.xyz/aggregator/transaction?${transactionQueryString}`
155160
const transactionResponse = await fetchService.fetch(transactionUrl, {
156161
timeout,
162+
headers,
157163
})
158164
if (!transactionResponse.ok) {
159165
failed(

tokenLists/tokenList_143.json

Lines changed: 295 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
[
2+
{
3+
"chainId": 143,
4+
"address": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
5+
"name": "AUSD",
6+
"symbol": "AUSD",
7+
"decimals": 6,
8+
"extensions": {
9+
"coinGeckoId": "agora-dollar"
10+
},
11+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/AUSD/logo.svg"
12+
},
13+
{
14+
"chainId": 143,
15+
"address": "0x4917a5ec9fCb5e10f47CBB197aBe6aB63be81fE8",
16+
"name": "Asian Dollar",
17+
"symbol": "AZND",
18+
"decimals": 18,
19+
"extensions": {
20+
"coinGeckoId": "mu-digital-aznd"
21+
},
22+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/AZND/logo.svg"
23+
},
24+
{
25+
"chainId": 143,
26+
"address": "0xB0F70C0bD6FD87dbEb7C10dC692a2a6106817072",
27+
"name": "Bitcoin",
28+
"symbol": "BTC.b",
29+
"decimals": 8,
30+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/BTC.b/logo.svg"
31+
},
32+
{
33+
"chainId": 143,
34+
"address": "0xDef72Af3fc69E1Dd5a094f7DDa08Ba203CD0438B",
35+
"name": "Euler",
36+
"symbol": "EUL",
37+
"decimals": 18,
38+
"extensions": {
39+
"coinGeckoId": "euler"
40+
}
41+
},
42+
{
43+
"chainId": 143,
44+
"address": "0xFF7F8F301F7A706E3CfD3D2275f5dc0b9EE8009B",
45+
"name": "Folks Finance",
46+
"symbol": "FOLKS",
47+
"decimals": 6,
48+
"extensions": {
49+
"coinGeckoId": "folks"
50+
},
51+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/FOLKS/logo.svg"
52+
},
53+
{
54+
"chainId": 143,
55+
"address": "0x18Bc5bcC660cf2B9cE3cd51a404aFe1a0cBD3C22",
56+
"name": "IDRX",
57+
"symbol": "IDRX",
58+
"decimals": 2,
59+
"extensions": {
60+
"coinGeckoId": "idrx"
61+
},
62+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/IDRX/logo.svg"
63+
},
64+
{
65+
"chainId": 143,
66+
"address": "0xecAc9C5F704e954931349Da37F60E39f515c11c1",
67+
"name": "Lombard Staked Bitcoin",
68+
"symbol": "LBTC",
69+
"decimals": 8,
70+
"extensions": {
71+
"coinGeckoId": "lombard-staked-btc"
72+
},
73+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/LBTC/logo.svg"
74+
},
75+
{
76+
"chainId": 143,
77+
"address": "0x91b81bfbe3A747230F0529Aa28d8b2Bc898E6D56",
78+
"name": "LeverUp MON",
79+
"symbol": "LVMON",
80+
"decimals": 18,
81+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/LVMON/logo.svg"
82+
},
83+
{
84+
"chainId": 143,
85+
"address": "0xFD44B35139Ae53FFF7d8F2A9869c503D987f00d1",
86+
"name": "LeverUp USD",
87+
"symbol": "LVUSD",
88+
"decimals": 18,
89+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/LVUSD/logo.svg"
90+
},
91+
{
92+
"chainId": 143,
93+
"address": "0x0000000000000000000000000000000000000000",
94+
"name": "Monad",
95+
"symbol": "MON",
96+
"decimals": 18,
97+
"extensions": {
98+
"coinGeckoId": "monad"
99+
},
100+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/MON/logo.svg"
101+
},
102+
{
103+
"chainId": 143,
104+
"address": "0x04f8c38AE80BcF690B947f60F62BdA18145c3D67",
105+
"name": "Monad Vault",
106+
"symbol": "MVT",
107+
"decimals": 18,
108+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/MVT/logo.svg"
109+
},
110+
{
111+
"chainId": 143,
112+
"address": "0xea17E5a9efEBf1477dB45082d67010E2245217f1",
113+
"name": "Wrapped SOL",
114+
"symbol": "SOL",
115+
"decimals": 9,
116+
"extensions": {
117+
"coinGeckoId": "wrapped-solana"
118+
},
119+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/SOL/logo.svg"
120+
},
121+
{
122+
"chainId": 143,
123+
"address": "0x111111d2bf19e43C34263401e0CAd979eD1cdb61",
124+
"name": "USD1",
125+
"symbol": "USD1",
126+
"decimals": 6,
127+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/USD1/logo.svg"
128+
},
129+
{
130+
"chainId": 143,
131+
"address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
132+
"name": "USDC",
133+
"symbol": "USDC",
134+
"decimals": 6,
135+
"extensions": {
136+
"coinGeckoId": "usd-coin"
137+
},
138+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/USDC/logo.svg"
139+
},
140+
{
141+
"chainId": 143,
142+
"address": "0xe7cd86e13AC4309349F30B3435a9d337750fC82D",
143+
"name": "USDT0",
144+
"symbol": "USDT0",
145+
"decimals": 6,
146+
"extensions": {
147+
"coinGeckoId": "usdt0"
148+
},
149+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/USDT0/logo.svg"
150+
},
151+
{
152+
"chainId": 143,
153+
"address": "0x0555E30da8f98308EdB960aa94C0Db47230d2B9c",
154+
"name": "Wrapped BTC",
155+
"symbol": "WBTC",
156+
"decimals": 8,
157+
"extensions": {
158+
"coinGeckoId": "wrapped-bitcoin"
159+
},
160+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/WBTC/logo.svg"
161+
},
162+
{
163+
"chainId": 143,
164+
"address": "0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242",
165+
"name": "Wrapped Ether",
166+
"symbol": "WETH",
167+
"decimals": 18,
168+
"extensions": {
169+
"coinGeckoId": "weth"
170+
},
171+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/WETH/logo.svg"
172+
},
173+
{
174+
"chainId": 143,
175+
"address": "0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A",
176+
"name": "Wrapped MON",
177+
"symbol": "WMON",
178+
"decimals": 18,
179+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/WMON/logo.svg"
180+
},
181+
{
182+
"chainId": 143,
183+
"address": "0x01bFF41798a0BcF287b996046Ca68b395DbC1071",
184+
"name": "XAUt0",
185+
"symbol": "XAUt0",
186+
"decimals": 6,
187+
"extensions": {
188+
"coinGeckoId": "tether-gold-tokens"
189+
},
190+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/XAUt0/logo.svg"
191+
},
192+
{
193+
"chainId": 143,
194+
"address": "0x0c65A0BC65a5D819235B71F554D210D3F80E0852",
195+
"name": "aPriori Monad LST",
196+
"symbol": "aprMON",
197+
"decimals": 18
198+
},
199+
{
200+
"chainId": 143,
201+
"address": "0x103222f020e98Bba0AD9809A011FDF8e6F067496",
202+
"name": "earnAUSD",
203+
"symbol": "earnAUSD",
204+
"decimals": 6
205+
},
206+
{
207+
"chainId": 143,
208+
"address": "0x8498312A6B3CbD158bf0c93AbdCF29E6e4F55081",
209+
"name": "gMON",
210+
"symbol": "gMON",
211+
"decimals": 18,
212+
"extensions": {
213+
"coinGeckoId": "magma-staked-monad"
214+
},
215+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/gMON/logo.svg"
216+
},
217+
{
218+
"chainId": 143,
219+
"address": "0x1D4795A4670033f47f572b910553be0295077b51",
220+
"name": "mcMON",
221+
"symbol": "mcMON",
222+
"decimals": 18,
223+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/mcMON/logo.svg"
224+
},
225+
{
226+
"chainId": 143,
227+
"address": "0x336D414754967C6682B5A665C7DAF6F1409E63e8",
228+
"name": "mu Bond",
229+
"symbol": "muBOND",
230+
"decimals": 18,
231+
"extensions": {
232+
"coinGeckoId": "mu-digital-mubond"
233+
},
234+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/muBOND/logo.svg"
235+
},
236+
{
237+
"chainId": 143,
238+
"address": "0x37D6382B6889cCeF8d6871A8b60E667115eDDBcF",
239+
"name": "pufETH",
240+
"symbol": "pufETH",
241+
"decimals": 18,
242+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/pufETH/logo.png"
243+
},
244+
{
245+
"chainId": 143,
246+
"address": "0xA3227C5969757783154C60bF0bC1944180ed81B9",
247+
"name": "Kintsu Staked Monad",
248+
"symbol": "sMON",
249+
"decimals": 18,
250+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/sMON/logo.svg"
251+
},
252+
{
253+
"chainId": 143,
254+
"address": "0x1B68626dCa36c7fE922fD2d55E4f631d962dE19c",
255+
"name": "ShMonad",
256+
"symbol": "shMON",
257+
"decimals": 18,
258+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/shMON/logo.png"
259+
},
260+
{
261+
"chainId": 143,
262+
"address": "0xe85411C030fB32A9D8b14Bbbc6CB19417391F711",
263+
"name": "Sumerian BTC",
264+
"symbol": "suBTC",
265+
"decimals": 18,
266+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/suBTC/logo.png"
267+
},
268+
{
269+
"chainId": 143,
270+
"address": "0x1c22531AA9747d76fFF8F0A43b37954ca67d28e0",
271+
"name": "Sumerian ETH",
272+
"symbol": "suETH",
273+
"decimals": 18,
274+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/suETH/logo.png"
275+
},
276+
{
277+
"chainId": 143,
278+
"address": "0x8BF591Eae535f93a242D5A954d3Cde648b48A5A8",
279+
"name": "Sumerian USD",
280+
"symbol": "suUSD",
281+
"decimals": 18,
282+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/suUSD/logo.png"
283+
},
284+
{
285+
"chainId": 143,
286+
"address": "0x10Aeaf63194db8d453d4D85a06E5eFE1dd0b5417",
287+
"name": "Wrapped liquid staked Ether 2.0",
288+
"symbol": "wstETH",
289+
"decimals": 18,
290+
"extensions": {
291+
"coinGeckoId": "wrapped-steth"
292+
},
293+
"logoURI": "https://raw.githubusercontent.com/monad-crypto/token-list/refs/heads/main/mainnet/wstETH/logo.svg"
294+
}
295+
]

0 commit comments

Comments
 (0)