-
Notifications
You must be signed in to change notification settings - Fork 92
/
index.html
28 lines (27 loc) · 1.32 KB
/
index.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
26
27
28
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
</head>
<body style="background: #fff; margin-top: 3em">
<div>Please run the following command in shell, then enter account id here. masterAccountId default: test.near
</div>
<div>
<code id="shell-command"></code>
</div>
<input type="text" id="accountId" name="accountId" placeholder="Account id"></input>
<button type="button" onClick="done()">done</button>
<script>
const currentUrl = new URL(window.location.href);
const message = `NODE_ENV=local near create_account {newAccountId} --masterAccount {masterAccountId} --publicKey ${currentUrl.searchParams.get('public_key')} --initialAmount 10000000000000000000`;
document.getElementById('shell-command').innerText = message;
function done() {
const successUrl = new URL(currentUrl.searchParams.get('success_url'));
successUrl.searchParams.set('account_id', document.getElementById('accountId').value);
successUrl.searchParams.set('public_key', currentUrl.searchParams.get('public_key'));
window.location.assign(successUrl.toString());
}
</script>
</body>
</html>