Beispiel #1
0
 public WalletService(
     IBitcoindClient bitcoindClient,
     DataContext dataContext)
 {
     _bitcoindClient = bitcoindClient;
     _dataContext    = dataContext;
 }
Beispiel #2
0
 public TransactionService(
     DataContext dataContext,
     IBitcoindClient bitcoindClient)
 {
     _dataContext    = dataContext;
     _bitcoindClient = bitcoindClient;
 }
Beispiel #3
0
 public BitcoinController(
     ITransactionService transactionService,
     IBitcoindClient bitcoindClient,
     AppSettings appSettings)
 {
     _transactionService = transactionService;
     _bitcoindClient     = bitcoindClient;
     _appSettings        = appSettings;
 }
        public void Setup()
        {
            var services      = new ServiceCollection();
            var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

            DIConfiguration.Configurate(services, configuration);
            var provider = services.BuildServiceProvider();
            var servs    = provider.GetServices <IHostedService>();

            _bitcoindClient = provider.GetRequiredService <IBitcoindClient>();
            //_walletService = (WalletService)provider.GetService(typeof(WalletService));
            //_dataContext = (DataContext)provider.GetService(typeof(DataContext));

            //init automapper
            Mapper.Initialize(cfg => {
                cfg.AddProfile <AutoMapperProfile>();
            });

            var b = new BitcoinSingleTransactionDto()
            {
                Txid          = "1",
                Confirmations = 4,
                Time          = 5,
                Details       = new List <Details>
                {
                    new Details
                    {
                        Address  = "2",
                        Category = "send",
                        Amount   = 3
                    }
                }
            };

            var t = Mapper.Map <Transaction>(b);
        }