liteclient

package
v0.0.0-...-a9c7d36 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 24 Imported by: 0

README

ADNL pure-golang implementation.

This library implements ADNL protocol to communicate with TON nodes at low level.

Protocol description you can find here:

Usage

Example

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBlockNotApplied = fmt.Errorf("block is not applied")
)

Functions

func IsClientError

func IsClientError(err error) bool

func IsNotConnectedYet

func IsNotConnectedYet(e error) bool

Types

type Address

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

func NewAddress

func NewAddress(key []byte) (Address, error)

type AdnlMessage

type AdnlMessage struct {
	tl.SumType
	AdnlMessageQuery struct {
		QueryId tl.Int256
		Query   []byte
	}
	AdnlMessageAnswer struct {
		QueryId tl.Int256
		Answer  []byte
	}
}

func (AdnlMessage) MarshalTL

func (t AdnlMessage) MarshalTL() ([]byte, error)

func (*AdnlMessage) UnmarshalTL

func (t *AdnlMessage) UnmarshalTL(r io.Reader) error

type Client

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

func NewClient

func NewClient(c *Connection, opts ...Options) *Client

func (*Client) AverageRoundTrip

func (c *Client) AverageRoundTrip() time.Duration

func (*Client) IsOK

func (c *Client) IsOK() bool

IsOK returns true if there is no problems with this client and its underlying connection to a lite server.

func (*Client) LiteProxyGetRequestRateLimit

func (c *Client) LiteProxyGetRequestRateLimit(ctx context.Context) (res LiteProxyRequestRateLimitC, err error)

func (*Client) LiteServerGetAccountState

func (c *Client) LiteServerGetAccountState(ctx context.Context, request LiteServerGetAccountStateRequest) (res LiteServerAccountStateC, err error)

func (*Client) LiteServerGetAccountStatePrunned

func (c *Client) LiteServerGetAccountStatePrunned(ctx context.Context, request LiteServerGetAccountStatePrunnedRequest) (res LiteServerAccountStateC, err error)

func (*Client) LiteServerGetAllShardsInfo

func (c *Client) LiteServerGetAllShardsInfo(ctx context.Context, request LiteServerGetAllShardsInfoRequest) (res LiteServerAllShardsInfoC, err error)

func (*Client) LiteServerGetBlock

func (c *Client) LiteServerGetBlock(ctx context.Context, request LiteServerGetBlockRequest) (res LiteServerBlockDataC, err error)

func (*Client) LiteServerGetBlockHeader

func (c *Client) LiteServerGetBlockHeader(ctx context.Context, request LiteServerGetBlockHeaderRequest) (res LiteServerBlockHeaderC, err error)

func (*Client) LiteServerGetBlockProof

func (c *Client) LiteServerGetBlockProof(ctx context.Context, request LiteServerGetBlockProofRequest) (res LiteServerPartialBlockProofC, err error)

func (*Client) LiteServerGetConfigAll

func (c *Client) LiteServerGetConfigAll(ctx context.Context, request LiteServerGetConfigAllRequest) (res LiteServerConfigInfoC, err error)

func (*Client) LiteServerGetConfigParams

func (c *Client) LiteServerGetConfigParams(ctx context.Context, request LiteServerGetConfigParamsRequest) (res LiteServerConfigInfoC, err error)

func (*Client) LiteServerGetDispatchQueueInfo

func (c *Client) LiteServerGetDispatchQueueInfo(ctx context.Context, request LiteServerGetDispatchQueueInfoRequest) (res LiteServerDispatchQueueInfoC, err error)

func (*Client) LiteServerGetLibraries

func (c *Client) LiteServerGetLibraries(ctx context.Context, request LiteServerGetLibrariesRequest) (res LiteServerLibraryResultC, err error)

func (*Client) LiteServerGetLibrariesWithProof

func (c *Client) LiteServerGetLibrariesWithProof(ctx context.Context, request LiteServerGetLibrariesWithProofRequest) (res LiteServerLibraryResultWithProofC, err error)

func (*Client) LiteServerGetMasterchainInfo

func (c *Client) LiteServerGetMasterchainInfo(ctx context.Context) (res LiteServerMasterchainInfoC, err error)

func (*Client) LiteServerGetMasterchainInfoExt

func (c *Client) LiteServerGetMasterchainInfoExt(ctx context.Context, request LiteServerGetMasterchainInfoExtRequest) (res LiteServerMasterchainInfoExtC, err error)

func (*Client) LiteServerGetOneTransaction

func (c *Client) LiteServerGetOneTransaction(ctx context.Context, request LiteServerGetOneTransactionRequest) (res LiteServerTransactionInfoC, err error)

func (*Client) LiteServerGetOutMsgQueueSizes

func (c *Client) LiteServerGetOutMsgQueueSizes(ctx context.Context, request LiteServerGetOutMsgQueueSizesRequest) (res LiteServerOutMsgQueueSizesC, err error)

func (*Client) LiteServerGetShardBlockProof

func (c *Client) LiteServerGetShardBlockProof(ctx context.Context, request LiteServerGetShardBlockProofRequest) (res LiteServerShardBlockProofC, err error)

func (*Client) LiteServerGetShardInfo

func (c *Client) LiteServerGetShardInfo(ctx context.Context, request LiteServerGetShardInfoRequest) (res LiteServerShardInfoC, err error)

func (*Client) LiteServerGetState

func (c *Client) LiteServerGetState(ctx context.Context, request LiteServerGetStateRequest) (res LiteServerBlockStateC, err error)

func (*Client) LiteServerGetTime

func (c *Client) LiteServerGetTime(ctx context.Context) (res LiteServerCurrentTimeC, err error)

