Skip to content

Instantly share code, notes, and snippets.

@belivenn
Last active July 8, 2025 21:29
Show Gist options
  • Select an option

  • Save belivenn/3f484afd6c10ec190f8f3b7fa171eaff to your computer and use it in GitHub Desktop.

Select an option

Save belivenn/3f484afd6c10ec190f8f3b7fa171eaff to your computer and use it in GitHub Desktop.
describe("anchor-vault-q3", () => {
// Helper function to log a message
const log = async (signature: string): Promise<string> => {
console.log(
`Your transaction signature: https://explorer.solana.com/transaction/${signature}?cluster=custom&customUrl=${connection.rpcEndpoint}\n`
);
return signature;
};
const confirmTx = async (signature: string) => {
const latestBlockhash = await anchor.getProvider().connection.getLatestBlockhash();
await anchor.getProvider().connection.confirmTransaction(
{
signature,
...latestBlockhash,
},
commitment
)
}
const confirmTxs = async (signatures: string[]) => {
await Promise.all(signatures.map(confirmTx))
}
const provider = anchor.AnchorProvider.env();
anchor.setProvider(provider);
const connection = provider.connection;
const program = anchor.workspace.Quest as Program<AnchorVaultQ3>;
// Helper function to log the transaction signature
const confirm = async (signature: string): Promise<string> => {
const block = await connection.getLatestBlockhash();
await connection.confirmTransaction({
signature,
...block,
});
await log(signature);
return signature;
};
...
etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment