ton

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 15 Imported by: 35

Documentation

Index

Constants

View Source
const OneTON tlb.Grams = 1_000_000_000

Variables

This section is empty.

Functions

func CreateExternalMessage

func CreateExternalMessage(address AccountID, body *boc.Cell, init *tlb.StateInit, importFee tlb.Grams) (tlb.Message, error)

Types

type AccountID

type AccountID struct {
	Workchain int32
	Address   [32]byte
}

func AccountIDFromBase64Url

func AccountIDFromBase64Url(s string) (AccountID, error)

func AccountIDFromRaw

func AccountIDFromRaw(s string) (AccountID, error)

func AccountIDFromTlb

func AccountIDFromTlb(a tlb.MsgAddress) (*AccountID, error)

TODO: replace pointer with nullable type

func MustParseAccountID

func MustParseAccountID(s string) AccountID

func NewAccountID added in v1.3.0

func NewAccountID(id int32, addr [32]byte) *AccountID

func ParseAccountID

func ParseAccountID(s string) (AccountID, error)

func (AccountID) IsZero

func (id AccountID) IsZero() bool

func (AccountID) MarshalJSON

func (id AccountID) MarshalJSON() ([]byte, error)

func (AccountID) MarshalTL

func (id AccountID) MarshalTL() ([]byte, error)

func (AccountID) String

func (id AccountID) String() string

func (AccountID) ToHuman

func (id AccountID) ToHuman(bounce, testnet bool) string

func (*AccountID) ToMsgAddress

func (id *AccountID) ToMsgAddress() tlb.MsgAddress

func (AccountID) ToRaw

func (id AccountID) ToRaw() string

func (*AccountID) UnmarshalJSON

func (id *AccountID) UnmarshalJSON(data []byte) error

func (*AccountID) UnmarshalTL

func (id *AccountID) UnmarshalTL(r io.Reader) error

type Address

type Address struct {
	ID        AccountID
	Bounce    bool
	StateInit *tlb.StateInit
}

Address identifies an account in the TON network. Comparing to AccountID which is a low-level identifier of a smart contract, Address is a high-level abstraction containing additional information besides AccountID, which is useful for building more advanced workflows.

type Bits256

type Bits256 tlb.Bits256

func MustParseHash

func MustParseHash(s string) Bits256

func ParseHash

func ParseHash(s string) (Bits256, error)

func (Bits256) Base64

func (h Bits256) Base64() string

func (*Bits256) FromBase64

func (h *Bits256) FromBase64(s string) error

func (*Bits256) FromBase64URL

func (h *Bits256) FromBase64URL(s string) error

func (*Bits256) FromBytes

func (h *Bits256) FromBytes(b []byte) error

func (*Bits256) FromHex

func (h *Bits256) FromHex(s string) error

func (*Bits256) FromUnknownString

func (h *Bits256) FromUnknownString(s string) error

func (Bits256) Hex

func (h Bits256) Hex() string

func (Bits256) MarshalJSON

func (b Bits256) MarshalJSON() ([]byte, error)

func (*Bits256) Scan

func (h *Bits256) Scan(src interface{}) error

Scan implements Scanner for database/sql.

func (*Bits256) UnmarshalJSON

func (b *Bits256) UnmarshalJSON(buf []byte) error

func (Bits256) Value

func (h Bits256) Value() (driver.Value, error)

Value implements valuer for database/sql.

type BlockID

type BlockID struct {
	Workchain int32
	Shard     uint64
	Seqno     uint32
}

func MustParseBlockID

func MustParseBlockID(s string) BlockID

func ParseBlockID

func ParseBlockID(s string) (BlockID, error)

ParseBlockID tries to construct BlockID from the given string.

func (BlockID) String

func (id BlockID) String() string

type BlockIDExt

type BlockIDExt struct {
	BlockID
	RootHash Bits256
	FileHash Bits256
}

func GetParents

func GetParents(i tlb.BlockInfo) ([]BlockIDExt, error)

func NewTonBlockId

func NewTonBlockId(fileHash, rootHash Bits256, seqno uint32, shard uint64, workchain int32) *BlockIDExt

func ShardIDs

func ShardIDs(blk *tlb.Block) []BlockIDExt

ShardIDs returns a list of IDs of shard blocks this block refers to.

func ToBlockId

func ToBlockId(s tlb.ShardDesc, workchain int32) BlockIDExt

func (BlockIDExt) MarshalTL

func (id BlockIDExt) MarshalTL() ([]byte, error)

func (BlockIDExt) String

func (id BlockIDExt) String() string

func (*BlockIDExt) UnmarshalTL

func (id *BlockIDExt) UnmarshalTL(data []byte) error

type ShardID

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

func MustParseShardID

func MustParseShardID(m int64) ShardID

func ParseShardID

func ParseShardID(m int64) (ShardID, error)

func (ShardID) Encode

func (s ShardID) Encode() int64

func (ShardID) MatchAccountID

func (s ShardID) MatchAccountID(a AccountID) bool

func (ShardID) MatchBlockID

func (s ShardID) MatchBlockID(block BlockID) bool

type Transaction

type Transaction struct {
	tlb.Transaction
	BlockID BlockIDExt
}

Jump to

Keyboard shortcuts

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