/** * Represents an OP_RETURN output — an unspendable output used to store * arbitrary data on-chain. * * OP_RETURN outputs are provably unspendable (the script immediately returns * false), so they do not bloat the UTXO set. Nodes prune them after indexing. * * Common uses: document timestamping, protocol metadata, asset issuance markers. */ export interface OpReturnData { /** The full locking script (OP_RETURN ) as hex. */ scriptPubKeyHex: string; /** The embedded data as hex. */ dataHex: string; /** The embedded data decoded as UTF-8 text, if valid. undefined if binary. */ dataText?: string; /** Number of data bytes embedded (not counting the script overhead). */ byteSize: number; } /** * Creates an OP_RETURN output embedding raw bytes. * * @param data - Arbitrary bytes to embed. Must not exceed MAX_OPRETURN_DATA bytes. * @throws If data exceeds the maximum allowed size. */ export declare function embedData(data: Uint8Array): OpReturnData; /** * Creates an OP_RETURN output embedding a UTF-8 string. * * @param text - Plain text to embed. Encoded to UTF-8 bytes before storing. */ export declare function embedText(text: string): OpReturnData; /** * Creates an OP_RETURN output from a hex string. * Useful when you already have the data as hex (e.g. a hash or identifier). * * @param hex - Hex-encoded bytes to embed. */ export declare function embedHex(hex: string): OpReturnData; /** * Serializes a JSON-serializable object to UTF-8 and embeds it in an OP_RETURN output. * Useful for lightweight on-chain metadata (e.g. protocol version tags, asset data). * * @param obj - Any JSON-serializable value. */ export declare function embedJSON(obj: unknown): OpReturnData; export declare function decodeOpReturn(scriptHex: string): OpReturnData | null; //# sourceMappingURL=opreturn.d.ts.map