i am using
split_and_transferfunction ofpaymodule i am using multisig account for this transaction i am getting this errorVMVerificationOrDeserializationErrorwhile doing it thorughjs-sdkit works fine on CLI ? what can be root cause of this error? i am using js-sdk version 1.2.0
2 Likes
When signing from a multisig address, the process is
- building the transaction using
setSender(multisigAddr) - assembling signatures of the participants of the multisig and possibly the gas-owner/sponsor if any.
- executing the transaction passing the transaction bytes and above signatures with
SuiClient.executeTransactionBlock.
Do you have a code snippet we can maybe debug?
sa.
1 Like
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 Like
- I assume the
addressyou use is the multisig address, correct? - 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 useMultisigPublicKey.combinePartialSignatures()as here
1 Like