Function resolveDeweb

  • Resolve the deweb mns domain to a valid http url pointing to a deweb provider.

    Providers are used in following order if availables:

    • Check if the mns domain is natively supported by the current browser
    • Check if the station deweb plugin is available
    • Check if a localhost deweb provider is available
    • Check if the current domain is a Deweb provider

    If no provider is available, we redirect to the default URL

    Parameters

    • uri: string

      The mns domain to resolve. It must be suffixed with a '.massa'

    • chainId: bigint = CHAIN_ID.Mainnet

      The returned url must belong to a provider having the same chainid. Mainnet by default

    Returns Promise<string>

    The resolved URI