utxostack / btc-assets-api

Bitcoin/RGB++ Assets API
https://api.rgbpp.io/docs
Apache License 2.0
3 stars 1 forks source link

Using unconfirmed utxo as input broadcast transaction failed #178

Open Dawn-githup opened 4 months ago

Dawn-githup commented 4 months ago

When constructing a transaction using this input, I get the following error:

Error: BtcAssetsAPI returned an error: (400) sendrawtransaction RPC error: {"code":-25,"message":"bad-txns-inputs-missingorspent"}

This is the input used in the transaction:

[
  {
    "hash": "e7bb86c081a833c3092df98b8ca479cf0b30308411d99a243106c2f7f84207ac",
    "index": 0,
    "sequence": 4294967295
  }
]
Dawn-githup commented 4 months ago

inputs:

https://mempool.space/testnet/tx/ac0742f8f7c20631249ad9118430300bcf79a48c8bf92d09c333a881c086bbe7

tx.Hex:

02000000000101e7bb86c081a833c3092df98b8ca479cf0b30308411d99a243106c2f7f84207ac0000000000ffffffff022202000000000000160014ea862df068017db9eebbb3eed98712f13e885397f183010000000000160014ea862df068017db9eebbb3eed98712f13e88539702473044022033d788ef3a41a4831d3fdae27948e7bddd1655aca7291f46608b626cac13fa64022041c74f116af27ef46eac04b0c0e7e294a373a254690aa620c59f561e7484b85c0121031c5a0b10c244d18e478cbfd3122c5daff349108afcabfad44acb76f3887e97b300000000
Dawn-githup commented 4 months ago

If the input's previous transaction was constructed in Unisat and then the second transaction is broadcasted using btc-assets-api, this error occurs:

Error: BtcAssetsAPI returned an error: (400) sendrawtransaction RPC error: {"code":-25,"message":"bad-txns-inputs-missingorspent"}

However, if both transactions are constructed entirely in Unisat or entirely using btc-assets-api, there are no issues.