Documentation
¶
Index ¶
- Constants
- Variables
- func LoadFromCell(v any, loader *cell.Slice) error
- func ToCell(v any) (*cell.Cell, error)
- type Account
- type AccountState
- type AccountStatus
- type AccountStorage
- type AllShardsInfo
- type AnyMessage
- type BinTree
- type Block
- type BlockExtra
- type BlockInfo
- type Coins
- type CurrencyCollection
- type DepthBalanceInfo
- type ExternalMessage
- type ExternalMessageOut
- type InternalMessage
- type Magic
- type McBlockExtra
- type Message
- type MsgType
- type ShardDesc
- type ShardIdent
- type ShardState
- type Stack
- type StackElement
- type StackNaN
- type StateInit
- type StateUpdate
- type StorageInfo
- type StorageUsed
- type TickTock
- type Transaction
- type TransactionID
Constants ¶
const ( AccountStatusActive = "ACTIVE" AccountStatusUninit = "UNINIT" AccountStatusFrozen = "FROZEN" AccountStatusNonExist = "NON_EXIST" )
Variables ¶
var ErrStackEmpty = errors.New("stack is empty")
Functions ¶
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"
Types ¶
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
}
func (*AccountStorage) LoadFromCell ¶
func (s *AccountStorage) LoadFromCell(loader *cell.Slice) error
type AllShardsInfo ¶
type AllShardsInfo struct {
ShardHashes *cell.Dictionary `tlb:"dict 32"`
}
type AnyMessage ¶
type Block ¶
type Block struct {
GlobalID int32 `tlb:"## 32"`
BlockInfo *cell.Cell `tlb:"^"`
ValueFlow *cell.Cell `tlb:"^"`
StateUpdate StateUpdate `tlb:"^"`
Extra *BlockExtra `tlb:"^"`
// contains filtered or unexported fields
}
type BlockExtra ¶
type Coins ¶
type Coins struct {
// contains filtered or unexported fields
}
func FromNanoTON ¶
func FromNanoTONU ¶
func MustFromTON ¶
func (Coins) MarshalJSON ¶
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 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 Message ¶
type Message struct {
MsgType MsgType
Msg AnyMessage
}
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 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 {
GlobalID int32 `tlb:"## 32"`
ShardIdent ShardIdent `tlb:"."`
Seqno uint32 `tlb:"## 32"`
OutMsgQueueInfo *cell.Cell `tlb:"^"`
Accounts struct {
ShardAccounts *cell.Dictionary `tlb:"dict 256"`
} `tlb:"^"`
// contains filtered or unexported fields
}
type StackElement ¶
type StackElement struct {
// contains filtered or unexported fields
}
type StateInit ¶
type StateUpdate ¶
type StateUpdate struct {
Old ShardState `tlb:"^"`
New ShardState `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 StorageUsed ¶
func (*StorageUsed) LoadFromCell ¶
func (s *StorageUsed) LoadFromCell(loader *cell.Slice) error
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 []*Message `tlb:"dict 15 -> array ^"`
} `tlb:"^"`
TotalFees CurrencyCollection `tlb:"."`
StateUpdate *cell.Cell `tlb:"^"`
Description *cell.Cell `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