UNPKG

@emeraldpay/api-node

Version:
20 lines (19 loc) 1.17 kB
import { ConnectionListener, IssuedTokenResponse, IssueTokenRequest, ListTokensRequest, ListTokensResponse, WhoIAmResponse } from '@emeraldpay/api'; import { ChannelCredentials } from '@grpc/grpc-js'; import { NativeChannel } from '../channel'; import { AuthClient as ProtoAuthClient } from '../generated/auth_grpc_pb'; import { AuthRequest as ProtoAuthRequest, AuthResponse as ProtoAuthResponse, RefreshRequest as ProtoRefreshRequest } from '../generated/auth_pb'; export declare class AuthClient { readonly client: ProtoAuthClient; readonly channel: NativeChannel; readonly credentials: ChannelCredentials; readonly retries: number; private readonly convert; constructor(address: string, credentials: ChannelCredentials, agents: string[], retries?: number); setConnectionListener(listener: ConnectionListener): void; authenticate(request: ProtoAuthRequest): Promise<ProtoAuthResponse>; refresh(request: ProtoRefreshRequest): Promise<ProtoAuthResponse>; whoIAm(): Promise<WhoIAmResponse>; listTokens(req: ListTokensRequest): Promise<ListTokensResponse>; issueToken(req: IssueTokenRequest): Promise<IssuedTokenResponse>; }