Skip to content

Feature Request: Type Inference #3

@hmtrent

Description

@hmtrent

Today, borsher does not perform type inference using the structure of schema:

    const schema = BorshSchema.Struct({
      myU64: BorshSchema.u64,
      myBool: BorshSchema.bool,
    });

    // x is typed as "unknown"
    const x = borshDeserialize(schema, bytes);

It's certainly possible for TypeScript to infer the type of x as { myU64: bigint; myBool: boolean }

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