Commit Graph

25 Commits

Author SHA1 Message Date
walker-16 f4fe630623
Add methods to identify kujira & evmos (#729)
* Add methods to identify kujira & evmos

* Add fetch methods to kajira and evmos

* fix fetch kujira and evmos methods

* Add support to search vaas gateway chain txHash

* Add deploy config to tx-tracker for evmos & kujira
2023-10-26 19:34:00 -03:00
agodnic 0f1797e44a
[API] Add `toChain` filter to `GET /api/v1/vaas/{emitterChain}/{emitterAddr}` (#598)
### 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})`
2023-08-01 16:38:34 -03:00
agodnic 80280da757
Handle multiple VAAs with the same `txHash` (#564)
### 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
2023-07-20 16:37:45 -03:00
agodnic 0425a89e75
Fix `parsedPayload` param in `GET /api/v1/vaas` (#536)
Fix `parsedPayload` param in `GET /api/v1/vaas`
2023-07-13 15:17:09 -03:00
agodnic 5aedf0247e
Fix issue in `txHash` search (#494)
### Description

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/493

Fix an issue in which transaction hash search was failing for VAAs that have the same `txHash`.
2023-07-04 09:58:21 -03:00
agodnic 98ae127278
[API] Expose emitter native addresses (#466)
### 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`
2023-06-28 14:54:51 -03:00
agodnic 5663fed0c9
Fix transaction hash search for Aptos (#461)
### Description

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/430

In `GET /api/v1/vaas?txHash={hash}`, searching for Aptos VAAs by transaction hash was not working correctly. This pull request fixes the issue.
2023-06-27 10:12:32 -03:00
agodnic 532412077b
Fix `vaa.txHash` for Solana and Aptos (#443)
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.
2023-06-21 17:00:11 -03:00
agodnic 69ff71d440
Sort the output of `GET /api/v1/vaas` by timestamp (#267)
### Summary

The output of `GET /api/v1/vaas` was not being correctly sorted. This pull request changes the behavior so that the output will be sorted by the `timestamp` field.

Additionally, duplicated code was removed in the VAA code that handles queries.

Also, there was an unused query parameter `sortBy` which was being exposed but not used. Hence it was removed.

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/233
2023-04-28 10:18:07 -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
agodnic d0cf9cc04b
[API] Fix issue in VAA search filters (#211)
### Summary

Searching for VAAs with the `txHash` and the `parsedPayload` parameters simultaneously wasn't working correctly. This commit fixes the problem.

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/210
2023-03-27 16:14:38 -03:00
agodnic 93427d6dfc
[API] Fix serialization issue in HTTP responses (#204)
### Summary

Several endpoints related to VAAs and observations returned `null` when no results were found.

This commit changes the behavior to return `[]` instead, which is more ergonomic for users.

Endpoints affected:
- `GET /api/v1/observations/:chain`
- `GET /api/v1/observations/:chain/:emitter`
- `GET /api/v1/observations/:chain/:emitter/:sequence`
- `GET /api/v1/observations/:chain/:emitter/:sequence/:signer/:hash`
- `GET /api/v1/vaas/{chain_id}`
- `GET /api/v1/vaas/{chain_id}/{emitter}`
- `GET /api/v1/vaas/{chain_id}/{emitter}/{seq}`
2023-03-22 14:18:11 -03:00
agodnic e85fa82784
[API] Remove redundant checks (#150)
Remove redundant nil checks in `api/handlers/governor/repository.go`.
2023-02-10 15:57:11 -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
Gabriel Zimmermann b5e5ce73c5
Query pythnet collection for pyth chain id in api (#57)
* Query pythnet collection for pyth chain id in api

* Delete api/vq FindForPythnet endpoint

Co-authored-by: Agustin Pazos <agpazos85@gmail.com>
2023-01-18 12:33:26 -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