Closed ciricc closed 2 months ago
Hey @ciricc it looks like your trying to generate a transaction to send 0.1 NEOX to GJeEoPQPXjxxfkdBzQ23FSGWBN26iB9P9q
and are running into some trouble. No worries, there seems to be a slight issue with the inputs to your transaction. Error code -22 indicates that there is an issue with the structure of the transaction. Since you are trying to send NEOX to that address, you need to provide the transaction with a valid UTXO input.
For example:
neoxa-cli createrawtransaction "[{\"txid\": \"73d23debd79b11b81152cb2a4571bb02a68c3128c12820534609769c81836385\",\"vout\": 0}]" "{\"GNcbu5GuZKMUui8A9eZxGXhJurgSixNRfT\": 0.01}"
Now when I go to decode the transaction:
{
"txid": "4296a14aa234fbac6589defd641a31b4d37d47b07f8c0cb7f2423221f99c86d9",
"hash": "4296a14aa234fbac6589defd641a31b4d37d47b07f8c0cb7f2423221f99c86d9",
"version": 2,
"type": 0,
"size": 85,
"locktime": 0,
"vin": [
{
"txid": "73d23debd79b11b81152cb2a4571bb02a68c3128c12820534609769c81836385",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.01000000,
"valueSat": 1000000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 3453c363ed2d12f8f4450a3754c81f784aeb002e OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9143453c363ed2d12f8f4450a3754c81f784aeb002e88ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"GNcbu5GuZKMUui8A9eZxGXhJurgSixNRfT"
]
}
}
],
"hex": "0200000001856383819c760946532028c128318ca602bb71452acb5211b8119bd7eb3dd2730000000000ffffffff0140420f00000000001976a9143453c363ed2d12f8f4450a3754c81f784aeb002e88ac00000000"
}
You can list unspent UTXOs with:
neoxa-cli listunspent
Reference: UTXO Create A Raw Transaction
No worries, there seems to be a slight issue with the inputs to your transaction. Error code -22 indicates that there is an issue with the structure of the transaction
Thank you for your reply! I want to use createrawtransaction
with fundrawtransaction
after. But with this issue i can't. What's my case? I wrote Bitcoin compatible transaction processer, which using bitcoin's RPC API and another compatible blockchains (like Neoxa), but only in the Neoxa now i have this problem.
I think that is the bug, because i read documentation of fundrawtransaction
method. There is this message:
Examples:
Create a transaction with no inputs
> neoxa-cli createrawtransaction "[]" "{\"myaddress\":0.01}"
Add sufficient unsigned inputs to meet the output value
> neoxa-cli fundrawtransaction "rawtransactionhex"
Sign the transaction
> neoxa-cli signrawtransaction "fundedtransactionhex"
Send the transaction
> neoxa-cli sendrawtransaction "signedtransactionhex"
So, now i cna't use fundrawtransaction
method in any way because when i use it, it tries decode transaction by decoderawtransaction method and returns me an error.
Software: