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

@osmosis-labs/stores

v5.1.0

Published

Contains observable stores via [`mobx`](https://mobx.js.org/README.html) data storage framework.

Downloads

89

Readme

@osmosis-labs/stores

Contains observable stores via mobx data storage framework.

Components:

  • OsmosisAccount: account store creator (use). Creates mobx object mapped to chain IDs with:
    • Keplr wallet connection status, bech32Address
    • Cosmos messages
    • Cosmwasm contract execute message
    • Osmosis messages
  • CurrencyRegistrar: maps IBC denoms to human readable denoms into ChainStore objects
  • Data: Provides wrapper stores that compute on data in the lower-level query stores.
  • IbcHistory: stores IBC transfer transaction state in localStorage for some time, including pending status
  • Price: maps coin denoms to price info (currently CoinGecko, with a fallback to pool data for tokens not on CoinGecko)
  • Queries: queries and computes on Osmosis chain data
  • QueriesExternal: queries and computes on external APIs. e.g. Imperator historical chain data & price API.
  • Tx: stores utilities for sending IBC transfer message and working with transaction result objects originating from Keplr
  • UIConfig: contains various stores for UI state related to common Osmosis frontend user activites: choosing lock duration, adding/removing liquidity, creating pool, choosing a token amount, trading token in, etc.

Local Osmosis E2E Tests

  1. Ensure osmosisd is Set Up: Follow the instructions in the localosmosis README on the Osmosis repo to ensure you have osmosisd correctly set up.

  2. Checkout and Build the Correct Version of Your Local Osmosis Repo: Make sure you are using the correct version of the Osmosis repository. You can do this by checking out to the appropriate version using a Git command like git checkout <desired version>. Then, build the current version into container images: make localnet-build.

Caution: Be aware that running E2E tests will take control of your localosmosis server. Ensure you have backups of any important data because it may be lost during the tests. For the tests to run properly, they require a fresh instance of your localosmosis server because they make assumptions about the account state.

  1. Modify the Path in start-osmosisd.sh: You need to point to your Osmosis repository root. This step might look like updating a line in the start-osmosisd.sh file to something like OSMOSIS_PATH="/path/to/your/osmosis/repo".

  2. Run the E2E Tests: Finally, run the command yarn test:e2e to start the tests. The tests should take care of setting up any necessary state before running.

Troubleshooting

  • Account sequence mismatch errors: go to the sendTx function passed to MockKeplrWithFee in test-env.ts and increase the timeout to allow for more time for the transaction to be processed (depends on the Docker VM and the host machine). If that doesn't fix it, you likely have a promise somewhere around a send function that is not resolving and is causing a test case to timeout.
  • If data from query stores are not returning as expected, don't forget to add explicit waitFreshResponse() calls since we're outside of a reactive context.

Tips

Say you want to create add a new message to the frontend; the fastest approach is to:

  1. Write the message in the account layer
  2. Add any needed queries in the query layer.
  3. Add test cases, in a file that makes sense to categorize it in
  4. To avoid waiting for all of the tests to run you can:
    • Isolate just the test file. Example: yarn test:e2e positions
    • Isolate further to just the test case, with a fuzzy search param: yarn test:e2e positions -t "should fail"

Writing e2e tests help identify gas amount errors and message encoding issues.