import { CreateTokenRequest, GatekeeperAPIStatus } from '../types'; export declare const isGkApiStatusTokenCreated: (code: number) => boolean; export declare const isGkApiStatusTokenPending: (code: number) => boolean; export declare const isGkApiStatusRequestedRetriesExhausted: (code: number) => boolean; export declare const isGkApiStatusFailure: (code: number) => boolean; export declare const withoutUndefined: (obj: Record) => Record; export type GatekeeperClientConfig = { baseUrl: string; queryParams?: Record; headers?: Record; stage: string; fetchImplementation?: (input: RequestInfo | URL, init?: RequestInit | undefined) => Promise; numRetries?: number; walletAddress?: string; }; export type GatekeeperErrorResponse = { errorCode?: string; payload?: Record; }; export type GatekeeperRecordResponse = GatekeeperErrorResponse & { state: GatekeeperAPIStatus; pending?: { presentationRequestId: string; }; }; export type RequestTokenIssuanceResponse = GatekeeperErrorResponse & { status: number; transaction: string; pending: { presentationRequestId: string; }; }; export type RequestTokenRefreshResponse = GatekeeperErrorResponse & { status: number; transaction: string; state?: string; }; export default class GatekeeperClient { initConfig: GatekeeperClientConfig; private abortController; private baseUrl; private queryParams; private headers; private stage; private defaultRetryParams; private fetchImplementation; private fetchWithRetry; constructor(initConfig: GatekeeperClientConfig, flowId?: string); private instanceName; abort(): void; private addQueryParams; private continueIfNotAborted; private urlForWallet; getGatekeeperRecordWithPayload(walletAddress: string): Promise; getGatekeeperStatus(walletAddress: string): Promise; requestGatewayTokenFromGatekeeper({ wallet, payload, proof, payer, }: CreateTokenRequest): Promise; /** * Tries to refresh a token. * If it fails with a 5xx, handleFetchError will retry a number of times. */ refreshToken({ wallet, payload, proof, payer, }: CreateTokenRequest): Promise; }