tlb

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 103

Documentation

Index

Constants

View Source
const (
	AccountStatusActive   = "ACTIVE"
	AccountStatusUninit   = "UNINIT"
	AccountStatusFrozen   = "FROZEN"
	AccountStatusNonExist = "NON_EXIST"
)
View Source
const MaxTextChunkSize = 127 - 2

Variables

View Source
var ErrStackEmpty = errors.New("stack is empty")
View Source
var ZeroCoins = MustFromTON("0")

Functions

func ConvertShardIdentToShard added in v1.4.0

func ConvertShardIdentToShard(si ShardIdent) (workchain int32, shard uint64)

func LoadFromCell

func LoadFromCell(v any, loader *cell.Slice, skipMagic ...bool) error

LoadFromCell automatically parses cell based on struct tags ## N - means integer with N bits, if size <= 64 it loads to uint of any size, if > 64 it loads to *big.Int ^ - loads ref and calls recursively, if field type is *cell.Cell, it loads without parsing . - calls recursively to continue load from current loader (inner struct) dict [inline] N - loads dictionary with key size N, example: 'dict 256', inline option can be used if dict is Hashmap and not HashmapE bits N - loads bit slice N len to []byte bool - loads 1 bit boolean addr - loads ton address maybe - reads 1 bit, and loads rest if its 1, can be used in combination with others only either [leave {bits},{refs}] X Y - reads 1 bit, if its 0 - loads X, if 1 - loads Y,

tries to serialize first condition, if not succeed (not enough free bits or refs), then second.
if 'leave' is specified, then after write it will additionally check specified
number of free bits and refs in cell.

