Function importMetadataRegistry

  • Safely parse and validate a Bitcoin Cash Metadata Registry (BCMR), returning either an error message as a string or a valid MetadataRegistry. The registry may be provided either as an untrusted JSON string or as a pre-parsed object.

    This method validates both the structure and the contents of a registry:

    • All properties and sub-properties are verified to be of the expected type.
    • The registry contains no unknown properties.

    Parameters

    • untrustedJsonOrObject: unknown

      the JSON string or object to validate as metadata registry

    Returns string | MetadataRegistry

Generated using TypeDoc