Skip to content

@lelantos-org/sdk / services/relayer / isShieldedFeeRejection

Function: isShieldedFeeRejection() โ€‹

ts
function isShieldedFeeRejection(err): err is NetworkError<NetworkErrorCode>;

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:63

Whether a thrown error is a relayer refusing a submission over its shielded fee.

The relayer answers 402 for this and for nothing else, so the status alone is decisive โ€” but only for errors from this client. 402 is also the x402 payment-challenge status, which core/http.ts handles separately via onPaymentRequired; the point of a named predicate is that a call site says which of the two it means.

The reason is in err.body, verbatim from the relayer: which asset, what it paid, what was required, and the grace band. It is prose, not JSON โ€” enough to show a user or put in a log, not something to parse for a number.

The useful reaction is almost always to re-estimate and rebuild rather than to resubmit: the quote a fee was sized against has gone stale, and the same payload will be refused again.

Parameters โ€‹

ParameterType
errunknown

Returns โ€‹

err is NetworkError<NetworkErrorCode>

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub