Skip to content

Commit

Permalink
feat: add stability network to supported chains (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
deblanco authored Mar 12, 2024
1 parent a37d0bb commit 185f1b9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/constants/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const networks = [
"hederatestnet",
"hederamainnet",
"stabilitytestnet",
"stability",
] as const;

export type networkName = (typeof networks)[number];
Expand Down
9 changes: 9 additions & 0 deletions src/constants/supportedChains.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,13 @@ describe("supportedChains", () => {
expect(currency).toBe("FREE");
expect(explorerUrl).toBe("https://stability-testnet.blockscout.com/");
});
it("should stability chain info correctly", () => {
const { id, name, type, currency, explorerUrl } = SUPPORTED_CHAINS[CHAIN_ID.stability];

expect(id).toBe(CHAIN_ID.stability);
expect(name).toBe("stability");
expect(type).toBe("production");
expect(currency).toBe("FREE");
expect(explorerUrl).toBe("https://stability.blockscout.com/");
});
});
16 changes: 16 additions & 0 deletions src/constants/supportedChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export enum CHAIN_ID {
hederatestnet = "296",
hederamainnet = "295",
stabilitytestnet = "20180427",
stability = "101010",
}

export type chainInfo = {
Expand Down Expand Up @@ -193,4 +194,19 @@ export const SUPPORTED_CHAINS: supportedChains = {
decimals: 18,
},
},
[CHAIN_ID.stability]: {
id: CHAIN_ID.stability,
label: "Stability Network",
name: "stability",
type: "production",
currency: "FREE",
iconImage: iconStability,
explorerUrl: "https://stability.blockscout.com/",
rpcUrl: `https://gtn.stabilityprotocol.com/?api_key=${process.env.STABILITY_API_KEY}`,
nativeCurrency: {
name: "FREE",
symbol: "FREE",
decimals: 18,
},
},
};

0 comments on commit 185f1b9

Please sign in to comment.