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

debank

v1.0.1

Published

API for cloud.debank.com

Readme

debank

API for cloud.debank.com

npm i debank

Usage

const Debank = require('debank')

const debank = new Debank('<access key>')

const used = await debank.user.used_chain_list({
  id: '0x5853ed4f26a3fcea565b3fbc698bb19cdf6deb85'
})
console.log(used)

API

const debank = new Debank(accessKey, [options])

Available options:

{
  timeout: 60000,
  agent: null
}

For example:

const { SocksProxyAgent } = require('socks-proxy-agent')

const debank = new Debank('<access key>', {
  agent: new SocksProxyAgent('socks://127.0.0.1:1080')
})

Requests

API reference is here: https://docs.open.debank.com/en/reference/api-pro-reference

Let's take Get top holders of token as an example:

GET /v1/token/top_holders/?{chain_id,id,start,limit}

The equivalent JavaScript call is like so:

const holders = await debank.token.top_holders({ chain_id, id, start, limit })

Errors

If Debank fails, then based on the status code it throws an error code:

  • 400 INVALID_PARAMS
  • 401 INVALID_ACCESS_KEY
  • 403 CAPACITY_LIMIT
  • 429 RATE_LIMIT
  • 500 INTERNAL_SERVER_ERROR
  • Or UNKNOWN_STATUS

For example:

const debank = new Debank('wrong-access-key')

try {
  await debank.chain.list()
} catch (error) {
  console.log(error.name) // => 'DebankError'
  console.log(error.code) // => 'INVALID_ACCESS_KEY'
  console.log(error.message) // => 'You must authenticate your request with an access key'
}

Chain

const chain = await debank.chain({ id })
const list = await debank.chain.list()

Protocol

const protocol = await debank.protocol({ id: 'compound' })
const list = await debank.protocol.list({ chain_id: 'eth' })
const all = await debank.protocol.all_list({ chain_ids: ['eth', 'bsc'] })

Token

const token = await debank.token({ chain_id: 'eth', id: '<token>' })
const list = await debank.token.list_by_ids({ chain_id: 'eth', ids: ['<token1>', '<token2>'] })
const holders = await debank.token.top_holders({ chain_id: 'celo', id: 'celo', start: 2, limit: 1 })

User

const used = await debank.user.used_chain_list({ id: '<user>' })
const balance = await debank.user.chain_balance({ chain_id: 'eth', id: '<user>' })

const protocol = await debank.user.protocol({ protocol_id: 'bsc_pancakeswap', id: '<user>' })
const list = await debank.user.complex_protocol_list({ chain_id: 'eth', id: '<user>' })
const all = await debank.user.all_complex_protocol_list({ chain_ids: ['eth', 'bsc'], id: '<user>' })
const simpleList = await debank.user.simple_protocol_list({ chain_id: 'eth', id: '<user>' })
const simpleAll = await debank.user.all_simple_protocol_list({ chain_ids: ['eth', 'bsc'], id: '<user>' })

const token = await debank.user.token({ chain_id: 'eth', id: '<user>', token_id: '<token>' })
const list = await debank.user.token_list({ chain_id: 'eth', id: '<user>', is_all: true })
const all = await debank.user.all_token_list({ id: '<user>', is_all: true })

const nfts = await debank.user.nft_list({ chain_id: 'eth', id: '<user>', is_all: true })
const allNfts = await debank.user.all_nft_list({ chain_ids: ['eth', 'bsc'], id: '<user>', is_all: true })

const history = await debank.user.history_list({ chain_id: 'eth', id: '<user>' })
const history = await debank.user.history_list({ chain_id: 'eth', id: '<user>', token_id: '<token>', page_count: 20 })
const allHistory = await debank.user.all_history_list({ chain_ids: ['eth', 'bsc'], id: '<user>' })
const allHistory = await debank.user.all_history_list({ chain_ids: ['eth', 'bsc'], id: '<user>', token_id: '<token>', page_count: 20 })

const authorizedList = await debank.user.token_authorized_list({ chain_id: 'eth', id: '<user>' })
const authorizedList = await debank.user.nft_authorized_list({ chain_id: 'eth', id: '<user>' })

const balance = await debank.user.total_balance({ id: '<user>' })

const curve = await debank.user.chain_net_curve({ chain_id: 'eth', id: '<user>' })
const totalCurve = await debank.user.total_net_curve({ chain_ids: ['eth', 'bsc'], id: '<user>' })

Collection

const list = await debank.collection.nft_list({ id: '<user>', chain_id: 'eth', start: 1000, limit: 1 })`

Wallet

const gas = await debank.wallet.gas_market({ chain_id: 'eth' })
const exec = await debank.wallet.pre_exec_tx({ tx: { chainId, from, to, value, data, gas, maxFeePerGas, maxPriorityFeePerGas, nonce }, pending_tx_list })
const explain = await debank.wallet.explain_tx({ tx: { chainId, from, to, value, data, gas, maxFeePerGas, maxPriorityFeePerGas, nonce } })

License

MIT