bcs
library
Mixins
TypeInterface
Set of methods that allows data encoding/decoding as standalone
BCS value or a part of a composed structure/vector.
Functions
bigUIntBcsType ({required String name , required int size , required String readMethod , required String writeMethod , required BigInt maxValue , void validate (BigInt )? })
→ BcsType <BigInt , dynamic >
compareBcsBytes (Uint8List a , Uint8List b )
→ int
Lexicographic byte compare (byte-by-byte, then length) for BTreeMap key order.
decodeStr (String data , Encoding encoding )
→ Uint8List
dynamicSizeBcsType <T , Input > ({required String name , required T read (BcsReader ), required Uint8List serialize (Input , {BcsWriterOptions ? options }), void validate (Input )? })
→ BcsType <T , Input >
encodeStr (Uint8List data , Encoding encoding )
→ String
fixedSizeBcsType <T , Input > ({required String name , required int size , required T read (BcsReader ), required void write (Input , BcsWriter ), void validate (Input )? })
→ BcsType <T , Input >
fromB58 (String str )
→ Uint8List
fromB64 (String str )
→ Uint8List
fromHEX (String str )
→ Uint8List
getRustConfig ()
→ BcsConfig
getSuiMoveConfig ()
→ BcsConfig
isSerializedBcs (Object ? obj )
→ bool
Whether obj is a SerializedBcs .
lazyBcsType <T , Input > (BcsType <T , Input > cb () )
→ BcsType <T , Input >
registerPrimitives (LegacyBCS 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.
stringLikeBcsType ({required String name , required Uint8List toBytes (String ), required String fromBytes (Uint8List ), int ? serializedSize (dynamic , {BcsWriterOptions ? options })?, void validate (String )? })
→ BcsType <String , dynamic >
toB58 (Uint8List buffer )
→ String
toB64 (Uint8List buffer )
→ String
toBN (dynamic number )
→ BigInt
Unify argument types by converting them to BigInt.
toHEX (Uint8List buffer )
→ String
uIntBcsType ({required String name , required int size , required String readMethod , required String writeMethod , required int maxValue , void validate (int )? })
→ BcsType <int , dynamic >