Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Reduce type de-duplication and finalize all APIs #900

Description

@albrow

Related to #859. The combination of the new GraphQL API and the big database upgrade has left our types in a pretty bad place. There is a lot of code in the repository related purely to describing types with subtle differences and how to convert between them. There are a few different steps that we could take to address the problem. We need to prioritize any potential changes that could affect backwards compatibility so that they get included in the v10 release instead of afterwards.

  1. Use strings whenever possible instead of common.Address, common.Hash, and common.Bytes. Strings are easy to convert to JavaScript, JSON, GraphQL, and SQL, but the types from the common package need to be converted manually. This change alone would remove a lot of type conversion code.
  2. Make the browser API, native Go API, and GraphQL API match more closely. Ideally the browser API and the TypeScript GraphQL client should have the same interface. This will help us accomplish some of the goals laid out in GraphQL API Draft Specification #854 and simplify the experience of using 0x Mesh.
  3. Create a types package in the TypeScript monorepo (i.e. the packages/ directory) which contains all common types and conversion between them. @0x/mesh-browser, @0x/mesh-browser-lite, and @0x/mesh-graphql-client can all depend on this types package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions