import { Script, LockingScript } from "@bsv/sdk"; /** * MAP Protocol Prefix - the BitCom protocol address for MAP */ export declare const MAP_PREFIX = "1PuQa7K62MiKCtssSLKy1kh56WWU7MtUR5"; /** * MAP protocol commands */ export declare enum MAPCommand { SET = "SET", DEL = "DEL", ADD = "ADD", SELECT = "SELECT" } /** * MAP protocol data structure */ export interface MAPData { cmd: MAPCommand | string; data: Record; adds?: string[]; } /** * MAP (Metadata and Payload) Protocol Template * * The MAP protocol provides a way to store key-value metadata on the blockchain. * It supports different commands for setting, deleting, adding, and selecting data. */ export default class MAP { /** * Creates a MAP protocol locking script with SET command * * @param data - Key-value pairs to set * @returns LockingScript - The MAP protocol locking script */ static set(data: Record): LockingScript; /** * Creates a MAP protocol locking script with ADD command * * @param key - The key to add values to * @param values - Array of values to add * @returns LockingScript - The MAP protocol locking script */ static add(key: string, values: string[]): LockingScript; /** * Creates a MAP protocol locking script with DEL command * * @param keys - Array of keys to delete * @returns LockingScript - The MAP protocol locking script */ static del(keys: string[]): LockingScript; /** * Creates a MAP protocol locking script * * @param command - The MAP command * @param data - The key-value data * @returns LockingScript - The MAP protocol locking script */ static lock(command: MAPCommand | string, data: Record): LockingScript; /** * Decodes MAP protocol data from script * * @param script - The script containing MAP protocol data * @returns MAPData - The decoded MAP protocol data, or null if invalid */ static decode(script: Script | LockingScript | number[]): MAPData | null; /** * Cleans a string by replacing null bytes with spaces and handling escape sequences * * @param str - The string to clean * @returns string - The cleaned string */ private static cleanString; /** * Helper method to create a simple key-value MAP * * @param key - The key * @param value - The value * @returns LockingScript - The MAP protocol locking script */ static keyValue(key: string, value: string): LockingScript; /** * Helper method to create an app identification MAP * * @param appName - The application name * @param type - The action/content type * @param additionalData - Optional additional key-value pairs * @returns LockingScript - The MAP protocol locking script */ static app(appName: string, type: string, additionalData?: Record): LockingScript; }