コード例 #1
0
        public async Task <Transaction> GetTransaction(string txId)
        {
            var rpcRequest  = RpcRequestFactory.CreateRpcRequest(1, BitcoinMethods.GetTransaction, txId);
            var rpcResponse = await rpcService.SendRequest <TransactionRpcResponse>(rpcRequest);

            return(mapper.Map <TransactionRpcResponse, Transaction>(rpcResponse.Result));
        }
コード例 #2
0
        private async Task <Wallet> GetWalletFromBitcoinDaemon()
        {
            var rpcRequest  = RpcRequestFactory.CreateRpcRequest(1, BitcoinMethods.GetWalletInfo);
            var rpcResponse = await rpcService.SendRequest <GetWalletInfoRpcResponse>(rpcRequest);

            return(mapper.Map <GetWalletInfoRpcResponse, Wallet>(rpcResponse.Result));
        }
コード例 #3
0
        public async Task <string> SendBitcoins(SendBitcoinModel sendBitcoinModel)
        {
            var rpcRequest  = RpcRequestFactory.CreateRpcRequest(1, BitcoinMethods.SendToAddress, sendBitcoinModel.Address, sendBitcoinModel.Amount);
            var rpcResponse = await rpcService.SendRequest <string>(rpcRequest);

            return(rpcResponse.Result);
        }