Describe the bug
When calling syscoinBurnToAssetAllocation with a WIF key (no Signer) and passing sysFromXpubOrAddress, the UTXOs are fetched and sanitized correctly but then re-sanitized inside fetchAndSanitizeUTXOs. The re-sanitization reads utxo.txid (lowercase) but sanitized UTXOs use utxo.txId (camelCase), causing txId to be undefined in the resulting inputs. This causes createPSBTFromRes to fail with "Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]".
To Reproduce
- Call syscoinBurnToAssetAllocation without a Signer
- Pass sysFromXpubOrAddress as an address string
- Pass null for utxos
Expected behavior
Transaction builds and broadcasts successfully.
Actual behavior
Error: Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]
Root cause
In fetchAndSanitizeUTXOs, when utxos is null and fromXpubOrAddress is set, UTXOs are fetched and sanitized correctly. However the sanitized UTXOs are then passed back through sanitizeBlockbookUTXOs again at line 610, which reads utxo.txid (undefined on already-sanitized UTXOs) instead of utxo.txId.
Fix
Skip re-sanitization when UTXOs are already in sanitized format, or ensure sanitizeBlockbookUTXOs handles both txid and txId field names.
Impact
This affects all developers using WIF key signing (server-side scripts, automated tools,
testing). The HD Signer path works correctly. WIF signing is the natural choice for
backend integrations and development tooling, making this a significant barrier to
adoption.
Describe the bug
When calling syscoinBurnToAssetAllocation with a WIF key (no Signer) and passing sysFromXpubOrAddress, the UTXOs are fetched and sanitized correctly but then re-sanitized inside fetchAndSanitizeUTXOs. The re-sanitization reads utxo.txid (lowercase) but sanitized UTXOs use utxo.txId (camelCase), causing txId to be undefined in the resulting inputs. This causes createPSBTFromRes to fail with "Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]".
To Reproduce
Expected behavior
Transaction builds and broadcasts successfully.
Actual behavior
Error: Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]
Root cause
In fetchAndSanitizeUTXOs, when utxos is null and fromXpubOrAddress is set, UTXOs are fetched and sanitized correctly. However the sanitized UTXOs are then passed back through sanitizeBlockbookUTXOs again at line 610, which reads utxo.txid (undefined on already-sanitized UTXOs) instead of utxo.txId.
Fix
Skip re-sanitization when UTXOs are already in sanitized format, or ensure sanitizeBlockbookUTXOs handles both txid and txId field names.
Impact
This affects all developers using WIF key signing (server-side scripts, automated tools,
testing). The HD Signer path works correctly. WIF signing is the natural choice for
backend integrations and development tooling, making this a significant barrier to
adoption.