import type { HexString } from '../types.js'; /** The JSON representation of a {@linkcode Type} */ export type JSON = { /** The inner url */ url: string; /** The checksum SHA-256 of the URL */ checksumSha256?: HexString; /** Any additional values. These are hex representations of CBOR encoded values. */ _additional?: Record; }; /** The intermediary CBOR representation of a {@linkcode Type} */ export type CBOR = { /** The inner url */ url: string; /** The checksum SHA-256 of the URL */ checksumSha256?: Uint8Array; /** * Any additional values. These are CBOR intermediary representations of values and might include custom tags if * not handled by adding decoders for these. */ [key: string]: unknown; }; /** * Protocol level token (PLT) metadata URL. */ declare class TokenMetadataUrl { #private; /** The inner url */ readonly url: string; /** The checksum SHA-256 of the URL */ readonly checksumSha256?: Uint8Array | undefined; /** * Additional metadata url fields. Any keys in this object must not collide with the explicit fields for the * type. */ readonly additional?: Record | undefined; /** * Constructs a new TokenMetadataUrl instance. */ constructor( /** The inner url */ url: string, /** The checksum SHA-256 of the URL */ checksumSha256?: Uint8Array | undefined, /** * Additional metadata url fields. Any keys in this object must not collide with the explicit fields for the * type. */ additional?: Record | undefined); /** * Get a string representation of the token metadata URL. * @returns {string} The string representation. */ toString(): string; /** * Get a JSON-serializable representation of the token metadata URL. This is called implicitly when serialized with JSON.stringify. * @returns {JSON} The JSON representation. */ toJSON(): JSON; } /** * Protocol level token (PLT) metadata URL. */ export type Type = TokenMetadataUrl; /** * Create a protocol level token metadata URL. * * @param {string} url - The URL of the token metadata. * @param {Uint8Array} [checksumSha256] - The SHA-256 checksum of the URL. * @param {Record} [additional] - Additional metadata fields. * @returns {TokenMetadataUrl} A new token metadata URL instance. */ export declare function create(url: string, checksumSha256?: Uint8Array, additional?: Record): TokenMetadataUrl; /** * Create a protocol level token metadata URL from a string value. If the url should be * accompanied by a checksum or any other additional values, use {@linkcode create} instead. * * @param {string} url - The string to create the token ID from. * @returns {TokenMetadataUrl} A new token metadata URL instance. */ export declare function fromString(url: string): TokenMetadataUrl; /** * Type predicate for {@linkcode Type} * * @param value value to check. * @returns whether `value` is of type {@linkcode Type} */ export declare function instanceOf(value: unknown): value is TokenMetadataUrl; /** * Converts {@linkcode JSON} to a token amount. * * @param {string} json The JSON representation of token metadata URL. * @returns {TokenMetadataUrl} The token metadata URL. */ export declare function fromJSON({ url, checksumSha256, _additional }: JSON): TokenMetadataUrl; /** * Converts a TokenMetadataUrl object to it's intermediary {@linkcode CBOR} representation. * * @param tokenMetadataUrl - The TokenMetadataUrl object to convert. * @returns A CBOR-compatible value representation of the TokenMetadataUrl. */ export declare function toCBORValue(tokenMetadataUrl: TokenMetadataUrl): CBOR; /** * Encodes a TokenMetadataUrl object into a CBOR-formatted Uint8Array. * * @param tokenMetadataUrl - The TokenMetadataUrl object to encode. * @returns A Uint8Array containing the CBOR encoding of the TokenMetadataUrl. */ export declare function toCBOR(tokenMetadataUrl: TokenMetadataUrl): Uint8Array; /** * Constructs a TokenMetadataUrl object from it's {@linkcode CBOR}. * * @param value - The CBOR-compatible value to decode. The expected format is {@linkcode CBOR}. * @returns The decoded TokenMetadataUrl object. * @throws Will throw an error if the value is not a valid CBOR representation of TokenMetadataUrl. */ export declare function fromCBORValue(value: unknown): TokenMetadataUrl; /** * Decodes a CBOR-encoded Uint8Array into a TokenMetadataUrl object. * * @param cbor - The CBOR-encoded Uint8Array to decode. * @returns The decoded TokenMetadataUrl object. * @throws Will throw an error if the CBOR data is not a valid representation of TokenMetadataUrl. */ export declare function fromCBOR(cbor: Uint8Array): TokenMetadataUrl; /** * Registers a CBOR encoder for the TokenMetadataUrl type with the `cbor2` library. * This allows TokenMetadataUrl instances to be automatically encoded when used with * the `cbor2` library's encode function. * * @returns {void} * @example * // Register the encoder * registerCBOREncoder(); * // Now TokenMetadataUrl instances can be encoded directly * const encoded = encode(myTokenMetadataUrl); */ export declare function registerCBOREncoder(): void; export {};