# Path: feemodel/apiclient.py
# class APIClient(object):
#     def __init__(self, host=config.get("client", "host"),
#                  port=config.getint("client", "port")):
#     def get_pools(self):
#     def get_transient(self):
#     def get_mempool(self):
#     def get_prediction(self):
#     def get_txrate(self):
#     def estimatefee(self, conftime):
#     def decidefee(self, txsize, ten_minute_cost, waitcostfn="quadratic"):
#     def get_poolsobj(self):
#     def get_txsource_obj(self):
#     def get_loglevel(self):
#     def set_loglevel(self, level):
#     def baseurl(self):
#     def _put_resource(self, path, data):
#     def _get_resource(self, path, data=None):


import click
    import time
from feemodel.apiclient import client
        from feemodel.config import config
    from feemodel.app.main import main, logfile
    from feemodel.config import __version__, pkgname, config
    from tabulate import tabulate
    from tabulate import tabulate
    from tabulate import tabulate
    from tabulate import tabulate
    from tabulate import tabulate
    from tabulate import tabulate


@cli.command()
@click.option("--waitcostfn", "-w",
              type=click.Choice(['linear', 'quadratic']),
              default="quadratic")
@click.argument("txsize", type=click.INT, required=True)
@click.argument("tenmincost", type=click.INT, required=True)
def decidefee(txsize, tenmincost, waitcostfn):
    """Compute optimal fee.

    txsize is transaction size in bytes.
    tenmincost is the cost in satoshis of waiting for the first ten minutes.
    waitcostfn (default 'quadratic') is the type of wait cost fn: linear
    or quadratic.
    """
    try:
        res = client.decidefee(txsize, tenmincost, waitcostfn)
    except Exception as e:
        click.echo(repr(e))
        return

    table = res.items()
    click.echo(tabulate(table))


@cli.command()
def mempool():
    '''Get mempool stats.'''
    try:

# Path: feemodel/apiclient.py
# class APIClient(object):
#     def __init__(self, host=config.get("client", "host"),
#                  port=config.getint("client", "port")):
#     def get_pools(self):
#     def get_transient(self):
#     def get_mempool(self):
#     def get_prediction(self):
#     def get_txrate(self):
#     def estimatefee(self, conftime):
#     def decidefee(self, txsize, ten_minute_cost, waitcostfn="quadratic"):
#     def get_poolsobj(self):
#     def get_txsource_obj(self):
#     def get_loglevel(self):
#     def set_loglevel(self, level):
#     def baseurl(self):
#     def _put_resource(self, path, data):
#     def _get_resource(self, path, data=None):


# Path: feemodel/cli.py
import click
    import time
from feemodel.apiclient import client
        from feemodel.config import config
    from feemodel.app.main import main, logfile
    from feemodel.config import __version__, pkgname, config
    from tabulate import tabulate
    from tabulate import tabulate
    from tabulate import tabulate
    from tabulate import tabulate
    from tabulate import tabulate
    from tabulate import tabulate



@cli.command()
@click.option("--waitcostfn", "-w",
              type=click.Choice(['linear', 'quadratic']),
              default="quadratic")
@click.argument("txsize", type=click.INT, required=True)
@click.argument("tenmincost", type=click.INT, required=True)
def decidefee(txsize, tenmincost, waitcostfn):
    """Compute optimal fee.

    txsize is transaction size in bytes.
    tenmincost is the cost in satoshis of waiting for the first ten minutes.
    waitcostfn (default 'quadratic') is the type of wait cost fn: linear
    or quadratic.
    """
    try:
        res = client.decidefee(txsize, tenmincost, waitcostfn)
    except Exception as e:
        click.echo(repr(e))
        return

    table = res.items()
    click.echo(tabulate(table))


@cli.command()
def mempool():
    '''Get mempool stats.'''
    try:

        stats = client.get_mempool()