コード例 #1
0
        ///<inheritdoc cref="IMatchingEngineClient"/>
        public Task <MeResponseModel> CashInOutAsync(
            string id,
            string clientId,
            string assetId,
            int accuracy,
            double amount,
            string feeClientId,
            double feeSize,
            FeeSizeType feeSizeType,
            CancellationToken cancellationToken = default)
        {
            var fee = FeeExtensions.GenerateCashInOutFee(
                amount,
                accuracy,
                feeClientId,
                feeSize,
                feeSizeType);

            var amountWithFee = fee?.CalculateAmountWithFee(amount, accuracy) ??
                                amount.TruncateDecimalPlaces(accuracy, true);

            var model = MeNewCashInOutModel.Create(
                id,
                clientId,
                assetId,
                amountWithFee,
                fee?.ToMeModel());

            return(SendData(
                       model,
                       _newTasksManager,
                       x => x.ToDomainModel(),
                       _meResponsePolicy,
                       cancellationToken,
                       id,
                       $"{assetId} with acc {accuracy} and fee type {feeSizeType}"
                       ));
        }
コード例 #2
0
        ///<inheritdoc cref="IMatchingEngineClient"/>
        public Task <MeResponseModel> CashInOutAsync(
            string id,
            string clientId,
            string assetId,
            double amount,
            CancellationToken cancellationToken = default)
        {
            var model = MeNewCashInOutModel.Create(
                id,
                clientId,
                assetId,
                amount);

            return(SendData(
                       model,
                       _newTasksManager,
                       x => x.ToDomainModel(),
                       _meResponsePolicy,
                       cancellationToken,
                       id,
                       assetId
                       ));
        }