Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchGasConfig ¶
func FetchGasConfig(ctx context.Context, getter ConfigGetter) (tlb.GasLimitsPrices, error)
FetchGasConfig fetches gas price from the config.
func ParseGasPrice ¶
func ParseGasPrice(cfg tlb.GasLimitsPrices) (uint64, error)
ParseGasPrice parses gas price from the config and returns price in tons per 1 gas unit. You can take a look at definitions here: https://github.com/ton-blockchain/ton/blob/master/crypto/block/block.tlb https://docs.ton.org/develop/howto/blockchain-configs#param-20-and-21
gas_prices#dd gas_price:uint64 gas_limit:uint64 gas_credit:uint64 block_gas_limit:uint64 freeze_due_limit:uint64 delete_due_limit:uint64 = GasLimitsPrices;
gas_prices_ext#de gas_price:uint64 gas_limit:uint64 special_gas_limit:uint64 gas_credit:uint64 block_gas_limit:uint64 freeze_due_limit:uint64 delete_due_limit:uint64 = GasLimitsPrices;
gas_flat_pfx#d1 flat_gas_limit:uint64 flat_gas_price:uint64 other:GasLimitsPrices = GasLimitsPrices;
Types ¶
type ConfigGetter ¶
type ConfigGetter interface {
GetConfigParams(ctx context.Context, mode liteapi.ConfigMode, params []uint32) (tlb.ConfigParams, error)
}
ConfigGetter represents LiteAPI config params getter. Don't be confused because config param in this case represent on-chain params, not lite-client's ADNL json config to connect to the network.
Read more at https://docs.ton.org/develop/howto/blockchain-configs
type GlobalConfigurationFile ¶
type GlobalConfigurationFile = config.GlobalConfigurationFile
func ConfigFromPath ¶
func ConfigFromPath(path string) (*GlobalConfigurationFile, error)
func ConfigFromSource ¶
func ConfigFromSource(ctx context.Context, urlOrPath string) (*GlobalConfigurationFile, error)
ConfigFromSource returns a parsed configuration file from a URL or a file path.
func ConfigFromURL ¶
func ConfigFromURL(ctx context.Context, url string) (*GlobalConfigurationFile, error)
ConfigFromURL downloads & parses lite server config.