pub async fn outputs(self, address: &'a Address) -> Result<Box<[UTXOInput]>> {
        let address = address.to_bech32();
        let mut url = self.client.get_node()?;
        url.set_path(&format!("api/v1/addresses/{}/outputs", address));
        let resp = reqwest::get(url).await?;

        parse_response!(resp, 200 => {
            let r = resp.json::<Response<AddressOutputs>>().await?.data.output_ids;
            r.iter()
                .map(|s| {
                    let mut transaction_id = [0u8; 32];
                    hex::decode_to_slice(&s[..64], &mut transaction_id)?;
                    let index = u16::from_le_bytes(
                        hex::decode(&s[64..]).map_err(|_| Error::InvalidParameter("index".to_string()))?[..]
                            .try_into()
                            .map_err(|_| Error::InvalidParameter("index".to_string()))?,
                    );
                    Ok(UTXOInput::new(TransactionId::new(transaction_id), index)?)
                })
                .collect::<Result<Box<[UTXOInput]>>>()
        })
    }
/// Consume the builder and get all outputs that use a given address.
/// If count equals maxResults, then there might be more outputs available but those were skipped for performance
/// reasons. User should sweep the address to reduce the amount of outputs.
Consume the builder and get all outputs that use a given address.
If count equals maxResults, then there might be more outputs available but those were skipped for performance
reasons. User should sweep the address to reduce the amount of outputs.
Consume the builder and get all outputs that use a given address . If count equals maxResults then there might be more outputs available but those were skipped for performance reasons . User should sweep the address to reduce the amount of outputs .
pub async fn outputs(self, address: &'a Address) -> Result<Box<[UTXOInput]>> {
        let address = address.to_bech32();
        let mut url = self.client.get_node()?;
        url.set_path(&format!("api/v1/addresses/{}/outputs", address));
        let resp = reqwest::get(url).await?;
        parse_response!(resp, 200 => {
            let r = resp.json::<Response<AddressOutputs>>().await?.data.output_ids;
            r.iter()
                .map(|s| {
                    let mut transaction_id = [0u8; 32];
                    hex::decode_to_slice(&s[..64], &mut transaction_id)?;
                    let index = u16::from_le_bytes(
                        hex::decode(&s[64..]).map_err(|_| Error::InvalidParameter("index".to_string()))?[..]
                            .try_into()
                            .map_err(|_| Error::InvalidParameter("index".to_string()))?,
                    );
                    Ok(UTXOInput::new(TransactionId::new(transaction_id), index)?)
                })
                .collect::<Result<Box<[UTXOInput]>>>()
        })
    }
pub async fn outputs ( self , address : & ' a Address ) -> Result < Box < [ UTXOInput ] > > { let address = address . to_bech32 ( ) ; let mut url = self . client . get_node ( ) ? ; url . set_path ( & format ! ( " " address ) ) ; let resp = reqwest :: get ( url ) . await ? ; parse_response ! ( resp 200 { let r resp json Response AddressOutputs ( ) await data output_ids r iter ( ) map ( s { let mut transaction_id [ 0u8 32 ] hex decode_to_slice ( s [ 64 ] mut transaction_id ) let index u16 from_le_bytes ( hex decode ( s [ 64 ] ) map_err ( Error InvalidParameter ( " " to_string ( ) ) ) [ ] try_into ( ) map_err ( Error InvalidParameter ( " " to_string ( ) ) ) ) Ok ( UTXOInput new ( TransactionId new ( transaction_id ) index ) ) } ) collect Result Box [ UTXOInput ] ( ) } ) }
Consume the builder and get all outputs that use a given address.
Consume the builder and get all outputs that use a given address .
self
address
&'a Address
self
address
&'a Address