/// <summary> /// Create and execute custom json-rpc method /// </summary> /// <typeparam name="T">Custom type. JsonConvert will try to convert json-response to you custom object</typeparam> /// <param name="api">Api name</param> /// <param name="method">Sets json-rpc "method" field</param> /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param> /// <returns></returns> public Task <JsonRpcResponse <T> > CustomGetRequestAsync <T>(string api, string method, CancellationToken token) { var jsonRpc = JsonRpcRequest.Request(api, method); return(ConnectionManager.RepeatExecuteAsync <T>(jsonRpc, NewJsonSerializerSettings, token)); }
/// <summary> /// Create and execute custom json-rpc method /// </summary> /// <typeparam name="T">Custom type. JsonConvert will try to convert json-response to you custom object</typeparam> /// <param name="api">Api name</param> /// <param name="method">Sets json-rpc "method" field</param> /// <param name="data">Sets to json-rpc params field. JsonConvert use`s for convert array of data to string.</param> /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param> /// <returns></returns> /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception> public Task <JsonRpcResponse <T> > CustomBroadcastRequestAsync <T>(string api, string method, object data, CancellationToken token) { var jsonRpc = JsonRpcRequest.Request(NewJsonSerializerSettings, api, method, data); return(ConnectionManager.ExecuteAsync <T>(jsonRpc, NewJsonSerializerSettings, token)); }