diff --git a/silverback/_cli.py b/silverback/_cli.py index 043ff5e6..cec07627 100644 --- a/silverback/_cli.py +++ b/silverback/_cli.py @@ -6,6 +6,7 @@ import click import yaml # type: ignore[import-untyped] +from ape import Contract from ape.cli import ( AccountAliasPromptChoice, ConnectedProviderCommand, @@ -546,6 +547,15 @@ def create_payment_stream( sm = platform.get_stream_manager(network.chain_id) product = configuration.get_product_code(account.address, cluster.id) + if token: + try: + token = Contract(token).symbol() + accepted_tokens = platform.get_accepted_tokens(network.chain_id) + if token not in accepted_tokens: + raise click.UsageError(f"Token symbol '{token}' not found in token list.") + except ValueError: + raise click.UsageError(f"Token address '{token}' not found.") + if not token: accepted_tokens = platform.get_accepted_tokens(network.chain_id) token = accepted_tokens.get(