checkGasSponsorshipEligibility
Defined in: aa-sdk/core/src/actions/smartAccount/checkGasSponsorshipEligibility.ts:56
This function verifies the eligibility of the connected account for gas sponsorship concerning the upcoming UserOperation (UO) that is intended to be sent.
Internally, this method invokes buildUserOperation, which navigates through the middleware pipeline, including the PaymasterMiddleware. Its purpose is to construct the UO struct meant for transmission to the bundler. Following the construction of the UO struct, this function verifies if the resulting structure contains a non-empty paymasterAndData field.
You can utilize this method before sending the user operation to confirm its eligibility for gas sponsorship. Depending on the outcome, it allows you to tailor the user experience accordingly, based on eligibility.
Example
Type Parameters
Parameters
Returns
Promise<CheckGasSponsorshipEligibilityResult<TAccount, GetEntryPointFromAccount<TAccount, SmartContractAccount<string, keyof EntryPointRegistryBase<unknown>>>>>
a Promise containing a boolean indicating if the account is elgibile for sponsorship and the sponsored UO