Exemplo n.º 1
0
        /// <summary>
        /// Register interface:
        ///   * IFeesSettingsClient
        /// </summary>
        public static void RegisterFeesClients(this ContainerBuilder builder,
                                               IMyNoSqlSubscriber myNoSqlSubscriber)
        {
            var feesSettings = new MyNoSqlReadRepository <FeesSettingsNoSqlEntity>(myNoSqlSubscriber,
                                                                                   FeesSettingsNoSqlEntity.TableName);

            var assetFees = new MyNoSqlReadRepository <AssetFeesNoSqlEntity>(myNoSqlSubscriber,
                                                                             AssetFeesNoSqlEntity.TableName);

            var depositFees = new MyNoSqlReadRepository <DepositFeesNoSqlEntity>(myNoSqlSubscriber,
                                                                                 DepositFeesNoSqlEntity.TableName);

            var instrumentFees = new MyNoSqlReadRepository <SpotInstrumentFeesNoSqlEntity>(myNoSqlSubscriber,
                                                                                           SpotInstrumentFeesNoSqlEntity.TableName);

            builder
            .RegisterInstance(new DepositFeesClient(depositFees))
            .As <IDepositFeesClient>()
            .AutoActivate()
            .SingleInstance();

            builder
            .RegisterInstance(new AssetFeesClient(assetFees, feesSettings))
            .As <IAssetFeesClient>()
            .AutoActivate()
            .SingleInstance();

            builder
            .RegisterInstance(new SpotInstrumentFeesClient(instrumentFees, feesSettings))
            .As <ISpotInstrumentFeesClient>()
            .AutoActivate()
            .SingleInstance();
        }
Exemplo n.º 2
0
        public static void RegisterApiKeyVolumesClient(
            this ContainerBuilder builder,
            IMyNoSqlSubscriber myNoSqlSubscriber)
        {
            MyNoSqlReadRepository <ApiKeyVolumeNoSqlEntity> readRepository =
                new MyNoSqlReadRepository <ApiKeyVolumeNoSqlEntity>(myNoSqlSubscriber,
                                                                    ApiKeyVolumeNoSqlEntity.TableName);

            builder.RegisterInstance(readRepository).As <IMyNoSqlServerDataReader <ApiKeyVolumeNoSqlEntity> >()
            .SingleInstance();
        }
        /// <summary>
        /// Register interface:
        ///   * IFeesSettingsClient
        /// </summary>
        public static void RegisterFeesSettingsClients(this ContainerBuilder builder,
                                                       IMyNoSqlSubscriber myNoSqlSubscriber)
        {
            var subs = new MyNoSqlReadRepository <FeesSettingsNoSqlEntity>(myNoSqlSubscriber,
                                                                           FeesSettingsNoSqlEntity.TableName);

            builder
            .RegisterInstance(new FeesSettingsClient(subs))
            .As <IFeesSettingsClient>()
            .AutoActivate()
            .SingleInstance();
        }
        public static void RegisterKycCountriesClient(this ContainerBuilder builder, IMyNoSqlSubscriber myNoSqlSubscriber, string grpcServiceUrl)
        {
            var subs = new MyNoSqlReadRepository <KycCountryNoSqlEntity>(myNoSqlSubscriber, KycCountryNoSqlEntity.TableName);

            var factory = new KYCClientFactory(grpcServiceUrl, subs);

            builder
            .RegisterInstance(subs)
            .As <IMyNoSqlServerDataReader <KycCountryNoSqlEntity> >()
            .SingleInstance();

            builder
            .RegisterInstance(factory.GetKycCountriesService())
            .As <IKycCountriesService>()
            .AutoActivate()
            .SingleInstance();
        }
        /// <summary>
        /// Register interfaces:
        ///   * IKycStatusClient
        /// </summary>
        public static void RegisterKycStatusClients(this ContainerBuilder builder, IMyNoSqlSubscriber myNoSqlSubscriber,
                                                    string kycStatusServiceUrl)
        {
            var kycStatusMyNoSqlReadRepository =
                new MyNoSqlReadRepository <KycProfileNoSqlEntity>(myNoSqlSubscriber, KycProfileNoSqlEntity.TableName);
            var kycClientFactory = new KYCClientFactory(kycStatusServiceUrl);

            builder.RegisterInstance(kycStatusMyNoSqlReadRepository)
            .As <IMyNoSqlServerDataReader <KycProfileNoSqlEntity> >()
            .AutoActivate()
            .SingleInstance();

            builder
            .RegisterInstance(new KycStatusClient(kycStatusMyNoSqlReadRepository,
                                                  kycClientFactory.GetKycStatusService()))
            .As <IKycStatusClient>()
            .AutoActivate()
            .SingleInstance();
        }
 public MyNoSqlReadRepository(IMyNoSqlSubscriber subscriber, string tableName)
 {
     tableName = tableName.ToLower();
     subscriber.Subscribe <T>(tableName, Init, InitPartition, Update, Delete);
 }
        public static void RegisterBitgoSettingsReader(this ContainerBuilder builder, IMyNoSqlSubscriber myNoSqlClient)
        {
            builder
            .RegisterInstance(new MyNoSqlReadRepository <BitgoAssetMapEntity>(myNoSqlClient, BitgoAssetMapEntity.TableName))
            .As <IMyNoSqlServerDataReader <BitgoAssetMapEntity> >()
            .SingleInstance();

            builder
            .RegisterInstance(new MyNoSqlReadRepository <BitgoCoinEntity>(myNoSqlClient, BitgoCoinEntity.TableName))
            .As <IMyNoSqlServerDataReader <BitgoCoinEntity> >()
            .SingleInstance();

            builder
            .RegisterType <WalletMapper>()
            .As <IWalletMapper>()
            .SingleInstance();

            builder
            .RegisterType <AssetMapper>()
            .As <IAssetMapper>()
            .SingleInstance();
        }
