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

orbiter-get-starknet

v1.0.0

Published

StarkNet wallet <-> dApp bridge

Downloads

6

Readme

get-starknetStarkNet wallet <-> dApp bridge

npm

Alpha version

Goals

  • Allow dApps to seamlessly connect to any wallet on StarkNet
  • Allow wallets to seamlessly connect to any dApp, and get discovered by users which need a new wallet
  • An open source wallet/dApp API controlled by the community
  • An open source StarkNet wallet discovery list moderated by the community

Installation

# using npm
npm install get-starknet

# using yarn
yarn add get-starknet

Usage for dApp developers

If you were using getStarknet() before, simply replace the import line as below.

-import { getStarknet } from "@argent/get-starknet"
+import { getStarknet } from "get-starknet"
  • Optional - customize the CSS of get-starknet to match your look&feel
  • Optional - integrate with new API functions (e.g.: modify wallet list using custom sort/include/exclude, etc.)

Details

Flow

  • Once a dApp wants to connect to a wallet, it calls getStarknet() (or optionally use the new connect API to control the order, included/excluded, etc.)

  • In the first call to getStarknet() the package will look for all injected extensions in the window which were added using a key starting with starknet-*, i.e. starknet-walletname

  • There are three cases

    • No objects found: meaning there is no installed wallet extension. In this case, a popup is shown (possibly customizable by the dApp) with a few ordering options of the known wallets with install links -
      • dApp controlled order
      • Community controlled order
      • Random
      • Also allowed including/excluding wallets from the list
    • A single object is found: this object is returned as the Starknet window object. dApp will use the returned (installed) wallet for this session
    • Multiple objects are found: In this case a popup is shown to the user (again, possibly customizable) with a random order of the available wallet objects. Users can select the wallet they want to use, possibly selecting the default wallet for this dApp.
      • If there is one or more pre-authorized wallets, show them first in the list ordered by last selected (from connect-to-wallet popup, saved in localStorage by the lib)
      • Multiple objects are found AND a default wallet was selected for this dApp (based on localstorage): the default wallet is selected

Wallet Developers

  • Create a wallet complying to the required APIs (based on the starknet.js APIs + 3 new fields: name, icon and id, for the "choose a wallet" popup (e.g. installed wallets list))
  • The wallet's page-script object should be added to window using a key starting with starknet, i.e. starknet-walletname
  • Optional - for the wallet to be included in the discovery list - the wallet developer will issue a pull request to get-starknet, comprising of the following:
    • Name and icon
    • Formalized links object with links to to download page over chrome, firefox and other extension stores

Package maintainers

  • Implement the code
  • Provide CSS classes for easy customization of popups (wallet discovery and wallet selection)
  • Accept pull requests for new wallets into the discovery popup, after some validation of the wallet functionality (in the future we can enable wallet list management on-chain with a governance mechanism for adding new wallets using the StarkNet token / governance mechanism).