loyalty-sdk-test
v1.0.30
Published
The **SUI Loyalty Platform SDK** is a SDK designed to integrate a loyalty platform with the SUI blockchain using Move smart contracts. The SDK provides a modular framework to facilitate user sign-up, loyalty program configuration, token management, custom
Downloads
121
Readme
SUI Loyalty Platform SDK
Overview
The SUI Loyalty Platform SDK is a SDK designed to integrate a loyalty platform with the SUI blockchain using Move smart contracts. The SDK provides a modular framework to facilitate user sign-up, loyalty program configuration, token management, customer participation, wallet integration, redemption, and reward distribution.
Build Process
1. Setup Development Environment
- Install Node.js and npm
- Install dependencies
2. SDK Folder Structure
A structured folder layout:
sui-sdk/
├── src/
│ ├── auth/
│ ├── clients/
│ ├── modules/
│ ├── utils/
│ ├── index.js
│ ├── constants.js
│ └── package.json
└── tests/
└── README.md3. Publish the SDK
npm run build
npm publishUsage
Import the SDK and use the package in the script
npm install loyalty-sdk-testAuthorize by setting API Key
const sdk = new AuthManager('chain-network');
sdk.setApiKey('API Key');Authorize and create the JWT Token
const sdk = new AuthManager('chain-network');
sdk.generateJWT('wallet-address','signature','chain','message',sdk);Setting JWT Token Key
const sdk = new AuthManager('chain-network');
sdk.setJWT('JWT Token');Initiating the claim
let claim = new ClaimModule();
let response = await claim.initiateClaim('mission-id','user-unique-address',sdk);Fetching the claim status
let admin = new AdminModule();
let response = await admin.getClaimStatus('tenant-slug','mission-id','user-unique-address','claim-id',sdk);Get All the Missions
let admin = new AdminModule();
let response = await admin.getMissions('tenant-slug',sdk);Get All the Rewards
let admin = new AdminModule();
let response = await admin.getRewards('tenant-slug',sdk);