Optional_options: BcsWriterOptionsOptionalenc: {Adds support for iterations over the object.
Ensure the buffer has at least bytes bytes of capacity remaining.
Number of bytes to reserve.
Shift current cursor position by bytes.
Number of bytes to
Self for possible chaining.
Get underlying buffer taking only value bytes (in case initial buffer size was bigger).
Resulting bcs.
Represent data as 'hex' or 'base64'
Encoding to use: 'base64' or 'hex'
Write a U128 value into a buffer and shift cursor position by 16.
Value to write.
Write a U16 value into a buffer and shift cursor position by 2.
Value to write.
Write a U256 value into a buffer and shift cursor position by 32.
Value to write.
Write a U32 value into a buffer and shift cursor position by 4.
Value to write.
Write a U64 value into a buffer and shift cursor position by 8.
Value to write.
Write a U8 value into a buffer and shift cursor position by 1.
Value to write.
Write raw bytes into the buffer and shift cursor by the length of the bytes.
Bytes to write.
Write a ULEB value into a buffer and shift cursor position by number of bytes written.
Value to write.
Write a vector into a buffer by first writing the vector length and then calling a callback on each passed value.
Array of elements to write.
Callback to call on each element of the vector.
Class used to write BCS data into a buffer. Initializer requires some size of a buffer to init; default value for this buffer is 1KB.
Most methods are chainable, so it is possible to write them in one go.
Example