示例#1
0
        Step2Prepare ConcertFromWSObjectAndMergeStep1(Step1Response step1Response, MoneroWalletInput data, string Amount, string SpendKey, string ViewKey, string FromAddress, string ToAddress, MixOutput[] mixOuts)
        {
            Step2Prepare step2Prepare = new Step2Prepare();

            step2Prepare.change_amount       = step1Response.change_amount;
            step2Prepare.fee_amount          = step1Response.using_fee;
            step2Prepare.fee_per_b           = data.FeePerB;
            step2Prepare.final_total_wo_fee  = step1Response.final_total_wo_fee;
            step2Prepare.from_address_string = FromAddress;
            step2Prepare.nettype_string      = "MAINNET";
            step2Prepare.priority            = data.Priority;
            step2Prepare.sec_spendKey_string = SpendKey;
            step2Prepare.sec_viewKey_string  = ViewKey;
            step2Prepare.to_address_string   = ToAddress;
            step2Prepare.unlock_time         = "0";
            step2Prepare.using_outs          = step1Response.using_outs;
            if (!string.IsNullOrEmpty(data.PaymentIdString) && data.PaymentIdString.Length > 10)
            {
                step2Prepare.payment_id_string = data.PaymentIdString;
            }

            if (!string.IsNullOrEmpty(data.fee_mask))
            {
                step2Prepare.fee_mask = data.fee_mask;
            }
            else
            {
                step2Prepare.fee_mask = "10000";
            }

            List <mixouts> step2PrepareMixOutPrep = new List <mixouts>();

            foreach (var mixA in mixOuts)
            {
                List <outs> MixedOutList = new List <outs>();

                foreach (var usedOutputs in mixA.Outputs)
                {
                    outs Mix_Out = new outs();
                    Mix_Out.amount       = usedOutputs.Amount;
                    Mix_Out.global_index = usedOutputs.GlobalIndex;
                    Mix_Out.index        = usedOutputs.Index.ToString();
                    Mix_Out.public_key   = usedOutputs.PublicKey;
                    Mix_Out.rct          = usedOutputs.Rct;
                    Mix_Out.tx_pub_key   = usedOutputs.TxPubKey;
                    MixedOutList.Add(Mix_Out);
                }

                mixouts m = new mixouts()
                {
                    amount  = mixA.Amount,
                    outputs = MixedOutList.ToArray()
                };
                step2PrepareMixOutPrep.Add(m);
            }

            step2Prepare.mix_outs = step2PrepareMixOutPrep.ToArray();

            return(step2Prepare);
        }
示例#2
0
 public Step1Prepare ConvertFromWSObject(MoneroWalletInput data, string Amount)
 {
     Step1Prepare step1Prepare = new Step1Prepare();
     step1Prepare.fee_per_b = data.FeePerB;
     step1Prepare.is_sweeping = "false";
     step1Prepare.priority = data.Priority;
     step1Prepare.sending_amount = Amount;
     step1Prepare.passedIn_attemptAt_fee = null;
     step1Prepare.payment_id_string = null;
     if (!string.IsNullOrEmpty(data.PassedInAttemptAtFee)) step1Prepare.passedIn_attemptAt_fee = data.PassedInAttemptAtFee;
     if (!string.IsNullOrEmpty(data.PaymentIdString) && data.PaymentIdString.Length \>\ 10) step1Prepare.payment_id_string = data.PaymentIdString;
     if (!string.IsNullOrEmpty(data.fee_mask))
     {
         step1Prepare.fee_mask = data.fee_mask;
     }
     else
     {
         step1Prepare.fee_mask = "10000";
     }
     List\\ UnspentList = new List\\();
     foreach (var usedOutputs in data.UnspentOuts)
     {
         outs Unspent_Out = new outs();
         Unspent_Out.amount = usedOutputs.Amount;
         Unspent_Out.global_index = usedOutputs.GlobalIndex;
         Unspent_Out.index = usedOutputs.Index.ToString();
         Unspent_Out.public_key = usedOutputs.PublicKey;
         Unspent_Out.rct = usedOutputs.Rct;
         Unspent_Out.tx_pub_key = usedOutputs.TxPubKey;
         UnspentList.Add(Unspent_Out);
     }
     step1Prepare.unspent_outs = UnspentList.ToArray();
     return step1Prepare;
 }