-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclaim.py
executable file
·32 lines (23 loc) · 869 Bytes
/
claim.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
import click
from golos.account import Account
from golosscripts.decorators import common_options, helper
@click.command()
@common_options
@helper
@click.option('--to', help='claim to another account')
@click.option('--amount', type=float, help='claim only specified amount, otherwise claim all')
@click.option('--to-vesting', is_flag=True, default=False, help='claim to vesting')
@click.argument('account')
@click.pass_context
def main(ctx, to, amount, to_vesting, account):
"""Claim funds from accumulative balance to tip balance or to vesting."""
if not amount:
acc = Account(account)
balance = acc.get_balances()
amount = balance['accumulative']['GOLOS']
if not to:
to = account
ctx.helper.claim(to, amount, to_vesting=to_vesting, account=account)
if __name__ == '__main__':
main()