bit icon indicating copy to clipboard operation
bit copied to clipboard

ValueError: Transactions must have at least one unspent.

Open Gadzhi07 opened this issue 3 years ago • 2 comments

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)

Gadzhi07 avatar Jan 27 '22 16:01 Gadzhi07

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.

eriktlu avatar Apr 01 '22 09:04 eriktlu

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

Change key.balance for key.get_balance

Pep3M avatar May 11 '22 22:05 Pep3M