Methods
pytoniq
's LiteClient
supports all methods from the lite_api.tl. The following describes the non-obvious specifics of some of the methods:
raw methods
For almost all raw methods which require providing block specify block as instance of TL
class BlockIdExt
. If block in function arguments default value is None
then last (trusted) masterchain block will be taken.
raw_get_account_state
Returns 2 values: instances of Account
and ShardAccount
TLB wrappers. The ShardAccount
value is needed to take last account transaction lt and hash to get last account transactions. If Full node doesn't have account (for e.g. it's uninitilized and has zero balance) returns (None, None)
.
get_account_state
Returns instance of class SimpleAccount
. The SimpleAccount
is a wrapper for TLB scheme
with friendly account state representation:
SimpleAccount
is a customTLB Scheme
and not used anywhere outside of the library
run_get_method
For stack
argument provide just a list
with get method arguments. Returns list
with deserialized values.
raw_get_mc_block_proof
This method is used inside more high-level get_mc_block_proof
method. Asks a Liteserver for block proof link and checks it. If the proof is invalid raises exceptions. If the proof is valid returns is_complete
- is the proof was complete from known block to target one, last proved mc block and can return best key block and its gen_utime
.
For blockLinkForward
checks validators signatures of to_block
For blockLinkBack
if to_key_block
checks if prev key block hash in trusted block matches with to_block
hash, otherwise checks if prev block hash in OldMcBlocksInfo
of trusted block matches with to_block
hash.
If provided return_best_key_block=True
compares every key block ttl it receives with last stored (it's needed to store key block with big persistent state ttl):
Last updated