@polkadot/primitives-json
TypeScript icon, indicating that this package has built-in type declarations

0.25.1 • Public • Published

polkadotjs isc style npm travis maintainability coverage dependency devDependency

@polkadot/primitives-json

Conversion of Polkadot types to and from a structure with Json-only primitives, ready for serialisation. As such, it does not stringify itself, rather converts from complex classes to the correct Json reprsentation.

Usage

Installation -

npm install --save @polkadot/primitives-json

Usage -

const { parachainIdDecode, parachainIdEncode } from '@polkadot/primitives-json');

parachainIdDecode(     // step 3 - BN `0x123456`
  parachainIdEncode(   // step 1 -  string `'0x123456'`
    new BN('0x123456') // step 0 - BN `0x123456`
  )
);

Readme

Keywords

Package Sidebar

Install

npm i @polkadot/primitives-json

Weekly Downloads

76

Version

0.25.1

License

ISC

Unpacked Size

42.6 kB

Total Files

96

Last publish

Collaborators

  • polkadotjs
  • jacogr