tip-to-comment-client

1.0.5 • Public • Published

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 */
}

Package Sidebar

Install

npm i tip-to-comment-client

Weekly Downloads

2

Version

1.0.5

License

ISC

Last publish

Collaborators

  • williamcotton
  • andrewmalta