diff --git a/src/clients/SpokePoolClient.ts b/src/clients/SpokePoolClient.ts index 7edf114c..d740fde4 100644 --- a/src/clients/SpokePoolClient.ts +++ b/src/clients/SpokePoolClient.ts @@ -302,6 +302,16 @@ export class SpokePoolClient extends BaseAbstractClient { return validateFillForDeposit(fill, depositWithMatchingDepositId) ? depositWithMatchingDepositId : undefined; } + /** + * Find a valid fill for a given deposit. + * @param deposit A deposit event. + * @returns A valid fill for the deposit, or undefined. + */ + public getFillForDeposit(deposit: Deposit): FillWithBlock | undefined { + const fills = this.depositHashesToFills[this.getDepositHash(deposit)]; + return fills?.find((fill) => validateFillForDeposit(fill, deposit)); + } + /** * Find the unfilled amount for a given deposit. This is the full deposit amount minus the total filled amount. * @param deposit The deposit to find the unfilled amount for.