Skip to content

Instantly share code, notes, and snippets.

@mflaxman
Created September 7, 2017 17:04
Show Gist options
  • Select an option

  • Save mflaxman/14e62e46bbc85068fa3d0fd2e00c8df5 to your computer and use it in GitHub Desktop.

Select an option

Save mflaxman/14e62e46bbc85068fa3d0fd2e00c8df5 to your computer and use it in GitHub Desktop.

Revisions

  1. mflaxman created this gist Sep 7, 2017.
    16 changes: 16 additions & 0 deletions sweep.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    from pycoin.tx.tx_utils import create_signed_tx
    from pycoin.services.blockcypher import BlockcypherProvider

    # inspect your spendables
    spendables = [x.as_text() for x in BlockcypherProvider().spendables_for_address(address=FROM_ADDRESS)]

    # sign TX
    signed_tx = create_signed_tx(
    spendables=spendables,
    payables=[TO_ADDRESS],
    wifs=[WIF],
    fee=FEE_IN_SATOSHIS,
    )

    # inspect signed TX and then use a pushtx service to broadcast
    signed_tx.as_hex()