Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove [create|sign|send]transaction interface #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions green_cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,49 +428,6 @@ def gettransactions(session, summary, details):
result = _txlist_summary(result) if summary else format_output(result)
click.echo(result)

@green.command()
@click.option('--addressee', '-a', type=(Address(), Amount()), expose_value=False, multiple=True)
@click.option('--subaccount', default=0, expose_value=False, callback=details_json)
@click.option('--fee-rate', '-f', type=int, expose_value=False, callback=details_json)
@with_login
@print_result
def createtransaction(session, details):
"""Create an outgoing transaction."""
add_utxos_to_transaction(session, details)
return gdk_resolve(gdk.create_transaction(session.session_obj, json.dumps(details)))

@green.command()
@click.argument('details', type=click.File('rb'))
@with_login
@print_result
@with_gdk_resolve
def signtransaction(session, details):
"""Sign a transaction.

Pass in the transaction details json from createtransaction. TXDETAILS can be a filename or - to
read from standard input, e.g.

$ green createtransaction -a <address> 1000 | green signtransaction -
"""
details = details.read().decode('utf-8')
return gdk.sign_transaction(session.session_obj, details)

@green.command()
@click.argument('details', type=click.File('rb'))
@with_login
@print_result
@with_gdk_resolve
def sendtransaction(session, details):
"""Send a transaction.

Send a transaction previously returned by signtransaction. TXDETAILS can be a filename or - to
read from standard input, e.g.

$ green createtransaction -a <address> 1000 | green signtransaction - | green sendtransaction -
"""
details = details.read().decode('utf-8')
return gdk.send_transaction(session.session_obj, details)

def _send_transaction(session, details):
add_utxos_to_transaction(session, details)
details = gdk_resolve(gdk.create_transaction(session.session_obj, json.dumps(details)))
Expand Down
5 changes: 0 additions & 5 deletions green_cli/liquid.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ def sendtoaddress(session, details):
raise click.ClickException("Unsafe asset amount conversion disabled")
return green_cli.common._send_transaction(session, details)

# Insert asset into addressee option for createtransaction
params = {p.name: p for p in green_cli.common.createtransaction.params}
params['addressee'].type = click.Tuple((Address(), Asset(), Amount()))
params['addressee'].nargs = 3

# Add '--confidential' option to getbalance and getunspentoutputs
confidential_option = click.Option(
['--confidential',], is_flag=True, expose_value=False, callback=details_json,
Expand Down