Пример #1
0
 public ContractInfo(Release.SmartContract sc)
 {
     Address     = Base58Encoding.Encode(sc.Address);
     SourceCode  = ConvUtils.FormatSrc(sc.SourceCode);
     HashState   = sc.HashState;
     ByteCodeLen = sc.ByteCode.Length;
     Deployer    = Base58Encoding.Encode(sc.Deployer);
 }
Пример #2
0
 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);
 }
Пример #3
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);
 }
Пример #4
0
 public TokenInfo2(Release.TokenInfo t)
 {
     Address           = Base58Encoding.Encode(t.Address);
     Code              = t.Code;
     Name              = t.Name;
     HoldersCount      = t.HoldersCount;
     TotalSupply       = t.TotalSupply;
     Owner             = Base58Encoding.Encode(t.Owner);
     TransactionsCount = t.TransactionsCount;
     TransfersCount    = t.TransfersCount;
     Found             = true;
 }
Пример #5
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;
 }
Пример #6
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;
 }
Пример #7
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)})";
 }
Пример #8
0
 public static string ConvertHashBackPartial(string hash)
 {
     return(ConvertHash(Base58Encoding.Decode(hash)));
 }
Пример #9
0
 public static string ConvertHashPartial(string hash)
 {
     return(Base58Encoding.Encode(ConvertHashBack(hash)));
 }
Пример #10
0
        public bool Loading; // For displaying token transfers, store loading flag here in js

        public TokenBalance(Release.TokenBalance b)
        {
            Address = Base58Encoding.Encode(b.Token);
            Code    = b.Code;
            Balance = b.Balance;
        }
Пример #11
0
 public TokenHolder(Release.TokenHolder t)
 {
     Address        = Base58Encoding.Encode(t.Holder);
     Balance        = t.Balance;
     TransfersCount = t.TransfersCount;
 }