Beispiel #1
0
        public async Task <CommandHandlingResult> Handle(RetrieveAssetInfoCommand command,
                                                         IEventPublisher publisher)
        {
            var asset = await _assetsService.AssetGetAsync(command.AssetId);

            publisher.PublishEvent(new AssetInfoRetrievedEvent
            {
                DisplayId       = asset.DisplayId,
                MultiplierPower = asset.MultiplierPower,
                AssetAddress    = asset.AssetAddress,
                Accuracy        = asset.Accuracy,
                BlockchainIntegrationLayerId = asset.BlockchainIntegrationLayerId,
                Blockchain           = asset.Blockchain.ToString(),
                Type                 = asset.Type?.ToString(),
                IsTradable           = asset.IsTradable,
                IsTrusted            = asset.IsTrusted,
                KycNeeded            = asset.KycNeeded,
                BlockchainWithdrawal = asset.BlockchainWithdrawal,
                CashoutMinimalAmount = (decimal)asset.CashoutMinimalAmount,
                LowVolumeAmount      = (decimal?)asset.LowVolumeAmount ?? 0,
                LykkeEntityId        = asset.LykkeEntityId,
                Moment               = DateTime.UtcNow,
                OperationId          = command.OperationId
            });

            _chaosKitty.Meow(command.OperationId);

            return(CommandHandlingResult.Ok());
        }
Beispiel #2
0
        public async Task <CommandHandlingResult> Handle(RetrieveAssetInfoCommand command, IEventPublisher publisher)
        {
            var neoAsset = await _assetsService.AssetGetAsync(command.NeoAssetId);

            var gasAsset = await _assetsService.AssetGetAsync(command.GasAssetId);

            publisher.PublishEvent(new AssetInfoRetrievedEvent
            {
                TransactionId        = command.TransactionId,
                NeoAssetId           = command.NeoAssetId,
                NeoBlockchainType    = neoAsset.BlockchainIntegrationLayerId,
                NeoBlockchainAssetId = neoAsset.BlockchainIntegrationLayerAssetId,
                GasAssetId           = command.GasAssetId,
                GasBlockchainType    = gasAsset.BlockchainIntegrationLayerId,
                GasBlockchainAssetId = gasAsset.BlockchainIntegrationLayerAssetId
            });

            _chaosKitty.Meow(command.TransactionId);

            return(CommandHandlingResult.Ok());
        }