public PaymentServiceJsonRpcServer(System.Dispatcher sys, System.Event stopEvent, WalletService service, Logging.ILogger loggerGroup, PaymentService.ConfigurationManager config) : base(sys, stopEvent, loggerGroup, config)
 {
     this.service = new PaymentService.WalletService(service);
     this.logger  = new Logging.LoggerRef(loggerGroup, "PaymentServiceJsonRpcServer");
     handlers.Add("save", jsonHandler <Save.Request, Save.Response>(std::bind(this.handleSave, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("export", jsonHandler <Export.Request, Export.Response>(std::bind(this.handleExport, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("reset", jsonHandler <Reset.Request, Reset.Response>(std::bind(this.handleReset, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("createAddress", jsonHandler <CreateAddress.Request, CreateAddress.Response>(std::bind(this.handleCreateAddress, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("createAddressList", jsonHandler <CreateAddressList.Request, CreateAddressList.Response>(std::bind(this.handleCreateAddressList, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("deleteAddress", jsonHandler <DeleteAddress.Request, DeleteAddress.Response>(std::bind(this.handleDeleteAddress, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getSpendKeys", jsonHandler <GetSpendKeys.Request, GetSpendKeys.Response>(std::bind(this.handleGetSpendKeys, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getBalance", jsonHandler <GetBalance.Request, GetBalance.Response>(std::bind(this.handleGetBalance, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getBlockHashes", jsonHandler <GetBlockHashes.Request, GetBlockHashes.Response>(std::bind(this.handleGetBlockHashes, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getTransactionHashes", jsonHandler <GetTransactionHashes.Request, GetTransactionHashes.Response>(std::bind(this.handleGetTransactionHashes, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getTransactions", jsonHandler <GetTransactions.Request, GetTransactions.Response>(std::bind(this.handleGetTransactions, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getUnconfirmedTransactionHashes", jsonHandler <GetUnconfirmedTransactionHashes.Request, GetUnconfirmedTransactionHashes.Response>(std::bind(this.handleGetUnconfirmedTransactionHashes, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getTransaction", jsonHandler <GetTransaction.Request, GetTransaction.Response>(std::bind(this.handleGetTransaction, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("sendTransaction", jsonHandler <SendTransaction.Request, SendTransaction.Response>(std::bind(this.handleSendTransaction, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("createDelayedTransaction", jsonHandler <CreateDelayedTransaction.Request, CreateDelayedTransaction.Response>(std::bind(this.handleCreateDelayedTransaction, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getDelayedTransactionHashes", jsonHandler <GetDelayedTransactionHashes.Request, GetDelayedTransactionHashes.Response>(std::bind(this.handleGetDelayedTransactionHashes, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("deleteDelayedTransaction", jsonHandler <DeleteDelayedTransaction.Request, DeleteDelayedTransaction.Response>(std::bind(this.handleDeleteDelayedTransaction, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("sendDelayedTransaction", jsonHandler <SendDelayedTransaction.Request, SendDelayedTransaction.Response>(std::bind(this.handleSendDelayedTransaction, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getViewKey", jsonHandler <GetViewKey.Request, GetViewKey.Response>(std::bind(this.handleGetViewKey, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getMnemonicSeed", jsonHandler <GetMnemonicSeed.Request, GetMnemonicSeed.Response>(std::bind(this.handleGetMnemonicSeed, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getStatus", jsonHandler <GetStatus.Request, GetStatus.Response>(std::bind(this.handleGetStatus, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getAddresses", jsonHandler <GetAddresses.Request, GetAddresses.Response>(std::bind(this.handleGetAddresses, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("sendFusionTransaction", jsonHandler <SendFusionTransaction.Request, SendFusionTransaction.Response>(std::bind(this.handleSendFusionTransaction, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("estimateFusion", jsonHandler <EstimateFusion.Request, EstimateFusion.Response>(std::bind(this.handleEstimateFusion, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("createIntegratedAddress", jsonHandler <CreateIntegratedAddress.Request, CreateIntegratedAddress.Response>(std::bind(this.handleCreateIntegratedAddress, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getFeeInfo", jsonHandler <NodeFeeInfo.Request, NodeFeeInfo.Response>(std::bind(this.handleNodeFeeInfo, this, std::placeholders._1, std::placeholders._2)));
     handlers.Add("getNodeFeeInfo", jsonHandler <NodeFeeInfo.Request, NodeFeeInfo.Response>(std::bind(this.handleNodeFeeInfo, this, std::placeholders._1, std::placeholders._2)));
 }
Ejemplo n.º 2
0
 public JsonRpcServer(System.Dispatcher sys, System.Event stopEvent, Logging.ILogger loggerGroup, PaymentService.ConfigurationManager config) : base(sys, loggerGroup)
 {
     this.stopEvent = stopEvent;
     this.logger    = new Logging.LoggerRef(loggerGroup, "JsonRpcServer");
     this.config    = new PaymentService.ConfigurationManager(config);
 }