PollingTrackerConfig<R, T>
PollingTrackerConfig<
R,T> =object
Defined in: utils/initializePollingTracker.ts:55
The configuration of initializePollingTracker.
Type Parameters
R
R
The response type the fetcher reports.
T
T extends Pick<Transaction, "txKey" | "pending">
The tracked transaction type; only txKey and pending are required.
Properties
fetcher
fetcher: (
params) =>Promise<void>
Defined in: utils/initializePollingTracker.ts:63
Checks the transaction once per tick and reports through the callbacks it receives. It must call stopPolling on a
terminal result. A thrown error counts as a failed attempt.
Parameters
params
PollingFetcherParams<R, T>
The transaction, stopPolling and the callbacks.
Returns
Promise<void>
maxRetries?
optionalmaxRetries?:number
Defined in: utils/initializePollingTracker.ts:95
The number of consecutive failed attempts (thrown errors) after which polling stops. Defaults to 10.
onFailure
onFailure: (
response?) =>void
Defined in: utils/initializePollingTracker.ts:74
Called by the fetcher when the transaction failed, and without arguments by the tracker after maxRetries
consecutive failed attempts.
Parameters
response?
R
The result reported by the fetcher, if any.
Returns
void
onInitialize?
optionalonInitialize?: () =>void
Defined in: utils/initializePollingTracker.ts:76
Called once, synchronously, when polling starts.
Returns
void
onIntervalTick?
optionalonIntervalTick?: (response) =>void
Defined in: utils/initializePollingTracker.ts:81
Called by the fetcher with intermediate results.
Parameters
response
R
The intermediate result.
Returns
void
onReplaced?
optionalonReplaced?: (response) =>void
Defined in: utils/initializePollingTracker.ts:86
Called by the fetcher when the transaction was replaced.
Parameters
response
R
The result describing the replacement.
Returns
void
onSuccess
onSuccess: (
response) =>void
Defined in: utils/initializePollingTracker.ts:68
Called by the fetcher when the transaction succeeded.
Parameters
response
R
The result reported by the fetcher.
Returns
void
pollingInterval?
optionalpollingInterval?:number
Defined in: utils/initializePollingTracker.ts:93
The delay before each attempt, in milliseconds. Defaults to 5000.
removeTxFromPool?
optionalremoveTxFromPool?: (txKey) =>void
Defined in: utils/initializePollingTracker.ts:91
Called when polling stops, unless it was stopped with withoutRemoving: true.
Parameters
txKey
string
The txKey of the tracked transaction.
Returns
void
tx
tx:
T
Defined in: utils/initializePollingTracker.ts:57
The transaction to track. Polling starts only if pending is true.