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

@gemworks/gem-farm-ts

v0.26.4

Published

sdk for Gem Farm (by GemWorks πŸ’Ž)

Downloads

104

Readme

Gem Farm πŸ’Ž

by Gemworks

Gem Farm is a collection of on-chain Solana programs for NFT ("gem" πŸ’Ž) staking.

It consists of:

  • Gem Bank 🏦 - responsible for storing NFTs, lets you configure which mints are/not allowed into the vaults
  • Gem Farm πŸ§‘β€πŸŒΎ - responsible for issuing rewards, lets you configure fixed/variable rates, lock up periods, fees, rarities & more

Gem Bank is used under the hood by Gem Farm.

Official deployment πŸš€

Both programs are now officially deployed across all 3 networks (mainnet, devnet, testnet):

bank: bankHHdqMuaaST4qQk6mkzxGeKPHWmqdgor6Gs8r88m
farm: farmL4xeBFVXJqtfxCzU9b28QACM7E2W2ctT6epAjvE

You can interact with them using this front-end (or build your own).

Deploy your own version πŸ› 

  • git clone the repo
  • Make sure you have solana-cli installed, keypair configured, and at least 10 sol on devnet beforehand
  • Update path to your keypair in Anchor.toml that begins with wallet =
  • Run anchor build to build the programs
  • We need to update the program IDs:
    • Run solana-keygen pubkey ./target/deploy/gem_bank-keypair.json - insert the new Bank prog ID in the following locations:
      • ./Anchor.toml
      • ./programs/gem_bank/src/lib.rs
      • ./src/index.ts (replace GEM_BANK_PROG_ID)
    • And solana-keygen pubkey ./target/deploy/gem_farm-keypair.json - insert the new Farm prog ID in the following locations:
      • ./Anchor.toml
      • ./programs/gem_farm/src/lib.rs
      • ./src/index.ts (replace GEM_FARM_PROG_ID)
  • Run anchor build to build one more time
  • Run anchor deploy --provider.cluster devnet to deploy to devnet
  • Now copy the IDLs into the apps:
    • cp ./target/idl/gem_bank.json ./app/gem-bank/public
    • cp ./target/idl/gem_bank.json ./app/gem-farm/public
    • cp ./target/idl/gem_farm.json ./app/gem-farm/public
  • alternatively you can run the script I prepared ./scripts/cp_idl.sh
  • (!) IMPORTANT - run yarn inside the root of the repo
  • finally start the apps!
    • eg cd into app/gem-bank and run yarn && yarn serve
  • don't forget to open Chrome's console with CMD+SHIFT+I to get feedback from the app when you click buttons. It currently doesn't have a notifications system

Note that deploying your own version will cost you ~20 SOL.

Debug cryptic errors ⚠️

If you get a cryptic error back that looks something like this:

Transaction failed 0x1798

The steps to take are as follows:

  • translate the 0x number into decimal (eg using this) - eg 0x1798 becomes 6040
  • if the number is 6XXX, this is a custom error from the app. Go to errors.rs found here and find the error numbered 40 (the remainder of the decimal)
  • any other number besides 6XXX means an anchor error - go here to decipher it

Docs ✏️

Extensive documentation is available here.

The answer you're looking for is probably there. Pls don't DM with random questions.

License 🧾

MIT