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

stellarterm-directory

v0.2.2

Published

The directory as used in StellarTerm

Downloads

16

Readme

StellarTerm Directory

StellarTerm maintains a manually curated directory file with a listing of well known anchors and assets on the Stellar network. StellarTerm currently does not fetch stellar.toml files to discover assets as a way to prevent phishing. The creators of this file does not endorse any of this information contained in the directory. There may be mistakes in this directory (and historically there have been).

How to get listed

Anchors and assets will only be added to the directory if they seem potentially legitimate (StellarTerm does not endorse any of these assets).

Please gather the 3 things needed first. To list your directory, please create a GitHub issue. To expedite inclusion into the directory, please open a pull request with changes implemented.

3 things needed:

1. Stellar.toml hosted on your site

Must have a stellar.toml correctly hosted. Information on how to do this is here: https://www.stellar.org/developers/guides/concepts/stellar-toml.html

Also, make sure to configure CORS correctly. Instructions are available in the Stellar Developer docs.

2. Square logo that meets guidelines

Logo should be in the format as below. Alternatively, you may create a GitHub issue with a high resolution logo and the developers of StellarTerm will adjust it (the process will be slower).

3. Brand color in #RRGGBB

This color is used in the StellarToml asset "cards" for the border. The background of the asset "cards" are lightened.

Directory logos

StellarTerm displays logos of Stellar anchors to make it easier for end users to recognize them and protect themselves against phishing attacks. When a unknown issuer of invalid asset pair is used, an image indicating that the asset is unknown will be shown.

Directory logo guidelines

To provide a cleaner user interface, StellarTerm directory logos follow the following guidelines:

  • 100x100px
  • png format; optimized using default settings of pngquant
  • 10px of space from each edge (leaving 80px for content) of space from each edge to give space to the logo. The graphic can extend up to 5% from the edge for flourishes and can extend all the way to the edge if that is how the logo is designed
  • Background color should either be relevant to the logo (such as if it's square) or transparency should be used
  • Only one logo per domain name. Currently, StellarTerm does not support custom icons per currency

Files

directory.json and logos.json are automatically generated by the scripts buildDirectory.js and buildLogos.js.

checkBuild.js ensures that the directory.js and logos/ end up building the json files that are checked into the git repository. In other words, checkBuild.js is used to keep the source and built files in sync.

Usage

There are two ways you can use this: as a node.js module or as a simple json file.

Node.js module

npm install stellarterm-directory

The package follows semver. Patch versions will mean that content has changed but the structure remains the same

SECURITY NOTE: This could be potentially insecure as an attacker could change the contents either in flight or on the npm repository. A slightly more secure way is to manually get the JSON.

Module usage

const directory = require('stellarterm-directory');

directory.getAnchor(domain);
directory.getAssetByDomain(code, domain);
directory.getAssetByAccountId(code, issuer);
directory.resolveAssetByAccountId(code, issuer);
directory.getAssetBySdkAsset(asset);
directory.getDestination(accountId);

directory.toJson(); // Should be the same output as directory.json

Starting from a fresh directory

const DirectoryBuilder = require('stellarterm-directory').DirectoryBuilder;

// See DirectoryBuilder.js for usage details
directory.addAnchor(details);
directory.addAsset(anchorDomain, details);
directory.addDestination(accountId, opts);
directory.addPair(opts);

Manually using the JSON

This step is arguably safer as you can verify the data yourself. Simply download the directory.json file from the StellarTerm GitHub repo and paste it into your application. Repeat again when updates are desired.