title: Generate digest/ binary blob for XRP raw transaction using rippled c++ library
body: <p>I have an offline signing code to which I need to pass the digest or the binary blob to get the signature. Looks like the digest I have produced is not right as when I try to submit the serialized signature, it complains of &quot;fails local checks: Invalid signature.&quot; Here are the steps, I am doing to generate the digest/binary blob</p>
  <pre><code>  STTx noopTx(ttPAYMENT,
      [&amp;](auto&amp; obj)
  {
      // General transaction fields
      obj[sfAccount] = id;
      obj[sfFee] = STAmount(XRPAmount(fee));
      obj[sfFlags] = tfFullyCanonicalSig;
      obj[sfSequence] = sequence;
      obj[sfSigningPubKey] = pub_key.slice();
      // Payment-specific fields
      obj[sfAmount] = STAmount(XRPAmount(amount));
      obj[sfDestination] = *to_account;
      obj[sfSendMax] = STAmount(XRPAmount(amount));
  });
  ripple::uint256 hash256 = noopTx.getSigningHash();
  </code></pre>
  <p>output:
  0861970E8AAC8539600E2FB9169774F303A29C3B8CA98FF9206C9B958C681ACF</p>
  <p>Please can someone tell me if I am missing any field that is needed?.</p>