Skip to content

Commit

Permalink
feat: add base and base_goerli for ankr provider
Browse files Browse the repository at this point in the history
  • Loading branch information
yum0e committed Sep 7, 2023
1 parent 6dade4e commit 624715d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"name": "Network",
"argName": "network",
"type": "string",
"example": "eth, 1, bsc, 56...",
"description": "The network name or ID where the Token is located. Network accepted: eth, bsc, fantom, avalanche, polygon, arbitrum, syscoin, optimism, eth_goerli, polygon_mumbai, avalanche_fuji"
"example": "eth, 1, base, 8453...",
"description": "The network name or ID where the Token is located. Network accepted: eth, base, bsc, fantom, avalanche, polygon, arbitrum, syscoin, optimism, eth_goerli, base_goerli, polygon_mumbai, avalanche_fuji"
}
]
},
Expand All @@ -42,8 +42,8 @@
"name": "Network",
"argName": "network",
"type": "string",
"example": "eth, 1, bsc, 56...",
"description": "The network name or ID where the Token is located. Network accepted: eth, bsc, fantom, avalanche, polygon, arbitrum, syscoin, optimism, eth_goerli, polygon_mumbai, avalanche_fuji"
"example": "eth, 1, base, 8453...",
"description": "The network name or ID where the Token is located. Network accepted: eth, base, bsc, fantom, avalanche, polygon, arbitrum, syscoin, optimism, eth_goerli, base_goerli, polygon_mumbai, avalanche_fuji"
}
]
}
Expand Down
10 changes: 9 additions & 1 deletion group-generators/helpers/data-providers/ankr/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type TokenInfo = {

export enum SupportedNetwork {
ETH = "eth",
BASE = "base",
BSC = "bsc",
FANTOM = "fantom",
AVALANCHE = "avalanche",
Expand All @@ -13,15 +14,19 @@ export enum SupportedNetwork {
SYSCOIN = "syscoin",
OPTIMISM = "optimism",
ETH_GOERLI = "eth_goerli",
BASE_GOERLI = "base_goerli",
POLYGON_MUMBAI = "polygon_mumbai",
AVALANCHE_FUJI = "avalanche_fuji"
AVALANCHE_FUJI = "avalanche_fuji",
}

export const fromStringToSupportedNetwork = (network: string): SupportedNetwork => {
switch (network) {
case "eth":
case "1":
return SupportedNetwork.ETH;
case "base":
case "8453":
return SupportedNetwork.BASE;
case "bsc":
case "56":
return SupportedNetwork.BSC;
Expand All @@ -46,6 +51,9 @@ export const fromStringToSupportedNetwork = (network: string): SupportedNetwork
case "eth_goerli":
case "5":
return SupportedNetwork.ETH_GOERLI;
case "base_goerli":
case "84531":
return SupportedNetwork.BASE_GOERLI;
case "polygon_mumbai":
case "80001":
return SupportedNetwork.POLYGON_MUMBAI;
Expand Down

0 comments on commit 624715d

Please sign in to comment.