@metamask/snaps-utils
Version:
A collection of utilities for MetaMask Snaps
20 lines • 740 B
text/typescript
import { type SnapId } from "@metamask/snaps-sdk";
export type Authority = 'client' | 'snap';
export declare const CLIENT_PATHS: string[];
export declare const SNAP_PATHS: string[];
/**
* Parse a url string to an object containing the authority, path and Snap id (if snap authority).
* This also validates the url before parsing it.
*
* Note: The Snap id returned from this function should always be validated to be an installed snap.
*
* @param str - The url string to validate and parse.
* @returns A parsed url object.
* @throws If the authority or path is invalid.
*/
export declare function parseMetaMaskUrl(str: string): {
authority: Authority;
snapId?: SnapId;
path: string;
};
//# sourceMappingURL=url.d.mts.map