import type { EnrollmentRequest } from './enrollment.js'; /** * The onboarding-response envelope version this build mints and accepts. */ export declare const ONBOARDING_RESPONSE_VERSION = 1; /** * The longest suggested display label an onboarding response may carry, in * code points, after control characters are stripped and whitespace trimmed. */ export declare const ONBOARDING_LABEL_MAX_LENGTH = 64; /** * The onboarding-response envelope as it travels: the versioned wrapper, the * connect code verbatim, and the enrollee's optional suggested display label. */ export type WalletOnboardingResponse = { walletOnboarding: { v: number; code: string; label?: string; }; }; /** * ENROLLEE: builds the response envelope for a connect code it just minted. * The code is validated with the ceremony's own parser (a code this side * cannot parse is one the inviter would refuse), and the label is sanitized by * the same rule the parse side applies, so an envelope this call produces is * always one {@link parseOnboardingResponse} accepts. * * @param options {object} * @param options.code {string} the `freewallet-connect:` connect code * @param [options.label] {string} a display label to suggest for this client * @returns {WalletOnboardingResponse} */ export declare function encodeOnboardingResponse({ code, label }: { code: string; label?: string; }): WalletOnboardingResponse; /** * INVITER: validates a received onboarding-response body and hands back what * the approval screen needs -- the parsed enrollment request (so the * fingerprint renders without a second parse), the code verbatim (so * `approveEnrollment` receives exactly what the enrollee minted), and the * sanitized label, if any. Anything malformed throws: a body that is not an * object, a missing or mis-shaped envelope, an unsupported version, a * non-string or unparseable code, or a label that is not a string or exceeds * the cap. The remedy for every one of them is the same -- generate a new code * and try again. * * @param options {object} * @param options.body {unknown} the received JSON body * @returns {object} the parsed request, the code verbatim, and the label */ export declare function parseOnboardingResponse({ body }: { body: unknown; }): { request: EnrollmentRequest; code: string; label?: string; }; //# sourceMappingURL=onboardingResponse.d.ts.map