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 🙏

© 2024 – Pkg Stats / Ryan Hefner

klarda-sdk

v2.0.3

Published

SDK for Klarda API

Downloads

19

Readme

klarda-sdk

Compact JavaScript library for interacting with Klarda's Advanced APIs.

Get started in 2 minutes

1. Install the package from npm


# with npm
npm i klarda-sdk

# with yarn
yarn add klarda-sdk

2. Initialize the provider

Note: to use Advanced API for free starting from 19.06.2024 you have to register on the platform.

Get your individual endpoint here https://docs.klarda.com/reference.

import { KlardaSDK } from 'klarda-sdk';

const klardaSdk = new KlardaSDK('YOUR_API_KEY');

Supported chains

klarda supports the following chains at this time:

Mainnet

  • Ethereum: "eth"
  • BNB Smart Chain: "bsc"
  • Polygon: "polygon"
  • Fantom: "fantom"
  • Arbitrum: "arbitrum"
  • Avalanche: "avalanche"
  • Syscoin NEVM: "syscoin"
  • Optimism: "optimism"
  • Polygon zkEVM: "polygon_zkevm"
  • Rollux: "rollux"
  • Base: "base"
  • Flare: "flare"
  • Gnosis Chain: "gnosis"
  • Scroll: "scroll"
  • Linea: "linea"

Testnet

  • Ethereum Goerli: "eth_goerli"
  • Avalanche Fuji: "avalanche_fuji"
  • Polygon Mumbai: "polygon_mumbai"
  • Optimism Testnet: "optimism_testnet"

Appchain

  • META Apes: "bas_metaapes"

Appchain Testnet

  • META Apes Testnet: "bas_metaapes_testnet"

Available methods

klarda supports the following methods:

Market

Wallet

Chain

Utils

Research


Usage

getTokenList

Get a list of tokens.


const tokenList = async () => {   return await klardaSdk.getTokenList({     category: 'all',     sort_by: 'market_cap',     sort_order: 'desc',     page: 1,     limit: 50,   }); };

getNewTokenList

Get a list of new tokens.


const newTokenList = async () => {   return await klardaSdk.getNewTokenList({     category: 'all',     page: 1,     limit: 50,   }); };

getTopGainerLoser

Get top gainers or losers.


const topGainersLosers = async () => {   return await klardaSdk.getTopGainerLoser({     type: 'gainers',     limit: 10,   }); };

getFundraising

Get fundraising data.


const fundraising = async () => {   return await klardaSdk.getFundraising({     page: 1,     limit: 50,   }); };

getPrivateFundraising

Get private fundraising data.


const privateFundraising = async () => {   return await klardaSdk.getPrivateFundraising({     page: 1,     limit: 50,   }); };

getTokenCategory

Get token categories.


const tokenCategories = async () => {   return await klardaSdk.getTokenCategory(); };

getProtocolList

Get a list of protocols.


const protocolList = async () => {   return await klardaSdk.getProtocolList({     page: 1,     limit: 50,   }); };

getGlobalData

Get global data.


const globalData = async () => {   return await klardaSdk.getGlobalData(); };

getEconomicCalendar

Get economic calendar events.


const economicCalendar = async () => {   return await klardaSdk.getEconomicCalendar({     start_date: '2023-01-01',     end_date: '2023-12-31',     country: 'US',   }); };

getIndicesFuture

Get indices future data.


const indicesFuture = async () => {   return await klardaSdk.getIndicesFuture(); };

getCommodities

Get commodities data.


const commodities = async () => {   return await klardaSdk.getCommodities(); };

getSearchByQueries

Search by queries.


const searchResults = async () => {   return await klardaSdk.getSearchByQueries({     q: 'bitcoin',     type: 'token',     page: 1,     limit: 50,   }); };

getTrendingSearch

Get trending search data.


const trendingSearch = async () => {   return await klardaSdk.getTrendingSearch({     page: 1,     limit: 50,   }); };

getTokenTechnicalIndicators

Get token technical indicators.


const technicalIndicators = async () => {   return await klardaSdk.getTokenTechnicalIndicators({     duration: '1d',     token_id: 'bitcoin',   }); };

getTokenSignal

Get token signal data.


const tokenSignal = async () => {   return await klardaSdk.getTokenSignal({     duration: '1d',     token_id: 'bitcoin',   }); };

getTokenLiquidityById

Get token liquidity by ID.


