Multi-Transaction Signing for SignTransaction#551
Open
Conversation
Add TransactionData type and extend SignTransactionRequestStandard to accept either inline single-tx fields or a transactions array. Return type now includes SignTransactionResults for multi-tx responses.
Support signing multiple transactions in a single request, with both TransactionData[] and serialized Uint8Array[] formats. Staking transactions are signed using KeyPair.derive + transaction.sign() instead of manual SignatureProof construction. Adds a multi-transaction UI with per-transaction cards, totals, and a "Confirm transactions" button variant.
Add translation keys for multi-tx heading, transaction count, total fees label, and "Confirm transactions".
Rework the demo page to support inline, single-array, and multi-array request formats with configurable transaction count and amounts.
- Remove unused `parsedRequest.plain` assignment in SignTransactionApi - Remove staking-specific field parsing (validatorAddress, validatorImageUrl, amount) that was not on any type and unused by the handler - Fix Parsed type for Checkout/Cashlink to map `transaction` → `transactions` matching what the parser actually produces - Make transaction count text reactive to language changes - Remove unused `.tx-label` CSS rule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SignTransactionrequest to accept multiple transactions (TransactionData[]orUint8Array[]) that are signed with a single password entry, enabling batch operations like combined staking + transfer flowsSignTransactionResult; only multi-item arrays returnSignTransactionResultsChanges
Client types (
client/src/PublicRequest.ts)TransactionDatatype (TransactionInfowithoutkeyPath, sincekeyPathlives at request level)SignTransactionRequestStandardnow accepts either inlineTransactionDatafields or a{ transactions: TransactionData[] | Uint8Array[] }objectSignTransactionResultsarray type;ResultTypeandResultByCommandupdated accordinglyRequest parsing (
SignTransactionApi.js)TransactionData[], orUint8Array[](serialized, for staking transactions)postMessageUint8Array→ plain object conversionInternal types (
Keyguard.d.ts)Parsedfor Standard now usestransactions: Nimiq.Transaction[]instead oftransaction: Nimiq.TransactionParsedfor Checkout and Cashlink updated withTransformto also maptransaction→transactionsUI handler (
SignTransaction.js,SignTransaction.css,index.html)_renderMultiTransactionViewand_renderSingleTransactionViewbased ontransactions.lengthI18n.observertransaction.sign(keyPair)when any staking tx is present, manualSignatureProof.singleSigotherwise#confirm-transaction.multi— no impact onSignMultisigTransactionwhich shares the same stylesheetTranslations (
en.json)sign-tx-heading-multi,sign-tx-multi-count,sign-tx-multi-total-fees,passwordbox-confirm-txsOther
PasswordBox.js: addedpasswordbox-confirm-txsbutton templateRequestParser.js: minor adjustment for sharedparseTransaction()usagedemos/SignTransaction.html: comprehensive demo with format selector and multi-tx controlsTesting
Use the demo page at
demos/SignTransaction.html. It provides a format selector (inline / TransactionData / Uint8Array) and controls to adjust the number of transactions. Test single-tx mode to verify backward compatibility, then switch to multi-tx to verify the batch UI, totals, and array result format.