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

@0xintuition/sdk

v2.0.2

Published

Intuition SDK

Readme

Intuition SDK

This Intuition SDK simplifies development with the Intuition backend systems.

Version Downloads/week

Install

npm install 0xintuition/sdk
pnpm install 0xintuition/sdk
bun install 0xintuition/sdk

Usage

The Intuition SDK simplifies reads and writes to the Intuition backend systems, allowing developers to create and manage Atoms and Triples with ease.

The SDK requires [email protected] to execute reads and writes.

import {
  getMultiVaultAddressFromChainId,
  intuitionTestnet,
} from '@0xintuition/protocol'

import {
  createPublicClient,
  createWalletClient,
  http,
  privateKeyToAccount,
} from 'viem'

export const address = getMultiVaultAddressFromChainId(intuitionTestnet.id)

export const publicClient = createPublicClient({
  chain: intuitionTestnet,
  transport: http(),
})

const account = privateKeyToAccount(
  '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',
)
export const walletClient = createWalletClient({
  chain: intuitionTestnet,
  transport: http(),
  account: account,
})

Reads

import { getAtomDetails, getTripleDetails } from '@0xintuition/sdk'

const atomData = await getAtomDetails(
  '0x57d94c116a33bb460428eced262b7ae2ec6f865e7aceef6357cec3d034e8ea21',
)

const tripleData = await getTripleDetails(
  '0x4957d3f442acc301ad71e73f26efd6af78647f57dacf2b3a686d91fa773fe0b6',
)

Atoms

Calculate Atom ID

import { calculateAtomId } from '@0xintuition/sdk'

const atomId = calculateAtomId(
  'ipfs://bafkreib7534cszxn2c6qwoviv43sqh244yfrxomjbealjdwntd6a7atq6u',
)

Create Triple Statement

// Example of creating a triple statement with three atoms
const atom1 = await createAtomFromString(
  { walletClient, publicClient, address },
  'atom1',
)
const atom2 = await createAtomFromString(
  { walletClient, publicClient, address },
  'atom2',
)
const atom3 = await createAtomFromString(
  { walletClient, publicClient, address },
  'atom3',
)

const triple = await createTripleStatement(
  { walletClient, publicClient, address },
  {
    args: [atom1.state.termId, atom2.state.termId, atom3.state.termId],
    value: 1000000000000000000n, // 1 ETH in wei for deposit
  },
)

Create Atom from String

import { createAtomFromString } from '@0xintuition/sdk'

const data = await createAtomFromString(
  { walletClient, publicClient, address },
  'is great',
)

Create Atom from IPFS Upload

import { createAtomFromIpfsUpload } from '@0xintuition/sdk'

const data = await createAtomFromIpfsUpload(
  {
    walletClient,
    publicClient,
    address,
    pinataApiKey: 'your-pinata-api-key',
  },
  {
    url: 'https://www.intuition.systems/',
    name: 'Intuition',
    description: 'A decentralized trust protocol',
    image: 'https://example.com/image.png',
    tags: ['decentralized', 'trust', 'protocol'],
    twitter: 'https://twitter.com/intuition_systems',
    github: 'github.com/intuition-systems',
  },
)

Create a Thing

import { createAtomFromThing } from '@0xintuition/sdk'

const data = await createAtomFromThing(
  { walletClient, publicClient, address },
  {
    url: 'https://www.intuition.systems/',
    name: 'Intuition',
    description: 'A decentralized trust protocol',
    image: 'https://example.com/image.png',
  },
)

Create an Ethereum Account

import { createAtomFromEthereumAccount } from '@0xintuition/sdk'

const data = await createAtomFromEthereumAccount(
  { walletClient, publicClient, address },
  {
    address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
    chainId: 1, // Mainnet
  },
)

After successfully creating a new Atom the SDK will return a data object containing the uri, transaction hash and other relevant state.

const data: {
    uri: string
    transactionHash: `0x${string}`;
    state: {
        creator: Address,
        termId: Hex,
        atomData: Hex,
        atomWallet: Address
    };
}

Triples

Calculate Triple ID

import { calculateTripleId } from '@0xintuition/sdk'

const tripleId = calculateTripleId('0x1234', '0x5678', '0x9abc')

Calculate Counter Triple ID

import { calculateCounterTripleId, calculateTripleId } from '@0xintuition/sdk'

// First, calculate the original triple ID
const tripleId = calculateTripleId('0x1234', '0x5678', '0x9abc')

// Then, calculate the counter triple ID using the original triple ID
const counterTripleId = calculateCounterTripleId(tripleId)

Create Triple Statement

import { createAtomFromString, createTripleStatement } from '@0xintuition/sdk'

// Example of creating a triple statement with three atoms
const atom1 = await createAtomFromString(
  { walletClient, publicClient, address: multivaultAddress },
  'atom1',
)
const atom2 = await createAtomFromString(
  { walletClient, publicClient, address: multivaultAddress },
  'atom2',
)
const atom3 = await createAtomFromString(
  { walletClient, publicClient, address: multivaultAddress },
  'atom3',
)

const triple = await createTripleStatement(
  { walletClient, publicClient, address: multivaultAddress },
  {
    args: [atom1.state.vaultId, atom2.state.vaultId, atom3.state.vaultId],
  },
)

React Example

import * as React from 'react'

import {
  createAtomFromThing,
  getMultiVaultAddressFromChainId,
} from '@0xintuition/sdk'

import { useChainId, usePublicClient, useWalletClient } from 'wagmi'

type IntuitionButton = React.HTMLAttributes<HTMLElement>

const IntuitionButton = ({ children, className }: IntuitionButton) => {
  const chainId = useChainId()
  const publicClient = usePublicClient()
  const { data: walletClient } = useWalletClient()

  const handleClick = async () => {
    const multiVaultAddress = getMultiVaultAddressFromChainId(chainId)
    const data = await createAtomFromThing(
      { walletClient, publicClient, address: multiVaultAddress },
      {
        url: 'https://www.intuition.systems/',
        name: 'Intuition',
        description: 'A decentralized trust protocol.',
        image: 'https://example.com/image.png',
      },
    )
  }

  return <button onClick={handleClick}>Create Thing</button>
}

export { IntuitionButton }

Development

Building

Run pnpm build to build the library.

Running unit tests

Run pnpm test to execute the unit tests

Contributing

Contributions are welcome! Please see the main repository for more information on how to contribute.

License

This project is licensed under the MIT License.