Skip to content

Create separate schemas for query request_type options #79

@eclipseeer

Description

@eclipseeer

It this moment we have a one general schema - RpcQueryResponseSchema - for all request_type options - view_account, view_access_key etc.
Would be nice to create a separate shema per option, for example RpcQueryViewAccountResponseSchema - it will return the exact type instead of union, and eliminate a need to use if to get a real response type.

const parsed = RpcQueryResponseSchema().parse(camelCased);
if (!('keys' in parsed)) throw new Error('Invalid query response');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions