Skip to content

@aldea/sdk / Exports / BufWriter

Class: BufWriter

BufWriter.

Class used for writing BCS data chunk by chunk. Normally this is used via the BCS wrapper, but can also be used as a general purpose Buffer writer.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new BufWriter(«destructured»?): BufWriter

Parameters

NameType
«destructured»BufWriterOpts

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:25

Properties

chunkSize

Private chunkSize: any

Defined in

packages/core/dist/bcs/buf-writer.d.ts:22


cursor

Private cursor: any

Defined in

packages/core/dist/bcs/buf-writer.d.ts:20


expand

Private expand: any

Defined in

packages/core/dist/bcs/buf-writer.d.ts:47


maxSize

Private maxSize: any

Defined in

packages/core/dist/bcs/buf-writer.d.ts:23


push

Private push: any

Defined in

packages/core/dist/bcs/buf-writer.d.ts:46


size

Private size: any

Defined in

packages/core/dist/bcs/buf-writer.d.ts:21


view

Private view: any

Defined in

packages/core/dist/bcs/buf-writer.d.ts:24

Accessors

data

get data(): Uint8Array

Returns

Uint8Array

Defined in

packages/core/dist/bcs/buf-writer.d.ts:26

Methods

_writeVarInt

_writeVarInt(int): BufWriter

Parameters

NameType
intnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:44


toBytes

toBytes(): Uint8Array

Returns

Uint8Array

Defined in

packages/core/dist/bcs/buf-writer.d.ts:45


write

write<T>(serializer, item): BufWriter

Type parameters

Name
T

Parameters

NameType
serializerSerializable<T>
itemT

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:43


writeBool

writeBool(val): BufWriter

Parameters

NameType
valboolean

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:27


writeBytes

writeBytes(val): BufWriter

Parameters

NameType
valUint8Array

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:40


writeF32

writeF32(val): BufWriter

Parameters

NameType
valnumber

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:28


writeF64

writeF64(val): BufWriter

Parameters

NameType
valnumber

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:29


writeFixedBytes

writeFixedBytes(val): BufWriter

Parameters

NameType
valUint8Array

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:39


writeFixedSeq

writeFixedSeq<T>(seq, cb): BufWriter

Type parameters

Name
T

Parameters

NameType
seqT[]
cbBufWriterSeqCallback<T>

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:41


writeI16

writeI16(val): BufWriter

Parameters

NameType
valnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:31


writeI32

writeI32(val): BufWriter

Parameters

NameType
valnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:32


writeI64

writeI64(val): BufWriter

Parameters

NameType
valnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:33


writeI8

writeI8(val): BufWriter

Parameters

NameType
valnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:30


writeSeq

writeSeq<T>(seq, cb): BufWriter

Type parameters

Name
T

Parameters

NameType
seqT[]
cbBufWriterSeqCallback<T>

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:42


writeU16

writeU16(val): BufWriter

Parameters

NameType
valnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:35


writeU32

writeU32(val): BufWriter

Parameters

NameType
valnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:36


writeU64

writeU64(val): BufWriter

Parameters

NameType
valnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:37


writeU8

writeU8(val): BufWriter

Parameters

NameType
valnumber | bigint

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:34


writeULEB

writeULEB(val): BufWriter

Parameters

NameType
valnumber

Returns

BufWriter

Defined in

packages/core/dist/bcs/buf-writer.d.ts:38