Skip to content

Commit

Permalink
Merge pull request #85 from Cryptorubic/feature/enum-typing
Browse files Browse the repository at this point in the history
  • Loading branch information
axtezy authored May 26, 2022
2 parents 5466edb + 6365f0b commit 2554350
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rubic-sdk",
"version": "1.2.1",
"version": "1.2.2",
"description": "Simplify dApp creation",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
42 changes: 21 additions & 21 deletions src/core/blockchain/models/BLOCKCHAIN_NAME.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
export enum TESTNET_BLOCKCHAIN_NAME {
KOVAN = 'KOVAN',
BINANCE_SMART_CHAIN_TESTNET = 'BSC_TESTNET',
POLYGON_TESTNET = 'POLYGON_TESTNET',
HARMONY_TESTNET = 'HARMONY_TESTNET',
AVALANCHE_TESTNET = 'AVALANCHE_TESTNET',
MOONRIVER_TESTNET = 'MOONRIVER_TESTNET',
FANTOM_TESTNET = 'FANTOM_TESTNET'
}
export const TESTNET_BLOCKCHAIN_NAME = {
KOVAN: 'KOVAN',
BINANCE_SMART_CHAIN_TESTNET: 'BSC_TESTNET',
POLYGON_TESTNET: 'POLYGON_TESTNET',
HARMONY_TESTNET: 'HARMONY_TESTNET',
AVALANCHE_TESTNET: 'AVALANCHE_TESTNET',
MOONRIVER_TESTNET: 'MOONRIVER_TESTNET',
FANTOM_TESTNET: 'FANTOM_TESTNET'
} as const;

export enum MAINNET_BLOCKCHAIN_NAME {
ETHEREUM = 'ETH',
BINANCE_SMART_CHAIN = 'BSC',
POLYGON = 'POLYGON',
AVALANCHE = 'AVALANCHE',
MOONRIVER = 'MOONRIVER',
FANTOM = 'FANTOM',
HARMONY = 'HARMONY',
ARBITRUM = 'ARBITRUM',
AURORA = 'AURORA'
}
export const MAINNET_BLOCKCHAIN_NAME = {
ETHEREUM: 'ETH',
BINANCE_SMART_CHAIN: 'BSC',
POLYGON: 'POLYGON',
AVALANCHE: 'AVALANCHE',
MOONRIVER: 'MOONRIVER',
FANTOM: 'FANTOM',
HARMONY: 'HARMONY',
ARBITRUM: 'ARBITRUM',
AURORA: 'AURORA'
} as const;

export const BLOCKCHAIN_NAME = {
...MAINNET_BLOCKCHAIN_NAME,
...TESTNET_BLOCKCHAIN_NAME
};

// eslint-disable-next-line @typescript-eslint/no-redeclare
export type BLOCKCHAIN_NAME = MAINNET_BLOCKCHAIN_NAME | TESTNET_BLOCKCHAIN_NAME;
export type BLOCKCHAIN_NAME = typeof BLOCKCHAIN_NAME[keyof typeof BLOCKCHAIN_NAME];

0 comments on commit 2554350

Please sign in to comment.