golosscripts.golos_helper
¶
Module Contents¶
-
class
GolosHelper
(*args, **kwargs)[source]¶ Bases:
golos.Steem
Helper class for Golos which implements additional methods.
Please see base class documentation on instantiation.
Note
On instantiation this class calls
golos.instance.set_shared_steemd_instance()
! This means all your golos objects likeAccount()
etc will use that instance.-
static
parse_url
(url: str)[source]¶ Parses an url to exctract author and permlink.
- Parameters
url – URL to post/comment
- Return type
post_entry
-
get_bandwidth
(self, account: str, type_: str = 'market')[source]¶ Estimate current account bandwidth and usage ratio.
-
get_market_price
(self, type_: str = 'bid')[source]¶ Get current market price GBG/GOLOS from internal Dex.
- Parameters
type (str) – bid or ask
- Returns
price as float
-
get_witness_pricefeed
(self, witness: Union[str, Dict])[source]¶ Obtain current published price for single witness.
-
estimate_median_price
(self)[source]¶ Calculate new expected median price based on last median price feed.
-
get_voting_power
(self, account: str)[source]¶ Calculate real voting power instead of stale info in get_account()
- Parameters
account (str) – account name
- Returns
voting power 0-100
-
calc_inflation
(self, start_block_num: Optional[int] = None, stop_block_num: Optional[int] = None, virtual_supply: Optional[float] = None, worker_percent: Optional[int] = None, witness_percent: Optional[int] = None, vesting_percent: Optional[int] = None, precise_rewards: bool = False)[source]¶ Calculate inflation in range from start block to stop block.
- Parameters
start_block_num (int) – start block
stop_block_num (int) – stop block
virtual_supply (float) – initial virtual_supply
worker_percent (int) – worker fund inflation percent (0-10000)
witness_percent (int) – witness pay inflation percent (0-10000)
vesting_percent (int) – vesting inflation percent (0-10000)
precise_rewards (bool) – calculate precise witness reward; precise but slow; Gives a little better results (difference is very low)
- Returns
new emission detailed data for requested period
-
static