/** * Canonical-CBOR of the LCP label value — a text-keyed map `{ atrHash, v }`, keys ordered by encoded * length then bytewise (RFC 8949 §4.2.1). `"v"` (1-byte text) sorts before `"atrHash"` (7-byte text), so * the on-chain, canonical key order is `v` then `atrHash` — matching the reference `encMetadatum` * sort. Returns the metadatum bytes. */ export declare function encodeLcpMetadatum(fields: { atrHash: string; v: string; }): Uint8Array; /** The JSON shape of the LCP label value as Blockfrost returns it under `json_metadata`. */ export interface LcpMetadataValue { /** LCP spec version this binding conforms to — the value of `LCP_SPEC_VERSION`, never a literal. */ v: string; /** atrHash as bare lowercase hex (no 0x), 64 chars. */ atrHash: string; } /** * Build the LCP label value object (Blockfrost `json_metadata` shape). Throws on a malformed atrHash * (fail-fast). This is the JSON view; `encodeLcpMetadatum` is the on-chain CBOR view of the same value. */ export declare function buildLcpMetadataValue(atrHash: string, v: string): LcpMetadataValue; /** * Recover the 0x-prefixed atrHash from an LCP label value object, or `null` if it is not a well-formed * LCP metadatum (so a metadata scan skips non-LCP entries rather than erroring). Accepts any-case hex * DIGITS and a stray lowercase `0x` prefix (defensive against a non-canonical writer), but the prefix * itself must be lowercase: `isAtrHash` is the ATR canon, and it rejects `0X` — the same rule the * carrier corpus pins with its uppercase-0X reject vector. */ export declare function decodeLcpMetadataValue(value: unknown): `0x${string}` | null; /** A single tx-metadata array entry (Blockfrost `GET /txs/{hash}/metadata`, or the same row out of * db-sync or Koios). `label` is a metadata label — a Cardano `word64` — and indexers disagree about how * to spell one on the wire; see {@link recoverAtrHashFromMetadata}. */ export interface BlockfrostMetadataEntry { /** The metadata label. Blockfrost serialises it as a decimal STRING; db-sync and Koios hand back a * NUMBER. Both spellings are the same label and both are accepted. */ label: string | number; json_metadata: unknown; } /** * Extract the 0x-prefixed atrHash from a tx-metadata array (the recover boundary), or `null` if no * LCP-label entry carries a well-formed atrHash. * * ⛔⛔ **THE LABEL COMPARISON WAS `m.label === String(label)`, AND A NUMERIC LABEL LOST IT.** That is a * strict comparison against a string, so an entry whose `label` is `8847` — a NUMBER — matched nothing, * `find` answered `undefined`, and a genuinely welded settlement read `no-atr-metadata`: the refusal that * says the transaction carries no LCP weld at all. The number is not an exotic shape. This module's own * port docblock names db-sync and Koios beside Blockfrost as the indexers a reader wraps, and a numeric * label is precisely what those two return; only Blockfrost's JSON quotes it. So the reading depended on * which indexer the consumer happened to bridge, and the failure was a false NEGATIVE — the direction no * caller can challenge, because "this transaction has no LCP metadata" looks exactly like the truth. * * ⭐ **NORMALISED ON BOTH SIDES, WHICH IS A TOTAL COMPARISON RATHER THAN A FALLBACK.** A Cardano metadata * label is a `word64`, so its decimal spelling is unique: no two distinct labels share one, and * `String(8847) === String("8847")` is exact rather than lenient. There is no second attempt here and no * "try it the other way" — one comparison, over the one canonical spelling of a number. */ export declare function recoverAtrHashFromMetadata(metadata: readonly BlockfrostMetadataEntry[] | null | undefined, label: number): `0x${string}` | null; /** True iff `value` carries exactly `atrHash` (verification-time check). */ export declare function verifyAtrMetadata(inputs: { value: unknown; atrHash: string; }): boolean; //# sourceMappingURL=metadata.d.ts.map