Exemplo n.º 1
0
        public static RpcApiResult ListExchangePaginated(int offset,
                                                         int limit,
                                                         out ExchangeList exchanges)
        {
            exchanges = null;

            PaginatedMessage message = new PaginatedMessage();

            message.Offset = offset;
            message.Limit  = limit;

            JObject receive = SendCommand(RpcCommand.AssetIssue.ListExchange, new JArray()
            {
                message.ToByteArray()
            });

            if (receive.TryGetValue("error", out JToken value))
            {
                return(new RpcApiResult(false, value["code"].ToObject <int>(), value["message"].ToObject <string>()));
            }

            exchanges = ExchangeList.Parser.ParseFrom(receive["result"].ToObject <byte[]>());

            return(RpcApiResult.Success);
        }