1- import { Program , BN , Idl } from "@coral-xyz/anchor" ;
1+ import { Program , BN , type Idl } from "@coral-xyz/anchor" ;
22import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet" ;
3- import { Wallet } from "@coral-xyz/anchor/dist/cjs/provider" ;
3+ import type { Wallet } from "@coral-xyz/anchor/dist/cjs/provider" ;
44import { TOKEN_PROGRAM_ID } from "@coral-xyz/anchor/dist/cjs/utils/token" ;
55import {
66 pythOracleProgram ,
7- PythHttpClient ,
87 parseBaseData ,
98 AccountType ,
109 parsePriceData ,
1110} from "@pythnetwork/client" ;
1211import {
13- PythCluster ,
12+ type PythCluster ,
1413 getPythClusterApiUrl ,
1514 getPythProgramKeyForCluster ,
1615} from "@pythnetwork/client/lib/cluster" ;
@@ -20,7 +19,7 @@ import {
2019 getMint ,
2120} from "@solana/spl-token" ;
2221import {
23- AccountMeta ,
22+ type AccountMeta ,
2423 Connection ,
2524 Keypair ,
2625 LAMPORTS_PER_SOL ,
@@ -65,7 +64,6 @@ import {
6564 DEFAULT_PRIORITY_FEE_CONFIG ,
6665 TransactionBuilder ,
6766} from "@pythnetwork/solana-utils" ;
68- import { bs58 } from "@coral-xyz/anchor/dist/cjs/utils/bytes" ;
6967
7068export async function loadHotWalletOrLedger (
7169 wallet : string ,
@@ -170,7 +168,7 @@ multisigCommand(
170168 ) [ 0 ] ;
171169
172170 const proposalInstruction = await programAuthorityEscrow . methods
173- . accept ( )
171+ . accept ?. ( )
174172 . accounts ( {
175173 currentAuthority : current ,
176174 newAuthority : await vault . getVaultAuthorityPDA ( targetCluster ) ,
@@ -180,11 +178,13 @@ multisigCommand(
180178 } )
181179 . instruction ( ) ;
182180
183- await vault . proposeInstructions (
184- [ proposalInstruction ] ,
185- targetCluster ,
186- DEFAULT_PRIORITY_FEE_CONFIG ,
187- ) ;
181+ if ( proposalInstruction ) {
182+ await vault . proposeInstructions (
183+ [ proposalInstruction ] ,
184+ targetCluster ,
185+ DEFAULT_PRIORITY_FEE_CONFIG ,
186+ ) ;
187+ }
188188 } ) ;
189189
190190multisigCommand (
@@ -423,7 +423,7 @@ multisigCommand(
423423 . map ( ( stakeAccounts , index ) => {
424424 if ( stakeAccounts . length === 0 ) {
425425 console . log (
426- `Skipping vote account ${ voteAccounts [ index ] . toBase58 ( ) } - no stake accounts found` ,
426+ `Skipping vote account ${ voteAccounts [ index ] ? .toBase58 ( ) } - no stake accounts found` ,
427427 ) ;
428428 }
429429 return stakeAccounts ;
@@ -444,7 +444,7 @@ multisigCommand(
444444
445445 console . log (
446446 "Successfully proposed at: https://proposals.pyth.network/?tab=proposals&proposal=" +
447- proposalAddresses [ 0 ] . toBase58 ( ) ,
447+ proposalAddresses [ 0 ] ? .toBase58 ( ) ,
448448 ) ;
449449 } ) ;
450450
@@ -551,7 +551,7 @@ multisigCommand(
551551 stakePubkey,
552552 authorizedPubkey,
553553 votePubkey,
554- } ) . instructions [ 0 ] ,
554+ } ) . instructions [ 0 ] ! ,
555555 ) ;
556556 }
557557
@@ -564,7 +564,7 @@ multisigCommand(
564564 // This should be a single proposal normally
565565 console . log (
566566 "Successfully proposed at: https://proposals.pyth.network/?tab=proposals&proposal=" +
567- proposalAddresses [ 0 ] . toBase58 ( ) ,
567+ proposalAddresses [ 0 ] ? .toBase58 ( ) ,
568568 ) ;
569569 } ) ;
570570
@@ -750,7 +750,7 @@ program
750750 console . log (
751751 JSON . stringify (
752752 parsed ,
753- ( key , value ) => ( typeof value === "bigint" ? value . toString ( ) : value ) , // return everything else unchanged
753+ ( _ , value ) => ( typeof value === "bigint" ? value . toString ( ) : value ) , // return everything else unchanged
754754 2 ,
755755 ) ,
756756 ) ;
@@ -975,18 +975,20 @@ multisigCommand(
975975
976976 // Use Anchor to create the instruction
977977 const updateInstruction = await lazerProgram . methods
978- . update ( trustedSigner , expiryTime )
978+ . update ?. ( trustedSigner , expiryTime )
979979 . accounts ( {
980980 topAuthority : await vault . getVaultAuthorityPDA ( targetCluster ) ,
981981 storage : new PublicKey ( SOLANA_LAZER_STORAGE_ID ) ,
982982 } )
983983 . instruction ( ) ;
984984
985- await vault . proposeInstructions (
986- [ updateInstruction ] ,
987- targetCluster ,
988- DEFAULT_PRIORITY_FEE_CONFIG ,
989- ) ;
985+ if ( updateInstruction ) {
986+ await vault . proposeInstructions (
987+ [ updateInstruction ] ,
988+ targetCluster ,
989+ DEFAULT_PRIORITY_FEE_CONFIG ,
990+ ) ;
991+ }
990992 } ) ;
991993
992994multisigCommand (
@@ -1045,18 +1047,20 @@ multisigCommand(
10451047
10461048 // Use Anchor to create the instruction
10471049 const updateSignerInstruction = await lazerProgram . methods
1048- . updateEcdsaSigner ( trustedSigner , expiryTime )
1050+ . updateEcdsaSigner ?. ( trustedSigner , expiryTime )
10491051 . accounts ( {
10501052 topAuthority : await vault . getVaultAuthorityPDA ( targetCluster ) ,
10511053 storage : new PublicKey ( SOLANA_LAZER_STORAGE_ID ) ,
10521054 } )
10531055 . instruction ( ) ;
10541056
1055- await vault . proposeInstructions (
1056- [ upgradeInstruction , updateSignerInstruction ] ,
1057- targetCluster ,
1058- DEFAULT_PRIORITY_FEE_CONFIG ,
1059- ) ;
1057+ if ( updateSignerInstruction ) {
1058+ await vault . proposeInstructions (
1059+ [ upgradeInstruction , updateSignerInstruction ] ,
1060+ targetCluster ,
1061+ DEFAULT_PRIORITY_FEE_CONFIG ,
1062+ ) ;
1063+ }
10601064 } ) ;
10611065
10621066program . parse ( ) ;
0 commit comments