コード例 #1
0
        private async ValueTask HandleTrades(IReadOnlyList <WalletTradeMessage> trades)
        {
            var wallets = _walletManager.GetAll().Select(e => e.WalletId).ToList();

            var list = trades.Where(e => wallets.Contains(e.WalletId)).ToList();

            if (list.Any())
            {
                using var _ = MyTelemetry.StartActivity("Handle event WalletTradeMessage")
                              ?.AddTag("event-count", list.Count)?.AddTag("event-name", "WalletTradeMessage");

                await _manager.RegisterLocalTradesAsync(list);

                lock (_sync) _needToHedge = true;
            }
        }
コード例 #2
0
        public Task <GrpcResponseWithData <GrpcList <LpWallet> > > GetAllAsync()
        {
            var data = _manager.GetAll();

            return(GrpcResponseWithData <GrpcList <LpWallet> > .CreateTask(GrpcList <LpWallet> .Create(data)));
        }