npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

refmint-sdk

v1.2.2

Published

SDK for use with https://app.refmint.xyz or https://test.refmint.xyz

Readme

refmint-sdk

SDK for use with https://app.refmint.xyz or https://test.refmint.xyz

The Refmint SDK is for developers to be able to make API calls to the Refmint app server and testnet server. The following pages will describe how to make calls to the Refmint API. Developers will need to install the refmint-sdk to their project. This can be done using npm or by cloning the github project.

Update Note: As of v.1.1.18, there is now an enum for baseUrl when initializing the Refmint client. Previously, one had to pass the baseUrl endpoint string (i.e. 'https://testnet.refmint.xyz'). Now, instead of passing the base url, you must import the BaseURLOptions enum from refmint-sdk as show in the examples below. This enum has options of LOCAL, TESTNET (equivalent of https://test.refmint.xyz), and MAINNET (equivalent of https://app.refmint.xyz). Pass the enum value as shown in the examples below:

I.E.

Previously:

var refmintClient = new Refmint({  apiKey: api_key,  baseUrl: "https://test.refmint.xyz" });

Is now:

var refmintClient = new Refmint({  apiKey: api_key,  baseUrl: BaseURLOptions.TESTNET });

Update note: As of v.1.2.0, The Game and NFT project clients have been seperated. They are now seperate and can be initiated as below:

var refmintClient = new Refmint.Game({  apiKey: api_key,  baseUrl: BaseURLOptions.TESTNET });

OR

var refmintClient = new Refmint.NFT({  apiKey: api_key,  baseUrl: BaseURLOptions.TESTNET });

npm i refmint-sdk

Usage

Log Referral Example:

Arguments:  custom_url: string // Custom URL of your project  wallet_adress: string // wallet_adress of the new user being referred  link_id: string // affiliate referral_id of the referrer  email_address (optional): string // email address of the referred new user  phone_number (optional): string // phone number of the referred new user

Response:  {   referral_link: string // ink to raffle refferal page,   referral_id: string // affiliate referral_id of the referred user  }

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const custom_url = 'refmintsdk'; //example project on testnet
const wallet_adress = '0x123abc456def'; //insert wallet of referree here
const link_id = 'fqOm45Jv'; //example link id for an affiliate on the example project
const email_address = ''; // (optional) insert referree email here
const phone_number = '1234567890' // (optional) insert referree phone number here
const api_key = 'reYam27iBtMqeGuEhR2ywSV6440wo3gx2CcIC5IK6RNHRCvBoKAHdsNx3FyLz2t1'; //demo api key for testnet

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.logReferral(custom_url,wallet_adress,link_id,email_address,phone_number).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});

Log View Example:

Arguments:  custom_url: string // Custom URL of your project  link_id: string // affiliate referral_id of the referrer

Response: N/A

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const custom_url = 'refmintsdk'; //example project on testnet
const link_id = 'fqOm45Jv'; //example link id for an affiliate on the example project
const api_key = 'reYam27iBtMqeGuEhR2ywSV6440wo3gx2CcIC5IK6RNHRCvBoKAHdsNx3FyLz2t1'; //demo api key for testnet

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.logView(custom_url,link_id).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e)
});

Is Affiliate Check Example:

Arguments:  custom_url: string // Custom URL of your project  wallet_address: string // wallet_address of the user to be checked

Response: boolean

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const custom_url = "refmintsdk";
const wallet_address = "0xE7bb679Fa033517393001e1E43b3d326016E0A0c";

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.isAffiliate(
      custom_url,
      wallet_address,
    ).then((resp) => {
      if (resp) {
        // do something if wallet_address belongs to an affiliate
      } else {
        // do something else if wallet_address doesn't belong to an affiliate
      }
}).catch(e => {
	console.log(e);
});

Affiliate Data Example:

Arguments:  custom_url: string // Custom URL of your project  wallet_address: string // wallet_address of the user to be checked

Response:  {   clicks: number, // the number of clicks/views of this project via the affiliate   referrals: number, // the number of referred users by this affiliate   referral_mints: number, // the number of mints by referred users from the affiliate   amount_owed: number, // the commission earned from referred mints by this affiliate   amount_claimable: number, //commissions from referred mints that haven't been claimed yet by the affiliate   amount_claimed: number, // commissions from referred mints that have already been claimed the by affiliate   additional_raffle_entries: number, // raffle entries earned from referring users   type: ENUM string ["PAID", "LINK", "RAFFLE", "LIVE", "DQ"], // type of the affiliate   is_on_allow_list: boolean, // boolean indicating if the affiliate is on the allowlist for the project   link_id: string, // link id of the affiliate   affiliate_link: string // link to the referral page where new us  }

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const custom_url = "refmintsdk";
const wallet_address = "0xE7bb679Fa033517393001e1E43b3d326016E0A0c";

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.affiliateLink(
      custom_url,
      wallet_address,
    ).then((resp) => {
      
      // console.log(resp) example return:
      // {
      //     "clicks":0,
      //     "referrals":0,
      //     "referral_mints":0,
      //     "amount_owed":"0",
      //     "amount_claimable":"0",
      //     "amount_claimed":"0",
      //     "additional_raffle_entries":0,
      //     "type":"LIVE",
      //     "is_on_allow_list":false,
      //     "link_id":"toRMyGkK",
      //     "affiliate_link":"https://test.refmint.xyz/p/refmintsdk/toRMyGkK"
      //}
      
      // console.log(resp.clicks) // returns 0
      
}).catch(e => {
	console.log(e);
});

Modify Score Example:

Arguments:  project_url: string // Custom URL of your project  campaign_url: string // Custom URL of your campaign  users: {   wallet_adress: string // wallet_adress of the user whose score we want to add to   score: number // how much to add to be added/subtracted to user score  }[] // array of objects which has a wallet address and score to be added/subtracted to user score

Response: N/A

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const project_url = 'refmintsdk'; // custom url for the project
const campaign_url = 'campaignURL'; // custom url for the project
const users = [
  {
    wallet_address: '0x123abc456def',
    score: 10
  },
  {
    wallet_address: '0xabc123def456',
    score: -3
  },
];

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.modifyScore(custom_url,campaign_url,users).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});

