forked from kobigurk/icebox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendtx.html
25 lines (23 loc) · 795 Bytes
/
sendtx.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<html>
<head>
<title>icebox - send tx</title>
</head>
<body>
<script src="./node_modules/web3/dist/web3.min.js"></script>
<script>
function sendTx() {
var web3 = new Web3();
var web3prov = new web3.providers.HttpProvider('http://localhost:8545');
web3.setProvider(web3prov);
var rawtx = document.getElementById('rawSignedTx').value;
web3.eth.sendRawTransaction(rawtx, function (tx) {
document.getElementById('confirmation').innerHTML = "Transaction submitted to network. TxID: " + tx;
});
}
</script>
<h1>Send Transaction</h1>
<div><textarea id='rawSignedTx' rows=6 cols=40></textarea></div>
<button onclick="sendTx()">Send Transaction</button>
<div id="confirmation"></div>
</body>
</html>