diff --git a/examples/add-key-auth.js b/examples/add-key-auth.js index 9aff8d0be6a5ed002d997f775aaf9053d829f0ca..9d5969e7edf3bd80f83e3eb230d50a305a2e350e 100644 --- a/examples/add-key-auth.js +++ b/examples/add-key-auth.js @@ -1,12 +1,12 @@ -const steem = require('../lib'); +const hive = require('../lib'); /* Generate private active WIF */ -const username = process.env.STEEM_USERNAME; -const password = process.env.STEEM_PASSWORD; -const privActiveWif = steem.auth.toWif(username, password, 'active'); +const username = process.env.HIVE_USERNAME; +const password = process.env.HIVE_PASSWORD; +const privActiveWif = hive.auth.toWif(username, password, 'active'); /** Add posting key auth */ -steem.broadcast.addKeyAuth({ +hive.broadcast.addKeyAuth({ signingKey: privActiveWif, username, authorizedKey: 'STM88CPfhCmeEzCnvC1Cjc3DNd1DTjkMcmihih8SSxmm4LBqRq5Y9', diff --git a/examples/broadcast.html b/examples/broadcast.html index 170b652e36bc11d91c95b532c60520dd37052ae9..3e63ecf6397e18b367e2fb28641219208c01c967 100644 --- a/examples/broadcast.html +++ b/examples/broadcast.html @@ -2,22 +2,22 @@ <html lang="en"> <head> <meta charset="UTF-8"> - <title>Steem.js Broadcast</title> + <title>Hive.js Broadcast</title> </head> <body> -<script src="../dist/steem.min.js"></script> +<script src="../dist/hive.min.js"></script> <script> /** Configure your account */ var username = 'guest123'; var postingWif = '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg'; /** Broadcast a vote */ - steem.broadcast.vote( + hive.broadcast.vote( postingWif, username, // Voter - 'firepower', // Author - 'steemit-veni-vidi-vici-steemfest-2016-together-we-made-it-happen-thank-you-steemians', // Permlink + 'hiveio', // Author + 'announcing-the-launch-of-hive-blockchain', // Permlink 10000, // Weight (10000 = 100%) function(err, result) { console.log(err, result); @@ -27,7 +27,7 @@ /** Broadcast a comment */ var permlink = new Date().toISOString().replace(/[^a-zA-Z0-9]+/g, '').toLowerCase(); - steem.broadcast.comment( + hive.broadcast.comment( postingWif, 'siol', // Parent Author 'test', // Parent Permlink @@ -35,7 +35,7 @@ permlink, // Permlink '', // Title 'This is a test!', // Body - { tags: ['test'], app: 'steemjs/examples' }, // Json Metadata + { tags: ['test'], app: 'hivejs/examples' }, // Json Metadata function(err, result) { console.log(err, result); } @@ -44,7 +44,7 @@ /** Broadcast a post */ var permlink = new Date().toISOString().replace(/[^a-zA-Z0-9]+/g, '').toLowerCase(); - steem.broadcast.comment( + hive.broadcast.comment( postingWif, '', // Leave parent author empty 'photography', // Main tag @@ -52,7 +52,7 @@ permlink + '-post', // Permlink 'This is just a test!', // Title 'Nothing to see here', // Body - { tags: ['test'], app: 'steemjs/examples' }, // Json Metadata + { tags: ['test'], app: 'hivejs/examples' }, // Json Metadata function(err, result) { console.log(err, result); } @@ -60,7 +60,7 @@ /** Follow an user */ var follower = username; // Your username - var following = 'steemjs'; // User to follow + var following = 'hiveio'; // User to follow var json = JSON.stringify( ['follow', { @@ -70,7 +70,7 @@ }] ); - steem.broadcast.customJson( + hive.broadcast.customJson( postingWif, [], // Required_auths [follower], // Required Posting Auths @@ -90,7 +90,7 @@ }] ); - steem.broadcast.customJson( + hive.broadcast.customJson( postingWif, [], // Required_auths [follower], // Required Posting Auths @@ -103,4 +103,4 @@ </script> </body> -</html> \ No newline at end of file +</html> diff --git a/examples/get-post-content.js b/examples/get-post-content.js index 7e7ee395e08ef04614427ca99578c2e6f615b107..dfe3a2a325c78b428d2aa57a7e16edfdc3ed85e7 100644 --- a/examples/get-post-content.js +++ b/examples/get-post-content.js @@ -1,4 +1,4 @@ -const steem = require('../lib'); +const hive = require('../lib'); -const resultP = steem.api.getContentAsync('yamadapc', 'test-1-2-3-4-5-6-7-9'); +const resultP = hive.api.getContentAsync('hiveio', 'announcing-the-launch-of-hive-blockchain'); resultP.then(result => console.log(result)); diff --git a/examples/index.html b/examples/index.html index 2da043ffd24be778b493610ad0b06c7f6553f588..dd5b851b136edf7678fdd0711340099f67ea37e8 100644 --- a/examples/index.html +++ b/examples/index.html @@ -2,19 +2,19 @@ <html lang="en"> <head> <meta charset="UTF-8"> - <title>Steem.js</title> + <title>Hive.js</title> </head> <body> -<script src="../dist/steem.min.js"></script> +<script src="../dist/hive.min.js"></script> <script> -steem.api.getConfig(function(err, response){ +hive.api.getConfig(function(err, response){ console.log(err, response); }); -steem.api.getAccounts(['ned', 'dan'], function(err, response){ +hive.api.getAccounts(['hiveio', 'mahdiyari'], function(err, response){ console.log(err, response); }); -steem.api.getAccountCount(function(err, response){ +hive.api.getAccountCount(function(err, response){ console.log(err, response); }); </script> diff --git a/examples/multisig.js b/examples/multisig.js index a5dfbdb31cd5be88de2f03587ae1c8209dde20d1..4c5020e39804cb48d00899f4c9ea6642461824ce 100644 --- a/examples/multisig.js +++ b/examples/multisig.js @@ -1,9 +1,9 @@ -const steem = require('../lib'); +const hive = require('../lib'); const privWif1 = '5K2LA2ucS8b1GuFvVgZK6itKNE6fFMbDMX4GDtNHiczJESLGRd8'; const privWif2 = '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg'; -steem.broadcast.send({ +hive.broadcast.send({ extensions: [], operations: [ ['vote', { diff --git a/examples/server.js b/examples/server.js index 71e35c5bd07b033a2758819eb8983f9a4fb8217f..334c23a9cd3f9002343163dab08db25c94d97711 100644 --- a/examples/server.js +++ b/examples/server.js @@ -1,32 +1,32 @@ -var steem = require('../lib'); +var hive = require('../lib'); -steem.api.getAccountCount(function(err, result) { +hive.api.getAccountCount(function(err, result) { console.log(err, result); }); -steem.api.getAccounts(['dan'], function(err, result) { +hive.api.getAccounts(['hiveio'], function(err, result) { console.log(err, result); - var reputation = steem.formatter.reputation(result[0].reputation); + var reputation = hive.formatter.reputation(result[0].reputation); console.log(reputation); }); -steem.api.getState('trending/steemit', function(err, result) { +hive.api.getState('trending/hive', function(err, result) { console.log(err, result); }); -steem.api.getFollowing('ned', 0, 'blog', 10, function(err, result) { +hive.api.getFollowing('hiveio', 0, 'blog', 10, function(err, result) { console.log(err, result); }); -steem.api.getFollowers('dan', 0, 'blog', 10, function(err, result) { +hive.api.getFollowers('hiveio', 0, 'blog', 10, function(err, result) { console.log(err, result); }); -steem.api.streamOperations(function(err, result) { +hive.api.streamOperations(function(err, result) { console.log(err, result); }); -steem.api.getDiscussionsByActive({ +hive.api.getDiscussionsByActive({ limit: 10, start_author: 'thecastle', start_permlink: 'this-week-in-level-design-1-22-2017' diff --git a/examples/stream.html b/examples/stream.html index ba6fae92c6389fe317e1ecbfff9763ff12dc5876..5af5eeae6d1fe840d81eafb5d95f1c19cb2ecd93 100644 --- a/examples/stream.html +++ b/examples/stream.html @@ -2,13 +2,13 @@ <html lang="en"> <head> <meta charset="UTF-8"> - <title>Steem.js Stream</title> + <title>Hive.js Stream</title> </head> <body> -<script src="../dist/steem.min.js"></script> +<script src="../dist/hive.min.js"></script> <script> -steem.api.streamOperations(function (err, operations) { +hive.api.streamOperations(function (err, operations) { operations.forEach(function (operation) { console.log(operation); }); diff --git a/examples/test-vote.js b/examples/test-vote.js index 6a705679b47bb3c53a47c3bf03e76f9c84c842ca..c7151f397705b8caf012bc02cbf63cd0ce9fc631 100644 --- a/examples/test-vote.js +++ b/examples/test-vote.js @@ -1,9 +1,9 @@ -const steem = require('../lib'); +const hive = require('../lib'); const username = 'guest123'; const wif = '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg'; -steem +hive .broadcast .vote( wif, diff --git a/examples/webpack-example/README.md b/examples/webpack-example/README.md index b2a6ba494fde256c1e6f9ab4eaec860804a7358f..7052ad3e146094a3788fe09787aa4fb1cf261ffd 100644 --- a/examples/webpack-example/README.md +++ b/examples/webpack-example/README.md @@ -1,5 +1,5 @@ -# `steem-js` webpack configuration example -This is a demo of `steem-js` and webpack usage targetting both the Web and +# `hive-js` webpack configuration example +This is a demo of `hive-js` and webpack usage targetting both the Web and Node.js platforms. ## Compiling the example diff --git a/examples/webpack-example/package.json b/examples/webpack-example/package.json index 12ccc885eddfbab7b2588d9fe3135e748d928f02..7f1a2fe48990c2445eff0bdef3d1256ca4e7f08c 100644 --- a/examples/webpack-example/package.json +++ b/examples/webpack-example/package.json @@ -1,5 +1,5 @@ { - "name": "steem-js-webpack-example", + "name": "hive-js-webpack-example", "scripts": { "build": "npm run build-web && npm run build-node", "build-web": "webpack", @@ -10,6 +10,6 @@ "webpack": "^3.0.0" }, "dependencies": { - "steem": "^0.5.20" + "hive": "^0.0.5" } } diff --git a/examples/webpack-example/src/index.js b/examples/webpack-example/src/index.js index 0c4ed6adbb4ec4ff5820e8bc798df8a136cbb971..cfd0a25fa0ba70bbeac7047e0c0f51dd524082a9 100644 --- a/examples/webpack-example/src/index.js +++ b/examples/webpack-example/src/index.js @@ -1,5 +1,5 @@ -const steem = require('steem/lib/browser'); +const hive = require('hive/lib/browser'); console.log('Getting post content...'); -const resultP = steem.api.getContentAsync('yamadapc', 'test-1-2-3-4-5-6-7-9'); +const resultP = hive.api.getContentAsync('yamadapc', 'test-1-2-3-4-5-6-7-9'); resultP.then(result => console.log(result));