common

package
v0.0.1-test-release Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDummyCell

func NewDummyCell() (*cell.Cell, error)

NewDummyCell returns a cell containing the string "placeholder" in its data.

Types

type CrossChainAddress

type CrossChainAddress []byte

CrossChainAddress is a type that represents a cross-chain address.

func (*CrossChainAddress) LoadFromCell

func (c *CrossChainAddress) LoadFromCell(s *cell.Slice) error

func (CrossChainAddress) ToCell

func (c CrossChainAddress) ToCell() (*cell.Cell, error)

ToCell converts the CrossChainAddress to a cell structure.

type Ownable2Step

type Ownable2Step struct {
	Owner        *address.Address `tlb:"addr"`
	PendingOwner *address.Address `tlb:"maybe addr"` // PendingOwner is optional
}

Ownable2Step represents a two-step ownership structure, where an owner can set a pending owner.

type Signature

type Signature struct {
	Sig []byte `tlb:"bits 256"`
}

Signature is a type that represents a cryptographic signature used in MerkleProofs

type SnakeBytes

type SnakeBytes []byte

SnakeBytes is a byte array type for packing and unpacking into a cell structure.

func (*SnakeBytes) LoadFromCell

func (s *SnakeBytes) LoadFromCell(c *cell.Slice) error

LoadFromCell loads the SnakeBytes from a cell slice. It uses unloadCellToByteArray to deserialize the data.

func (SnakeBytes) ToCell

func (s SnakeBytes) ToCell() (*cell.Cell, error)

ToCell packs the SnakeBytes into a cell. It uses packByteArrayToCell to serialize the data.

type SnakeData

type SnakeData[T any] []T

SnakeData is a generic type for packing and unpacking slices of any type T into a cell structure.

func (*SnakeData[T]) LoadFromCell

func (s *SnakeData[T]) LoadFromCell(c *cell.Slice) error

LoadFromCell loads the SnakeData from a cell slice. It uses UnpackArray to deserialize the data.

func (SnakeData[T]) ToCell

func (s SnakeData[T]) ToCell() (*cell.Cell, error)

ToCell packs the SnakeData into a cell. It uses PackArray to serialize the data. currently this function is not using pointer receiver, lack of support from tonutils-go library https://github.com/xssnick/tonutils-go/issues/340

type SnakeRef

type SnakeRef[T any] []T

SnakeRef is a generic type for packing and unpacking slices of any type T into a cell structure with references chaining.

func (*SnakeRef[T]) LoadFromCell

func (s *SnakeRef[T]) LoadFromCell(c *cell.Slice) error

LoadFromCell loads the SnakeRef from a cell slice. It uses unpackArrayWithRefChaining to deserialize the data.

func (SnakeRef[T]) ToCell

func (s SnakeRef[T]) ToCell() (*cell.Cell, error)

ToCell packs the SnakeRef into a cell. It uses packArrayWithRefChaining to serialize the data.

Jump to

Keyboard shortcuts

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