Skip to main content

VarIntWriter

scrypt-ts / VarIntWriter

Class: VarIntWriter

A writer that serializes ByteString, boolean, bigint

Table of contents

Constructors

Methods

Constructors

constructor

new VarIntWriter()

Methods

writeBool

Static writeBool(x): ByteString

serializes boolean with fixed 1 byte

Parameters

NameTypeDescription
xbooleana boolean

Returns

ByteString

serialized ByteString

Defined in

dist/smart-contract/builtins/functions.d.ts:1124


writeBytes

Static writeBytes(buf): ByteString

serializes ByteString with VarInt encoding

Parameters

NameTypeDescription
bufByteStringa ByteString

Returns

ByteString

serialized ByteString

Defined in

dist/smart-contract/builtins/functions.d.ts:1118


writeInt

Static writeInt(x): ByteString

serializes bigint with VarInt encoding

Parameters

NameTypeDescription
xbiginta boolean

Returns

ByteString

serialized ByteString

Defined in

dist/smart-contract/builtins/functions.d.ts:1130