Beispiel #1
0
        public static CreateTransactionRequest ToCreateRequest(this PaymentBcnTransaction src, GetTransactionResponse txDetails, Network network)
        {
            if (src == null)
            {
                throw new ArgumentNullException(nameof(src));
            }

            if (txDetails == null)
            {
                throw new ArgumentNullException(nameof(txDetails));
            }

            return(new CreateTransactionRequest
            {
                WalletAddress = src.WalletAddress,
                Amount = src.Amount,
                Confirmations = src.Confirmations,
                BlockId = src.BlockId,
                FirstSeen = txDetails.FirstSeen.DateTime,
                Hash = src.Id,
                Blockchain = Enum.Parse <Service.PayInternal.Client.Models.BlockchainType>(src.Blockchain.ToString()),
                AssetId = src.AssetId,
                SourceWalletAddresses = txDetails.GetSourceWalletAddresses(network)?.Select(x => x.ToString()).ToArray(),
                IdentityType = TransactionIdentityType.Hash,
                Identity = src.Id
            });
        }
Beispiel #2
0
 public static UpdateTransactionRequest ToUpdateRequest(this PaymentBcnTransaction src)
 {
     return(new UpdateTransactionRequest
     {
         WalletAddress = src.WalletAddress,
         Amount = src.Amount,
         Confirmations = src.Confirmations,
         BlockId = src.BlockId,
         Hash = src.Id,
         Blockchain = Enum.Parse <Service.PayInternal.Client.Models.BlockchainType>(src.Blockchain.ToString()),
         IdentityType = TransactionIdentityType.Hash,
         Identity = src.Id
     });
 }