Bitcoin Forum

Bitcoin => Wallet software => Topic started by: hivewallet on October 18, 2013, 10:56:50 AM



Title: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on October 18, 2013, 10:56:50 AM
Hive (https://bitcointalk.org/index.php?topic=304060.0;all) is pleased to announce our v1 app API (https://github.com/hivewallet/hive-osx/wiki/API), now available to developers!

Hive apps are made with HTML, CSS and JavaScript. They're basically just websites with JavaScript code, running in an embedded browser inside the Hive window. You can use most features you'd expect from a standard modern web browser.

Full instructions for how to create a Hive application can be found on our wiki here:
https://github.com/hivewallet/hive-osx/wiki/How-to-build-a-Hive-app

API-specific documentation can be found here:
https://github.com/hivewallet/hive-osx/wiki/API

https://i.imgur.com/RhlBKvK.png https://i.imgur.com/6Ac0r4i.png

Frequently asked questions

Q: Once I've built my app, how do I get it included in Hive?
A: A formal submission process will be created over the next few weeks. For the moment, please notify us here and/or via email at w@hivewallet.com and we will review it and hopefully include the app with our test releases.

Q: Do I need to include all of my site or service's functionality in the app?
A: It isn't necessary. Remember, many Hive users will not have used Bitcoin before. Especially for the first version of your app, we suggest that you only include functionality that will give users a taste of your services.

Q: Can I just use an iframe to embed my webpage?
A: There are of course exceptions, but on the whole we would greatly prefer it if you did not. :)


Title: Re: How to build a Hive app (and introducing the Hive app API)
Post by: hivewallet on October 18, 2013, 10:57:27 AM
reserved


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: Zaih on October 18, 2013, 02:11:02 PM
Great! Best of luck! This will be an amazing contribution to Bitcoin


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: evoorhees on October 18, 2013, 02:19:12 PM
Great job mate!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on October 18, 2013, 03:25:34 PM
Great! Best of luck! This will be an amazing contribution to Bitcoin

Thank you very much, we sure hope so!

Great job mate!

Thank you! And thanks for being such an inspiration!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: bitcoinstarter on October 18, 2013, 05:03:57 PM
Looking forward to getting BitcoinStarter Bitcoin crowdfunding app on Hive   ;)

Just amazing work guys!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: CurbsideProphet on October 18, 2013, 05:33:25 PM
Looks great so far, keep up the good work!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: BitOrca on October 18, 2013, 06:34:38 PM
Not only will Hive bridge that gap between the masses and Bitcoin, these integrations will help propel Bitcoin services.  +1 to you guys  :)


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: Skinnkavaj on October 18, 2013, 08:35:21 PM
You are awesome


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: icedicedavid on October 18, 2013, 09:09:54 PM
so the index.html has to be compiled into the hive.app? Can it be loaded from an url?


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: gweedo on October 18, 2013, 10:06:34 PM
so the index.html has to be compiled into the hive.app? Can it be loaded from an url?

yes they have to be compiled and made into a .hiveapp and put in this folder https://github.com/grabhive/hive-osx/tree/master/Hive/Applications then compiled. That is the only way I see currently.


Also if you want someone that has a current git master branch of hive working to test your applications, I be willing to do that for $10 in BTC for each test per application. I even have the debug enabled.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: yellowdog on October 21, 2013, 07:54:05 AM
I am working hard and hope i'll have an app for http://satoshirat.com (http://satoshirat.com) soon.

