Skip to content

Commit

Permalink
Add Flow chains
Browse files Browse the repository at this point in the history
  • Loading branch information
Destiner committed Apr 24, 2024
1 parent a708c08 commit 0e1ab75
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ import {
xdcTestnet,
zilliqa,
zilliqaTestnet,
flowMainnet,
flowTestnet,
} from 'viem/chains';

const ETHEREUM = mainnet.id;
Expand Down Expand Up @@ -214,6 +216,8 @@ const XDC = xdc.id;
const XDC_TESTNET = xdcTestnet.id;
const ZILLIQA = zilliqa.id;
const ZILLIQA_TESTNET = zilliqaTestnet.id;
const FLOW_MAINNET = flowMainnet.id;
const FLOW_TESTNET = flowTestnet.id;

type Chain =
| typeof ETHEREUM
Expand Down Expand Up @@ -318,7 +322,9 @@ type Chain =
| typeof XDC
| typeof XDC_TESTNET
| typeof ZILLIQA
| typeof ZILLIQA_TESTNET;
| typeof ZILLIQA_TESTNET
| typeof FLOW_MAINNET
| typeof FLOW_TESTNET;

const CHAINS: Chain[] = [
ETHEREUM,
Expand Down Expand Up @@ -424,6 +430,8 @@ const CHAINS: Chain[] = [
XDC_TESTNET,
ZILLIQA,
ZILLIQA_TESTNET,
FLOW_MAINNET,
FLOW_TESTNET,
];

function getChainEndpointUrl(chain: Chain): string | null {
Expand Down Expand Up @@ -644,6 +652,10 @@ function getChainData(chain: Chain): ChainData {
return zilliqa;
case ZILLIQA_TESTNET:
return zilliqaTestnet;
case FLOW_MAINNET:
return flowMainnet;
case FLOW_TESTNET:
return flowTestnet;
}
}

Expand Down

0 comments on commit 0e1ab75

Please sign in to comment.