Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertShardIdentToShard(si ShardIdent) (workchain int32, shard uint64)
- func LoadFromCell(v any, loader *cell.Slice, skipMagic ...bool) error
- func MethodNameHash(name string) uint64
- func ToCell(v any) (*cell.Cell, error)
- type AccStatusChange
- type AccStatusChangeType
- type Account
- type AccountBlock
- type AccountState
- type AccountStatus
- type AccountStorage
- type ActionPhase
- type AllShardsInfo
- type AnyMessage
- type BinTree
- type BlkPrevInfo
- type Block
- type BlockExtra
- type BlockHeader
- type BlockInfodeprecated
- type BouncePhase
- type BouncePhaseNegFunds
- type BouncePhaseNoFunds
- type BouncePhaseOk
- type Coins
- type ComputePhase
- type ComputePhaseSkipped
- type ComputePhaseVM
- type ComputeSkipReason
- type ComputeSkipReasonType
- type ConfigParams
- type CreditPhase
- type CurrencyCollection
- type DepthBalanceInfo
- type ExtBlkRef
- type ExternalMessage
- type ExternalMessageOut
- type GlobalVersion
- type HashUpdate
- type InternalMessage
- type Magic
- type McBlockExtra
- type McStateExtra
- type Message
- type MessagesList
- type MsgType
- type ShardAccountBlocks
- type ShardDesc
- type ShardIdent
- type ShardState
- type ShardStateUnsplit
- type SigPubKeyED25519
- type SplitMergeInfo
- type Stack
- type StackElement
- type StackNaN
- type StateInit
- type StateUpdate
- type StorageInfo
- type StoragePhase
- type StorageUsed
- type StorageUsedShort
- type Text
- type TickTock
- type Transaction
- type TransactionDescription
- type TransactionDescriptionMergeInstall
- type TransactionDescriptionMergePrepare
- type TransactionDescriptionOrdinary
- type TransactionDescriptionSplitInstall
- type TransactionDescriptionSplitPrepare
- type TransactionDescriptionStorage
- type TransactionDescriptionTickTock
- type TransactionIDdeprecated
- type Validator
- type ValidatorAddr
- type ValidatorSet
- type ValidatorSetExt
Constants ¶
const ( AccountStatusActive = "ACTIVE" AccountStatusUninit = "UNINIT" AccountStatusFrozen = "FROZEN" AccountStatusNonExist = "NON_EXIST" )
const MaxTextChunkSize = 127 - 2
Variables ¶
var ErrStackEmpty = errors.New("stack is empty")
Functions ¶
func ConvertShardIdentToShard ¶ added in v1.4.0
func ConvertShardIdentToShard(si ShardIdent) (workchain int32, shard uint64)
func LoadFromCell ¶
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 N [-> array [^]] - loads dictionary with key size N, transformation '->' can be applied to convert dict to array, example: 'dict 256 -> array ^' will give you array of deserialized refs (^) of values 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 X Y - reads 1 bit, if its 0 - loads X, if 1 - loads Y 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 MethodNameHash ¶ added in v1.2.0
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
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
type AccountBlock ¶ added in v1.6.0
type AccountBlock struct {
Addr []byte `tlb:"bits 256"`
Transactions *cell.Dictionary `tlb:"dict 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
type AccountStorage ¶
type AccountStorage struct {
Status AccountStatus
LastTransactionLT uint64
Balance Coins
// 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 BlkPrevInfo ¶ added in v1.4.0
type Block ¶
type Block struct {
GlobalID int32 `tlb:"## 32"`
BlockInfo BlockHeader `tlb:"^"`
ValueFlow *cell.Cell `tlb:"^"`
StateUpdate StateUpdate `tlb:"^"`
Extra *BlockExtra `tlb:"^"`
// contains filtered or unexported fields
}
type BlockExtra ¶
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 BouncePhase ¶ added in v1.7.0
type BouncePhase struct {
Phase any `tlb:"."`
}
func (*BouncePhase) LoadFromCell ¶ added in v1.7.0
func (b *BouncePhase) LoadFromCell(loader *cell.Slice) error
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 Coins ¶
type Coins struct {
// contains filtered or unexported fields
}
func FromNanoTON ¶
func FromNanoTONU ¶
func MustFromTON ¶
func (Coins) MarshalJSON ¶
type ComputePhase ¶ added in v1.7.0
type ComputePhase struct {
Phase any `tlb:"."`
}
func (*ComputePhase) LoadFromCell ¶ added in v1.7.0
func (c *ComputePhase) LoadFromCell(loader *cell.Slice) error
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
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 *address.Address
Config *cell.Dictionary
}
func (*ConfigParams) LoadFromCell ¶ added in v1.4.0
func (p *ConfigParams) LoadFromCell(loader *cell.Slice) error
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 ExternalMessage ¶
type ExternalMessage struct {
SrcAddr *address.Address `tlb:"addr"`
DstAddr *address.Address `tlb:"addr"`
ImportFee Coins `tlb:"."`
StateInit *StateInit `tlb:"maybe either . ^"`
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 . ^"`
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 GlobalVersion ¶ added in v1.4.0
type HashUpdate ¶ added in v1.7.0
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 . ^"`
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 McBlockExtra ¶
type McBlockExtra struct {
KeyBlock uint8 `tlb:"## 1"`
ShardHashes *cell.Dictionary `tlb:"dict 32"`
ShardFees *cell.Dictionary `tlb:"dict 96"`
// 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 Message ¶
type Message struct {
MsgType MsgType `tlb:"-"`
Msg AnyMessage `tlb:"."`
}
func (*Message) AsExternalIn ¶
func (m *Message) AsExternalIn() *ExternalMessage
func (*Message) AsExternalOut ¶
func (m *Message) AsExternalOut() *ExternalMessageOut
func (*Message) AsInternal ¶
func (m *Message) AsInternal() *InternalMessage
type MessagesList ¶ added in v1.7.0
type MessagesList struct {
List *cell.Dictionary
}
func (*MessagesList) LoadFromCell ¶ added in v1.7.0
func (m *MessagesList) LoadFromCell(loader *cell.Slice) error
func (*MessagesList) ToSlice ¶ added in v1.7.0
func (m *MessagesList) ToSlice() ([]Message, error)
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"`
// contains filtered or unexported fields
}
type ShardIdent ¶
type ShardState ¶
type ShardState struct {
Left ShardStateUnsplit
Right *ShardStateUnsplit
}
func (*ShardState) LoadFromCell ¶ added in v1.4.0
func (s *ShardState) LoadFromCell(loader *cell.Slice) error
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 *McStateExtra `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 StackElement ¶
type StackElement struct {
// contains filtered or unexported fields
}
type StateUpdate ¶
type StateUpdate struct {
Old ShardState `tlb:"^"`
New *cell.Cell `tlb:"^"`
}
type StorageInfo ¶
type StorageInfo struct {
StorageUsed StorageUsed
LastPaid uint32
DuePayment *big.Int
}
func (*StorageInfo) LoadFromCell ¶
func (s *StorageInfo) LoadFromCell(loader *cell.Slice) error
type StoragePhase ¶ added in v1.7.0
type StoragePhase struct {
StorageFeesCollected Coins `tlb:"."`
StorageFeesDue *Coins `tlb:"maybe ."`
StatusChange AccStatusChange `tlb:"."`
}
type StorageUsed ¶
func (*StorageUsed) LoadFromCell ¶
func (s *StorageUsed) LoadFromCell(loader *cell.Slice) error
type StorageUsedShort ¶ added in v1.7.0
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 `tlb:"."`
}
func (*TransactionDescription) LoadFromCell ¶ added in v1.7.0
func (t *TransactionDescription) LoadFromCell(loader *cell.Slice) error
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 TransactionID
deprecated
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
}