Signing with multisig

i am using split_and_transfer function of pay module i am using multisig account for this transaction i am getting this error VMVerificationOrDeserializationError while doing it thorugh js-sdk it works fine on CLI ? what can be root cause of this error? i am using js-sdk version 1.2.0

1 Like

When signing from a multisig address, the process is

  1. building the transaction using setSender(multisigAddr)
  2. assembling signatures of the participants of the multisig and possibly the gas-owner/sponsor if any.
  3. executing the transaction passing the transaction bytes and above signatures with SuiClient.executeTransactionBlock.

Do you have a code snippet we can maybe debug?
sa.

try {
const tx: any = new Transaction();
const coins = await client.getCoins({
owner: address,
coinType: ‘0x2::sui::SUI’,
});
const […mergeCoins] = coins.data;
if (mergeCoins?.length) {
tx.moveCall({
target: 0x2::pay::split_and_transfer,
type: ‘0x2::sui::SUI’,
arguments: [
tx.object(mergeCoins[0]?.coinObjectId),
tx.pure(+values?.amount * 1000000000),
tx.pure(values?.recipentAddress),
],
});
tx.setSender(address);
tx.setGasBudget(10_000_000);
tx.setGasOwner(address);

    const { transactionBlockBytes, signature }: any = await signTransaction({
      transactionBlock: tx,
      chain: SUI_ENVIRONMENT,
    });

    getSignature(
      transactionBlockBytes,
      walletDeatils,
      'pay',
      'split_and_transfer',
      tabStatus,
      setTabStatus,
      setTransactions,
      signature,
    );
    setValue({ recipentAddress: '', amount: '' });
    setShowModal(false);
  }
} catch (e: any) {
  toast.error(e.message);
}
  1. I assume the address you use is the multisig address, correct?
  2. If signTransaction() uses a wallet to sign, I suppose it signs it with a simple address, not a multisig. If so, you need to do use MultisigPublicKey.combinePartialSignatures() as here