mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
lint fixes
This commit is contained in:
parent
6865fae4a8
commit
b09e3acb12
@ -28,7 +28,9 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"react/prop-types": "off",
|
"react/prop-types": "off",
|
||||||
"react/no-unused-prop-types": "off",
|
"react/no-unused-prop-types": "off",
|
||||||
"@typescript-eslint/explicit-function-return-type": "off"
|
"@typescript-eslint/explicit-function-return-type": "off",
|
||||||
|
"no-use-before-define": "off",
|
||||||
|
"@typescript-eslint/no-use-before-define": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -39,6 +39,19 @@ export const web3ModalOpts = {
|
|||||||
theme: web3ModalTheme
|
theme: web3ModalTheme
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getChainId(network: string): number {
|
||||||
|
switch (network) {
|
||||||
|
case 'mainnet':
|
||||||
|
return 1
|
||||||
|
case 'rinkeby':
|
||||||
|
return 4
|
||||||
|
case 'kovan':
|
||||||
|
return 42
|
||||||
|
default:
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function isCorrectNetwork(chainId: number): boolean {
|
export function isCorrectNetwork(chainId: number): boolean {
|
||||||
const configuredNetwork = getChainId(network)
|
const configuredNetwork = getChainId(network)
|
||||||
return configuredNetwork === chainId
|
return configuredNetwork === chainId
|
||||||
@ -62,16 +75,3 @@ export function getNetworkName(chainId: number): string {
|
|||||||
return 'Unknown'
|
return 'Unknown'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getChainId(network: string): number {
|
|
||||||
switch (network) {
|
|
||||||
case 'mainnet':
|
|
||||||
return 1
|
|
||||||
case 'rinkeby':
|
|
||||||
return 4
|
|
||||||
case 'kovan':
|
|
||||||
return 42
|
|
||||||
default:
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user