Skip to content

Commit

Permalink
feat:add xdc network
Browse files Browse the repository at this point in the history
  • Loading branch information
AnilChinchawale committed Jul 24, 2023
1 parent 8f04616 commit 70615cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ npx -p @govtechsg/open-attestation-cli open-attestation <arguments>
| Goerli(Deprecated) | 5 | Test |
| polygon | 137 | Production |
| mumbai | 80001 | Test |
| xdc | 50 | Production |
| xdcapothem | 51 | Test |

---

Expand Down
18 changes: 17 additions & 1 deletion src/commands/networks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { providers } from "ethers";

export type networkCurrency = "ETH" | "MATIC";
export type networkCurrency = "ETH" | "MATIC" | "XDC";

type SupportedNetwork = {
explorer: string;
Expand All @@ -17,6 +17,8 @@ export enum NetworkCmdName {
Sepolia = "sepolia",
Matic = "matic",
Maticmum = "maticmum",
XDC = "xdc",
XDCApothem = "xdcapothem",
}

const defaultInfuraProvider =
Expand Down Expand Up @@ -74,6 +76,20 @@ export const supportedNetwork: {
networkName: "maticmum",
currency: "MATIC",
},
[NetworkCmdName.XDC]: {
explorer: "https://xdcscan.io",
provider: jsonRpcProvider("https://erpc.xinfin.network"),
networkId: 50,
networkName: "xdc",
currency: "XDC",
},
[NetworkCmdName.XDCApothem]: {
explorer: "https://apothem.xdcscan.io",
provider: jsonRpcProvider("https://erpc.apothem.network"),
networkId: 51,
networkName: "xdcapothem",
currency: "XDC",
},
};

export const getSupportedNetwork = (networkCmdName: string): SupportedNetwork => {
Expand Down

0 comments on commit 70615cf

Please sign in to comment.