Title: "Bitcoin Wallet Error: No Unspent Transaction Outputs or Key Available for UTXOs" #374
Replies: 1 comment
-
Not seeing anything wrong in your code. Some ideas:
This code worked for me: from bitcoinlib.wallets import wallet_create_or_open
pk = '5ad7fd6ce16afa31b1c4e26ec6325edb7b2f668ba0636b90a32b087a0e100183'
w = wallet_create_or_open('wallet_name', pk, scheme='single', network='testnet')
w.transactions_update()
t = w.send_to('tb1qmm7drwkesrw99fztzusd4sy347xjx93v2xgupe', 1000, fee=1000, min_confirms=0, offline=False)
t.info() You can find it online: https://blocksmurfer.io/tbtc/transaction/f02e171fda11b7976ea1526b0905223babecb6cde31a7d2be8c0aa445752a378 To send a raw transaction you can use the sendrawtransaction method: from bitcoinlib.services.services import Service
Service().sendrawtransaction(tx_hex) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having problem, I am trying to send transaction using Wallet and Transaction I tried both ways
Note : I am trying to use bitcoin mainnet
1)
from bitcoinlib.wallets import wallet_create_or_open
pk = 'private_key'
w = wallet_create_or_open('wallet_name', pk, scheme='single')
w.transactions_update()
w.info()
w.send_to('destination_Address', 10000)
Even my this PK having funds up to 16000 but I am getting this error
bitcoinlib.wallets.WalletError: Create transaction: No unspent transaction outputs found or no key available for UTXO's
If I use any btcscan I can see my funds in this PK even in my wallet I can see
import os
from bitcoinlib.transactions import Transaction
from bitcoinlib.keys import Key
from bitcoinlib.wallets import wallet_create_or_open
from blockcypher import pushtx
wallet = wallet_create_or_open('MyWallet')
Previous transaction ID (prev_tx) that you are spending an output from
t = Transaction()
k = Key('private_key')
hexa_format = k.private_hex
ki = Key(hexa_format, compressed=False)
t.add_input(prev_txid="prev_tx_id", output_n=1, keys=ki.public_hex, compressed=False)
t.add_output(60000, 'destination_Address')
t.sign(ki.private_byte)
tx_hex = t.raw_hex()
I got tx_id here but bitcoinlib have not function to send transactions
If someone knows any solution for anyone of them, I will be thankful for your help
Beta Was this translation helpful? Give feedback.
All reactions