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

@altananetwork/sdk

v0.9.0

Published

TypeScript SDK for creating non-custodial smart agentic wallets with on-chain session-key delegation.

Readme

@altananetwork/sdk

TypeScript SDK for creating non-custodial smart agentic wallets with on-chain session-key delegation.

npm install @altananetwork/sdk viem

Quick start

Create a client for the chains you want. Pass one L1 or several: the same wallet address works on every chain you configure.

import { createClient, ETHEREUM, BNB } from "@altananetwork/sdk";

// Both L1s, or just one, your choice.
const client = createClient({ chains: [ETHEREUM, BNB] });

Passkey wallet (browser)

const wallet = await client.createPasskeyWallet({ name: "My Agent Wallet" });

Private-key wallet (server / agent)

import { signerFromPrivateKey } from "@altananetwork/sdk";

const signer = signerFromPrivateKey(process.env.PRIVATE_KEY);
const wallet = await client.createWallet({ signer });

Grant a session and execute

Operations take an optional chainId (defaults to the client's first chain):

const session = await client.grantSession({
  wallet,
  signer,
  permissions: {
    calls: [{ to: "0x…" }],
    spend: [{ limit: 1_000_000n, period: "day" }], // 1 USDC/day
  },
  expiry: Math.floor(Date.now() / 1000) + 60 * 60, // 1 hour
});

await client.execute({
  session,
  chainId: 56, // BNB Smart Chain; omit to use the default chain
  calls: [{ to: "0x…", value: 0n, data: "0x…" }],
});

Pay for an API with x402

A session key can pay for HTTP resources via the x402 standard (Permit2 or EIP-3009 rails), settled on-chain from the smart wallet. Provision once, then pay transparently:

import { PERMIT2_ADDRESS } from "@altananetwork/sdk";

// One-time, as admin (permit2 rail):
await client.approveTokenForPermit2({ wallet, signer, token: "0xUSDC…" });
await client.approveSignatureChecker({ wallet, signer, session, checker: PERMIT2_ADDRESS });

// The agent pays + fetches (server-side):
const res = await client.fetchWithX402({ session, url: "https://api.example.com/paid" });

Payments are authorized with the account's ERC-1271 signature. See Off-chain signatures.

Hire another agent (ERC-8183)

Agents can hire and pay each other for work. hireErc8183Agent runs the whole buyer flow (create, register, budget, approve, fund) as one atomic relay intent, and returns once the job is funded on-chain.

import { hireErc8183Agent, getErc8183Job, BNB } from "@altananetwork/sdk";

const { jobId } = await hireErc8183Agent(session, {
  provider: "0xSellerAgentAddress",
  task: "Audit wallet 0x…'s Venus position and recommend an action.",
  budget: 100_000_000_000_000_000n, // 0.1 $U (18 decimals)
}, { network: BNB });

const job = await getErc8183Job(BNB, jobId); // OPEN, FUNDED, SUBMITTED, COMPLETED

The admin path is hireErc8183Agent(wallet, signer, params, opts). Using the session path instead means a scoped key with an on-chain spend limit caps what an autonomous agent can ever escrow. settleErc8183Job approves or disputes on delivery, and buildClaimRefundCall recovers the budget if nothing arrives.

Full reference: ERC-8183 agent jobs.

Give an agent an identity (ERC-8004)

Buyers find sellers through the ERC-8004 identity registry. An agent can mint and maintain its own entry with a session key scoped to just those two calls — erc8004RegisterPermissions grants register and setAgentURI on the registry and nothing else, so a compromised session cannot transfer the identity away or approve an operator that outlives its revocation.

import {
  erc8004RegisterPermissions,
  registerErc8004Agent,
  setErc8004AgentUri,
  encodeErc8004AgentUri,
  withErc8004Registration,
  BNB,
} from "@altananetwork/sdk";

// Grant: permissions: { calls: erc8004RegisterPermissions(56), spend: [...] }

const record = {
  type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
  name: "Vault Sentinel",
  description: "Watches Venus positions.",
  services: [{ name: "A2A", endpoint: "https://sentinel.example/.well-known/agent-card.json" }],
  registrations: [], // the id does not exist until the mint assigns it
} as const;

const { agentId } = await registerErc8004Agent(
  session,
  { agentUri: encodeErc8004AgentUri(record) },
  { network: BNB },
);

await setErc8004AgentUri(
  session,
  { agentId, agentUri: encodeErc8004AgentUri(withErc8004Registration(record, agentId, 56)) },
  { network: BNB },
);

Registration is two-phase because the record embeds the id the mint assigns. getErc8004Agent(BNB, agentId) reads the owner and record back — persist the agentId, as the registry has no reverse lookup.

Full reference: ERC-8004 agent identity.

Documentation

Full docs, concept guides, and SDK reference: docs.altana.network.

Source: github.com/altananetwork/altana-sdk.

License

Apache-2.0