const tokenLiquidity = async () => {   return await klardaSdk.getTokenLiquidityById({     address: '0x1234567890abcdef',     chain_id: 'ethereum',   }); };

getTokenOnchainSummary

Get token onchain summary.


const onchainSummary = async () => {   return await klardaSdk.getTokenOnchainSummary({     token_id: 'bitcoin',   }); };

getTokenOnchainBurnCounts

Get token onchain burn counts.


const burnCounts = async () => {   return await klardaSdk.getTokenOnchainBurnCounts({     token_id: 'bitcoin',   }); };

getTokenOnchainSwapCounts

Get token onchain swap counts.


const swapCounts = async () => {   return await klardaSdk.getTokenOnchainSwapCounts({     token_id: 'bitcoin',     address: '0x1234567890abcdef',     chain_id: 'ethereum',   }); };

getTokenOnchainSmartMoneyData

Get token onchain smart money data.


const smartMoneyData = async () => {   return await klardaSdk.getTokenOnchainSmartMoneyData({     token_id: 'bitcoin',     duration: '1d',     chain_id: 'ethereum',     sort_by: 'volume',     sort_order: 'desc',     page: 1,     limit: 50,   }); };

getTokenOnchainCEXFlow

Get token onchain CEX flow.


const cexFlow = async () => {   return await klardaSdk.getTokenOnchainCEXFlow({     duration: '1d',     sort_by: 'volume',     sort_order: 'desc',     page: 1,     limit: 50,   }); };

getSuspiciousVolume

Get suspicious volume data.


const suspiciousVolume = async () => {   return await klardaSdk.getSuspiciousVolume({     duration: '1d',     chain_id: 'ethereum',     page: 1,     limit: 50,   }); };

getDEXGainers

Get DEX gainers data.


const dexGainers = async () => {   return await klardaSdk.getDEXGainers({     duration: '1d',     chain_id: 'ethereum',     page: 1,     limit: 50,   }); };

getTokenHolderHistory

Get historical data about token holders for a given token ID.


