Developers can create multisig wallets using the SDK. This functionality enables the setup of wallets with multiple signatories, enhancing the security and decentralization of fund management.
Note: createMultisig will only create a multisig you need to do a existential deposite to onchain your multisig wallet
// To create a multisig wallet, a minimum of two signatories and a threshold of two are required.
// The signatories can be other user addresses participating in the multisig setup.
// Threshold represents the minimum number of approvals required from the signatories to send a transaction
const signatories = ['...', '...', '...'] // Array of substrate address
const threshold = 2 // number
const multisigName = 'Polka Multisig'
const { data, error } = await client.createMultisig(signatories, threshold, multisigName);
if (data){
console.log(data)
// use your data
}
else if(error){
console.log(error)
}