Skip to content

Commit

Permalink
Merge pull request #465 from axelarnetwork/chore/fix-not-recognize-as…
Browse files Browse the repository at this point in the history
…set-on-fraxtal

feat: add fraxtal and blast chain config
  • Loading branch information
canhtrinh authored Mar 14, 2024
2 parents 63fa64c + 252e08c commit 790b3e3
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"socket.io-client": "^4.7.2",
"spinners-react": "^1.0.7",
"usehooks-ts": "^2.9.1",
"viem": "~1.16.0",
"viem": "~1.16.5",
"wagmi": "1.4.1",
"wait": "^0.4.2",
"zustand": "^4.4.1"
Expand Down
8 changes: 2 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions src/config/web3/evm/mainnet/blast.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineChain } from "viem";

import { ChainExtension } from "../interface";

export const blast: ChainExtension = defineChain({
id: 81457,
name: "Blast",
network: "blast",
nativeCurrency: {
decimals: 18,
name: "Ether",
symbol: "ETH",
},
rpcUrls: {
default: { http: ["https://rpc.blast.io"] },
public: { http: ["https://rpc.blast.io"] },
},
blockExplorers: {
default: { name: "Blastscan", url: "https://blastscan.io" },
},
contracts: {
multicall3: {
address: "0xcA11bde05977b3631167028862bE2a173976CA11",
blockCreated: 212929,
},
},
networkNameOverride: "blast",
});
31 changes: 31 additions & 0 deletions src/config/web3/evm/mainnet/fraxtal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { defineChain } from "viem";

import { ChainExtension } from "../interface";

export const fraxtal: ChainExtension = defineChain({
id: 252,
network: "fraxtal",
name: "Fraxtal",
nativeCurrency: { name: "Frax Ether", symbol: "frxETH", decimals: 18 },
rpcUrls: {
default: {
http: ["https://rpc.frax.com"],
},
public: {
http: ["https://rpc.frax.com"],
},
},
blockExplorers: {
default: {
name: "fraxscan",
url: "https://fraxscan.com",
apiUrl: "https://api.fraxscan.com/api",
},
},
contracts: {
multicall3: {
address: "0xca11bde05977b3631167028862be2a173976ca11",
},
},
networkNameOverride: "fraxtal",
});
4 changes: 4 additions & 0 deletions src/config/web3/evm/mainnet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { arbitrum } from "./arbitrum";
import { avalanche } from "./avalanche";
import { base } from "./base";
import { binance } from "./binance";
import { blast } from "./blast";
import { celo } from "./celo";
import { ethereum } from "./ethereum";
import { fantom } from "./fantom";
import { filecoin } from "./filecoin";
import { fraxtal } from "./fraxtal";
import { kava } from "./kava";
import { linea } from "./linea";
import { mantle } from "./mantle";
Expand All @@ -21,9 +23,11 @@ export const mainnetChains: ChainExtension[] = [
avalanche,
base,
binance,
blast,
celo,
ethereum,
filecoin,
fraxtal,
kava,
linea,
moonbeam,
Expand Down
2 changes: 1 addition & 1 deletion src/config/web3/evm/testnet/arbitrum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { arbitrumGoerli as arbitrumConfig } from "viem/chains";
import { arbitrumSepolia as arbitrumConfig } from "viem/chains";

import { ChainExtension } from "../interface";

Expand Down
4 changes: 2 additions & 2 deletions src/config/web3/evm/testnet/base.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { baseGoerli } from "viem/chains";
import { baseSepolia } from "viem/chains";

import { ChainExtension } from "../interface";

export const base: ChainExtension = {
...baseGoerli,
...baseSepolia,
networkNameOverride: "base",
};
29 changes: 29 additions & 0 deletions src/config/web3/evm/testnet/blast.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { defineChain } from "viem";

import { ChainExtension } from "../interface";

export const blast: ChainExtension = defineChain({
id: 168_587_773,
name: "Blast Sepolia",
network: "blast",
nativeCurrency: {
decimals: 18,
name: "Ether",
symbol: "ETH",
},
rpcUrls: {
default: { http: ["https://sepolia.blast.io"] },
public: { http: ["https://sepoliablast.io"] },
},
blockExplorers: {
default: { name: "Blastscan", url: "https://testnet.blastscan.io" },
},
contracts: {
multicall3: {
address: "0xca11bde05977b3631167028862be2a173976ca11",
blockCreated: 756690,
},
},
testnet: true,
networkNameOverride: "blast",
});
2 changes: 1 addition & 1 deletion src/config/web3/evm/testnet/ethereum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { goerli as ethereumConfig } from "viem/chains";
import { sepolia as ethereumConfig } from "viem/chains";

import { ChainExtension } from "../interface";

Expand Down
32 changes: 32 additions & 0 deletions src/config/web3/evm/testnet/fraxtal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { defineChain } from "viem";

import { ChainExtension } from "../interface";

export const fraxtal: ChainExtension = defineChain({
id: 2522,
network: "fraxtal",
name: "Fraxtal Testnet",
nativeCurrency: { name: "Frax Ether", symbol: "frxETH", decimals: 18 },
rpcUrls: {
default: {
http: ["https://rpc.testnet.frax.com"],
},
public: {
http: ["https://rpc.testnet.frax.com"],
},
},
blockExplorers: {
default: {
name: "fraxscan testnet",
url: "https://holesky.fraxscan.com",
apiUrl: "https://api-holesky.fraxscan.com/api",
},
},
contracts: {
multicall3: {
address: "0xca11bde05977b3631167028862be2a173976ca11",
},
},
testnet: true,
networkNameOverride: "fraxtal",
});
4 changes: 4 additions & 0 deletions src/config/web3/evm/testnet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { aurora } from "./aurora";
import { avalanche } from "./avalanche";
import { base } from "./base";
import { binance } from "./binance";
import { blast } from "./blast";
import { celo } from "./celo";
import { ethereum } from "./ethereum";
import { fantom } from "./fantom";
import { filecoin } from "./filecoin";
import { fraxtal } from "./fraxtal";
import { kava } from "./kava";
import { linea } from "./linea";
import { mantle } from "./mantle";
Expand All @@ -21,10 +23,12 @@ export const testnetChains: ChainExtension[] = [
aurora,
avalanche,
base,
blast,
ethereum,
moonbeam,
fantom,
filecoin,
fraxtal,
polygon,
polygonZkEvm,
binance,
Expand Down
2 changes: 1 addition & 1 deletion src/config/web3/evm/testnet/optimism.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { optimismGoerli as optimismConfig } from "viem/chains";
import { optimismSepolia as optimismConfig } from "viem/chains";

import { ChainExtension } from "../interface";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const SrcChainTxPropagation = () => {

let name = "";
if (srcChain.chainName.toLowerCase()?.includes("base")) {
name = "Goerli L1";
name = "Sepolia L1";
} else {
name = srcChain.chainName;
}
Expand Down
1 change: 1 addition & 0 deletions src/store/stores/swap-store/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ const getWagmiChainOverride = (wagmiNetwork: string) => {
ropsten: "ethereum",
homestead: "ethereum",
goerli: "ethereum",
sepolia: "ethereum",
};
return map[wagmiNetwork] || wagmiNetwork;
};

0 comments on commit 790b3e3

Please sign in to comment.