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

odin-connect

v1.2.1

Published

`npm i odin-connect`

Readme

OdinConnect

Installation

npm i odin-connect

Demo

This repository includes a demo. See /demo folder

To run it, simply do npm run demo

Examples

Initializing new instance

Instantiate the OdinConnect class with some information about your application

  • name - Name of your app
  • env - Odin Environment. Accepted values: prod, dev, local. Default: prod.
const odinConnect = new OdinConnect({ name: "Demo App", env: "prod" });

Request for user connection

const user = await odinConnect.connect({
  // these will be used when window.open is called
  open: {
    target: "_blank",
    settings: "height=800,width=400",
  },
  // flag to determine if api key is being requested
  requires_api: true,
  // flag ot determine if DelegationChain is being requested
  requires_delegation: false,
});

Request for Identity

const user = await odinConnect.connect({
  // set to true
  requires_delegation: true,
  // canister ids
  targets: ["aaaa-aa"],
});
const identity = user.getIdentity();

Request for various user data from API

// get balances
const balances = await user.getBalances({ page: 1, limit: 10 });
// get tokens
const tokens = await user.getTokens({ page: 1, limit: 10 });
// get created tokens
const createdTokens = await user.getCreatedTokens({ page: 1, limit: 10 });
// get liquidity
const liquidity = await user.getLiquidity({ page: 1, limit: 10 });
// get activity
const activity = await user.getActivity({ page: 1, limit: 10 });
// get achievements
const achievements = await user.getAchievements({ page: 1, limit: 10 });
// get transactions
const transactions = await user.getTransactions({ page: 1, limit: 10 });

Request for token transfer

await odinConnect.transfer({
  principal: "veyov-kjgrf-hke6v-6d63i-sdwae-oldgg-huau6-ke5g3-rllp2-5jhca-uqe",
  destination:
    "vv5jb-7sm7u-vn3nq-6nflf-dghis-fd7ji-cx764-xunni-zosog-eqvpw-oae",
  token: "2jjj",
  amount: 20_000_000n, // 20K sats in millisats
});

Request for buy authorization

const user = await odinConnect.connect();
await user.buy({
  btcAmount: 10_000_000n,
  token: "2jjj",
});

Request for sell authorization

const user = await odinConnect.connect();
await user.sell({
  tokenAmount: 20_000_000n,
  token: "2jjj",
});

Request for add liquidity authorization

const user = await odinConnect.connect();
await user.addLiquidity({
  btcAmount: 20_000_000n,
  token: "2jj",
});

Request for remove liquidity authorization

const user = await odinConnect.connect();
await user.removeLiquidity({
  btcAmount: 20_000_000n,
  token: "2jj",
});

Request for creating new token

Note: require_api must be set set to true

const user = await odinConnect.connect({ requires_api: true });
await user.createToken({
  image: file, // instance of a file
  principal: "veyov-kjgrf-hke6v-6d63i-sdwae-oldgg-huau6-ke5g3-rllp2-5jhca-uqe",
  name: "Test Token",
  ticker: "TEST",
  description: "Test Description", // optional
  website: "http://test-website.com", // optional
  telegram: "", // optional
  twitter: "", // optional
  buy: 20_000_000n, // 20K sats
  discount: "",
});

API Methods

// Get tokens
const tokens = await odin.api.getTokens(
  {
    page: 1,
    limit: 10,
  },
  {
    field: "marketcap",
    direction: "desc",
  },
  {
    marketcap_min: 100000000n, // in millisats
  }
);

// Get activities
const activity = await odinConnect.api.getUserActivity({
  pagination: { page: 1, limit: 10 },
});

// Get token by id
const token = await odinConnect.api.getToken("2jjj");

// Get user data by id
const user = await odinConnect.api.getUser(
  "veyov-kjgrf-hke6v-6d63i-sdwae-oldgg-huau6-ke5g3-rllp2-5jhca-uqe"
);

// Get user balance by user id
const balances = await odinConnect.api.getBalances(
  "veyov-kjgrf-hke6v-6d63i-sdwae-oldgg-huau6-ke5g3-rllp2-5jhca-uqe",
  { page: 1, limit: 20 }
);

// Get activities by  user id
const activity = await odinConnect.api.getUserActivity(
  "veyov-kjgrf-hke6v-6d63i-sdwae-oldgg-huau6-ke5g3-rllp2-5jhca-uqe",
  { page: 1, limit: 10 }
);

// Get transactions by user id
const transactions = await odinConnecct.api.getUserTransactions(
  "veyov-kjgrf-hke6v-6d63i-sdwae-oldgg-huau6-ke5g3-rllp2-5jhca-uqe",
  {
    page: 1,
    limit: 10,
  }
);

// Get user stats
const stats = await odin.api.getUserStats(
  "veyov-kjgrf-hke6v-6d63i-sdwae-oldgg-huau6-ke5g3-rllp2-5jhca-uqe"
);

General Notes

  • BTC amounts are in millisatoshis