@@ -6,11 +6,11 @@ import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
66import { AccountType , parseProductData } from "@pythnetwork/client" ;
77import {
88 getPythClusterApiUrl ,
9- PythCluster ,
9+ type PythCluster ,
1010} from "@pythnetwork/client/lib/cluster" ;
1111import {
12- AccountMeta ,
13- Commitment ,
12+ type AccountMeta ,
13+ type Commitment ,
1414 ComputeBudgetProgram ,
1515 Connection ,
1616 Keypair ,
@@ -67,7 +67,7 @@ async function run() {
6767 ) [ 0 ] ;
6868 const executorKey : PublicKey = mapKey ( EMITTER ) ;
6969 const claimRecord =
70- await remoteExecutor . account . claimRecord . fetchNullable ( claimRecordAddress ) ;
70+ await remoteExecutor . account . claimRecord ? .fetchNullable ( claimRecordAddress ) ;
7171 let lastSequenceNumber : number = claimRecord
7272 ? ( claimRecord . sequence as BN ) . toNumber ( )
7373 : - 1 ;
@@ -78,13 +78,13 @@ async function run() {
7878 lastSequenceNumber += 1 ;
7979 console . log ( `Trying sequence number : ${ lastSequenceNumber } ` ) ;
8080
81- const response = await (
81+ const response = ( await (
8282 await fetch (
8383 `${ wormholeApi } /v1/signed_vaa/1/${ EMITTER . toBuffer ( ) . toString (
8484 "hex" ,
8585 ) } /${ lastSequenceNumber } `,
8686 )
87- ) . json ( ) ;
87+ ) . json ( ) ) as Partial < { code : number ; vaaBytes : string } > ;
8888
8989 if ( response . vaaBytes ) {
9090 const vaa = parseVaa ( Buffer . from ( response . vaaBytes , "base64" ) ) ;
@@ -144,19 +144,19 @@ async function run() {
144144 ) ,
145145 ) ;
146146 productAccountToSymbol [
147- parsedInstruction . accounts . named . productAccount . pubkey . toBase58 ( )
147+ parsedInstruction . accounts . named . productAccount ! . pubkey . toBase58 ( )
148148 ] = parsedInstruction . args . symbol ;
149149 } else if (
150150 parsedInstruction instanceof PythMultisigInstruction &&
151151 parsedInstruction . name == "addPrice"
152152 ) {
153153 const productAccount = await provider . connection . getAccountInfo (
154- parsedInstruction . accounts . named . productAccount . pubkey ,
154+ parsedInstruction . accounts . named . productAccount ! . pubkey ,
155155 ) ;
156156 const productSymbol = productAccount
157157 ? parseProductData ( productAccount . data ) . product . symbol
158158 : productAccountToSymbol [
159- parsedInstruction . accounts . named . productAccount . pubkey . toBase58 ( )
159+ parsedInstruction . accounts . named . productAccount ! . pubkey . toBase58 ( )
160160 ] ;
161161 if ( productSymbol ) {
162162 preInstructions . push (
@@ -187,7 +187,7 @@ async function run() {
187187
188188 try {
189189 await remoteExecutor . methods
190- . executePostedVaa ( )
190+ . executePostedVaa ?. ( )
191191 . accounts ( {
192192 claimRecord : claimRecordAddress ,
193193 postedVaa : derivePostedVaaKey (
0 commit comments