We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5fda4b commit a484bf0Copy full SHA for a484bf0
governance/pyth_staking_sdk/src/utils/clock.ts
@@ -3,11 +3,12 @@ import { Connection } from "@solana/web3.js";
3
import { EPOCH_DURATION } from "../constants";
4
5
export const getCurrentSolanaTimestamp = async (connection: Connection) => {
6
- const slot = await connection.getSlot();
+ const slot = await connection.getSlot("finalized");
7
const blockTime = await connection.getBlockTime(slot);
8
if (blockTime === null) {
9
throw new Error("Block time is not available");
10
}
11
+
12
return BigInt(blockTime);
13
};
14
0 commit comments