This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@lto-network/lto-marshall
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

@lto-network/lto-marshall npm version Build Status

Marshall can serialize and parse LTO blockchain data structures

Includes:

  • Serialization primitives
  • Parsing primitives
  • Binary to js converters
  • Js to binary converters
  • JSON to js converters
  • Js to JSON converters

Usage:

import { binary, json } from 'parse-serialize'

const tx = {
  type: 4,
  version: 2,
  fee: 100000,
  senderPublicKey: '7GGPvAPV3Gmxo4eswmBRLb6bXXEhAovPinfcwVkA2LJh',
  timestamp: 1542539421461,
  proofs:
  ['22J76sGhLRo3S5pkqGjCi9fijpEeGGRmnv7canxeon2n2MNx1HhvKaBz2gYTdpJQohmUusRKR3yoCAHptRnJ1Fwe'],
  id: 'EG3WvPWWEU5DdJ7xfB3Y5TRJNzMpt6urgKoP7docipvW',
  recipient: '3N3Cn2pYtqzj7N9pviSesNe8KG9Cmb718Y1',
  amount: 10000,
  attachment: '',
};

// Binary converter
const bytes = binary.serializeTx(tx);

const txb = binary.parseTx(bytes)

// json converted
const jsonString = json.stringifyTx(tx)

const txj = json.parseTx(jsonString)

Readme

Keywords

none

Package Sidebar

Install

npm i @lto-network/lto-marshall

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

138 kB

Total Files

49

Last publish

Collaborators

  • jasny
  • svenstam