terra-money / fcd-classic

Terra ETL + RestFul API Server
https://fcd.terra.dev/swagger
MIT License
63 stars 42 forks source link

Mempool support #131

Closed hanjukim closed 3 years ago

hanjukim commented 3 years ago

Description

This PR provides 2 additional endpoints for querying mempool data which could be useful to applications for showing the status, calculate eta and etc.

It is similar to /v1/tx and /v1/txs

  1. /v1/mempool/:txhash -> query mempool by txhash
  2. /v1/mempool?account={address} -> query mempool by account(wallet) address

The result of above endpoints is also similar

interface MempoolItem {
  timestamp: string // ISO Date
  txhash: string
  tx: Transaction.LcdTx
}

I've also rewrite RPCWatcher class and test from the scratch to use reconnecting-websocket instead of bespoke one. The changes are already deployed to Tequila-0004 network.

ethsc2021 commented 3 years ago

@hanjukim How should we decode tx string from unconfirmed_txs? I see the main branch is using amino's unmarshalTx which generates error, but the Bombay branch fixes that by calling /tx/decode.