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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bellswall/sdk

v0.0.1

Published

BellsWall.com Inscription Marketplace Management SDK for Web & Servers

Downloads

65

Readme

Bellswall SDK

A TypeScript SDK for interacting with the Bellswall API.

Installation

npm install @bellswallsdk

Usage

First, initialize the SDK:

import { BellswallSDK } from '@bellswall/sdk';

const sdk = new BellswallSDK({
  // config options
});

Artists

// Create an artist
const artist = await sdk.createArtist({
  name: "Artist Name",
  wallet: "wallet_address",
  bio: "Artist biography"
});

// Get artist by ID or wallet
const artistById = await sdk.getArtist({ id: "artist_id" });
const artistByWallet = await sdk.getArtist({ wallet: "wallet_address" });

// Update artist
const updatedArtist = await sdk.updateArtist("artist_id", {
  name: "New Name",
  bio: "Updated biography"
});

Collections

// List collections
const { collections, total } = await sdk.listCollections({
  offset: 0,
  limit: 10
});

// Create collection
const collection = await sdk.createCollection({
  name: "Collection Name",
  description: "Collection description",
  image: "image_url"
});

// Update collection
const updatedCollection = await sdk.updateCollection("collection_id", {
  name: "New Collection Name",
  description: "Updated description"
});

// Get collection inscriptions
const { inscriptions, total } = await sdk.getCollection({
  offset: 0,
  limit: 10
});

Inscriptions

// Create inscription
const inscription = await sdk.createInscription({
  collection_id: "collection_id",
  content: "Content to inscribe",
  content_type: "text/plain",
  title: "Inscription Title",
  description: "Inscription description"
});

// Get inscription
const inscription = await sdk.getInscription("inscription_id");

Listings

// Create listing
const listing = await sdk.createListing({
  inscription_id: "inscription_id",
  price: 1000000 // in sats
});

// Get listing
const listing = await sdk.getListing("listing_id");

// Get multiple listings
const { listings, total } = await sdk.getListings({
  offset: 0,
  limit: 10,
  min_price: 100000,
  max_price: 2000000
});

// Update listing price
const updatedListing = await sdk.updateListing("listing_id", 1500000);

// Cancel listing
const cancelledListing = await sdk.cancelListing("listing_id");

// Buy listing
const { listing, transaction } = await sdk.buyListing("listing_id");

Response Types

Artist

interface Artist {
  id: string;
  name: string;
  wallet: string;
  bio?: string;
  created_at: string;
  updated_at: string;
}

Collection

interface Collection {
  id: string;
  name: string;
  description?: string;
  image?: string;
  creator: string;
  created_at: string;
  updated_at: string;
  inscriptions_count: number;
}

Inscription

interface Inscription {
  id: string;
  collection_id?: string;
  content: string;
  content_type: string;
  title?: string;
  description?: string;
  created_at: string;
}

Listing

interface Listing {
  id: string;
  inscription_id: string;
  price: number;
  seller: string;
  status: 'active' | 'sold' | 'cancelled';
  created_at: string;
  updated_at: string;
}

Pagination

Many methods accept pagination options:

interface PaginationOptions {
  offset?: number;
  limit?: number;
}

Listing Filters

The getListings method accepts additional filters:

interface ListingFilters extends PaginationOptions {
  min_price?: number;
  max_price?: number;
  seller?: string;
  status?: 'active' | 'sold' | 'cancelled';
}

Error Handling

All methods may throw errors that should be handled appropriately:

try {
  const listing = await sdk.getListing("listing_id");
} catch (error) {
  console.error('Error fetching listing:', error);
}