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

eraswap-sdk

v3.0.6

Published

Typechain outputs of esn-contracts and utils. Commit tag of KMPARDS/esn-contracts is included in the version.

Downloads

3

Readme

Era Swap SDK

This kit is intended to make it convenient to access to addresses of smart contracts related to Era Swap and common utilities.

$ yarn add eraswap-sdk@latest

or

$ npm i eraswap-sdk@latest

Please note that Era Swap SDK requires that you are using TypeScript 3.8+

addresses bucket: Accessing Contract Addresses

import { es } from 'eraswap-sdk';

// Get the testing address
const timeallyAddressTesting = es.addresses['development'].ESN.timeallyManager;

// Get the mainnet address
const timeallyAddressMainnet = es.addresses['production'].ESN.timeallyManager;

You can use a env variable to easily switch between testnet and mainnet deployments.

CustomProvider

Custom provider is a modification of ethers.js's JsonRpcProvider with Kyc Dapp integrated and better errors

import { es } from 'eraswap-sdk';

// for mainnet
const providerESN = new es.CustomProvider('mainnet');

// for testnet
const providerESN = new es.CustomProvider('testnet');

// or (a preferrable way)

import { CustomProvider } from 'eraswap-sdk';

const providerESN = new CustomProvider('testnet');

typechain bucket: Accessing Contract Typings

import { es } from 'eraswap-sdk';

const timeallyInstance = es.typechain.ESN.TimeAllyManagerFactory.connect(
  es.addresses[process.env.NODE_ENV].ESN.timeallyManager,
  providerESN
);

// another (preferrable) way to import

import { PlasmaManagerFactory } from 'eraswap-sdk/dist/typechain/ETH';
import { TimeAllyManagerFactory } from 'eraswap-sdk/dist/typechain/ESN';

const timeallyInstance = TimeAllyManagerFactory.connect(
  es.addresses[process.env.NODE_ENV].ESN.timeallyManager,
  providerESN
);

General Utils

Parsing Ethers.js errors.

Errors in v5 have gotten ugly lately. See ethers-io/ethers.js#871. This

import { es } from 'eraswap-sdk';

try {
  await contract.methodThatThrowError();
} catch (error) {
  const readableError = es.utils.parseEthersJsError(error); // string
  setDisplayMessage(`Error: ${readableError}`);
}

Getting Era Swap Explorer url

import { es } from 'eraswap-sdk';

const url = es.utils.EraswapInfo.getAddressHref(
  '0xC8e1F3B9a0CdFceF9fFd2343B943989A22517b26'
);
// returns: https://eraswap.info/address/0xC8e1F3B9a0CdFceF9fFd2343B943989A22517b26

const url = es.utils.EraswapInfo.getTxHref(
  '0x200706e0608bec9ad2993b6659df036062e8fbbdc9cc61bd52c61ab106a48f44'
);
// returns: https://eraswap.info/txn/0x200706e0608bec9ad2993b6659df036062e8fbbdc9cc61bd52c61ab106a48f44

License

MIT