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

ValueError: Transactions must have at least one unspent. #159

Open
Gadzhi07 opened this issue Jan 27, 2022 · 2 comments
Open

ValueError: Transactions must have at least one unspent. #159

Gadzhi07 opened this issue Jan 27, 2022 · 2 comments

Comments

@Gadzhi07
Copy link

Gadzhi07 commented Jan 27, 2022

My btc addres : 1GwLg3QmpcdTj3DiQB6tsLeaiRoRtoNTgS
My code :

from bit import PrivateKey

my_key = PrivateKey(wif="***")
money=1
wallet='1MfnucMaYJ5P81TUYTB9zzeThiHNXdBrvH
fee=2000
utxos = my_key.get_unspents()
print(utxos)

tx_hash = my_key.create_transaction([(wallet, money, 'usd')],fee=fee,unspents=utxos)

print(tx_hash)

@eriktlu
Copy link

eriktlu commented Apr 1, 2022

Did you ever solve this issue? I have a similar problem.

from bit import PrivateKey

key = PrivateKey('PrivateKeyFromExodusWallet')

print(key.address)
print(key.get_balance('btc'))
print(key.balance)

This gives me a wrong BTC address and shows that balance is 0.

@Pep3M
Copy link

Pep3M commented May 11, 2022

This gives me a wrong BTC address and shows that balance is 0.

Change key.balance for key.get_balance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants