Пример #1
0
 public AccountData(Release.WalletInfo info)
 {
     Address         = Base58Encoding.Encode(info.Address);
     Balance         = ConvUtils.FormatAmount(info.Balance);
     TxCount         = (int)info.TransactionsNumber;
     FirstTxDateTime = ConvUtils.UnixTimeStampToDateTime(info.FirstTransactionTime);
 }
Пример #2
0
 public BlockInfo(Release.Pool pool)
 {
     Time    = ConvUtils.UnixTimeStampToDateTime(pool.Time);
     Hash    = ConvUtils.ConvertHash(pool.Hash);
     TxCount = pool.TransactionsCount;
     Number  = pool.PoolNumber;
     Fee     = ConvUtils.FormatAmount(pool.TotalFee);
     Writer  = Base58Encoding.Encode(pool.Writer);
 }
Пример #3
0
 public TransactionInfo(int idx, string id, TestApi.Transaction tr)
 {
     Index       = idx;
     Id          = id;
     Value       = ConvUtils.FormatAmount(tr.Amount);
     FromAccount = Base58Encoding.Encode(tr.Source);
     ToAccount   = Base58Encoding.Encode(tr.Target);
     Currency    = tr.Currency;
     Fee         = "0";
     if (tr.SmartContract == null)
     {
         return;
     }
     SmartContractSource    = tr.SmartContract.SourceCode;
     SmartContractHashState = tr.SmartContract.HashState;
 }
Пример #4
0
 public TransactionInfo(int idx, string id, NodeApi.Transaction tr)
 {
     Index       = idx;
     Id          = id;
     Value       = ConvUtils.FormatAmount(tr.Amount);
     FromAccount = ConvUtils.ConvertHashPartial(tr.Source.Trim());
     ToAccount   = ConvUtils.ConvertHashPartial(tr.Target.Trim());
     Currency    = tr.Currency;
     Fee         = "0";
     if (tr.SmartContract == null)
     {
         return;
     }
     SmartContractSource    = tr.SmartContract.SourceCode;
     SmartContractHashState = tr.SmartContract.HashState;
 }
Пример #5
0
 public TransactionInfo(int idx, Release.TransactionId id, Release.Transaction tr)
 {
     Index = idx;
     if (id != null)
     {
         Id = $"{ConvUtils.ConvertHash(id.PoolHash)}.{id.Index + 1}";
     }
     Value       = ConvUtils.FormatAmount(tr.Amount);
     FromAccount = Base58Encoding.Encode(tr.Source);
     ToAccount   = Base58Encoding.Encode(tr.Target);
     Currency    = "CS";
     Fee         = "0";
     if (tr.SmartContract == null)
     {
         return;
     }
     SmartContractSource    = tr.SmartContract.SourceCode;
     SmartContractHashState = tr.SmartContract.HashState;
 }
Пример #6
0
 public TransactionInfo(int idx, Release.TransactionId id, Release.Transaction tr)
 {
     Index       = idx;
     Id          = ConvUtils.GetTxId(id);
     Value       = ConvUtils.FormatAmount(tr.Amount);
     FromAccount = Base58Encoding.Encode(tr.Source);
     ToAccount   = Base58Encoding.Encode(tr.Target);
     Currency    = "CS";
     Fee         = ConvUtils.FormatAmount(tr.Fee);
     InnerId     = tr.Id;
     if (tr.SmartContract == null)
     {
         return;
     }
     if (string.IsNullOrEmpty(tr.SmartContract.Method))
     {
         return;
     }
     Method = $"{tr.SmartContract.Method}({string.Join(',', tr.SmartContract.Params)})";
 }