Skip to content

Commit

Permalink
feat: add stability network
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielMartinezRodriguez committed Mar 13, 2024
1 parent 500b920 commit 11ff6a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ npx -p @tradetrust-tt/tradetrust-cli tradetrust <arguments>
| hederamainet | 295 | Production |
| hederatestnet | 296 | Test |
| stabilitytestnet | 20180427 | Test |
| stability | 101010 | Production |

---

Expand Down
12 changes: 12 additions & 0 deletions src/common/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export enum NetworkCmdName {
HederaMainnet = "hederamainnet",
HederaTestnet = "hederatestnet",
StabilityTestnet = "stabilitytestnet",
Stability = "stability",
}

const defaultInfuraProvider =
Expand All @@ -36,6 +37,10 @@ const jsonRpcProvider =
() =>
new providers.JsonRpcProvider(url);

const getStabilityApiKey = () => {
return process.env.STABILITY_API_KEY || "test";
};

export const supportedNetwork: {
[key in NetworkCmdName]: SupportedNetwork;
} = {
Expand Down Expand Up @@ -104,6 +109,13 @@ export const supportedNetwork: {
networkName: NetworkCmdName.HederaTestnet,
currency: "HBAR",
},
[NetworkCmdName.Stability]: {
explorer: "https://stability.blockscout.com",
provider: jsonRpcProvider(`https://gtn.stabilityprotocol.com/zgt/${getStabilityApiKey()}`),
networkId: 101010,
networkName: NetworkCmdName.Stability,
currency: "FREE",
},
[NetworkCmdName.StabilityTestnet]: {
explorer: "https://stability-testnet.blockscout.com/",
provider: jsonRpcProvider("https://free.testnet.stabilityprotocol.com"),
Expand Down

0 comments on commit 11ff6a2

Please sign in to comment.