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

zapperfi-api

v0.0.7

Published

Unofficial wrapper for the Zapperfi API

Downloads

12

Readme

Test npm npm Lines

Install

# use npm
$ npm i zapperfi-api

# use yarn
$ yarn add zapperfi-api

# use pnpm
$ pnpm add zapperfi-api

API

before using the zapperfi-api, you need to request a zapperfi api_key first

the zapperfi v2 api have been wrapped.

Usage

Creating a client

To create a client, simply provide an object with your apiKey

NOTE: If you're using zapperfi-api in a browser, you'll need to proxy your requests through your server with credentials, to keep the apiKey confidential. I will provide a convenient way to do this soon.

import { V2Client } from 'zapperfi-api'

const client = new V2Client({
  apiKey: '<your-api-key>',
})

Make a request

All methods have 2 arguments: the first one includes all of the parameters for particular method. And the second one is a callback function, it's optional, if you don't provide it, the request will return a promise instead. All the parameters and responses types are already defined, so you can use them directly with safe type.

// callback style
client.misc.getGasPrices(parameters, callback)

// async/await style
const response = await client.misc.getGasPrices(parameters)

Examples

get wallet tokens breakdown

import { V2Client, V2Models } from 'zapperfi-api'

const client = new V2Client({
  apiKey: process.env.ZAPPER_API_KEY,
})

const parameters = {
  networks: [V2Models.Network.ETHEREUM_MAINNET],
  addresses: ['0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'],
}

await client.balances.getAppBalance({ addresses, network, appId: 'tokens' })

get addresses balances

import { V2Client, V2Models } from 'zapperfi-api'

const client = new V2Client({
  apiKey: process.env.ZAPPER_API_KEY
})

const parameters = {
  networks: [V2Models.Network.ETHEREUM_MAINNET],
  addresses: ['0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'],
}

// use callback style
const callback = (err, data) => {
  if (err) throw err

  const { type, payload } = data

  if (type === 'partial') {
    // process payload with every incoming message payload
    // faster than full payload, but payload is not full
    ...
  }

  if (type === 'full') {
    // or, just process the final payload
    // slower than partial payload, but payload is full
    ...
  }
}
client.balances.get(parameters, callback)


// or, use async/await style
// but it only return the final full payload
const balances = await client.balances.get(parameters)

Client Methods

apps


Get supported applications.

apps.getPositions(parameters, callback?)

Retrieve positions (non-tokenized) for a given application

apps.getTokens(parameters, callback?)

Retrieve tokens for a given application

apps.supported(callback?)

Retrieve all supported applications info

apps.get(parameters, callback?)

Retrieve application info by appId

balances


balances.get(parameters, callback?)

Gets the balances for given addresses.

balances.getAppBalance(parameters, callback?)

get wallets balance by appId

balances.supported(parameters, callback?)

get all the apps info have participated for given addresses

exchange


Returns an easy to submit transaction for exchanging assets.

exchange.getPrice(parameters, callback?)

Returns data about the amount received if a trade would be made. Should be called whenever a price needs to be calculated.

exchange.getQuote(parameters, callback?)

Returns both the relative price for a trade as well as the call data used to submit a transaction for a trade.Should only be called when a trade is ready to be submitted.

exchange.supported(callback?)

Returns the exchanges supported by Zapper API.

misc


Miscellaneous Data Endpoints

misc.prices(parameters, callback?)

Retrieve supported tokens and their prices

misc.getTokenPrices(parameters, callback?)

Retrieve given token and its prices

misc.getGasPrices(parameters, callback?)

Retrieve a gas price aggregated from multiple different sources

transactions


Historical Transactions. Data on past transactions for a specific address.

transactions.get(parameters, callback?)

Data on past transactions for addresses

zapIn


Endpoints for creating transactions for adding liquidity to different applications.

zapIn.supported(parameters, callback?)

Provides a list of networks to app IDs that are supported by the Zap In routes.

zapIn.getApprovalState(parameters, callback?)

Retrieves an ERC20 approval status for an application zap-in

zapIn.getApprovalTransaction(parameters, callback?)

Builds an ERC20 approval transaction for an application zap-in

zapOut


Endpoints for creating transactions for removing liquidity from an application.

zapOut.supported(parameters, callback?)

Provides a list of networks to app IDs that are supported by the Zap Out routes.

zapOut.getApprovalState(parameters, callback?)

Retrieves an ERC20 approval status for an application zap-out.

zapOut.getApprovalTransaction(parameters, callback?)

Builds an ERC20 approval transaction for an application zap-out.

nft


Get Ethereum NFT balances for addresses.

nft.getNetWorth(parameters, callback?)

nft.getCollections(parameters, callback?)

nft.getCollectionsTotals(parameters, callback?)

Donations

Feel free to use the GitHub Sponsor button to donate towards my work if you think this project is helpful. 🤗