@solana/spl-type-length-value
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Type-Length-Value-js

Library with utilities for working with Type-Length-Value structures in js.

Example usage

import { TlvState, SplDiscriminator } from '@solana/spl-type-length-value';

const tlv = new TlvState(tlvData, discriminatorSize, lengthSize);
const discriminator = await splDiscriminate("<discriminator-hash-input>", discriminatorSize);

const firstValue = tlv.firstBytes(discriminator);

const allValues = tlv.bytesRepeating(discriminator);

const firstThreeValues = tlv.bytesRepeating(discriminator, 3);

Dependents (3)

Package Sidebar

Install

npm i @solana/spl-type-length-value

Weekly Downloads

74,132

Version

0.2.0

License

Apache-2.0

Unpacked Size

41.3 kB

Total Files

34

Last publish

Collaborators

  • nickfrosty
  • mcintyre94
  • 2501babe
  • lorisleiva
  • buffalojoec
  • ngundotra
  • _chido
  • steveluscher
  • seanyoung
  • tyera
  • joncinque
  • ryoqun
  • trent-solana
  • jordansexton