The amount field in ListUnspentItem (returned by the listunspent RPC) is typed as SignedAmount, but UTXO amounts are always non-negative per the Bitcoin protocol.
|
/// The transaction amount. |
|
#[serde(default, with = "bitcoin::amount::serde::as_btc")] |
|
pub amount: SignedAmount, |
Bitcoin Core's own RPC documentation does not indicate that this field can be signed/negative.
See https://bitcoincore.org/en/doc/29.0.0/rpc/wallet/listunspent/:
In contrast, signed amounts are appropriate for other RPCs (e.g., listtransactions) where negative values indicate outflows/sends/fees.
See https://bitcoincore.org/en/doc/29.0.0/rpc/wallet/listtransactions/:
