public ProposalCreateOperation(string author, string title, string memo, TimePointSec expirationTime)
 {
     Author         = author;
     Title          = title;
     Memo           = memo;
     ExpirationTime = expirationTime;
 }
Esempio n. 2
0
        public void TimePointSecFormatTest()
        {
            var jws = new TimePointSecJsonWriterStub(new Regex("[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9]"));
            var dt  = DateTime.Today;
            var tps = new TimePointSec(dt);

            for (var i = 0; i < 100; i++)
            {
                tps.Value = tps.Value.AddMilliseconds(10);
                tps.WriteJson(jws, null);
            }
            for (var i = 0; i < 60; i++)
            {
                tps.Value = tps.Value.AddSeconds(1);
                tps.WriteJson(jws, null);
            }
            for (var i = 0; i < 60; i++)
            {
                tps.Value = tps.Value.AddMinutes(1);
                tps.WriteJson(jws, null);
            }
            for (var i = 0; i < 24; i++)
            {
                tps.Value = tps.Value.AddDays(1);
                tps.WriteJson(jws, null);
            }
            for (var i = 0; i < 12; i++)
            {
                tps.Value = tps.Value.AddMonths(1);
                tps.WriteJson(jws, null);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// API name: get_market_history
 /// *Возвращает историю рынка для внутреннего рынка
 ///
 /// </summary>
 /// <param name="bucketSeconds">API type: uint32_t The size of buckets the history is broken into. The bucket size must be configured in the plugin options.</param>
 /// <param name="start">API type: fc::time_point_sec The start time to get market history.</param>
 /// <param name="end">API type: fc::time_point_sec The end time to get market history</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <returns>API type: bucket_object A list of market history buckets.</returns>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <BucketObject[]> > GetMarketHistory(uint bucketSeconds, TimePointSec start, TimePointSec end, CancellationToken token)
 {
     return(CustomGetRequest <BucketObject[]>(KnownApiNames.MarketHistory, "get_market_history", new object[] { bucketSeconds, start, end }, token));
 }
Esempio n. 4
0
 /// <summary>
 /// API name: get_trade_history
 /// *Возвращает историю торговли для внутреннего рынка
 ///
 /// </summary>
 /// <param name="start">API type: fc::time_point_sec Start time as a UNIX timestamp</param>
 /// <param name="stop">API type: fc::time_point_sec Stop time as a UNIX timestamp</param>
 /// <param name="limit">API type: unsigned Number of transactions to retrieve, capped at 100</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <returns>API type: market_trade Recent transactions in the market</returns>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <MarketTrade[]> > GetTradeHistory(TimePointSec start, TimePointSec stop, uint limit, CancellationToken token)
 {
     return(CustomGetRequest <MarketTrade[]>(KnownApiNames.MarketHistory, "get_trade_history", new object[] { start, stop, limit }, token));
 }
Esempio n. 5
0
 ///  <summary>
 ///  API name: get_discussions_by_author_before_date
 ///  This method is used to fetch all posts/comments by start_author that occur after before_date and start_permlink with up to limit being returned.
 ///
 ///  If start_permlink is empty then only before_date will be considered. If both are specified the eariler to the two metrics will be used. This
 ///  should allow easy pagination.
 ///
 ///  *Displays a limited number of user publications
 ///
 ///  </summary>
 ///  <param name="author">API type: std::string</param>
 ///  <param name="startPermlink">API type: std::string</param>
 ///  <param name="beforeDate">API type: time_point_sec</param>
 ///  <param name="limit">API type: uint32_t</param>
 /// <param name="voteLimit"></param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 ///  <returns>API type: discussion</returns>
 ///  <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <Discussion[]> > GetDiscussionsByAuthorBeforeDateAsync(string author, string startPermlink, TimePointSec beforeDate, uint limit, ushort voteLimit, CancellationToken token)
 {
     return(CustomGetRequestAsync <Discussion[]>(KnownApiNames.Tags, "get_discussions_by_author_before_date", new object[] { author, startPermlink, beforeDate, limit, voteLimit }, token));
 }
Esempio n. 6
0
 /// <summary>
 /// API name: get_market_history
 ///
 /// </summary>
 /// <param name="a">API type: asset_id_type</param>
 /// <param name="b">API type: asset_id_type</param>
 /// <param name="bucketSeconds">API type: uint32_t</param>
 /// <param name="start">API type: fc::time_point_sec</param>
 /// <param name="end">API type: fc::time_point_sec</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <returns>API type: bucket_object</returns>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <BucketObject[]> > GetMarketHistoryAsync(AssetIdType a, AssetIdType b, uint bucketSeconds, TimePointSec start, TimePointSec end, CancellationToken token)
 {
     return(CustomGetRequestAsync <BucketObject[]>(KnownApiNames.HistoryApi, "get_market_history", new object[] { a, b, bucketSeconds, start, end }, token));
 }
Esempio n. 7
0
 /// <summary>
 /// API name: get_expiring_vesting_delegations
 /// Получить список возвращаемых (отозванных и «замороженных») «делегирований» аккаунта
 ///
 /// </summary>
 /// <param name="account">аккаунт, возвращающий «делегирования»</param>
 /// <param name="from"> начальное время возврата «делегирований» (для пагинации)</param>
 /// <param name="limit">количество возвращаемых элементов(для пагинации). необязательный аргумент.по умолчанию = 100.макс. 1000</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <returns>API type: vesting_delegation_expiration_api_object</returns>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <VestingDelegationExpirationApiObject[]> > GetExpiringVestingDelegations(string account, TimePointSec from, uint limit, CancellationToken token)
 {
     return(CustomGetRequest <VestingDelegationExpirationApiObject[]>(KnownApiNames.DatabaseApi, "get_expiring_vesting_delegations", new object[] { account, from, limit }, token));
 }