cell

package
v0.0.0-...-bcde84c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAddressTypeNotSupported = errors.New("address type is not supported")
View Source
var ErrNegative = errors.New("value should be non negative")
View Source
var ErrNoMoreRefs = errors.New("no more refs exists")
View Source
var ErrNotEnoughData = errors.New("not enough data in reader")
View Source
var ErrNotFit1023 = errors.New("cell data size should fit into 1023 bits")
View Source
var ErrRefCannotBeNil = errors.New("ref cannot be nil")
View Source
var ErrSmallSlice = errors.New("too small slice for this size")
View Source
var ErrTooBigSize = errors.New("too big size")
View Source
var ErrTooBigValue = errors.New("too big value")
View Source
var ErrTooMuchRefs = errors.New("too much refs")

Functions

func CheckProof

func CheckProof(proof *Cell, hash []byte) error

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func BeginCell

func BeginCell() *Builder

func (*Builder) BitsLeft

func (b *Builder) BitsLeft() uint

func (*Builder) BitsUsed

func (b *Builder) BitsUsed() uint

func (*Builder) Copy

func (b *Builder) Copy() *Builder

func (*Builder) EndCell

func (b *Builder) EndCell() *Cell

func (*Builder) MustStoreAddr

func (b *Builder) MustStoreAddr(addr *address.Address) *Builder

func (*Builder) MustStoreBigCoins

func (b *Builder) MustStoreBigCoins(value *big.Int) *Builder

func (*Builder) MustStoreBigInt

func (b *Builder) MustStoreBigInt(value *big.Int, sz uint) *Builder

func (*Builder) MustStoreBigUInt

func (b *Builder) MustStoreBigUInt(value *big.Int, sz uint) *Builder

func (*Builder) MustStoreBinarySnake

func (b *Builder) MustStoreBinarySnake(data []byte) *Builder

func (*Builder) MustStoreBoolBit

func (b *Builder) MustStoreBoolBit(value bool) *Builder

func (*Builder) MustStoreBuilder

func (b *Builder) MustStoreBuilder(builder *Builder) *Builder

func (*Builder) MustStoreCoins

func (b *Builder) MustStoreCoins(value uint64) *Builder

func (*Builder) MustStoreDict

func (b *Builder) MustStoreDict(dict *Dictionary) *Builder

func (*Builder) MustStoreInt

func (b *Builder) MustStoreInt(value int64, sz uint) *Builder

func (*Builder) MustStoreMaybeRef

func (b *Builder) MustStoreMaybeRef(ref *Cell) *Builder

func (*Builder) MustStoreRef

func (b *Builder) MustStoreRef(ref *Cell) *Builder

func (*Builder) MustStoreSlice

func (b *Builder) MustStoreSlice(bytes []byte, sz uint) *Builder

func (*Builder) MustStoreStringSnake

func (b *Builder) MustStoreStringSnake(str string) *Builder

func (*Builder) MustStoreUInt

func (b *Builder) MustStoreUInt(value uint64, sz uint) *Builder

func (*Builder) RefsLeft

func (b *Builder) RefsLeft() uint

func (*Builder) RefsUsed

func (b *Builder) RefsUsed() int

func (*Builder) StoreAddr

func (b *Builder) StoreAddr(addr *address.Address) error

func (*Builder) StoreBigCoins

func (b *Builder) StoreBigCoins(value *big.Int) error

func (*Builder) StoreBigInt

func (b *Builder) StoreBigInt(value *big.Int, sz uint) error

func (*Builder) StoreBigUInt

func (b *Builder) StoreBigUInt(value *big.Int, sz uint) error

func (*Builder) StoreBinarySnake

func (b *Builder) StoreBinarySnake(data []byte) error

func (*Builder) StoreBoolBit

func (b *Builder) StoreBoolBit(value bool) error

func (*Builder) StoreBuilder

func (b *Builder) StoreBuilder(builder *Builder) error

func (*Builder) StoreCoins

func (b *Builder) StoreCoins(value uint64) error

func (*Builder) StoreDict

func (b *Builder) StoreDict(dict *Dictionary) error

func (*Builder) StoreInt

func (b *Builder) StoreInt(value int64, sz uint) error

func (*Builder) StoreMaybeRef

func (b *Builder) StoreMaybeRef(ref *Cell) error

func (*Builder) StoreRef

func (b *Builder) StoreRef(ref *Cell) error

func (*Builder) StoreSlice

func (b *Builder) StoreSlice(bytes []byte, sz uint) error

func (*Builder) StoreStringSnake

func (b *Builder) StoreStringSnake(str string) error

func (*Builder) StoreUInt

func (b *Builder) StoreUInt(value uint64, sz uint) error

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

func FromBOC

func FromBOC(data []byte) (*Cell, error)

func FromBOCMultiRoot

func FromBOCMultiRoot(data []byte) ([]*Cell, error)

func (*Cell) BeginParse

func (c *Cell) BeginParse() *Slice

func (*Cell) BitsSize

func (c *Cell) BitsSize() uint

func (*Cell) CreateProof

func (c *Cell) CreateProof(parts [][]byte) (*Cell, error)

func (*Cell) Dump

func (c *Cell) Dump() string

func (*Cell) DumpBits

func (c *Cell) DumpBits() string

func (*Cell) Hash

func (c *Cell) Hash() []byte

func (*Cell) RefsNum

func (c *Cell) RefsNum() uint

func (*Cell) Sign

func (c *Cell) Sign(key ed25519.PrivateKey) []byte

func (*Cell) ToBOC

func (c *Cell) ToBOC() []byte

func (*Cell) ToBOCWithFlags

func (c *Cell) ToBOCWithFlags(withCRC bool) []byte

func (*Cell) ToBuilder

func (c *Cell) ToBuilder() *Builder

type Dictionary

type Dictionary struct {
	// contains filtered or unexported fields
}

func NewDict

func NewDict(keySz uint) *Dictionary

func (*Dictionary) All

func (d *Dictionary) All() []*HashmapKV

func (*Dictionary) Get

func (d *Dictionary) Get(key *Cell) *Cell

func (*Dictionary) GetByIntKey

func (d *Dictionary) GetByIntKey(key *big.Int) *Cell

func (*Dictionary) MustToCell

func (d *Dictionary) MustToCell() *Cell

func (*Dictionary) Set

func (d *Dictionary) Set(key, value *Cell) error

func (*Dictionary) SetIntKey

func (d *Dictionary) SetIntKey(key *big.Int, value *Cell) error

func (*Dictionary) ToCell

func (d *Dictionary) ToCell() (*Cell, error)

type HashmapKV

type HashmapKV struct {
	Key   *Cell
	Value *Cell
}

type Slice

type Slice struct {
	// contains filtered or unexported fields
}

func (*Slice) BitsLeft

func (c *Slice) BitsLeft() uint

func (*Slice) Copy

func (c *Slice) Copy() *Slice

func (*Slice) LoadAddr

func (c *Slice) LoadAddr() (*address.Address, error)

func (*Slice) LoadBigCoins

func (c *Slice) LoadBigCoins() (*big.Int, error)

func (*Slice) LoadBigInt

func (c *Slice) LoadBigInt(sz uint) (*big.Int, error)

func (*Slice) LoadBigUInt

func (c *Slice) LoadBigUInt(sz uint) (*big.Int, error)

func (*Slice) LoadBinarySnake

func (c *Slice) LoadBinarySnake() ([]byte, error)

func (*Slice) LoadBoolBit

func (c *Slice) LoadBoolBit() (bool, error)

func (*Slice) LoadCoins

func (c *Slice) LoadCoins() (uint64, error)

func (*Slice) LoadDict

func (c *Slice) LoadDict(keySz uint) (*Dictionary, error)

func (*Slice) LoadInt

func (c *Slice) LoadInt(sz uint) (int64, error)

func (*Slice) LoadMaybeRef

func (c *Slice) LoadMaybeRef() (*Slice, error)

func (*Slice) LoadRef

func (c *Slice) LoadRef() (*Slice, error)

func (*Slice) LoadSlice

func (c *Slice) LoadSlice(sz uint) ([]byte, error)

func (*Slice) LoadStringSnake

func (c *Slice) LoadStringSnake() (string, error)

func (*Slice) LoadUInt

func (c *Slice) LoadUInt(sz uint) (uint64, error)

func (*Slice) LoadVarUInt

func (c *Slice) LoadVarUInt(sz uint) (*big.Int, error)

func (*Slice) MustLoadAddr

func (c *Slice) MustLoadAddr() *address.Address

func (*Slice) MustLoadBigCoins

func (c *Slice) MustLoadBigCoins() *big.Int

func (*Slice) MustLoadBigUInt

func (c *Slice) MustLoadBigUInt(sz uint) *big.Int

func (*Slice) MustLoadBinarySnake

func (c *Slice) MustLoadBinarySnake() []byte

func (*Slice) MustLoadBoolBit

func (c *Slice) MustLoadBoolBit() bool

func (*Slice) MustLoadCoins

func (c *Slice) MustLoadCoins() uint64

func (*Slice) MustLoadDict

func (c *Slice) MustLoadDict(keySz uint) *Dictionary

func (*Slice) MustLoadInt

func (c *Slice) MustLoadInt(sz uint) int64

func (*Slice) MustLoadMaybeRef

func (c *Slice) MustLoadMaybeRef() *Slice

func (*Slice) MustLoadRef

func (c *Slice) MustLoadRef() *Slice

func (*Slice) MustLoadSlice

func (c *Slice) MustLoadSlice(sz uint) []byte

func (*Slice) MustLoadStringSnake

func (c *Slice) MustLoadStringSnake() string

func (*Slice) MustLoadUInt

func (c *Slice) MustLoadUInt(sz uint) uint64

func (*Slice) MustToCell

func (c *Slice) MustToCell() *Cell

func (*Slice) RefsNum

func (c *Slice) RefsNum() int

func (*Slice) RestBits

func (c *Slice) RestBits() (uint, []byte, error)

func (*Slice) ToCell

func (c *Slice) ToCell() (*Cell, error)

func (*Slice) ToDict

func (c *Slice) ToDict(keySz uint) (*Dictionary, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL