alax-web-sdk v0.1.0
ALAX JavaScript SDK
Introduction
Our mission is to create an open financial system for the gaming world by providing services for sending or receiving ALAX digital currency between online wallets, game players, or game publishers. This SDK aims to help the development of intergrations with ALAX that use JavaScript, providing an easy interface to communicate with ALAX's REST API and request the information required.
Requirements
In order to use this SDK, you will need the following tools:
- Node.js v8.0.0 or above Node installation will include NPM, which is responsible for the dependencies management. For dealing with asynchronous code, many ES2015 features were used, as well as Promises notation to help.
Installation
Browser (without code bundler)
git checkout git@github.com:alaxio/alax-web-sdk.git
npm install
npm run bundle
- Use the bundle.js file generated in dist folder to use the SDK in the browser.
- Include in
<script src="path/to/bundle.js"></script>
- Define the constructor like this: const AlaxSdk = AlaxSDK.default;
Browser (with code bundler)
npm install alax-web-sdk
- import AlaxSdk from "alax-web-sdk"
Usage
You can find example projects with SDK usage here
This SDK provides an AlaxSdk
object containing several methods corresponding to the calls to be performed.
This is a generic example of how to use the SDK, if you need specifec details for a specific module, refer to api folder
Before executing any request, you need to call the constructor passing your apiKey credential as parameters, making it possible to authorize the calls to the API:
const AlaxSDKClient = new AlaxSdk(apiKey)
From this point on, you just need to call the methods made available to call the API and retrieve the data you're looking for.
Methods available
Here's a list of all the methods available, separated by module:
transationApi
- getFee()
productApi
- purchaseInAppItem(amount, fee)
5 years ago