Skip to main content

isGasSponsorshipError

A type guard function that checks if an error is related to gas sponsorship policies. This is useful for handling cases where a transaction was expected to be sponsored but didn’t match any sponsorship policies.

Usage

Parameters

Returns

boolean - Returns true if the error is a gas sponsorship error, false otherwise.

React

Use isGasSponsorshipError inside a button handler’s catch block to show appropriate UI when sponsorship fails:
Last modified on June 24, 2026