Cashmere
Search…
⌃K

Execute Transaction

Example code to programmatically approve a transaction
// fetch the transaction account holding the
// instruction to be executed
const txAccountRemainingAccounts = await multisigProgram.account.transaction.fetch(txAccountPublicKey);
​
// execute a signed transaction with the current provider wallet
await program.rpc.executeTransaction({
accounts: {
multisig: multisigPublicKey,
multisigSigner: multisigSigner,
transaction: txAccountPublicKey,
owner: provider.wallet.publicKey,
},
// the accounts that are needed by the instruction
// to be executed
// need to be in the correct order
remainingAccounts: txAccount.accounts,
signers: [provider.wallet.publicKey]
});
Last modified 10mo ago