pub fn requests_to_operations(
        requests: &[Request],
        token_name: &str,
    ) -> Result<Vec<Operation>, ApiError> {
        let mut builder = TransactionBuilder::default();
        for request in requests {
            match request {
                Request::Transfer(o) => builder.transfer(o, token_name)?,
                Request::Stake(o) => builder.stake(o),
                Request::SetDissolveTimestamp(o) => builder.set_dissolve_timestamp(o),
                Request::StartDissolve(o) => builder.start_dissolve(o),
                Request::StopDissolve(o) => builder.stop_dissolve(o),
                Request::Disburse(o) => builder.disburse(o, token_name),
                Request::AddHotKey(o) => builder.add_hot_key(o),
                Request::Spawn(o) => builder.spawn(o),
                Request::MergeMaturity(o) => builder.merge_maturity(o),
            };
        }
        Ok(builder.build())
    }
/// Builds a Transaction from a sequence of `Request`s.
/// This is a thin wrapper over the `TransactionBuilder`.
///
/// TODO We should capture the concept of a Transaction in a type.
Builds a Transaction from a sequence of `Request`s.
This is a thin wrapper over the `TransactionBuilder`.


Builds a Transaction from a sequence of ` Request ` s . This is a thin wrapper over the ` TransactionBuilder ` .
pub fn requests_to_operations(
        requests: &[Request],
        token_name: &str,
    ) -> Result<Vec<Operation>, ApiError> {
        let mut builder = TransactionBuilder::default();
        for request in requests {
            match request {
                Request::Transfer(o) => builder.transfer(o, token_name)?,
                Request::Stake(o) => builder.stake(o),
                Request::SetDissolveTimestamp(o) => builder.set_dissolve_timestamp(o),
                Request::StartDissolve(o) => builder.start_dissolve(o),
                Request::StopDissolve(o) => builder.stop_dissolve(o),
                Request::Disburse(o) => builder.disburse(o, token_name),
                Request::AddHotKey(o) => builder.add_hot_key(o),
                Request::Spawn(o) => builder.spawn(o),
                Request::MergeMaturity(o) => builder.merge_maturity(o),
            };
        }
        Ok(builder.build())
    }
pub fn requests_to_operations ( requests : & [ Request ] , token_name : & str , ) -> Result < Vec < Operation > , ApiError > { let mut builder = TransactionBuilder :: default ( ) ; for request in requests { match request { Request :: Transfer ( o ) => builder . transfer ( o , token_name ) ? , Request :: Stake ( o ) => builder . stake ( o ) , Request :: SetDissolveTimestamp ( o ) => builder . set_dissolve_timestamp ( o ) , Request :: StartDissolve ( o ) => builder . start_dissolve ( o ) , Request :: StopDissolve ( o ) => builder . stop_dissolve ( o ) , Request :: Disburse ( o ) => builder . disburse ( o , token_name ) , Request :: AddHotKey ( o ) => builder . add_hot_key ( o ) , Request :: Spawn ( o ) => builder . spawn ( o ) , Request :: MergeMaturity ( o ) => builder . merge_maturity ( o ) , } ; } Ok ( builder . build ( ) ) }
Builds a Transaction from a sequence of `Request`s.
Builds a Transaction from a sequence of ` Request ` s .
requests
&[Request]
token_name
&str
requests
&[Request]
token_name
&str