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

your-stable-sdk

v0.2.0

Published

A TypeScript SDK for interacting with the your-stable contract

Readme

Your Stable SDK

Overview

The Your Stable SDK provides a set of functions for interacting with Your Stable contracts, allowing developers to:

  • Create a factory for Your Stable coins
  • Mint Your Stable coins with supported stablecoins (e.g., USDC)
  • Burn Your Stable coins to redeem underlying assets
  • Claim rewards
  • Manage factory settings and limits
  • Update metadata for Your Stable coins

Installation

npm install your-stable-sdk
# or
yarn add your-stable-sdk

Usage Examples

Initialize Sui Client

import { getFullnodeUrl, SuiClient } from "@mysten/sui/client";

const suiClient = new SuiClient({ url: getFullnodeUrl("mainnet") });

Create a Factory

import { Transaction } from "@mysten/sui/transactions";
import { YourStableClient, phantom, dryRun } from "your-stable-sdk";

async function createFactory() {
  const signer = loadSigner();
  const tx = new Transaction();

  // input your config
  const config = {
    // yourStable coinType
    yourStableCoinType: "0x26c842736665d461bd9a73c7a11ac69d64ec14015fdb5fd8f3c04c881a993f6a::jusd::JUSD",
    // yourStable treasuryCapId
    treasuryCapId: "0x82004b20e7d6b78eceeb61fc69d2c3e5a10a9e4448d37a2876e67fe5059741ce",
    // metadata for yourStable
    metadataObjectId: "0x9aa8e18af0d91d6be64c9478ad6ef01e513720664b816545aed79071014a2d62",
    // supply limit for yourStable 
    supplyLimit: BigInt(10000 * 10 ** YourStableClient.underlyingDecimal),
  };

  const [factory, factoryCap] = YourStableClient.createFactoryMoveCall(
    tx,
    config.yourStableCoinType,
    config.treasuryCapId,
    config.metadataObjectId,
    config.supplyLimit,
  );

  // Make factory a shared object; or converting to owned/wrapped object as you wish
  const factoryType = Factory.r(
    phantom(config.yourStableCoinType),
  ).fullTypeName;
  tx.moveCall({
    target: "0x2::transfer::public_share_object",
    typeArguments: [factoryType],
    arguments: [factory],
  });

  // Transfer factory cap to recipient
  tx.transferObjects([factoryCap], signer.toSuiAddress());

  // Execute transaction
  const response = await suiClient.signAndExecuteTransaction({
    transaction: tx,
    signer,
  });
}

Mint Your Stable Coins

import { COIN_TYPE_LIST } from "your-stable-sdk";

async function mintYourStable() {
  const signer = loadSigner();
  const yourStableCoinType = "0x26c842736665d461bd9a73c7a11ac69d64ec14015fdb5fd8f3c04c881a993f6a::jusd::JUSD";
  
  // Initialize factory
  const factory = await YourStableClient.initialize(
    suiClient,
    yourStableCoinType,
  );

  const tx = new Transaction();
  // Mint 0.01 USDC worth of Your Stable
  const depositedAmount = 0.01 * 10 ** 6;
  const usdcCoin = await getInputCoins(
    tx,
    suiClient,
    signer.toSuiAddress(),
    COIN_TYPE_LIST.USDC,
    BigInt(depositedAmount),
  );
  
  // Mint Your Stable coins
  const yourStableCoin = factory.mintYourStableMoveCall(
    tx,
    COIN_TYPE_LIST.USDC,
    usdcCoin,
  );

  tx.transferObjects([yourStableCoin], signer.toSuiAddress());

  // Execute transaction
  const response = await suiClient.signAndExecuteTransaction({
    transaction: tx,
    signer,
  });
}

Burn Your Stable Coins

async function burnYourStable() {
  const signer = loadSigner();
  const yourStableCoinType = "0x26c842736665d461bd9a73c7a11ac69d64ec14015fdb5fd8f3c04c881a993f6a::jusd::JUSD";
  
  const factory = await YourStableClient.initialize(
    suiClient,
    yourStableCoinType,
  );

  const tx = new Transaction();
  // Burn 0.01 Your Stable
  const burnedAmount = 0.01 * 10 ** YourStableClient.underlyingDecimal;
  const yourStableCoin = await getInputCoins(
    tx,
    suiClient,
    signer.toSuiAddress(),
    yourStableCoinType,
    BigInt(burnedAmount),
  );
  
  // Burn and receive USDC
  const buckCoin = factory.burnYourStableMoveCall(tx, yourStableCoin, "USDC");

  tx.transferObjects([buckCoin], signer.toSuiAddress());

  const response = await suiClient.signAndExecuteTransaction({
    transaction: tx,
    signer,
  });
}

