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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@accret/api-client

v1.0.5

Published

A comprehensive SDK for blockchain data access via Moralis, Alchemy, and Shyft APIs

Readme

Accret API SDK

This SDK provides a unified interface for interacting with EVM and Solana wallets and tokens. All major functions accept a universal input structure and return a standardized response.

Installation

npm install @accret/api-client
# or
yarn add @accret/api-client
# or
bun add @accret/api-client

Usage

Using the AccretClient class

import { AccretClient } from "@accret/api-client";

const client = new AccretClient();
await client.configure({
  alchemyApiKey: "YOUR_ALCHEMY_API_KEY",
  moralisApiKey: "YOUR_MORALIS_API_KEY",
  shyftApiKey: "YOUR_SHYFT_API_KEY",
  heliusApiKey: "YOUR_HELIUS_API_KEY",
});

// Example: Get token metadata
const tokenMetadata = await client.getTokenMetadata([
  { address: "0x...", chainId: client.AccretSupportedChain.ETHEREUM_CHAIN },
]);

// Example: Get token price
const tokenPrice = await client.getTokenPrice([
  { address: "0x...", chainId: client.AccretSupportedChain.ETHEREUM_CHAIN },
]);

// Example: Get tokens for wallet
const tokensForWallet = await client.getTokensForWallet([
  { address: "0x...", chainId: client.AccretSupportedChain.ETHEREUM_CHAIN },
  { address: "...", chainId: client.AccretSupportedChain.SOLANA_CHAIN },
]);

// Example: Get transaction history
const txHistory = await client.getTransactionHistory([
  { address: "0x...", chainId: client.AccretSupportedChain.ETHEREUM_CHAIN },
]);

// Example: Get historical token price
const historicalPrice = await client.getHistoricalTokenPrice([
  {
    address: "0x...",
    chainId: client.AccretSupportedChain.ETHEREUM_CHAIN,
    startTime: "2024-01-01T00:00:00Z",
    endTime: "2024-01-31T23:59:59Z",
    interval: client.HistoricalPriceInterval.DAILY,
  },
]);

Universal Input Types

Token/Wallet Input

{
  address: string; // wallet or token address
  chainId: AccretSupportedChain; // enum value for supported chains
}

Historical Price Input

{
  address: string;
  chainId: AccretSupportedChain;
  startTime: string; // ISO date string
  endTime: string; // ISO date string
  interval: HistoricalPriceInterval; // e.g., DAILY, HOURLY
}

AccretSupportedChain Enum

| Enum Name | Chain ID | | --------------- | -------------- | | ETHEREUM_CHAIN | eip155:1 | | BNB_CHAIN | eip155:56 | | POLYGON_CHAIN | eip155:137 | | BASE_CHAIN | eip155:8453 | | ARBITRUM_CHAIN | eip155:42161 | | AVALANCHE_CHAIN | eip155:43114 | | SOLANA_CHAIN | solana:501 |

Available Functions

  • Get tokens held by one or more wallets across supported chains.
    getTokensForWallet(addresses: {
      address: string,
      chainId: AccretSupportedChain
    }[])
  • Get transaction history for one or more wallets.
    getTransactionHistory(addresses: {
      address: string,
      chainId: AccretSupportedChain
    }[])
  • Get metadata for one or more tokens.
    getTokenMetadata(addresses: {
      address: string,
      chainId: AccretSupportedChain
    }[])
  • Get current price for one or more tokens.
    getTokenPrice(addresses: {
      address: string,
      chainId: AccretSupportedChain
    }[])
  • Get historical price data for one or more tokens.
    getHistoricalTokenPrice(addresses: {
      address: string,
      chainId: AccretSupportedChain,
      startTime: string,
      endTime: string,
      interval: HistoricalPriceInterval
    }[])
  • Get the Accret-supported chain identifier for a given chain/network.
    getAccretSupportedChain({ chain });
  • Get chain identifiers for a given Accret-supported chain.
    getChainIdentifiers({ chain });

API Keys Required

To use this SDK, you'll need API keys from:

  • Alchemy (EVM data)
  • Moralis (EVM data)
  • Shyft (Solana data)
  • Helius (Solana data)

These must be provided when initializing the AccretClient.

License

MIT