import type { AccountMeta , Cluster , TransactionInstruction , } from "@solana/web3.js" ; import { PublicKey , Transaction } from "@solana/web3.js" ; /**
 * Instruction that can be serialized to JSON.
 */ export interface SerializableInstruction { programId : string ; keys : ( Omit < AccountMeta , "pubkey" > & { publicKey : string ; } ) [ ] ; data : string ; } /**
 * Stub of a recent blockhash that can be used to simulate transactions.
 */ export const RECENT_BLOCKHASH_STUB = "GfVcyD4kkTrj4bKc7WA9sZCin9JDbdT4Zkd3EittNR1W" ; param cluster param ixs returns export const buildStubbedTransaction = ( cluster , ixs ) : Transaction => { const tx = new Transaction ( ) ; tx . recentBlockhash = RECENT_BLOCKHASH_STUB ; tx . feePayer = cluster === "devnet" ? new PublicKey ( "A2jaCHPzD6346348JoEym2KFGX9A7uRBw6AhCdX7gTWP" ) : new PublicKey ( "9u9iZBWqGsp5hXBxkVZtBTuLSGNAG9gEQLgpuVw39ASg" ) ; tx . instructions = ixs ; return tx ; } ; /**
 * Serializes a  Transaction to base64 format without checking signatures.
 *  param tx returns export const serializeToBase64Unchecked = ( tx ) : string => tx . serialize ( { requireAllSignatures : false , verifySignatures : false , } ) . toString ( "base64" ) ; returns export const generateInspectLinkFromBase64 = ( cluster , base64TX ) : string => { return `https://${ cluster === "mainnet-beta" ? "" : `${ cluster }.` }anchor.so/tx/inspector?message=${ encodeURIComponent ( base64TX ) }` ; } ; returns export const generateUncheckedInspectLink = ( cluster , tx ) : string => { return generateInspectLinkFromBase64 ( cluster , serializeToBase64Unchecked ( tx ) ) ; } ;