Great job, i think this kind of wallet approach will stimulate btc economy more.



Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on October 21, 2013, 03:54:28 PM
so the index.html has to be compiled into the hive.app? Can it be loaded from an url?
Yes, the base HTML file must be available offline inside the app bundle. When it opens you can use JS to load additional scripts and resources, some of which might be loaded from a remote server (though it's recommended that as much as possible is kept inside the bundle for faster loading).

Quote
yes they have to be compiled and made into a .hiveapp and put in this folder https://github.com/grabhive/hive-osx/tree/master/Hive/Applications then compiled. That is the only way I see currently.
Actually, the .hiveapp bundles don't have to be added to that Applications folder - those four that are there now will be preinstalled for all users, but the idea is that you can add any apps to Hive that you've downloaded from anywhere - author's website, GitHub, email attachment, whatever. You just open the .hiveapp in Finder and Hive will ask you if you want to "install" the app.

Quote
Also if you want someone that has a current git master branch of hive working to test your applications, I be willing to do that for $10 in BTC for each test per application. I even have the debug enabled.
We're planning to release a new build with the new API soon (tomorrow/Wendesday), we just need to make sure the four bundled apps are all working correctly.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on October 21, 2013, 04:03:46 PM
I am working hard and hope i'll have an app for http://satoshirat.com soon.
Nice! Let us know when you finish it, or if you have any problems with the API.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on October 27, 2013, 12:46:18 PM
https://i.imgur.com/z5lUh2L.png

Introducing the LocalBitcoins (http://localbitcoins.com/) app for Hive.

Please note: as with Hive itself, this should be handled with great care and at the moment we do not recommend it for any kind of day-to-day use.

The latest releases will be made available here:
https://github.com/hivewallet/hiveapp-localbitcoins/releases

Issues can be tracked here:
https://github.com/hivewallet/hiveapp-localbitcoins/issues


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on October 28, 2013, 09:25:20 PM
I'm missing some step zero on how to use your bitcoin global object.

I'm running Hive Version 0.9 (2013102201), and there is no such global object named "bitcoin" that is accessible through the app. Does this build include it or what else am I supposed to do ? The relevant javascript might be as simple as console.log(bitcoin), and Web Inspector will give me a reference error.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on October 28, 2013, 10:14:24 PM
I'm missing some step zero on how to use your bitcoin global object.

I'm running Hive Version 0.9 (2013102201), and there is no such global object named "bitcoin" that is accessible through the app. Does this build include it or what else am I supposed to do ? The relevant javascript might be as simple as console.log(bitcoin), and Web Inspector will give me a reference error.
Hmm, this doesn't make sense... This build definitely should include the window.bitcoin object in the JS context of an app. Open any of the built-in apps, e.g. supporthive, do a right-click and "Inspect" and check the console, you should see the bitcoin object there:

https://i.imgur.com/V9aTzoQ.png


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on October 28, 2013, 10:41:13 PM
I'm missing some step zero on how to use your bitcoin global object.

I'm running Hive Version 0.9 (2013102201), and there is no such global object named "bitcoin" that is accessible through the app. Does this build include it or what else am I supposed to do ? The relevant javascript might be as simple as console.log(bitcoin), and Web Inspector will give me a reference error.
Hmm, this doesn't make sense... This build definitely should include the window.bitcoin object in the JS context of an app. Open any of the built-in apps, e.g. supporthive, do a right-click and "Inspect" and check the console, you should see the bitcoin object there:

Ok, at least now I know for sure the object should be there so I rechecked the issue.

There seems to be some problem regarding overwriting a running application, which causes the bitcoin object to disappear. I can reproduce this every time by doing the following:

1) Create your app X and run it inside Hive;
2) While it is running, overwrite it (i.e. open myappx.hiveapp and confirm the overwrite);
3) Right click and click on Reload;
4) Right click and click on Inspect;
5) The bitcoin object is gone

How to fix the missing bitcoin object: restart the app.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: icedicedavid on October 29, 2013, 12:09:37 AM
does hive save cookies?

Would it work if I just make a blank index.html redirect to ice-dice.com on load?


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on October 29, 2013, 01:11:21 PM
does hive save cookies?
I actually had to check - looks like the cookies are saved, but only for the duration of one session with Hive, when you quite Hive and restart it, they're lost. There's also localStorage, but it's also lost when you quit Hive, and it also seems to be shared between the apps. We'll have to tweak the WebKit settings - I've added a ticket here: https://github.com/grabhive/hive-osx/issues/101

