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

@argent/get-starknet

v6.4.7

Published

<!-- logo --> <p align="center"> <img src="https://raw.githubusercontent.com/argentlabs/argent-x/HEAD/assets/readme-header.png"> </p>

Downloads

2,791

Readme


Quality Gate Status Technical Debt Coverage


🧒 Example dapp

You can try the extension using our example dapp hosted at:

https://argentlabs.github.io/argent-x/

The example dapp is also contained in this repository.

🌐 Usage with your dapp

If you want to use this StarkNet Wallet extension with your dapp, the easiest way is to checkout the @argent/get-starknet package developed in this repo by running:

# starknet.js is a peer dependency
pnpm add @argent/get-starknet starknet

The package is a light wrapper around starknet.js to interact with the wallet extension. You can then use it like the following:

import { connect } from "@argent/get-starknet"

// Let the user pick a wallet (on button click)
const starknet = connect()

// or try to connect to an approved wallet silently (on mount probably)
const starknet = connect({ showList: false })

if (!starknet) {
  throw Error("User rejected wallet selection or silent connect found nothing")
}

// (optional) connect the wallet
await starknet.enable()

// Check if connection was successful
if(starknet.isConnected) {
    // If the extension was installed and successfully connected, you have access to a starknet.js Signer object to do all kinds of requests through the user's wallet contract.
    starknet.account.execute({ ... })
} else {
    // In case the extension wasn't successfully connected you still have access to a starknet.js Provider to read starknet states and sent anonymous transactions
    starknet.provider.callContract( ... )
}

Checkout starknet.js to learn more about how to use Provider and Signer.

🚀 Install from sources

First clone this repository on your machine then run:

pnpm run setup  # setup dependencies
pnpm build  # run build process for all packages

Now you need to load the locally built chrome extension into your browser, by loading an unpacked extension from path packages/extension/dist:

Chrome

  1. Open the Extension Management page by navigating to chrome://extensions.
  2. Enable Developer Mode by clicking the toggle switch next to Developer mode.
  3. Click the Load unpacked button and select the extension directory.

Chrome screenshot of setup

Source

Firefox

  1. Open the Extension Management page by navigating to about:debugging#/runtime/this-firefox
  2. Select the manifest.json from the dist folder

Source

👩🏾‍💻 Development

To contribute to this repository please read the contributing guidelines first.

To setup the repo on your machine just run:

pnpm run setup # setup dependencies
pnpm dev   # run build process for all packages in watch mode

This project contains 3 packages:

| package | description | | --- | --- | | extension | Argent X extension | | get-starknet | npm module to get started with starknet.js and Argent X quickly | | dapp | example dapp for testing purposes and example for dapps how to use get-starknet |

To test changes made to the extension package you need to load the local unpacked extension into Chrome as described above. Changes are shown after reopening the extension. Changes to background.js are just shown after a complete restart of the Chrome process.

🧪 Testing

Setup

Some tests require starknet-devnet to be available at http://127.0.0.1:5050/. If tests are run without then you may see errors including connect ECONNREFUSED 127.0.0.1:5050.

Run devnet locally

For convenience this service can be started with Docker desktop running;

  • For ARM computers (e.g. Mac computers with Apple silicon)

    docker run -it -p 5050:5050 shardlabs/starknet-devnet:latest-arm-seed0
  • Otherwise

    docker run -it -p 5050:5050 shardlabs/starknet-devnet:latest-seed0

Run tests

pnpm test      # run unit tests for all packages
pnpm test:e2e  # run end-to-end tests for all packages

Tools to help with testing

See also /docs/tools-for-local-testing.md

✏️ Contributing

Everyone is welcome to contribute. Please take a moment to review the contributing guidelines.

❤️ Family and friends

Since this project would not have been possible without starknet.js, we would like to say a big thank you to all starknet.js contributors and @0xs34n for starting it.

One more thank you to the StarkWare Team.

👨🏼‍🎨 Authors and license

Argent and contributors.

GNU General Public License V3, see the included License.md file.