Exemplo n.º 8
0
        /// <summary>
        /// Register interfaces:
        ///   * IClientWalletService
        /// </summary>
        public static void RegisterClientWalletsClients(this ContainerBuilder builder, IMyNoSqlSubscriber myNoSqlSubscriber, string clientWalletsGrpcServiceUrl)
        {
            var subs = new MyNoSqlReadRepository <ClientWalletNoSqlEntity>(myNoSqlSubscriber, ClientWalletNoSqlEntity.TableName);

            var factory = new ClientWalletsClientFactory(clientWalletsGrpcServiceUrl, subs);

            builder
            .RegisterInstance(subs)
            .As <IMyNoSqlServerDataReader <ClientWalletNoSqlEntity> >()
            .SingleInstance();

            builder
            .RegisterInstance(factory.ClientWalletService())
            .As <IClientWalletService>()
            .AutoActivate()
            .SingleInstance();
        }
Exemplo n.º 9
0
        public static void RegisterAuthorizationSessionCache(this ContainerBuilder builder, IMyNoSqlSubscriber myNoSqlSubscriber)
        {
            var reader = new MyNoSqlReadRepository <SpotSessionNoSql>(myNoSqlSubscriber, SpotSessionNoSql.TableName);

            builder.RegisterInstance(reader).As <IMyNoSqlServerDataReader <SpotSessionNoSql> >().SingleInstance();
        }
        public static void RegisterMatchingEngineOrderBookClient(this ContainerBuilder builder, IMyNoSqlSubscriber myNoSqlSubscriber)
        {
            var subs = new MyNoSqlReadRepository <OrderBookNoSql>(myNoSqlSubscriber, OrderBookNoSql.TableName);

            builder
            .RegisterInstance(new OrderBookCache(subs))
            .As <IOrderBookService>()
            .AutoActivate()
            .SingleInstance();
        }
        /// <summary>
        /// Register interfaces:
        ///   * ICurrentPricesCache
        /// </summary>
        public static void RegisterMatchingEnginePriceSourceClient(this ContainerBuilder builder, IMyNoSqlSubscriber myNoSqlSubscriber)
        {
            var subs = new MyNoSqlReadRepository <BidAskNoSql>(myNoSqlSubscriber, BidAskNoSql.TableName);

            builder
            .RegisterInstance(new CurrentPricesCache(subs))
            .As <ICurrentPricesCache>()
            .AutoActivate()
            .SingleInstance();
        }
        public static void RegisterBitgoDepositAddressClient(this ContainerBuilder builder,
                                                             string bitgoDepositDetectorGrpcServiceUrl, IMyNoSqlSubscriber myNoSqlClient)
        {
            var reader           = new MyNoSqlReadRepository <DepositAddressEntity>(myNoSqlClient, DepositAddressEntity.TableName);
            var blockchainReader =
                new MyNoSqlReadRepository <BlockchainDepositAddressEntity>(myNoSqlClient,
                                                                           BlockchainDepositAddressEntity.TableName);

            builder
            .RegisterInstance(reader)
            .As <IMyNoSqlServerDataReader <DepositAddressEntity> >()
            .SingleInstance();

            var factory = new DepositDetectorClientFactory(bitgoDepositDetectorGrpcServiceUrl);

            builder
            .RegisterInstance(
                new DepositAddressServiceCachedClient(factory.GetDepositAddressService(), reader, blockchainReader))
            .As <IDepositAddressService>()
            .SingleInstance();
        }
Exemplo n.º 13
0
        public static void RegisterSnapshotClient(this ContainerBuilder builder, string avgPriceGrpcServiceUrl, IMyNoSqlSubscriber myNoSqlSubscriber)
        {
            var factory         = new BalanceHistoryClientFactory(avgPriceGrpcServiceUrl);
            var snapshotService = factory.GetSnapshotService();
            var subs            = new MyNoSqlReadRepository <SnapshotNoSqlEntity>(myNoSqlSubscriber, SnapshotNoSqlEntity.TableName);

            builder
            .RegisterInstance(new SnapshotClient(subs, snapshotService))
            .As <ISnapshotClient>()
            .SingleInstance();
        }
Exemplo n.º 14
0
        public static void RegisterOperationHistoryClient(this ContainerBuilder builder, IMyNoSqlSubscriber myNoSqlSubscriber, string operationHistoryGrpcServiceUrl, int maxCachedEntities)
        {
            var factory = new BalanceHistoryClientFactory(operationHistoryGrpcServiceUrl);
            var operationHistoryService = factory.GetOperationHistoryService();

            var subs = new MyNoSqlReadRepository <OperationHistoryNoSqlEntity>(myNoSqlSubscriber, OperationHistoryNoSqlEntity.TableName);

            builder.RegisterInstance(operationHistoryService).As <IOperationHistoryService>().SingleInstance();
            builder
            .RegisterInstance(new OperationsHistoryHistoryClient(operationHistoryService, subs, maxCachedEntities))
            .As <IOperationsHistoryClient>()
            .SingleInstance();
        }