seedelf_cli::koios

Function credential_utxos

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

Fetches the UTXOs associated with a given payment credential from the Koios API.

This function collects all UTXOs (Unspent Transaction Outputs) related to the specified payment credential by paginating through the Koios API results.

§Arguments

  • payment_credential - A string slice representing the payment credential to search for.
  • network_flag - A boolean flag specifying the network:
    • true for Preprod/Testnet.
    • false for Mainnet.

§Returns

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

§Behavior

The function paginates through the UTXO results, starting with an offset of zero and incrementing by 1000 until no further results are returned.