Migrating from MultisigCreate v1 to v2
Squads has recently made a new update to their program which introduced rent collection of account data for transactions that have been initiated through the Squads program.
Here's how to use the new Multisig Create V2 instruction.
Typescript
const creator = fundedKeypairExample();
const createKey = Keypair.generate();
const [multisigPda] = multisig.getMultisigPda({
createKey: createKey.publicKey,
});
const programConfigPda = getProgramConfigPda({})[0];
const programConfig =
await multisig.accounts.ProgramConfig.fromAccountAddress(
connection,
programConfigPda
);
const configTreasury = programConfig.treasury;
const tx = multisig.transactions.multisigCreateV2({
blockhash: (await connection.getLatestBlockhash()).blockhash,
treasury: configTreasury,
createKey: createKey.publicKey,
creator: creator.publicKey,
multisigPda,
configAuthority: null,
timeLock: 0,
threshold: 1,
rentCollector: null,
members: [
{
key: members.almighty.publicKey,
permissions: Permissions.all(),
},
{
key: members.almighty.publicKey,
permissions: Permissions.all(),
},
],
programId,
});
tx.sign([creator, createKey]);Rust
Last updated