This Hack Stellar app is a boilerplate collection of basic Stellar functions. You can either hack this Stencil project into whatever you're trying to build or just cut and paste out the functions from here into your own project.
To start building with this project clone this repo and install the deps:
npm i
and run:
npm start
To build the app for production, run:
npm run build
Stellar Functions Featured in this Boilerplate
keypairGenerate() {}
Dead simple Stellar keypair generator method. There are lots of ways to generate valid Stellar keypairs but if all you're looking for is a quick random keypair this is the method for you.
async accountFund() {}
While on testnet we have a fancy little friendbot server method we can call to pay ourselves 10,000 XLM. Once you're in a production environment you'll need to use an accountPay
method in order to get accounts created and funded. This is just a quick way to boot up your testing environment.
async accountUpdate() {}
Once we have a funded account live on the ledger we can call that account and GET its current state. There's lots of data in an account object understandably so you'll likely want to brush up on these fields.
async accountCreate() {}
A core Stellar transaction operation is creating new accounts. It's just like a payment operation except it's always XLM and always funding new accounts which don't exist on the ledger.
async accountPay() {}
Another central operation of Stellar transactions is making payments. In this method we're paying 100 XLM to the account we just created with an intial 10 XLM. The next step would be to explore custom assets so you can make and receive payments in assets other than the native XLM.