1
1
// This script finds the fillStatus (fillStatus + event) from a provided fillStatusPda.
2
2
import * as anchor from "@coral-xyz/anchor" ;
3
3
import { AnchorProvider , BN , Program } from "@coral-xyz/anchor" ;
4
- import { address , createSolanaRpc } from "@solana/kit" ;
4
+ import { address , createSolanaRpc , createSolanaRpcSubscriptions } from "@solana/kit" ;
5
5
import yargs from "yargs" ;
6
6
import { hideBin } from "yargs/helpers" ;
7
7
import { SvmSpokeIdl } from "../../src/svm" ;
@@ -23,10 +23,14 @@ async function findFillStatusFromFillStatusPda(): Promise<void> {
23
23
const fillStatusPda = address ( resolvedArgv . fillStatusPda ) ;
24
24
25
25
console . log ( `Looking for Fill Event for Fill Status PDA: ${ fillStatusPda . toString ( ) } ` ) ;
26
+ const { rpcEndpoint } = provider . connection ;
27
+ const rpc = createSolanaRpc ( rpcEndpoint ) ;
28
+ const rpcSubscriptions = createSolanaRpcSubscriptions (
29
+ rpcEndpoint . replace ( / ^ h t t p ( s ? ) : \/ \/ / i, ( _m , s ) => `ws${ s ?? "" } ://` )
30
+ ) ;
26
31
27
- const rpc = createSolanaRpc ( provider . connection . rpcEndpoint ) ;
28
32
const { event, slot } = await readFillEventFromFillStatusPda (
29
- rpc ,
33
+ { rpc, rpcSubscriptions } ,
30
34
fillStatusPda ,
31
35
address ( resolvedArgv . programId ) ,
32
36
SvmSpokeIdl
0 commit comments