Documentation
¶
Index ¶
- Constants
- Variables
- func VerifySendMessagePayload(payload []byte) error
- type Client
- func (c *Client) DnsResolve(ctx context.Context, address tongo.AccountID, domain string, category *big.Int) (int, *boc.Cell, error)
- func (c *Client) GetAccountState(ctx context.Context, accountID tongo.AccountID) (tlb.ShardAccount, error)
- func (c *Client) GetAllShardsInfo(ctx context.Context, blockID tongo.BlockIDExt) ([]tongo.BlockIDExt, error)
- func (c *Client) GetBlock(ctx context.Context, blockID tongo.BlockIDExt) (tlb.Block, error)
- func (c *Client) GetBlockHeader(ctx context.Context, blockID tongo.BlockIDExt, mode uint32) (tlb.BlockInfo, error)
- func (c *Client) GetBlockProof(ctx context.Context, knownBlock tongo.BlockIDExt, ...) (liteclient.LiteServerPartialBlockProofC, error)
- func (c *Client) GetConfigAll(ctx context.Context, mode ConfigMode) (tlb.ConfigParams, error)
- func (c *Client) GetConfigParams(ctx context.Context, mode ConfigMode, paramList []uint32) (tlb.ConfigParams, error)
- func (c *Client) GetJettonBalance(ctx context.Context, jettonWallet tongo.AccountID) (*big.Int, error)
- func (c *Client) GetJettonData(ctx context.Context, master tongo.AccountID) (tongo.JettonMetadata, error)
- func (c *Client) GetJettonWallet(ctx context.Context, master, owner tongo.AccountID) (tongo.AccountID, error)
- func (c *Client) GetLastTransactions(ctx context.Context, a tongo.AccountID, limit int) ([]tongo.Transaction, error)
- func (c *Client) GetLibraries(ctx context.Context, libraryList []tongo.Bits256) ([]liteclient.LiteServerLibraryEntryC, error)
- func (c *Client) GetMasterchainInfo(ctx context.Context) (liteclient.LiteServerMasterchainInfoC, error)
- func (c *Client) GetMasterchainInfoExt(ctx context.Context, mode uint32) (liteclient.LiteServerMasterchainInfoExtC, error)
- func (c *Client) GetOneTransactionFromBlock(ctx context.Context, accountID tongo.AccountID, blockId tongo.BlockIDExt, ...) (tongo.Transaction, error)
- func (c *Client) GetRootDNS(ctx context.Context) (tongo.AccountID, error)
- func (c *Client) GetSeqno(ctx context.Context, account tongo.AccountID) (uint32, error)
- func (c *Client) GetShardBlockProof(ctx context.Context) (liteclient.LiteServerShardBlockProofC, error)
- func (c *Client) GetShardInfo(ctx context.Context, blockID tongo.BlockIDExt, workchain uint32, shard uint64, ...) (tongo.BlockIDExt, error)
- func (c *Client) GetState(ctx context.Context, blockID tongo.BlockIDExt) ([]byte, tongo.Bits256, tongo.Bits256, error)
- func (c *Client) GetTime(ctx context.Context) (uint32, error)
- func (c *Client) GetTransactions(ctx context.Context, count uint32, accountID tongo.AccountID, lt uint64, ...) ([]tongo.Transaction, error)
- func (c *Client) GetValidatorStats(ctx context.Context, mode, limit uint32, startAfter *tongo.Bits256, ...) (*tlb.McStateExtra, error)
- func (c *Client) GetVersion(ctx context.Context) (liteclient.LiteServerVersionC, error)
- func (c *Client) ListBlockTransactions(ctx context.Context, blockID tongo.BlockIDExt, mode, count uint32, ...) ([]liteclient.LiteServerTransactionIdC, bool, error)
- func (c *Client) LookupBlock(ctx context.Context, blockID tongo.BlockID, mode uint32, lt *uint64, ...) (tongo.BlockIDExt, tlb.BlockInfo, error)
- func (c *Client) RunSmcMethod(ctx context.Context, accountID tongo.AccountID, method string, ...) (uint32, tlb.VmStack, error)
- func (c *Client) RunSmcMethodByID(ctx context.Context, accountID tongo.AccountID, methodID int, ...) (uint32, tlb.VmStack, error)
- func (c *Client) SendMessage(ctx context.Context, payload []byte) (uint32, error)
- func (c *Client) WithBlock(block tongo.BlockIDExt) *Client
- type ConfigMode
- type Option
- type Options
Constants ¶
const ( IntTag uint32 = 0xda9b50a8 LongTag uint32 = 0xba6c0722 DoubleTag uint32 = 0x54c11022 StringTag uint32 = 0x246e28b5 ObjectTag uint32 = 0xa04c7029 FunctionTag uint32 = 0x97c1cb7a BytesTag uint32 = 0xd1144618 TrueTag uint32 = 0x39d3ed3f BoolTrueTag uint32 = 0xb5757299 BoolFalseTag uint32 = 0x379779bc VectorTag uint32 = 0x144a1a50 Int128Tag uint32 = 0xb7f7cc84 Int256Tag uint32 = 0x5bebed7b TonNodeBlockIdTag uint32 = 0x67b1cdb7 TonNodeBlockIdExtTag uint32 = 0x78eb5267 TonNodeZeroStateIdExtTag uint32 = 0xae35721d AdnlMessageQueryTag uint32 = 0x7af98bb4 AdnlMessageAnswerTag uint32 = 0x1684ac0f LiteServerErrorTag uint32 = 0x48e1a9bb LiteServerAccountIdTag uint32 = 0xc5e2a075 LiteServerMasterchainInfoTag uint32 = 0x81288385 LiteServerMasterchainInfoExtTag uint32 = 0xf5e0cca8 LiteServerCurrentTimeTag uint32 = 0xd0053e9 LiteServerVersionTag uint32 = 0xe591045a LiteServerBlockDataTag uint32 = 0x6ced74a5 LiteServerBlockStateTag uint32 = 0xcdcadab LiteServerBlockHeaderTag uint32 = 0x19822d75 LiteServerSendMsgStatusTag uint32 = 0x97e55039 LiteServerAccountStateTag uint32 = 0x51c77970 LiteServerRunMethodResultTag uint32 = 0x6b619aa3 LiteServerShardInfoTag uint32 = 0x84cde69f LiteServerAllShardsInfoTag uint32 = 0x2de78f09 LiteServerTransactionInfoTag uint32 = 0x47edde0e LiteServerTransactionListTag uint32 = 0x9dd72eb9 LiteServerTransactionIdTag uint32 = 0xaf652fb1 LiteServerTransactionId3Tag uint32 = 0x77da812c LiteServerBlockTransactionsTag uint32 = 0x5c6c542f LiteServerSignatureTag uint32 = 0x55f8dea3 LiteServerSignatureSetTag uint32 = 0x9755e192 LiteServerBlockLinkBackTag uint32 = 0xef1b7eef LiteServerBlockLinkForwardTag uint32 = 0x1cce0f52 LiteServerPartialBlockProofTag uint32 = 0xc1d2d08e LiteServerConfigInfoTag uint32 = 0x2f277bae LiteServerValidatorStatsTag uint32 = 0xd896f7b9 LiteServerDebugVerbosityTag uint32 = 0x3347405d LiteServerGetMasterchainInfoTag uint32 = 0x2ee6b589 LiteServerGetMasterchainInfoExtTag uint32 = 0xdf71a670 LiteServerGetTimeTag uint32 = 0x345aad16 LiteServerGetVersionTag uint32 = 0xb942b23 LiteServerGetBlockTag uint32 = 0xdcf7763 LiteServerGetStateTag uint32 = 0xb62e6eba LiteServerGetBlockHeaderTag uint32 = 0x9e06ec21 LiteServerSendMessageTag uint32 = 0x82d40a69 LiteServerGetAccountStateTag uint32 = 0x250e896b LiteServerRunSmcMethodTag uint32 = 0xd25dc65c LiteServerGetShardInfoTag uint32 = 0x25f4a246 LiteServerGetAllShardsInfoTag uint32 = 0x6bfdd374 LiteServerGetOneTransactionTag uint32 = 0xea240fd4 LiteServerGetTransactionsTag uint32 = 0xa1e7401c LiteServerLookupBlockTag uint32 = 0x1ef7c8fa LiteServerListBlockTransactionsTag uint32 = 0xdac7fcad LiteServerGetBlockProofTag uint32 = 0x449cea8a LiteServerGetConfigAllTag uint32 = 0xb7261b91 LiteServerGetConfigParamsTag uint32 = 0x638df89e LiteServerGetValidatorStatsTag uint32 = 0xbc581a09 LiteServerQueryPrefixTag uint32 = 0x86e6d372 LiteServerQueryTag uint32 = 0xdf068c79 LiteServerWaitMasterchainSeqnoTag uint32 = 0x92b8eaba )
const (
LiteServerEnvName = "LITE_SERVERS"
)
Variables ¶
var ( // ErrAccountNotFound is returned by lite server when executing a method for an account that has not been deployed to the blockchain. ErrAccountNotFound = errors.New("account not found") )
var (
ErrOnchainContentOnly = fmt.Errorf("only onchain jetton data supported")
)
Functions ¶
func VerifySendMessagePayload ¶ added in v1.0.14
VerifySendMessagePayload verifies that the given payload is an external message ready to be sent to the blockchain.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient Get options and create new lite client. If no options provided - download public config for mainnet from ton.org.
func (*Client) DnsResolve ¶
func (c *Client) DnsResolve(ctx context.Context, address tongo.AccountID, domain string, category *big.Int) (int, *boc.Cell, error)
DnsResolve is deprecated. please use github.com/tonkeeper/tongo/contract/dns
func (*Client) GetAccountState ¶
func (*Client) GetAllShardsInfo ¶
func (c *Client) GetAllShardsInfo(ctx context.Context, blockID tongo.BlockIDExt) ([]tongo.BlockIDExt, error)
func (*Client) GetBlockHeader ¶
func (*Client) GetBlockProof ¶
func (c *Client) GetBlockProof( ctx context.Context, knownBlock tongo.BlockIDExt, targetBlock *tongo.BlockIDExt, ) (liteclient.LiteServerPartialBlockProofC, error)
func (*Client) GetConfigAll ¶
func (c *Client) GetConfigAll(ctx context.Context, mode ConfigMode) (tlb.ConfigParams, error)
GetConfigAll returns a current configuration of the blockchain.
func (*Client) GetConfigParams ¶
func (c *Client) GetConfigParams(ctx context.Context, mode ConfigMode, paramList []uint32) (tlb.ConfigParams, error)
func (*Client) GetJettonBalance ¶
func (c *Client) GetJettonBalance(ctx context.Context, jettonWallet tongo.AccountID) (*big.Int, error)
GetJettonBalance TEP-74 Fungible tokens (Jettons) standard https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md
func (*Client) GetJettonData ¶
func (c *Client) GetJettonData(ctx context.Context, master tongo.AccountID) (tongo.JettonMetadata, error)
GetJettonData TEP-74 Fungible tokens (Jettons) standard https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md
func (*Client) GetJettonWallet ¶
func (c *Client) GetJettonWallet(ctx context.Context, master, owner tongo.AccountID) (tongo.AccountID, error)
GetJettonWallet TEP-74 Fungible tokens (Jettons) standard https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md
func (*Client) GetLastTransactions ¶
func (*Client) GetLibraries ¶
func (c *Client) GetLibraries(ctx context.Context, libraryList []tongo.Bits256) ([]liteclient.LiteServerLibraryEntryC, error)
func (*Client) GetMasterchainInfo ¶
func (c *Client) GetMasterchainInfo(ctx context.Context) (liteclient.LiteServerMasterchainInfoC, error)
func (*Client) GetMasterchainInfoExt ¶
func (c *Client) GetMasterchainInfoExt(ctx context.Context, mode uint32) (liteclient.LiteServerMasterchainInfoExtC, error)
func (*Client) GetOneTransactionFromBlock ¶
func (*Client) GetRootDNS ¶
func (*Client) GetShardBlockProof ¶
func (c *Client) GetShardBlockProof(ctx context.Context) (liteclient.LiteServerShardBlockProofC, error)
func (*Client) GetShardInfo ¶
func (*Client) GetTransactions ¶
func (*Client) GetValidatorStats ¶
func (*Client) GetVersion ¶
func (c *Client) GetVersion(ctx context.Context) (liteclient.LiteServerVersionC, error)
func (*Client) ListBlockTransactions ¶
func (c *Client) ListBlockTransactions( ctx context.Context, blockID tongo.BlockIDExt, mode, count uint32, after *liteclient.LiteServerTransactionId3C, ) ([]liteclient.LiteServerTransactionIdC, bool, error)
func (*Client) LookupBlock ¶
func (*Client) RunSmcMethod ¶
func (*Client) RunSmcMethodByID ¶
func (*Client) SendMessage ¶
SendMessage verifies that the given payload contains an external message and sends it to a lite server.
type ConfigMode ¶
type ConfigMode uint32
const ( NeedStateRoot ConfigMode = 1 NeedLibraries ConfigMode = 2 NeedStateExtraRoot ConfigMode = 4 NeedShardHashes ConfigMode = 8 NeedValidatorSet ConfigMode = 16 NeedSpecialSmc ConfigMode = 32 NeedAccountsRoot ConfigMode = 64 NeedPrevBlocks ConfigMode = 128 NeedWorkchainInfo ConfigMode = 256 NeedCapabilities ConfigMode = 512 )
constants below are different flags for "mode" param of GetConfigAll. one needs to OR them to get different aspects of TON's configuration.
type Option ¶
func FromEnvs ¶ added in v1.0.15
func FromEnvs() Option
FromEnvs configures a Client based on the following environment variables: LITE_SERVERS - a list of lite servers to use
func Mainnet ¶ added in v1.0.15
func Mainnet() Option
Mainnet configures a client to use lite servers from the mainnet.
func Testnet ¶ added in v1.0.15
func Testnet() Option
Testnet configures a client to use lite servers from the testnet.
func WithConfigurationFile ¶
func WithConfigurationFile(file config.GlobalConfigurationFile) Option
func WithLiteServers ¶
func WithLiteServers(servers []config.LiteServer) Option