Skip to content
This repository was archived by the owner on Apr 3, 2023. It is now read-only.

Commit c04ef05

Browse files
committed
address feedback
1 parent 7e3e2fc commit c04ef05

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pyth-common-js/src/PriceServiceConnection.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,26 +150,27 @@ export class PriceServiceConnection {
150150
}
151151

152152
/**
153-
* Fetch VAA of given price id and publish time.
153+
* Fetch the earliest VAA of the given price id that is published since the given publish time.
154+
* This will throw an error if the given publish time is in the future, or if the price service does not have a db backend.
154155
* This will throw an axios error if there is a network problem or the price service returns a non-ok response (e.g: Invalid price id)
155156
*
156157
* This function is coupled to wormhole implemntation.
157158
*
158159
* @param priceId Hex-encoded price id.
159160
* @param publishTime Epoch timestamp in seconds.
160-
* @returns Base64 encoded VAAs.
161+
* @returns JSON object of VAA and publishTime.
161162
*/
162163
async getVaa(
163164
priceId: HexString,
164165
publishTime: EpochTimeStamp
165-
): Promise<string> {
166+
): Promise<[string, EpochTimeStamp]> {
166167
const response = await this.httpClient.get("/api/get_vaa", {
167168
params: {
168169
id: priceId,
169170
publish_time: publishTime,
170171
},
171172
});
172-
return response.data;
173+
return [response.data.vaa, response.data.publishTime];
173174
}
174175

175176
/**

0 commit comments

Comments
 (0)