Asset

class bitshares.asset.Asset(asset, lazy=False, full=False, bitshares_instance=None)

Deals with Assets of the network.

Parameters:
  • Asset (str) – Symbol name or object id of an asset
  • lazy (bool) – Lazy loading
  • full (bool) – Also obtain bitasset-data and dynamic asset dat
  • bitshares_instance (bitshares.bitshares.BitShares) – BitShares instance
Returns:

All data of an asset

Return type:

dict

Note

This class comes with its own caching function to reduce the load on the API server. Instances of this class can be refreshed with Asset.refresh().

add_authorities(type, authorities=[])

Add authorities to an assets white/black list

Parameters:
  • type (str) – blacklist or whitelist
  • authorities (list) – List of authorities (Accounts)
add_markets(type, authorities=[], force_enable=True)

Add markets to an assets white/black list

Parameters:
  • type (str) – blacklist or whitelist
  • markets (list) – List of markets (assets)
  • force_enable (bool) – Force enable white_list flag
disableflag(flag)

Enable a certain flag.

Parameters:flag (str) – Flag name
enableflag(flag)

Enable a certain flag.

Parameters:flag (str) – Flag name
flags

List the permissions that are currently used (flags)

halt()

Halt this asset from being moved or traded

is_bitasset

Is the asset a Market Pegged Assets?

permissions

List the permissions for this asset that the issuer can obtain

refresh()

Refresh the data from the API server

release(whitelist_authorities=[], blacklist_authorities=[], whitelist_markets=[], blacklist_markets=[])

Release this asset and allow unrestricted transfer, trading, etc.

Parameters:
  • whitelist_authorities (list) – List of accounts that serve as whitelist authorities
  • blacklist_authorities (list) – List of accounts that serve as blacklist authorities
  • whitelist_markets (list) – List of assets to allow trading with
  • blacklist_markets (list) – List of assets to prevent trading with
remove_authorities(type, authorities=[])

Remove authorities from an assets white/black list

Parameters:
  • type (str) – blacklist or whitelist
  • authorities (list) – List of authorities (Accounts)
remove_markets(type, authorities=[])

Remove markets from an assets white/black list

Parameters:
  • type (str) – blacklist or whitelist
  • markets (list) – List of markets (assets)
seize(from_account, to_account, amount)

Seize amount from an account and send to another

... note:: This requires the override_authority to be
set for this asset!
Parameters:
set_market_fee(percentage_fee, max_market_fee)

Set trading percentage fee

Parameters:
setoptions(flags)

Enable a certain flag.

Flags:

  • charge_market_fee
  • white_list
  • override_authority
  • transfer_restricted
  • disable_force_settle
  • global_settle
  • disable_confidential
  • witness_fed_asset
  • committee_fed_asset
Parameters:flag (dict) – dictionary of flags and boolean
update_feed_producers(producers)

Update bitasset feed producers

Parameters:producers (list) – List of accounts that are allowed to produce a feed