Skip to content

Commit f6cea72

Browse files
committed
Staking
1 parent 2dadfe1 commit f6cea72

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

2_generate_transaction.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
).sort(
1515
function(a, b){return parseInt(Eos.modules.format.encodeName(a, false)) - parseInt(Eos.modules.format.encodeName(b, false));}
1616
);
17+
18+
let main_token_symbol = 'EOS';
19+
let stake_net_quantity = document.getElementById('stake_net_quantity').value;
20+
let stake_cpu_quantity = document.getElementById('stake_cpu_quantity').value;
21+
1722
let expireInSeconds = 60 * document.getElementById('minutes_before_expiration').value;
1823
let block_num = +document.getElementById('block_num').value;
1924
let chainId = document.getElementById('chainId').value;
@@ -49,6 +54,14 @@
4954

5055
EOS.transaction(
5156
function(tr){
57+
tr.delegatebw({
58+
'from': account_name,
59+
'receiver': account_name,
60+
'stake_net_quantity': stake_net_quantity.toString() + ' ' + main_token_symbol,
61+
'stake_cpu_quantity': stake_cpu_quantity.toString() + ' ' + main_token_symbol,
62+
'transfer': 0
63+
});
64+
5265
tr.voteproducer({
5366
'voter': account_name,
5467
'proxy': '',
@@ -110,6 +123,16 @@ <h1>Step 2: Generate your voting transaction while being OFF-LINE</h1>
110123
<label for="minutes_before_expiration">Transaction will expire in</label>
111124
<input type="number" min="1" max="60" step="1" name="minutes_before_expiration" id="minutes_before_expiration" value="10" required> minutes<br>
112125

126+
<h3>Staking</h3>
127+
128+
<label for="stake_net_quantity">Stake Net Quantity</label>
129+
<input type="number" min="0" step="1" name="stake_net_quantity" id="stake_net_quantity" value="0" required> EOS<br>
130+
131+
<label for="stake_cpu_quantity">Stake CPU Quantity</label>
132+
<input type="number" min="0" step="1" name="stake_cpu_quantity" id="stake_cpu_quantity" value="0" required> EOS<br>
133+
134+
<h3>Voting</h3>
135+
113136
<label for="bp">Block Producers</label>
114137
<input type="text" name="bp" id="bp" value="" style="width: 700px;" placeholder="Coma separated list of block producers account names (no more than 30). Example: alpha, beta, gamma" required><br>
115138

0 commit comments

Comments
 (0)