Commit Graph

16 Commits

Author SHA1 Message Date
agodnic d9d49ec919
Add 24h volume to scorecards (#274)
### Summary

This pull request adds volume metrics to influxdb. Also, it adds the 24h volume metric to `GET /api/v1/scorecards`.

Tracking issues: https://github.com/wormhole-foundation/wormhole-explorer/issues/221, https://github.com/wormhole-foundation/wormhole-explorer/issues/280

### Changes:
* The `parser` service no longer generates metrics for influxdb. All metrics-related code was removed from that service, that code was moved to the analytics service instead.
* New volume metrics were added to the analytics service.
* The notional cache was modified to use token names (i.e.: ticker symbols) as keys instead of chain IDs.
* The notional cache reader was moved to the `common/client/cache` package.
* A little bit of duplicated code between the cache reader and writer was removed.
* A 24h volume metric was added to `GET /api/v1/scorecards`.
* A dictionary that stores token metadata was added under `common/domain/tokenbridge.go`. More tokens will be added to it in the near future.
2023-05-04 20:17:03 -03:00
agodnic 1f47f887da
[API/TX-TRACKER] Add support for Solana tx hashes (#218)
### Summary
This pull request adds the functionality to search for VAAs using Solana tx hashes, e.g.:

`GET /api/v1/vaas?txHash=2qnNNBQQQ152sGkQ1Rnq2Kdr48LvdN4oXwnTWyEmJqYYWFusLWxbwhpGS5KTXH1bKKx9gg9BLZMKd3g1cXiy7QMz`.

Also, the VAA objects returned by the API now have a new field `nativeTxHash`, which contains the tx hash that generated the VAA in the native format of the emitter chain.

Tracking issues: https://github.com/wormhole-foundation/wormhole-explorer/issues/212, https://github.com/wormhole-foundation/wormhole-explorer/issues/214

### Testing guidelines

Endpoints affected:
* `GET /api/v1/vaas` now supports Solana tx hashes by using the `?txHash=` query parameter. This search is limited to VAAs created by the portal token bridge.
* Some VAAs returned by the API should have a new field `nativeTxHash`. All VAAs related to the portal token bridge should have this field set.
*  An internal refactoring affected pretty much all routes under `GET /api/v1/vaas*`, which should be re-tested.
* In the response of `/api/v1/global-tx/`, the field `originTx.signer` has been renamed to `originTx.from`
2023-04-05 10:33:28 -03:00
ftocal db3a54270a
fix: use full address (#193) 2023-03-16 15:42:34 -03:00
agodnic 533b83ad28
[API] Accept additional address formats (#170)
### Summary

Context: https://github.com/wormhole-foundation/wormhole-explorer/issues/154

This PR modifies all endpoints that receive an emitter/guardian address to accept a wider range of formats.
After this pull request, all of these are equivalent:
* `0x000000000000000000000000f890982f9310df57d00f659cf4fd87e65aded8d7`
* `000000000000000000000000f890982f9310df57d00f659cf4fd87e65aded8d7`
* `0xf890982f9310df57d00f659cf4fd87e65aded8d7`
* `f890982f9310df57d00f659cf4fd87e65aded8d7`

### Testing plan
* Added unit tests for the parsing code.
* Tested manually a few of the affected endpoints.
2023-02-28 17:50:23 -03:00
agodnic e2195d420e
[API] Fix issue in MongoDB aggregation pipeline (#147)
### Summary

In some cases, the query parameters for a MongoDB aggregation pipeline were not being initialized.

This led to errors in `GET /api/v1/vaas/{chain}/{emitter}/{seq}`. 
Other endpoints could also have been affected.
2023-02-10 15:55:45 -03:00
agodnic dde87acf84
[API] Several fixes related to pagination (#144)
### Summary
* On all endpoints, fix the behavior of the `page` parameter (which was previously being ignored).
* On `GET /api/v1/vaas`, fix the behavior of the `sortBy` parameter (which wasn't working when `parsedPayload=true`).
* For all endpoints, validate the query parameters `page`, `pageNumber` and `sortOrder`.
* Return descriptive errors when pagination-related parameters happen to be invalid (`page`, `pageSize`, `sortOrder`).
* Validate guardian addresses in query params.

### Testing plan
All parameters involved were manually tested.
2023-02-09 14:28:39 -03:00
agodnic 9018d9a51a
[API] Remove duplicated model for VAAs (#135)
The structs `VaaDoc` and `VaaWithPayload` were being used for similar purposes.

This commit merges both into the same struct.
2023-02-03 16:46:02 -03:00
agodnic cd976bac96
[API] Add appId parameter to GET /api/v1/vaas (#114)
Add the `appId` query parameter to `GET /api/v1/vaas`.
2023-02-01 09:59:51 -03:00
agodnic ed0985d502
[API] Add parsed payloads to `GET /api/v1/vaas` (#113)
Add query parameter `parsedPayload` to the endpoint `GET /api/v1/vaas`.
2023-01-31 15:24:34 -03:00
walker-16 ca6710d5d5
Add parsedPayload query param to /vaa/:chainID/:address/:sequence (#102) 2023-01-27 13:47:17 -03:00
ftocal e20e73c636
Add txHash in VAA (#94)
* add vaaId and txHash relation in vaaIdTxHash collection

* add txHash in vaas collection

* add txHash in response vaa and as filter in find vaas endpoints
2023-01-26 11:54:41 -03:00
walker-16 5225cc13fa
Feature/add grpc support (#73)
* Add grpc web support

* Add endpoints GRPC
- GovernorGetAvailableNotionalByChain
- GovernorGetEnqueuedVAAs
- GovernorIsVAAEnqueued
- GovernorGetTokenList

* Add endpoint GRPC - GetSignedVAA, GetSignedBatchVAA, GetLastHeartbeats, GetCurrentGuardianSet

Co-authored-by: Fernando Torres <fert1335@gmail.com>
2023-01-23 11:45:09 -03:00
walker-16 7255b214ca
18 fly api cache most recent data for most frequent queries (#51)
* Add use of sequence cache in API

* Add sequence cache in fly

* Deploy for API

* Improve use cache in API

* Remove sequence cache in fly for pythnet

Co-authored-by: Fernando Torres <fert1335@gmail.com>
2023-01-05 16:40:24 -03:00
walker-16 bfd68061a8
Fix: change sequence type to string (#42)
Co-authored-by: Fernando Torres <fert1335@gmail.com>
2022-12-14 16:26:45 -03:00
walker-16 bf8319bf10
Modify vaa count endpoint to use capped collection (#35) 2022-11-23 10:15:16 -03:00
walker-16 8ed4804d63
Feature/refactor api (#34)
* Refactor error handling and comments

* Refactor and improve error handling and logs
2022-11-23 09:06:29 -03:00