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

adryx-sdk

v0.1.3

Published

TypeScript SDK for interacting with Celo Health contracts

Readme

celo-health-sdk

TypeScript SDK for interacting with Celo Health contracts on the Celo blockchain.

Installation

npm install celo-health-sdk

Quick start

import {
  createCeloHealthConfig,
  fetchBlockNumber,
  fetchCeloBalance,
  fetchPatientRecordCount,
  formatCelo,
} from 'celo-health-sdk';

const config = createCeloHealthConfig({
  network: 'celo',
  contractAddress: '0x209c0138c80C60a570333D03b980e1cA22880fE1',
});

const blockNumber = await fetchBlockNumber(config);
console.log(`Current block: ${blockNumber}`);

const balanceWei = await fetchCeloBalance(
  config,
  '0xA8D9d84f838c72e5e02717Ee7c3B36b4528a86e3',
);
console.log(`Balance: ${formatCelo(balanceWei)}`);

const patientCount = await fetchPatientRecordCount(config);
console.log(`Patient records: ${patientCount}`);

API

createCeloHealthConfig(options)

Creates a resolved config object required by all SDK functions.

const config = createCeloHealthConfig({
  network: 'celo', // 'celo' | 'celo-sepolia'
  contractAddress: '0x...',
  rpcUrl: 'https://...', // optional
});

Contract functions

| Function | Description | |---|---| | fetchBlockNumber(config) | Get the current Celo block number | | fetchCeloBalance(config, address) | Get account CELO balance in wei | | fetchErc20Balance(config, tokenAddress, account) | Get ERC-20 token balance | | fetchPatientRecordCount(config) | Read patientRecordCount() from health contract | | fetchHospitalCount(config) | Read hospitalCount() from health contract | | readContract(config, abi, functionName, args) | Generic read-only contract call |

Utilities

import {
  weiToCelo,
  celoToWei,
  truncateAddress,
  formatCelo,
  formatDuration,
} from 'celo-health-sdk';

weiToCelo(1_000_000_000_000_000_000n); // 1
celoToWei(1);                            // 1000000000000000000n
truncateAddress('0xA8D9...86e3', 6);     // '0xA8D9…8a86e3'
formatCelo(1_500_000_000_000_000_000n);  // '1.5 CELO'
formatDuration(12);                      // '1 minute'

Constants

import { MS_PER_BLOCK, BLOCKS_PER_DAY, BLOCKS_PER_WEEK } from 'celo-health-sdk';

| Constant | Value | Description | |---|---|---| | MS_PER_BLOCK | 5_000 | Milliseconds per Celo block | | BLOCKS_PER_DAY | 17_280 | ~1 day | | BLOCKS_PER_WEEK | 120_960 | ~1 week | | BLOCKS_PER_MONTH | 518_400 | ~1 month | | BLOCKS_PER_YEAR | 6_307_200 | ~1 year |

License

MIT