Kin Unity SDK server - Node
This is a simple server side implementation of Kin's node SDK. and its callback implementation It can work as a standalone implementation, or together with the client side wrapper provided in the Kin Unity SDK tutorial.
With this code, you can call Kin's blockchain to:
- Fund newly created accounts
- Send payments
- Whitelist transactions for the client
You can also extend it to suit your needs.
Installation
npm install kin-node-server
Configuration
Set the following variables in server.js and upload to your server or localhost (port 5000)
const isProduction = false;
const seed = 'SBKK2MJZLU4UERFXP3CCG5QYUZ27WXDJ2CIUKA2UCOAXZV3DRDBLBCLA'; //private key/seed (keep private / store in .env file for production)
const uniqueAppId = '1acd'; //your app id assigned by Kin - you can use 1acd for testing
const maxKinSendable = 10; //just for your security - set max Kin you allow from your server to your app
You can use Kin's Laboratory to generate your seed.
Push to your server (Heroku recommended).
Usage
Simply call the server with GET/POST to perform the following functions:
-
Fund a new account (create it on the blockchain)
GET: fund = 1
POST: address, memo, amount
-
Send a payment to an account
GET: request = 1
POST: address, id, memo, amount
-
Whitelist a transaction for the client
GET: whitelist = 1
POST: address, id, memo, amount
Variables
- address: The blockchain address you wish to make a payment to
- memo: Memo to add to your transaction
- amount: Amount to send for your transaction
- id: A unique id for your client (optional)
Contributing
Please read CONTRIBUTING.md for details.
License
This project is licensed under the MIT License - see the LICENSE.md file for details