Skip to content

Commit

Permalink
Remove [create|sign|send]transaction interface
Browse files Browse the repository at this point in the history
Remove [create|sign|send]transaction. There preferred interface for
creating and sending transactions is now the `tx` command.
  • Loading branch information
jkauffman1 committed Nov 18, 2021
1 parent 2e15481 commit 7a4eee3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
43 changes: 0 additions & 43 deletions green_cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,49 +425,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 @@ -103,11 +103,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

0 comments on commit 7a4eee3

Please sign in to comment.