Comparing version 0.5.18 to 0.5.19-beta.1
@@ -37,3 +37,3 @@ 'use strict'; | ||
var _util = require('../util'); | ||
var _utils = require('../utils'); | ||
@@ -147,3 +147,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
if (!request) { | ||
console.error('Steem.onMessage error: unknown request ', id); | ||
debugWs('Steem.onMessage error: unknown request ', id); | ||
return; | ||
@@ -233,3 +233,3 @@ } | ||
console.log('-- Steem.onMessage -->', message.id); | ||
debugWs('-- Steem.onMessage -->', message.id); | ||
var errorCause = message.error; | ||
@@ -445,3 +445,3 @@ if (errorCause) { | ||
_methods2.default.forEach(function (method) { | ||
var methodName = method.method_name || (0, _util.camelCase)(method.method); | ||
var methodName = method.method_name || (0, _utils.camelCase)(method.method); | ||
var methodParams = method.params || []; | ||
@@ -448,0 +448,0 @@ |
@@ -37,3 +37,3 @@ 'use strict'; | ||
var _util = require('../util'); | ||
var _utils = require('../utils'); | ||
@@ -92,3 +92,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
_operations2.default.forEach(function (operation) { | ||
var operationName = (0, _util.camelCase)(operation.operation); | ||
var operationName = (0, _utils.camelCase)(operation.operation); | ||
var operationParams = operation.params || []; | ||
@@ -95,0 +95,0 @@ |
@@ -8,2 +8,3 @@ "use strict"; | ||
var formatter = require("./formatter")(api); | ||
var utils = require("./utils"); | ||
@@ -15,3 +16,4 @@ var steem = { | ||
config: config, | ||
formatter: formatter | ||
formatter: formatter, | ||
utils: utils | ||
}; | ||
@@ -18,0 +20,0 @@ |
{ | ||
"name": "steem", | ||
"version": "0.5.18", | ||
"version": "0.5.19-beta.1", | ||
"description": "Steem.js the JavaScript API for Steem blockchain", | ||
"main": "index.js", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "test": "eslint --quiet src test; mocha -t 20000 --require babel-polyfill --require babel-register", |
import Promise from 'bluebird'; | ||
import should from 'should'; | ||
import steemAuth from '../src/auth'; | ||
import steemBroadcast from '../src/broadcast'; | ||
import packageJson from '../package.json'; | ||
import steem from '../src'; | ||
@@ -10,3 +8,3 @@ const username = process.env.STEEM_USERNAME || 'guest123'; | ||
const postingWif = password | ||
? steemAuth.toWif(username, password, 'posting') | ||
? steem.auth.toWif(username, password, 'posting') | ||
: '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg'; | ||
@@ -16,20 +14,20 @@ | ||
it('exists', () => { | ||
should.exist(steemBroadcast); | ||
should.exist(steem.broadcast); | ||
}); | ||
it('has generated methods', () => { | ||
should.exist(steemBroadcast.vote); | ||
should.exist(steemBroadcast.voteWith); | ||
should.exist(steemBroadcast.comment); | ||
should.exist(steemBroadcast.transfer); | ||
should.exist(steem.broadcast.vote); | ||
should.exist(steem.broadcast.voteWith); | ||
should.exist(steem.broadcast.comment); | ||
should.exist(steem.broadcast.transfer); | ||
}); | ||
it('has backing methods', () => { | ||
should.exist(steemBroadcast.send); | ||
should.exist(steem.broadcast.send); | ||
}); | ||
it('has promise methods', () => { | ||
should.exist(steemBroadcast.sendAsync); | ||
should.exist(steemBroadcast.voteAsync); | ||
should.exist(steemBroadcast.transferAsync); | ||
should.exist(steem.broadcast.sendAsync); | ||
should.exist(steem.broadcast.voteAsync); | ||
should.exist(steem.broadcast.transferAsync); | ||
}); | ||
@@ -39,3 +37,3 @@ | ||
it('works', async () => { | ||
const tx = await steemBroadcast._prepareTransaction({ | ||
const tx = await steem.broadcast._prepareTransaction({ | ||
extensions: [], | ||
@@ -61,3 +59,3 @@ operations: [['vote', { | ||
it('works', async () => { | ||
const tx = await steemBroadcast.voteAsync( | ||
const tx = await steem.broadcast.voteAsync( | ||
postingWif, | ||
@@ -87,3 +85,3 @@ username, | ||
it('works', async () => { | ||
const tx = await steemBroadcast.voteAsync( | ||
const tx = await steem.broadcast.voteAsync( | ||
postingWif, | ||
@@ -107,3 +105,3 @@ username, | ||
it('works with callbacks', (done) => { | ||
steemBroadcast.vote( | ||
steem.broadcast.vote( | ||
postingWif, | ||
@@ -113,3 +111,3 @@ username, | ||
'test-1-2-3-4-5-6-7-9', | ||
10000, | ||
5000, | ||
(err, tx) => { | ||
@@ -137,3 +135,3 @@ if (err) return done(err); | ||
it('works', async () => { | ||
const tx = await steemBroadcast.customJsonAsync( | ||
const tx = await steem.broadcast.customJsonAsync( | ||
postingWif, | ||
@@ -140,0 +138,0 @@ [], |
import Promise from 'bluebird'; | ||
import should from 'should'; | ||
import steemAuth from '../src/auth'; | ||
import steemBroadcast from '../src/broadcast'; | ||
import steem from '../src'; | ||
import pkg from '../package.json'; | ||
@@ -10,3 +9,3 @@ | ||
const postingWif = password | ||
? steemAuth.toWif(username, password, 'posting') | ||
? steem.auth.toWif(username, password, 'posting') | ||
: '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg'; | ||
@@ -22,3 +21,3 @@ | ||
it('works', async () => { | ||
const permlink = new Date().toISOString().replace(/[^a-zA-Z0-9]+/g, '').toLowerCase(); | ||
const permlink = steem.formatter.commentPermlink('siol', 'test'); | ||
const operations = [ | ||
@@ -57,3 +56,3 @@ ['comment', | ||
const tx = await steemBroadcast.sendAsync( | ||
const tx = await steem.broadcast.sendAsync( | ||
{ operations, extensions: [] }, | ||
@@ -60,0 +59,0 @@ { posting: postingWif } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12940596
9634