public TokenTransfer(Release.TokenTransfer t) { Initiator = Base58Encoding.Encode(t.Initiator); Amount = t.Amount; Time = ConvUtils.UnixTimeStampToDateTime(t.Time); Transaction = ConvUtils.GetTxId(t.Transaction); }
public PoolInfo(TestApi.Pool pool) { Time = ConvUtils.UnixTimeStampToDateTime(pool.Time); Hash = ConvUtils.ConvertHash(pool.Hash); TxCount = pool.TransactionsCount; Number = pool.PoolNumber; }
public AccountData(Release.WalletInfo info) { Address = Base58Encoding.Encode(info.Address); Balance = ConvUtils.FormatAmount(info.Balance); TxCount = (int)info.TransactionsNumber; FirstTxDateTime = ConvUtils.UnixTimeStampToDateTime(info.FirstTransactionTime); }
public ContractInfo(TestApi.SmartContract sc) { Address = Base58Encoding.Encode(sc.Address); SourceCode = ConvUtils.FormatSrc(sc.SourceCode); HashState = sc.HashState; ByteCodeLen = sc.ByteCode.Length; Deployer = Base58Encoding.Encode(sc.Deployer); }
public TokenTransaction(Release.TokenTransaction t, int index) { Index = index; Id = ConvUtils.GetTxId(t.Transaction); Time = ConvUtils.UnixTimeStampToDateTime(t.Time); Initiator = Base58Encoding.Encode(t.Initiator); Method = t.Method; Params = string.Join(", ", t.Params); }
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); }
public ContractInfo(SmartContract sc) { Address = sc.Address; SourceCode = ConvUtils.FormatSrc(sc.SourceCode); HashState = sc.HashState; Method = sc.Method; Params = string.Join(", ", sc.Params); ByteCodeLen = sc.ByteCode.Length; }
public PoolInfo(NodeApi.Pool pool) { Age = ConvUtils.GetAge(pool.Time); Time = ConvUtils.UnixTimeStampToDateTime(pool.Time); Hash = ConvUtils.ConvertHashAscii(pool.Hash); TxCount = pool.TransactionsCount; Status = true; Number = pool.PoolNumber; }
public NodeInfo(ServerApi.ServerNode n) { Ip = n.Ip; if (n.PublicKey.All("0123456789ABCDEF".Contains)) { PublicKey = ConvUtils.ConvertHashPartial(n.PublicKey); } Version = n.Version ?? string.Empty; byte.TryParse(n.Platform, out Platform); CountTrust = n.CountTrust; TimeRegistration = ConvUtils.UnixTimeStampToDateTimeS(n.TimeRegistration); TimeActive = n.TimeActive; Active = true; }
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; }
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; }
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; }
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)})"; }
public void HideIp() { Ip = ConvUtils.GetIpCut(Ip); }
public static string GetTxId(Release.TransactionId id) { return(id == null ? null : $"{ConvUtils.ConvertHash(id.PoolHash)}.{id.Index + 1}"); }
public void RefreshAge(DateTime time) { Age = ConvUtils.AgeStr(time - Time); }