RippledError Submit failed resultCode: 'temMALFORMED while submitting a transaction

Free training on Ripple development. Click here for details.


If you are submitting a signed ripple transaction and the transaction payload is not having all the fields required for the transaction , the response will come as rejected with temMALFORMED resultCode as shown below :

Promise {
  [RippledError(Submit failed, { resultCode: 'temMALFORMED',
  resultMessage: 'Malformed transaction.' })],
  domain:
   Domain {
     domain: null,
     _events: { error: [Function: debugDomainError] },
     _eventsCount: 1,
     _maxListeners: undefined,
     members: [] } }

Fix:

Refer the Ripple documentation for all the fields for your transaction types and try submitting the transaction with values for all the possible fields even if the documentation says the field is optional.

For example, for a "PaymentChannelClaim" , the documentation mentions "Balance" as optional field , so below requrest was submitted without "Balance" parameter but it resulted in temMALFORMED  response.

{
            "Account": sender,
            "TransactionType": "PaymentChannelClaim",
            "Channel": channelId,
    "Amount": "10000000",
    "Fee" : _fee+"",
    "PublicKey":publicKey,
    "Signature":signedChannelClaimSigneture,
    "Sequence":nextseqSender

 }

The issue got fixed when the request included "Balance" parameter as shown below:

{
            "Account": sender,
            "TransactionType": "PaymentChannelClaim",
            "Channel": channelId,
    "Amount": "10000000",
    "Balance": "10000000",
    "Fee" : _fee+"",
    "PublicKey":publicKey,
    "Signature":signedChannelClaimSigneture,
    "Sequence":nextseqSender
        }

Comments

Popular posts from this blog

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 18): AssertionError [ERR_ASSERTION]: issuer must be defined