Skip to content

Commit 03d5821

Browse files
authored
Update create-stake-account.en.ts
using new place for getActivationStatus since original deprecated https://github.com/anza-xyz/solana-rpc-client-extensions
1 parent 7f42c6c commit 03d5821

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

code/staking/create-stake-account/create-stake-account.en.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
sendAndConfirmTransaction,
99
Lockup,
1010
} from "@solana/web3.js";
11+
import { getStakeActivation } from '@anza-xyz/solana-rpc-get-stake-activation';
1112

1213
(async () => {
1314
// Setup our connection and wallet
@@ -56,6 +57,7 @@ import {
5657
console.log(`Stake account balance: ${stakeBalance / LAMPORTS_PER_SOL} SOL`);
5758

5859
// Verify the status of our stake account. This will start as inactive and will take some time to activate.
59-
let stakeStatus = await connection.getStakeActivation(stakeAccount.publicKey);
60-
console.log(`Stake account status: ${stakeStatus.state}`);
60+
let stakeStatus = await getStakeActivation(connection, stakeAccount.publicKey);
61+
62+
console.log(`Stake account status: ${stakeStatus.status}`);
6163
})();

0 commit comments

Comments
 (0)