Yield Xyz Unknown Enum Adapter Factory
Gson factory that decodes unrecognized enum values to a designated UNKNOWN constant instead of failing.
Gson's default enum adapter maps an unrecognized value to null, which then violates a non-null Kotlin field (latent NPE). Yield.xyz (StakeKit) is an external provider that periodically adds new action/transaction and opportunity types, so this keeps response decoding resilient.
JSON null is also mapped to UNKNOWN for the same reason: a null token would otherwise leave a non-null Kotlin enum property as null at runtime. Non-string tokens (number/boolean/object) are skipped and mapped to UNKNOWN so decode stays resilient.
The factory only applies to enums that declare an UNKNOWN constant; every other enum falls back to Gson's default adapter.