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

@mysten/pas

v0.0.2

Published

Permissioned Assets Standard SDK

Readme

@mysten/pas

TypeScript SDK for the Permissioned Assets Standard (PAS) on Sui.

PAS lets asset issuers define transfer policies that are enforced on-chain. The SDK handles policy resolution, account derivation, and transaction building so callers work with a simple intent-based API.

Installation

npm install @mysten/pas

Setup

The PAS client plugs into any Sui client via the $extend pattern:

import { SuiGrpcClient } from '@mysten/sui/grpc';
import { pas } from '@mysten/pas';

const client = new SuiGrpcClient({ network: 'testnet' }).$extend(pas());

The client auto-selects the correct on-chain package config for the connected network (mainnet or testnet). For custom deployments (e.g. during localnet / CI testing) you can pass a packageConfig explicitly:

const client = new SuiGrpcClient({ network: 'testnet' }).$extend(
	pas({
		packageConfig: {
			packageId: '0x...',
			namespaceId: '0x...',
		},
	}),
);

Reading data

Every PAS user has a deterministic Account address derived from their wallet address. You can derive it locally — no network call needed — and then use regular Sui queries against it:

const accountAddress = client.pas.deriveAccountAddress(ownerAddress);

Once you have the account address, use the standard core client to query balances, objects, or any other on-chain state:

const DEMO_USD = '0xabc...::demo_usd::DEMO_USD';

const [walletBalance, accountBalance] = await Promise.all([
	client.core.getBalance({ owner: ownerAddress, coinType: DEMO_USD }),
	client.core.getBalance({ owner: accountAddress, coinType: DEMO_USD }),
]);

Other derivation helpers are available for policies and templates:

const policyAddress = client.pas.derivePolicyAddress(assetType);
const templateRegistryAddress = client.pas.deriveTemplateRegistryAddress();

Writing transactions

Transactions use an intent-based API. You add intents to a Transaction and the SDK resolves them at build time — fetching policies, approval templates, and creating accounts as needed.

Transferring a permissioned asset

import { Transaction } from '@mysten/sui/transactions';

const DEMO_USD = '0xabc...::demo_usd::DEMO_USD';

const tx = new Transaction();
tx.add(
	client.pas.call.sendBalance({
		from: senderAddress, // The sender address (NOT the account address)
		to: recipientAddress, // the recipient wallet address. NOT the account address.
		amount: 1_000_000,
		assetType: DEMO_USD,
	}),
);

// .. sign and execute

Under the hood, sendBalance will:

  1. Derive the sender and recipient Account addresses.
  2. Create any accounts that don't exist yet.
  3. Fetch the issuer's Policy for the asset type and resolve the required approval template commands.
  4. Build the full PTB (auth, request, approvals, resolve) in a single transaction.

More resources