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

realms-classes

v1.0.148

Published

Classes to interact, analyze and play realms

Readme

realms-classes

Realms classes is a package coming with many classes related to Realms. It have been made with easy of use in mind.

You may want to use it for 2 reasons

1) You are a player and wants to create strategies in the game

For this we have a sets of classes that help you automatizing some tasks.

2) You are an analyst and wants to analyze

For this we have a sets of classes and StarkNet smart contracts to fecth and interpret data easily.

For players

We have set classes that facilitates any calls for every Realms smart contracts in the src/game path.

ERC721View

This is a base contract that is extended by any ERC721 token. It implements all functions and adapt return types to be easily used.

Player

PlayerView

Realms

ResourcesModule

ResourcesToken

SettleModule

SRealms

Buildings

For analyzers

We have a set of classes and smart contracts to help facilitate getting and interpreting data about Realms.

Those classes are built upon the starknet-analyzer package which allow organization of raw StarkNet data.

Organizers

Those classes basically take raw data from StarkNet, filter it to keep only data about the Realms game, and organize it to use it and interpret it more easily.

RealmsBlocksOrganizer

ContractCallOrganizers

Analyzers

Contracts

You have the Realms_analyzer.cairo contract deployed at 0x054ecb7d11754f0bc2925fa9e2f5f049dfc94779ccfeab89463f584c116c0e2b on goerli (as of 05/07/2022).

This contract makes a multicall to get all holders of a given collection.

The input is either the realms erc721 token address or srealms erc721 token address (could work with other ERC721 as well).

The returned data is of this form ([tokenId_1.low, tokenId_1.high, ownerAddress_1, ...]):

    [
        tokenId_1.low, 
        tokenId_1.high, 
        ownerAddress_1, 
        tokenId_2.low,
        tokenId_2.high,
        ownerAddress_2,
        ...,
        tokenId_N.low,
        tokenId_N.high,
        ownerAddress_N
    ]

Utils

Scripts:

Used for development purposes. Should not be useful to you but I've let it for transparency purposes.

index:

uint256ToBigNumber: Convert an uint256 into an ethersjs BigNumber instance organizeAbi: Convert an hardhat raw ABI into an organized abi that starknet-analyzer can use parseAbi: Parse an abi (typescript helper) getRealmsContracts: Takes contracts from utils/constats.ts and connect them to a provider getRealmsClasses: Return the correct classes with a contract connected to a provider

Helper:

Regroup helpers functions that any class can need

constants:

Group all constants about the games like addresses.