Yesterday the fine folks at Stripe brought to the world of digital currency yet another player with the announcement of the Stellar Organization, stewards of a new decentralized protocol for sending and receiving money in any pairs of currency and a new companion digital currency called the stellar (STR). This new protocol and currency, while having its own market determined value, is intended to provide a simpler path for converting between other currencies.

Never one to back away from a bandwagon, I immediately signed up and started playing with stellar, having a ton of fun exchanging the currency with friends and bugging my twitter network to send me stellars. As my friends and I continued, I thought, “Wouldn’t it be great to get an SMS message every time I received some stellar? If only there was an API for stellar that I could tap into”.

If only?!? Of course stellar has an API! There are APIs for everything: thermostats, coffee machines, lightbulbs, even cars. Why wouldn’t currency have an API too? In this post I’ll show you how to take the Stellar API, mix in a pinch of Node.js and a dash of Twilio SMS and create a simple stellar notification system. If you want to skip ahead, you can view the final code for our app here.

Lets get started!

Your Tools

Before you dive into the code, let’s make sure you have everything you need:

A Stellar Account – this lets you send and receive STR. Good news, they give you 5000 STR when you register.

Twilio SMS – sign up for a free Twilio account here.

Node.js – a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications.

Interaction With The Stellar API

You can interact with the Stellar API in 3 different ways: RPC, Command Line and Websockets. For this app we’ll be using Websockets but you can read about each method in the API documentation. Specifically, we’ll be using the node ws module. Let’s install it using npm: