diff --git a/README.md b/README.md index 6b49b11a..cca8a736 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,8 @@ npx -p @govtechsg/open-attestation-cli open-attestation | mumbai | 80001 | Test | | xdc | 50 | Production | | xdcapothem | 51 | Test | - +| hederamainet | 295 | Production | +| hederatestnet | 296 | Test | --- ## Usage @@ -324,6 +325,14 @@ open-attestation deploy token-registry "My Sample Token" MST --network sepolia ✔ success Token registry deployed at 0x4B127b8d5e53872d403ce43414afeb1db67B1842 ``` +Example - Hedera network using Title Escrow address. + +```bash +open-attestation deploy token-registry "KrypCEBL" KRYE -n hederatestnet -f key.txt --factory-address 0xde5aBf7B2416b99cba15021E3CF35A2a56ac83c1 --standalone + +✔ success Token registry deployed at 0x67f98aB5E2836223bCFC3e5c03D701AeB3a8A30a +``` + #### Issue document to token registry `Issue` a hash to a token registry deployed on the blockchain. The `tokenId` option would be used to indicate the document hash, and the `to` option to indicate the title escrow address the document is mapped to. diff --git a/src/commands/config/config.type.ts b/src/commands/config/config.type.ts index fafb89a8..669f16a5 100644 --- a/src/commands/config/config.type.ts +++ b/src/commands/config/config.type.ts @@ -14,4 +14,5 @@ export enum TestNetwork { Sepolia = "sepolia", Mumbai = "mumbai (polygon)", Apothem = "apothem (xdc)", + Hedera = "hedera (testnet)" } diff --git a/src/commands/config/create.ts b/src/commands/config/create.ts index ec36bf07..d4635062 100644 --- a/src/commands/config/create.ts +++ b/src/commands/config/create.ts @@ -66,6 +66,7 @@ export const handler = async (args: CreateConfigCommand): Promise => { TestNetwork.Sepolia, TestNetwork.Mumbai, TestNetwork.Apothem, + TestNetwork.Hedera ]; const { network } = await inquirer.prompt({ type: "list", @@ -91,6 +92,7 @@ const convertNetworkToNetworkCmdName = (selectedNetwork: TestNetwork): NetworkCm [TestNetwork.Sepolia]: NetworkCmdName.Sepolia, [TestNetwork.Mumbai]: NetworkCmdName.Maticmum, [TestNetwork.Apothem]: NetworkCmdName.XDCApothem, + [TestNetwork.Hedera]: NetworkCmdName.HederaTestnet, }; return network[selectedNetwork]; }; diff --git a/src/commands/networks.ts b/src/commands/networks.ts index 4dfa1cf6..091aad62 100644 --- a/src/commands/networks.ts +++ b/src/commands/networks.ts @@ -1,6 +1,6 @@ import { providers } from "ethers"; -export type networkCurrency = "ETH" | "MATIC" | "XDC"; +export type networkCurrency = "ETH" | "MATIC" | "XDC" | "HBAR"; type SupportedNetwork = { explorer: string; @@ -19,6 +19,8 @@ export enum NetworkCmdName { Maticmum = "maticmum", XDC = "xdc", XDCApothem = "xdcapothem", + HederaMainnet = "hederamainnet", + HederaTestnet = "hederatestnet" } const defaultInfuraProvider = @@ -90,6 +92,21 @@ export const supportedNetwork: { networkName: "xdcapothem", currency: "XDC", }, + [NetworkCmdName.HederaMainnet]: { + explorer: "https://hashscan.io/mainnet", + provider: jsonRpcProvider("https://mainnet.hashio.io/api"), + networkId: 295, + networkName: "hederamainnet", + currency: "HBAR", + + }, + [NetworkCmdName.HederaTestnet]: { + explorer: "https://hashscan.io/testnet", + provider: jsonRpcProvider("https://testnet.hashio.io/api"), + networkId: 296, + networkName: "hederatestnet", + currency: "HBAR", + }, }; export const getSupportedNetwork = (networkCmdName: string): SupportedNetwork => {