func (*Client) LiteServerGetTransactions

func (c *Client) LiteServerGetTransactions(ctx context.Context, request LiteServerGetTransactionsRequest) (res LiteServerTransactionListC, err error)

func (*Client) LiteServerGetValidatorStats

func (c *Client) LiteServerGetValidatorStats(ctx context.Context, request LiteServerGetValidatorStatsRequest) (res LiteServerValidatorStatsC, err error)

func (*Client) LiteServerGetVersion

func (c *Client) LiteServerGetVersion(ctx context.Context) (res LiteServerVersionC, err error)

func (*Client) LiteServerListBlockTransactions

func (c *Client) LiteServerListBlockTransactions(ctx context.Context, request LiteServerListBlockTransactionsRequest) (res LiteServerBlockTransactionsC, err error)

func (*Client) LiteServerListBlockTransactionsExt

func (c *Client) LiteServerListBlockTransactionsExt(ctx context.Context, request LiteServerListBlockTransactionsExtRequest) (res LiteServerBlockTransactionsExtC, err error)

func (*Client) LiteServerLookupBlock

func (c *Client) LiteServerLookupBlock(ctx context.Context, request LiteServerLookupBlockRequest) (res LiteServerBlockHeaderC, err error)

func (*Client) LiteServerLookupBlockWithProof

func (c *Client) LiteServerLookupBlockWithProof(ctx context.Context, request LiteServerLookupBlockWithProofRequest) (res LiteServerLookupBlockResultC, err error)

func (*Client) LiteServerRunSmcMethod

func (c *Client) LiteServerRunSmcMethod(ctx context.Context, request LiteServerRunSmcMethodRequest) (res LiteServerRunMethodResultC, err error)

func (*Client) LiteServerSendMessage

func (c *Client) LiteServerSendMessage(ctx context.Context, request LiteServerSendMessageRequest) (res LiteServerSendMsgStatusC, err error)

func (*Client) Request

func (c *Client) Request(ctx context.Context, q []byte) ([]byte, error)

Request sends q as query in adnl.message.query and receives answer from adnl.message.answer adnl.message.query query_id:int256 query:bytes = adnl.Message adnl.message.answer query_id:int256 answer:bytes = adnl.Message

func (*Client) WaitMasterchainBlock

func (c *Client) WaitMasterchainBlock(ctx context.Context, seqno uint32, timeout uint32) (res LiteServerBlockHeaderC, err error)

func (*Client) WaitMasterchainSeqno

func (c *Client) WaitMasterchainSeqno(ctx context.Context, seqno uint32, timeout uint32) error

WaitMasterchainSeqno waits for the given block to become committed. If timeout happens, it returns an error.

type Connection

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

func NewConnection

func NewConnection(ctx context.Context, peerPublicKey []byte, host string) (*Connection, error)

func (*Connection) AverageRoundTrip

func (c *Connection) AverageRoundTrip() time.Duration

AverageRoundTrip returns an average round trip of the last several pings.

func (*Connection) Responses

func (c *Connection) Responses() chan Packet

func (*Connection) Send

func (c *Connection) Send(p Packet) error

func (*Connection) Status

func (c *Connection) Status() ConnectionStatus

type ConnectionStatus

type ConnectionStatus int
const (
	Connecting ConnectionStatus = iota
	Connected
)

type LiteProxyGetRequestRateLimitRequest

type LiteProxyGetRequestRateLimitRequest struct{}

func (*LiteProxyGetRequestRateLimitRequest) UnmarshalTL

type LiteProxyRequestRateLimitC

type LiteProxyRequestRateLimitC struct {
	Limit   uint32
	PerTime uint32
}

func (LiteProxyRequestRateLimitC) MarshalTL

func (t LiteProxyRequestRateLimitC) MarshalTL() ([]byte, error)

func (*LiteProxyRequestRateLimitC) UnmarshalTL

func (t *LiteProxyRequestRateLimitC) UnmarshalTL(r io.Reader) error

type LiteServerAccountDispatchQueueInfoC

type LiteServerAccountDispatchQueueInfoC struct {
	Addr  tl.Int256
	Size  uint64
	MinLt uint64
	MaxLt uint64
}

func (LiteServerAccountDispatchQueueInfoC) MarshalTL

func (t LiteServerAccountDispatchQueueInfoC) MarshalTL() ([]byte, error)

func (*LiteServerAccountDispatchQueueInfoC) UnmarshalTL

type LiteServerAccountIdC

type LiteServerAccountIdC struct {
	Workchain uint32
	Id        tl.Int256
}

func AccountID

func AccountID(id ton.AccountID) LiteServerAccountIdC

func (LiteServerAccountIdC) MarshalTL

func (t LiteServerAccountIdC) MarshalTL() ([]byte, error)

func (*LiteServerAccountIdC) UnmarshalTL

func (t *LiteServerAccountIdC) UnmarshalTL(r io.Reader) error

type LiteServerAccountStateC

type LiteServerAccountStateC struct {
	Id         TonNodeBlockIdExtC
	Shardblk   TonNodeBlockIdExtC
	ShardProof []byte
	Proof      []byte
	State      []byte
}

func (LiteServerAccountStateC) MarshalTL

func (t LiteServerAccountStateC) MarshalTL() ([]byte, error)

func (*LiteServerAccountStateC) UnmarshalTL

func (t *LiteServerAccountStateC) UnmarshalTL(r io.Reader) error

type LiteServerAllShardsInfoC

type LiteServerAllShardsInfoC struct {
	Id    TonNodeBlockIdExtC
	Proof []byte
	Data  []byte
}

func (LiteServerAllShardsInfoC) MarshalTL

