~There is nothing stopping the user from shooting themselves in the foot with the types. For example, they call BlocksTraces without first setting the Traces option. The returned data will be Trace data, but the underlying call will have gone through the regular Blocks routines. BlockNumber and TransactionIndex will be filled, but nothing else. The JSON parser is "forgiving" in the sense that it ignores unknown fields and doesn't require other fields.~
The Globals data allows users to specify options for which the underlying routine does not have the capability. For example, enabling Raw on routines that have no --raw option. There's a solution here. Instead of embedding the Globals, we can include any available fields in the sdk TypeOptions so the user can only set those values that are available.
~There is nothing stopping the user from shooting themselves in the foot with the types. For example, they call
BlocksTraces
without first setting theTraces
option. The returned data will beTrace
data, but the underlying call will have gone through the regularBlocks
routines.BlockNumber
andTransactionIndex
will be filled, but nothing else. The JSON parser is "forgiving" in the sense that it ignores unknown fields and doesn't require other fields.~The Globals data allows users to specify options for which the underlying routine does not have the capability. For example, enabling Raw on routines that have no --raw option. There's a solution here. Instead of embedding the Globals, we can include any available fields in the sdk TypeOptions so the user can only set those values that are available.