hexripple Posted January 17, 2020 Share Posted January 17, 2020 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 More sharing options...
Flintstone Posted January 17, 2020 Share Posted January 17, 2020 This may be of some help https://xrpl.org/transaction-basics.html#signing-and-submitting-transactions hexripple 1 Link to comment Share on other sites More sharing options...
Kakoyla Posted January 17, 2020 Share Posted January 17, 2020 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 Warbler and hexripple 1 1 Link to comment Share on other sites More sharing options...
hexripple Posted January 20, 2020 Author Share Posted January 20, 2020 @Kakoyla thanks this was really helpful. Will be sure to checkout your website too Link to comment Share on other sites More sharing options...
Warbler Posted January 28, 2020 Share Posted January 28, 2020 @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> Flintstone 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now