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

@vanterlabs/sdk

v0.1.3

Published

Vanter TypeScript SDK for Telegram authentication, auth code exchange, and agent transaction execution

Readme

@vanterlabs/sdk

TypeScript SDK for Vanter backend integrations.

This package wraps the Developer Docs auth flow into a single API surface:

  1. Build org-scoped authenticate URLs for your bot
  2. Exchange auth code + auto-provision wallets/roles/session
  3. Execute sponsored transactions with short-lived AGENT_JWT

Install

npm install @vanterlabs/sdk
pnpm add @vanterlabs/sdk
yarn add @vanterlabs/sdk
bun add @vanterlabs/sdk

Deno (npm compatibility):

import { VanterClient } from "npm:@vanterlabs/sdk";

Quickstart (TypeScript)

import {
  VanterClient,
  generateAgentKeypair,
  createSponsorExecuteJwtPair,
} from "@vanterlabs/sdk";

const client = new VanterClient({
  gatewayBaseUrl: "https://gateway.vanter.trade", // optional
  appBaseUrl: "https://app.vanter.trade", // optional
  accessKeyId: process.env.VANTER_ACCESS_KEY_ID!,
  accessKeySecret: process.env.VANTER_ACCESS_KEY_SECRET!,
});

// Step 1: share this URL from your bot
const authenticateUrl = client.createAuthenticateUrl({
  organizationId: process.env.VANTER_ORG_ID!,
});

// Step 2: exchange auth code and auto-provision in one call
const keys = await generateAgentKeypair();

const auth = await client.authenticate({
  organizationId: process.env.VANTER_ORG_ID!,
  authCode: process.env.AUTH_CODE!,
  agentPublicKeyBase64: keys.publicKeyBase64,
});

const sessionId = auth.session_id;
const walletId = auth.wallet_id ?? auth.agent_session.wallet_ids[0];
if (!walletId) {
  throw new Error("No wallet_id returned from authenticate");
}

// Optional: recover context later by app_user_id/provider_sub/user_id
const context = await client.resolveAuthenticationContext({
  organizationId: process.env.VANTER_ORG_ID!,
  appUserId: auth.app_user.id,
});

// Step 3: create EVM JWT pair and execute
const { bearerJwt, authorizationJwt } = await createSponsorExecuteJwtPair({
  appId: auth.app.id,
  sessionId,
  walletId,
  privateKeyHex: keys.privateKeyHex,
  ttlSeconds: 60,
});

const execution = await client.executeSponsoredTransaction({
  agentJwt: bearerJwt,
  authorizationJwt,
  walletId,
  chain: "Evm",
  chainId: 8453,
  deadline: Math.floor(Date.now() / 1000) + 120,
  calls: [{
    target: "0x1234567890abcdef1234567890abcdef12345678",
    value: "0",
    data: "0x",
  }],
});

console.log(authenticateUrl, context.session_id, execution);

Runtime Support

  • Node.js 18+
  • Bun 1+
  • Deno 2+ (npm: imports)

The SDK uses fetch, TextEncoder, and WebCrypto-compatible APIs.

Security Notes

  • Keep accessKeySecret and agent private keys server-side only.
  • Do not embed SDK credentials in browser code.
  • Keep AGENT_JWT short-lived and use fresh jti values per request.

API Surface

new VanterClient(options)

  • accessKeyId (required)
  • accessKeySecret (required)
  • gatewayBaseUrl (optional, default https://gateway.vanter.trade)
  • appBaseUrl (optional, default https://app.vanter.trade)
  • fetch (optional override)

client.createAuthenticateUrl({ organizationId })

Returns https://app.vanter.trade/authenticate/o/:organization_id by default.

client.authenticate({ ... })

Calls POST /api/integrations/:organization_id/authenticate/claim.

By default, provisioning uses the app-level supported_chains and onboarding_role_templates configured in Developer Portal. You can still pass chains and roleTemplates to override per-request when needed.

Returns auth tokens and provisioned/reused context including:

  • wallet_id
  • session_id
  • agent_session
  • wallets
  • roles
  • provisioning.status (new_user or returning_user)

client.resolveAuthenticationContext({ ... })

Calls GET /api/integrations/:organization_id/authenticate/context.

Use this to recover wallet_id and session_id later by appUserId, userId, or providerSub.

client.executeSponsoredTransaction({ ... })

Calls POST /api/integrations/agent/sponsor-execute with app access-key headers and AGENT_JWT bearer token.

For chain: "Evm", also pass a distinct authorizationJwt (different jti) alongside agentJwt.

generateAgentKeypair()

Returns raw Ed25519 keypair in multiple encodings:

  • privateKeyHex
  • privateKeyRawBase64
  • publicKeyBase64

createAgentJwt({ ... })

Creates EdDSA JWT with required claims:

  • app_id
  • session_id
  • wallet_id
  • iat, exp, jti

createSponsorExecuteJwtPair({ ... })

Returns two distinct JWTs (bearerJwt, authorizationJwt) for flows requiring dual-token EVM sponsor-execute auth.

createEvmSponsorExecuteJwtPair({ ... }) (deprecated)

Backward-compatible alias for createSponsorExecuteJwtPair({ ... }).