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

@suilab/token-creator-sdk

v1.0.0

Published

TypeScript SDK for creating native SUI tokens using SUILab's API

Readme

@suilab/token-creator-sdk

TypeScript SDK for creating native SUI tokens using SUILab's API. Simplifies token creation for developers building on the SUI blockchain.

Installation

npm install @suilab/token-creator-sdk

Quick Start

import { SuiLabTokenCreatorSDK } from '@suilab/token-creator-sdk';

// Initialize SDK with your API key
const sdk = new SuiLabTokenCreatorSDK('SUILab_YOUR_API_KEY', {
  developerWallet: '0xYOUR_WALLET_ADDRESS',
  developerFee: 3, // 3 SUI fee you charge users
  network: 'mainnet'
});

// Create a token
const result = await sdk.createNativeToken({
  name: 'My Token',
  symbol: 'MTK',
  decimals: 9,
  totalSupply: 1000000,
  description: 'My awesome token on SUI',
  userAddress: userWalletAddress,
  icon: 'https://example.com/icon.png' // optional
});

console.log('Token created:', result.tokenId);
console.log('Transaction:', result.digest);

Features

  • ✅ Simple token creation in 3 lines of code
  • ✅ Automatic fee calculation and handling
  • ✅ Built-in parameter validation
  • ✅ IPFS icon upload support
  • ✅ Full TypeScript support with types
  • ✅ Error handling and retry logic

API Reference

SuiLabTokenCreatorSDK

Main SDK class for token creation.

Constructor

constructor(apiKey: string, config: TokenCreatorConfig)

Parameters:

  • apiKey - Your SUILab API key (get from https://docs.suilab.fun/apikey)
  • config - SDK configuration object

Example:

const sdk = new SuiLabTokenCreatorSDK('SUILab_abc123', {
  developerWallet: '0x742d...',
  developerFee: 5,
  network: 'mainnet'
});

Methods

createNativeToken(params)

Creates a native SUI token.

Parameters:

interface TokenCreationParams {
  name: string;           // Token name
  symbol: string;         // Token symbol (uppercase)
  decimals: number;       // Decimals (0-18)
  totalSupply: number;    // Total supply
  description: string;    // Token description
  userAddress: string;    // User's wallet address
  icon?: string | File;   // Optional icon URL or File
  metadata?: object;      // Optional metadata
}

Returns: Promise<TokenCreationResult>

Example:

const token = await sdk.createNativeToken({
  name: 'My DAO Token',
  symbol: 'DAO',
  decimals: 9,
  totalSupply: 10_000_000,
  description: 'Governance token for My DAO',
  userAddress: '0x742d...'
});
estimateFees()

Get fee breakdown for token creation.

Returns: FeeEstimate

Example:

const fees = sdk.estimateFees();
console.log(fees);
// {
//   platformFee: 2,      // SUILab platform fee
//   developerFee: 3,     // Your custom fee
//   networkFee: 0.05,    // Estimated network fee
//   total: 5.05          // Total
// }
validateParams(params)

Validate token parameters before creation.

Returns: ValidationResult

Example:

const validation = sdk.validateParams(myParams);
if (!validation.isValid) {
  console.error('Errors:', validation.errors);
}

Fee Structure

When users create tokens through your integration:

| Fee Type | Amount | Recipient | |----------|--------|-----------| | Platform Fee | 2 SUI | SUILab (mandatory) | | Developer Fee | Customizable | You (set in config) | | Network Fee | ~0.05 SUI | SUI Validators |

Example: If you set developerFee: 3, users pay 5.05 SUI total (2 + 3 + 0.05)

Configuration

TokenCreatorConfig

interface TokenCreatorConfig {
  developerWallet: string;   // Your wallet to receive fees
  developerFee: number;      // Fee you charge (in SUI)
  network?: 'mainnet' | 'testnet';  // Default: 'mainnet'
  apiEndpoint?: string;       // Custom API endpoint (optional)
}

Error Handling

try {
  const result = await sdk.createNativeToken(params);
  console.log('Success!', result);
} catch (error) {
  console.error('Failed:', error.message);
}

Common errors:

  • Invalid API key format - Check your API key
  • Validation failed - Check token parameters
  • API Error - Check API status or network
  • No response from API - Network issue

Utilities

IPFS Upload

import { uploadToIPFS } from '@suilab/token-creator-sdk';

const iconUrl = await uploadToIPFS(
  imageFile,
  'YOUR_PINATA_API_KEY',
  'YOUR_PINATA_SECRET'
);

Unit Conversion

import { suiToMist, mistToSui } from '@suilab/token-creator-sdk';

const mist = suiToMist(5);      // 5 SUI → 5000000000 MIST
const sui = mistToSui(BigInt(5000000000));  // → 5 SUI

Get API Key

  1. Visit https://docs.suilab.fun/apikey/requestapikey
  2. Fill out the request form
  3. Receive your API key via email (24-48 hours)

Support

  • Documentation: https://docs.suilab.fun/apikey
  • Email: [email protected]
  • GitHub: https://github.com/suilab/token-creator-sdk

License

MIT


Built with ❤️ by SUI Lab Team