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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@upsideos/solana-rwa

v1.0.0

Published

A generated JavaScript client for Upside OS Solana RWA programs

Downloads

373

Readme

JavaScript Client

A Codama-generated JavaScript library for Upside OS Solana RWA programs.

Installation

npm install @upsideos/solana-rwa

Programs

This package includes clients for the following programs:

  • Access Control - Manage wallet roles, permissions, and security token operations
  • Transfer Restrictions - Enforce transfer rules between holder groups
  • Tokenlock - Create and manage time-locked token releases
  • Dividends - Distribute and claim dividends via merkle proofs

Getting Started

To build and test the JavaScript client from the root of the repository, you may use the following command:

pnpm clients:js:test

This will start a new local validator, if one is not already running, and run the tests for the JavaScript client.

Available Client Scripts

Alternatively, you can go into the client directory and run the scripts directly:

# Build your programs and start the validator
pnpm build
pnpm validator:restart

# Go into the client directory and run the tests
cd clients/js
pnpm install
pnpm build
pnpm test

You may also use the following scripts to lint and/or format your JavaScript client:

pnpm lint
pnpm lint:fix
pnpm format
pnpm format:fix

Usage Example

Recommended: Using Fetch Functions

import { createSolanaRpc } from '@solana/kit';
import {
  fetchAccessControl,
  fetchMaybeWalletRole
} from '@upsideos/solana-rwa';

// Create RPC connection
const rpc = createSolanaRpc(v);

// Compute PDA for access control account
const accessControlPda = '59mfBZPtvb64bVzXQHi8kLQoA2BmcuCD8GGa6rTKwbiM'; // Example PDA

// Fetch and decode access control account
const accessControl = await fetchAccessControl(rpc, accessControlPda);

// Access account data
console.log('Mint:', accessControl.data.mint);
console.log('Authority:', accessControl.data.authority);
console.log('Max Total Supply:', accessControl.data.maxTotalSupply);

// Fetch wallet role (returns MaybeAccount - check exists property)
const walletRolePda = '6ZNDXHtDQpG7Nz8po5otoXrPmCiMAMxsVLAr8Nc6XL95'; // Example PDA
const walletRole = await fetchMaybeWalletRole(rpc, walletRolePda);

if (walletRole.exists) {
  console.log('Wallet Role:', walletRole.data.role);
}

Building Instructions

The library provides generated functions for building Solana instructions. Here's an example of building a transfer restriction instruction:

import { address } from '@solana/kit';
import {
  getSetAddressPermissionInstructionAsync
} from '@upsideos/solana-rwa';

// Build a set address permission instruction
const instruction = await getSetAddressPermissionInstructionAsync(
  {
    securityAssociatedAccount: securityAssociatedAccountAddress,
    transferRestrictionGroupNew: groupNewAddress,
    transferRestrictionGroupCurrent: groupCurrentAddress,
    transferRestrictionHolder: transferRestrictionHolderAddress,
    holderGroupNew: holderGroupNewAddress,
    holderGroupCurrent: holderGroupCurrentAddress,
    securityToken: mint,
    userWallet: walletAddress,
    userAssociatedTokenAccount: walletAssociatedAccountAddress,
    authorityWalletRole: authorityWalletRoleAddress,
    securityMint: mint,
    accessControlAccount: accessControlHelper.accessControlPubkey!,
    accessControlProgram: ACCESS_CONTROL_PROGRAM_ID,
    payer: payerSigner,
    authority: authoritySigner,
    groupId: BigInt(groupId),
    frozen,
  },
  { programAddress: TRANSFER_RESTRICTIONS_PROGRAM_ID },
);

License

MIT