Find policy-asset inputs for an Elements issued-asset payment

A wallet may hold enough of an issued token to pay a recipient but still lack policy-asset inputs for network fees. Coin selection must account for both assets independently.

Inspect only the fee asset

Set POLICY_ASSET to the policy asset ID for the intended chain. The example filters confirmed outputs for that asset, excludes unsafe entries and prints a narrow list excluding blinding factors. Inspect spendable before treating an output as available.

opts=$(jq -cn --arg asset "$POLICY_ASSET" '{asset:$asset}')
elements-cli listunspent 1 9999999 '[]' false "$opts" | jq 'map({txid,vout,asset,amount,spendable})'

Keep two funding requirements

For a transfer of 25 units of asset A plus a policy-asset fee, 30 units of A alone cannot satisfy the separate fee requirement. Rebuild fee estimates when extra inputs change transaction weight. A snapshot of eligible outputs does not reserve them against another transaction builder.

elementsproject.org listunspent