import { Name, PublicKey } from '@wharfkit/antelope';
import { VCWithTypeType, VerifiableCredentialOptions, VerifiableCredentialWithType } from './ssi/vc';
import { Issuer } from 'did-jwt-vc';
import { App } from '../controllers/App';
import { IUserRequestsManager } from '../types/User';
import { SdkErrors } from './errors';
import { Serializable } from './serializable';
import { TonomyUsername } from './username';
import { KYCVC } from './veriff';
export type WalletResponseError = {
    code: SdkErrors;
    reason: string;
};
export type LoginRequestPayload = {
    login: {
        randomString: string;
        origin: string;
        publicKey: PublicKey;
        callbackPath: string;
    };
};
export type DataRequest = {
    username?: boolean;
    kyc?: boolean;
};
export type DataSharingRequestPayload = {
    data: DataRequest;
};
export type WalletRequestPayloadType = LoginRequestPayload | DataSharingRequestPayload;
export type WalletRequestPayload = {
    requests: WalletRequestPayloadType[];
};
export type LoginRequestResponsePayload = {
    login: {
        origin: string;
        callbackPath: string;
    };
};
export type DataSharingResponsePayload = {
    data: {
        username?: TonomyUsername;
        kyc?: KYCVC;
    };
};
export type WalletResponsePayloadType = LoginRequestResponsePayload | DataSharingResponsePayload;
export type WalletResponsePayload = {
    success: boolean;
    error?: WalletResponseError;
    responses?: WalletResponsePayloadType[];
};
export declare class WalletRequestVerifiableCredential extends VerifiableCredentialWithType<WalletRequestPayload> {
    protected static type: string;
    /**
     * @override the VerifiableCredentialWithType constructor to decode the payload of type LoginRequestPayload
     */
    constructor(vc: WalletRequestVerifiableCredential | VCWithTypeType<WalletRequestPayload>);
    /**
     * Alternative constructor that returns type LoginRequest
     */
    static signRequest(payload: WalletRequestPayload, issuer: Issuer, options?: VerifiableCredentialOptions): Promise<WalletRequestVerifiableCredential>;
}
export declare class WalletResponseVerifiableCredential extends VerifiableCredentialWithType<WalletResponsePayload> {
    protected static type: string;
    /**
     * @override the VerifiableCredentialWithType constructor to decode the payload of type LoginRequestPayload
     */
    constructor(vc: WalletResponseVerifiableCredential | VCWithTypeType<WalletResponsePayload>);
    /**
     * Alternative constructor that returns type LoginRequest
     */
    static signResponse(payload: WalletResponsePayload, issuer: Issuer, options?: VerifiableCredentialOptions): Promise<WalletResponseVerifiableCredential>;
}
export declare class WalletRequest implements Serializable {
    vc: WalletRequestVerifiableCredential;
    app?: App;
    constructor(vc: WalletRequestVerifiableCredential | VCWithTypeType<WalletRequestPayload>);
    static isLoginRequest(request: WalletRequestPayloadType): boolean;
    static isDataSharingRequest(request: WalletRequestPayloadType): boolean;
    getRequests(): WalletRequestPayloadType[];
    getLoginRequest(): LoginRequestPayload;
    getDataSharingRequest(): DataSharingRequestPayload | undefined;
    getOrigin(): string;
    verify(): Promise<boolean>;
    getDid(): string;
    checkReferrerOrigin(): void;
    getApp(): Promise<App>;
    /**
     * Accepts the wallet request and returns a WalletResponse.
     *
     * @param {IUserRequestsManager} user - The user manager to handle the request.
     * @param {boolean} [checkSsoDomain=false] - Whether to check the SSO domain for login requests.
     * @returns {Promise<WalletResponse>} - The wallet response containing the accepted requests.
     */
    accept(user: IUserRequestsManager, checkSsoDomain?: boolean): Promise<WalletResponse>;
    toJSON(): string;
    toString(): string;
}
export declare class DualWalletRequests implements Serializable {
    external: WalletRequest;
    sso?: WalletRequest;
    constructor(external: WalletRequest, sso?: WalletRequest);
    static fromString(str: string): DualWalletRequests;
    static fromUrl(): DualWalletRequests;
    verify(): Promise<boolean>;
    accept(user: IUserRequestsManager): Promise<DualWalletResponse>;
    reject(error: WalletResponseError): Promise<DualWalletResponse>;
    toJSON(): string;
    toString(): string;
}
export declare class WalletResponse implements Serializable {
    vc: WalletResponseVerifiableCredential;
    constructor(vc: WalletResponseVerifiableCredential | VCWithTypeType<WalletResponsePayload>);
    getResponses(): WalletResponsePayloadType[] | undefined;
    static isLoginResponse(response: WalletResponsePayloadType): boolean;
    static isDataSharingResponse(response: WalletResponsePayloadType): boolean;
    getLoginResponse(): LoginRequestResponsePayload;
    getDataSharingResponse(): DataSharingResponsePayload | undefined;
    getAccountName(): Name;
    toJSON(): string;
    toString(): string;
}
export declare class DualWalletResponse implements Serializable {
    success: boolean;
    external?: WalletResponse;
    sso?: WalletResponse;
    error?: WalletResponseError;
    requests?: DualWalletRequests;
    constructor(success: boolean, { external, sso, error, requests, }: {
        external?: WalletResponse;
        sso?: WalletResponse;
        error?: WalletResponseError;
        requests?: DualWalletRequests;
    });
    static fromResponses(external: WalletResponse, sso?: WalletResponse): DualWalletResponse;
    static fromError(error: WalletResponseError, requests: DualWalletRequests): DualWalletResponse;
    static fromString(str: string): DualWalletResponse;
    static fromUrl(): DualWalletResponse;
    isSuccess(): boolean;
    verify(): Promise<boolean>;
    toJSON(): string;
    toString(): string;
    getRedirectUrl(external?: boolean): string;
}
//# sourceMappingURL=request.d.ts.map