Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

RexMorgan/bitmessage-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archived

This project is now archived. Please feel free to fork it if needed.

bitmessage-node

NPM

Bitmessage client for the API written in Node.js.

Install

npm install bitmessage-node

Usage

//establish connection to Bitmessage server
var bm = require('bitmessage-node')(host, port, username, password);

//get inbox list
bm.messages.inbox.list(cb); //returns list of messages

//get message by id
bm.messages.inbox.single(id, cb, read);

//send message
bm.messages.send(toAddress, fromAddress, subject, message, cb);

//get sent messages
bm.messages.sent.list(cb);

//get sent message by id
bm.messages.sent.single(id, cb);

//get sent message by ack
bm.messages.sent.singleByAck(ack, cb);

//move message to trash by id
bm.messages.inbox.moveToTrash(id, cb);

//move message to trash by ack
bm.messages.sent.moveToTrashByAck(ack, cb);

//list identities
bm.addresses.list(cb); //returns identities

//create random address
bm.addresses.createRandom(label, cb); //returns address id

//create deterministic address
bm.addresses.createDeterministic(passphrase, cb); //returns address id

//list subscriptions
bm.subscriptions.list(cb); //returns subscriptions

//subscribe
bm.subscriptions.subscribe(address, label, cb); //returns string with status

//unsubscribe
bm.subscriptions.unsubscribe(address, cb); //returns string with status

//list contacts
bm.addressbook.list(cb); //returns contacts

//add contact
bm.addressbook.addEntry(address, label, cb);

//delete contact
bm.addressbook.deleteEntry(address, cb);

Requirements

A Bitmessage server running on a local machine. Download from Bitmessage.org

If you plan on connecting to a remote Bitmessage server, you should absolutely use SSH tunneling to establish a secure connection and connect via a local port.

ssh -N -L 8442:localhost:8442 <remote-bitmessage-server-hostname>

More info

The MIT License (MIT)