Would it work if I just make a blank index.html redirect to ice-dice.com on load?
There's nothing in Hive that would stop you from setting a meta redirect there, but we'd prefer you didn't, because it's not designed to work this way. It will be a worse user experience because things will load slower, and the layout might not be adapted that well to the Hive window. You'd also have to be careful when you use the window.bitcoin object on your website so that you don't break it in other browsers.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: yellowdog on October 29, 2013, 04:03:08 PM
Does your embedded browser has "Same Origin Policy"?

I made my site to give json info to feed the app but i am afraid it will not work and have to implement jsonp.

I'll test myself tomorrow, but now i have some problems with my mac ox image and will download a new OSX 10.8.2.


Keep up the good work!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: yellowdog on October 30, 2013, 01:46:21 PM
Does your embedded browser has "Same Origin Policy"?

I made my site to give json info to feed the app but i am afraid it will not work and have to implement jsonp.

I'll test myself tomorrow, but now i have some problems with my mac ox image and will download a new OSX 10.8.2.


Keep up the good work!

It works. No need for jsonp.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on October 30, 2013, 09:05:15 PM
It works. No need for jsonp.

Sorry for the late reply and glad you figured it out!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on October 31, 2013, 06:15:05 PM
Note to all app developers:

We have changed our GitHub URL! It is now:
https://github.com/hivewallet

If you happen to spot any places around this forum (or elsewhere) where that needs to be changed, please let us know!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on November 01, 2013, 06:26:13 AM
I'm releasing the version 0.1.0 of a game I'm calling Patten. Right now it is available exclusively for the Hive wallet, just grab the .zip at https://github.com/knowitnothing/patten_hive/releases, rename it to .hiveapp then open it. The source is at https://github.com/knowitnothing/patten_hive.

EDIT: Grab the 0.1.2 release at https://github.com/knowitnothing/patten_hive/releases/tag/v0.1.2

https://github-camo.global.ssl.fastly.net/e374b0839db85fdc5c1b89feeb004f953f456ea4/687474703a2f2f692e706963726573697a652e636f6d2f696d616765732f323031332f31302f33312f7065552e706e67http://i.picresize.com/images/2013/10/31/ONjqS.png


Jackpot of 1 bitcoin, max bet of 5 bitcents, more info can be found through the Help button.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on November 01, 2013, 10:39:48 AM
I'm releasing the version 0.1.0 of a game I'm calling Patten. Right now it is available exclusively for the Hive wallet, just grab the .zip at https://github.com/knowitnothing/patten_hive/releases, rename it to .hiveapp then open it. The source is at https://github.com/knowitnothing/patten_hive.

Sweet, thanks. We'll test this out for a bit and then maybe bundle it if it all looks good?


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: yellowdog on November 01, 2013, 11:39:18 AM
I've released my app for satoshirat, it's in your repo, and i've done today a major update.

check it out.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on November 01, 2013, 12:14:28 PM
I'm releasing the version 0.1.0 of a game I'm calling Patten. Right now it is available exclusively for the Hive wallet, just grab the .zip at https://github.com/knowitnothing/patten_hive/releases, rename it to .hiveapp then open it. The source is at https://github.com/knowitnothing/patten_hive.

Sweet, thanks. We'll test this out for a bit and then maybe bundle it if it all looks good?

Absolutely, it would be excellent if you could report any problems you find. I expect deposits/withdrawals are working correctly, but if you or anyone else has any issues with that I will refund the deposit + some small amount for hitting a bug.

How do you handle app updates ? Does the user need to download the newer version manually, is it re-packaged in the next hive release, or is there some other way ? If there's some other way, I've missed it.

EDIT: added sentence about refund + bonus in case of bugs.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on November 01, 2013, 12:42:07 PM
Absolutely, it would be excellent if you could report any problems you find.

How do you handle app updates ? Does the user need to download the newer version manually, is it re-packaged in the next hive release, or is there some other way ? If there's some other way, I've missed it.

We will soon have an app repo to which you will be able to send us pull requests. We'll pull them, and the users will be able to download the updates automatically. For the time being we will bundle your updates up with our app, which is auto-updated every Monday.

