@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
- _writeVarInt
- toBytes
- write
- writeBool
- writeBytes
- writeF32
- writeF64
- writeFixedBytes
- writeFixedSeq
- writeI16
- writeI32
- writeI64
- writeI8
- writeSeq
- writeU16
- writeU32
- writeU64
- writeU8
- writeULEB
Constructors
constructor
• new BufWriter(«destructured»?
): BufWriter
Parameters
Name | Type |
---|---|
«destructured» | BufWriterOpts |
Returns
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
Name | Type |
---|---|
int | number | bigint |
Returns
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
Name | Type |
---|---|
serializer | Serializable <T > |
item | T |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:43
writeBool
▸ writeBool(val
): BufWriter
Parameters
Name | Type |
---|---|
val | boolean |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:27
writeBytes
▸ writeBytes(val
): BufWriter
Parameters
Name | Type |
---|---|
val | Uint8Array |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:40
writeF32
▸ writeF32(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:28
writeF64
▸ writeF64(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:29
writeFixedBytes
▸ writeFixedBytes(val
): BufWriter
Parameters
Name | Type |
---|---|
val | Uint8Array |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:39
writeFixedSeq
▸ writeFixedSeq<T
>(seq
, cb
): BufWriter
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
seq | T [] |
cb | BufWriterSeqCallback <T > |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:41
writeI16
▸ writeI16(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number | bigint |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:31
writeI32
▸ writeI32(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number | bigint |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:32
writeI64
▸ writeI64(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number | bigint |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:33
writeI8
▸ writeI8(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number | bigint |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:30
writeSeq
▸ writeSeq<T
>(seq
, cb
): BufWriter
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
seq | T [] |
cb | BufWriterSeqCallback <T > |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:42
writeU16
▸ writeU16(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number | bigint |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:35
writeU32
▸ writeU32(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number | bigint |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:36
writeU64
▸ writeU64(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number | bigint |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:37
writeU8
▸ writeU8(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number | bigint |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:34
writeULEB
▸ writeULEB(val
): BufWriter
Parameters
Name | Type |
---|---|
val | number |
Returns
Defined in
packages/core/dist/bcs/buf-writer.d.ts:38