본문 바로가기
블록체인

wallet.html

by ^..^v 2019. 10. 8.
728x90
반응형

 

C:\testnet\wallet.html

<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js@0.20.6/dist/web3.js"></script>
	<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
	<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
	<style>
		label { 
			min-width: 200px !important;
			display: inline-block !important;
		}
	</style>
</head>
<body>
	<div class="container">
		<!-- 제목 --> 
		<div class="row">
			<h1>ETHER wallet</h1>
		</div>
		<!-- 계좌 잔고 출력 -->
		<div class="row">
			<div id="divStatus">
				<!--
				<table class="table table-striped">
				<thead class="thead-dark">
					<tr>
						<th scope="col">계정</th>
						<th scope="col">잔액</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>0x202020202020202</td>
						<td>22020.0000</td>
					</tr>
				</tbody>
				</table>
				-->
			</div>
		</div>
		<!-- 송금 입력 창 -->
		<div class="row">
			<div class="input-group">
				<label class="input-group-text" for="fromAccounts">보내는 사람</label>
				<select class="form-control accountsList" id="fromAccounts">
					<option selected>선택하세요.</option>
				</select>
			</div>
			<div class="input-group">
				<label class="input-group-text" fro="fromPassword">패스워드</label>
				<input class="form-control" id="fromPassword" type="password" />
			</div>
			<div class="input-group">
				<label class="input-group-text" for="toAccounts">받는 사람</label>
				<select class="form-control accountsList" id="toAccounts">
					<option selected>선택하세요.</option>
				</select>
			</div>
			<div class="input-group">
				<label class="input-group-text" for="amount">송금액</label>
				<input class="form-control" id="amount" type="number" />
				<div class="input-group-append">
					<span class="input-group-text">ETHER</span>
					<button type="button" class="btn btn-primary" id="btnSend">송금</button>
				</div>
			</div>
		</div>
	</div>

	<script>
	   var Web3 = require('web3');
	   web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

		// 계정 정보를 조회해서 보내는 사람과 받는 사람 선택창에 설정
		function setAccountsList() {
			// TODO
		}

		// 계정별 잔액을 divStatus 영역에 출력
		function showStatus() {
			// TODO
		}

		$(function() {
			setAccountsList();
			showStatus();

			// 블록에 변화가 생기면 계정별 잔액 정보를 갱신
			// TODO

			// 송금 버튼을 클릭하면 송금을 요청
			// TODO

		});

	</script>
</body>
</html>

 

728x90
반응형

'블록체인' 카테고리의 다른 글

web3 연동  (0) 2019.10.08
단일 머신에서 멀티 노드 실행  (0) 2019.10.08
Remix 환경에서 계약 작성  (0) 2019.10.08
콘솔에서 계약 배포, 실행  (0) 2019.10.04
Postman을 이용한 RPC 테스트  (0) 2019.10.04

댓글