See here:
https://github.com/hivewallet/hive-osx/issues/56

By the way, you did a really nice job with this. It's extremely responsive.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on November 01, 2013, 01:00:35 PM
Absolutely, it would be excellent if you could report any problems you find.

How do you handle app updates ? Does the user need to download the newer version manually, is it re-packaged in the next hive release, or is there some other way ? If there's some other way, I've missed it.

We will soon have an app repo to which you will be able to send us pull requests. We'll pull them, and the users will be able to download the updates automatically. For the time being we will bundle your updates up with our app, which is auto-updated every Monday.

See here:
https://github.com/hivewallet/hive-osx/issues/56

By the way, you did a really nice job with this. It's extremely responsive.

Alright, 1 week for updates looks good enough at least for now.

Thanks about the app, I tried to make it responsive enough (but the table for Recent history needs some work regarding that). Congrats on the Hive app, I will see if I can contribute to its code too. Keep up the good work.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on November 03, 2013, 11:58:18 AM
Alright, 1 week for updates looks good enough at least for now.

Should we try to bundle on Monday?


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on November 03, 2013, 02:36:57 PM
Alright, 1 week for updates looks good enough at least for now.

Should we try to bundle on Monday?

Ok, make sure you grab the latest version present there. I will be releasing an update today.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: argov on November 03, 2013, 02:51:45 PM
Nice work. I think I will test it soon (if I find some time   :( )


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on November 04, 2013, 12:59:40 AM
Alright, 1 week for updates looks good enough at least for now.

Should we try to bundle on Monday?

Please do so with the version 0.2.2 available at https://github.com/knowitnothing/patten_hive/releases, couple of updates today.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: maco on November 04, 2013, 07:05:36 AM
interesting


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on November 07, 2013, 02:33:30 PM
FYI, if you need to detect that the app is opened inside Hive (as opposed to a normal web browser), I've added a custom user agent string - inside Hive, navigator.userAgent will now include "Hive/0.9" (or whatever the version is) at the end. I'd say there should be very few cases where the user agent will have to be checked in code, but it's there if you need it. (This is only available in testing releases now, see GitHub releases page.)

I've also fixed the problem reported by @knowitnothing:

There seems to be some problem regarding overwriting a running application, which causes the bitcoin object to disappear. I can reproduce this every time by doing the following:

1) Create your app X and run it inside Hive;
2) While it is running, overwrite it (i.e. open myappx.hiveapp and confirm the overwrite);
3) Right click and click on Reload;
4) Right click and click on Inspect;
5) The bitcoin object is gone

How to fix the missing bitcoin object: restart the app.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on November 07, 2013, 02:54:34 PM
FYI, if you need to detect that the app is opened inside Hive (as opposed to a normal web browser), I've added a custom user agent string - inside Hive, navigator.userAgent will now include "Hive/0.9" (or whatever the version is) at the end. I'd say there should be very few cases where the user agent will have to be checked in code, but it's there if you need it. (This is only available in testing releases now, see GitHub releases page.)

I've also fixed the problem reported by @knowitnothing

Thanks for the work on Hive.

I believe this custom useragent is only useful if you start accepting apps that only redirect to a site, are you planning to do that ? Or are you planning to include a mini-browser app inside hive ?


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on November 07, 2013, 08:52:32 PM
Thanks for the work on Hive.

I believe this custom useragent is only useful if you start accepting apps that only redirect to a site, are you planning to do that ? Or are you planning to include a mini-browser app inside hive ?

We discourage it of course, but there may be some exceptions. And re: mini-browser app, there is no such plan, no.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on November 09, 2013, 05:48:24 PM
I've released my app for satoshirat, it's in your repo, and i've done today a major update.

check it out.

Oh wow, we totally missed this, sorry yellowdog!
https://github.com/hivewallet/hiveapp-satoshirat

Can you please post a screenshot here so that it stands out more?