Query Leaderboard Example:

Arguments:  project_url: string // Custom URL of your project  campaign_url: string // Custom URL of your campaign  order_by: string // what to sort leaderboard by 'score' or referral  page_size: number // how many users to include in query result  page: number // which page of users to return, ie set to page to 2 and page size to 1o if you want users 11-20  with_points_only: boolean // whether to only include users with a score or not

Response: An array of objects: [  {   created_at: number, // date this user object for the leaderboard was created   project_id: string, // unique ID for the project   referral: number, // number of referrals by the user for the project   score: number, // the user's score for the project   updated_at: number, // the date the user was last updated   wallet_address: string, // the user's wallet address   id: string, // the user's unique id for the project  }  ,{   ...  } ]

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const project_url = 'refmintsdk'; //example project on testnet
const campaign_url = 'campaignURL'; //example campaign on testnet
const order_by = 'score'; // order the leaderboard by highgest score
const page_size = 10; // include 10 users in this request
const page = 1; // get the first (page_size) users , i.e. users 1-10 in this case with the top score
const with_points_only = true; // only include users in the list of their score is greater than 0

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.leaderboard(project_url,campaign_url,order_by,page_size,page,with_points_only).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});

User Score Example:

Arguments:  project_url: string // Custom URL of your project  campaign_url: string // Custom URL of your campaign  wallet_address: string // the wallet address of the user to check for a score

Response: {  project_url: string, // custom_url of the project  campaign_url: string, // custom_url of the campaign  wallet_address: string, // wallet_address of user }

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const custom_url = 'refmintsdk'; //example project on testnet
const campaign_url = 'myCampaignURL'; // example campaign in the project
const wallet_address = '0x123abc456def'; // example wallet_address

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.userScore(custom_url,campaign_url,wallet_address).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});

Add Users Example:

Arguments:  project_url: string // Custom URL of your project  campaign_url: string // Custom URL of your campaign  users: { wallet_address: string, score: number, referral: number }[] // array of objects (object is a user object with a wallet_addres, the score, and referrals total)  link_id?: string // optional, whether or not to attribute a referral, insert the link_id of the referrer

Response:

An array of user objects: [  {   wallet_address: string // wallet_address of the referred user   referral_link: string // referral link for new user for the campaign   referral_id: string // added user's referral id  }  ,{   ...  } ]

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const custom_url = 'refmintsdk'; //example project on testnet
const campaign_url = 'myCampaignURL'; // example campaign
const users = [{wallet_address:'0x123abc456def', score: 0, referral: 0}]; // example user to be added
const link_id = 'fqOm45Jv'; // optional, example link_id of the referrer

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.addUsers(custom_url,campaign_url,users,link_id).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});

Referral Example:

Arguments:  project_url: string // Custom URL of your project  campaign_url: string // Custom URL of your campaign  wallet_address: string // the wallet address of the user to add a referral to  referral_only: boolean // true if only to count referral, false if you want to add points as well (based on campaign points_per_referral)

Response: N/A

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const project_url = 'refmintsdk'; //example project on testnet
const campaign_url = 'myCampaignURL'; // example campaign
const wallet_address = '0x123abc456def'; // example wallet_address to add referral to
const referral_only = true; // only add referral (or false to add points as well)

var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.referral(project_url,campaign_url,wallet_address,referral_only).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});

Is User Example:

Arguments:  custom_url: string // Custom URL of your project  wallet_address: string // wallet addresses to check if user of project

Response: boolean

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const custom_url = 'refmintsdk'; //example project on testnet
const wallet_address = '0x123abc456def'; //wallet address to check


var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.isUser(custom_url,wallet_address).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});

User Links Example:

Arguments:  custom_url: string // Custom URL of your project  wallet_address: string // wallet addresses to grab links for

Response: Object {  referral_link: string // referral link to the project  referral_id: string // referral_id of the user }

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const custom_url = 'refmintsdk'; //example project on testnet
const wallet_address = '0x123abc456def'; //wallet address to check


var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.userLinks(custom_url,wallet_address).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});

Click Example:

Arguments:  project_url: string // Custom URL of your project  campaign_url: string // Custom URL of your campaign  link_id?: string // optional, user's link id to attribute click to

Response: N/A

import Refmint from "refmint-sdk"
import { BaseURLOptions } from "refmint-sdk"

const project_url = 'refmintsdk'; //example project on testnet
const campaign_url = 'campaign_1'; //example project on testnet
const link_id? = 'fqOm45Jv'; // optional, example link_id of the referrer


var refmintClient = new Refmint({
	apiKey: api_key,
	baseUrl: BaseURLOptions.TESTNET
});

refmintClient.click(project_url,campaign_url,link_id).then((resp) => {
	//do something...
}).catch(e => {
	console.log(e);
});