from typing import Callable
import click
import functools
from typing import List
from typing import Dict
from typing import Any


def common_options(func: Callable) -> Callable:
    """A decorator that combines commonly appearing @click.option decorators."""

    @click.option(
        "--private-key", required=True, help="Path to a private key store.", type=click.STRING
    )
    @click.option("--password", help="password file for the keystore json file", type=click.STRING)
    @click.option(
        "--rpc-url",
        default="http://127.0.0.1:8545",
        help="Address of the Ethereum RPC provider",
        type=click.STRING,
    )
    @click.option(
        "--token-address", required=True, help="Address of the token contract", type=click.STRING
    )
    @click.option(
        "--amount", required=True, help="Amount to mint/deposit/transfer", type=click.INT
    )
    @click.option("--wait", default=300, help="Max tx wait time in s.", type=click.INT)
    @functools.wraps(func)
    def wrapper(*args: List, **kwargs: Dict) -> Any:
        return func(*args, **kwargs)

    return wrapper