1.0.5 • Published 9 years ago

tip-to-comment-client v1.0.5

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

Tip To Comment Client

A client to interface with the openpublish tip to comment service

Initialization

var tipToCommentClient = require('../')({
  commonWallet: commonWallet
});

or

var tipToCommentClient = require('../')({
  commonWallet: commonWallet,
  inBrowser: true
});

Usage

NOTE: the commonWallet address has to have tipped the post to be able to succesfully comment on the post

tipToCommentClient.comment({
  comment: "your comment goes here",
  sha1: "the post you want to comment on"
}, callback (error, comment) {
   /* callback */
}
tipToCommentClient.getComments({
  method: "address",
  query: "the address you would like to to see the comments of"
}, callback (error, comments) {
   /* callback */
}

NOTE: the commonWallet address has to have tipped the post to be able to succesfully see all of the comments on the post

tipToCommentClient.getComments({
  method: "sha1",
  query: "the sha1 you would like to to see the comments of"
}, callback (error, comments) {
   /* callback */
}

returns the number of comments on the supplied sha1, does not require any authentication (therefore services like coinvote can display a comment count without the user having to tip or authenticate)

tipToCommentClient.getNumComments({
  sha1: "the sha1 you are interested about"
}, callback (error, comments) {
   /* callback */
}