mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-02 21:03:28 +00:00
parent
6c2f20fc93
commit
6bab62a0a9
@ -24,8 +24,10 @@ export const checkReceiptStatus = async (hash: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// export const calculateGasPrice = async () => '1000000000'
|
||||||
|
|
||||||
export const calculateGasPrice = async () => {
|
export const calculateGasPrice = async () => {
|
||||||
/*
|
/*
|
||||||
const web3 = getWeb3()
|
const web3 = getWeb3()
|
||||||
const { network } = web3.version
|
const { network } = web3.version
|
||||||
const isMainnet = MAINNET_NETWORK === network
|
const isMainnet = MAINNET_NETWORK === network
|
||||||
@ -33,9 +35,13 @@ export const calculateGasPrice = async () => {
|
|||||||
const url = isMainnet
|
const url = isMainnet
|
||||||
? 'https://safe-relay.staging.gnosisdev.com/api/v1/gas-station/'
|
? 'https://safe-relay.staging.gnosisdev.com/api/v1/gas-station/'
|
||||||
: 'https://safe-relay.dev.gnosisdev.com/'
|
: 'https://safe-relay.dev.gnosisdev.com/'
|
||||||
*/
|
*/
|
||||||
|
const corsProblem = process.env.NODE_ENV === 'test'
|
||||||
|
if (corsProblem) {
|
||||||
|
return '4000000'
|
||||||
|
}
|
||||||
|
|
||||||
const response = await fetch('https://ethgasstation.info/json/ethgasAPI.json', { mode: 'cors' })
|
const response = await fetch('https://ethgasstation.info/json/ethgasAPI.json')
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('Error querying gast station')
|
throw new Error('Error querying gast station')
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user