bcs library

Classes

BCS
BCS implementation for Move types and few additional built-ins.
BcsConfig
Configuration that is passed into BCS constructor.
BcsConfigTypes
BcsReader
Class used for reading BCS data chunk by chunk. Meant to be used by some wrapper, which will make sure that data is valid and is matching the desired format.
BcsWriter
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.
BcsWriterOptions
TypeEncodeDecode

Enums

Encoding

Mixins

TypeInterface
Set of methods that allows data encoding/decoding as standalone BCS value or a part of a composed structure/vector.

Constants

SUI_ADDRESS_LENGTH → const int

Properties

base58 BaseXCodec
final

Functions

base58Decode(String source) Uint8List
base58Encode(List<int> bytes) String
decodeStr(String data, Encoding encoding) Uint8List
encodeStr(Uint8List data, Encoding encoding) String
fromB58(String str) Uint8List
fromB64(String str) Uint8List
fromHEX(String str) Uint8List
getRustConfig() BcsConfig
getSuiMoveConfig() BcsConfig
registerPrimitives(BCS bcs) → void
Register the base set of primitive and common types. Is called in the BCS constructor automatically but can be ignored if the withPrimitives argument is not set.
toB58(Uint8List buffer) String
toB64(Uint8List buffer) String
toBN(dynamic number) BigInt
Unify argument types by converting them to BigInt.
toHEX(Uint8List buffer) String
ulebDecode(Uint8List arr) → (int, int)
ulebEncode(int num) List<int>

Typedefs

DecodeCb = dynamic Function(BcsReader reader, List typeParams, Map<String, dynamic> typeMap)
EncodeCb = BcsWriter Function(BcsWriter writer, dynamic data, List typeParams, Map<String, dynamic> typeMap)
EnumTypeDefinition = Map<String, dynamic>
Enum type definition. Used as input format in BcsConfig.types as well as an argument type for bcs.registerEnumType.
StructTypeDefinition = Map<String, dynamic>
Struct type definition. Used as input format in BcsConfig.types as well as an argument type for bcs.registerStructType.
TypeName = dynamic
Allows for array definitions for names.
ValidateCb = bool Function(dynamic data)