pub async fn find_outputs(&self, outputs: &[UTXOInput], addresses: &[Address]) -> Result<Vec<OutputMetadata>> {
        let mut output_metadata = Vec::<OutputMetadata>::new();
        // Use a `HashSet` to prevent duplicate output.
        let mut output_to_query = HashSet::<UTXOInput>::new();

        // Collect the `UTXOInput` in the HashSet.
        for output in outputs {
            output_to_query.insert(output.to_owned());
        }

        // Use `get_address()` API to get the address outputs first,
        // then collect the `UTXOInput` in the HashSet.
        for address in addresses {
            let address_outputs = self.get_address().outputs(&address).await?;
            for output in address_outputs.iter() {
                output_to_query.insert(output.to_owned());
            }
        }

        // Use `get_output` API to get the `OutputMetadata`.
        for output in output_to_query {
            let meta_data = self.get_output(&output).await?;
            output_metadata.push(meta_data);
        }
        Ok(output_metadata)
    }
/// Find all outputs based on the requests criteria. This method will try to query multiple nodes if
/// the request amount exceed individual node limit.
Find all outputs based on the requests criteria. This method will try to query multiple nodes if
the request amount exceed individual node limit.
Find all outputs based on the requests criteria . This method will try to query multiple nodes if the request amount exceed individual node limit .
pub async fn find_outputs(&self, outputs: &[UTXOInput], addresses: &[Address]) -> Result<Vec<OutputMetadata>> {
        let mut output_metadata = Vec::<OutputMetadata>::new();
        // Use a `HashSet` to prevent duplicate output.
        let mut output_to_query = HashSet::<UTXOInput>::new();
        // Collect the `UTXOInput` in the HashSet.
        for output in outputs {
            output_to_query.insert(output.to_owned());
        }
        // Use `get_address()` API to get the address outputs first,
        // then collect the `UTXOInput` in the HashSet.
        for address in addresses {
            let address_outputs = self.get_address().outputs(&address).await?;
            for output in address_outputs.iter() {
                output_to_query.insert(output.to_owned());
            }
        }
        // Use `get_output` API to get the `OutputMetadata`.
        for output in output_to_query {
            let meta_data = self.get_output(&output).await?;
            output_metadata.push(meta_data);
        }
        Ok(output_metadata)
    }
pub async fn find_outputs ( & self , outputs : & [ UTXOInput ] , addresses : & [ Address ] ) -> Result < Vec < OutputMetadata > > { let mut output_metadata = Vec :: < OutputMetadata > :: new ( ) ; // Use a `HashSet` to prevent duplicate output. let mut output_to_query = HashSet :: < UTXOInput > :: new ( ) ; // Collect the `UTXOInput` in the HashSet. for output in outputs { output_to_query . insert ( output . to_owned ( ) ) ; } // Use `get_address()` API to get the address outputs first, // then collect the `UTXOInput` in the HashSet. for address in addresses { let address_outputs = self . get_address ( ) . outputs ( & address ) . await ? ; for output in address_outputs . iter ( ) { output_to_query . insert ( output . to_owned ( ) ) ; } } // Use `get_output` API to get the `OutputMetadata`. for output in output_to_query { let meta_data = self . get_output ( & output ) . await ? ; output_metadata . push ( meta_data ) ; } Ok ( output_metadata ) }
Find all outputs based on the requests criteria.
Find all outputs based on the requests criteria .
&self
outputs
&[UTXOInput]
addresses
&[Address]
&self
outputs
&[UTXOInput]
addresses
&[Address]