privex.steemengine.SteemEngineToken.SteemEngineToken¶
- class SteemEngineToken(network_account='ssc-mainnet1', history_conf: Optional[dict] = None, network='steem', **rpc_args)[source]¶
SteemEngineToken - a wrapper class around
privex.jsonrpc.SteemEngineRPC, with support for signing transactions, including issuing/sending tokens.Copyright:
+===================================================+ | © 2019 Privex Inc. | | https://www.privex.io | +===================================================+ | | | Python Steem Engine Library | | License: X11/MIT | | | | Core Developer(s): | | | | (+) Chris (@someguy123) [Privex] | | | +===================================================+
Basic usage:
>>> from privex.steemengine import SteemEngineToken >>> s = SteemEngineToken() >>> # Send 10 ENG to @privex from @someguy123 with the memo 'hello memo' >>> s.send_token('ENG', 'someguy123', 'privex', Decimal('10'), 'hello memo')
- __init__(network_account='ssc-mainnet1', history_conf: Optional[dict] = None, network='steem', **rpc_args)[source]¶
Initialises the class with various configuration options. All parameters are optional.
Pass a dict in
history_confto override the SteemEngine history node used Pass extra kwargs such ashostname='api.example.com'ot override the SteemEngine RPC node used.- Parameters
network_account – The Steem account that operates the SteemEngine network, e.g. ssc-mainnet1 for the Steem Smart Contracts Main Network
history_conf – A dictionary containing kwargs to pass to
SteemEngineHistoryconstructorrpc_args – Any additional kwargs will be passed to the
privex.jsonrpc.SteemEngineRPCconstructornodes (str|list) – If the
nodeskwarg is specified, e.g.nodes=['https://api.something.com'], then Beem will be configured during__init__to use those specific RPC nodes.
Methods
__init__([network_account, history_conf, ...])Initialises the class with various configuration options.
account_exists(user)Helper function to verify if a given user exists on Steem.
custom_beem([node, network])Generates a new Beem
Steem/Hiveinstancefind_fulfilled(txid[, limit, offset, indexes])find_fulfilled_buys(txid[, limit, offset, ...])find_fulfilled_sells(txid[, limit, offset, ...])find_steem_tx(tx_data[, last_blocks])Used internally to get the transaction ID after a Steem transaction has been broadcasted.
get_balances(user)Get all token balances for a user.
get_orderbook(symbol[, direction, user, ...])Get a list of open Steem/Hive Engine orders for a given symbol, by default will display
'buy'orders unless you setdirectionto'sell'get_ticker(symbol, **query)Retrieve a ticker for a single symbol as a
SETickerobject.get_tickers([limit, offset, indexes])Retrieve a list of market tickers from Hive/SteemEngine as a list of
SETickerobjects.get_token(symbol)Get the token object for an individual token.
get_token_balance(user, symbol)Find a specific token balance of a user.
get_transaction_info(txid)issue_token(symbol, to, amount[, find_tx])Issues a specified amount
amountofsymbolto the Steem accountto.list_tokens([limit, offset])Returns a list of all tokens as
Tokenobjects.list_transactions(user[, symbol, limit, offset])Get the Steem Engine transaction history for a given account
order_history(symbol[, limit, offset, indexes])Get a list of recent Steem Engine orders for a given symbol.
place_order(user, action, symbol, quantity, ...)Place an order on the Steem/Hive Engine market
query_order_history([limit, offset, indexes])Used internally by methods such as
order_history()andfind_fulfilled_sells()etc.send_token(symbol, from_acc, to_acc, amount)Sends a given
amountofsymbolfromfrom_acctoto_accwith the memomemo.set_beem([nodes, network])Create and override the Beem instance used by this instance.
trade_history(symbol[, limit, offset, indexes])Get a list of recent Steem Engine orders for a given symbol.
verify_network([network, inst])Check that the current RPC node is on the correct blockchain network.
Attributes
CACHEGlobal cache switch.
CACHE_BLACKLISTA list of fully qualified module paths to functions/methods which always bypass
se_cache()CACHE_BLACKLIST_FUNCSA list of plain function names which always bypass
se_cache()CACHE_BLACKLIST_MODSA list of fully qualified module names which always bypass
se_cache()DEFAULT_BLOCKCHAIN_URLdefault_nodesThis is a class-level attribute (shared by all instances, instead of specific to one instance), which contains a list of RPC nodes to be used by default for each network.
native_tokenReturns the
Tokenobject for the native coinnative_coinWhen a method calls
self.steem, this property will first try to return_steemif it was previously called.use_shared_instancesThis is a class-level attribute that controls whether instances of
SteemEngineTokenshould use Beem's shared instances.networknative_coin