func (t LiteServerAllShardsInfoC) MarshalTL() ([]byte, error)

func (*LiteServerAllShardsInfoC) UnmarshalTL

func (t *LiteServerAllShardsInfoC) UnmarshalTL(r io.Reader) error

type LiteServerBlockDataC

type LiteServerBlockDataC struct {
	Id   TonNodeBlockIdExtC
	Data []byte
}

func (LiteServerBlockDataC) MarshalTL

func (t LiteServerBlockDataC) MarshalTL() ([]byte, error)

func (*LiteServerBlockDataC) UnmarshalTL

func (t *LiteServerBlockDataC) UnmarshalTL(r io.Reader) error

type LiteServerBlockHeaderC

type LiteServerBlockHeaderC struct {
	Id          TonNodeBlockIdExtC
	Mode        uint32
	HeaderProof []byte
}

func (LiteServerBlockHeaderC) MarshalTL

func (t LiteServerBlockHeaderC) MarshalTL() ([]byte, error)

func (*LiteServerBlockHeaderC) UnmarshalTL

func (t *LiteServerBlockHeaderC) UnmarshalTL(r io.Reader) error
type LiteServerBlockLink struct {
	tl.SumType
	LiteServerBlockLinkBack struct {
		ToKeyBlock bool
		From       TonNodeBlockIdExtC
		To         TonNodeBlockIdExtC
		DestProof  []byte
		Proof      []byte
		StateProof []byte
	}
	LiteServerBlockLinkForward struct {
		ToKeyBlock  bool
		From        TonNodeBlockIdExtC
		To          TonNodeBlockIdExtC
		DestProof   []byte
		ConfigProof []byte
		Signatures  LiteServerSignatureSet
	}
}

func (LiteServerBlockLink) MarshalTL

func (t LiteServerBlockLink) MarshalTL() ([]byte, error)

func (*LiteServerBlockLink) UnmarshalTL

func (t *LiteServerBlockLink) UnmarshalTL(r io.Reader) error

type LiteServerBlockStateC

type LiteServerBlockStateC struct {
	Id       TonNodeBlockIdExtC
	RootHash tl.Int256
	FileHash tl.Int256
	Data     []byte
}

func (LiteServerBlockStateC) MarshalTL

func (t LiteServerBlockStateC) MarshalTL() ([]byte, error)

func (*LiteServerBlockStateC) UnmarshalTL

func (t *LiteServerBlockStateC) UnmarshalTL(r io.Reader) error

type LiteServerBlockTransactionsC

type LiteServerBlockTransactionsC struct {
	Id         TonNodeBlockIdExtC
	ReqCount   uint32
	Incomplete bool
	Ids        []LiteServerTransactionIdC
	Proof      []byte
}

func (LiteServerBlockTransactionsC) MarshalTL

func (t LiteServerBlockTransactionsC) MarshalTL() ([]byte, error)

func (*LiteServerBlockTransactionsC) UnmarshalTL

func (t *LiteServerBlockTransactionsC) UnmarshalTL(r io.Reader) error

type LiteServerBlockTransactionsExtC

type LiteServerBlockTransactionsExtC struct {
	Id           TonNodeBlockIdExtC
	ReqCount     uint32
	Incomplete   bool
	Transactions []byte
	Proof        []byte
}

func (LiteServerBlockTransactionsExtC) MarshalTL

func (t LiteServerBlockTransactionsExtC) MarshalTL() ([]byte, error)

func (*LiteServerBlockTransactionsExtC) UnmarshalTL

func (t *LiteServerBlockTransactionsExtC) UnmarshalTL(r io.Reader) error

type LiteServerConfigInfoC

type LiteServerConfigInfoC struct {
	Mode        uint32
	Id          TonNodeBlockIdExtC
	StateProof  []byte
	ConfigProof []byte
}

func (LiteServerConfigInfoC) MarshalTL

func (t LiteServerConfigInfoC) MarshalTL() ([]byte, error)

func (*LiteServerConfigInfoC) UnmarshalTL

func (t *LiteServerConfigInfoC) UnmarshalTL(r io.Reader) error

type LiteServerCurrentTimeC

type LiteServerCurrentTimeC struct {
	Now uint32
}

func (LiteServerCurrentTimeC) MarshalTL

func (t LiteServerCurrentTimeC) MarshalTL() ([]byte, error)

func (*LiteServerCurrentTimeC) UnmarshalTL

func (t *LiteServerCurrentTimeC) UnmarshalTL(r io.Reader) error

type LiteServerDebugVerbosityC

type LiteServerDebugVerbosityC struct {
	Value uint32
}

func (LiteServerDebugVerbosityC) MarshalTL

func (t LiteServerDebugVerbosityC) MarshalTL() ([]byte, error)

func (*LiteServerDebugVerbosityC) UnmarshalTL

func (t *LiteServerDebugVerbosityC) UnmarshalTL(r io.Reader) error

type LiteServerDispatchQueueInfoC

type LiteServerDispatchQueueInfoC struct {
	Mode                  uint32
	Id                    TonNodeBlockIdExtC
	AccountDispatchQueues []LiteServerAccountDispatchQueueInfoC
	Complete              bool
	Proof                 []byte
}

func (LiteServerDispatchQueueInfoC) MarshalTL

func (t LiteServerDispatchQueueInfoC) MarshalTL() ([]byte, error)

func (*LiteServerDispatchQueueInfoC) UnmarshalTL

func (t *LiteServerDispatchQueueInfoC) UnmarshalTL(r io.Reader) error

type LiteServerErrorC

type LiteServerErrorC struct {
	Code    uint32
	Message string
}

func (LiteServerErrorC) Error

func (t LiteServerErrorC) Error() string

