Пример #1
0
    def __init__(self, steemd_instance=None, mode="irreversible"):
        self.steem = steemd_instance or shared_steemd_instance()

        if mode == "irreversible":
            self.mode = 'last_irreversible_block_num'
        elif mode == "head":
            self.mode = "head_block_number"
        else:
            raise ValueError("invalid value for 'mode'!")
Пример #2
0
 def __init__(self,
              account_name: str,
              comments_only: bool = False,
              steemd_instance=None):
     self.steem = steemd_instance or shared_steemd_instance()
     self.comments_only = comments_only
     self.account = Account(account_name, steemd_instance=steemd_instance)
     self.history = self.account.history_reverse(filter_by='comment')
     self.seen_items = set()
Пример #3
0
    def __init__(self,
                 tx=None,
                 steemd_instance=None,
                 wallet_instance=None,
                 no_broadcast=False,
                 expiration=60):
        self.steemd = steemd_instance or shared_steemd_instance()
        self.no_broadcast = no_broadcast
        self.expiration = expiration
        self.wallet = wallet_instance or Wallet(self.steemd)

        self.op = []
        self.wifs = []
        self.tx = tx
Пример #4
0
    def __init__(self,
                 tx=None,
                 steemd_instance=None,
                 wallet_instance=None,
                 no_broadcast=False,
                 expiration=60):
        self.steemd = steemd_instance or shared_steemd_instance()
        self.no_broadcast = no_broadcast
        self.expiration = expiration
        self.wallet = wallet_instance or Wallet(self.steemd)

        self.op = []
        self.wifs = []
        if tx and not isinstance(tx, dict):
            raise ValueError("Invalid Transaction (self.tx) Format")
        super(TransactionBuilder, self).__init__(tx or {})
Пример #5
0
    def __init__(self, steemd_instance=None, **kwargs):
        from golosbase.storage import configStorage
        self.configStorage = configStorage

        # RPC
        self.steemd = steemd_instance or shared_steemd_instance()
        self.prefix = "GLS"

        if "keys" in kwargs:
            self.setKeys(kwargs["keys"])
        else:
            """ If no keys are provided manually we load the SQLite
                keyStorage
            """
            from golosbase.storage import (keyStorage, MasterPassword)
            self.MasterPassword = MasterPassword
            self.keyStorage = keyStorage
Пример #6
0
    def __init__(self, post, steemd_instance=None):
        self.steemd = steemd_instance or shared_steemd_instance()
        self.commit = Commit(steemd_instance=self.steemd)

        # will set these during refresh()
        self.patched = False
        self.category = None
        self.root_identifier = None

        if isinstance(post, str):  # From identifier
            self.identifier = self.parse_identifier(post)
        elif isinstance(post, dict) and "author" in post and "permlink" in post:
            self.identifier = construct_identifier(post["author"], post["permlink"])
        else:
            raise ValueError("Post expects an identifier or a dict "
                             "with author and permlink!")

        self.refresh()
Пример #7
0
    def __init__(self, steemd_instance=None, **kwargs):
        from golosbase.storage import configStorage

        self.configStorage = configStorage

        # RPC
        self.steemd = steemd_instance or shared_steemd_instance()

        # Prefix
        if self.steemd:
            self.prefix = self.steemd.chain_params["prefix"]
        else:
            # If not connected, load prefix from config
            self.prefix = self.configStorage["prefix"]

        if "keys" in kwargs:
            self.setKeys(kwargs["keys"])
        else:
            """If no keys are provided manually we load the SQLite keyStorage."""
            from golosbase.storage import keyStorage, MasterPassword

            self.MasterPassword = MasterPassword
            self.keyStorage = keyStorage
Пример #8
0
 def __init__(self, witness, steemd_instance=None):
     self.steemd = steemd_instance or shared_steemd_instance()
     self.witness_name = witness
     self.witness = None
     self.refresh()
Пример #9
0
    def __init__(self, steemd_instance=None):
        self.steemd = steemd_instance or shared_steemd_instance()
        self.config = self.steemd.get_config()

        self.CONTENT_CONSTANT = 2000000000000
Пример #10
0
 def __init__(self, steemd_instance=None):
     self.steemd = steemd_instance or shared_steemd_instance()