Skip to content

Commit 6318bc7

Browse files
committed
avalanche support
1 parent 9a3b18e commit 6318bc7

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/ChainConfig.jsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ export function getChainConfigs() {
4545
chain.addresses.maglevAddrs = {
4646
maglevLens: '0x1F5fDa12a026729e2635978324d2f98d839859f9',
4747
};
48+
} else if (chain.chainId === 43114) {
49+
chain.addresses.eulerSwapAddrs = {
50+
eulerSwapFactory: '0x8A1D3a4850ed7deeC9003680Cf41b8E75D27e440',
51+
eulerSwapPeriphery: '0x31F34124a37f94efd17201A1B88d5008cD444c72',
52+
};
53+
54+
chain.addresses.maglevAddrs = {
55+
maglevLens: '0xD43a8258549b77a4E55614648116e3a5923BAB0D',
56+
};
4857
}
4958
}
5059

@@ -62,15 +71,7 @@ export function getWagmiChainConfigs() {
6271
if (config.status === 'testing') continue;
6372
if (!chain) throw Error(`no viem entry found for chain ${config.name}`);
6473

65-
// FIXME: Figure out better solution for this than hard-coding
66-
67-
if (chain.id === 1) {
68-
chain.rpcUrls.default.http[0] = 'https://lb.drpc.org/ogrpc?network=ethereum&dkey=AqqUmy43EUMFg-KecrSxzlod45SCPT4R8I63FuhS1q00';
69-
} else if (chain.id === 56) {
70-
chain.rpcUrls.default.http[0] = 'https://lb.drpc.org/ogrpc?network=bsc&dkey=AqqUmy43EUMFg-KecrSxzlod45SCPT4R8I63FuhS1q00';
71-
} else if (chain.id === 130) {
72-
chain.rpcUrls.default.http[0] = 'https://lb.drpc.org/ogrpc?network=unichain&dkey=AqqUmy43EUMFg-KecrSxzlod45SCPT4R8I63FuhS1q00';
73-
}
74+
chain.rpcUrls.default.http[0] = `https://rpc2.euler.finance/maglev/evm/${chain.id}`;
7475

7576
chains.push(chain);
7677
}

src/EulerSwap.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ export function EulerSwapPanel(props) {
796796
EulerSwap is not currently supported on this chain.
797797
</h3>
798798
<p style={{ marginTop: '1rem' }}>
799-
Maglev is currently available on Ethereum, BSC, and Unichain.
799+
Maglev is currently available on Ethereum, BSC, Avalanche, and Unichain.
800800
</p>
801801
</div>
802802
</Panel>;
@@ -884,7 +884,7 @@ export function EulerSwapBrowse(props) {
884884
EulerSwap is not currently supported on this chain.
885885
</h2>
886886
<p style={{ textAlign: 'center', marginTop: '1rem' }}>
887-
Maglev is currently available on Ethereum, BSC, and Unichain.
887+
Maglev is currently available on Ethereum, BSC, Avalanche, and Unichain.
888888
</p>
889889
</div>;
890890
}
@@ -1127,7 +1127,7 @@ export function EulerSwapShowInstance(props) {
11271127
EulerSwap is not currently supported on this chain.
11281128
</h2>
11291129
<p style={{ textAlign: 'center', marginTop: '1rem' }}>
1130-
Maglev is currently available on Ethereum, BSC, and Unichain.
1130+
Maglev is currently available on Ethereum, BSC, Avalanche, and Unichain.
11311131
</p>
11321132
</div>;
11331133
}

0 commit comments

Comments
 (0)