Thanks!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: yellowdog on November 13, 2013, 01:03:58 PM
I've released my app for satoshirat, it's in your repo, and i've done today a major update.

check it out.

Oh wow, we totally missed this, sorry yellowdog!
https://github.com/hivewallet/hiveapp-satoshirat

Can you please post a screenshot here so that it stands out more?

Thanks!

Some pics, thx!

http://imageshack.com/a/img607/6279/0r2e.png

http://imageshack.com/a/img17/1861/e77h.png



Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on November 16, 2013, 06:53:50 AM
Adding idea of passing the system language to app platform:
https://github.com/hivewallet/hive-osx/issues/111


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: knowitnothing on November 16, 2013, 03:18:01 PM
Adding idea of passing the system language to app platform:
https://github.com/hivewallet/hive-osx/issues/111

The comment linked in that issue seems to suggest more than just passing the current language.

The apps can already be localized, it is a matter of having a menu inside the app where the user can pick some other language, and obviously the app needs to provide such translations. Passing the current language is unneeded, as it is already available through navigator.language in javascript. If navigator.language doesn't reflect the current language, then that should be an issue by itself.

It looks like that comment is after some method for sharing the translations already available for Hive, so the apps can reuse them as much as possible. No amount of translations will ever be enough for all the possible apps, but some of the common translated strings could be reused and at least reduce some trivial effort on the translations there. I'm not sure if this actually helps, as it might induce to apps half-translated which doesn't improve the user experience.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: moderate on November 16, 2013, 04:44:08 PM
Adding idea of passing the system language to app platform:
https://github.com/hivewallet/hive-osx/issues/111

It looks like that comment is after some method for sharing the translations already available for Hive, so the apps can reuse them as much as possible.

Yes.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on November 19, 2013, 09:13:06 AM
The apps can already be localized, it is a matter of having a menu inside the app where the user can pick some other language, and obviously the app needs to provide such translations. Passing the current language is unneeded, as it is already available through navigator.language in javascript. If navigator.language doesn't reflect the current language, then that should be an issue by itself.

It looks like that comment is after some method for sharing the translations already available for Hive, so the apps can reuse them as much as possible. No amount of translations will ever be enough for all the possible apps, but some of the common translated strings could be reused and at least reduce some trivial effort on the translations there. I'm not sure if this actually helps, as it might induce to apps half-translated which doesn't improve the user experience.
No, it wasn't about passing any actual translated strings from Hive to apps, that wouldn't make much sense as you say. This is specifically about passing info about the locale currently used in the app. I haven't thought about navigator.language, that can probably be useful for now, but I'm guessing it doesn't always reflect the Hive locale exactly - especially if Hive doesn't currently have a translation for the language you've chosen in the system preferences.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: moderate on November 19, 2013, 12:40:46 PM
The apps can already be localized, it is a matter of having a menu inside the app where the user can pick some other language, and obviously the app needs to provide such translations. Passing the current language is unneeded, as it is already available through navigator.language in javascript. If navigator.language doesn't reflect the current language, then that should be an issue by itself.

It looks like that comment is after some method for sharing the translations already available for Hive, so the apps can reuse them as much as possible. No amount of translations will ever be enough for all the possible apps, but some of the common translated strings could be reused and at least reduce some trivial effort on the translations there. I'm not sure if this actually helps, as it might induce to apps half-translated which doesn't improve the user experience.
No, it wasn't about passing any actual translated strings from Hive to apps, that wouldn't make much sense as you say.


Uhm I just said it was, right in the last comment. You need an API for letting the apps access the locales, obviously you won't pass the entire files on every application start.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on November 19, 2013, 02:43:26 PM
Uhm I just said it was, right in the last comment. You need an API for letting the apps access the locales, obviously you won't pass the entire files on every application start.
Ok, now I'm confused, but anyway here's what we're planning:

- there will be locale information in the JS API, so the app will be able to check if the whole UI is displayed e.g. in French or in German, and if it includes its own translations for its labels inside the app bundle, it can use some kind of JS i18n library to change the language of the labels

