示例#1
0
    def call_tx(self, other_args: List[str]):
        """Process tx command"""
        parser = argparse.ArgumentParser(
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="tx",
            description="""
                  Display info ERC20 token transaction on ethereum blockchain.
                  e.g. 0x9dc7b43ad4288c624fdd236b2ecb9f2b81c93e706b2ffd1d19b112c1df7849e6
                  [Source: Ethplorer]
              """,
        )

        ns_parser = parse_known_args_and_warn(parser, other_args,
                                              EXPORT_ONLY_RAW_DATA_ALLOWED)

        if ns_parser and self.address:
            ethplorer_view.display_tx_info(
                tx_hash=self.address,
                export=ns_parser.export,
            )
        else:
            console.print("You need to set an ethereum address\n")
    def call_tx(self, other_args: List[str]):
        """Process tx command"""
        parser = argparse.ArgumentParser(
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="tx",
            description="""
                  Display info ERC20 token transaction on ethereum blockchain.
                  e.g. 0x9dc7b43ad4288c624fdd236b2ecb9f2b81c93e706b2ffd1d19b112c1df7849e6
                  [Source: Ethplorer]
              """,
        )

        parser.add_argument(
            "--export",
            choices=["csv", "json", "xlsx"],
            default="",
            type=str,
            dest="export",
            help="Export dataframe data to csv,json,xlsx file",
        )

        try:

            ns_parser = parse_known_args_and_warn(parser, other_args)

            if not ns_parser or not self.address:
                return

            ethplorer_view.display_tx_info(
                tx_hash=self.address,
                export=ns_parser.export,
            )

        except Exception as e:
            print(e)