Skip to content

Commit

Permalink
✨ Command w3 token decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
coccoinomane committed Feb 14, 2024
1 parent e376054 commit 5157cc0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/web3cli/controllers/token_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ def revoke(self) -> None:
# Print output
render(self.app, output)

@ex(
help="Show the decimals of the given token",
arguments=[
(["token"], {"help": "Token to check, by name"}),
*args.chain_and_rpc(),
],
)
def decimals(self) -> None:
client = make_contract_client(self.app, self.app.pargs.token)
decimals = client.functions["decimals"]().call()
render(self.app, decimals)

@ex(
help="Show the balance of the given token for the given address",
arguments=[
Expand Down

0 comments on commit 5157cc0

Please sign in to comment.