iroha-javascript
iroha-javascript copied to clipboard
Add utility methods to build, sign, and send a transaction
Add utility methods to build, sign, and send a transaction. Something like:
- [x] ~
createTransactionPayload~- The request was canceled because your example helped them @0x009922
- [ ]
signTransactionPayload - [ ]
submitVersionedTransaction
-
createTransactionPayload- what exactly is needed here? Transaction payload could be created by hand withTransactionPayload()helper from@iroha2/data-model:import { TransactionPayload, OptionU32, MapNameValue } from '@iroha2/data-model' const payload = TransactionPayload({ instructions: executable, time_to_live_ms: 100_000n, nonce: OptionU32('None'), metadata: MapNameValue(new Map()), creation_time: BigInt(Date.now()), account_id: accountId, }) -
signTransactionPayload- this could be exposed easily. CurrentlyClient.submit()does it internally. -
submitVersionedTransaction- this could be exposed fromClientas well.
The transaction lifecycle feature will affect the implementation of this issue
I close this issue after merging of #124.
- You can scaffold a transaction payload with a new helper for it -
makeTransactionPayload() - You can make signature of a transaction in 2 ways:
signTransaction(payload)returnsSignaturemakeSignedTransaction(payload, signer)returns signedVersionedTransaction
Torii.transaction(tx)literally only submitsVersionedTransaction