Пример #1
0
 internal TxId ToTxId()
 {
     return(new TxId
     {
         Address = AccountID.ToAddress(),
         ValidStartSeconds = TransactionValidStart.Seconds,
         ValidStartNanos = TransactionValidStart.Nanos
     });
 }
Пример #2
0
 internal Hashgraph.AccountBalances ToAccountBalances()
 {
     return(new Hashgraph.AccountBalances
     {
         Address = AccountID.ToAddress(),
         Crypto = Balance,
         Tokens = FromTokenBalances(TokenBalances)
     });
 }
Пример #3
0
 internal static ReadOnlyCollection <TokenTransfer> ToTransfers(this RepeatedField <TokenTransferList> list)
 {
     if (list != null && list.Count > 0)
     {
         var collector = new Dictionary <(Address, Address), long>();
         foreach (var xferList in list)
         {
             var token = xferList.Token.ToAddress();
             foreach (var xfer in xferList.Transfers)
             {
                 var key = (token, xfer.AccountID.ToAddress());
                 collector.TryGetValue(key, out long amount);
                 collector[key] = amount + xfer.Amount;
             }
         }
         var result = new List <TokenTransfer>(collector.Count);
         foreach (var entry in collector)
         {
             result.Add(new TokenTransfer(entry.Key.Item1, entry.Key.Item2, entry.Value));
         }
         return(result.AsReadOnly());
     }
     return(EMPTY_RESULT);
 }
Пример #4
0
 internal CreateAccountReceipt FillProperties(TransactionID transactionId, CreateAccountReceipt receipt)
 {
     FillCommonProperties(transactionId, receipt);
     receipt.Address = AccountID.ToAddress();
     return(receipt);
 }