Created
January 22, 2018 00:03
-
-
Save code-with-sam/0df6e6bfdbf91fa3f69374dcf452b00c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Bot's in Steem-js</title> | |
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script> | |
<script> | |
console.log('Hello, Is Anybody OUt There!?') | |
// Tutorial 06 - Auto Claim Bot | |
const ACCOUNT_NAME = '' | |
const ACCOUNT_KEY = '' | |
const INTERVAL = 60 * 60 * 1000 | |
steem.api.setOptions({ url: 'wss://rpc.buildteam.io' }); | |
setInterval(claimBalance, INTERVAL) | |
function claimBalance(){ | |
steem.api.getAccounts([ACCOUNT_NAME], function(err, result){ | |
console.log(err, result) | |
let sbdReward = result[0].reward_sbd_balance | |
let steemReward = result[0].reward_steem_balance | |
let steemPowerInVests = result[0].reward_vesting_balance | |
steem.broadcast.claimRewardBalance(ACCOUNT_KEY, ACCOUNT_NAME, steemReward, sbdReward, steemPowerInVests, function(err, result) { | |
console.log(err, result); | |
}); | |
}) | |
} | |
</script> | |
</head> | |
<body>Check The Console.</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment