Skip to content

Commit

Permalink
Merge pull request #273 from axelarnetwork/chore/update-chain-configs
Browse files Browse the repository at this point in the history
chore: update supported chains
  • Loading branch information
canhtrinh authored Mar 12, 2024
2 parents 59c4478 + 323d6b0 commit 9665458
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 261 deletions.
18 changes: 9 additions & 9 deletions apps/maestro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"type": "module",
"scripts": {
"dev": "next dev",
"dev": "next dev --turbo",
"build": "scripts/build.sh",
"build:analyze": "ANALYZE=true pnpm build",
"start": "next start",
Expand Down Expand Up @@ -42,14 +42,14 @@
"@axelarjs/utils": "workspace:*",
"@hookform/resolvers": "^3.3.4",
"@sentry/nextjs": "^7.102.1",
"@tanstack/react-query": "^5.24.1",
"@trpc/client": "11.0.0-next-beta.294",
"@trpc/next": "11.0.0-next-beta.294",
"@trpc/react-query": "11.0.0-next-beta.294",
"@trpc/server": "11.0.0-next-beta.294",
"@tanstack/react-query": "^5.26.3",
"@trpc/client": "11.0.0-next-beta.318",
"@trpc/next": "11.0.0-next-beta.318",
"@trpc/react-query": "11.0.0-next-beta.318",
"@trpc/server": "11.0.0-next-beta.318",
"@vercel/kv": "^1.0.1",
"@vercel/postgres": "^0.7.2",
"@web3modal/wagmi": "^4.0.10",
"@web3modal/wagmi": "^4.1.0",
"drizzle-orm": "^0.29.4",
"lucide-react": "^0.265.0",
"next": "^14.1.0",
Expand All @@ -68,7 +68,7 @@
"swagger-ui-react": "^5.11.8",
"trpc-openapi": "^1.2.0",
"unfetch": "^4.2.0",
"viem": "^2.7.15",
"viem": "^2.8.1",
"wagmi": "^2.5.7",
"zod": "^3.22.4"
},
Expand All @@ -92,7 +92,7 @@
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.3.1",
"@wagmi/cli": "^2.1.1",
"@wagmi/cli": "^2.1.2",
"autoprefixer": "^10.4.17",
"concurrently": "^8.2.2",
"date-fns": "^3.3.1",
Expand Down
91 changes: 30 additions & 61 deletions apps/maestro/src/config/evm-chains.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import { defineChain } from "viem";
import { Chain } from "viem/chains";
import {
arbitrum,
arbitrumGoerli,
arbitrumSepolia,
aurora,
auroraTestnet,
avalanche,
avalancheFuji,
base,
baseGoerli,
baseSepolia,
blast,
blastSepolia,
bsc,
bscTestnet,
celo,
celoAlfajores,
Chain,
fantom,
fantomTestnet,
filecoin,
filecoinCalibration,
goerli,
fraxtal,
fraxtalTestnet,
kava,
kavaTestnet,
linea,
Expand All @@ -29,15 +30,15 @@ import {
moonbaseAlpha,
moonbeam,
optimism,
optimismGoerli,
optimismSepolia,
polygon,
polygonMumbai,
polygonZkEvm,
polygonZkEvmTestnet,
scroll,
scrollSepolia,
sepolia,
} from "wagmi/chains";
} from "viem/chains";

import { NEXT_PUBLIC_NETWORK_ENV } from "./env";

