Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ npx -p @govtechsg/open-attestation-cli open-attestation <arguments>
| mumbai | 80001 | Test |
| xdc | 50 | Production |
| xdcapothem | 51 | Test |

| hederamainet | 295 | Production |
| hederatestnet | 296 | Test |
---

## Usage
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/commands/config/config.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export enum TestNetwork {
Sepolia = "sepolia",
Mumbai = "mumbai (polygon)",
Apothem = "apothem (xdc)",
Hedera = "hedera (testnet)"
}
2 changes: 2 additions & 0 deletions src/commands/config/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const handler = async (args: CreateConfigCommand): Promise<void> => {
TestNetwork.Sepolia,
TestNetwork.Mumbai,
TestNetwork.Apothem,
TestNetwork.Hedera
];
const { network } = await inquirer.prompt({
type: "list",
Expand All @@ -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];
};
19 changes: 18 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" | "XDC";
export type networkCurrency = "ETH" | "MATIC" | "XDC" | "HBAR";

type SupportedNetwork = {
explorer: string;
Expand All @@ -19,6 +19,8 @@ export enum NetworkCmdName {
Maticmum = "maticmum",
XDC = "xdc",
XDCApothem = "xdcapothem",
HederaMainnet = "hederamainnet",
HederaTestnet = "hederatestnet"
}

const defaultInfuraProvider =
Expand Down Expand Up @@ -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 => {
Expand Down