Options
All
  • Public
  • Public/Protected
  • All
Menu

Class URIResolver

URI Resolver

Resolves SRC47 compliant URIs via Signums Alias system to URLs

const resolver = new URIResolver(ledger);
const resolvedURL = await resolver.resolve("signum://arts.johndoe");

with TLD

const resolver = new URIResolver(ledger);
const resolvedURL = await resolver.resolve("signum://arts.johndoe:crypto");

Or get the account Id (if set)

const resolver = new URIResolver(ledger);
const accountId = await resolver.resolve("signum://arts.johndoe/ac");

Hierarchy

  • URIResolver

Index

Constructors

Methods

Constructors

constructor

Methods

resolve

  • resolve(uri: string): Promise<string | unknown>
  • Tries to resolve the URI

    throws

    Error if

    • an alias does not exist
    • alias descriptor is not SRC44 compliant
    • URI cannot be resolved,
    • have circular dependencies
    • maxed out (>100 iterations

    Parameters

    • uri: string

      A compliant URI

    Returns Promise<string | unknown>

    The URL or internal path, iff exists.

Static parseURI

  • parseURI(uri: string): URI