Using the xtoearn-near-sdk-js in your app
xtoearn-near-sdk-js reference
Last updated
Was this helpful?
xtoearn-near-sdk-js reference
Last updated
Was this helpful?
Install dotenv npm package
Create a .env and copy contents from .env.example
Set METHOD_NAME to process_events
Set ACCOUNT_ID to your Account ID which you connected to the app
Set CONTRACT_ID to your Contract Name as shown on the xtoearn app
To send Rewards for a single Rewards Program:
Generate and download the Private Key of the Rewards Program
Store the private key in your .env
as PRIVATE_KEY
To pay out the rewards call the give_rewards
function with the necessary inputs
To send rewards for multiple Rewards Programs:
Create a directory and set credentials_dir
in the args
to the complete path of the directory
To pay out the rewards call the give_rewards
function with the necessary inputs
Download each program private key from website and copy the file to the directory created above