Trying to convert account to multisig account. Would like to do co-signing at cosigner device:
After listen to the bonded transaction:
listener
.aggregateBondedAdded(multisigAccount.address)
.pipe(
filter(
transaction =>
transaction.transactionInfo !== undefined && transaction.transactionInfo.hash === signedTransaction.hash,
),
)
.subscribe(
transaction => {
console.log(JSON.stringify(transaction)); // Use this?
console.log(transaction.serialize()); // or use this?
Then how do I sign it at co-signer device?
I tried this:
const cosignAggregateBondedTransaction = (transaction: AggregateTransaction, account: Account): CosignatureSignedTransaction => {
const cosignatureSignedTransaction = CosignatureTransaction.create(transaction);
return account.signCosignatureTransaction(cosignatureSignedTransaction);
}
but how can I convert the serialize transaction to AggregateTransaction?
Then I tried this, but not working, dont’t know if I use the right function to do it:
const hash = '7B25CD68A3D6837941D4E0C2A48A0C680B842C013A6C140DD53B0049C8590D45';
const txSerialize = 'E9000000CA054D47A726CAA0......; // result from transaction.serialize()
const signed = CosignatureTransaction.signTransactionPayload(acocunt, txSerialize , hash);
** Just to add, the cosinger device is not directly connected to the NEM2 blockchain. So it is signed at device using the private key, and then send to a server and continue to announce the transaction from the server.