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

Commit 21d4b66

Browse files
committed
Format
1 parent 2c30499 commit 21d4b66

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

pyth-aptos-js/src/AptosPriceServiceConnection.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ export class AptosPriceServiceConnection extends PriceServiceConnection {
1616
// Serialize the VAAs using BCS
1717
const serializer = new BCS.Serializer();
1818
serializer.serializeU32AsUleb128(latestVaas.length);
19-
latestVaas.forEach(vaa =>
20-
serializer.serializeBytes(Buffer.from(vaa, "base64")));
19+
latestVaas.forEach((vaa) =>
20+
serializer.serializeBytes(Buffer.from(vaa, "base64"))
21+
);
2122
return serializer.getBytes();
2223
}
2324
}

pyth-aptos-js/src/examples/AptosRelay.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ const argv = yargs(hideBin(process.argv))
2626
required: true,
2727
})
2828
.option("pyth-contract", {
29-
description:
30-
"Pyth contract address.",
29+
description: "Pyth contract address.",
3130
type: "string",
3231
required: true,
3332
})
@@ -41,19 +40,25 @@ const argv = yargs(hideBin(process.argv))
4140
async function run() {
4241
// Fetch the latest price feed update data from the Price Service
4342
const connection = new AptosPriceServiceConnection(argv.priceService);
44-
const priceFeedUpdateData = await connection.getPriceFeedsUpdateData(argv.priceIds as string[]);
43+
const priceFeedUpdateData = await connection.getPriceFeedsUpdateData(
44+
argv.priceIds as string[]
45+
);
4546

4647
// Update the Pyth Contract using this update data
4748
let sender = new AptosAccount(Buffer.from(process.env[APTOS_KEY]!, "hex"));
4849
const client = new AptosClient(argv.fullNode);
4950
let result = await client.generateSignSubmitWaitForTransaction(
5051
sender,
5152
new TxnBuilderTypes.TransactionPayloadEntryFunction(
52-
TxnBuilderTypes.EntryFunction.natural(argv.pythContract + "::pyth", "update_price_feeds_with_funder",
53-
[], [priceFeedUpdateData]
53+
TxnBuilderTypes.EntryFunction.natural(
54+
argv.pythContract + "::pyth",
55+
"update_price_feeds_with_funder",
56+
[],
57+
[priceFeedUpdateData]
5458
)
55-
));
56-
59+
)
60+
);
61+
5762
console.dir(result, { depth: null });
5863
}
5964

pyth-aptos-js/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ export {
99
PriceStatus,
1010
UnixTimestamp,
1111
} from "@pythnetwork/pyth-common-js";
12-

0 commit comments

Comments
 (0)