Claim Rewards

async function claimReward() {
  const signer = loadSigner();
  const yourStableCoinType = "0x26c842736665d461bd9a73c7a11ac69d64ec14015fdb5fd8f3c04c881a993f6a::jusd::JUSD";
  
  const factory = await YourStableClient.initialize(
    suiClient,
    yourStableCoinType,
  );

  const tx = new Transaction();
  const stsBuckCoin = factory.claimRewardMoveCall(tx);
  tx.transferObjects([stsBuckCoin], signer.toSuiAddress());

  const response = await suiClient.signAndExecuteTransaction({
    transaction: tx,
    signer,
  });
}

Update Metadata

async function updateMetadata() {
  const signer = loadSigner();
  const yourStableCoinType = "0x26c842736665d461bd9a73c7a11ac69d64ec14015fdb5fd8f3c04c881a993f6a::jusd::JUSD";
  
  const factory = await YourStableClient.initialize(
    suiClient,
    yourStableCoinType,
  );

  const tx = new Transaction();
  const metadataObjectId = "0x9aa8e18af0d91d6be64c9478ad6ef01e513720664b816545aed79071014a2d62";
  
  factory.updateMetadataMoveCall(tx, metadataObjectId, {
    iconUrl: "data:image/svg+xml;base64,PHN2Z...",
  });

  const response = await suiClient.signAndExecuteTransaction({
    transaction: tx,
    signer,
  });
}

Get Factory Information

  const yourStableCoinType =
    "0x26c842736665d461bd9a73c7a11ac69d64ec14015fdb5fd8f3c04c881a993f6a::jusd::JUSD";

  // create Factory instance
  const factory = await YourStableClient.initialize(
    suiClient,
    yourStableCoinType,
  );

  const yourStableTotalSupply =
    Number(await factory.getYourStableTotalSupply()) / 10 ** 9;
  const yourStableBasicSupply =
    Number(await factory.getYourStableBasicSupply()) / 10 ** 9;
  const yourStableExtensionSupplies =
    await factory.getYourStableExtensionSupplies();
  const underlyingSTSBUCKBalance = Number(
    factory.getUnderlyingSTSBUCKBalance(),
  );
  const underlyingSTSBUCKReserve =
    Number(await factory.getUnderlyingSTSBuckReserve()) / 10 ** 9;
  const rewardSTSBuckAmount =
    Number(await factory.getRewardsSTSBuckAmount()) / 10 ** 9;
  const rewardsBuckAmount =
    Number(await factory.getRewardsBuckAmount()) / 10 ** 9;
  const quotedBuckFromUnderlyingSTSBuckBalance =
    Number(
      await YourStableClient.getQuotedStableCoinAmountByStSBuckAmount(
        suiClient,
        BigInt(underlyingSTSBUCKBalance),
      ),
    ) /
    10 ** 9;
  const tickets = await YourStableClient.getTicketInfos(suiClient, "USDC", 100);

  logger.info({
    yourStableTotalSupply,
    yourStableBasicSupply,
    yourStableExtensionSupplies,
    underlyingSTSBUCKBalance,
    underlyingSTSBUCKReserve,
    rewardSTSBuckAmount,
    rewardsBuckAmount,
    quotedBuckFromUnderlyingSTSBuckBalance,
    tickets,
  });

Additional Features

  • Batch Redeem: Redeem multiple stablecoins at once
  • Set Basic Limit: Update the basic supply limit for Your Stable coins
  • Burn and Redeem: Combined operation to burn Your Stable and redeem a specific amount

Dry Run Support

The SDK supports dry running transactions before submitting them:

const dryRunResponse = await dryRun(suiClient, tx, signer.toSuiAddress());

if (dryRunResponse.dryrunRes.effects.status.status === "success") {
  const response = await suiClient.signAndExecuteTransaction({
    transaction: tx,
    signer,
  });
} else {
  console.error(dryRunResponse.dryrunRes.effects.status.error);
}

⚠️ Important: Package ID Updates

Warning: Static utility functions may not track the latest package ID automatically.

When using static utility functions such as:

  • getQuotedStSBuckAmountByStableCoinAmount
  • batchRedeem

These functions are exported as static methods for external usage convenience, but they will not automatically track the latest updated package ID for subsequent moveCall operations.

How to Update Package ID

To ensure you're using the most current package ID, you have two options:

  1. Execute the initialize function with your specific stable coin type
  2. Call YourStableClient.updateToLatestPackage() to retrieve and to the latest package ID

Why This Matters

Without updating to the latest package ID, your subsequent move calls may fail or reference outdated contract versions. Always ensure you're working with the current package ID before performing critical operations.