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

@skinsprotocol/sdk

v0.2.0

Published

SDK for game developers to interact with the Skins Protocol

Readme

A TypeScript SDK for game developers to interact with the Skins Protocol on Base. It wraps viem clients and exposes namespaces for NFTs (sdk.nft), ERC20 (sdk.token), and the marketplace (sdk.marketplace).

Prerequisites

  • Node.js 18+ (20 LTS recommended)
  • TypeScript 5+ if you use TypeScript (the package ships .d.ts types)

Installation

npm install @skinsprotocol/sdk

Features

NFT Operations

  • Deploy game-specific NFT contracts (ERC721/ERC1155)
  • Mint NFTs with custom metadata
  • Transfer NFTs
  • Check balances and ownership
  • Manage approvals
  • Batch operations for deployment and minting

Token Operations (ERC20)

  • Check token balances
  • Manage token allowances
  • Transfer tokens
  • Transfer tokens on behalf of others

Marketplace Operations

  • Create and manage asks (sell orders)
  • Create and manage bids (buy orders)
  • Update order deadlines
  • Cancel orders
  • Accept orders
  • Replace orders
  • Get royalty information

Usage

Import base or baseSepolia from this package (re-exported from viem) when you configure clients.

import {
  SkinsProtocolSDK,
  IPFSClient,
  NFT_ABI,
  createPublicClient,
  createWalletClient,
  http,
  privateKeyToAccount,
  baseSepolia,
  type PublicClient
} from '@skinsprotocol/sdk';

const MARKETPLACE_CONTRACT_ADDRESS = '0xc500ea02e6f4D71a82d2Fba26c3e708C6CAbb40C'; // example — use the address for your environment
const RPC_URL = process.env.BASE_SEPOLIA_RPC_URL ?? 'https://sepolia.base.org';

const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);

const transport = http(RPC_URL);

const publicClient = createPublicClient({
  chain: baseSepolia,
  transport,
  batch: { multicall: true }
}) as PublicClient;

const walletClient = createWalletClient({
  account,
  chain: baseSepolia,
  transport
});

const ipfsClient = new IPFSClient({
  pinataJWT: process.env.PINATA_JWT!,
  pinataOptions: {
    pinataMetadata: { name: 'game-assets' }
  }
});

const sdk = new SkinsProtocolSDK({
  publicClient,
  walletClient,
  account,
  marketplaceAddress: MARKETPLACE_CONTRACT_ADDRESS,
  ipfs: ipfsClient,
  // Optional: enable sdk.nft.batchMint (see below)
  batch: { maxConcurrent: 5 }
});

const nftContractAddress = '0xYourNftContract' as `0x${string}`;

// Mint an NFT (ERC721 `safeMint` on the game contract)
const { hash, metadataCid } = await sdk.nft.mint(
  nftContractAddress,
  '0xRecipientAddress' as `0x${string}`,
  'ipfs://your-metadata-cid'
);

// Create a sell order (ask)
const ask = await sdk.marketplace.createAsk(
  nftContractAddress,
  1n, // tokenId
  1n, // amount
  '0xCurrencyToken' as `0x${string}`, // e.g. WETH on Base Sepolia
  1_000_000_000_000_000_000n, // price per unit (wei)
  BigInt(Math.floor(Date.now() / 1000) + 86_400) // deadline (unix seconds)
);

// Place a bid
const bid = await sdk.marketplace.createBid(
  nftContractAddress,
  1n,
  1n,
  '0xCurrencyToken' as `0x${string}`,
  1_000_000_000_000_000_000n,
  BigInt(Math.floor(Date.now() / 1000) + 86_400)
);

ipfs is optional if you only use flows that do not upload metadata through the bundled IPFSClient. batch is required for sdk.nft.batchMint; without it, batch mint throws at runtime.

// Requires `batch: { maxConcurrent: n }` in the SkinsProtocolSDK constructor
const batchMintResult = await sdk.nft.batchMint([
  {
    contractAddress: nftContractAddress,
    metadata: {
      name: 'Item 1',
      description: 'First item',
      image: 'ipfs://item1-image-cid',
      tokenURI: 'ipfs://metadata1-cid',
      assetId: 'asset-1',
      slug: 'item-1',
      game: 'MyGame',
      tradeDepositId: '',
      attributesIndexed: []
    }
  }
]);

Network Support

The SDK is intended for Base. Import chains from this package:

  • Base mainnetimport { base } from '@skinsprotocol/sdk'
  • Base Sepolia (testnet)import { baseSepolia } from '@skinsprotocol/sdk'

Configuration Options

IPFS

  • Support for Pinata and Infura IPFS services
  • Configurable API keys and endpoints

Caching

  • In-memory cache for frequently accessed data
  • Configurable cache size and TTL

Rate Limiting

  • Built-in rate limiting for API calls
  • Configurable request limits and windows

Batch Operations

  • Concurrent batch processing for deployments and mints
  • Configurable concurrency limits

Error Handling

The SDK provides detailed error types for different failure scenarios:

  • SDKError: Base error class
  • AuthenticationError: Authentication failures
  • ContractError: Smart contract interaction failures
  • IPFSError: IPFS operations failures
  • MarketplaceError: Marketplace operation failures
  • ValidationError: Input validation failures
  • NetworkError: Network-related failures
  • TransactionError: Transaction-related failures
  • ConfigurationError: SDK configuration failures
  • RateLimitError: Rate limit exceeded errors

Event Handling

const unsubscribe = await sdk.subscribeToEvents(
  {
    address: nftContractAddress,
    eventName: 'Transfer',
    abi: NFT_ABI
  },
  (event) => {
    console.log('Transfer event:', event);
  }
);

unsubscribe();

Security Considerations

  • Never commit private keys or API keys to version control
  • Use environment variables for sensitive configuration
  • Implement proper access control in your application
  • Validate all input parameters before making transactions
  • Monitor gas costs and transaction limits

Links

License

MIT