import { Address, GSNConfig, GsnTransactionDetails, HttpClient, LoggerInterface, PartialRelayInfo, PingFilter, RelayInfoUrl, RelaySelectionResult, WaitForSuccessResults } from '@opengsn/common'; import { KnownRelaysManager } from './KnownRelaysManager'; export declare class RelaySelectionManager { private readonly knownRelaysManager; private readonly httpClient; private readonly config; private readonly logger; private readonly pingFilter; private readonly gsnTransactionDetails; private remainingRelays; private isInitialized; errors: Map; constructor(gsnTransactionDetails: GsnTransactionDetails, knownRelaysManager: KnownRelaysManager, httpClient: HttpClient, pingFilter: PingFilter, logger: LoggerInterface, config: GSNConfig); /** * Ping those relays that were not pinged yet, and remove both the returned relay or relays re from {@link remainingRelays} * @returns the first relay to respond to a ping message. Note: will never return the same relay twice. */ selectNextRelay(relayHub: Address, paymaster?: Address): Promise; _nextRelayInternal(relays: RelayInfoUrl[], relayHub: Address, paymaster?: Address): Promise; init(): Promise; relaysLeft(): RelayInfoUrl[]; _getNextSlice(): RelayInfoUrl[]; /** * @returns JSON response from the relay server, but adds the requested URL to it :'-( */ _getRelayAddressPing(relayInfo: RelayInfoUrl, relayHub: Address, paymaster?: Address): Promise; _waitForSuccess(relays: RelayInfoUrl[], relayHub: Address, paymaster?: Address): Promise>; _handleWaitForSuccessResults(raceResult: WaitForSuccessResults, skippedRelays: string[], winner?: PartialRelayInfo): void; selectWinnerFromResult(allPingResults: WaitForSuccessResults): { winner?: RelaySelectionResult; skippedRelays: string[]; }; /** * Pick a random relay among those that satisfy the original client gas fees parameters. */ selectWinnerWithoutAdjustingFees(allPingResults: WaitForSuccessResults): RelaySelectionResult | undefined; /** * Here we attempt to save the Relay Request attempt and avoid raising an exception in the client code. * As these Relay Servers did not agree to our suggested gas fees, we cannot rely on Random to pick a winner. * Pick Relay Servers deterministically with the closest gas fees instead. */ selectWinnerByAdjustingFees(allPingResults: WaitForSuccessResults): { winner?: RelaySelectionResult; skippedRelays: string[]; }; }