* Change query to sort by timestamp and id
* Add maximun size to pageSize in operation endpoint
* Add missing indexes for mongodb
* improve search txHash for nested wormchain txHash
---------
Co-authored-by: Fernando Torres <fert1335@gmail.com>
Add to cache without expiration.
Increase expiration to fetch data from influx to 10 minute. After 10 minute we update the data to influx is the response is success, if the response is not success we return the old data in the cache without expiration.
Add alert when return metrics endpoint using cache that are expired.
Co-authored-by: walker-16 <agpazos85@gmail.com>
### Description
This pull request adds the parameter `toChain` to the endpoint `GET /api/v1/vaas/{emitterChain}/{emitterAddress}`.
Other VAA-related endpoints do not support this parameter.
Additionally, for performance reasons, a composite index must be created in MongoDB: `db.parsedVaa.createIndex({"emitterChain": -1, "emitterAddr": -1, "rawStandardizedProperties.toChain": -1, "indexedAt": -1})`
### Description
Before this pull request, when calling `GET /api/v1/vaas?txHash={h}` for a hash that has multiple VAAs associated with it, we were just returning one. After this pull request, the API should return all of the VAAs associated with that transaction hash.
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/563
### Description
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/535.
This pull request fixes an inconsistency between the endpoints `GET /api/v1/x-chain-activity` and `GET /api/v1/top-chain-pairs-by-num-transfers`.
The inconsistency arose because the endpoints computed the data in slightly different ways.
It was resolved by modifying the `GET /api/v1/top-chain-pairs-by-num-transfers` endpoint to use the same data source as `GET /api/v1/x-chain-activity`.
### Description
This pull request removes two unused fields from the `GlobalTransaction.OriginTx` JSON model:
* `timestamp`: this field is always set to the VAA's timestamp, making it redundant. Moreover, for EVM chains we need one extra RPC node request to get it. So better get rid of it.
* `chainId`: this field is always set to the VAA's emitter chain, making it redundant.
### Summary
This pull request modifies the API service to expose two endpoints for the Wormhole Scan UI:
* `GET /api/v1/transactions`: data needed to render the transactions list page.
* `GET /api/v1/transactions/{chain}/{id}/{sequence}`: data needed to render the transaction detail page.
### Description
This pull request implements an improvement in the processing logic of the `tx-tracker` service to avoid processing a message more than once.
### Description
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/451.
The Wormhole Scan UI needs to provide a link to the emitter address for each VAA.
This pull request adds a field containing decoded emitter addresses in the following endpoints:
* `GET /api/v1/transactions`: field `emitterNativeAddress`
* `GET /api/v1/vaas*`: field `emiterNativeAddr`
### Description
Remove the `NativeTxHash` from the JSON model returned by `GET /api/v1/vaas`. That field was never meant to be exposed to the API users.
For Solana and Aptos, the transaction hash returned by `GET /api/v1/vaas` is incorrect (currently it's the value transmitted in the gossip network, which is not the real transaction hash).
This pull request replaces it with the real transaction hash.
* Replace start_time and end_time query parameters with fixed ranges at the endpoint of the chain activity
Add InfluxDB tasks for enpdoint chain-activity for each timeSpan
Add cache for chain-activity endpoint
* Code review updates
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/404
The WormholeScan UI needs to display the sender address for each token bridge VAA. This pull request modifies the `tx-tracker` service to obtain that information for Solana and eight EVM chains.
The transaction sender will become accessible through the following endpoints:
* `GET /api/v1/global-tx/{chain}/{emitter}/{seq}`: field `originTx.from`.
* `GET /api/v1/transactions`: field `originAddress`.
In both cases, the field is nullable (i.e.: sometimes it may not be available due to eventual consistency or internal errors)
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/385
This pull request implements a new endpoint, `GET /api/v1/transactions`, which will be consumed by the wormhole explorer UI.
The endpoint returns a paginated list of transactions, in which each element contains a brief overview of the transaction (ID, txHash, status, etc.).
It exposes offset-based pagination via the parameters `page` and `pageSize`. Also, results can be obtained for a specific address by using the `address` query parameter.
The response model looks like this:
```json
{
"transactions": [
{
"id": "1/5ec18c34b47c63d17ab43b07b9b2319ea5ee2d163bce2e467000174e238c8e7f/12965",
"timestamp": "2023-06-08T19:30:19Z",
"txHash": "a302c4ab2d6b9a6003951d2e91f8fdbb83cfa20f6ffb588b95ef0290aab37066",
"originChain": 1,
"status": "ongoing"
},
{
"id": "22/0000000000000000000000000000000000000000000000000000000000000001/18308",
"timestamp": "2023-06-08T19:17:14Z",
"txHash": "00000000000000000000000000000000000000000000000000000000000047e7",
"originChain": 22,
"destinationAddress": "0x00000000000000000000000067e8a40816a983fbe3294aaebd0cc2391815b86b",
"destinationChain": 5,
"tokenAmount": "0.12",
"usdAmount": "0.12012",
"symbol": "USDC",
"status": "completed"
},
...
]
}
```
### Limitations of the current implementation
1. Doesn't return the total number of results (this may result in a performance issue when we filter by address)
2. Can only filter by receiver address (we don't have sender information in the database yet)
### Summary
This pull request fixes an issue in which all observation-related endpoints were returning results sorted by `id` (https://github.com/wormhole-foundation/wormhole-explorer/issues/358). The expected behavior is to sort results based on descending timestamp order instead.
Also, swagger docs were updated to document this behavior.
### Summary
This pull request fixes an issue in which volume metrics were not being generated for unknown tokens (i.e.: tokens that are not present in our database).
Also, the function that generated volume metrics was modified in order to handle timestamp collisions.