예제 #1
0
    def get(self, txid):
        # call fetcher
        # self.updater.update()

        # render

        socket = dator.Socket()
        result = socket.get_txid(txid)

        self.render("txid.html",
                    data=result)
예제 #2
0
    def get(self, height):
        # call fetcher
        # self.updater.update()

        # render

        socket = dator.Socket()
        result = socket.get_blockfromheight(height)

        self.render("address.html",
                    data=result)
예제 #3
0
    def get(self, address):
        # call fetcher
        # self.updater.update()

        # render

        socket = dator.Socket()
        result = socket.get_address(address)

        self.render("address.html",
                    data=result)
예제 #4
0
    def get(self, data):
        # call fetcher
        # self.updater.update()

        query = seekHandler.get_argument(self, "query")
        print(f"Query: {query}, {type(query)}, {len(query)}")

        socket = dator.Socket()

        try:
            if query.strip() == "":
                self.write("Nothing entered")
                return

            if query.isnumeric():

                result = socket.get_blockfromheight(query)
                self.render("address.html",
                            data=result)
            elif query.lower() != query:
                print("txid")
                result = socket.get_txid(query)
                if result:
                    self.render("txid.html",
                                data=result)
            else:
                result = socket.get_blockfromhash(query)
                if result:
                    print(result)
                    self.render("address.html",
                                data=result)

                result = socket.get_address(query)
                if result:
                    print(result)
                    self.render("address.html",
                                data=result)

        except Exception as e:
            self.write(f"Request not recognized ({e})")

        # render
        """