const tokenHolderHistory = async () => {   return await klardaSdk.getTokenHolderHistory({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',     chain_id: 'eth',     duration: '30d', // Specify the duration (e.g., '30d' for 30 days)   }); };

getTokenHolderCounts

Get the count of token holders for a given token ID.


const tokenHolderCounts = async () => {   return await klardaSdk.getTokenHolderCounts({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',     chain_id: 'eth',   }); };

getTokenHolderDistribution

Get the distribution of token holders for a given token ID.


const tokenHolderDistribution = async () => {   return await klardaSdk.getTokenHolderDistribution({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',     chain_id: 'eth',   }); };

getTokenPriceExchangeTrade

Get the exchange trade price for a given token ID.


const tokenPriceExchangeTrade = async () => {   return await klardaSdk.getTokenPriceExchangeTrade({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getTokenPriceInformation

Get price information for a given token ID.


const tokenPriceInformation = async () => {   return await klardaSdk.getTokenPriceInformation({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getTokenPrice

Get the current price for a given token ID.


const tokenPrice = async () => {   return await klardaSdk.getTokenPrice({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getTokenPriceHistory

Get the historical price for a given token ID at a specified timestamp.


const tokenPriceHistory = async () => {   return await klardaSdk.getTokenPriceHistory({     timestamp: '1625097600', // Unix timestamp     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getTokenPriceHistoryTimeRange

Get the historical price for a given token ID within a specified time range.


const tokenPriceHistoryTimeRange = async () => {   return await klardaSdk.getTokenPriceHistoryTimeRange({     start_timestamp: '1625097600', // Unix timestamp     end_timestamp: '1627689600', // Unix timestamp     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getTokenPriceOHLCV

Get the OHLCV (Open, High, Low, Close, Volume) data for a given token ID.


const tokenPriceOHLCV = async () => {   return await klardaSdk.getTokenPriceOHLCV({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',     duration: '30d', // Specify the duration (e.g., '30d' for 30 days)     limit: 100, // Number of data points to return   }); };

getTokenMetadataWithOnchain

Get metadata with on-chain data for a given token ID.


const tokenMetadataWithOnchain = async () => {   return await klardaSdk.getTokenMetadataWithOnchain({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getTokenMetadataProfile

Get profile metadata for a given token ID.


const tokenMetadataProfile = async () => {   return await klardaSdk.getTokenMetadataProfile({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getTokenMetadataFundraising

Get fundraising metadata for a given token ID.


const tokenMetadataFundraising = async () => {   return await klardaSdk.getTokenMetadataFundraising({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getTokenMetadataTokenomics

Get tokenomics metadata for a given token ID.


const tokenMetadataTokenomics = async () => {   return await klardaSdk.getTokenMetadataTokenomics({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',   }); };

getNftMetadata

Get metadata for a specific NFT.


const nftMetadata = async () => {   return await klardaSdk.getNftMetadata({     token_id: '1', // NFT token ID     address: '0xabefbc9fd2f806065b4f3c237d4b59d9a97bcac7', // NFT contract address     chain_id: 'eth', // Blockchain network   }); };

getNftHolders

Get the holders of a specific NFT.


const nftHolders = async () => {   return await klardaSdk.getNftHolders({     token_id: '1', // NFT token ID     address: '0xabefbc9fd2f806065b4f3c237d4b59d9a97bcac7', // NFT contract address     chain_id: 'eth', // Blockchain network   }); };

getExchangeListWithMetadata

Get a list of exchanges with metadata.


const exchangeListWithMetadata = async () => {   return await klardaSdk.getExchangeListWithMetadata({}); };

getExchangeBalanceDistribution

Get the balance distribution of an exchange.


const exchangeBalanceDistribution = async () => {   return await klardaSdk.getExchangeBalanceDistribution({}); };

getExchangeTokenAmount

Get the amount of a specific token on an exchange.


const exchangeTokenAmount = async () => {   return await klardaSdk.getExchangeTokenAmount({     token_id: '0xdac17f958d2ee523a2206206994597c13d831ec7',     exchange_id: 'binance',     chain_id: 'eth',   }); };

getWalletNativeBalance

Get the native balance of a wallet.


const walletNativeBalance = async () => {   return await klardaSdk.getWalletNativeBalance({     chain_id: 'eth',     address: '0x1234567890abcdef1234567890abcdef12345678',   }); };

getWalletNativeTransaction

Get native transactions of a wallet.


const walletNativeTransaction = async () => {   return await klardaSdk.getWalletNativeTransaction({     chain_id: 'eth',     address: '0x1234567890abcdef1234567890abcdef12345678',     page: 1,     limit: 50,   }); };

getWalletTransferTransaction

Get transfer transactions of a wallet.


const walletTransferTransaction = async () => {   return await klardaSdk.getWalletTransferTransaction({     chain_id: 'eth',     address: '0x1234567890abcdef1234567890abcdef12345678',     page: 1,     limit: 50,   }); };

getWalletTokenBalance

Get the token balance of a wallet.


const walletTokenBalance = async () => {   return await klardaSdk.getWalletTokenBalance({     chain_id: 'eth',     address: '0x1234567890abcdef1234567890abcdef12345678',   }); };

getListChains

Get the list of supported blockchain networks.


const listChains = async () => {   return await klardaSdk.getListChains(); };

getDeFiGrowthChart

Get the DeFi growth chart for a specific chain and duration.


const deFiGrowthChart = async () => {   return await klardaSdk.getDeFiGrowthChart({     duration: '30d', // Specify the duration (e.g., '30d' for 30 days)     chain_id: 'eth',   }); };

getMarketCapitalizationChart

Get the market capitalization chart for a specific chain and duration.


const marketCapitalizationChart = async () => {   return await klardaSdk.getMarketCapitalizationChart({     duration: '30d', // Specify the duration (e.g., '30d' for 30 days)     chain_id: 'eth',   }); };

getDailyActiveAddress

Get the daily active address count for a specific chain and duration.


const dailyActiveAddress = async () => {   return await klardaSdk.getDailyActiveAddress({     duration: '30d', // Specify the duration (e.g., '30d' for 30 days)     chain_id: 'eth',   }); };

getTransactionSignature

Get the transaction details by signature hash.


const transactionSignature = async () => {   return await klardaSdk.getTransactionSignature({     signature_hash: '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890',   }); };

getClosetTimestampToBlockNumber

Get the closest timestamp to a block number for a specific chain.


const closestTimestampToBlockNumber = async () => {   return await klardaSdk.getClosetTimestampToBlockNumber({     chain: 'eth',     timestamp: '1625097600', // Unix timestamp   }); };

getResearchReport

Get research reports.


const researchReport = async () => {   return await klardaSdk.getResearchReport({     page: 1,     limit: 10,   }); };

About API keys

Klarda is offering free access to Advanced API, however you have to register on Klarda platform to access it. Get your individual endpoint here https://docs.klarda.com/reference.