Comparing version 0.2.21 to 0.3.0
@@ -1,5 +0,4 @@ | ||
var Steem = require('./lib/steem'), | ||
steem = new Steem(); | ||
var steem = require('./index'); | ||
steem.login('******', '****************', function(err, result) { | ||
steem.api.login('******', '****************', function(err, result) { | ||
console.log(result); | ||
@@ -19,5 +18,5 @@ var trx = { | ||
}; | ||
steem.broadcastTransaction(trx, function(err, result) { | ||
steem.api.broadcastTransaction(trx, function(err, result) { | ||
console.log(err, result); | ||
}); | ||
}); |
@@ -11,3 +11,3 @@ # Documentation | ||
```js | ||
steem.setSubscribeCallback(cb, clearFilter, function(err, result) { | ||
steem.api.setSubscribeCallback(cb, clearFilter, function(err, result) { | ||
console.log(err, result); | ||
@@ -18,3 +18,3 @@ }); | ||
```js | ||
steem.setPendingTransactionCallback(cb, function(err, result) { | ||
steem.api.setPendingTransactionCallback(cb, function(err, result) { | ||
console.log(err, result); | ||
@@ -25,3 +25,3 @@ }); | ||
```js | ||
steem.setBlockAppliedCallback(cb, function(err, result) { | ||
steem.api.setBlockAppliedCallback(cb, function(err, result) { | ||
console.log(err, result); | ||
@@ -32,3 +32,3 @@ }); | ||
```js | ||
steem.cancelAllSubscriptions(function(err, result) { | ||
steem.api.cancelAllSubscriptions(function(err, result) { | ||
console.log(err, result); | ||
@@ -41,3 +41,3 @@ }); | ||
```js | ||
steem.getTrendingTags(afterTag, limit, function(err, result) { | ||
steem.api.getTrendingTags(afterTag, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -48,3 +48,3 @@ }); | ||
```js | ||
steem.getDiscussionsByTrending(query, function(err, result) { | ||
steem.api.getDiscussionsByTrending(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -55,3 +55,3 @@ }); | ||
```js | ||
steem.getDiscussionsByCreated(query, function(err, result) { | ||
steem.api.getDiscussionsByCreated(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -62,3 +62,3 @@ }); | ||
```js | ||
steem.getDiscussionsByActive(query, function(err, result) { | ||
steem.api.getDiscussionsByActive(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -69,3 +69,3 @@ }); | ||
```js | ||
steem.getDiscussionsByCashout(query, function(err, result) { | ||
steem.api.getDiscussionsByCashout(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -76,3 +76,3 @@ }); | ||
```js | ||
steem.getDiscussionsByPayout(query, function(err, result) { | ||
steem.api.getDiscussionsByPayout(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -83,3 +83,3 @@ }); | ||
```js | ||
steem.getDiscussionsByVotes(query, function(err, result) { | ||
steem.api.getDiscussionsByVotes(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -90,3 +90,3 @@ }); | ||
```js | ||
steem.getDiscussionsByChildren(query, function(err, result) { | ||
steem.api.getDiscussionsByChildren(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -97,3 +97,3 @@ }); | ||
```js | ||
steem.getDiscussionsByHot(query, function(err, result) { | ||
steem.api.getDiscussionsByHot(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -104,3 +104,3 @@ }); | ||
```js | ||
steem.getDiscussionsByFeed(query, function(err, result) { | ||
steem.api.getDiscussionsByFeed(query, function(err, result) { | ||
console.log(err, result); | ||
@@ -113,3 +113,3 @@ }); | ||
```js | ||
steem.getBlockHeader(blockNum, function(err, result) { | ||
steem.api.getBlockHeader(blockNum, function(err, result) { | ||
console.log(err, result); | ||
@@ -120,3 +120,3 @@ }); | ||
```js | ||
steem.getBlock(blockNum, function(err, result) { | ||
steem.api.getBlock(blockNum, function(err, result) { | ||
console.log(err, result); | ||
@@ -127,3 +127,3 @@ }); | ||
```js | ||
steem.getState(path, function(err, result) { | ||
steem.api.getState(path, function(err, result) { | ||
console.log(err, result); | ||
@@ -134,3 +134,3 @@ }); | ||
```js | ||
steem.getTrendingCategories(after, limit, function(err, result) { | ||
steem.api.getTrendingCategories(after, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -141,3 +141,3 @@ }); | ||
```js | ||
steem.getBestCategories(after, limit, function(err, result) { | ||
steem.api.getBestCategories(after, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -148,3 +148,3 @@ }); | ||
```js | ||
steem.getActiveCategories(after, limit, function(err, result) { | ||
steem.api.getActiveCategories(after, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -155,3 +155,3 @@ }); | ||
```js | ||
steem.getRecentCategories(after, limit, function(err, result) { | ||
steem.api.getRecentCategories(after, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -164,3 +164,3 @@ }); | ||
```js | ||
steem.getConfig(function(err, result) { | ||
steem.api.getConfig(function(err, result) { | ||
console.log(err, result); | ||
@@ -171,3 +171,3 @@ }); | ||
```js | ||
steem.getDynamicGlobalProperties(function(err, result) { | ||
steem.api.getDynamicGlobalProperties(function(err, result) { | ||
console.log(err, result); | ||
@@ -178,3 +178,3 @@ }); | ||
```js | ||
steem.getChainProperties(after, limit, function(err, result) { | ||
steem.api.getChainProperties(after, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -185,3 +185,3 @@ }); | ||
```js | ||
steem.getFeedHistory(function(err, result) { | ||
steem.api.getFeedHistory(function(err, result) { | ||
console.log(err, result); | ||
@@ -192,3 +192,3 @@ }); | ||
```js | ||
steem.getCurrentMedianHistoryPrice(function(err, result) { | ||
steem.api.getCurrentMedianHistoryPrice(function(err, result) { | ||
console.log(err, result); | ||
@@ -199,3 +199,3 @@ }); | ||
```js | ||
steem.getWitnessSchedule(function(err, result) { | ||
steem.api.getWitnessSchedule(function(err, result) { | ||
console.log(err, result); | ||
@@ -206,3 +206,3 @@ }); | ||
```js | ||
steem.getHardforkVersion(function(err, result) { | ||
steem.api.getHardforkVersion(function(err, result) { | ||
console.log(err, result); | ||
@@ -213,3 +213,3 @@ }); | ||
```js | ||
steem.getNextScheduledHardfork(function(err, result) { | ||
steem.api.getNextScheduledHardfork(function(err, result) { | ||
console.log(err, result); | ||
@@ -222,3 +222,3 @@ }); | ||
```js | ||
steem.getKeyReferences(key, function(err, result) { | ||
steem.api.getKeyReferences(key, function(err, result) { | ||
console.log(err, result); | ||
@@ -231,3 +231,3 @@ }); | ||
```js | ||
steem.getAccounts(names, function(err, result) { | ||
steem.api.getAccounts(names, function(err, result) { | ||
console.log(err, result); | ||
@@ -238,3 +238,3 @@ }); | ||
```js | ||
steem.getAccountReferences(accountId, function(err, result) { | ||
steem.api.getAccountReferences(accountId, function(err, result) { | ||
console.log(err, result); | ||
@@ -245,3 +245,3 @@ }); | ||
```js | ||
steem.lookupAccountNames(accountNames, function(err, result) { | ||
steem.api.lookupAccountNames(accountNames, function(err, result) { | ||
console.log(err, result); | ||
@@ -252,3 +252,3 @@ }); | ||
```js | ||
steem.lookupAccounts(lowerBoundName, limit, function(err, result) { | ||
steem.api.lookupAccounts(lowerBoundName, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -259,3 +259,3 @@ }); | ||
```js | ||
steem.getAccountCount(function(err, result) { | ||
steem.api.getAccountCount(function(err, result) { | ||
console.log(err, result); | ||
@@ -266,3 +266,3 @@ }); | ||
```js | ||
steem.getConversionRequests(accountName, function(err, result) { | ||
steem.api.getConversionRequests(accountName, function(err, result) { | ||
console.log(err, result); | ||
@@ -273,3 +273,3 @@ }); | ||
```js | ||
steem.getAccountHistory(account, from, limit, function(err, result) { | ||
steem.api.getAccountHistory(account, from, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -280,3 +280,3 @@ }); | ||
```js | ||
steem.getOwnerHistory(account, function(err, result) { | ||
steem.api.getOwnerHistory(account, function(err, result) { | ||
console.log(err, result); | ||
@@ -287,3 +287,3 @@ }); | ||
```js | ||
steem.getRecoveryRequest(account, function(err, result) { | ||
steem.api.getRecoveryRequest(account, function(err, result) { | ||
console.log(err, result); | ||
@@ -296,3 +296,3 @@ }); | ||
```js | ||
steem.getOrderBook(limit, function(err, result) { | ||
steem.api.getOrderBook(limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -303,3 +303,3 @@ }); | ||
```js | ||
steem.getOpenOrders(owner, function(err, result) { | ||
steem.api.getOpenOrders(owner, function(err, result) { | ||
console.log(err, result); | ||
@@ -310,3 +310,3 @@ }); | ||
```js | ||
steem.getLiquidityQueue(startAccount, limit, function(err, result) { | ||
steem.api.getLiquidityQueue(startAccount, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -319,3 +319,3 @@ }); | ||
```js | ||
steem.getTransactionHex(trx, function(err, result) { | ||
steem.api.getTransactionHex(trx, function(err, result) { | ||
console.log(err, result); | ||
@@ -326,3 +326,3 @@ }); | ||
```js | ||
steem.getTransaction(trxId, function(err, result) { | ||
steem.api.getTransaction(trxId, function(err, result) { | ||
console.log(err, result); | ||
@@ -333,3 +333,3 @@ }); | ||
```js | ||
steem.getRequiredSignatures(trx, availableKeys, function(err, result) { | ||
steem.api.getRequiredSignatures(trx, availableKeys, function(err, result) { | ||
console.log(err, result); | ||
@@ -340,3 +340,3 @@ }); | ||
```js | ||
steem.getPotentialSignatures(trx, function(err, result) { | ||
steem.api.getPotentialSignatures(trx, function(err, result) { | ||
console.log(err, result); | ||
@@ -347,3 +347,3 @@ }); | ||
```js | ||
steem.verifyAuthority(trx, function(err, result) { | ||
steem.api.verifyAuthority(trx, function(err, result) { | ||
console.log(err, result); | ||
@@ -354,3 +354,3 @@ }); | ||
```js | ||
steem.verifyAccountAuthority(nameOrId, signers, function(err, result) { | ||
steem.api.verifyAccountAuthority(nameOrId, signers, function(err, result) { | ||
console.log(err, result); | ||
@@ -363,3 +363,3 @@ }); | ||
```js | ||
steem.getActiveVotes(author, permlink, function(err, result) { | ||
steem.api.getActiveVotes(author, permlink, function(err, result) { | ||
console.log(err, result); | ||
@@ -370,3 +370,3 @@ }); | ||
```js | ||
steem.getAccountVotes(voter, function(err, result) { | ||
steem.api.getAccountVotes(voter, function(err, result) { | ||
console.log(err, result); | ||
@@ -379,3 +379,3 @@ }); | ||
```js | ||
steem.getContent(author, permlink, function(err, result) { | ||
steem.api.getContent(author, permlink, function(err, result) { | ||
console.log(err, result); | ||
@@ -386,3 +386,3 @@ }); | ||
```js | ||
steem.getContentReplies(parent, parentPermlink, function(err, result) { | ||
steem.api.getContentReplies(parent, parentPermlink, function(err, result) { | ||
console.log(err, result); | ||
@@ -393,3 +393,3 @@ }); | ||
```js | ||
steem.getDiscussionsByAuthorBeforeDate(author, startPermlink, beforeDate, limit, function(err, result) { | ||
steem.api.getDiscussionsByAuthorBeforeDate(author, startPermlink, beforeDate, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -400,3 +400,3 @@ }); | ||
```js | ||
steem.getRepliesByLastUpdate(startAuthor, startPermlink, limit, function(err, result) { | ||
steem.api.getRepliesByLastUpdate(startAuthor, startPermlink, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -409,3 +409,3 @@ }); | ||
```js | ||
steem.getWitnesses(witnessIds, function(err, result) { | ||
steem.api.getWitnesses(witnessIds, function(err, result) { | ||
console.log(err, result); | ||
@@ -416,3 +416,3 @@ }); | ||
```js | ||
steem.getWitnessByAccount(accountName, function(err, result) { | ||
steem.api.getWitnessByAccount(accountName, function(err, result) { | ||
console.log(err, result); | ||
@@ -423,3 +423,3 @@ }); | ||
```js | ||
steem.getWitnessesByVote(from, limit, function(err, result) { | ||
steem.api.getWitnessesByVote(from, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -430,3 +430,3 @@ }); | ||
```js | ||
steem.lookupWitnessAccounts(lowerBoundName, limit, function(err, result) { | ||
steem.api.lookupWitnessAccounts(lowerBoundName, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -437,3 +437,3 @@ }); | ||
```js | ||
steem.getWitnessCount(function(err, result) { | ||
steem.api.getWitnessCount(function(err, result) { | ||
console.log(err, result); | ||
@@ -444,3 +444,3 @@ }); | ||
```js | ||
steem.getActiveWitnesses(function(err, result) { | ||
steem.api.getActiveWitnesses(function(err, result) { | ||
console.log(err, result); | ||
@@ -451,3 +451,3 @@ }); | ||
```js | ||
steem.getMinerQueue(function(err, result) { | ||
steem.api.getMinerQueue(function(err, result) { | ||
console.log(err, result); | ||
@@ -459,3 +459,3 @@ }); | ||
```js | ||
steem.login('ned', '****************', function(err, result) { | ||
steem.api.login('ned', '****************', function(err, result) { | ||
console.log(err, result); | ||
@@ -468,3 +468,3 @@ }); | ||
```js | ||
steem.getFollowers(following, startFollower, followType, limit, function(err, result) { | ||
steem.api.getFollowers(following, startFollower, followType, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -475,3 +475,3 @@ }); | ||
```js | ||
steem.getFollowing(follower, startFollowing, followType, limit, function(err, result) { | ||
steem.api.getFollowing(follower, startFollowing, followType, limit, function(err, result) { | ||
console.log(err, result); | ||
@@ -484,3 +484,3 @@ }); | ||
```js | ||
steem.broadcastTransaction(trx, function(err, result) { | ||
steem.api.broadcastTransaction(trx, function(err, result) { | ||
console.log(err, result); | ||
@@ -491,3 +491,3 @@ }); | ||
```js | ||
steem.broadcastTransactionSynchronous(trx, function(err, result) { | ||
steem.api.broadcastTransactionSynchronous(trx, function(err, result) { | ||
console.log(err, result); | ||
@@ -498,3 +498,3 @@ }); | ||
```js | ||
steem.broadcastBlock(b, function(err, result) { | ||
steem.api.broadcastBlock(b, function(err, result) { | ||
console.log(err, result); | ||
@@ -505,3 +505,3 @@ }); | ||
```js | ||
steem.broadcastTransactionWithCallback(confirmationCallback, trx, function(err, result) { | ||
steem.api.broadcastTransactionWithCallback(confirmationCallback, trx, function(err, result) { | ||
console.log(err, result); | ||
@@ -514,3 +514,3 @@ }); | ||
```js | ||
steem.streamBlockNumber(function(err, result) { | ||
steem.api.streamBlockNumber(function(err, result) { | ||
console.log(err, result); | ||
@@ -521,3 +521,3 @@ }); | ||
```js | ||
steem.streamBlock(function(err, result) { | ||
steem.api.streamBlock(function(err, result) { | ||
console.log(err, result); | ||
@@ -528,3 +528,3 @@ }); | ||
```js | ||
steem.streamTransactions(function(err, result) { | ||
steem.api.streamTransactions(function(err, result) { | ||
console.log(err, result); | ||
@@ -535,5 +535,17 @@ }); | ||
```js | ||
steem.streamOperations(function(err, result) { | ||
steem.api.streamOperations(function(err, result) { | ||
console.log(err, result); | ||
}); | ||
``` | ||
## Formatter | ||
### Reputation | ||
```js | ||
var reputation = steem.formatter.reputation(user.reputation); | ||
console.log(reputation); | ||
``` | ||
### Vest To Steem | ||
```js | ||
var power = steem.formatter.vestToSteem(user.vesting_shares, props.total_vesting_shares, props.total_vesting_fund_steem) | ||
console.log(power); | ||
``` |
@@ -1,1 +0,4 @@ | ||
module.exports = require('./lib/steem'); | ||
module.exports = { | ||
api: require('./lib/api'), | ||
formatter: require('./lib/formatter'), | ||
}; |
{ | ||
"name": "steem", | ||
"version": "0.2.21", | ||
"version": "0.3.0", | ||
"description": "Steem.js the JavaScript API for Steem blockchain", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"test": "node test.js", | ||
"build": "browserify lib/browser.js -o | uglifyjs > lib/steem.min.js && browserify lib/browser.js -o | uglifyjs > examples/steem.min.js" | ||
"build": "browserify browser.js -o | uglifyjs > lib/steem.min.js && browserify browser.js -o | uglifyjs > examples/steem.min.js" | ||
}, | ||
@@ -11,0 +11,0 @@ "repository": { |
@@ -38,6 +38,5 @@ # Steem.js | ||
```js | ||
var Steem = require('steem'); | ||
var steem = new Steem(); | ||
var steem = require('steem'); | ||
steem.getAccounts(['ned', 'dan'], function(err, result) { | ||
steem.api.getAccounts(['ned', 'dan'], function(err, result) { | ||
console.log(err, result); | ||
@@ -49,3 +48,3 @@ }); | ||
```js | ||
steem.getState('/trends/funny', function(err, result) { | ||
steem.api.getState('/trends/funny', function(err, result) { | ||
console.log(err, result); | ||
@@ -57,3 +56,3 @@ }); | ||
```js | ||
steem.getConfig(function(err, result) { | ||
steem.api.getConfig(function(err, result) { | ||
console.log(err, result); | ||
@@ -63,2 +62,8 @@ }); | ||
### Reputation Formatter | ||
```js | ||
var reputation = steem.formatter.reputation(user.reputation); | ||
console.log(reputation); | ||
``` | ||
## Contributions | ||
@@ -65,0 +70,0 @@ Patches are welcome! Contributors are listed in the package.json file. Please run the tests before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list or on Slack https://steem.slack.com/ channel #steemjs. |
20
test.js
@@ -1,22 +0,28 @@ | ||
var steem = require('./lib/steem'), | ||
steem = new Steem(); | ||
var steem = require('./index'); | ||
steem.getAccountCount(function(err, result) { | ||
steem.api.getAccountCount(function(err, result) { | ||
console.log(err, result); | ||
}); | ||
steem.getAccounts(['dan'], function(err, result) { | ||
steem.api.getAccounts(['dan'], function(err, result) { | ||
console.log(err, result); | ||
var reputation = steem.formatter.reputation(result[0].reputation); | ||
console.log(reputation); | ||
}); | ||
steem.getState('trending/steemit', function(err, result) { | ||
steem.api.getState('trending/steemit', function(err, result) { | ||
console.log(err, result); | ||
}); | ||
steem.getFollowing('ned', 0, 'blog', 10, function(err, result) { | ||
steem.api.getFollowing('ned', 0, 'blog', 10, function(err, result) { | ||
console.log(err, result); | ||
}); | ||
steem.getFollowers('dan', 0, 'blog', 10, function(err, result) { | ||
steem.api.getFollowers('dan', 0, 'blog', 10, function(err, result) { | ||
console.log(err, result); | ||
}); | ||
steem.api.streamOperations(function(err, result) { | ||
console.log(err, result); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
72
2
61571
1025
1