- there (probably) won't be any API that passes any specific translated strings from Hive to the app through the API, because I think there's no way we can prepare any generic set of labels that would be reusable in any significant amount of apps and would cover all copy needed in those apps, and that would probably be more work than it's worth anyway


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: Ecurb123 on November 19, 2013, 07:03:27 PM
Hi, I'm just trying to get my head around what this is, and I'm sorry I haven't read too much yet. As I understand it, the hive app is an app which is or will be a bitcoin wallet, but also offers an API for people to create their own bitcoin related games which can be played with the bitcoins in the users wallet. Is that right or am I way off?


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: moderate on November 19, 2013, 07:12:11 PM
Hi, I'm just trying to get my head around what this is, and I'm sorry I haven't read too much yet. As I understand it, the hive app is an app which is or will be a bitcoin wallet, but also offers an API for people to create their own bitcoin related games which can be played with the bitcoins in the users wallet. Is that right or am I way off?

Any kind of app, as long as you can do it using javascript, html, and css. It is just a webkit browser embedded there.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: tgerring on November 27, 2013, 03:59:02 PM
Hi, I'm just trying to get my head around what this is, and I'm sorry I haven't read too much yet. As I understand it, the hive app is an app which is or will be a bitcoin wallet, but also offers an API for people to create their own bitcoin related games which can be played with the bitcoins in the users wallet. Is that right or am I way off?

Hive is a Bitcoin wallet for Mac OS X :)

Hive wallet also has a API, allowing developers to build apps that live inside the wallet itself, making it easy for Hive users to interact with Bitcoin services directly. Since it's HTML/CSS/JS-based, anything that can run in the browser can be an app.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: BTC_GHD on December 01, 2013, 06:46:17 AM
I'm working on an app for Dabs' charity based on Seans Outpost
https://i.imgur.com/J6sCkof.png


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on December 04, 2013, 12:19:32 PM
A few updates for Hive app developers:

  • apps now run on http://app_name.hiveapp/ instead of http://localhost/app_name - this was changed to prevent apps from reading each other's cookies (but if possible, please don't hardcode the address, just take it from location.href, as we may need to change it again in the future)
  • you can now safely use cookies to persist data between sessions (just remember to set a persistent cookie, not a session cookie, i.e. with an expiration date set)
  • localStorage does NOT work properly right now and you should not rely on it
  • there are bitcoin.VERSION and bitcoin.BUILD_NUMBER properties if you need to check the Hive version
  • if you are relying on the fact that Hive disables origin policy check for XHR requests, please don't do that - we'll be removing this in the future (and there will be an API method added instead that will proxy the request for you)
 

Also, a few things you might not be aware of:

  • Hive has a Webkit inspector enabled, so in any app you can right-click and choose "Inspect" to get access to the JS console
  • for easier development, you can replace an archived app bundle in ~/Library/Application Support/Hive/Applications with an unpacked directory with the same name, and the app will work exactly the same


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: greenek on December 08, 2013, 09:13:00 PM
Hello!

My name is Paweł and I'm working on few stuff for Hive Wallet.

http://cl.ly/image/0Y3N3G1y3S3l/Zrzut%20ekranu%202013-12-08%20o%2021.51.06.png

Basic functionality has been implemented. What else would you like to see here?

Greetings from Kraków, Poland!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: daybyter on December 08, 2013, 09:38:59 PM
Maybe some trading methods?

I did something similar with phonegap here:

https://bitcointalk.org/index.php?topic=135392.0


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on December 08, 2013, 10:38:40 PM
Maybe some trading methods?

I did something similar with phonegap here:

https://bitcointalk.org/index.php?topic=135392.0

Neat! Would you be interested in porting that to a Hive app? We'd love to get some BTC-E action in there!


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: daybyter on December 08, 2013, 11:11:50 PM
To be honest: I have no clue, how hive works...  ;D

But the btc-e stuff is dirt simple. It's just 4 or 5 lines of js with some jsquery mobile and some rough html to display the tables.

