Skip to content

Commit 9198c0c

Browse files
feat: add plasma
1 parent 56ed30a commit 9198c0c

File tree

3 files changed

+59
-58
lines changed

3 files changed

+59
-58
lines changed

package-lock.json

Lines changed: 50 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"react": "^18.3.1",
1919
"react-dom": "^18.3.1",
2020
"react-icons": "^5.3.0",
21-
"viem": "^2.31.4"
21+
"viem": "^2.37.8"
2222
},
2323
"devDependencies": {
2424
"@eslint/js": "^9.11.1",

src/lib/constants.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const abi = [
6060

6161

6262

63-
let globalAddresses = {};
63+
let globalAddresses: Record<number, any> = {};
6464

6565
for (let chain of eulerChains) {
6666
globalAddresses[chain.chainId] = {
@@ -84,13 +84,14 @@ export const eVaultFunctionNames = extractFunctionNames(abiEVault);
8484
export const eulerRouterFunctionNames = extractFunctionNames(abiEulerRouter);
8585

8686

87-
export let supportedChains = {};
88-
export let supportedChainList = [];
87+
export let supportedChains: Record<number, any> = {};
88+
export let supportedChainList: any[] = [];
8989

9090
for (let config of eulerChains) {
91-
let chain = viemChains[config.viemName || config.name];
91+
let chain = Object.values(viemChains).find(chain => chain.id === config.chainId);
92+
9293
if (config.status === 'testing') continue;
93-
if (!chain) throw Error(`no viem entry found for chain ${config.name}`);
94+
if (!chain) throw Error(`no viem entry found for chain ${config.name} (chainId: ${config.chainId})`);
9495

9596
let client = createPublicClient({
9697
chain,
@@ -99,7 +100,7 @@ for (let config of eulerChains) {
99100

100101
supportedChains[config.chainId] = {
101102
id: config.chainId,
102-
explorerUrl: chain.blockExplorers.default.url,
103+
explorerUrl: chain.blockExplorers?.default?.url || '',
103104
client,
104105
config,
105106
};
@@ -111,7 +112,7 @@ for (let config of eulerChains) {
111112
function loadDeploymentAddresses(
112113
chainId: number
113114
): AddressMetadataMap<AddressMetadata> {
114-
let output = {};
115+
let output: Record<string, AddressMetadata> = {};
115116

116117
let chain = supportedChains[chainId];
117118
if (!chain) throw Error(`unable to load deployment addrs for chain ${chainId}`);

0 commit comments

Comments
 (0)