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 a65f121 commit 9e5dc77Copy full SHA for 9e5dc77
governance/pyth_staking_sdk/src/pyth-staking-client.ts
@@ -250,7 +250,20 @@ export class PythStakingClient {
250
stakeAccountPositions: PublicKey,
251
amount: bigint,
252
) {
253
- const instructions = [];
+ const globalConfig = await this.getGlobalConfig();
254
+ const instructions: TransactionInstruction[] = [];
255
+
256
+ if (!(await this.hasGovernanceRecord(globalConfig))) {
257
+ await withCreateTokenOwnerRecord(
258
+ instructions,
259
+ GOVERNANCE_ADDRESS,
260
+ PROGRAM_VERSION_V2,
261
+ globalConfig.pythGovernanceRealm,
262
+ this.wallet.publicKey,
263
+ globalConfig.pythTokenMint,
264
265
+ );
266
+ }
267
268
if (!(await this.hasJoinedDaoLlc(stakeAccountPositions))) {
269
instructions.push(
0 commit comments