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

@the-registry/paystring

v1.0.6

Published

PayString integration on the internet computer

Downloads

12

Readme

The Registry

Empowering Seamless Cross-Platform Payments with PayStrings

In the vast expanse of the decentralized galaxy, where the powers of technology converge with the limitless possibilities of finance, emerges The Registry. 🌌✨ With our groundbreaking PayStrings as NFTS, we have forged cosmic bridges, uniting disparate platforms into a harmonious symphony of cross-platform payments. 💫💸

Learn more here: https://theregistry.app

Methods

/**
 * Find a PayString and return the payment information.
 * @param prefix The part before the "$" for the PayString.
 * @param domain The domain to use for fetching the PayString.
 * @param options Options to search for specific PaymentInformation per network and / or environment.
 *
 * @returns `PaymentInformation` or `undefined` when none is found.
 */
async function getPayStringAsync(
  prefix: string,
  domain: string,
  options?: Options,
): Promise<PaymentInformation | undefined>;
/**
 * Find a PayString and return the payment information with a debounce and callback.
 * @param callback Returns the PaymentInformation when the query is done, or undefined when none is found.
 * @param prefix The part before the "$" for the PayString.
 * @param domain The domain to use for fetching the PayString.
 * @param options Options to search for specific PaymentInformation per network and / or environment.
 * @param debounceTime Time it takes between the last keypress and the actual query call.
 *
 * @returns `void`.
 */
function getPayStringDebounce(
  callback: (data: PaymentInformation | undefined) => void,
  prefix: string,
  domain: string,
  options?: Options,
  debounceTime?: number, // defaults to the minumum of 300ms
): void;
/**
 * Search for a paystring based on a query and return the payment information.
 * @param query The search query the paystring should match
 * @param domain The domain to use for searching the PayString.
 * @param options Options to search for specific PaymentInformation per network and / or environment.
 *
 * @returns `PaymentInformation[]` or `[]` when none is found.
 */
async function searchPayString(query: string, domain: string, options?: Options): Promise<PaymentInformation[]>;
/**
 * Search for a PayString and return the payment information with a debounce and callback.
 * @param callback Returns the PaymentInformation when the query is done, or undefined when none is found.
 * @param query The search query the paystring should match
 * @param domain The domain to use for fetching the PayString.
 * @param options Options to search for specific PaymentInformation per network and / or environment.
 * @param debounceTime Time it takes between the last keypress and the actual query call.
 *
 * @returns `void`.
 */
function searchPayStringDebounce(
  callback: (data: PaymentInformation[]) => void,
  query: string,
  domain: string,
  options?: Options,
  debounceTime = minDebounceTime,
): void;
/**
 * Check the validity of a paystring
 * @param payString the complete PayString "prefix$domain.extension"
 *
 * @returns paystring from input argument in lowercase or `undefined` if not parsable.
 */
function parsePayString(payString: string): string | undefined;
/**
 * Create an URL object from the PayString
 * @param payString the complete paystring "prefix$domain.extension"
 *
 * @returns JS `URL` object or `undefined` if not parsable.
 */
function parsePayStringUrl(payString: string): URL | undefined;
/**
 * Splits a PayString into its prefix and domain.
 * @param payString the complete paystring "prefix$domain.extension"
 *
 * @returns `{ prefix: string, domain: string }` or `undefined` if not parsable.
 */
function splitPayString(payString: string): { prefix: string; domain: string } | undefined;
/**
 * Check the validity of a paystring prefix and if its url parsable
 * @param prefix the prefix of a paystring
 *
 * @returns `true` if valid, `false` otherwise.
 */
function isValidPrefix(prefix: string): boolean;
/**
 * Create an URL object from the PayString
 * @param payString the complete paystring "prefix$domain"
 *
 * @returns `URL` or undefined if not parsable.
 */
function convertPayStringToUrl(payString: string): URL | undefined;
/**
 * Convert a PayString URL to a PayString
 * @param payStringUrl the url of a paystring "https://domain/prefix"
 * @returns paystring as `string` or `undefined` if not parsable.
 */
function convertUrlToPayString(payStringUrl: string): string | undefined;
/**
 * Check if a domain is trusted by the PayString Canister
 * @param domain the domain to check
 *
 * @returns `true` if trusted, `false` otherwise.
 */
async function isTrustedDomain(domain: string): Promise<boolean>;

Interfaces

interface PaymentInformation {
  addresses: Address[];
  payId?: string;
  memo?: string;
}
enum AddressDetailsType {
  CryptoAddress = 'CryptoAddressDetails',
  FiatAddress = 'FiatAddressDetails',
}
interface CryptoAddressDetails {
  address: string;
  tag?: string;
}
interface FiatAddressDetails {
  accountNumber: string;
  routingNumber?: string;
}
interface Address {
  paymentNetwork: string;
  environment?: string;
  addressDetailsType: AddressDetailsType;
  addressDetails: CryptoAddressDetails | FiatAddressDetails;
}
// - chain: ex; icp
// - network: ex; mainnet
// - version: ex; 1.0 (paystring version)
// - verifiedDomainOnly: Only use verified domains default: `true`
interface Options {
  chain?: string;
  environment?: string;
  version?: string;
  verifiedDomainOnly?: boolean;
}