Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Functions | Variables
zeth.cli.zeth_ls_notes Namespace Reference

Functions

None ls_notes (Context ctx, bool balance, bool spent)
 

Variables

 is_flag
 
 True
 
 help
 

Function Documentation

◆ ls_notes()

None zeth.cli.zeth_ls_notes.ls_notes ( Context  ctx,
bool  balance,
bool  spent 
)
List the set of notes owned by this wallet

Definition at line 15 of file zeth_ls_notes.py.

15 def ls_notes(ctx: Context, balance: bool, spent: bool) -> None:
16  """
17  List the set of notes owned by this wallet
18  """
19  client_ctx = ctx.obj
20  web3 = open_web3_from_ctx(client_ctx)
21  mixer_desc = load_mixer_description_from_ctx(client_ctx)
22  mixer_instance = mixer_desc.mixer.instantiate(web3)
23  js_secret = load_zeth_address_secret(client_ctx)
24  wallet = open_wallet(mixer_instance, js_secret, client_ctx)
25 
26  total = EtherValue(0)
27  for addr, short_commit, value in wallet.note_summaries():
28  print(f"{short_commit}: value={value.ether()}, addr={addr}")
29  total = total + value
30 
31  if balance:
32  print(f"TOTAL BALANCE: {total.ether()}")
33 
34  if not spent:
35  return
36 
37  print("SPENT NOTES:")
38  for addr, short_commit, value in wallet.spent_note_summaries():
39  print(f"{short_commit}: value={value.ether()}, addr={addr}")
Here is the call graph for this function:

Variable Documentation

◆ help

zeth.cli.zeth_ls_notes.help

Definition at line 12 of file zeth_ls_notes.py.

◆ is_flag

zeth.cli.zeth_ls_notes.is_flag

Definition at line 12 of file zeth_ls_notes.py.

◆ True

zeth.cli.zeth_ls_notes.True

Definition at line 12 of file zeth_ls_notes.py.

zeth.cli.utils.open_web3_from_ctx
Any open_web3_from_ctx(ClientConfig ctx)
Definition: utils.py:135
zeth.cli.utils.open_wallet
Wallet open_wallet(Any mixer_instance, ZethAddressPriv js_secret, ClientConfig ctx)
Definition: utils.py:275
zeth.cli.utils.load_mixer_description_from_ctx
MixerDescription load_mixer_description_from_ctx(ClientConfig ctx)
Definition: utils.py:220
zeth.cli.utils.load_zeth_address_secret
ZethAddressPriv load_zeth_address_secret(ClientConfig ctx)
Definition: utils.py:247
zeth.cli.zeth_ls_notes.ls_notes
None ls_notes(Context ctx, bool balance, bool spent)
Definition: zeth_ls_notes.py:15