func (LiteServerErrorC) IsNotApplied

func (t LiteServerErrorC) IsNotApplied() bool

func (LiteServerErrorC) MarshalTL

func (t LiteServerErrorC) MarshalTL() ([]byte, error)

func (*LiteServerErrorC) UnmarshalTL

func (t *LiteServerErrorC) UnmarshalTL(r io.Reader) error

type LiteServerGetAccountStatePrunnedRequest

type LiteServerGetAccountStatePrunnedRequest struct {
	Id      TonNodeBlockIdExtC
	Account LiteServerAccountIdC
}

func (LiteServerGetAccountStatePrunnedRequest) MarshalTL

func (*LiteServerGetAccountStatePrunnedRequest) UnmarshalTL

type LiteServerGetAccountStateRequest

type LiteServerGetAccountStateRequest struct {
	Id      TonNodeBlockIdExtC
	Account LiteServerAccountIdC
}

func (LiteServerGetAccountStateRequest) MarshalTL

func (t LiteServerGetAccountStateRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetAccountStateRequest) UnmarshalTL

func (t *LiteServerGetAccountStateRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetAllShardsInfoRequest

type LiteServerGetAllShardsInfoRequest struct {
	Id TonNodeBlockIdExtC
}

func (LiteServerGetAllShardsInfoRequest) MarshalTL

func (t LiteServerGetAllShardsInfoRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetAllShardsInfoRequest) UnmarshalTL

type LiteServerGetBlockHeaderRequest

type LiteServerGetBlockHeaderRequest struct {
	Id   TonNodeBlockIdExtC
	Mode uint32
}

func (LiteServerGetBlockHeaderRequest) MarshalTL

func (t LiteServerGetBlockHeaderRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetBlockHeaderRequest) UnmarshalTL

func (t *LiteServerGetBlockHeaderRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetBlockProofRequest

type LiteServerGetBlockProofRequest struct {
	Mode        uint32
	KnownBlock  TonNodeBlockIdExtC
	TargetBlock *TonNodeBlockIdExtC
}

func (LiteServerGetBlockProofRequest) MarshalTL

func (t LiteServerGetBlockProofRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetBlockProofRequest) UnmarshalTL

func (t *LiteServerGetBlockProofRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetBlockRequest

type LiteServerGetBlockRequest struct {
	Id TonNodeBlockIdExtC
}

func (LiteServerGetBlockRequest) MarshalTL

func (t LiteServerGetBlockRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetBlockRequest) UnmarshalTL

func (t *LiteServerGetBlockRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetConfigAllRequest

type LiteServerGetConfigAllRequest struct {
	Mode uint32
	Id   TonNodeBlockIdExtC
}

func (LiteServerGetConfigAllRequest) MarshalTL

func (t LiteServerGetConfigAllRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetConfigAllRequest) UnmarshalTL

func (t *LiteServerGetConfigAllRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetConfigParamsRequest

type LiteServerGetConfigParamsRequest struct {
	Mode      uint32
	Id        TonNodeBlockIdExtC
	ParamList []uint32
}

func (LiteServerGetConfigParamsRequest) MarshalTL

func (t LiteServerGetConfigParamsRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetConfigParamsRequest) UnmarshalTL

func (t *LiteServerGetConfigParamsRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetDispatchQueueInfoRequest

type LiteServerGetDispatchQueueInfoRequest struct {
	Mode        uint32
	Id          TonNodeBlockIdExtC
	AfterAddr   *tl.Int256
	MaxAccounts uint32
}

func (LiteServerGetDispatchQueueInfoRequest) MarshalTL

func (*LiteServerGetDispatchQueueInfoRequest) UnmarshalTL

type LiteServerGetLibrariesRequest

type LiteServerGetLibrariesRequest struct {
	LibraryList []tl.Int256
}

func (LiteServerGetLibrariesRequest) MarshalTL

func (t LiteServerGetLibrariesRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetLibrariesRequest) UnmarshalTL

func (t *LiteServerGetLibrariesRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetLibrariesWithProofRequest

type LiteServerGetLibrariesWithProofRequest struct {
	Id          TonNodeBlockIdExtC
	Mode        uint32
	LibraryList []tl.Int256
}

func (LiteServerGetLibrariesWithProofRequest) MarshalTL

func (*LiteServerGetLibrariesWithProofRequest) UnmarshalTL

type LiteServerGetMasterchainInfoExtRequest

type LiteServerGetMasterchainInfoExtRequest struct {
	Mode uint32
}

func (LiteServerGetMasterchainInfoExtRequest) MarshalTL

func (*LiteServerGetMasterchainInfoExtRequest) UnmarshalTL

type LiteServerGetMasterchainInfoRequest

type LiteServerGetMasterchainInfoRequest struct{}

func (*LiteServerGetMasterchainInfoRequest) UnmarshalTL

type LiteServerGetOneTransactionRequest

type LiteServerGetOneTransactionRequest struct {
	Id      TonNodeBlockIdExtC
	Account LiteServerAccountIdC
	Lt      uint64
}

func (LiteServerGetOneTransactionRequest) MarshalTL

func (t LiteServerGetOneTransactionRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetOneTransactionRequest) UnmarshalTL

type LiteServerGetOutMsgQueueSizesRequest

type LiteServerGetOutMsgQueueSizesRequest struct {
	Mode  uint32
	Wc    *uint32
	Shard *uint64
}

func (LiteServerGetOutMsgQueueSizesRequest) MarshalTL

func (t LiteServerGetOutMsgQueueSizesRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetOutMsgQueueSizesRequest) UnmarshalTL

type LiteServerGetShardBlockProofRequest

type LiteServerGetShardBlockProofRequest struct {
	Id TonNodeBlockIdExtC
}

func (LiteServerGetShardBlockProofRequest) MarshalTL

func (t LiteServerGetShardBlockProofRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetShardBlockProofRequest) UnmarshalTL

type LiteServerGetShardInfoRequest

type LiteServerGetShardInfoRequest struct {
	Id        TonNodeBlockIdExtC
	Workchain uint32
	Shard     uint64
	Exact     bool
}

func (LiteServerGetShardInfoRequest) MarshalTL

func (t LiteServerGetShardInfoRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetShardInfoRequest) UnmarshalTL

func (t *LiteServerGetShardInfoRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetStateRequest

type LiteServerGetStateRequest struct {
	Id TonNodeBlockIdExtC
}

func (LiteServerGetStateRequest) MarshalTL

func (t LiteServerGetStateRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetStateRequest) UnmarshalTL

func (t *LiteServerGetStateRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetTimeRequest

type LiteServerGetTimeRequest struct{}

func (*LiteServerGetTimeRequest) UnmarshalTL

func (t *LiteServerGetTimeRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetTransactionsRequest

type LiteServerGetTransactionsRequest struct {
	Count   uint32
	Account LiteServerAccountIdC
	Lt      uint64
	Hash    tl.Int256
}

func (LiteServerGetTransactionsRequest) MarshalTL

func (t LiteServerGetTransactionsRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetTransactionsRequest) UnmarshalTL

func (t *LiteServerGetTransactionsRequest) UnmarshalTL(r io.Reader) error

type LiteServerGetValidatorStatsRequest

type LiteServerGetValidatorStatsRequest struct {
	Mode          uint32
	Id            TonNodeBlockIdExtC
	Limit         uint32
	StartAfter    *tl.Int256
	ModifiedAfter *uint32
}

func (LiteServerGetValidatorStatsRequest) MarshalTL

func (t LiteServerGetValidatorStatsRequest) MarshalTL() ([]byte, error)

func (*LiteServerGetValidatorStatsRequest) UnmarshalTL

type LiteServerGetVersionRequest

type LiteServerGetVersionRequest struct{}

func (*LiteServerGetVersionRequest) UnmarshalTL

func (t *LiteServerGetVersionRequest) UnmarshalTL(r io.Reader) error

type LiteServerLibraryEntryC

type LiteServerLibraryEntryC struct {
	Hash tl.Int256
	Data []byte
}

func (LiteServerLibraryEntryC) MarshalTL

func (t LiteServerLibraryEntryC) MarshalTL() ([]byte, error)

func (*LiteServerLibraryEntryC) UnmarshalTL

func (t *LiteServerLibraryEntryC) UnmarshalTL(r io.Reader) error

type LiteServerLibraryResultC

type LiteServerLibraryResultC struct {
	Result []LiteServerLibraryEntryC
}

func (LiteServerLibraryResultC) MarshalTL

func (t LiteServerLibraryResultC) MarshalTL() ([]byte, error)

func (*LiteServerLibraryResultC) UnmarshalTL

func (t *LiteServerLibraryResultC) UnmarshalTL(r io.Reader) error

type LiteServerLibraryResultWithProofC

type LiteServerLibraryResultWithProofC struct {
	Id         TonNodeBlockIdExtC
	Mode       uint32
	Result     []LiteServerLibraryEntryC
	StateProof []byte
	DataProof  []byte
}

func (LiteServerLibraryResultWithProofC) MarshalTL

func (t LiteServerLibraryResultWithProofC) MarshalTL() ([]byte, error)

func (*LiteServerLibraryResultWithProofC) UnmarshalTL

type LiteServerListBlockTransactionsExtRequest

type LiteServerListBlockTransactionsExtRequest struct {
	Id    TonNodeBlockIdExtC
	Mode  uint32
	Count uint32
	After *LiteServerTransactionId3C
}

func (LiteServerListBlockTransactionsExtRequest) MarshalTL

func (*LiteServerListBlockTransactionsExtRequest) UnmarshalTL

type LiteServerListBlockTransactionsRequest

type LiteServerListBlockTransactionsRequest struct {
	Id    TonNodeBlockIdExtC
	Mode  uint32
	Count uint32
	After *LiteServerTransactionId3C
}

func (LiteServerListBlockTransactionsRequest) MarshalTL

func (*LiteServerListBlockTransactionsRequest) UnmarshalTL

type LiteServerLookupBlockRequest

type LiteServerLookupBlockRequest struct {
	Mode  uint32
	Id    TonNodeBlockIdC
	Lt    *uint64
	Utime *uint32
}

func (LiteServerLookupBlockRequest) MarshalTL

func (t LiteServerLookupBlockRequest) MarshalTL() ([]byte, error)

func (*LiteServerLookupBlockRequest) UnmarshalTL

func (t *LiteServerLookupBlockRequest) UnmarshalTL(r io.Reader) error

type LiteServerLookupBlockResultC

type LiteServerLookupBlockResultC struct {
	Id                 TonNodeBlockIdExtC
	Mode               uint32
	McBlockId          TonNodeBlockIdExtC
	ClientMcStateProof []byte
	McBlockProof       []byte
	ShardLinks         []LiteServerShardBlockLinkC
	Header             []byte
	PrevHeader         []byte
}

func (LiteServerLookupBlockResultC) MarshalTL

func (t LiteServerLookupBlockResultC) MarshalTL() ([]byte, error)

func (*LiteServerLookupBlockResultC) UnmarshalTL

func (t *LiteServerLookupBlockResultC) UnmarshalTL(r io.Reader) error

type LiteServerLookupBlockWithProofRequest

type LiteServerLookupBlockWithProofRequest struct {
	Mode      uint32
	Id        TonNodeBlockIdC
	McBlockId TonNodeBlockIdExtC
	Lt        *uint64
	Utime     *uint32
}

func (LiteServerLookupBlockWithProofRequest) MarshalTL

func (*LiteServerLookupBlockWithProofRequest) UnmarshalTL

type LiteServerMasterchainInfoC

type LiteServerMasterchainInfoC struct {
	Last          TonNodeBlockIdExtC
	StateRootHash tl.Int256
	Init          TonNodeZeroStateIdExtC
}

func (LiteServerMasterchainInfoC) MarshalTL

func (t LiteServerMasterchainInfoC) MarshalTL() ([]byte, error)

func (*LiteServerMasterchainInfoC) UnmarshalTL

func (t *LiteServerMasterchainInfoC) UnmarshalTL(r io.Reader) error

type LiteServerMasterchainInfoExtC

type LiteServerMasterchainInfoExtC struct {
	Mode          uint32
	Version       uint32
	Capabilities  uint64
	Last          TonNodeBlockIdExtC
	LastUtime     uint32
	Now           uint32
	StateRootHash tl.Int256
	Init          TonNodeZeroStateIdExtC
}

func (LiteServerMasterchainInfoExtC) MarshalTL

func (t LiteServerMasterchainInfoExtC) MarshalTL() ([]byte, error)

func (*LiteServerMasterchainInfoExtC) UnmarshalTL

func (t *LiteServerMasterchainInfoExtC) UnmarshalTL(r io.Reader) error

type LiteServerOutMsgQueueSizeC

type LiteServerOutMsgQueueSizeC struct {
	Id   TonNodeBlockIdExtC
	Size uint32
}

func (LiteServerOutMsgQueueSizeC) MarshalTL

func (t LiteServerOutMsgQueueSizeC) MarshalTL() ([]byte, error)

func (*LiteServerOutMsgQueueSizeC) UnmarshalTL

func (t *LiteServerOutMsgQueueSizeC) UnmarshalTL(r io.Reader) error

type LiteServerOutMsgQueueSizesC

type LiteServerOutMsgQueueSizesC struct {
	Shards               []LiteServerOutMsgQueueSizeC
	ExtMsgQueueSizeLimit uint32
}

func (LiteServerOutMsgQueueSizesC) MarshalTL

func (t LiteServerOutMsgQueueSizesC) MarshalTL() ([]byte, error)

func (*LiteServerOutMsgQueueSizesC) UnmarshalTL

func (t *LiteServerOutMsgQueueSizesC) UnmarshalTL(r io.Reader) error

type LiteServerPartialBlockProofC

type LiteServerPartialBlockProofC struct {
	Complete bool
	From     TonNodeBlockIdExtC
	To       TonNodeBlockIdExtC
	Steps    []LiteServerBlockLink
}

func (LiteServerPartialBlockProofC) MarshalTL

func (t LiteServerPartialBlockProofC) MarshalTL() ([]byte, error)

func (*LiteServerPartialBlockProofC) UnmarshalTL

func (t *LiteServerPartialBlockProofC) UnmarshalTL(r io.Reader) error

type LiteServerRunMethodResultC

type LiteServerRunMethodResultC struct {
	Mode       uint32
	Id         TonNodeBlockIdExtC
	Shardblk   TonNodeBlockIdExtC
	ShardProof []byte
	Proof      []byte
	StateProof []byte
	InitC7     []byte
	LibExtras  []byte
	ExitCode   uint32
	Result     []byte
}

func (LiteServerRunMethodResultC) MarshalTL

func (t LiteServerRunMethodResultC) MarshalTL() ([]byte, error)

func (*LiteServerRunMethodResultC) UnmarshalTL

func (t *LiteServerRunMethodResultC) UnmarshalTL(r io.Reader) error

type LiteServerRunSmcMethodRequest

type LiteServerRunSmcMethodRequest struct {
	Mode     uint32
	Id       TonNodeBlockIdExtC
	Account  LiteServerAccountIdC
	MethodId uint64
	Params   []byte
}

func (LiteServerRunSmcMethodRequest) MarshalTL

func (t LiteServerRunSmcMethodRequest) MarshalTL() ([]byte, error)

func (*LiteServerRunSmcMethodRequest) UnmarshalTL

func (t *LiteServerRunSmcMethodRequest) UnmarshalTL(r io.Reader) error

type LiteServerSendMessageRequest

type LiteServerSendMessageRequest struct {
	Body []byte
}

func (LiteServerSendMessageRequest) MarshalTL

func (t LiteServerSendMessageRequest) MarshalTL() ([]byte, error)

func (*LiteServerSendMessageRequest) UnmarshalTL

func (t *LiteServerSendMessageRequest) UnmarshalTL(r io.Reader) error

type LiteServerSendMsgStatusC

type LiteServerSendMsgStatusC struct {
	Status uint32
}

func (LiteServerSendMsgStatusC) MarshalTL

func (t LiteServerSendMsgStatusC) MarshalTL() ([]byte, error)

func (*LiteServerSendMsgStatusC) UnmarshalTL

func (t *LiteServerSendMsgStatusC) UnmarshalTL(r io.Reader) error

type LiteServerShardBlockLinkC

type LiteServerShardBlockLinkC struct {
	Id    TonNodeBlockIdExtC
	Proof []byte
}

func (LiteServerShardBlockLinkC) MarshalTL

func (t LiteServerShardBlockLinkC) MarshalTL() ([]byte, error)

func (*LiteServerShardBlockLinkC) UnmarshalTL

func (t *LiteServerShardBlockLinkC) UnmarshalTL(r io.Reader) error

type LiteServerShardBlockProofC

type LiteServerShardBlockProofC struct {
	MasterchainId TonNodeBlockIdExtC
	Links         []LiteServerShardBlockLinkC
}

func (LiteServerShardBlockProofC) MarshalTL

func (t LiteServerShardBlockProofC) MarshalTL() ([]byte, error)

func (*LiteServerShardBlockProofC) UnmarshalTL

func (t *LiteServerShardBlockProofC) UnmarshalTL(r io.Reader) error

type LiteServerShardInfoC

type LiteServerShardInfoC struct {
	Id         TonNodeBlockIdExtC
	Shardblk   TonNodeBlockIdExtC
	ShardProof []byte
	ShardDescr []byte
}

func (LiteServerShardInfoC) MarshalTL

func (t LiteServerShardInfoC) MarshalTL() ([]byte, error)

func (*LiteServerShardInfoC) UnmarshalTL

func (t *LiteServerShardInfoC) UnmarshalTL(r io.Reader) error

type LiteServerSignatureC

type LiteServerSignatureC struct {
	NodeIdShort tl.Int256
	Signature   []byte
}

func (LiteServerSignatureC) MarshalTL

func (t LiteServerSignatureC) MarshalTL() ([]byte, error)

func (*LiteServerSignatureC) UnmarshalTL

func (t *LiteServerSignatureC) UnmarshalTL(r io.Reader) error

type LiteServerSignatureSet

type LiteServerSignatureSet LiteServerSignatureSetC

func (LiteServerSignatureSet) MarshalTL

func (t LiteServerSignatureSet) MarshalTL() ([]byte, error)

func (*LiteServerSignatureSet) UnmarshalTL

func (t *LiteServerSignatureSet) UnmarshalTL(r io.Reader) error

type LiteServerSignatureSetC

type LiteServerSignatureSetC struct {
	ValidatorSetHash uint32
	CatchainSeqno    uint32
	Signatures       []LiteServerSignatureC
}

func (LiteServerSignatureSetC) MarshalTL

func (t LiteServerSignatureSetC) MarshalTL() ([]byte, error)

func (*LiteServerSignatureSetC) UnmarshalTL

func (t *LiteServerSignatureSetC) UnmarshalTL(r io.Reader) error

type LiteServerTransactionId3C

type LiteServerTransactionId3C struct {
	Account tl.Int256
	Lt      uint64
}

func (LiteServerTransactionId3C) MarshalTL

func (t LiteServerTransactionId3C) MarshalTL() ([]byte, error)

func (*LiteServerTransactionId3C) UnmarshalTL

func (t *LiteServerTransactionId3C) UnmarshalTL(r io.Reader) error

type LiteServerTransactionIdC

type LiteServerTransactionIdC struct {
	Mode    uint32
	Account *tl.Int256
	Lt      *uint64
	Hash    *tl.Int256
}

func (LiteServerTransactionIdC) MarshalTL

func (t LiteServerTransactionIdC) MarshalTL() ([]byte, error)

func (*LiteServerTransactionIdC) UnmarshalTL

func (t *LiteServerTransactionIdC) UnmarshalTL(r io.Reader) error

type LiteServerTransactionInfoC

type LiteServerTransactionInfoC struct {
	Id          TonNodeBlockIdExtC
	Proof       []byte
	Transaction []byte
}

func (LiteServerTransactionInfoC) MarshalTL

func (t LiteServerTransactionInfoC) MarshalTL() ([]byte, error)

func (*LiteServerTransactionInfoC) UnmarshalTL

func (t *LiteServerTransactionInfoC) UnmarshalTL(r io.Reader) error

type LiteServerTransactionListC

type LiteServerTransactionListC struct {
	Ids          []TonNodeBlockIdExtC
	Transactions []byte
}

func (LiteServerTransactionListC) MarshalTL

func (t LiteServerTransactionListC) MarshalTL() ([]byte, error)

func (*LiteServerTransactionListC) UnmarshalTL

func (t *LiteServerTransactionListC) UnmarshalTL(r io.Reader) error

type LiteServerValidatorStatsC

type LiteServerValidatorStatsC struct {
	Mode       uint32
	Id         TonNodeBlockIdExtC
	Count      uint32
	Complete   bool
	StateProof []byte
	DataProof  []byte
}

func (LiteServerValidatorStatsC) MarshalTL

func (t LiteServerValidatorStatsC) MarshalTL() ([]byte, error)

func (*LiteServerValidatorStatsC) UnmarshalTL

func (t *LiteServerValidatorStatsC) UnmarshalTL(r io.Reader) error

type LiteServerVersionC

type LiteServerVersionC struct {
	Mode         uint32
	Version      uint32
	Capabilities uint64
	Now          uint32
}

func (LiteServerVersionC) MarshalTL

func (t LiteServerVersionC) MarshalTL() ([]byte, error)

func (*LiteServerVersionC) UnmarshalTL

func (t *LiteServerVersionC) UnmarshalTL(r io.Reader) error

type Options

type Options func(connection *Client)

func OptionTimeout

func OptionTimeout(t time.Duration) Options

func OptionWorkersPerConnection

func OptionWorkersPerConnection(n int) Options

type OverlayID

type OverlayID struct {
	Workchain         int32
	Shard             int64
	ZeroStateFileHash tlb.Bits256
}

func (OverlayID) ComputeShortID

func (o OverlayID) ComputeShortID() (tl.Int256, error)

func (OverlayID) FullID

func (o OverlayID) FullID() ([]byte, error)

FullID computes an ID of the overlay that is used to represent overlay in the TON overlay network.

type Packet

type Packet struct {
	Payload []byte
	// contains filtered or unexported fields
}

func NewPacket

func NewPacket(payload []byte) (Packet, error)

func ParsePacket

func ParsePacket(r io.Reader, decryptor cipher.Stream) (Packet, error)

func (Packet) MagicType

func (p Packet) MagicType() uint32

type RequestName

type RequestName = string
const (
	LiteProxyGetRequestRateLimitRequestName       RequestName = "liteProxy.getRequestRateLimit"
	LiteServerGetAccountStatePrunnedRequestName   RequestName = "liteServer.getAccountStatePrunned"
	LiteServerGetAccountStateRequestName          RequestName = "liteServer.getAccountState"
	LiteServerGetAllShardsInfoRequestName         RequestName = "liteServer.getAllShardsInfo"
	LiteServerGetBlockHeaderRequestName           RequestName = "liteServer.getBlockHeader"
	LiteServerGetBlockProofRequestName            RequestName = "liteServer.getBlockProof"
	LiteServerGetBlockRequestName                 RequestName = "liteServer.getBlock"
	LiteServerGetConfigAllRequestName             RequestName = "liteServer.getConfigAll"
	LiteServerGetConfigParamsRequestName          RequestName = "liteServer.getConfigParams"
	LiteServerGetDispatchQueueInfoRequestName     RequestName = "liteServer.getDispatchQueueInfo"
	LiteServerGetLibrariesRequestName             RequestName = "liteServer.getLibraries"
	LiteServerGetLibrariesWithProofRequestName    RequestName = "liteServer.getLibrariesWithProof"
	LiteServerGetMasterchainInfoExtRequestName    RequestName = "liteServer.getMasterchainInfoExt"
	LiteServerGetMasterchainInfoRequestName       RequestName = "liteServer.getMasterchainInfo"
	LiteServerGetOneTransactionRequestName        RequestName = "liteServer.getOneTransaction"
	LiteServerGetOutMsgQueueSizesRequestName      RequestName = "liteServer.getOutMsgQueueSizes"
	LiteServerGetShardBlockProofRequestName       RequestName = "liteServer.getShardBlockProof"
	LiteServerGetShardInfoRequestName             RequestName = "liteServer.getShardInfo"
	LiteServerGetStateRequestName                 RequestName = "liteServer.getState"
	LiteServerGetTimeRequestName                  RequestName = "liteServer.getTime"
	LiteServerGetTransactionsRequestName          RequestName = "liteServer.getTransactions"
	LiteServerGetValidatorStatsRequestName        RequestName = "liteServer.getValidatorStats"
	LiteServerGetVersionRequestName               RequestName = "liteServer.getVersion"
	LiteServerListBlockTransactionsExtRequestName RequestName = "liteServer.listBlockTransactionsExt"
	LiteServerListBlockTransactionsRequestName    RequestName = "liteServer.listBlockTransactions"
	LiteServerLookupBlockRequestName              RequestName = "liteServer.lookupBlock"
	LiteServerLookupBlockWithProofRequestName     RequestName = "liteServer.lookupBlockWithProof"
	LiteServerRunSmcMethodRequestName             RequestName = "liteServer.runSmcMethod"
	LiteServerSendMessageRequestName              RequestName = "liteServer.sendMessage"
)
const (
	UnknownRequest RequestName = "Unknown"
)

func LiteapiRequestDecoder

func LiteapiRequestDecoder(b []byte) (uint32, *RequestName, any, error)

type TonNodeBlockIdC

type TonNodeBlockIdC struct {
	Workchain uint32
	Shard     uint64
	Seqno     uint32
}

func (TonNodeBlockIdC) MarshalTL

func (t TonNodeBlockIdC) MarshalTL() ([]byte, error)

func (*TonNodeBlockIdC) UnmarshalTL

func (t *TonNodeBlockIdC) UnmarshalTL(r io.Reader) error

type TonNodeBlockIdExtC

type TonNodeBlockIdExtC struct {
	Workchain uint32
	Shard     uint64
	Seqno     uint32
	RootHash  tl.Int256
	FileHash  tl.Int256
}

func BlockIDExt

func BlockIDExt(id ton.BlockIDExt) TonNodeBlockIdExtC

func (TonNodeBlockIdExtC) MarshalTL

func (t TonNodeBlockIdExtC) MarshalTL() ([]byte, error)

func (TonNodeBlockIdExtC) ToBlockIdExt

func (t TonNodeBlockIdExtC) ToBlockIdExt() ton.BlockIDExt

func (*TonNodeBlockIdExtC) UnmarshalTL

func (t *TonNodeBlockIdExtC) UnmarshalTL(r io.Reader) error

type TonNodeShardPublicOverlayIdC

type TonNodeShardPublicOverlayIdC struct {
	Workchain         uint32
	Shard             uint64
	ZeroStateFileHash tl.Int256
}

func (TonNodeShardPublicOverlayIdC) MarshalTL

func (t TonNodeShardPublicOverlayIdC) MarshalTL() ([]byte, error)

func (*TonNodeShardPublicOverlayIdC) UnmarshalTL

func (t *TonNodeShardPublicOverlayIdC) UnmarshalTL(r io.Reader) error

type TonNodeZeroStateIdExtC

type TonNodeZeroStateIdExtC struct {
	Workchain uint32
	RootHash  tl.Int256
	FileHash  tl.Int256
}

func (TonNodeZeroStateIdExtC) MarshalTL

func (t TonNodeZeroStateIdExtC) MarshalTL() ([]byte, error)

func (*TonNodeZeroStateIdExtC) UnmarshalTL

func (t *TonNodeZeroStateIdExtC) UnmarshalTL(r io.Reader) error

Jump to

Keyboard shortcuts

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