seedelf_cli::koios

Function address_utxos

Source
pub async fn address_utxos(
    address: &str,
    network_flag: bool,
) -> Result<Vec<UtxoResponse>, Error>
Expand description

Fetches the UTXOs associated with a specific address from the Koios API.

This function retrieves up to 1000 UTXOs for the given address. The _extended flag is enabled in the payload to include detailed UTXO information.

§Arguments

  • address - A string slice representing the Cardano address to query.
  • network_flag - A boolean flag specifying the network:
    • true for Preprod/Testnet.
    • false for Mainnet.

§Returns

  • Ok(Vec<UtxoResponse>) - A vector containing the UTXOs associated with the given address.
  • Err(Error) - If the API request or JSON parsing fails.

§Notes

The function assumes a maximum of 1000 UTXOs per address, as per CIP-30 wallets. If an address exceeds this limit, the wallet is likely mismanaged.