Extract the inner sub-type from a polkadot-api { type: "Invalid", value: { type: ... } } thrown via signSubmitAndWatch's observable. Returns undefined for any other shape so callers can fall through to generic error handling.
{ type: "Invalid", value: { type: ... } }
signSubmitAndWatch
undefined
extractInvalidKind({ type: "Invalid", value: { type: "Stale" } }); // "Stale"extractInvalidKind(new Error("Network down")); // undefined Copy
extractInvalidKind({ type: "Invalid", value: { type: "Stale" } }); // "Stale"extractInvalidKind(new Error("Network down")); // undefined
Extract the inner sub-type from a polkadot-api
{ type: "Invalid", value: { type: ... } }thrown viasignSubmitAndWatch's observable. Returnsundefinedfor any other shape so callers can fall through to generic error handling.