golosscripts.golos_helper

Module Contents

STEEMIT_BANDWIDTH_AVERAGE_WINDOW_SECONDS[source]
STEEMIT_BANDWIDTH_PRECISION = 1000000[source]
STEEMIT_100_PERCENT = 10000[source]
STEEMIT_VOTE_REGENERATION_SECONDS[source]
STEEMIT_INFLATION_RATE_START_PERCENT = 1515[source]
STEEMIT_INFLATION_RATE_STOP_PERCENT = 95[source]
STEEMIT_INFLATION_NARROWING_PERIOD = 250000[source]
STEEMIT_BLOCK_INTERVAL = 3[source]
STEEMIT_BLOCKS_PER_YEAR[source]
STEEMIT_BLOCKS_PER_DAY[source]
STEEMIT_MAX_WITNESSES = 21[source]
timeshare_weight = 5[source]
top19_weight = 1[source]
witness_pay_normalization_factor = 25[source]
key_types = ['owner', 'active', 'posting', 'memo'][source]
post_entry[source]
bandwidth[source]
feed[source]
emission[source]
log[source]
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 like Account() 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.

Parameters
  • account (str) – account name

  • type (str) – ‘market’ used for transfer operations, forum - for posting and voting, custom - custom ops

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_min_price(self)[source]

Get GBG/GOLOS minimal price (limit by chain).

get_price_feeds(self)[source]

Get current price feeds as reported by witnesses.

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