steemit / steem-js

Steem.js the official JavaScript library for Steem blockchain
https://www.npmjs.com/package/steem
MIT License
472 stars 225 forks source link

Enable "broadcast"-type operations from a browser #28

Closed MWaser closed 7 years ago

MWaser commented 8 years ago

Hi! I've been using the various broadcast operations (comment, vote, etc.) from Node.JS and they've worked perfectly.

I would, however, also like to use them from the browser. Is there any way in which to make that possible with Webpack or Browserify? It looks like you are using Browserify in your build but there is no sign of the broadcast-type transactions in the CDN javascript file.

I'm willing to help with this if someone could point me in the right starting direction. My name is mark.waser on steemit.chat.

Thanks!

bonustrack commented 8 years ago

Hi! On browser side we don't include steem.auth and steem.broadcast. We probably will include them after setup webpack, now we are using browserify and IMO it will make a too much heavy file. Meanwhile on browser side we have steem.connect. You can easy broadcast vote and comment if you are logged on steemconnect.com.

MWaser commented 8 years ago

Thanks for the reply! As I said above, I'm having no problems using the various broadcast operations (comment, vote, etc.) from Node.JS -- I was just looking for an alternative for people who don't want to give random websites (including mine) their Steem wifs . . . . (speaking of which . . . . out of curiosity . . . . has steemconnect actually gotten many people to give it their password or owner wif?)

Any idea when you might be setting up webpack? If it is far enough out, do you want me to try to do it? I haven't used it before but it seems a skill worth learning . . . .

On steemconnect, maybe I'm an idiot, but I didn't see the vote and comment options. Are they only available after you fill out your profile? No offense meant -- but there is no way in which I'm going to give any site my Steemit keys . . . .

Note: if you don't want to clutter up this issues thread, my e-mail is mark.waser@gmail.com . . . .

BTW, AWESOME work you've been doing here. THANK YOU!

bonustrack commented 8 years ago

I have a team with Webpack experts, the setup is planed but i can't give you a date as it's not our priority for the moment.

About steemconnect, you can use it with your posting wif. The wif is never stored by the server but on your cookie. There is an API to send vote/comment requests, you can use it with Steem.js directly example : steem.connect.vote('author', 'here-the-permlink', callback).

I'm available on Steem Rocket Chat if you want more informations my username is @fabien.

fabien commented 8 years ago

@adcpm "my username is @fabien" - I'm sorry, but I'm afraid my username is @fabien ;-) - I guess yours is @adcpm

bonustrack commented 8 years ago

Ahaha. Man... what you been doing? The @fabien username deserve a proper avatar.

MWaser commented 8 years ago

@adcpm doesn't exist on steemit.chat . . . .

I assume that the wif is used by the server even if the server never stores it . . . . thus, we only have your word that it is never stored (again, no offense intended).

fabien commented 8 years ago

Things are getting mixed up here - I received a notification because @fabien was mentioned here - obviously, it's not the Github username you meant. Sorry ...

bonustrack commented 8 years ago

@MWaser the new update of Steem.js 0.3.25 include now steem.auth and steem.broadcast with webpack compiling.

D161T4L-W15D0M commented 8 years ago

Awesome. I'll have to go investigate. How large is it? Did anyone go through and strip out unused code paths in the crypto section?

THANKS!

bonustrack commented 8 years ago

The size is 279 KB. The steem.auth lib code has been made using Steemit code in base, but we scoped the code to use only what are needed, basicly: generate signature and verify account. See here: https://github.com/adcpm/steemauth/blob/master/lib/steemauth.js