Expand All @@ -59,12 +60,6 @@ export const ALL_CHAINS: ExtendedWagmiChainConfig[] = [
axelarChainName: "ethereum",
environment: ENVIRONMENTS.mainnet,
},
{
...goerli,
axelarChainId: "ethereum-2",
axelarChainName: "ethereum-2",
environment: ENVIRONMENTS.testnet,
},
{
...sepolia,
axelarChainId: "ethereum-sepolia",
Expand Down Expand Up @@ -153,12 +148,6 @@ export const ALL_CHAINS: ExtendedWagmiChainConfig[] = [
axelarChainName: "arbitrum",
environment: ENVIRONMENTS.mainnet,
},
{
...arbitrumGoerli,
axelarChainId: "arbitrum",
axelarChainName: "arbitrum",
environment: ENVIRONMENTS.testnet,
},
{
...arbitrumSepolia,
axelarChainId: "arbitrum-sepolia",
Expand Down Expand Up @@ -196,9 +185,9 @@ export const ALL_CHAINS: ExtendedWagmiChainConfig[] = [
environment: ENVIRONMENTS.mainnet,
},
{
...optimismGoerli,
axelarChainId: "optimism",
axelarChainName: "optimism",
...optimismSepolia,
axelarChainId: "optimism-sepolia",
axelarChainName: "optimism-sepolia",
environment: ENVIRONMENTS.testnet,
},
{
Expand Down Expand Up @@ -232,9 +221,9 @@ export const ALL_CHAINS: ExtendedWagmiChainConfig[] = [
environment: ENVIRONMENTS.mainnet,
},
{
...baseGoerli,
axelarChainId: "base",
axelarChainName: "base",
...baseSepolia,
axelarChainId: "base-sepolia",
axelarChainName: "base-sepolia",
environment: ENVIRONMENTS.testnet,
},
{
Expand Down Expand Up @@ -274,49 +263,29 @@ export const ALL_CHAINS: ExtendedWagmiChainConfig[] = [
environment: ENVIRONMENTS.testnet,
},
{
...defineChain({
id: 252,
name: "Fraxtal",
nativeCurrency: { name: "Frax Ether", symbol: "frxETH", decimals: 18 },
rpcUrls: {
default: {
http: ["https://rpc.frax.com"],
},
},
blockExplorers: {
default: {
name: "Fraxscan",
url: "https://fraxscan.com",
apiUrl: "https://api.fraxscan.com/api",
},
},
}),
...fraxtal,
axelarChainId: "fraxtal",
axelarChainName: "Fraxtal",
axelarChainName: "fraxtal",
environment: ENVIRONMENTS.mainnet,
},
{
...defineChain({
id: 81457,
name: "Blast",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
rpcUrls: {
default: {
http: ["https://rpc.blast.io"],
},
},
blockExplorers: {
default: {
name: "Blastscan",
url: "https://blastscan.io",
apiUrl: "https://api.blastscan.io/api",
},
},
}),
...fraxtalTestnet,
axelarChainId: "fraxtal",
axelarChainName: "fraxtal",
environment: ENVIRONMENTS.testnet,
},
{
...blast,
axelarChainId: "blast",
axelarChainName: "Blast",
axelarChainName: "blast",
environment: ENVIRONMENTS.mainnet,
},
{
...blastSepolia,
axelarChainId: "blast-sepolia",
axelarChainName: "blast-sepolia",
environment: ENVIRONMENTS.testnet,
},
] as const;

export const WAGMI_CHAIN_CONFIGS = ALL_CHAINS.filter(
Expand Down
4 changes: 3 additions & 1 deletion apps/maestro/src/config/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export const wagmiConfig = defaultWagmiConfig({
icons: ["/icons/favicon-32x32.png"],
url: "",
},
enableCoinbase: true,
enableInjected: true,
enableCoinbase: false,
enableWalletConnect: false,
});

export const WEB3_MODAL = createWeb3Modal({
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@
"@axelarjs/core": "workspace:*",
"isomorphic-unfetch": "^4.0.2",
"rambda": "^9.1.0",
"viem": "^2.7.15"
"viem": "^2.8.1"
}
}
7 changes: 4 additions & 3 deletions packages/api/src/axelar-query/fee/getL1Fee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import {
createPublicClient,
http,
parseAbi,
PublicClient,
type Chain,
type HttpTransport,
type PublicClient,
} from "viem";

import {
EstimateL1FeeParams,
L2Chain,
MAINNET_L2_CHAINS,
TESTNET_L2_CHAINS,
type EstimateL1FeeParams,
type L2Chain,
} from "./types";

/**
Expand All @@ -30,6 +30,7 @@ export function getL1FeeForL2(
params: EstimateL1FeeParams
): Promise<bigint> {
const chains = env === "mainnet" ? MAINNET_L2_CHAINS : TESTNET_L2_CHAINS;

const publicClient = createPublicClient({
chain: chains[chain],
transport: http(),
Expand Down
17 changes: 9 additions & 8 deletions packages/api/src/axelar-query/fee/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { Chain } from "viem";
import {
arbitrum,
arbitrumGoerli,
arbitrumSepolia,
base,
baseGoerli,
baseSepolia,
mantle,
mantleTestnet,
optimism,
optimismGoerli,
optimismSepolia,
scroll,
scrollSepolia,
} from "viem/chains";
Expand All @@ -21,15 +22,15 @@ export const MAINNET_L2_CHAINS = {
optimism,
scroll,
mantle,
} as const;
} as Record<L2Chain, Chain>;

export const TESTNET_L2_CHAINS = {
arbitrum: arbitrumGoerli,
base: baseGoerli,
optimism: optimismGoerli,
arbitrum: arbitrumSepolia,
base: baseSepolia,
optimism: optimismSepolia,
scroll: scrollSepolia,
mantle: mantleTestnet,
} as const;
} as Record<L2Chain, Chain>;

export type EstimateL1FeeParams = {
destinationContractAddress?: `0x${string}` | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/deposit-address/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
"@axelarjs/utils": "workspace:*",
"@axelarjs/proto": "workspace:*",
"bech32": "^2.0.0",
"viem": "^2.7.15"
"viem": "^2.8.1"
}
}
2 changes: 1 addition & 1 deletion packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@axelarjs/utils": "workspace:*",
"package-json": "^8.1.1",
"tsx": "^4.7.1",
"viem": "^2.7.15",
"viem": "^2.8.1",
"zx": "^7.2.3"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 9665458

Please sign in to comment.