bitmessage-node
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -52,6 +52,13 @@ "use strict"; | ||
createRandom: function (label, cb) { | ||
callMethod({ method: 'createRandomAddress', args: [toBase64(label)], json: false }, cb); | ||
callMethod({ | ||
method: 'createRandomAddress', | ||
args: [toBase64(label)], | ||
json: false | ||
}, cb); | ||
}, | ||
createDeterministic: function (passphrase, cb) { | ||
callMethod({ method: 'createDeterministicAddresses', args: [toBase64(passphrase), 1, 0, 0, false, 1, 1] }, function (value) { | ||
callMethod({ | ||
method: 'createDeterministicAddresses', | ||
args: [toBase64(passphrase), 1, 0, 0, false, 1, 1] | ||
}, function (value) { | ||
if (value.addresses.length > 0) { | ||
@@ -64,3 +71,7 @@ return cb(value.addresses[0]); | ||
getDeterministic: function (passphrase, cb) { | ||
callMethod({ method: 'getDeterministicAddress', args: [toBase64(passphrase), 3, 1], json: false }, cb); | ||
callMethod({ | ||
method: 'getDeterministicAddress', | ||
args: [toBase64(passphrase), 3, 1], | ||
json: false | ||
}, cb); | ||
}, | ||
@@ -191,14 +202,57 @@ }, | ||
subscribe: function (address, label, cb) { | ||
callMethod({ method: 'addSubscription', args: [address, toBase64(label)], json: false }, cb); | ||
callMethod({ | ||
method: 'addSubscription', | ||
args: [address, toBase64(label)], | ||
json: false | ||
}, cb); | ||
}, | ||
unsubscribe: function (address, cb) { | ||
callMethod({ method: 'deleteSubscription', args: [address], json: false }, cb); | ||
callMethod({ | ||
method: 'deleteSubscription', | ||
args: [address], | ||
json: false | ||
}, cb); | ||
} | ||
}, | ||
addressbook: { | ||
list: function (cb) { | ||
callMethod({ method: 'listAddressBookEntries' }, function (value) { | ||
var addresses = value.addresses; | ||
for (var i = 0; i < addresses.length; ++i) { | ||
addresses[i].label = fromBase64(addresses[i].label); | ||
} | ||
cb(addresses); | ||
}); | ||
}, | ||
addEntry: function (address, label, cb) { | ||
callMethod({ | ||
method: 'addAddressBookEntry', | ||
args: [address, toBase64(label)], | ||
json: false | ||
}, cb); | ||
}, | ||
deleteEntry: function (address, cb) { | ||
callMethod({ | ||
method: 'deleteAddressBookEntry', | ||
args: [address], | ||
json: false | ||
}, cb); | ||
} | ||
}, | ||
test: { | ||
add: function (a, b, cb) { | ||
callMethod({ method: 'add', args: [a, b], json: false }, cb); | ||
callMethod({ | ||
method: 'add', | ||
args: [a, b], | ||
json: false | ||
}, cb); | ||
}, | ||
hello: function (word, word2, cb) { | ||
callMethod({ method: 'helloWorld', args: [word, word2], json: false }, cb); | ||
callMethod({ | ||
method: 'helloWorld', | ||
args: [word, word2], | ||
json: false | ||
}, cb); | ||
}, | ||
@@ -205,0 +259,0 @@ }, |
{ | ||
"name": "bitmessage-node", | ||
"description": "Node wrapper for bitmessage client api", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "xmlrpc": "1.1.0", |
10660
251