Skip to content

Commit

Permalink
style: fix prettier formatting issues
Browse files Browse the repository at this point in the history
Co-Authored-By: Jayant Krishnamurthy <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and Jayant Krishnamurthy committed Jan 17, 2025
1 parent 21b835b commit b9a8039
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions price_service/client/js/src/PriceServiceConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ export class PriceServiceConnection {

// Include VAA if binary flag is set
if (this.priceFeedRequestConfig.binary && response.data.binary?.data) {
const vaaIndex = response.data.parsed.findIndex((p: any) => p.id === item.id);
const vaaIndex = response.data.parsed.findIndex(
(p: any) => p.id === item.id
);
if (vaaIndex >= 0 && vaaIndex < response.data.binary.data.length) {
priceFeedJson.vaa = response.data.binary.data[vaaIndex];
}
Expand Down Expand Up @@ -208,7 +210,10 @@ export class PriceServiceConnection {
});

// Extract VAAs from binary data array
if (!response.data.binary?.data || !Array.isArray(response.data.binary.data)) {
if (
!response.data.binary?.data ||
!Array.isArray(response.data.binary.data)
) {
return [];
}

Expand Down Expand Up @@ -245,7 +250,9 @@ export class PriceServiceConnection {

// Extract VAA and publishTime from response
if (!response.data.binary?.data?.[0] || !response.data.parsed?.[0]) {
throw new Error("No VAA data found for the given price id and publish time");
throw new Error(
"No VAA data found for the given price id and publish time"
);
}

const vaa = response.data.binary.data[0];
Expand Down Expand Up @@ -287,7 +294,9 @@ export class PriceServiceConnection {

// Extract price feed from response
if (!response.data.parsed?.[0]) {
throw new Error("No price feed data found for the given price id and publish time");
throw new Error(
"No price feed data found for the given price id and publish time"
);
}

const priceFeedJson: any = {
Expand All @@ -297,7 +306,10 @@ export class PriceServiceConnection {
};

// Include metadata if verbose flag is set
if (this.priceFeedRequestConfig.verbose && response.data.parsed[0].metadata) {
if (
this.priceFeedRequestConfig.verbose &&
response.data.parsed[0].metadata
) {
priceFeedJson.metadata = response.data.parsed[0].metadata;
}

Expand Down

0 comments on commit b9a8039

Please sign in to comment.