ton

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 12 Imported by: 112

Documentation

Index

Constants

View Source
const (
	ErrCodeContractNotInitialized = 4294967040
)

Variables

View Source
var ErrBlockNotFound = errors.New("block not found")
View Source
var ErrIncorrectResultType = errors.New("incorrect result type")
View Source
var ErrMessageNotAccepted = errors.New("message was not accepted by the contract")
View Source
var ErrNoNewBlocks = errors.New("no new blocks in a given timeout or in 10 seconds")
View Source
var ErrResultIndexOutOfRange = errors.New("result index is out of range")

Functions

This section is empty.

Types

type APIClient

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

func NewAPIClient

func NewAPIClient(client LiteClient) *APIClient

func (*APIClient) Client added in v1.3.0

func (c *APIClient) Client() LiteClient

func (*APIClient) CurrentMasterchainInfo added in v1.1.0

func (c *APIClient) CurrentMasterchainInfo(ctx context.Context) (_ *tlb.BlockInfo, err error)

CurrentMasterchainInfo - cached version of GetMasterchainInfo to not do it in parallel many times

func (*APIClient) GetAccount added in v0.3.0

func (c *APIClient) GetAccount(ctx context.Context, block *tlb.BlockInfo, addr *address.Address) (*tlb.Account, error)

func (*APIClient) GetBlockData added in v0.8.0

func (c *APIClient) GetBlockData(ctx context.Context, block *tlb.BlockInfo) (*tlb.Block, error)

GetBlockData - get block detailed information

func (*APIClient) GetBlockShardsInfo added in v0.9.0

func (c *APIClient) GetBlockShardsInfo(ctx context.Context, master *tlb.BlockInfo) ([]*tlb.BlockInfo, error)

GetBlockShardsInfo - gets the information about workchains and its shards at given masterchain state

func (*APIClient) GetBlockTransactions added in v0.8.0

func (c *APIClient) GetBlockTransactions(ctx context.Context, block *tlb.BlockInfo, count uint32, after ...*tlb.TransactionID) ([]*tlb.TransactionID, bool, error)

GetBlockTransactions - list of block transactions

func (*APIClient) GetBlockchainConfig added in v1.4.0

func (c *APIClient) GetBlockchainConfig(ctx context.Context, block *tlb.BlockInfo, onlyParams ...int32) (*BlockchainConfig, error)

func (*APIClient) GetMasterchainInfo added in v0.9.0

func (c *APIClient) GetMasterchainInfo(ctx context.Context) (*tlb.BlockInfo, error)

GetMasterchainInfo - gets the latest state of master chain

func (*APIClient) GetTime added in v1.4.0

func (c *APIClient) GetTime(ctx context.Context) (uint32, error)

func (*APIClient) GetTransaction added in v0.9.0

func (c *APIClient) GetTransaction(ctx context.Context, block *tlb.BlockInfo, addr *address.Address, lt uint64) (*tlb.Transaction, error)

func (*APIClient) ListTransactions added in v0.5.0

func (c *APIClient) ListTransactions(ctx context.Context, addr *address.Address, limit uint32, lt uint64, txHash []byte) ([]*tlb.Transaction, error)

ListTransactions - returns list of transactions before (including) passed lt and hash, the oldest one is first in result slice

func (*APIClient) LookupBlock added in v0.9.0

func (c *APIClient) LookupBlock(ctx context.Context, workchain int32, shard int64, seqno uint32) (*tlb.BlockInfo, error)

LookupBlock - find block information by seqno, shard and chain

func (*APIClient) RunGetMethod

func (c *APIClient) RunGetMethod(ctx context.Context, blockInfo *tlb.BlockInfo, addr *address.Address, method string, params ...any) (*ExecutionResult, error)

func (*APIClient) SendExternalMessage added in v0.4.0

func (c *APIClient) SendExternalMessage(ctx context.Context, msg *tlb.ExternalMessage) error

func (*APIClient) WaitNextMasterBlock added in v1.3.0

func (c *APIClient) WaitNextMasterBlock(ctx context.Context, master *tlb.BlockInfo) (*tlb.BlockInfo, error)

type BlockchainConfig added in v1.4.0

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

func (*BlockchainConfig) All added in v1.4.0

func (b *BlockchainConfig) All() map[int32]*cell.Cell

func (*BlockchainConfig) Get added in v1.4.0

func (b *BlockchainConfig) Get(id int32) *cell.Cell

type ContractExecError added in v0.7.2

type ContractExecError struct {
	Code uint32
}

func (ContractExecError) Error added in v0.7.2

func (e ContractExecError) Error() string

func (ContractExecError) Is added in v0.7.2

func (e ContractExecError) Is(err error) bool

type ExecutionResult added in v1.3.0

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

func NewExecutionResult added in v1.3.0

func NewExecutionResult(data []any) *ExecutionResult

func (ExecutionResult) AsTuple added in v1.3.0

func (r ExecutionResult) AsTuple() []any

func (ExecutionResult) Builder added in v1.3.0

func (r ExecutionResult) Builder(index uint) (*cell.Builder, error)

func (ExecutionResult) Cell added in v1.3.0

func (r ExecutionResult) Cell(index uint) (*cell.Cell, error)

func (ExecutionResult) Int added in v1.3.0

func (r ExecutionResult) Int(index uint) (*big.Int, error)

func (ExecutionResult) IsNil added in v1.3.0

func (r ExecutionResult) IsNil(index uint) (bool, error)

func (ExecutionResult) MustBuilder added in v1.3.0

func (r ExecutionResult) MustBuilder(index uint) *cell.Builder

func (ExecutionResult) MustCell added in v1.3.0

func (r ExecutionResult) MustCell(index uint) *cell.Cell

func (ExecutionResult) MustInt added in v1.3.0

func (r ExecutionResult) MustInt(index uint) *big.Int

func (ExecutionResult) MustIsNil added in v1.3.0

func (r ExecutionResult) MustIsNil(index uint) bool

func (ExecutionResult) MustSlice added in v1.3.0

func (r ExecutionResult) MustSlice(index uint) *cell.Slice

func (ExecutionResult) MustTuple added in v1.3.0

func (r ExecutionResult) MustTuple(index uint) []any

func (ExecutionResult) Slice added in v1.3.0

func (r ExecutionResult) Slice(index uint) (*cell.Slice, error)

func (ExecutionResult) Tuple added in v1.3.0

func (r ExecutionResult) Tuple(index uint) ([]any, error)

type LSError

type LSError struct {
	Code int32
	Text string
}

func (LSError) Error added in v0.7.2

func (e LSError) Error() string

func (LSError) Is added in v0.7.2

func (e LSError) Is(err error) bool

func (*LSError) Load added in v1.0.0

func (e *LSError) Load(data []byte) ([]byte, error)

type LiteClient

type LiteClient interface {
	Do(ctx context.Context, typeID int32, payload []byte) (*liteclient.LiteResponse, error)
	StickyContext(ctx context.Context) context.Context
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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