InvalidTransactionException: The input UTxOs cannot cover the transaction outputs and tx fee. #78
-
Hi everyone First of all thanks for this awesome package. Im trying to use Transaction builder in order to submit automatic transactions JIT for the snapshots. Im following the example linked above but when I execute builder.build_and_sign([psk.to_cbor()], change_address=address) I get the following error pycardano.exception.InvalidTransactionException: The input UTxOs cannot cover the transaction outputs and tx fee. Here is the complete script Im using: from pycardano import PaymentSigningKey, PaymentVerificationKey, Address, BlockFrostChainContext, Network
network = Network.MAINNET
context = BlockFrostChainContext("my_blockfrost_project_id", network)
psk = PaymentSigningKey.load("payment.skey")
pvk = PaymentVerificationKey.load("payment.vkey")
svk = StakeVerificationKey.load("stake.vkey")
address = Address(pvk.hash(), svk.hash(), network)
builder = TransactionBuilder(context)
builder.add_input_address(str(address))
builder.add_output(TransactionOutput.from_primitive(["Addres I want to send funds to", 100]))
signed_tx = builder.build_and_sign([psk.to_cbor()], change_address=address) The input account has enough balance since running context.utxos(str(address)) outputs [{'input': {'index': ...h': None}}]
0: {'input': {'index': 0,
'transaction_id': TransactionId(hex='some hex value')},
'output': {'address': address,
'amount': {'coin': 10000000, 'multi_asset': {}},
'datum_hash': None}}
len(): 1 What ever value I use as value for the transaction gets rejected with the same error. Any idea? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @Jcruzsalaverri , could you confirm if there is enough balance in the input address? This usually happens when the balance of the input address is lower than specified output. |
Beta Was this translation helpful? Give feedback.
-
This looks weird to me. Are you trying to send only 100 lovelace to that address? |
Beta Was this translation helpful? Give feedback.
Hi @Jcruzsalaverri , could you confirm if there is enough balance in the input address? This usually happens when the balance of the input address is lower than specified output.