bitshares.message module¶
-
class
bitshares.message.Message(*args, **kwargs)[source]¶ Bases:
bitshares.instance.BlockchainInstance,bitshares.message.Message-
MESSAGE_SPLIT= ('-----BEGIN BITSHARES SIGNED MESSAGE-----', '-----BEGIN META-----', '-----BEGIN SIGNATURE-----', '-----END BITSHARES SIGNED MESSAGE-----')¶
-
SIGNED_MESSAGE_ENCAPSULATED= '\n{MESSAGE_SPLIT[0]}\n{message}\n{MESSAGE_SPLIT[1]}\naccount={meta[account]}\nmemokey={meta[memokey]}\nblock={meta[block]}\ntimestamp={meta[timestamp]}\n{MESSAGE_SPLIT[2]}\n{signature}\n{MESSAGE_SPLIT[3]}'¶
-
SIGNED_MESSAGE_META= '{message}\naccount={meta[account]}\nmemokey={meta[memokey]}\nblock={meta[block]}\ntimestamp={meta[timestamp]}'¶
-
bitshares¶ Alias for the specific blockchain.
-
blockchain¶
-
blockchain_instance_class¶
-
chain¶ Short form for blockchain (for the lazy)
-
get_instance_class()¶ Should return the Chain instance class, e.g. bitshares.BitShares
-
classmethod
inject(cls)¶
-
classmethod
set_shared_blockchain_instance(instance)¶ This method allows us to override default instance for all users of
SharedInstance.instance.Parameters: instance (chaininstance) – Chain instance
-
classmethod
set_shared_config(config)¶ This allows to set a config that will be used when calling
shared_blockchain_instanceand allows to define the configuration without requiring to actually create an instance
-
set_shared_instance()¶ This method allows to set the current instance as default
-
shared_blockchain_instance()¶ This method will initialize
SharedInstance.instanceand return it. The purpose of this method is to have offer single default instance that can be reused by multiple classes.
-
sign(*args, **kwargs)[source]¶ Sign a message with an account’s memo key
Parameters: account (str) – (optional) the account that owns the bet (defaults to default_account)Raises: ValueError – If not account for signing is provided Returns: the signed message encapsulated in a known format
-
supported_formats= (<class 'graphenecommon.message.MessageV1'>, <class 'graphenecommon.message.MessageV2'>)¶
-
valid_exceptions= (<class 'graphenecommon.exceptions.AccountDoesNotExistsException'>, <class 'graphenecommon.exceptions.InvalidMessageSignature'>, <class 'graphenecommon.exceptions.WrongMemoKey'>, <class 'graphenecommon.exceptions.InvalidMemoKeyException'>)¶
-