-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathchange_inflation_destination.html
48 lines (42 loc) · 1.23 KB
/
change_inflation_destination.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<head>
<title>pool.futuretense.io</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<form>
<div>
<label>Secret key:</label> <input id="seed" type="text">
<input type="button" onclick="signup()" value="Sign up">
</div>
</form>
<script src="js/stellar-sdk.js"></script>
<script>
var HORIZON_SERVER = {
secure: true,
hostname: 'horizon.stellar.org',
port: 443
};
//StellarSdk.Network.useTestNet();
var server = new StellarSdk.Server(HORIZON_SERVER);
StellarSdk.Network.usePublicNetwork();
//StellarSdk.Network.useTestNet();
var signup = function () {
var seed = document.getElementById('seed').value;
var keys = StellarSdk.Keypair.fromSeed(seed);
var accountId = keys.address();
server.loadAccount(accountId)
.then(function (account) {
var tx = new StellarSdk.TransactionBuilder(account)
.addOperation(StellarSdk.Operation.setOptions({
inflationDest: 'GBL7AE2HGRNQSPWV56ZFLILXNT52QWSMOQGDBBXYOP7XKMQTCKVMX2ZL'
})).build();
tx.sign(keys);
return server.submitTransaction(tx);
})
.then(console.log)
.catch(console.log);
};
</script>
</body>
</html>