Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Parse UNL

node v10.24.1
version: 4.0.0
endpointsharetweet
const fetch = require('node-fetch') const {decode} = require('ripple-binary-codec') const {encodeNodePublic} = require('ripple-address-codec') const base64ToDecoded = base64 => decode(Buffer.from(base64, 'base64').toString('hex')) const pubkeyToNode = pubhex => encodeNodePublic(Buffer.from(pubhex, 'hex')) const main = async () => { const f = await fetch('http://vl.ripple.com/') const {manifest, blob} = await f.json() const {validators} = JSON.parse(Buffer.from(blob, 'base64').toString('utf-8')) return validators.map(v => { const manifest = base64ToDecoded(v.manifest) return { validation_public_key: v.validation_public_key, decodedManifestPubKeys: { PublicKey: pubkeyToNode(manifest.PublicKey), SigningPubKey: pubkeyToNode(manifest.SigningPubKey) }, manifest } }) } console.log(await main())
Loading…

no comments

    sign in to comment