If your service is developed in Node.js, the features we provide are available through the SDK. The Gluwa SDK for Node.js is a library with powerful features that enable Node.js developers to easily make requests to the Gluwa APIs.
Getting started
Install the npm package on your Node.js server.
$npminstall@gluwa/gluwa-js
Never use Gluwa SDK on the client side or make your private key public.
Create and initialize a Gluwa object. Then, enter the APIKey, APISecret and WebookSecret generated from the Gluwa Dashboard, and an Ethereum wallet to manage your funds. Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.
constGluwaJS=require('@gluwa/gluwa-js');constGluwaConfig= { production: { APIKey:'{Your production API Key}', APISecret:'{Your production API Secret}', WebhookSecret:'{Your production Webhhok Secret}', MasterEthereumAddress:'{Your Ethereum Address for production}', MasterEthereumPrivateKey:'{Your Ethereum Private Key for production}', isDev:false, }, sandbox: { APIKey:'{Your sandbox API Key}', APISecret:'{Your sandbox API Secret}', WebhookSecret:'{Your sandbox Webhhok Secret}', MasterEthereumAddress:'{Your Ethereum Address for sandbox}', MasterEthereumPrivateKey:'{Your Ethereum Private Key for sandbox}', isDev:true, },}constGluwa=newGluwaJS(GluwaConfig.production);
constCurrency='{USDG or sUSDCG or KRWG}'; // e.g USDGconstOptionals= { Limit:'100',// optional, it must be a string Offset:'0',// optional, it must be a string Status:'Confirmed',// optional};constresultPromise=awaitGluwa.getTransactionHistory(Currency, Optionals);
When user completes transfer via the QR code, the Gluwa API sends a webhook to your webhook endpoint. Verify that the values actually sent by the Gluwa server are correct.
Verify the requested Signature and Payload as follows: