-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtransfer.py
More file actions
executable file
·33 lines (23 loc) · 797 Bytes
/
transfer.py
File metadata and controls
executable file
·33 lines (23 loc) · 797 Bytes
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
33
#!/usr/bin/env python
import sys
import click
from golosscripts.decorators import common_options, helper
@click.command()
@common_options
@helper
@click.option('--broadcast', default=False, is_flag=True, help='broadcast transaction')
@click.argument('from_')
@click.argument('to')
@click.argument('amount', type=float)
@click.argument('asset')
@click.argument('memo')
@click.pass_context
def main(ctx, broadcast, from_, to, amount, asset, memo):
"""Transfer asset FROM account to another account TO."""
ctx.log.info('transfer {} -> {}: {} {} "{}"'.format(from_, to, amount, asset, memo))
if not broadcast:
ctx.log.info('Not broadcasting!')
sys.exit(0)
ctx.helper.transfer(to, amount, asset, memo=memo, account=from_)
if __name__ == '__main__':
main()