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

Free training on Ripple development. Click here for details.


If you are trying to submit a transaction (in my case Check Cash using issued currency), and getting the error "AssertionError [ERR_ASSERTION]: issuer must be defined" , then the cause could be missing value for ripple account of issuer.

For example, in my case, I created a check in the XRP ledger using the CreateCheck transaction  by sender successfully, but when the receiver account was trying to cash the check, the payload did not mentioned the sender address resulting in above error. Below is the payload giving the error :

{ "checkID":checkID,
"amount": {
    "currency": "USD",
    "value": ""+checkAmount
  }
}

To fix the error, I had to add the counterparty parameter as highlighted below and the check got cashed.

checkCashTx = { "checkID":checkID,
"amount": {
    "currency": "USD",
    "counterparty":sender,
    "value": ""+checkAmount
  }
      }

Comments

Popular posts from this blog