Skip to content
Permalink
Browse files

update staking integratioin

  • Loading branch information...
thanhson1085 committed Jun 4, 2019
1 parent daec28c commit ef1598b04a6c2395c02afacaeec56427008f5b8d
Showing with 18 additions and 7 deletions.
  1. +18 −7 docs/developers/staking-integrations.md
@@ -160,14 +160,25 @@ validator.methods.resign(coinbase).call({
## Withdraw TOMO
You need to wait for 48 epochs (if unvote), 30 days (if resign) to unlock your TOMO staked


#### Example
```javascript
validator.methods.withdraw(blocknumber, index).call({
from : owner,
gas: 2000000,
gasPrice: 250000000
})
.then((result) => {
// get highest block number
web3.eth.getBlockNumber().then(blockNumber => {
return validator.methods.getWithdrawBlockNumbers().call({
from: owner
}).then(result => result, blockNumber)
}).then(result, blockNumber => {
let map = result.map(it, idx => {
if (parseInt(it) < blockNumber) {
return validator.methods.withdraw(it, idx).call({
from : owner,
gas: 2000000,
gasPrice: 250000000
})
}
})
return Promise.all(map)
}).then((result) => {
console.log(result)
}).catch(e => console.log(e))
```

0 comments on commit ef1598b

Please sign in to comment.
You can’t perform that action at this time.