예제 #1
0
        private static string[] GetTransactionHashes(IndexerClient indexerClient, IndexerTypes.SearchKey searchKey)
        {
            List <string> txHashes    = new();
            string?       afterCursor = null;
            int           limit       = 100;

            while (true)
            {
                var result = indexerClient.GetTransactions(searchKey, order: "desc", limit: limit, afterCursor: afterCursor);
                if (result == null || result.LastCursor == null)
                {
                    break;
                }
                afterCursor = result.LastCursor;

                foreach (var obj in result.Objects)
                {
                    txHashes.Add(obj.TxHash);
                }

                if (result.Objects.Length < limit)
                {
                    break;
                }
            }

            return(txHashes.Distinct().ToArray());
        }
예제 #2
0
        public IndexerTypes.Result <IndexerTypes.Cell>?GetCells(IndexerTypes.SearchKey searchKey, string order = "asc", int limit = 100, string?afterCursor = null)
        {
            List <object> methodParams = new() { searchKey, order, Hex.Int32ToHex(limit) };

            if (afterCursor != null)
            {
                methodParams.Add(afterCursor);
            }
            return(Call <IndexerTypes.Result <IndexerTypes.Cell> >("get_cells", methodParams.ToArray()));
        }
예제 #3
0
 public IndexerTypes.CellCapacity?GetCellsCapacity(IndexerTypes.SearchKey searchKey)
 {
     object[] methodParams = { searchKey };
     return(Call <IndexerTypes.CellCapacity>("get_cells_capacity", methodParams));
 }