API POST to transaction endpoint responds with 'not enough input'

When I send a POST to the transaction endpoint, i always get the error that there isnt enough input. I know this is some how related to the spending password, because if I dont include it, it gives me an error saying it needs exactly 3 inputs. But when I do include the spending password, it gives me the not enough input error.

the spending password is a 64 byte string as suggested from a 32 byte string base16 encoded as described in the documentation.

any ideas whats up with that?

yeah still no luck here. ive tried every different possible way to send it the data it wants and its always the same results.

it would be so awesome if somebody would just update the documentation to explain what this error even means! seriously, i have tried everything and its mom and its always not enough input. i dont even know what there isnt enough input of?!@#!@#@#%

i follow the api documentation exactly about what parameters the request requires (btw, there is an actual error for not enough parameters so i know thats not the issue here).

also, i have noticed that the examples in the documentation are often different than the written documentation (see transactions). ive tried both ways of doing it and its still not enough input.

It’s poorly written software. That’s the case for a lot of software. I would check the qty of coins putting through the transaction.

If this equation below using the coin qtys produces a negative number, you will get the error you mention:

output_value - input_value - estimated_fee.to_coin()

Also, the code appears to have issues created due to rounding when large numbers of coins are transacted.

Very poor software and not unexpected but consistent with other issues we see related to Cardano.

The password is probably not the issue. You need to include it but the issue may be with the number of coin(s).

1 Like

thank you for explaing that. that helps a lot.

but, even when i try to estimate the fees i get the same error of not enough input. I even tried to send just 1 ADA (from a wallet with 18 ADA in it) and it still said not enough input.

this is wack.

what is this supposed to equal?

output_value - input_value - estimated_fee.to_coin()

is anything greater than 0 a successful transaction?

what is the “output_value?” is that the amount being sent?

what is the “input_value?” is the the amount of funds in the wallet?

I still cant get this to work, its always not enough input.

That equation needs to be > 0.

I’m reading here: https://github.com/input-output-hk/rust-cardano/issues/253

Also, the not enough input is not that you have too few parameters, it’s that one of your coin amounts is too low. Try changing the position of your inputs. Maybe flip your input and output values. I am guessing. Since you are transacting one coin, we’re not talking much money so …

I FIGURED IT OUT!