wallet-kit / types / paylink.d.ts
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * Hand-authored declarations for the "./paylink" export of
 * ardegazu-wallet-kit — the compiled dist/paylink.js.
 *
 * Its own module so a page that only renders an incoming `#pay=` link does not
 * pull LedgerStore and a localStorage fold in with it. Same two functions the
 * "." export re-exports.
 */

import type { PayRequest } from "./index.js";

/**
 * `https://banca.ardegazu.ro/#pay=<b64url(JSON.stringify(wpr))>`
 *
 * Build-side: THROWS on a request that is not structurally valid, and encodes
 * the rebuilt one, so a link always carries the documented key order.
 */
export declare function payRequestUrl(wpr: PayRequest): string;

/**
 * Decode + fully verify a `#pay=` fragment. Accepts a whole URL, a fragment
 * with or without its `#`, and a fragment carrying other parameters. Resolves
 * null on any failure — no such parameter, a non-canonical or malformed
 * encoding, bad JSON, or a signature that does not hold — and never throws.
 *
 * Canonical base64url only: standard base64 and percent-encoding are rejected,
 * so one request has exactly one link.
 */
export declare function parsePayFragment(fragment: unknown): Promise<PayRequest | null>;

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/wallet-kit.git