Jump to content

How to get trx_json instead of trx_blob after signing the transaction?


hexripple

Recommended Posts

Hi! I recently signed a transaction and I was hoping to get  response in the form of JSON, but instead it returned it in the form of a blob which was the hexadecimal representation of the binary transaction.

I desperately want the transaction to be in JSON format.

Does anyone have any idea how to deal with this?

Link to comment
Share on other sites

5 hours ago, hexripple said:

Hi! I recently signed a transaction and I was hoping to get  response in the form of JSON, but instead it returned it in the form of a blob which was the hexadecimal representation of the binary transaction.

I desperately want the transaction to be in JSON format.

Does anyone have any idea how to deal with this?

You can use the binary codec to decode the blob. 

const binary = require('ripple-binary-codec')

const signedTX = ''

var decoded = (binary.decode(signedTX))

console.log(decoded)

If you just have a one off transaction you want to look at, I made a quick decoder tool for myself at

Padanaram.digital then  click quick tool's then decode tx blob. It's not perfect but works for basic transactions 

Link to comment
Share on other sites

  • 2 weeks later...

@hexripple @Flintstone

You can decode transaction here:

https://bithomp.com/submit/

it's client side (works offline) and opensourced. 

we have a js lib to decode transaction:

https://github.com/Bithomp/decodeXrplTx

very easy to use

<html>

<head>

<title>Bithomp-decode</title>

</head>

<body>

TX blob: <input id="tx" />

<br><br>

<button id="decode">Decode</button>

<br><br>

<pre id="output"></pre>

<script src="decodeXrplTx.min.js"></script>

<script>

var output = document.getElementById("output");

document.getElementById("decode").onclick = function() {

var tx = document.getElementById("tx").value;

var txJson = decodeXrplTx.decodeTx(tx);

output.innerHTML = JSON.stringify(txJson, null, 2);

}

</script>

</body>

</html>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...