JS版一次领取所有代领取SCOT代币

in #cn5 years ago (edited)



(Image source: Pixabay)

昨天看到@holger80介绍怎么通过python一次性领取所有待领的Steem-engine代币: How to claim all pending token rewards at once - improved claim command

我对Python不熟,加上Python在windows系统安装麻烦,所以我一般使用JS。

之前用JS写过一个自动领取代币的小程序,现在SCOT支持一次领取多个代币后,对现有的版本进行了小修改。有兴趣的可以使用:

const fetch = require("node-fetch");
const request = require('request');
const steem = require('steem');
const account = 'steem id';//你的steem id
const wif = 'posting Key'; //你的发帖密钥

(async() => {
let tokens = await getClaimable(account);
if (tokens.length > 0) {
claimToken(tokens);
} else {
console.log("Nothing to claim.")
}

})();

function claimToken(tokens) {
let json = [];
for (let i in tokens) {
json.push({
symbol: tokens[i].symbol
})
}
steem.broadcast.customJson(wif, [], [account], 'scot_claim_token', JSON.stringify(json), (err, result) => {
if (err)
console.log(err);
else {
console.log(tokens.length + " tokens claimed");
}

});

}

async function getClaimable(account) {
let claimable = [];
let token = await(await fetch('https://scot-api.steem-engine.com/@' + account, {
method: 'GET'
})).json();
for (let i in token) {
if (token[i].pending_token > 0) {
claimable.push({
symbol: i,
token: token[i].pending_token
})
}
}
return claimable;
}

如果你不会编程,也不会运行程序。那你可以使用阿盐@robertyan弄的自动领取SCOT 代币奖励的程序. 具体查看:自动领取 SCOT 代币奖励

自己动手弄点小程序也是挺有意思的,@windenchanter来尝试一下吧。 ---

Sort:  

感谢代理1005.69SP 给team-cn! 由于你使用CN作为你的首标签,额外获得2%点赞! 你的帖子获得team-cn 27% 点赞!(如果不想看到这个回复,请回复“取消”)

吃了吗?来 @steemgg 玩游戏吧,决战到天亮如果不想再收到我的留言,请回复“取消”。

每次要領,都得登入一次....挺麻煩的!
我來試試看這個會不會好些👍🏻👍🏻👍🏻

Posted using Partiko iOS

嗯,迟早尝试,以后每周找点时间来玩玩

Posted using Partiko Android

Thank you so much for participating in the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!

Hi @ericet!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.812 which ranks you at #1443 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 132 contributions, your post is ranked at #6.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers appreciate your great work!
  • Great user engagement! You rock!

Feel free to join our @steem-ua Discord server

image.png
image.png
js小白投来无助的目光,这个错误是什么意思?chrome控制台运行不起来呀~要有什么环境么?

你要安装node,windows上有的,然后安装npm

Posted using Partiko iOS

看来也没比python布置起来轻松多少~(((φ(◎ロ◎;)φ)))

简单多了,不然我也不会去学js

Posted using Partiko iOS

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63402.76
ETH 2554.52
USDT 1.00
SBD 2.66