lisk-mobile
lisk-mobile copied to clipboard
Implement transaction dry run before broadcasting to network
Description
Currently the transactions are created and validated against static schema check, however, the transaction might get rejected from transaction pool due to various scenarios like invalid nonce, fee replacement, etc..
Motivation
- To give immediate feedback to users regarding the incorrect information
- To improve overall user experience for transaction flow
Additional Information
- To implement this feature in Lisk Desktop, Lisk SDK needs to provide an interface to dry run the transaction before we can broadcast it to network
SDK endpoint for dry running
endpoint: txpool_dryRunTransaction
Request:
"{
transaction: string;
}"
Response:
"{
success: boolean;
events: {
readonly module: string;
readonly typeID: Buffer;
readonly topics: Buffer[];
readonly index: number;
readonly data: Buffer;
};
}"
Service endpoint:
/api/v3/transactions​/dryrun