-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
21 lines (18 loc) · 786 Bytes
/
index.ts
File metadata and controls
21 lines (18 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { PythStakingClient } from "@pythnetwork/staking-sdk";
import { PublicKey } from "@solana/web3.js";
import { Connection, clusterApiUrl } from "@solana/web3.js";
import { argv } from "node:process";
const main = async () => {
const walletPublicKey = new PublicKey(argv[2]);
const stakeAccount = new PublicKey(argv[3]);
const rewards = await new PythStakingClient({
connection: new Connection(clusterApiUrl("mainnet-beta")),
wallet: {
publicKey: walletPublicKey,
signAllTransactions: () => Promise.reject("Not implemented"),
signTransaction: () => Promise.reject("Not implemented")
}
}).getClaimableRewards(stakeAccount);
console.log("Claimable rewards: ", rewards.totalRewards);
}
main().catch((error: unknown) => console.error(error));