symbol-sdk-typescript-javascript: Wrong cosigner when converting account to multisig account
I am following this https://nemtech.github.io/guides/account/converting-an-account-to-multisig.html to convert an account to a multisig account.
The transaction is announce successfully, but the wired part is at the Cosign the AggregateTransaction .
I am expecting Alice and Bob to consign the aggregate transaction, but non of them receive the aggregateBondedTransactions.
When I try to use the multisig account to consign it, and it did go through successfully. I am confuse.
This is how I cosign the aggregate transaction, and using multisig account went through:
accountHttp
.aggregateBondedTransactions(multisigAccount.publicAccount, new QueryParams(100))
.pipe(
mergeMap((_) => _),
filter((_) => _.transactionInfo !== undefined && _.transactionInfo.hash !== undefined &&
_.transactionInfo.hash === hash), // Filter transaction
toArray(),
)
.subscribe((transactions: AggregateTransaction[]) => {
console.log(transactions.length)
if (transactions.length) {
const transaction = transactions[0];
const cosignatureTransaction = CosignatureTransaction.create(transaction);
const signedCosignature = multisigAccount.signCosignatureTransaction(cosignatureTransaction);
transactionHttp.announceAggregateBondedCosignature(signedCosignature).subscribe(
() => {
console.log('Transaction cosigned and announced correctly');
}, (err) => {
console.log(err.response !== undefined ? err.response.text : err);
});
}
});
I am using below: “nem2-sdk”: “^0.13.1” “catapult-server”:“v0.5.0.1”
Related issue:
After signed by multisig account, I try to getMultisigAccountInfo:
accountHttp
.getMultisigAccountInfo(address)
.subscribe(accountInfo => console.log(accountInfo), err => console.error(err));
I get an error and undefined result:
body: MultisigAccountInfoDTO { multisig: undefined } }
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (12 by maintainers)
Commits related to this issue
- Fixed #245 #267 #268 — committed to rg911/symbol-sdk-typescript-javascript by rg911 5 years ago
Hi @kahwooi, thanks for sharing the complete code! After running the example several times, I didn’t manage either to get the aggregated bonded transaction modification from the cosignatory account. Core devs are informed, it will be necessary to make Alice and Bob receivers of the notification as well to make this feature more usable.
In the meanwhile, we will update the docs with a workaround. You can still opt-in the transaction with Alice and Bob profiles. How? Querying the transaction from the future multisig account partial channel. Here you have a code snippet you can use to opt-in ModifyMultisigModificationTransactions https://gist.github.com/dgarcia360/32c97c99c4c18e801421d352feba2ce6
To finish the use case presented, you will have to run the snippet twice: one setting Alice’s account as the
cosignatoryPrivateKeyand a second one with Bob’s account.@evias
can someone else pay for the hashlock ?Yes, this is possible. The code looks correct, it’s a docs + feature behaviour problem.Yes, what I say is that the message is already present on the
partialAddedchannel, but filtered out, since it is nottransactionHasSignerOrReceptor… but it could fullfill theaccountAddedToMultiSigcondition, as the implementation of that function suggests.Edit: I may have caused a confusion - I am talking about websocket listeners, not http api endpoints. Sorry about that 😉