Options
All
  • Public
  • Public/Protected
  • All
Menu

Package molecule

Index

References

CodecMap

Re-exports CodecMap

CodecMap

Re-exports CodecMap

Parser

Re-exports Parser

Parser

Re-exports Parser

createParser

Re-exports createParser

createParser

Re-exports createParser

Type aliases

Array

Array: { item_count: number; type: "array" } & BaseType

Array

Array: { item_count: number; type: "array" } & BaseType

BaseType

BaseType: { item: string; name: string }

Type declaration

  • item: string
  • name: string

BaseType

BaseType: { item: string; name: string }

Type declaration

  • item: string
  • name: string

CodecMap

CodecMap: Record<string, AnyCodec>

CodecMap

CodecMap: Record<string, AnyCodec>

Field

Field: { name: string; type: string }

Type declaration

  • name: string
  • type: string

Field

Field: { name: string; type: string }

Type declaration

  • name: string
  • type: string

MolType

MolType: Array | Vector | Option | Union | Struct | Table

MolType

MolType: Array | Vector | Option | Union | Struct | Table

MolTypeMap

MolTypeMap: Record<string, MolType>

MolTypeMap

MolTypeMap: Record<string, MolType>

Option

Option: { type: "option" } & BaseType

Option

Option: { type: "option" } & BaseType

ParseOptions

ParseOptions: { refs: Record<string, AnyCodec>; skipDependenciesCheck?: undefined | false | true }

Type declaration

  • refs: Record<string, AnyCodec>
  • Optional skipDependenciesCheck?: undefined | false | true

ParseOptions

ParseOptions: { refs: Record<string, AnyCodec>; skipDependenciesCheck?: undefined | false | true }

Type declaration

  • refs: Record<string, AnyCodec>
  • Optional skipDependenciesCheck?: undefined | false | true

Struct

Struct: { fields: Field[]; name: string; type: "struct" }

Type declaration

  • fields: Field[]
  • name: string
  • type: "struct"

Struct

Struct: { fields: Field[]; name: string; type: "struct" }

Type declaration

  • fields: Field[]
  • name: string
  • type: "struct"

Table

Table: { fields: Field[]; name: string; type: "table" }

Type declaration

  • fields: Field[]
  • name: string
  • type: "table"

Table

Table: { fields: Field[]; name: string; type: "table" }

Type declaration

  • fields: Field[]
  • name: string
  • type: "table"

Union

Union: { items: string[]; name: string; type: "union" }

Type declaration

  • items: string[]
  • name: string
  • type: "union"

Union

Union: { items: string[]; name: string; type: "union" }

Type declaration

  • items: string[]
  • name: string
  • type: "union"

Vector

Vector: { type: "vector" } & BaseType

Vector

Vector: { type: "vector" } & BaseType

Variables

Const byte

byte: "byte" = "byte"

Const byte

byte: "byte" = "byte"

primitive type

Const byte

byte: "byte" = "byte"

Const byte

byte: "byte" = "byte"

primitive type

Const checkDependencies

checkDependencies: (results: MolType[]) => void

Type declaration

    • Parameters

      Returns void

Const createCodecMap

createCodecMap: (molTypeInfo: MolTypeMap | MolType[], refs?: Record<string, Codec> | undefined) => CodecMap

create Codecs from tokens

param
returns

Type declaration

Const createParser

createParser: () => Parser

Type declaration

Const grammar

grammar: any = require("./grammar/mol.js")

Const toCodec

toCodec: (key: string, molTypeMap: MolTypeMap, result: CodecMap, refs?: Record<string, Codec> | undefined) => BytesCodec<any, any>

Add corresponding type and its depencies to result, then return coressponding codec

param
param
param
returns

codec

Type declaration

Const toMolTypeMap

toMolTypeMap: (results: MolType[]) => MolTypeMap

Type declaration

Functions

Const assertFixedMolType

  • assertFixedMolType(name: string, map: MolTypeMap): void
  • mol type array and struct should have fixed byte length

    Parameters

    Returns void

Const checkDependencies

  • checkDependencies(results: MolType[]): void
  • Parameters

    Returns void

Const checkDuplicateNames

  • checkDuplicateNames(results: MolType[]): void
  • Parameters

    Returns void

Const createCodecMap

createHexBytesCodec

Const createParser

  • Returns Parser

nonNull

  • nonNull<T>(data: T): assertsdata is NonNullable<T>
  • Type parameters

    • T

    Parameters

    • data: T

    Returns assertsdata is NonNullable<T>

nonNull

  • nonNull<T>(data: T): assertsdata is NonNullable<T>
  • Type parameters

    • T

    Parameters

    • data: T

    Returns assertsdata is NonNullable<T>

Const toCodec

  • Add corresponding type and its depencies to result, then return coressponding codec

    Parameters

    Returns BytesCodec

    codec

Const toMolTypeMap

  • Parameters

    Returns MolTypeMap

Const validateParserResults

  • Parameters

    Returns void

Generated using TypeDoc