Documentation ¶
Index ¶
- Constants
- Variables
- func SerializeBoc(cell *Cell, idx bool, hasCrc32 bool, cacheBits bool, flags uint) ([]byte, error)
- type BitString
- func (s *BitString) Append(b BitString)
- func (s *BitString) BinaryString() string
- func (s *BitString) BitsAvailableForRead() int
- func (s *BitString) BitsAvailableForWrite() int
- func (s *BitString) Buffer() []byte
- func (s *BitString) Copy() BitString
- func (s *BitString) GetTopUppedArray() ([]byte, error)
- func (s *BitString) GetWriteCursor() int
- func (s *BitString) Grow(bitLen int)
- func (s BitString) MarshalJSON() ([]byte, error)
- func (s *BitString) Off(n int) error
- func (s *BitString) On(n int) error
- func (s *BitString) PickUint(bitLen int) (uint64, error)
- func (s *BitString) Print()
- func (s *BitString) ReadBigInt(bitLen int) (*big.Int, error)
- func (s *BitString) ReadBigUint(bitLen int) (*big.Int, error)
- func (s *BitString) ReadBit() (bool, error)
- func (s *BitString) ReadBits(n int) (BitString, error)
- func (s *BitString) ReadByte() (byte, error)
- func (s *BitString) ReadBytes(size int) ([]byte, error)
- func (s *BitString) ReadInt(bitLen int) (int64, error)
- func (s *BitString) ReadLimUint(n int) (uint, error)
- func (s *BitString) ReadRemainingBits() BitString
- func (s *BitString) ReadUint(bitLen int) (uint64, error)
- func (s *BitString) ReadUnary() (uint, error)
- func (s *BitString) ResetCounter()
- func (s *BitString) SetTopUppedArray(arr []byte, fulfilledBytes bool) error
- func (s *BitString) Skip(n int) error
- func (s *BitString) ToFiftHex() string
- func (s *BitString) UnmarshalJSON(b []byte) error
- func (s *BitString) WriteBigInt(val *big.Int, bitLen int) error
- func (s *BitString) WriteBigUint(val *big.Int, bitLen int) error
- func (s *BitString) WriteBit(val bool) error
- func (s *BitString) WriteBitArray(val []bool) error
- func (s *BitString) WriteBitString(bs BitString) error
- func (s *BitString) WriteByte(val byte) error
- func (s *BitString) WriteBytes(data []byte) error
- func (s *BitString) WriteInt(val int64, bitLen int) error
- func (s *BitString) WriteLimUint(val, n int) error
- func (s *BitString) WriteUint(val uint64, bitLen int) error
- func (s *BitString) WriteUnary(n uint) error
- type Cell
- func DeserializeBoc(boc []byte) ([]*Cell, error)
- func DeserializeBocBase64(boc string) ([]*Cell, error)
- func DeserializeBocHex(boc string) ([]*Cell, error)
- func DeserializeSinglRootBase64(boc string) (*Cell, error)
- func NewCell() *Cell
- func NewCellExotic(cellType CellType) *Cell
- func NewCellWithBits(b BitString) *Cell
- func (c *Cell) AddRef(c2 *Cell) error
- func (c *Cell) BitSize() int
- func (c *Cell) BitsAvailableForRead() int
- func (c *Cell) BitsAvailableForWrite() int
- func (c *Cell) CellType() CellType
- func (c *Cell) CopyRemaining() *Cell
- func (c *Cell) GetLibraryHash() ([32]byte, error)
- func (c *Cell) GetMerkleRoot() ([32]byte, error)
- func (c *Cell) Hash() ([]byte, error)
- func (c *Cell) Hash256() ([32]byte, error)
- func (c *Cell) HashString() (string, error)
- func (c *Cell) IsExotic() bool
- func (c *Cell) IsLibrary() bool
- func (c *Cell) Level() int
- func (c Cell) MarshalJSON() ([]byte, error)
- func (c *Cell) NewRef() (*Cell, error)
- func (c *Cell) NextRef() (*Cell, error)
- func (c *Cell) PickUint(bitLen int) (uint64, error)
- func (c *Cell) RawBitString() BitString
- func (c *Cell) ReadBigInt(n int) (*big.Int, error)
- func (c *Cell) ReadBigUint(n int) (*big.Int, error)
- func (c *Cell) ReadBit() (bool, error)
- func (c *Cell) ReadBits(n int) (BitString, error)
- func (c *Cell) ReadBytes(n int) ([]byte, error)
- func (c *Cell) ReadInt(n int) (int64, error)
- func (c *Cell) ReadLimUint(n int) (uint, error)
- func (c *Cell) ReadRemainingBits() BitString
- func (c *Cell) ReadUint(bitLen int) (uint64, error)
- func (c *Cell) ReadUnary() (uint, error)
- func (c *Cell) Refs() []*Cell
- func (c *Cell) RefsAvailableForRead() int
- func (c *Cell) RefsSize() int
- func (c *Cell) ResetCounters()
- func (c *Cell) Sign(key ed25519.PrivateKey) ([]byte, error)
- func (c *Cell) Skip(n int) error
- func (c *Cell) ToBoc() ([]byte, error)
- func (c *Cell) ToBocBase64() (string, error)
- func (c *Cell) ToBocBase64Custom(idx bool, hasCrc32 bool, cacheBits bool, flags uint) (string, error)
- func (c *Cell) ToBocCustom(idx bool, hasCrc32 bool, cacheBits bool, flags uint) ([]byte, error)
- func (c *Cell) ToBocCustomWithHasher(hasher *Hasher, idx bool, hasCrc32 bool, cacheBits bool, flags uint) ([]byte, error)
- func (c *Cell) ToBocString() (string, error)
- func (c *Cell) ToBocStringCustom(idx bool, hasCrc32 bool, cacheBits bool, flags uint) (string, error)
- func (c Cell) ToString() string
- func (c *Cell) UnmarshalJSON(b []byte) error
- func (c *Cell) WriteBigInt(val *big.Int, bitLen int) error
- func (c *Cell) WriteBigUint(val *big.Int, bitLen int) error
- func (c *Cell) WriteBit(val bool) error
- func (c *Cell) WriteBitString(s BitString) error
- func (c *Cell) WriteBytes(b []byte) error
- func (c *Cell) WriteInt(val int64, bitLen int) error
- func (c *Cell) WriteLimUint(val, n int) error
- func (c *Cell) WriteUint(val uint64, bitLen int) error
- func (c *Cell) WriteUnary(n uint) error
- type CellType
- type Cursor
- type Hasher
- type MerkleProver
Constants ¶
View Source
const BOCSizeLimit = 65536
View Source
const CellBits = 1023
Variables ¶
View Source
var ErrBitStingOverflow = errors.New("BitString overflow")
View Source
var ErrCellRefsOverflow = errors.New("too many refs")
View Source
var ErrDepthIsTooBig = errors.New("depth is too big")
View Source
var ErrInvalidHex = errors.New("invalid hex representation of bitstring")
View Source
var ErrNotEnoughBits = errors.New("not enough bits")
View Source
var ErrNotEnoughRefs = errors.New("not enough refs")
View Source
var ErrNotSingleRoot = errors.New("should be one root cell")
Functions ¶
Types ¶
type BitString ¶
type BitString struct {
// contains filtered or unexported fields
}
func BitStringFromFiftHex ¶ added in v1.0.1
BitStringFromFiftHex constructs a new BitString from the given hex representation.
func NewBitString ¶
func (*BitString) BinaryString ¶
func (*BitString) BitsAvailableForRead ¶
func (*BitString) BitsAvailableForWrite ¶
func (*BitString) GetTopUppedArray ¶
func (*BitString) GetWriteCursor ¶
func (BitString) MarshalJSON ¶ added in v1.0.1
func (*BitString) ReadLimUint ¶
ReadLimUint #<= n
func (*BitString) ReadRemainingBits ¶
func (*BitString) ResetCounter ¶
func (s *BitString) ResetCounter()
func (*BitString) SetTopUppedArray ¶
func (*BitString) UnmarshalJSON ¶ added in v1.0.1
func (*BitString) WriteBitArray ¶
func (*BitString) WriteBitString ¶
func (*BitString) WriteBytes ¶
func (*BitString) WriteLimUint ¶
WriteLimUint #<= n
func (*BitString) WriteUnary ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
func DeserializeBoc ¶
func DeserializeBocBase64 ¶
func DeserializeBocHex ¶
func DeserializeSinglRootBase64 ¶ added in v1.0.1
func NewCellExotic ¶
func NewCellWithBits ¶ added in v1.0.1
func (*Cell) BitsAvailableForRead ¶
func (*Cell) BitsAvailableForWrite ¶
func (*Cell) CopyRemaining ¶ added in v1.3.0
func (*Cell) GetLibraryHash ¶ added in v1.8.7
func (*Cell) GetMerkleRoot ¶ added in v1.9.2
func (*Cell) HashString ¶
func (Cell) MarshalJSON ¶ added in v1.0.1
func (*Cell) RawBitString ¶
func (*Cell) ReadRemainingBits ¶
func (*Cell) RefsAvailableForRead ¶
func (*Cell) ResetCounters ¶
func (c *Cell) ResetCounters()
func (*Cell) ToBocBase64 ¶
func (*Cell) ToBocBase64Custom ¶
func (*Cell) ToBocCustom ¶
func (*Cell) ToBocCustomWithHasher ¶ added in v1.5.2
func (*Cell) ToBocString ¶
func (*Cell) ToBocStringCustom ¶
func (*Cell) UnmarshalJSON ¶ added in v1.0.1
func (*Cell) WriteBigInt ¶ added in v1.0.1
func (*Cell) WriteBigUint ¶ added in v1.0.1
func (*Cell) WriteBitString ¶
func (*Cell) WriteBytes ¶
func (*Cell) WriteLimUint ¶
func (*Cell) WriteUnary ¶
type Hasher ¶ added in v1.0.1
type Hasher struct {
// contains filtered or unexported fields
}
Hasher calculates a cell's hash more efficiently than calling Hash() directly on a cell.
This is a performance optimization hack and must be used only with a read-only tree of cells. Hasher relies on two facts: * some cells can be used multiple times in different places inside the tree * the tree is readonly and thus any hash, once calculated, won't change.
type MerkleProver ¶ added in v1.9.2
type MerkleProver struct {
// contains filtered or unexported fields
}
func NewMerkleProver ¶ added in v1.9.2
func NewMerkleProver(root *Cell) (*MerkleProver, error)
func (*MerkleProver) CreateProof ¶ added in v1.9.2
func (p *MerkleProver) CreateProof(cursor *Cursor) ([]byte, error)
func (*MerkleProver) Cursor ¶ added in v1.9.2
func (p *MerkleProver) Cursor() *Cursor
Click to show internal directories.
Click to hide internal directories.