public BlockchainsModule(
     BlockchainsIntegrationSettings blockchainsIntegrationSettings,
     BlockchainWalletsServiceClientSettings blockchainWalletsServiceClientSettings)
 {
     _blockchainsIntegrationSettings         = blockchainsIntegrationSettings ?? throw new ArgumentNullException(nameof(blockchainsIntegrationSettings));
     _blockchainWalletsServiceClientSettings = blockchainWalletsServiceClientSettings ?? throw new ArgumentNullException(nameof(blockchainWalletsServiceClientSettings));
 }
コード例 #2
0
 public BlockchainsModule(
     BlockchainOperationsExecutorSettings blockchainOperationsExecutorSettings,
     BlockchainsIntegrationSettings blockchainsIntegrationSettings,
     BlockchainSignFacadeClientSettings blockchainSignFacadeClientSettings)
 {
     _blockchainOperationsExecutorSettings = blockchainOperationsExecutorSettings;
     _blockchainsIntegrationSettings       = blockchainsIntegrationSettings;
     _blockchainSignFacadeClientSettings   = blockchainSignFacadeClientSettings;
 }
        public BlockchainApiClientProvider(BlockchainsIntegrationSettings settings, ILogFactory logFactory, int blockchainApiTimeoutSeconds)
        {
            if (settings == null)
            {
                throw new ArgumentException($"{nameof(settings)} should not be null");
            }

            var timeout = TimeSpan.FromSeconds(blockchainApiTimeoutSeconds);

            _clients = settings.Blockchains.ToImmutableDictionary(x => x.Type,
                                                                  x => (IBlockchainApiClient) new BlockchainApiClient(logFactory, x.ApiUrl, timeout, 3));
        }
コード例 #4
0
 public ServiceModule(
     BlockchainsIntegrationSettings blockchainsIntegrationSettings,
     BlockchainSignFacadeClientSettings blockchainSignFacadeClientSettings,
     AppSettings appSettings,
     AssetServiceClientSettings assetServiceSettings,
     BlockchainWalletsSettings blockchainWalletsSettings)
 {
     _blockchainsIntegrationSettings     = blockchainsIntegrationSettings;
     _blockchainSignFacadeClientSettings = blockchainSignFacadeClientSettings;
     _appSettings               = appSettings;
     _assetServiceSettings      = assetServiceSettings;
     _blockchainWalletsSettings = blockchainWalletsSettings;
 }
コード例 #5
0
        public BlockchainIntegrationService(
            BlockchainsIntegrationSettings settings,
            int timeoutFoApiInSeconds,
            ILogFactory logFactory)
        {
            if (logFactory == null)
            {
                throw new ArgumentNullException(nameof(logFactory));
            }
            var log     = logFactory.CreateLog(this);
            var timeout = TimeSpan.FromSeconds(timeoutFoApiInSeconds);

            foreach (var blockchain in settings.Blockchains)
            {
                log.Info($"Registering blockchain: {blockchain.Type} -> \r\nAPI: {blockchain.ApiUrl}\r\nHW: {blockchain.HotWalletAddress}");
            }

            _apiClients = settings.Blockchains.ToImmutableDictionary
                          (
                x => x.Type,
                y => new BlockchainApiClient(logFactory, y.ApiUrl, timeout, 3)
                          );
        }
 public BlockchainSettingsProvider(BlockchainsIntegrationSettings settings)
 {
     _settings = settings?.Blockchains.ToImmutableDictionary(x => x.Type, x => x);
 }
コード例 #7
0
 public HealthService(
     BlockchainsIntegrationSettings settings)
 {
     _settings = settings;
 }