示例#1
0
                        privkey = PrivateKey(self.memo_wif_keys[account_name])
                        pubkey  = PublicKey(memo["from"], prefix=self.prefix)
                        memomsg = Memo.decode_memo(privkey, pubkey,
                                                   memo["nonce"],
                                                   memo["message"])
                except Exception as e:
                    memomsg = "--cannot decode-- (%s)" % str(e)

            " Print out "
            print(("last_op: %s | block:%s | from %s -> to: %s " +
                  "| fee: %f %s | amount: %f %s | memo: %s") % (
                      opID, block,
                      from_account["name"], to_account["name"],
                      fee_amount, fee_asset["symbol"],
                      amount_amount, amount_asset["symbol"],
                      memomsg))

            " Store this as last op seen"
            self.last_op = opID

    def onRegisterHistory(self):
        for name in self.watch_accounts:
            account = graphene.rpc.get_account(name)
            self.getAccountHistory(account["id"], self.process_operations,
                                   self.last_op, "1.11.0", 100)

if __name__ == '__main__':
    config = Config
    graphene = GrapheneClient(config)
    graphene.run()
示例#2
0
                    else:
                        privkey = PrivateKey(self.memo_wif_keys[account_name])
                        pubkey = PublicKey(memo["from"], prefix=self.prefix)
                        memomsg = Memo.decode_memo(privkey, pubkey,
                                                   memo["nonce"],
                                                   memo["message"])
                except Exception as e:
                    memomsg = "--cannot decode-- (%s)" % str(e)

            " Print out "
            print(("last_op: %s | block:%s | from %s -> to: %s " +
                   "| fee: %f %s | amount: %f %s | memo: %s") %
                  (opID, block, from_account["name"], to_account["name"],
                   fee_amount, fee_asset["symbol"], amount_amount,
                   amount_asset["symbol"], memomsg))

            " Store this as last op seen"
            self.last_op = opID

    def onRegisterHistory(self):
        for name in self.watch_accounts:
            account = graphene.rpc.get_account(name)
            self.getAccountHistory(account["id"], self.process_operations,
                                   self.last_op, "1.11.0", 100)


if __name__ == '__main__':
    config = Config
    graphene = GrapheneClient(config)
    graphene.run()