Skip to content

Commit 1b5195a

Browse files
committed
fix: run turbo fix
This commit fixes formatting & linting issues caused by reconfiguring prettier & eslint in the prior commit
1 parent b1dc4c2 commit 1b5195a

File tree

211 files changed

+2495
-2439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+2495
-2439
lines changed

apps/hermes/client/js/src/HermesClient.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class HermesClient {
6363
schema: z.ZodSchema<ResponseData>,
6464
options?: RequestInit,
6565
retries = this.httpRetries,
66-
backoff = 100 + Math.floor(Math.random() * 100) // Adding randomness to the initial backoff to avoid "thundering herd" scenario where a lot of clients that get kicked off all at the same time (say some script or something) and fail to connect all retry at exactly the same time too
66+
backoff = 100 + Math.floor(Math.random() * 100), // Adding randomness to the initial backoff to avoid "thundering herd" scenario where a lot of clients that get kicked off all at the same time (say some script or something) and fail to connect all retry at exactly the same time too
6767
): Promise<ResponseData> {
6868
try {
6969
const response = await fetch(url, {
@@ -79,7 +79,7 @@ export class HermesClient {
7979
throw new Error(
8080
`HTTP error! status: ${response.status}${
8181
errorBody ? `, body: ${errorBody}` : ""
82-
}`
82+
}`,
8383
);
8484
}
8585
const data = await response.json();
@@ -124,7 +124,7 @@ export class HermesClient {
124124
return await this.httpRequest(
125125
url.toString(),
126126
schemas.PriceFeedMetadata.array(),
127-
fetchOptions
127+
fetchOptions,
128128
);
129129
}
130130

@@ -154,7 +154,7 @@ export class HermesClient {
154154
return await this.httpRequest(
155155
url.toString(),
156156
schemas.LatestPublisherStakeCapsUpdateDataResponse,
157-
fetchOptions
157+
fetchOptions,
158158
);
159159
}
160160

@@ -178,7 +178,7 @@ export class HermesClient {
178178
parsed?: boolean;
179179
ignoreInvalidPriceIds?: boolean;
180180
},
181-
fetchOptions?: RequestInit
181+
fetchOptions?: RequestInit,
182182
): Promise<PriceUpdate> {
183183
const url = this.buildURL("updates/price/latest");
184184
for (const id of ids) {
@@ -215,7 +215,7 @@ export class HermesClient {
215215
parsed?: boolean;
216216
ignoreInvalidPriceIds?: boolean;
217217
},
218-
fetchOptions?: RequestInit
218+
fetchOptions?: RequestInit,
219219
): Promise<PriceUpdate> {
220220
const url = this.buildURL(`updates/price/${publishTime}`);
221221
for (const id of ids) {
@@ -255,7 +255,7 @@ export class HermesClient {
255255
allowUnordered?: boolean;
256256
benchmarksOnly?: boolean;
257257
ignoreInvalidPriceIds?: boolean;
258-
}
258+
},
259259
): Promise<EventSource> {
260260
const url = this.buildURL("updates/price/stream");
261261
ids.forEach((id) => {
@@ -302,7 +302,7 @@ export class HermesClient {
302302
parsed?: boolean;
303303
ignoreInvalidPriceIds?: boolean;
304304
},
305-
fetchOptions?: RequestInit
305+
fetchOptions?: RequestInit,
306306
): Promise<TwapsResponse> {
307307
const url = this.buildURL(`updates/twap/${window_seconds}/latest`);
308308
for (const id of ids) {
@@ -317,13 +317,13 @@ export class HermesClient {
317317
return this.httpRequest(
318318
url.toString(),
319319
schemas.TwapsResponse,
320-
fetchOptions
320+
fetchOptions,
321321
);
322322
}
323323

324324
private appendUrlSearchParams(
325325
url: URL,
326-
params: Record<string, string | boolean>
326+
params: Record<string, string | boolean>,
327327
) {
328328
Object.entries(params).forEach(([key, value]) => {
329329
if (value !== undefined) {
@@ -337,7 +337,7 @@ export class HermesClient {
337337
`./v2/${endpoint}`,
338338
// We ensure the `baseURL` ends with a `/` so that URL doesn't resolve the
339339
// path relative to the parent.
340-
`${this.baseURL}${this.baseURL.endsWith("/") ? "" : "/"}`
340+
`${this.baseURL}${this.baseURL.endsWith("/") ? "" : "/"}`,
341341
);
342342
}
343343
}

apps/hermes/client/js/src/examples/HermesClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function extractBasicAuthorizationHeadersFromUrl(urlString: string): {
4343

4444
if (url.username && url.password) {
4545
headers["Authorization"] = `Basic ${btoa(
46-
`${url.username}:${url.password}`
46+
`${url.username}:${url.password}`,
4747
)}`;
4848
url.username = "";
4949
url.password = "";
@@ -54,7 +54,7 @@ function extractBasicAuthorizationHeadersFromUrl(urlString: string): {
5454

5555
async function run() {
5656
const { endpoint, headers } = extractBasicAuthorizationHeadersFromUrl(
57-
argv.endpoint
57+
argv.endpoint,
5858
);
5959
const connection = new HermesClient(endpoint, { headers });
6060

apps/hermes/client/js/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function camelToSnakeCase(str: string): string {
33
}
44

55
export function camelToSnakeCaseObject(
6-
obj: Record<string, string | boolean>
6+
obj: Record<string, string | boolean>,
77
): Record<string, string | boolean> {
88
const result: Record<string, string | boolean> = {};
99
Object.keys(obj).forEach((key) => {

apps/price_pusher/src/aptos/aptos.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class AptosPriceListener extends ChainPriceListener {
1717
private logger: Logger,
1818
config: {
1919
pollingFrequency: DurationInSeconds;
20-
}
20+
},
2121
) {
2222
super(config.pollingFrequency, priceItems);
2323
}
@@ -27,7 +27,7 @@ export class AptosPriceListener extends ChainPriceListener {
2727

2828
const res = await client.getAccountResource(
2929
this.pythModule,
30-
`${this.pythModule}::state::LatestPriceInfo`
30+
`${this.pythModule}::state::LatestPriceInfo`,
3131
);
3232

3333
try {
@@ -50,8 +50,8 @@ export class AptosPriceListener extends ChainPriceListener {
5050

5151
this.logger.debug(
5252
`Polled an Aptos on-chain price for feed ${this.priceIdToAlias.get(
53-
priceId
54-
)} (${priceId}).`
53+
priceId,
54+
)} (${priceId}).`,
5555
);
5656

5757
return {
@@ -62,7 +62,7 @@ export class AptosPriceListener extends ChainPriceListener {
6262
} catch (err) {
6363
this.logger.error(
6464
err,
65-
`Polling Aptos on-chain price for ${priceId} failed.`
65+
`Polling Aptos on-chain price for ${priceId} failed.`,
6666
);
6767
return undefined;
6868
}
@@ -94,7 +94,7 @@ export class AptosPricePusher implements IPricePusher {
9494
private pythContractAddress: string,
9595
private endpoint: string,
9696
private mnemonic: string,
97-
private overrideGasPriceMultiplier: number
97+
private overrideGasPriceMultiplier: number,
9898
) {
9999
this.sequenceNumberLocked = false;
100100
}
@@ -111,13 +111,13 @@ export class AptosPricePusher implements IPricePusher {
111111
encoding: "base64",
112112
});
113113
return response.binary.data.map((data) =>
114-
Array.from(Buffer.from(data, "base64"))
114+
Array.from(Buffer.from(data, "base64")),
115115
);
116116
}
117117

118118
async updatePriceFeed(
119119
priceIds: string[],
120-
pubTimesToPush: number[]
120+
pubTimesToPush: number[],
121121
): Promise<void> {
122122
if (priceIds.length === 0) {
123123
return;
@@ -137,7 +137,7 @@ export class AptosPricePusher implements IPricePusher {
137137

138138
const account = AptosAccount.fromDerivePath(
139139
APTOS_ACCOUNT_HD_PATH,
140-
this.mnemonic
140+
this.mnemonic,
141141
);
142142
const client = new AptosClient(this.endpoint);
143143

@@ -151,7 +151,7 @@ export class AptosPricePusher implements IPricePusher {
151151
},
152152
{
153153
sequence_number: sequenceNumber.toFixed(),
154-
}
154+
},
155155
);
156156

157157
try {
@@ -160,7 +160,7 @@ export class AptosPricePusher implements IPricePusher {
160160

161161
this.logger.debug(
162162
{ hash: pendingTx.hash },
163-
"Successfully broadcasted tx."
163+
"Successfully broadcasted tx.",
164164
);
165165

166166
// Sometimes broadcasted txs don't make it on-chain and they cause our sequence number
@@ -183,7 +183,7 @@ export class AptosPricePusher implements IPricePusher {
183183
// Wait for the transaction to be confirmed. If it fails, reset the sequence number.
184184
private async waitForTransactionConfirmation(
185185
client: AptosClient,
186-
txHash: string
186+
txHash: string,
187187
): Promise<void> {
188188
try {
189189
await client.waitForTransaction(txHash, {
@@ -195,7 +195,7 @@ export class AptosPricePusher implements IPricePusher {
195195
} catch (err) {
196196
this.logger.error(
197197
{ err, hash: txHash },
198-
`Transaction failed to confirm.`
198+
`Transaction failed to confirm.`,
199199
);
200200

201201
this.lastSequenceNumber = undefined;
@@ -207,7 +207,7 @@ export class AptosPricePusher implements IPricePusher {
207207
// the blockchain itself (and caches it for later).
208208
private async tryGetNextSequenceNumber(
209209
client: AptosClient,
210-
account: AptosAccount
210+
account: AptosAccount,
211211
): Promise<number> {
212212
if (this.lastSequenceNumber !== undefined) {
213213
this.lastSequenceNumber += 1;
@@ -220,10 +220,10 @@ export class AptosPricePusher implements IPricePusher {
220220
try {
221221
this.sequenceNumberLocked = true;
222222
this.lastSequenceNumber = Number(
223-
(await client.getAccount(account.address())).sequence_number
223+
(await client.getAccount(account.address())).sequence_number,
224224
);
225225
this.logger.debug(
226-
`Fetched account sequence number: ${this.lastSequenceNumber}`
226+
`Fetched account sequence number: ${this.lastSequenceNumber}`,
227227
);
228228
return this.lastSequenceNumber;
229229
} catch (e: any) {

apps/price_pusher/src/aptos/command.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default {
6464
const mnemonic = fs.readFileSync(mnemonicFile, "utf-8").trim();
6565
const account = AptosAccount.fromDerivePath(
6666
APTOS_ACCOUNT_HD_PATH,
67-
mnemonic
67+
mnemonic,
6868
);
6969
logger.info(`Pushing from account address: ${account.address()}`);
7070

@@ -78,7 +78,7 @@ export default {
7878
logger.error(
7979
`Invalid price id submitted for: ${invalidPriceItems
8080
.map(({ alias }) => alias)
81-
.join(", ")}`
81+
.join(", ")}`,
8282
);
8383
}
8484

@@ -87,15 +87,15 @@ export default {
8787
const pythListener = new PythPriceListener(
8888
hermesClient,
8989
priceItems,
90-
logger.child({ module: "PythPriceListener" })
90+
logger.child({ module: "PythPriceListener" }),
9191
);
9292

9393
const aptosListener = new AptosPriceListener(
9494
pythContractAddress,
9595
endpoint,
9696
priceItems,
9797
logger.child({ module: "AptosPriceListener" }),
98-
{ pollingFrequency }
98+
{ pollingFrequency },
9999
);
100100

101101
const aptosPusher = new AptosPricePusher(
@@ -104,7 +104,7 @@ export default {
104104
pythContractAddress,
105105
endpoint,
106106
mnemonic,
107-
overrideGasPriceMultiplier
107+
overrideGasPriceMultiplier,
108108
);
109109

110110
const controller = new Controller(
@@ -113,7 +113,7 @@ export default {
113113
aptosListener,
114114
aptosPusher,
115115
logger.child({ module: "Controller" }, { level: controllerLogLevel }),
116-
{ pushingFrequency }
116+
{ pushingFrequency },
117117
);
118118

119119
controller.start();

apps/price_pusher/src/controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class Controller {
1414
private logger: Logger,
1515
config: {
1616
pushingFrequency: DurationInSeconds;
17-
}
17+
},
1818
) {
1919
this.pushingFrequency = config.pushingFrequency;
2020
}
@@ -48,7 +48,7 @@ export class Controller {
4848
priceConfig,
4949
sourceLatestPrice,
5050
targetLatestPrice,
51-
this.logger
51+
this.logger,
5252
);
5353
if (priceShouldUpdate == UpdateCondition.YES) {
5454
pushThresholdMet = true;
@@ -70,7 +70,7 @@ export class Controller {
7070
alias: priceConfig.alias,
7171
})),
7272
},
73-
"Some of the checks triggered pushing update. Will push the updates for some feeds."
73+
"Some of the checks triggered pushing update. Will push the updates for some feeds.",
7474
);
7575

7676
// note that the priceIds are without leading "0x"

apps/price_pusher/src/evm/command.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default {
125125
logger.error(
126126
`Invalid price id submitted for: ${invalidPriceItems
127127
.map(({ alias }) => alias)
128-
.join(", ")}`
128+
.join(", ")}`,
129129
);
130130
}
131131

@@ -134,14 +134,14 @@ export default {
134134
const pythListener = new PythPriceListener(
135135
hermesClient,
136136
priceItems,
137-
logger.child({ module: "PythPriceListener" })
137+
logger.child({ module: "PythPriceListener" }),
138138
);
139139

140140
const client = await createClient(endpoint, mnemonic);
141141
const pythContract = createPythContract(client, pythContractAddress);
142142

143143
logger.info(
144-
`Pushing updates from wallet address: ${client.account.address}`
144+
`Pushing updates from wallet address: ${client.account.address}`,
145145
);
146146

147147
// It is possible to watch the events in the non-ws endpoints, either by getFilter
@@ -156,13 +156,13 @@ export default {
156156
logger.child({ module: "EvmPriceListener" }),
157157
{
158158
pollingFrequency,
159-
}
159+
},
160160
);
161161

162162
const gasStation = getCustomGasStation(
163163
logger.child({ module: "CustomGasStation" }),
164164
customGasStation,
165-
txSpeed
165+
txSpeed,
166166
);
167167
const evmPusher = new EvmPricePusher(
168168
hermesClient,
@@ -174,7 +174,7 @@ export default {
174174
updateFeeMultiplier,
175175
gasLimit,
176176
gasStation,
177-
gasPrice
177+
gasPrice,
178178
);
179179

180180
const controller = new Controller(
@@ -183,7 +183,7 @@ export default {
183183
evmListener,
184184
evmPusher,
185185
logger.child({ module: "Controller" }, { level: controllerLogLevel }),
186-
{ pushingFrequency }
186+
{ pushingFrequency },
187187
);
188188

189189
controller.start();

0 commit comments

Comments
 (0)