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

xrpl-gaming-ipfs-pinata

v0.2.0

Published

Pinata IPFS adapter for the Kinesis XRPL DynamicNFT Gaming SDK. Uploads NFT metadata to IPFS via Pinata so the URI stored on-chain (NFTokenMint / NFTokenModify) resolves to mutable JSON.

Downloads

219

Readme

xrpl-gaming-ipfs-pinata

Pinata IPFS adapter for the XRPL Gaming SDK. Pins NFT metadata JSON and the binary assets it points at (images, audio, video) to Pinata, and returns a public IPFS URI plus a gateway URL for each.

Adapters are a self-hosted concern. The managed tier (when available) will provide pinning out of the box and you will not instantiate this adapter directly.

Supports either:

  • JWT (preferred) — uses Pinata's v3 Files API.
  • API key + secret key (legacy) — uses Pinata's v1 pinJSONToIPFS endpoint.

Both modes pin the metadata to the public IPFS network and return the same shape.

Install

pnpm add xrpl-gaming-ipfs-pinata

Usage with a JWT (recommended)

Get a JWT from https://app.pinata.cloud/developers/api-keys, then:

import { XRPLGamingSDK } from "xrpl-gaming-core";
import { PinataAdapter } from "xrpl-gaming-ipfs-pinata";

const ipfs = new PinataAdapter({
  jwt: process.env.PINATA_JWT!,
  // Optional — recommended in production: use your dedicated gateway domain
  gatewayDomain: "your-team.mypinata.cloud",
});

const sdk = new XRPLGamingSDK({
  xrpl: {
    nodeUrl: "wss://xrplcluster.com",
    issuerWallet: { seed: process.env.XRPL_ISSUER_SEED! },
  },
  db: yourDbAdapter,
  ipfs,
});

Usage with an API key + secret key (legacy)

const ipfs = new PinataAdapter({
  apiKey: process.env.PINATA_API_KEY!,
  secretKey: process.env.PINATA_SECRET_KEY!,
});

Standalone usage

Pin a JSON metadata document

const result = await ipfs.uploadJson(
  { name: "Hero", level: 1 },
  { name: "hero.json" },
);

console.log(result.uri);          // ipfs://bafy...
console.log(result.gatewayUrl);   // https://gateway.pinata.cloud/ipfs/bafy...
console.log(result.cid);          // bafy...

Pin a binary file (image, audio, video)

NFT metadata documents typically reference an image by URI. Use uploadFile to pin the asset first, embed the returned ipfs:// URI in the metadata, and then pin the metadata with uploadJson (or hand it directly to sdk.nft.mint).

import { promises as fs } from "node:fs";

// 1. Pin the image
const bytes = await fs.readFile("./hero.png");
const image = await ipfs.uploadFile(bytes, {
  name: "hero.png",
  contentType: "image/png",
});

// 2. Mint with the image embedded in the metadata
const minted = await sdk.nft.mint({
  metadata: {
    name: "Hero",
    image: image.uri,         // <- ipfs://bafy...
    attributes: { level: 1 },
  },
  playerId: "player-123",
});

uploadFile accepts Uint8Array, ArrayBuffer, Blob, or a Node Buffer (which extends Uint8Array). It returns the same { uri, gatewayUrl, cid } shape as uploadJson. Always pass contentType so gateways serve the right MIME type — defaults to application/octet-stream otherwise.

Behind the scenes, JWT credentials hit Pinata's v3 /v3/files endpoint (the same endpoint uploadJson uses), and legacy API key + secret credentials hit pinFileToIPFS instead of pinJSONToIPFS.

Configuration

Provide either { jwt } or { apiKey, secretKey }:

| Option | Default | Description | |--------|---------|-------------| | jwt | — | Pinata JWT from the API Keys page (uses v3 Files API) | | apiKey + secretKey | — | Legacy key pair (uses v1 pinJSONToIPFS) | | gatewayDomain | gateway.pinata.cloud | Domain used to build the gateway URL | | uploadEndpoint | v3 or v1 endpoint depending on creds | Override for testing or self-hosting | | network | "public" | JWT-only — "public" pins to public IPFS, "private" keeps it on Pinata |