You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: extract shared VAA instruction building into generateVaaInstructionGroups, allowing for flexible ix ordering and batching while sharing core logic
Copy file name to clipboardExpand all lines: target_chains/solana/sdk/js/pyth_solana_receiver/src/PythSolanaReceiver.ts
+17-87Lines changed: 17 additions & 87 deletions
Original file line number
Diff line number
Diff line change
@@ -40,9 +40,9 @@ import {
40
40
}from"./compute_budget";
41
41
import{Wallet}from"@coral-xyz/anchor";
42
42
import{
43
-
buildEncodedVaaCreateInstruction,
43
+
buildCloseEncodedVaaInstruction,
44
+
buildPostEncodedVaaInstructions,
44
45
buildPostEncodedVaasForTwapInstructions,
45
-
buildWriteEncodedVaaWithSplitInstructions,
46
46
findEncodedVaaAccountsByWriteAuthority,
47
47
getGuardianSetIndex,
48
48
trimSignatures,
@@ -549,77 +549,6 @@ export class PythSolanaReceiver {
549
549
};
550
550
}
551
551
552
-
/**
553
-
* Build a series of helper instructions that post a VAA in an encoded VAA account. This function is bespoke for posting Pyth VAAs and might not work for other usecases.
554
-
*
555
-
* @param vaa a Wormhole VAA
556
-
* @returns `postInstructions`: the instructions to post the VAA
557
-
* @returns `encodedVaaAddress`: the address of the encoded VAA account where the VAA will be posted
558
-
* @returns `closeInstructions`: the instructions to close the encoded VAA account
* Build a series of helper instructions that post price updates to the Pyth Solana Receiver program and another series to close the encoded vaa accounts and the price update accounts.
625
554
*
@@ -859,20 +788,19 @@ export class PythSolanaReceiver {
859
788
}
860
789
861
790
/**
862
-
* Build an instruction to close an encoded VAA account, recovering the rent.
791
+
* Build a series of helper instructions that post a VAA in an encoded VAA account. This function is bespoke for posting Pyth VAAs and might not work for other usecases.
792
+
*
793
+
* @param vaa a Wormhole VAA
794
+
* @returns `encodedVaaAddress`: the address of the encoded VAA account where the VAA will be posted
795
+
* @returns `postInstructions`: the instructions to post the VAA
796
+
* @returns `closeInstructions`: the instructions to close the encoded VAA account
0 commit comments