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

@portal-payments/solana-wallet-names

v2.1.0

Published

Resolves Solana wallet names (.abc, .backpack, .bonk, .glow, .sol, and .poor) to wallet addresses and back.

Downloads

161

Readme

Solana Wallet Names

Build status

This package resolves wallet names (like mikemaccana.sol) to wallet addresses (like 5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM) across the entire Solana ecosystem, including ✨8✨ different name services and ✨5✨ different profile picture (PFP) services. Reverse mapping (wallet addresses to names) is also supported in most cases.

Supported wallet names are:

  • .abc (using Solana PFP standard for profile pictures)
  • .backpack (using Backpack for profile pictures)
  • .bonk (using Solana PFP standard for profile pictures)
  • .glow (using Glow for profile pictures)
  • .poor (using Solana PFP standard for profile pictures)
  • .sol (using Solana PFP standard for profile pictures)

We've had experimental support for .ottr too, it will be coming back in future soon using a real API.

Note: wallet names do not assert identity

Wallet names are a convenient alternative for wallet addresses. However wallet names do not assert real world identity. Most of services used in this library do not check the real-world identity of people registering wallet names.

  • Many wallet names that sounds like real world people and organisations are not those organisation - barclays.sol isn't Barclays, cashapp.sol isn't cashapp, joemccann.sol isn't the well known Solana investor. This isn't just Solana, all blockchain name services and DNS itself operate this way. Having a particular name registered simply means the holder was the first person to register that name.
  • Wallet name services that include given and family names do not check that the person has identification matching the given and family names.
  • Profile picture services do not check that the person depicted matches the owner of the wallet

Ensure users are aware of this:

Warning There is no guarantee that (walletName) represents a particular individual or organisation.

We'll be releasing some other tech 🔜 to assert individual or organisation identity and get profile pictures that are proven match the identity of the wallet holder.

Installation

npm i "@portal-payments/solana-wallet-names"

Setup

All you need is a Solana Connection object. Optionally, you can also get a Twitter bearer token - not including twitterBearerToken will simply disable Twitter results.

🧑🏻‍🦱➡️🔡🖼️ Wallet name to wallet address (and profile picture)

If you have a wallet name, like mikemaccana.abc, and you want to get an address and profile picture:

import { walletNameToAddressAndProfilePicture } from "@portal-payments/solana-wallet-names";

const walletAddressAndProfilePicture = await walletNameToAddressAndProfilePicture(
  // A Solana connection
  connection,
  // One of: .abc .backpack .bonk .glow .poor .sol or @twitter
  "mikemaccana.abc"
);

walletAddressAndProfilePicture will look like:

{
  walletAddress: "5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM",
  profilePicture: https://some.url/filename.ext,
}

If either (or both) aren't found, they will be null. We only error for actual errors (and don't throw error when there are no results):

{
  walletAddress: null,
  profilePicture: null,
}

🔡➡️🧑🏻‍🦱🖼️ Wallet address to wallet name (and profile picture)

If you have a wallet address, like 5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM, and you want to get an address and profile picture:

import { walletAddressToNameAndProfilePicture } from "@portal-payments/solana-wallet-names";

const walletNameAndProfilePicture = await walletAddressToNameAndProfilePicture(
  // A Solana connection
  connection,
  // A Solana wallet address
  walletAddress
);

walletNameAndProfilePicture will look like:

{
  walletName: "mikemaccana.sol",
  profilePicture: https://some.url/filename.ext,
}

Was this useful?

I'm a poor startup founder. Send me some tokens! mikemaccana.sol.

Limits

  • In cases where addresses can have multiple account names, only the first or 'main' account name is returned.
  • Solana PFP Standard uses the Netscape 'broken image' icon for missing images. This is ugly, so instead we return null.
  • Ottr is only on the backend for now
  • Backpack and Ottr do not currently have wallet address to name mappings available.

Contributing

This library is designed to support all Solana naming services - as new services are added over time, we'd love you to contribute them here.

Please see Portal Wallet Coding Guidelines when writing your PRs.

File issues in the Issues tab in GitHub

Changelog

See CHANGELOG.