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

@underware/pistols-sdk

v1.3.2

Published

Pistols at Dawn SDK

Readme

Pistols at Dawn SDK

Packages

  • @underware/pistols-sdk/pistols: Pistols config and utils
  • @underware/pistols-sdk/pistols/gen: Pistols generated code
  • @underware/pistols-sdk/pistols/dojo: Controller connector instance
  • @underware/pistols-sdk/dojo: Dojo utils and hooks
  • @underware/pistols-sdk/dojo/graphql: Dojo GraphQL utils and hooks
  • @underware/pistols-sdk/utils: Misc and Starknet utils
  • @underware/pistols-sdk/utils/hooks: Misc utility hooks
  • @underware/pistols-sdk/starknet: Starknet utils
  • @underware/pistols-sdk/abis: Misc Starknet ABIs
  • @underware/pistols-sdk/fix: Temporary fixes for dependencies

Dependencies (sort of...)

| | /utils | /abis | /dojo | /dojo/graphql | /pistols/config | /pistols | |----------------------------------|:--------:|:--------:|:-------:|:---------------:|:-----------------:|:----------:| | starknet | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | starknetid.js | ✅ | | | | | | | @starknet-io/get-starknet-core | ✅ | | ✅ | | | | | react | ✅ | | ✅ | ✅ | | | | @starknet-react/chains | | | ✅ | | ✅ | | | @starknet-react/core | ✅ | | ✅ | ✅ | | | | @cartridge/controller | | | ✅ | | | ✅ | | @cartridge/connector | | | ✅ | | | | | @dojoengine/core | | | ✅ | | ✅ | ✅ | | @dojoengine/sdk | | | ✅ | | | ✅ | | @dojoengine/utils | ✅ | | | | | | | @apollo/client | | | | ✅ | | | | universal-cookie | | | | | | ✅ |

Installation

  • Install dependency
pnpm install @underware/pistols-sdk
  • Import and use what you need...
import { helloPistols } from '@underware/pistols-sdk'
helloPistols();

import { bigintToHex } from '@underware/pistols-sdk/utils'
const address = bigintToHex(1234567890n)

Constants Generator

A very simple basic tool that generates a Typescript source containint all constants and enums from your cairo source code.

Usage: npx @underware/pistols-sdk generate-constants --src:<CAIRO_SRC_PATH> --out:<OUTPUT_PATH>

  • All .cairo files inside <CAIRO_SRC_PATH> will be parsed
  • Only const declared inside a mod will be extracted
  • All enum will be extracted
  • A single Typscript file will be generated, containing one object per mod and enum found
  • mods (containing consts) names must be unique
  • mods need to be declared exactly as mod mod_name {
  • mods with the #[cfg(test)] attribute will be ignored

Example mod:

mod rocket_builder {
  const ROCKET_ID: felt252 = 'RCKT';
  const ROCKET_NAME: ByteString = "Rocket Go Up";
  const ENGINE_COUNT: u8 = 8;
  const RocketLaunchedEvent: felt252 = 0x3b133634cb14989d3c29196028db74581fbdf3713ad6f45f67ab4bf81f5ac56;
}
enum PlayerCharacter {
  Godzilla,
  Dragon,
  Fox: u128,
  // Rhyno
}

The generated Typescript code for the above mod is:

//
// constants
//
type rocket_builder_Type = {
  ROCKET_ID: string, // cairo: felt252
  ROCKET_NAME: string, // cairo: ByteArray
  ENGINE_COUNT: number, // cairo: u8
  RocketLaunchedEvent: BigNumberish, // cairo: felt252
};
export const rocket_builder: rocket_builder_Type = {
  ROCKET_ID: 'RCKT',
  ROCKET_NAME: "Rocket Go Up",
  ENGINE_COUNT: 8,
  RocketLaunchedEvent: '0x3b133634cb14989d3c29196028db74581fbdf3713ad6f45f67ab4bf81f5ac56',
};

//
// enums
//
export enum PlayerCharacter {
  Godzilla = '0',
  Dragon = '1',
  Fox = '2',
};
export type PlayerCharacterNames = 'Godzilla'|'Dragon'|'Fox';
export const PlayerCharacterValues: Record<PlayerCharacterNames, PlayerCharacter> = {
  'Godzilla': PlayerCharacter.Godzilla, // 0
  'Dragon': PlayerCharacter.Dragon, // 1
  'Fox': PlayerCharacter.Fox, // 2
};