This repository was archived by the owner on Apr 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -150,26 +150,27 @@ export class PriceServiceConnection {
150
150
}
151
151
152
152
/**
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.
154
155
* 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)
155
156
*
156
157
* This function is coupled to wormhole implemntation.
157
158
*
158
159
* @param priceId Hex-encoded price id.
159
160
* @param publishTime Epoch timestamp in seconds.
160
- * @returns Base64 encoded VAAs .
161
+ * @returns JSON object of VAA and publishTime .
161
162
*/
162
163
async getVaa (
163
164
priceId : HexString ,
164
165
publishTime : EpochTimeStamp
165
- ) : Promise < string > {
166
+ ) : Promise < [ string , EpochTimeStamp ] > {
166
167
const response = await this . httpClient . get ( "/api/get_vaa" , {
167
168
params : {
168
169
id : priceId ,
169
170
publish_time : publishTime ,
170
171
} ,
171
172
} ) ;
172
- return response . data ;
173
+ return [ response . data . vaa , response . data . publishTime ] ;
173
174
}
174
175
175
176
/**
You can’t perform that action at this time.
0 commit comments