?FieldName - Conditional field loading depending on boolean value of specified field. / Specified field must be declared before tag usage, or it will be always false during loading Some tags can be combined, for example "dict 256", "maybe ^" Magic can be used to load first bits and check struct type, in tag can be specified magic number itself, in [#]HEX or [$]BIN format Example: _ Magic `tlb:"#deadbeef" _ Magic `tlb:"$1101"

func LoadFromCellAsProof added in v1.8.0

func LoadFromCellAsProof(v any, loader *cell.Slice, skipMagic ...bool) error

func MethodNameHash added in v1.2.0

func MethodNameHash(name string) uint64

func ParseStackValue added in v1.9.0

func ParseStackValue(slice *cell.Slice) (any, error)

func Register added in v1.8.0

func Register(typ any)

func RegisterWithName added in v1.9.0

func RegisterWithName(name string, typ any)

func SerializeStackValue added in v1.9.0

func SerializeStackValue(b *cell.Builder, val any) error

func ToCell added in v1.1.0

func ToCell(v any) (*cell.Cell, error)

Types

type AccStatusChange added in v1.7.0

type AccStatusChange struct {
	Type AccStatusChangeType
}

func (*AccStatusChange) LoadFromCell added in v1.7.0

func (a *AccStatusChange) LoadFromCell(loader *cell.Slice) error

func (AccStatusChange) ToCell added in v1.7.0

func (a AccStatusChange) ToCell() (*cell.Cell, error)

type AccStatusChangeType added in v1.7.0

type AccStatusChangeType string
const (
	AccStatusChangeUnchanged AccStatusChangeType = "UNCHANGED"
	AccStatusChangeFrozen    AccStatusChangeType = "FROZEN"
	AccStatusChangeDeleted   AccStatusChangeType = "DELETED"
)

type Account

type Account struct {
	IsActive   bool
	State      *AccountState
	Data       *cell.Cell
	Code       *cell.Cell
	LastTxLT   uint64
	LastTxHash []byte
}

func (*Account) HasGetMethod added in v1.2.0

func (a *Account) HasGetMethod(name string) bool

type AccountBlock added in v1.6.0

type AccountBlock struct {
	Addr         []byte           `tlb:"bits 256"`
	Transactions *cell.Dictionary `tlb:"dict inline 64"`
	StateUpdate  *cell.Cell       `tlb:"^"`
	// contains filtered or unexported fields
}

type AccountState

type AccountState struct {
	IsValid     bool
	Address     *address.Address
	StorageInfo StorageInfo

	AccountStorage
}

func (*AccountState) LoadFromCell

func (a *AccountState) LoadFromCell(loader *cell.Slice) error

type AccountStatus

type AccountStatus string

func (*AccountStatus) LoadFromCell

func (g *AccountStatus) LoadFromCell(loader *cell.Slice) error

func (AccountStatus) ToCell added in v1.6.0

func (g AccountStatus) ToCell() (*cell.Cell, error)

type AccountStorage

type AccountStorage struct {
	Status            AccountStatus
	LastTransactionLT uint64
	Balance           Coins
	ExtraCurrencies   *cell.Dictionary `tlb:"dict 32"`

	// has value when active
	StateInit *StateInit
	// has value when frozen
	StateHash []byte
}

func (*AccountStorage) LoadFromCell

func (s *AccountStorage) LoadFromCell(loader *cell.Slice) error

type ActionPhase added in v1.7.0

type ActionPhase struct {
	Success         bool             `tlb:"bool"`
	Valid           bool             `tlb:"bool"`
	NoFunds         bool             `tlb:"bool"`
	StatusChange    AccStatusChange  `tlb:"."`
	TotalFwdFees    *Coins           `tlb:"maybe ."`
	TotalActionFees *Coins           `tlb:"maybe ."`
	ResultCode      int32            `tlb:"## 32"`
	ResultArg       *int32           `tlb:"maybe ## 32"`
	TotalActions    uint16           `tlb:"## 16"`
	SpecActions     uint16           `tlb:"## 16"`
	SkippedActions  uint16           `tlb:"## 16"`
	MessagesCreated uint16           `tlb:"## 16"`
	ActionListHash  []byte           `tlb:"bits 256"`
	TotalMsgSize    StorageUsedShort `tlb:"."`
}

type AllShardsInfo

type AllShardsInfo struct {
	ShardHashes *cell.Dictionary `tlb:"dict 32"`
}

type AnyMessage

type AnyMessage interface {
	Payload() *cell.Cell
	SenderAddr() *address.Address
	DestAddr() *address.Address
}

type BinTree

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

func (*BinTree) All

func (b *BinTree) All() []*cell.HashmapKV

func (*BinTree) Get

func (b *BinTree) Get(key *cell.Cell) *cell.Cell

func (*BinTree) LoadFromCell

func (b *BinTree) LoadFromCell(loader *cell.Slice) error

type BlkPrevInfo added in v1.4.0

type BlkPrevInfo struct {
	Prev1 ExtBlkRef
	Prev2 *ExtBlkRef
}

type Block

type Block struct {
	GlobalID    int32       `tlb:"## 32"`
	BlockInfo   BlockHeader `tlb:"^"`
	ValueFlow   *cell.Cell  `tlb:"^"`
	StateUpdate *cell.Cell  `tlb:"^"`
	Extra       *BlockExtra `tlb:"^"`
	// contains filtered or unexported fields
}

type BlockExtra

type BlockExtra struct {
	InMsgDesc          *cell.Cell    `tlb:"^"`
	OutMsgDesc         *cell.Cell    `tlb:"^"`
	ShardAccountBlocks *cell.Cell    `tlb:"^"`
	RandSeed           []byte        `tlb:"bits 256"`
	CreatedBy          []byte        `tlb:"bits 256"`
	Custom             *McBlockExtra `tlb:"maybe ^"`
	// contains filtered or unexported fields
}

type BlockHeader added in v1.4.0

type BlockHeader struct {
	GenSoftware *GlobalVersion
	MasterRef   *ExtBlkRef
	PrevRef     BlkPrevInfo
	PrevVertRef *BlkPrevInfo
	// contains filtered or unexported fields
}

func (*BlockHeader) GetParentBlocks added in v1.4.0

func (h *BlockHeader) GetParentBlocks() ([]*BlockInfo, error)

func (*BlockHeader) LoadFromCell added in v1.4.0

func (h *BlockHeader) LoadFromCell(loader *cell.Slice) error

type BlockInfo deprecated

type BlockInfo struct {
	Workchain int32  `tl:"int"`
	Shard     int64  `tl:"long"`
	SeqNo     uint32 `tl:"int"`
	RootHash  []byte `tl:"int256"`
	FileHash  []byte `tl:"int256"`
}

Deprecated: use ton.BlockIDExt

func (*BlockInfo) Copy added in v1.8.0

func (h *BlockInfo) Copy() *BlockInfo

func (*BlockInfo) Equals added in v1.8.0

func (h *BlockInfo) Equals(h2 *BlockInfo) bool

type BouncePhase added in v1.7.0

type BouncePhase struct {
	Phase any `tlb:"[BouncePhaseOk,BouncePhaseNegFunds,BouncePhaseNoFunds]"`
}

type BouncePhaseNegFunds added in v1.7.0

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

type BouncePhaseNoFunds added in v1.7.0

type BouncePhaseNoFunds struct {
	MsgSize    StorageUsedShort `tlb:"."`
	ReqFwdFees Coins            `tlb:"."`
	// contains filtered or unexported fields
}

type BouncePhaseOk added in v1.7.0

type BouncePhaseOk struct {
	MsgSize StorageUsedShort `tlb:"."`
	MsgFees Coins            `tlb:"."`
	FwdFees Coins            `tlb:"."`
	// contains filtered or unexported fields
}

type CatchainConfig added in v1.8.0

type CatchainConfig struct {
	Config any `tlb:"[CatchainConfigV1,CatchainConfigV2]"`
}

type CatchainConfigV1 added in v1.8.0

type CatchainConfigV1 struct {
	McCatchainLifetime      uint32 `tlb:"## 32"`
	ShardCatchainLifetime   uint32 `tlb:"## 32"`
	ShardValidatorsLifetime uint32 `tlb:"## 32"`
	ShardValidatorsNum      uint32 `tlb:"## 32"`
	// contains filtered or unexported fields
}

type CatchainConfigV2 added in v1.8.0

type CatchainConfigV2 struct {
	Flags                   uint8  `tlb:"## 7"`
	ShuffleMcValidators     bool   `tlb:"bool"`
	McCatchainLifetime      uint32 `tlb:"## 32"`
	ShardCatchainLifetime   uint32 `tlb:"## 32"`
	ShardValidatorsLifetime uint32 `tlb:"## 32"`
	ShardValidatorsNum      uint32 `tlb:"## 32"`
	// contains filtered or unexported fields
}

type Coins

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

func FromDecimal added in v1.8.0

func FromDecimal(val string, decimals int) (Coins, error)

func FromNano added in v1.8.0

func FromNano(val *big.Int, decimals int) (Coins, error)

func FromNanoTON

func FromNanoTON(val *big.Int) Coins

func FromNanoTONStr added in v1.9.0

func FromNanoTONStr(val string) (Coins, error)

func FromNanoTONU

func FromNanoTONU(val uint64) Coins

func FromTON

func FromTON(val string) (Coins, error)

func MustFromDecimal added in v1.8.0

func MustFromDecimal(val string, decimals int) Coins

func MustFromNano added in v1.8.0

func MustFromNano(val *big.Int, decimals int) Coins

func MustFromTON

func MustFromTON(val string) Coins

func (*Coins) Compare added in v1.10.0

func (g *Coins) Compare(coins *Coins) int

func (*Coins) Decimals added in v1.10.0

func (g *Coins) Decimals() int

func (*Coins) LoadFromCell

func (g *Coins) LoadFromCell(loader *cell.Slice) error

func (Coins) MarshalJSON

func (g Coins) MarshalJSON() ([]byte, error)

func (Coins) Nano added in v1.8.0

func (g Coins) Nano() *big.Int

func (Coins) NanoTON deprecated

func (g Coins) NanoTON() *big.Int

Deprecated: use Nano

func (Coins) String

func (g Coins) String() string

func (Coins) TON deprecated

func (g Coins) TON() string

Deprecated: use String

func (Coins) ToCell added in v1.1.0

func (g Coins) ToCell() (*cell.Cell, error)

func (*Coins) UnmarshalJSON added in v1.9.0

func (g *Coins) UnmarshalJSON(data []byte) error

type ComputePhase added in v1.7.0

type ComputePhase struct {
	Phase any `tlb:"[ComputePhaseVM,ComputePhaseSkipped]"`
}

type ComputePhaseSkipped added in v1.7.0

type ComputePhaseSkipped struct {
	Reason ComputeSkipReason `tlb:"."`
	// contains filtered or unexported fields
}

type ComputePhaseVM added in v1.7.0

type ComputePhaseVM struct {
	Success          bool  `tlb:"bool"`
	MsgStateUsed     bool  `tlb:"bool"`
	AccountActivated bool  `tlb:"bool"`
	GasFees          Coins `tlb:"."`
	Details          struct {
		GasUsed          *big.Int `tlb:"var uint 7"`
		GasLimit         *big.Int `tlb:"var uint 7"`
		GasCredit        *big.Int `tlb:"maybe var uint 3"`
		Mode             int8     `tlb:"## 8"`
		ExitCode         int32    `tlb:"## 32"`
		ExitArg          *int32   `tlb:"maybe ## 32"`
		VMSteps          uint32   `tlb:"## 32"`
		VMInitStateHash  []byte   `tlb:"bits 256"`
		VMFinalStateHash []byte   `tlb:"bits 256"`
	} `tlb:"^"`
	// contains filtered or unexported fields
}

type ComputeSkipReason added in v1.7.0

type ComputeSkipReason struct {
	Type ComputeSkipReasonType
}

func (*ComputeSkipReason) LoadFromCell added in v1.7.0

func (c *ComputeSkipReason) LoadFromCell(loader *cell.Slice) error

func (ComputeSkipReason) ToCell added in v1.7.0

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

type ComputeSkipReasonType added in v1.7.0

type ComputeSkipReasonType string
const (
	ComputeSkipReasonNoState   ComputeSkipReasonType = "NO_STATE"
	ComputeSkipReasonBadState  ComputeSkipReasonType = "BAD_STATE"
	ComputeSkipReasonNoGas     ComputeSkipReasonType = "NO_GAS"
	ComputeSkipReasonSuspended ComputeSkipReasonType = "SUSPENDED"
)

type ConfigParams added in v1.4.0

type ConfigParams struct {
	ConfigAddr []byte `tlb:"bits 256"`
	Config     struct {
		Params *cell.Dictionary `tlb:"dict inline 32"`
	} `tlb:"^"`
}

type ConsensusConfig added in v1.8.0

type ConsensusConfig struct {
	Config any `tlb:"[ConsensusConfigV1,ConsensusConfigV2,ConsensusConfigV3,ConsensusConfigV4]"`
}

type ConsensusConfigV1 added in v1.8.0

type ConsensusConfigV1 struct {
	RoundCandidates      uint32 `tlb:"## 32"`
	NextCandidateDelayMs uint32 `tlb:"## 32"`
	ConsensusTimeoutMs   uint32 `tlb:"## 32"`
	FastAttempts         uint32 `tlb:"## 32"`
	AttemptDuration      uint32 `tlb:"## 32"`
	CatchainMaxDeps      uint32 `tlb:"## 32"`
	MaxBlockBytes        uint32 `tlb:"## 32"`
	MaxCollatedBytes     uint32 `tlb:"## 32"`
	// contains filtered or unexported fields
}

type ConsensusConfigV2 added in v1.8.0

type ConsensusConfigV2 struct {
	Flags                uint8  `tlb:"## 7"`
	NewCatchainIds       bool   `tlb:"bool"`
	RoundCandidates      uint8  `tlb:"## 8"`
	NextCandidateDelayMs uint32 `tlb:"## 32"`
	ConsensusTimeoutMs   uint32 `tlb:"## 32"`
	FastAttempts         uint32 `tlb:"## 32"`
	AttemptDuration      uint32 `tlb:"## 32"`
	CatchainMaxDeps      uint32 `tlb:"## 32"`
	MaxBlockBytes        uint32 `tlb:"## 32"`
	MaxCollatedBytes     uint32 `tlb:"## 32"`
	// contains filtered or unexported fields
}

type ConsensusConfigV3 added in v1.8.0

type ConsensusConfigV3 struct {
	Flags                uint8  `tlb:"## 7"`
	NewCatchainIds       bool   `tlb:"bool"`
	RoundCandidates      uint8  `tlb:"## 8"`
	NextCandidateDelayMs uint32 `tlb:"## 32"`
	ConsensusTimeoutMs   uint32 `tlb:"## 32"`
	FastAttempts         uint32 `tlb:"## 32"`
	AttemptDuration      uint32 `tlb:"## 32"`
	CatchainMaxDeps      uint32 `tlb:"## 32"`
	MaxBlockBytes        uint32 `tlb:"## 32"`
	MaxCollatedBytes     uint32 `tlb:"## 32"`
	ProtoVersion         uint16 `tlb:"## 16"`
	// contains filtered or unexported fields
}

type ConsensusConfigV4 added in v1.8.0

type ConsensusConfigV4 struct {
	Flags                 uint8  `tlb:"## 7"`
	NewCatchainIds        bool   `tlb:"bool"`
	RoundCandidates       uint8  `tlb:"## 8"`
	NextCandidateDelayMs  uint32 `tlb:"## 32"`
	ConsensusTimeoutMs    uint32 `tlb:"## 32"`
	FastAttempts          uint32 `tlb:"## 32"`
	AttemptDuration       uint32 `tlb:"## 32"`
	CatchainMaxDeps       uint32 `tlb:"## 32"`
	MaxBlockBytes         uint32 `tlb:"## 32"`
	MaxCollatedBytes      uint32 `tlb:"## 32"`
	ProtoVersion          uint16 `tlb:"## 16"`
	CatchainMaxBlocksCoff uint32 `tlb:"## 32"`
	// contains filtered or unexported fields
}

type CreditPhase added in v1.7.0

type CreditPhase struct {
	DueFeesCollected *Coins             `tlb:"maybe ."`
	Credit           CurrencyCollection `tlb:"."`
}

type CurrencyCollection

type CurrencyCollection struct {
	Coins           Coins            `tlb:"."`
	ExtraCurrencies *cell.Dictionary `tlb:"dict 32"`
}

type DepthBalanceInfo

type DepthBalanceInfo struct {
	Depth      uint32             `tlb:"## 5"`
	Currencies CurrencyCollection `tlb:"."`
}

type ExtBlkRef added in v1.4.0

type ExtBlkRef struct {
	EndLt    uint64 `tlb:"## 64"`
	SeqNo    uint32 `tlb:"## 32"`
	RootHash []byte `tlb:"bits 256"`
	FileHash []byte `tlb:"bits 256"`
}

type ExternalMessage

type ExternalMessage struct {
	SrcAddr   *address.Address `tlb:"addr"`
	DstAddr   *address.Address `tlb:"addr"`
	ImportFee Coins            `tlb:"."`

	StateInit *StateInit `tlb:"maybe either leave 1,1 . ^"`
	Body      *cell.Cell `tlb:"either . ^"`
	// contains filtered or unexported fields
}

func (*ExternalMessage) DestAddr

func (m *ExternalMessage) DestAddr() *address.Address

func (*ExternalMessage) Payload

func (m *ExternalMessage) Payload() *cell.Cell

func (*ExternalMessage) SenderAddr

func (m *ExternalMessage) SenderAddr() *address.Address

type ExternalMessageOut

type ExternalMessageOut struct {
	SrcAddr   *address.Address `tlb:"addr"`
	DstAddr   *address.Address `tlb:"addr"`
	CreatedLT uint64           `tlb:"## 64"`
	CreatedAt uint32           `tlb:"## 32"`

	StateInit *StateInit `tlb:"maybe either leave 1,1 . ^"`
	Body      *cell.Cell `tlb:"either . ^"`
	// contains filtered or unexported fields
}

func (*ExternalMessageOut) DestAddr

func (m *ExternalMessageOut) DestAddr() *address.Address

func (*ExternalMessageOut) Payload

func (m *ExternalMessageOut) Payload() *cell.Cell

func (*ExternalMessageOut) SenderAddr

func (m *ExternalMessageOut) SenderAddr() *address.Address

type FutureMerge added in v1.8.0

type FutureMerge struct {
	MergeUtime uint32 `tlb:"## 32"`
	Interval   uint32 `tlb:"## 32"`
	// contains filtered or unexported fields
}

type FutureSplit added in v1.8.0

type FutureSplit struct {
	SplitUtime uint32 `tlb:"## 32"`
	Interval   uint32 `tlb:"## 32"`
	// contains filtered or unexported fields
}

type FutureSplitMergeNone added in v1.8.0

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

type GlobalVersion added in v1.4.0

type GlobalVersion struct {
	Version      uint32 `tlb:"## 32"`
	Capabilities uint64 `tlb:"## 64"`
	// contains filtered or unexported fields
}

type HashUpdate added in v1.7.0

type HashUpdate struct {
	OldHash []byte `tlb:"bits 256"`
	NewHash []byte `tlb:"bits 256"`
	// contains filtered or unexported fields
}

type InternalMessage

type InternalMessage struct {
	IHRDisabled     bool             `tlb:"bool"`
	Bounce          bool             `tlb:"bool"`
	Bounced         bool             `tlb:"bool"`
	SrcAddr         *address.Address `tlb:"addr"`
	DstAddr         *address.Address `tlb:"addr"`
	Amount          Coins            `tlb:"."`
	ExtraCurrencies *cell.Dictionary `tlb:"dict 32"`
	IHRFee          Coins            `tlb:"."`
	FwdFee          Coins            `tlb:"."`
	CreatedLT       uint64           `tlb:"## 64"`
	CreatedAt       uint32           `tlb:"## 32"`

	StateInit *StateInit `tlb:"maybe either leave 1,1 . ^"`
	Body      *cell.Cell `tlb:"either . ^"`
	// contains filtered or unexported fields
}

func (*InternalMessage) Comment

func (m *InternalMessage) Comment() string

func (*InternalMessage) DestAddr

func (m *InternalMessage) DestAddr() *address.Address

func (*InternalMessage) Dump

func (m *InternalMessage) Dump() string

func (*InternalMessage) Payload

func (m *InternalMessage) Payload() *cell.Cell

func (*InternalMessage) SenderAddr

func (m *InternalMessage) SenderAddr() *address.Address

type KeyExtBlkRef added in v1.8.0

type KeyExtBlkRef struct {
	IsKey  bool      `tlb:"bool"`
	BlkRef ExtBlkRef `tlb:"."`
}

type KeyMaxLt added in v1.8.0

type KeyMaxLt struct {
	IsKey    bool   `tlb:"bool"`
	MaxEndLT uint64 `tlb:"## 64"`
}

type Magic

type Magic struct{}

type Marshaller added in v1.8.3

type Marshaller interface {
	ToCell() (*cell.Cell, error)
}

type McBlockExtra

type McBlockExtra struct {
	KeyBlock    bool             `tlb:"bool"`
	ShardHashes *cell.Dictionary `tlb:"dict 32"`
	ShardFees   *cell.Dictionary `tlb:"dict 96"`
	Details     struct {
		PrevBlockSignatures *cell.Dictionary `tlb:"dict 16"`
		RecoverCreateMsg    *cell.Cell       `tlb:"maybe ^"`
		MintMsg             *cell.Cell       `tlb:"maybe ^"`
	} `tlb:"^"`
	ConfigParams *ConfigParams `tlb:"?KeyBlock ."`
	// contains filtered or unexported fields
}

type McStateExtra added in v1.4.0

type McStateExtra struct {
	ShardHashes   *cell.Dictionary   `tlb:"dict 32"`
	ConfigParams  ConfigParams       `tlb:"."`
	Info          *cell.Cell         `tlb:"^"`
	GlobalBalance CurrencyCollection `tlb:"."`
	// contains filtered or unexported fields
}

type McStateExtraBlockInfo added in v1.8.0

type McStateExtraBlockInfo struct {
	Flags            uint16           `tlb:"## 16"`
	ValidatorInfo    ValidatorInfo    `tlb:"."`
	PrevBlocks       *cell.Dictionary `tlb:"dict 32"`
	LastKeyBlock     *ExtBlkRef       `tlb:"maybe ."`
	BlockCreateStats *cell.Cell       `tlb:"."`
}

type Message

type Message struct {
	MsgType MsgType    `tlb:"-"`
	Msg     AnyMessage `tlb:"[ExternalMessage,ExternalMessageOut,InternalMessage]"`
}

func (*Message) AsExternalIn

func (m *Message) AsExternalIn() *ExternalMessage

func (*Message) AsExternalOut

func (m *Message) AsExternalOut() *ExternalMessageOut

func (*Message) AsInternal

func (m *Message) AsInternal() *InternalMessage

func (*Message) LoadFromCell

func (m *Message) LoadFromCell(loader *cell.Slice) error

type MessagesList added in v1.7.0

type MessagesList struct {
	List *cell.Dictionary `tlb:"dict inline 15"`
}

func (*MessagesList) ToSlice added in v1.7.0

func (m *MessagesList) ToSlice() ([]Message, error)

type MsgType

type MsgType string
const (
	MsgTypeInternal    MsgType = "INTERNAL"
	MsgTypeExternalIn  MsgType = "EXTERNAL_IN"
	MsgTypeExternalOut MsgType = "EXTERNAL_OUT"
)

type ShardAccount added in v1.8.0

type ShardAccount struct {
	Account       *cell.Cell `tlb:"^"`
	LastTransHash []byte     `tlb:"bits 256"`
	LastTransLT   uint64     `tlb:"## 64"`
}

type ShardAccountBlocks added in v1.6.0

type ShardAccountBlocks struct {
	Accounts *cell.Dictionary `tlb:"dict 256"`
}

type ShardDesc

type ShardDesc struct {
	SeqNo              uint32 `tlb:"## 32"`
	RegMcSeqno         uint32 `tlb:"## 32"`
	StartLT            uint64 `tlb:"## 64"`
	EndLT              uint64 `tlb:"## 64"`
	RootHash           []byte `tlb:"bits 256"`
	FileHash           []byte `tlb:"bits 256"`
	BeforeSplit        bool   `tlb:"bool"`
	BeforeMerge        bool   `tlb:"bool"`
	WantSplit          bool   `tlb:"bool"`
	WantMerge          bool   `tlb:"bool"`
	NXCCUpdated        bool   `tlb:"bool"`
	Flags              uint8  `tlb:"## 3"`
	NextCatchainSeqNo  uint32 `tlb:"## 32"`
	NextValidatorShard int64  `tlb:"## 64"`
	MinRefMcSeqNo      uint32 `tlb:"## 32"`
	GenUTime           uint32 `tlb:"## 32"`
	SplitMergeAt       any    `tlb:"[FutureMerge,FutureSplit,FutureSplitMergeNone]"`
	Currencies         struct {
		FeesCollected CurrencyCollection `tlb:"."`
		FundsCreated  CurrencyCollection `tlb:"."`
	} `tlb:"^"`
	// contains filtered or unexported fields
}

type ShardDescB added in v1.8.0

type ShardDescB struct {
	SeqNo              uint32             `tlb:"## 32"`
	RegMcSeqno         uint32             `tlb:"## 32"`
	StartLT            uint64             `tlb:"## 64"`
	EndLT              uint64             `tlb:"## 64"`
	RootHash           []byte             `tlb:"bits 256"`
	FileHash           []byte             `tlb:"bits 256"`
	BeforeSplit        bool               `tlb:"bool"`
	BeforeMerge        bool               `tlb:"bool"`
	WantSplit          bool               `tlb:"bool"`
	WantMerge          bool               `tlb:"bool"`
	NXCCUpdated        bool               `tlb:"bool"`
	Flags              uint8              `tlb:"## 3"`
	NextCatchainSeqNo  uint32             `tlb:"## 32"`
	NextValidatorShard int64              `tlb:"## 64"`
	MinRefMcSeqNo      uint32             `tlb:"## 32"`
	GenUTime           uint32             `tlb:"## 32"`
	SplitMergeAt       any                `tlb:"[FutureMerge,FutureSplit,FutureSplitMergeNone]"`
	FeesCollected      CurrencyCollection `tlb:"."`
	FundsCreated       CurrencyCollection `tlb:"."`
	// contains filtered or unexported fields
}

type ShardID added in v1.9.8

type ShardID uint64

func (ShardID) ContainsAddress added in v1.9.8

func (s ShardID) ContainsAddress(addr *address.Address) bool

func (ShardID) GetChild added in v1.9.8

func (s ShardID) GetChild(left bool) ShardID

func (ShardID) GetParent added in v1.9.8

func (s ShardID) GetParent() ShardID

func (ShardID) IsAncestor added in v1.9.8

func (s ShardID) IsAncestor(of ShardID) bool

func (ShardID) IsParent added in v1.9.8

func (s ShardID) IsParent(of ShardID) bool

func (ShardID) IsSibling added in v1.9.8

func (s ShardID) IsSibling(with ShardID) bool

type ShardIdent

type ShardIdent struct {
	PrefixBits  int8   `tlb:"## 6"` // #<= 60
	WorkchainID int32  `tlb:"## 32"`
	ShardPrefix uint64 `tlb:"## 64"`
	// contains filtered or unexported fields
}

func (ShardIdent) GetShardID added in v1.9.8

func (s ShardIdent) GetShardID() ShardID

func (ShardIdent) IsAncestor added in v1.9.8

func (s ShardIdent) IsAncestor(of ShardIdent) bool

func (ShardIdent) IsParent added in v1.9.8

func (s ShardIdent) IsParent(of ShardIdent) bool

func (ShardIdent) IsSibling added in v1.9.8

func (s ShardIdent) IsSibling(with ShardIdent) bool

type ShardStateSplit added in v1.8.0

type ShardStateSplit struct {
	Left  ShardStateUnsplit `tlb:"^"`
	Right ShardStateUnsplit `tlb:"^"`
	// contains filtered or unexported fields
}

type ShardStateUnsplit added in v1.4.0

type ShardStateUnsplit struct {
	GlobalID        int32      `tlb:"## 32"`
	ShardIdent      ShardIdent `tlb:"."`
	Seqno           uint32     `tlb:"## 32"`
	VertSeqno       uint32     `tlb:"## 32"`
	GenUTime        uint32     `tlb:"## 32"`
	GenLT           uint64     `tlb:"## 64"`
	MinRefMCSeqno   uint32     `tlb:"## 32"`
	OutMsgQueueInfo *cell.Cell `tlb:"^"`
	BeforeSplit     bool       `tlb:"bool"`
	Accounts        struct {
		ShardAccounts *cell.Dictionary `tlb:"dict 256"`
	} `tlb:"^"`
	Stats        *cell.Cell `tlb:"^"`
	McStateExtra *cell.Cell `tlb:"maybe ^"`
	// contains filtered or unexported fields
}

type SigPubKeyED25519 added in v1.6.0

type SigPubKeyED25519 struct {
	Key []byte `tlb:"bits 256"`
	// contains filtered or unexported fields
}

type SplitMergeInfo added in v1.7.0

type SplitMergeInfo struct {
	CurShardPfxLen uint8  `tlb:"## 6"`
	AccSplitDepth  uint8  `tlb:"## 6"`
	ThisAddr       []byte `tlb:"bits 256"`
	SiblingAddr    []byte `tlb:"bits 256"`
}

type Stack

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

func NewStack

func NewStack() *Stack

func (*Stack) Depth

func (s *Stack) Depth() uint

func (*Stack) LoadFromCell

func (s *Stack) LoadFromCell(loader *cell.Slice) error

func (*Stack) Pop

func (s *Stack) Pop() (any, error)

func (*Stack) Push

func (s *Stack) Push(obj any)

func (*Stack) ToCell

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

type StackElement

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

type StackNaN

type StackNaN struct{}

type StateInit

type StateInit struct {
	Depth    *uint64          `tlb:"maybe ## 5"`
	TickTock *TickTock        `tlb:"maybe ."`
	Code     *cell.Cell       `tlb:"maybe ^"`
	Data     *cell.Cell       `tlb:"maybe ^"`
	Lib      *cell.Dictionary `tlb:"dict 256"`
}

func (StateInit) CalcAddress added in v1.10.0

func (s StateInit) CalcAddress(workchain int) *address.Address

type StateUpdate

type StateUpdate struct {
	Old any        `tlb:"^ [ShardStateUnsplit,ShardStateSplit]"`
	New *cell.Cell `tlb:"^"`
}

type StorageInfo

type StorageInfo struct {
	StorageUsed StorageUsed `tlb:"."`
	LastPaid    uint32      `tlb:"## 32"`
	DuePayment  *Coins      `tlb:"maybe ."`
}

type StoragePhase added in v1.7.0

type StoragePhase struct {
	StorageFeesCollected Coins           `tlb:"."`
	StorageFeesDue       *Coins          `tlb:"maybe ."`
	StatusChange         AccStatusChange `tlb:"."`
}

type StorageUsed

type StorageUsed struct {
	CellsUsed       *big.Int `tlb:"var uint 7"`
	BitsUsed        *big.Int `tlb:"var uint 7"`
	PublicCellsUsed *big.Int `tlb:"var uint 7"`
}

type StorageUsedShort added in v1.7.0

type StorageUsedShort struct {
	Cells *big.Int `tlb:"var uint 7"`
	Bits  *big.Int `tlb:"var uint 7"`
}

type Text added in v1.7.1

type Text struct {
	MaxFirstChunkSize uint8
	Value             string
}

func (*Text) LoadFromCell added in v1.7.1

func (t *Text) LoadFromCell(loader *cell.Slice) error

func (Text) ToCell added in v1.7.1

func (t Text) ToCell() (*cell.Cell, error)

type TickTock

type TickTock struct {
	Tick bool `tlb:"bool"`
	Tock bool `tlb:"bool"`
}

type Transaction

type Transaction struct {
	AccountAddr []byte        `tlb:"bits 256"`
	LT          uint64        `tlb:"## 64"`
	PrevTxHash  []byte        `tlb:"bits 256"`
	PrevTxLT    uint64        `tlb:"## 64"`
	Now         uint32        `tlb:"## 32"`
	OutMsgCount uint16        `tlb:"## 15"`
	OrigStatus  AccountStatus `tlb:"."`
	EndStatus   AccountStatus `tlb:"."`
	IO          struct {
		In  *Message      `tlb:"maybe ^"`
		Out *MessagesList `tlb:"maybe ^"`
	} `tlb:"^"`
	TotalFees   CurrencyCollection     `tlb:"."`
	StateUpdate HashUpdate             `tlb:"^"` // of Account
	Description TransactionDescription `tlb:"^"`

	// not in scheme, but will be filled based on request data for flexibility
	Hash []byte `tlb:"-"`
	// contains filtered or unexported fields
}

func (*Transaction) Dump

func (t *Transaction) Dump() string

func (*Transaction) String

func (t *Transaction) String() string

type TransactionDescription added in v1.7.0

type TransactionDescription struct {
	Description any `` /* 239-byte string literal not displayed */
}

type TransactionDescriptionMergeInstall added in v1.7.0

type TransactionDescriptionMergeInstall struct {
	SplitInfo          SplitMergeInfo `tlb:"."`
	PrepareTransaction *Transaction   `tlb:"^"`
	StoragePhase       *StoragePhase  `tlb:"maybe ."`
	CreditPhase        *CreditPhase   `tlb:"maybe ."`
	ComputePhase       ComputePhase   `tlb:"."`
	ActionPhase        *ActionPhase   `tlb:"maybe ^"`
	Aborted            bool           `tlb:"bool"`
	Destroyed          bool           `tlb:"bool"`
	// contains filtered or unexported fields
}

type TransactionDescriptionMergePrepare added in v1.7.0

type TransactionDescriptionMergePrepare struct {
	SplitInfo    SplitMergeInfo `tlb:"."`
	StoragePhase StoragePhase   `tlb:"."`
	Aborted      bool           `tlb:"bool"`
	// contains filtered or unexported fields
}

type TransactionDescriptionOrdinary added in v1.7.0

type TransactionDescriptionOrdinary struct {
	CreditFirst  bool          `tlb:"bool"`
	StoragePhase *StoragePhase `tlb:"maybe ."`
	CreditPhase  *CreditPhase  `tlb:"maybe ."`
	ComputePhase ComputePhase  `tlb:"."`
	ActionPhase  *ActionPhase  `tlb:"maybe ^"`
	Aborted      bool          `tlb:"bool"`
	BouncePhase  *BouncePhase  `tlb:"maybe ."`
	Destroyed    bool          `tlb:"bool"`
	// contains filtered or unexported fields
}

type TransactionDescriptionSplitInstall added in v1.7.0

type TransactionDescriptionSplitInstall struct {
	SplitInfo          SplitMergeInfo `tlb:"."`
	PrepareTransaction *Transaction   `tlb:"^"`
	Installed          bool           `tlb:"bool"`
	// contains filtered or unexported fields
}

type TransactionDescriptionSplitPrepare added in v1.7.0

type TransactionDescriptionSplitPrepare struct {
	SplitInfo    SplitMergeInfo `tlb:"."`
	StoragePhase *StoragePhase  `tlb:"maybe ."`
	ComputePhase ComputePhase   `tlb:"."`
	ActionPhase  *ActionPhase   `tlb:"maybe ^"`
	Aborted      bool           `tlb:"bool"`
	Destroyed    bool           `tlb:"bool"`
	// contains filtered or unexported fields
}

type TransactionDescriptionStorage added in v1.7.0

type TransactionDescriptionStorage struct {
	StoragePhase StoragePhase `tlb:"."`
	// contains filtered or unexported fields
}

type TransactionDescriptionTickTock added in v1.7.0

type TransactionDescriptionTickTock struct {
	IsTock       bool         `tlb:"bool"`
	StoragePhase StoragePhase `tlb:"."`
	ComputePhase ComputePhase `tlb:"."`
	ActionPhase  *ActionPhase `tlb:"maybe ^"`
	Aborted      bool         `tlb:"bool"`
	Destroyed    bool         `tlb:"bool"`
	// contains filtered or unexported fields
}

type Unmarshaler added in v1.8.3

type Unmarshaler interface {
	LoadFromCell(loader *cell.Slice) error
}

type Validator added in v1.6.0

type Validator struct {
	PublicKey SigPubKeyED25519 `tlb:"."`
	Weight    uint64           `tlb:"## 64"`
	// contains filtered or unexported fields
}

type ValidatorAddr added in v1.6.0

type ValidatorAddr struct {
	PublicKey SigPubKeyED25519 `tlb:"."`
	Weight    uint64           `tlb:"## 64"`
	ADNLAddr  []byte           `tlb:"bits 256"`
	// contains filtered or unexported fields
}

type ValidatorInfo added in v1.8.0

type ValidatorInfo struct {
	ValidatorListHashShort uint32 `tlb:"## 32"`
	CatchainSeqno          uint32 `tlb:"## 32"`
	NextCCUpdated          bool   `tlb:"bool"`
}

type ValidatorSet added in v1.6.0

type ValidatorSet struct {
	UTimeSince uint32           `tlb:"## 32"`
	UTimeUntil uint32           `tlb:"## 32"`
	Total      uint16           `tlb:"## 16"`
	Main       uint16           `tlb:"## 16"`
	List       *cell.Dictionary `tlb:"dict 16"`
	// contains filtered or unexported fields
}

type ValidatorSetAny added in v1.8.0

type ValidatorSetAny struct {
	Validators any `tlb:"[ValidatorSet,ValidatorSetExt]"`
}

type ValidatorSetExt added in v1.6.0

type ValidatorSetExt struct {
	UTimeSince  uint32           `tlb:"## 32"`
	UTimeUntil  uint32           `tlb:"## 32"`
	Total       uint16           `tlb:"## 16"`
	Main        uint16           `tlb:"## 16"`
	TotalWeight uint64           `tlb:"## 64"`
	List        *cell.Dictionary `tlb:"dict 16"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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