pub async fn construction_hash(
        &self,
        msg: models::ConstructionHashRequest,
    ) -> Result<ConstructionHashResponse, ApiError> {
        verify_network_id(self.ledger.ledger_canister_id(), &msg.network_identifier)?;
        let envelopes = msg.signed_transaction()?;

        let transaction_identifier = if let Some((request_type, envelope_pairs)) =
            envelopes.iter().rev().find(|(rt, _)| rt.is_transfer())
        {
            TransactionIdentifier::try_from_envelope(*request_type, &envelope_pairs[0].update)
        } else if envelopes.iter().all(|(r, _)| r.is_neuron_management()) {
            Ok(TransactionIdentifier {
                hash: transaction_id::NEURON_MANAGEMEN_PSEUDO_HASH.to_owned(),
            })
        } else {
            Err(ApiError::invalid_request(
                "There is no hash for this transaction",
            ))
        }?;

        Ok(ConstructionHashResponse {
            transaction_identifier,
            metadata: Map::new(),
        })
    }
/// Get the Hash of a Signed Transfer
Get the Hash of a Signed Transfer
Get the Hash of a Signed Transfer
pub async fn construction_hash(
        &self,
        msg: models::ConstructionHashRequest,
    ) -> Result<ConstructionHashResponse, ApiError> {
        verify_network_id(self.ledger.ledger_canister_id(), &msg.network_identifier)?;
        let envelopes = msg.signed_transaction()?;
        let transaction_identifier = if let Some((request_type, envelope_pairs)) =
            envelopes.iter().rev().find(|(rt, _)| rt.is_transfer())
        {
            TransactionIdentifier::try_from_envelope(*request_type, &envelope_pairs[0].update)
        } else if envelopes.iter().all(|(r, _)| r.is_neuron_management()) {
            Ok(TransactionIdentifier {
                hash: transaction_id::NEURON_MANAGEMEN_PSEUDO_HASH.to_owned(),
            })
        } else {
            Err(ApiError::invalid_request(
                "There is no hash for this transaction",
            ))
        }?;
        Ok(ConstructionHashResponse {
            transaction_identifier,
            metadata: Map::new(),
        })
    }
pub async fn construction_hash ( & self , msg : models :: ConstructionHashRequest , ) -> Result < ConstructionHashResponse , ApiError > { verify_network_id ( self . ledger . ledger_canister_id ( ) , & msg . network_identifier ) ? ; let envelopes = msg . signed_transaction ( ) ? ; let transaction_identifier = if let Some ( ( request_type , envelope_pairs ) ) = envelopes . iter ( ) . rev ( ) . find ( | ( rt , _ ) | rt . is_transfer ( ) ) { TransactionIdentifier :: try_from_envelope ( * request_type , & envelope_pairs [ 0 ] . update ) } else if envelopes . iter ( ) . all ( | ( r , _ ) | r . is_neuron_management ( ) ) { Ok ( TransactionIdentifier { hash : transaction_id :: NEURON_MANAGEMEN_PSEUDO_HASH . to_owned ( ) , } ) } else { Err ( ApiError :: invalid_request ( " " , ) ) } ? ; Ok ( ConstructionHashResponse { transaction_identifier , metadata : Map :: new ( ) , } ) }
Get the Hash of a Signed Transfer
Get the Hash of a Signed Transfer
&self
msg
models::ConstructionHashRequest
&self
msg
models::ConstructionHashRequest