public AssetService(ILogger <AssetService> logger,
                            MapperConfiguration mapperConfiguration,
                            IWebSocketClientFactory webSocketClientFactory,
                            IGrapheneConfig gConfig)
        {
            _logger = logger;
            _mapper = mapperConfiguration.CreateMapper();
            _webSocketClientFactory = webSocketClientFactory;
            _gConfig = gConfig;

            _lstCreds = new List <CliCredential>()
            {
                new CliCredential()
                {
                    Url      = _gConfig.GrapheneWalletWs,
                    Username = "",
                    Password = ""
                },
                new CliCredential()
                {
                    Url      = _gConfig.GrapheneBlockchainWs,
                    Username = "",
                    Password = ""
                }
            };
        }
        public LimitOrderService(ILogger <LimitOrderService> logger,
                                 MapperConfiguration mapperConfiguration,
                                 IWebSocketClientFactory webSocketClientFactory,
                                 IGrapheneConfig grapheneConfig)
        {
            _grapheneConfig = grapheneConfig;

            _logger = logger;
            _mapper = mapperConfiguration.CreateMapper();
            _webSocketClientFactory = webSocketClientFactory;

            _lstCreds = new List <CliCredential>()
            {
                new CliCredential()
                {
                    Url      = _grapheneConfig.GrapheneWalletWs,
                    Username = "******",
                    Password = "******"
                },
                new CliCredential()
                {
                    Url      = _grapheneConfig.GrapheneBlockchainWs,
                    Username = "******",
                    Password = "******"
                }
            };
        }
 public WebSocketConnectionPool(
     IWebSocketClientFactory webSocketClientFactory,
     IEnumerable <ISocketConnectionInterceptor> connectionInterceptors)
 {
     _webSocketClientFactory = webSocketClientFactory
                               ?? throw new ArgumentNullException(nameof(webSocketClientFactory));
     _connectionInterceptors = connectionInterceptors?.ToArray()
                               ?? throw new ArgumentNullException(nameof(connectionInterceptors));
 }
 public StressTest(int seed, Uri uri, int numItems, int minNumBytesPerMessage, int maxNumBytesPerMessage)
 {
     _seed     = seed;
     _uri      = uri;
     _numItems = numItems;
     _minNumBytesPerMessage = minNumBytesPerMessage;
     _maxNumBytesPerMessage = maxNumBytesPerMessage;
     _clientFactory         = new WebSocketClientFactory();
 }
Exemple #5
0
 public StressTest(int seed, Uri uri, int numItems, int minNumBytesPerMessage, int maxBytesPerMessage)
 {
     myTestBytes            = GetPersonBytes(messageSizeMap[maxBytesPerMessage]);
     _seed                  = seed;
     _uri                   = uri;
     _numItems              = numItems;
     _minNumBytesPerMessage = minNumBytesPerMessage;
     _maxNumBytesPerMessage = maxBytesPerMessage;
     _clientFactory         = new WebSocketClientFactory();
 }
Exemple #6
0
        /// <summary>	Constructor. </summary>
        ///
        /// <remarks>	Paul, 19/10/2015. </remarks>
        ///
        /// <param name="url">	    URL of the document. </param>
        /// <param name="username">	(Optional) the username. </param>
        /// <param name="password">	(Optional) the password. </param>
        public GrapheneHttpSocketWrapper(IWebSocketClientFactory wsClientFactory)
        {
            _webSocketClientFactory = wsClientFactory;

            m_apiMap = new Dictionary <GrapheneApi, int>
            {
                { GrapheneApi.@public, 0 },
                { GrapheneApi.login, 1 },
                { GrapheneApi.history, 2 }
            };
        }
Exemple #7
0
 public HomeAssistantClient(
     ILogger <IHomeAssistantClient> logger,
     IWebSocketClientFactory webSocketClientFactory,
     IWebSocketClientTransportPipelineFactory transportPipelineFactory,
     IHomeAssistantConnectionFactory connectionFactory
     )
 {
     _logger = logger;
     _webSocketClientFactory   = webSocketClientFactory;
     _transportPipelineFactory = transportPipelineFactory;
     _connectionFactory        = connectionFactory;
 }
Exemple #8
0
        public DiscordWebSocket(
            ILogger logger,
            IWebSocketClientFactory webSocketClientFactory,
            bool supportsZLib = true)
        {
            Logger = logger;
            _webSocketClientFactory = webSocketClientFactory;
            _supportsZLib           = supportsZLib;

            _sendSemaphore = new SemaphoreSlim(1, 1);

            _receiveSemaphore = new SemaphoreSlim(1, 1);
            _receiveBuffer    = new byte[ReceiveBufferSize];
            _receiveStream    = new MemoryStream(ReceiveBufferSize * 2);
        }
        public DefaultGateway(
            IOptions <DefaultGatewayConfiguration> options,
            IJsonSerializer serializer,
            IWebSocketClientFactory webSocketClientFactory)
        {
            var configuration = options.Value;

            Version                = configuration.Version;
            LogsPayloads           = configuration.LogsPayloads;
            UsesZLib               = configuration.UsesZLib;
            Serializer             = serializer;
            WebSocketClientFactory = webSocketClientFactory;

            _binder = new(this);
        }
 public GrapheneWitnessNotifier(IWebSocketClientFactory wsClientFact,
                                IGrapheneConfig grapheneConfig)
 {
     _wsClientFact   = wsClientFact;
     _grapheneConfig = grapheneConfig;
 }
Exemple #11
0
        /// <summary>	Constructor. </summary>
        ///
        /// <remarks>	Paul, 26/11/2014. </remarks>
        ///
        /// <param name="rpcUrl">	    Bitshares RPC root url. </param>
        /// <param name="rpcUsername">	The RPC username. </param>
        /// <param name="rpcPassword">	The RPC password. </param>
        public GrapheneWallet(IWebSocketClientFactory wsClientFact)
        {
            ConfigureSerialisation();

            _wsClientFact = wsClientFact;
        }