def sign(self, account=None, **kwargs):
if not account:<EOL><INDENT>if "<STR_LIT>" in self.blockchain.config:<EOL><INDENT>account = self.blockchain.config["<STR_LIT>"]<EOL><DEDENT><DEDENT>if not account:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>account = self.account_class(account, blockchain_instance=self.blockchain)<EOL>wif = self.blockchain.wallet.getPrivateKeyForPublicKey(<EOL>account["<STR_LIT>"]["<STR_LIT>"]<EOL>)<EOL>payload = [<EOL>"<STR_LIT>",<EOL>account["<STR_LIT:name>"],<EOL>"<STR_LIT:key>",<EOL>account["<STR_LIT>"]["<STR_LIT>"],<EOL>"<STR_LIT:time>",<EOL>str(datetime.utcnow()),<EOL>"<STR_LIT:text>",<EOL>self.message,<EOL>]<EOL>enc_message = json.dumps(payload, separators=("<STR_LIT:U+002C>", "<STR_LIT::>"))<EOL>signature = hexlify(sign_message(enc_message, wif)).decode("<STR_LIT:ascii>")<EOL>return dict(signed=enc_message, payload=payload, signature=signature)<EOL>
Sign a message with an account's memo key

            :param str account: (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