The most interesting part would be a nice graph with candles etc. But I never managed to get there. I code java most of the time
and can't even read those candle graphs, so I wrote me my own UI:

https://i.imgur.com/MqHfF.jpg

So I guess, I won't be much help for you...  :(


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: Desensitizer on December 09, 2013, 03:53:59 AM
Any plans to develope a Windows version of hive? I am interested in trying it out and I would be willing to do some beta testing if you needed it.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on December 09, 2013, 04:09:13 PM
Three more updates about the API:

  • getSystemInfo (https://github.com/hivewallet/hive-osx/wiki/API#getting-information-about-system-settings) - it now includes locale and preferred currency info; the version and build number properties I mentioned before were also moved there (sorry...)
  • updateExchangeRate (https://github.com/hivewallet/hive-osx/wiki/API#getting-information-about-fiat-currency-exchange-rates) - you can now get currency exchange rates (e.g. USD/BTC) inside apps
  • makeRequest (https://github.com/hivewallet/hive-osx/wiki/API#sending-proxied-requests-to-web-apis) - this should be used to bypass origin policy if a web API doesn't support JSONP or CORS (again, please don't rely on the fact that Hive is currently disabling the origin policy check)

These changes will be available in the next build.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: icedicedavid on December 10, 2013, 09:17:21 AM
what is the user base for hive now?


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on December 10, 2013, 11:42:09 AM
what is the user base for hive now?

Since we are warning people at every turn to be careful with our wallet until it leaves "alpha" stage, there are probably not a lot. However, we will be peeling off those labels very soon and making a wider push.

Still, we do get emails every day asking for support, and we see in those that a lot of people are totally ignoring our warnings and sending thousands of dollars worth of Bitcoin using Hive. We don't have any kind of "calling home" feature to tally data, so we cannot be too specific just yet.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on December 10, 2013, 11:42:55 AM
Any plans to develope a Windows version of hive? I am interested in trying it out and I would be willing to do some beta testing if you needed it.

Hi Desensitizer! Only if an exceptional Windows developer steps up to help us. It's not something we really know anything about, unfortunately.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on December 10, 2013, 12:37:21 PM
  • getSystemInfo (https://github.com/hivewallet/hive-osx/wiki/API#getting-information-about-system-settings) - it now includes locale and preferred currency info; the version and build number properties I mentioned before were also moved there (sorry...)
  • updateExchangeRate (https://github.com/hivewallet/hive-osx/wiki/API#getting-information-about-fiat-currency-exchange-rates) - you can now get currency exchange rates (e.g. USD/BTC) inside apps
  • makeRequest (https://github.com/hivewallet/hive-osx/wiki/API#sending-proxied-requests-to-web-apis) - this should be used to bypass origin policy if a web API doesn't support JSONP or CORS (again, please don't rely on the fact that Hive is currently disabling the origin policy check)
This is now available in the latest build on Sparkle and on grabhive.com.

Oh, and one more thing: links with target="_blank" will now open in an external browser instead of just being ignored as before.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: greenek on December 10, 2013, 09:06:21 PM
Hi there!

First update for Coinbase bundle is here, including currency conversion and transactions history.

Download here: github.com/hivewallet/hiveapp-coinbase (https://github.com/hivewallet/hiveapp-coinbase)

http://cl.ly/image/452h0x29421S/Zrzut%20ekranu%202013-12-10%20o%2022.02.01.png


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on December 10, 2013, 10:05:43 PM
greenek that's looking really nice!

Does it allow at the moment sending purchased Bitcoin directly to your local Hive wallet? Also we should probably be careful to always say "Coinbase balance" when showing another balance. And that balance should respect the local BTC/mBTC/uBTC setting.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: tgerring on December 16, 2013, 03:41:03 PM
I've been working on a new Bitstamp app in light of both their and our API changes. It's a fairly simple HTML/jQuery app with Bootstrap styling--no compilers/preprocessors are used, so it should be very easy to inspect to design your own app using this as an example. It makes use of several common Hive Wallet API features including: send bitcoins, get user address, and get user locale. Additionally, this is the first app to make use of our new storage API so it will remember your API secret and automatically log you in to your account.

You can follow the project on GitHub at https://github.com/tgerring/hiveapp-bitstamptrader and here's a screenshot (though already outdated):

https://i.imgur.com/QsZqZV6.png


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: tgerring on January 03, 2014, 09:06:51 PM
The Sean's Output app has been updated to make use of built-in currency exchange rates, removing the need to interface with BitPay directly.

The updated app can be download from https://github.com/hivewallet/hiveapp-seansoutpost/releases/tag/1.4 and if you're a developer interested in using exchange rates in your app, the API documentation is here (https://github.com/hivewallet/hive-osx/wiki/API#getting-information-about-fiat-currency-exchange-rates).


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: tgerring on January 15, 2014, 09:28:37 PM
Sean's Outpost (https://github.com/hivewallet/hiveapp-seansoutpost) and the Support Hive (https://github.com/hivewallet/hiveapp-supporthive) have been updated to use our new formatting & parsing functions (https://github.com/hivewallet/hive-osx/wiki/API#formatting-and-parsing) and respect the user's BTC/mBTC/uBTC unit preference.

 :o


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on January 30, 2014, 09:41:55 PM
We've added 4 new apps in Hive 1.0 released today:

1) The new Bitstamp app - see above (we've added a detailed wizard/tutorial for creating an API key, since even I had problems with this process...).

2) Coinbase app - you can send and receive money from your Coinbase wallet (including easy transfer between Hive and Coinbase); no buying/selling yet.

https://i.imgur.com/ExCPkQq.png

3) BitPremier app:

https://i.imgur.com/Z4pF4DR.png

4) Prepaid Mobile Recharge app by Umbrel (mobile client of http://spend-a-bit.com):

https://i.imgur.com/8yJ1OFo.png


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on January 30, 2014, 11:58:16 PM
Yup, I've noticed that too... (https://github.com/hivewallet/hiveapp-bitpremier/issues/3).


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: ZeroEnmity on January 31, 2014, 12:06:22 PM
Thanks for the great tutorial.. Much appreciated!  :D


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: weilu on February 13, 2014, 11:03:41 AM
Announcing Hive Toolbelt (https://github.com/hivewallet/toolbelt (https://github.com/hivewallet/toolbelt)) - Building Hive apps made easy.

You can install it with `gem install hive-toolbelt`

Currently the toolbelt provides two useful commands:
1) `hive init` # walks you through scaffolding a Hive app
2) `hive package` # creates a .hiveapp bundle from specified or current working directory

Find out more on github: https://github.com/hivewallet/toolbelt (https://github.com/hivewallet/toolbelt). Issues and pull requests are welcome :)


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: jsuder on February 20, 2014, 02:25:31 PM
Hi,

a few new things we’ve added to the API:

  • bitcoin.installApp - can be used to create “app store” kind of apps that let you install other apps from a given set
  • bitcoin.apiVersionMajor/apiVersionMinor - returns current API version (currently 0.1)
  • bitcoin.getSystemInfo - added availableCurrencies list, and preferredBitcoinFormat and preferredCurrency that return user’s selected Bitcoin unit and fiat currency
  • a few methods for parsing and formatting amounts, see https://github.com/hivewallet/hive-osx/wiki/API#wiki-formatting-and-parsing

Also, the same-origin policy hack is disabled now, so XHR requests to external domains will not work unless the server supports CORS or JSONP - use bitcoin.makeRequest in those cases.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on May 15, 2014, 05:17:34 PM
Hive for Android beta has been released:

https://bitcointalk.org/index.php?topic=608891.0


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on May 28, 2014, 06:15:24 AM
The integrated app store app has been updated to reflect some Android changes.


Title: Re: How to build a Hive app (introducing the Hive app API)
Post by: hivewallet on June 27, 2014, 12:01:41 PM
To app developers:

Yes, Hive Web (https://bitcointalk.org/index.php?topic=663832.0;all) will soon support apps. We are not dropping them.