Class Builder

Builder for Cells

Constructors

Properties

_bits: BitBuilder
_refs: Cell[]

Accessors

Methods

  • Complete cell

    Parameters

    • Optional opts: {
          exotic?: boolean;
      }

      options

      • Optional exotic?: boolean

    Returns Cell

    cell

  • Write a single bit

    Parameters

    • value: number | boolean

      bit to write, true or positive number for 1, false or zero or negative for 0

    Returns Builder

    this builder

  • Store Buffer

    Parameters

    • src: Buffer

      source buffer

    • Optional bytes: Maybe<number>

      optional number of bytes to write

    Returns Builder

    this builder

  • Store int value

    Parameters

    • value: number | bigint

      value as bigint or number

    • bits: number

      number of bits to write

    Returns Builder

    this builder

  • Store Maybe Buffer

    Parameters

    • src: null | Buffer

      source buffer or null

    • Optional bytes: Maybe<number>

      optional number of bytes to write

    Returns Builder

    this builder

  • Store maybe coins value

    Parameters

    • amount: Maybe<number | bigint>

      amount of coins, null or undefined

    Returns Builder

    this builder

  • Store maybe int value

    Parameters

    • value: Maybe<number | bigint>

      value as bigint or number, null or undefined

    • bits: number

      number of bits to write

    Returns Builder

    this builder

  • Store maybe string tail in ref

    Parameters

    • Optional src: Maybe<null | string>

      source string

    Returns Builder

    this builder

  • Store maybe uint value

    Parameters

    • value: Maybe<number | bigint>

      value as bigint or number, null or undefined

    • bits: number

      number of bits to write

    Returns Builder

    this builder

  • Store maybe varint value

    Parameters

    • value: Maybe<number | bigint>

      value as bigint or number, null or undefined

    • bits: number

      number of bits to write to header

    Returns Builder

    this builder

  • Store maybe varuint value

    Parameters

    • value: Maybe<number | bigint>

      value as bigint or number, null or undefined

    • bits: number

      number of bits to write to header

    Returns Builder

    this builder

  • Store writer or builder if not null

    Parameters

    • Optional writer: Maybe<Writable | ((builder) => void)>

      writer or builder to store

    Returns Builder

    this builder

  • Store uint value

    Parameters

    • value: number | bigint

      value as bigint or number

    • bits: number

      number of bits to write

    Returns Builder

    this builder

  • Store varint value

    Parameters

    • value: number | bigint

      value as bigint or number

    • bits: number

      number of bits to write to header

    Returns Builder

    this builder

  • Store varuint value

    Parameters

    • value: number | bigint

      value as bigint or number

    • bits: number

      number of bits to write to header

    Returns Builder

    this builder