Skip to content

Commit

Permalink
feat: Introduce new Networks and Chains
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Feb 6, 2024
1 parent e7a27d4 commit dc72d7e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
24 changes: 22 additions & 2 deletions report/schemas.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ export enum CatalogSortDirection {

// @alpha
export enum ChainId {
// (undocumented)
ARBITRUM_MAINNET = 42161,
// (undocumented)
AVALANCHE_MAINNET = 43114,
// (undocumented)
BNB_MAINNET = 56,
// (undocumented)
ETHEREUM_GOERLI = 5,
// (undocumented)
Expand All @@ -348,9 +354,13 @@ export enum ChainId {
// (undocumented)
ETHEREUM_SEPOLIA = 11155111,
// (undocumented)
FANTOM_MAINNET = 250,
// (undocumented)
MATIC_MAINNET = 137,
// (undocumented)
MATIC_MUMBAI = 80001
MATIC_MUMBAI = 80001,
// (undocumented)
OPTIMISM_MAINNET = 10
}

// @alpha (undocumented)
Expand Down Expand Up @@ -1181,10 +1191,20 @@ export enum MintSortBy {

// @alpha
export enum Network {
// (undocumented)
ARBITRUM = "ARBITRUM",
// (undocumented)
AVALANCHE = "AVALANCHE",
// (undocumented)
BINANCE = "BINANCE",
// (undocumented)
ETHEREUM = "ETHEREUM",
// (undocumented)
MATIC = "MATIC"
FANTOM = "FANTOM",
// (undocumented)
MATIC = "MATIC",
// (undocumented)
OPTIMISM = "OPTIMISM"
}

// @alpha (undocumented)
Expand Down
17 changes: 16 additions & 1 deletion src/dapps/chain-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export enum ChainId {
ETHEREUM_KOVAN = 42,
ETHEREUM_SEPOLIA = 11155111,
MATIC_MAINNET = 137,
MATIC_MUMBAI = 80001
MATIC_MUMBAI = 80001,
BNB_MAINNET = 56,
OPTIMISM_MAINNET = 10,
ARBITRUM_MAINNET = 42161,
FANTOM_MAINNET = 250,
AVALANCHE_MAINNET = 43114
}

/**
Expand Down Expand Up @@ -147,6 +152,16 @@ export function getNetwork(chainId: ChainId): Network {
case ChainId.MATIC_MAINNET:
case ChainId.MATIC_MUMBAI:
return Network.MATIC
case ChainId.BNB_MAINNET:
return Network.BINANCE
case ChainId.OPTIMISM_MAINNET:
return Network.OPTIMISM
case ChainId.ARBITRUM_MAINNET:
return Network.ARBITRUM
case ChainId.FANTOM_MAINNET:
return Network.FANTOM
case ChainId.AVALANCHE_MAINNET:
return Network.AVALANCHE
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/dapps/chain-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ export function getChainId(chainName: ChainName): ChainId | null {
return ChainId.MATIC_MAINNET
case ChainName.MATIC_MUMBAI:
return ChainId.MATIC_MUMBAI
case ChainName.AVALANCHE_MAINNET:
return ChainId.AVALANCHE_MAINNET
case ChainName.BINANCE_MAINNET:
return ChainId.BNB_MAINNET
case ChainName.ARBITRUM_MAINNET:
return ChainId.ARBITRUM_MAINNET
case ChainName.OPTIMISM_MAINNET:
return ChainId.OPTIMISM_MAINNET
case ChainName.FANTOM_MAINNET:
return ChainId.FANTOM_MAINNET
default:
return null
}
Expand Down
7 changes: 6 additions & 1 deletion src/dapps/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { generateLazyValidator, JSONSchema, ValidateFunction } from '../validati
*/
export enum Network {
ETHEREUM = 'ETHEREUM',
MATIC = 'MATIC'
MATIC = 'MATIC',
AVALANCHE = 'AVALANCHE',
BINANCE = 'BINANCE',
OPTIMISM = 'OPTIMISM',
ARBITRUM = 'ARBITRUM',
FANTOM = 'FANTOM'
}

/**
Expand Down

0 comments on commit dc72d7e

Please sign in to comment.