當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript steem.api類代碼示例

本文整理匯總了TypeScript中steem.api的典型用法代碼示例。如果您正苦於以下問題:TypeScript api類的具體用法?TypeScript api怎麽用?TypeScript api使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了api類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: isValidAccount

// Checks if the public with the private key are valid.
function isValidAccount(req: any, res: any, next: any) {
    steem.api.setOptions({ url: 'https://api.steemit.com' });
    try {
        if (steem.auth.wifIsValid(req.body.acc.key, req.body.acc.publicKey)) {
            next();
        } else {
            return res.status(401).send(new Error(StatusMessages._401));
        }
    } catch (err) { return res.status(401).send(new Error(StatusMessages._401)); }
}
開發者ID:damisv,項目名稱:steemBotJobs,代碼行數:11,代碼來源:index.ts

示例2: start

 public async start() {
     steem.api.setOptions({ url: 'https://api.steemit.com' });
     const exists = await DBClient.findOne({_id: this.jobID}, 'logs');
     if (exists === null) {
         await DBClient.insertOne({_id: this.jobID, logs: []}, 'logs');
     }
     try {
         const count: {[key: string]: any} = await this.getCount();
         const followers = await this.getFollowers(count['follower_count']);
         const following = await this.getFollowing(count['following_count']);
         let temp = await this.getUsersToBeFollowed(followers, following, this.user);
         if (temp.length > 0) {
             await this.sendLog('log', `SHOULD FOLLOW --> ${temp.length} users`);
             this.follow(temp);
         } else {
             await this.sendLog('log', `${this.user} FOLLOWS EVERY FOLLOWER ALREADY`);
         }
     } catch (error) {
         await this.sendLog('error', error);
     }
 }
開發者ID:damisv,項目名稱:steemBotJobs,代碼行數:21,代碼來源:steem.ts

示例3: Promise

 return new Promise((resolve, reject) => {
     steem.api.getFollowing(this.user, 0, 'blog', count,
         (err: any, result: any) => err ? reject(err): resolve(result));
 })
開發者ID:damisv,項目名稱:steemBotJobs,代碼行數:4,代碼來源:steem.ts

示例4: Promise

 return new Promise((resolve, reject) => {
   steem.api.getRewardFund('post', (e, fund) => {
     if (e) return reject(e);
     resolve(fund);
   });
 });
開發者ID:eastmaels,項目名稱:v2.api.utopian.io,代碼行數:6,代碼來源:steemAPI.ts


注:本文中的steem.api類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。