CellBuilder
TonSdk.Core.Boc
CellBuilder
- a special class which allows you to write data and build a cell.
CellBuilder
instance can be create via constructor with optional int length
parameter:
You can build CellBuilder
instance into Cell
using Build
method:
To make code more readable and shorten, its prefer to use in one statement:
In docs we will use larger code for education purposes, but its prefer to use shorten version of code, implemented in previous code block.
Below you can see the methods what can be used.
StoreRefs(Cell[] refs)
- get array ofCell[]
and store them in builderStoreRef(Cell ref)
- get one ref asCell
and store it in builderStoreOptRef(Cell ref)
- get one ref asCell
and store it in builder, also stores one bit (will be true, if ref not null, otherwise false)
StoreCellSlice(CellSlice slice)
- getCellSlice
and store it in builderStoreBitsSlice(BitsSlice slice)
- getBitsSlice
and store it in builderStoreDict(HashmapE<K, V> hashmap)
- getHashmapE<K,V>
and store it in builder
StoreBits(Bits bits)
- getBits
and store it in builderStoreBits(BitsArray bitsArray)
- getBitsArray
and store it in builderStoreBits(string bitsArray)
- get string representation ofBitsArray
and store it in builderStoreBit(bool bit)
- getbool
as bit value and store it in builder
StoreBytes(byte[] value)
- getbyte[]
and store it in builderStoreByte(byte value)
- get onebyte
and store it in builderStoreString(string value)
- getstring
, convert it to bytes and store in builder
StoreUInt(ulong value, int size)
- get ulong
value and int
size, and store value in builder
StoreUInt(BigInteger value, int size)
- get BigInteger
value and int
size, and store value in builder
StoreInt(long value, int size)
- get long
value and int
size, and store value in builder
StoreInt(BigInteger value, int size)
- get BigInteger
value and int
size, and store value in builder
StoreUInt32LE(uint value)
- get uint
value, and store it in builder in Little-Endian order
StoreUInt64LE(ulong value)
- get ulong
value, and store it in builder in Little-Endian order
StoreAddress(Address? address)
- get Address
and store it in builder
StoreCoins(Coins coins)
- get Coins
and store it in builder
StoreVarUInt(BigInteger value, int length)
- get BigInteger
value of VarUInt and int
length, and store value in builder
StoreVarInt(BigInteger value, int length)
- get BigInteger
value of VarInt and int
length, and store value in builder
Last updated