JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/@tendermint/amino-js@0.1.1/dist/web.js"></script>
CSS
html {
background: 'white';
}
TypeScript
// mjs: import * as Amino from '@tendermint/amino-js';
// cjs: const Amino = require('@tendermint/amino-js');
let html = '';
// https://rpc.cosmos.network:26657/tx?hash=0x2268EB5AB730B45F8426078827BB5BB49819CE2B0D74B2C1D191070BADB379F1&prove=true
const base64AminoTx = '1gHwYl3uCkOoo2GaChS536x615s3L5HNHZqLKYPpCK3tiRIUF5FHHqSe5EQ+wA9u2QAy8QEasjAaEQoFdWF0b20SCDExNjU3OTk1EhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAtQaCqFnshaZQp6rIkvAPyzThvCvXSDO+9AzbxVErqJPEkDWdRwgfQItPT+dDSYFMOtPqQwbbQ1j8+wfs/aBzhulg0YsRiMGZ1Z69dQmi5IT/0D/rRAb1xh6rJN7mQUN4g/FIgoxMTIyNjcyNzU0';
const aminoTx = Amino.base64ToBytes(base64AminoTx);
// bare=false (length prefixed)
const jsonTx = Amino.unmarshalTx(aminoTx, false)
html += '<h4>auth/StdTx</h4>';
html += '<pre class="language-js">' + JSON.stringify(jsonTx, null, 2) + '</pre>';
// https://rpc.cosmos.network:26657/abci_query?path=%22store/acc/key%22&data=0x01D545E7384C3D6F5BBA7A1B252B4E1A956EBAC64C&prove=true
const base64AminoAccount = 'YPqWwQqcAQpUChTVRec4TD1vW7p6GyUrThqVbrrGTBIPCgV1YXRvbRIGMTc5ODQ4GibrWumHIQKYe02D/64eNwOGvV8fs+7Nr4O3wn9SS6I9ZgPcmQ1jEiCbASg7EhQKBXVhdG9tEgsxMTAwMDAwMDAwMBoSCgV1YXRvbRIJMjA5Nzk3NjA3IhQKBXVhdG9tEgsxMTAwMDAwMDAwMCjwoLDzBQ==';
const aminoAccount = Amino.base64ToBytes(base64AminoAccount);
// bare=true (not length prefixed)
const jsonAccount = Amino.unmarshalAccount(aminoAccount, true);
html += '<h4>auth/DelayedVestingAccount</h4>';
html += '<pre class="language-js">' + JSON.stringify(jsonAccount, null, 2) + '</pre>';
document.body.innerHTML = html;