You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Python-slip39 -- Ethereum SLIP-39 Account Generation and Recovery
4
+
#
5
+
# Copyright (c) 2022, Dominion Research & Development Corp.
6
+
#
7
+
# Python-slip39 is free software: you can redistribute it and/or modify it under
8
+
# the terms of the GNU General Public License as published by the Free Software
9
+
# Foundation, either version 3 of the License, or (at your option) any later
10
+
# version. It is also available under alternative (eg. Commercial) licenses, at
11
+
# your option. See the LICENSE file at the top of the source tree.
12
+
#
13
+
# Python-slip39 is distributed in the hope that it will be useful, but WITHOUT
14
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15
+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16
+
#
17
+
18
+
importclick
19
+
importjson
20
+
importlogging
21
+
22
+
from .. importaddressesasslip39_addresses
23
+
from ..utilimportlog_cfg, log_level
24
+
25
+
"""
26
+
Provide basic CLI access to the slip39 API.
27
+
28
+
Output generally defaults to JSON. Use -v for more details, and --no-json to emit standard text output instead.
29
+
"""
30
+
31
+
32
+
@click.group()
33
+
@click.option('-v', '--verbose', count=True)
34
+
@click.option('-q', '--quiet', count=True)
35
+
@click.option( '--json/--no-json', default=True, help="Output JSON (the default)")
36
+
defcli( verbose, quiet, json ):
37
+
cli.verbosity=verbose-quiet
38
+
log_cfg['level'] =log_level( cli.verbosity )
39
+
logging.basicConfig( **log_cfg )
40
+
ifverboseorquiet:
41
+
logging.getLogger().setLevel( log_cfg['level'] )
42
+
cli.json=json
43
+
cli.verbosity=0# noqa: E305
44
+
cli.json=False
45
+
46
+
47
+
@click.command()
48
+
@click.option( "--crypto", help="The cryptocurrency address to generate (default: BTC)" )
49
+
@click.option( "--paths", help="The HD wallet derivation path (default: the standard path for the cryptocurrency; if xpub, omits leading hardened segments by default)" )
50
+
@click.option( "--secret", help="A seed or '{x,y,z}{pub,prv}...' x-public/private key to derive HD wallet addresses from" )
51
+
@click.option( "--format", help="legacy, segwit, bech32 (default: standard for cryptocurrency or '{x,y,z}{pub/prv}...' key)" )
52
+
@click.option( '--unbounded/--no-unbounded', default=False, help="Allow unbounded sequences of addresses")
53
+
defaddresses( crypto, paths, secret, format, unbounded ):
0 commit comments