Skip to content
Snippets Groups Projects

Wax integration

Merged Krzysztof Mochocki requested to merge kmochocki/wax-integration into develop
All threads resolved!
Compare and
48 files
+ 3190
386
Compare changes
  • Side-by-side
  • Inline
Files
48
@@ -6,6 +6,7 @@ import typer
from merge_args import merge_args # type: ignore
from pydantic import BaseModel
from clive.__private import config
from clive.__private.core.world import World
from clive.__private.util import ExitCallHandler
@@ -21,6 +22,7 @@ class Common(BaseModel):
sign: Optional[str] = typer.Option(None, help="Key alias to sign the transaction with.")
password: Optional[str] = typer.Option(None, help="The password to use.")
save_file: Optional[str] = typer.Option(None, help="The file to save the transaction to.")
chain_id: Optional[str] = typer.Option(None, help="Chain id used for signatures")
world: World | None = None
class Config:
@@ -39,9 +41,12 @@ def common_options(func: Callable[..., None]) -> Any:
profile: str = common.profile,
password: Optional[str] = common.password, # noqa: ARG001
save_file: Optional[str] = common.save_file, # noqa: ARG001
chain_id: Optional[str] = common.chain_id,
**kwargs: Any,
) -> None:
with ExitCallHandler(World(profile_name=profile), finally_callback=lambda w: w.close()) as world:
if chain_id is not None:
config.settings["node.chain_id"] = chain_id
return func(ctx=ctx, **kwargs, world=world)
return wrapper
Loading