Skip to content

send token or send btc example #359

Answered by mccwdev
xll970211 asked this question in Q&A
Discussion options

You must be logged in to vote

Easiest is to create a wallet and then create a transaction:

pk = 'tprv8ZgxMBicQKsPeTWfDcHDjngYVa8LR4VQnn4GtoJLXEtQYpRRkRt6TsqKp2nBRfnJt9vjUTREV8YpjPr8jecxNh1USymackFnAHnD7MEQo7r'
w = wallet_create_or_open('mycoins', pk)
w.scan(scan_gap_limit=1)
w.info()
w.send_to('n1UDMjicDJ6c2Kuv8eHLcYrZUmGGXfH2Nu', 10000)

or if you have just a single key with unspent outputs:

pk = 'tprv8ZgxMBicQKsPeTWfDcHDjngYVa8LR4VQnn4GtoJLXEtQYpRRkRt6TsqKp2nBRfnJt9vjUTREV8YpjPr8jecxNh1USymackFnAHnD7MEQo7r'
w = wallet_create_or_open('mycoins_single', pk, scheme='single')
w.transactions_update()
w.info()
w.send_to('n1UDMjicDJ6c2Kuv8eHLcYrZUmGGXfH2Nu', 10000)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xll970211
Comment options

Answer selected by mccwdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants