Exemple #1
0
        /// <summary>
        /// Get all transactions.
        /// </summary>
        /// <param name="account">The account for which transactions should be returned.</param>
        /// <param name="query">The query parameters.</param>
        /// <returns>An <see cref="IObservable"/> list of <see cref="Transaction"/>.</returns>
        /// <exception cref="ArgumentNullException">account
        /// or
        /// query</exception>
        /// <example>
        /// This sample shows how to use the <see>
        ///         <cref>Transactions</cref>
        ///     </see>
        ///     method.
        /// <code>
        /// var accountHttp = new AccountHttp("<!--insert host like: http://0.0.0.0:7890-->");
        ///
        /// var address = Address.CreateFromEncoded("TCTUIF-557ZCQ-OQPW2M-6GH4TC-DPM2ZY-BBL54K-GNHR");
        ///
        /// var transactions = await accountHttp().Transactions(address, new TransactionQueryParams("hash","id"));
        /// </code>
        /// </example>
        public IObservable <List <Transaction> > Transactions(Address account, TransactionQueryParams query)
        {
            if (account == null)
            {
                throw new ArgumentNullException(nameof(account));
            }
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            return(Observable.FromAsync(async ar => await AccountRoutesApi.TransactionsAllAsync(account.Plain, query.GetHash(), query.GetId())));
        }
Exemple #2
0
 /// <summary>
 /// Get incoming transactions.
 /// </summary>
 /// <param name="account">The account.</param>
 /// <param name="query">The query. Includes the Transaction of the transaction up to which transactions should be returned and the data base id.</param>
 /// <returns>An <see cref="IObservable"/> list of <see cref="Transaction"/>.</returns>
 /// <example>
 /// This sample shows how to use the <see>
 ///         <cref>IncomingTransactions</cref>
 ///     </see>
 ///     method.
 /// <code>
 /// var accountHttp = new AccountHttp("<!--insert host like: http://0.0.0.0:7890-->");
 ///
 /// var publicAccount = new PublicAccount("856f39436e33129afff95b89aca998fa23cd751a6f4d79ce4fb9da9641ecb59c", NetworkType.Types.TEST_NET);
 ///
 /// var transactions = await accountHttp().IncomingTransactions(publicAccount, new TransactionQueryParams("hash","id"));
 /// </code>
 /// </example>
 public IObservable <List <Transaction> > IncomingTransactions(PublicAccount account, TransactionQueryParams query)
 {
     return(IncomingTransactions(account.Address, query));
 }