File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
target_chains/aptos/sdk/js/src Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11import {
22 PriceServiceConnection ,
33 HexString ,
4+ PriceFeed ,
45} from "@pythnetwork/price-service-sdk" ;
56import { BCS } from "aptos" ;
67import { Buffer } from "buffer" ;
@@ -14,9 +15,12 @@ export class AptosPriceServiceConnection extends PriceServiceConnection {
1415 * @returns Array of price update data.
1516 */
1617 async getPriceFeedsUpdateData ( priceIds : HexString [ ] ) : Promise < number [ ] [ ] > {
17- // Fetch the latest price feed update VAAs from the price service
18- const latestVaas = await this . getLatestVaas ( priceIds ) ;
19- return latestVaas . map ( ( vaa ) => Array . from ( Buffer . from ( vaa , "base64" ) ) ) ;
18+ // Fetch the latest price feeds from the price service
19+ const priceFeeds : PriceFeed [ ] = await this . getLatestPriceFeeds ( priceIds ) ;
20+ return priceFeeds
21+ . map ( ( feed : PriceFeed ) => feed . getVAA ( ) )
22+ . filter ( ( vaa : string | undefined ) : vaa is string => vaa !== undefined )
23+ . map ( ( vaa : string ) => Array . from ( Buffer . from ( vaa , "base64" ) ) ) ;
2024 }
2125
2226 /**
Original file line number Diff line number Diff line change 1- export { AptosPriceServiceConnection } from "./AptosPriceServiceConnection" ;
1+ export { AptosPriceServiceConnection } from "./AptosPriceServiceConnection.js " ;
22
33export {
44 DurationInMs ,
77 PriceFeed ,
88 PriceServiceConnectionConfig ,
99 UnixTimestamp ,
10- } from "@pythnetwork/price-service-client " ;
10+ } from "@pythnetwork/price-service-sdk " ;
You can’t perform that action at this time.
0 commit comments