forked from cerc-io/cosmos-explorer
add timestamp
This commit is contained in:
parent
20f787e1b8
commit
0993394e1c
@ -60,7 +60,7 @@ export default class ChainFetch {
|
|||||||
if (conf.chain_name === 'injective') {
|
if (conf.chain_name === 'injective') {
|
||||||
return ChainFetch.fetch('https://tm.injective.network', '/block').then(data => Block.create(commonProcess(data)))
|
return ChainFetch.fetch('https://tm.injective.network', '/block').then(data => Block.create(commonProcess(data)))
|
||||||
}
|
}
|
||||||
return this.get('/blocks/latest', config).then(data => Block.create(data))
|
return this.get(`/blocks/latest?${new Date().getTime()}`, config).then(data => Block.create(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
async getBlockByHeight(height, config = null) {
|
async getBlockByHeight(height, config = null) {
|
||||||
@ -386,6 +386,19 @@ export default class ChainFetch {
|
|||||||
return ChainFetch.fetchCoinMarketCap(`/quote/${symbol}`)
|
return ChainFetch.fetchCoinMarketCap(`/quote/${symbol}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Simulate Execution of tx
|
||||||
|
async simulate(tx, config = null) {
|
||||||
|
return this.post('/cosmos/tx/v1beta1/simulate', tx, config).then(res => {
|
||||||
|
if (res.code && res.code !== 0) {
|
||||||
|
throw new Error(res.message)
|
||||||
|
}
|
||||||
|
if (res.tx_response && res.tx_response.code !== 0) {
|
||||||
|
throw new Error(res.tx_response.raw_log)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Tx Submit
|
// Tx Submit
|
||||||
async broadcastTx(bodyBytes, config = null) {
|
async broadcastTx(bodyBytes, config = null) {
|
||||||
const txString = toBase64(TxRaw.encode(bodyBytes).finish())
|
const txString = toBase64(TxRaw.encode(bodyBytes).finish())
|
||||||
|
Loading…
Reference in New Issue
Block a user