Skip to content

[WIP] - replace request/response functional parsing to OO CairoTypes #1475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 34 commits into
base: develop
Choose a base branch
from

Conversation

tabaktoni
Copy link
Member

@tabaktoni tabaktoni commented Aug 18, 2025

Motivation and Resolution

Goal:
OO "self-contained composable" - CairoType
AR "accurate representation" - Byte representation
DD "Data-driven configurability" - Strategy Map

  • Convert all implemented parsing types to CairoTypes
  • Eventually remove request and response parsers
  • Programmable request/response using Strategy map
  • Remove formatter (replaced by Strategy map)
  • refactor higher-order types to contain appropriate CairoTypes
  • substitute lower-order types to contain CairoFelt instead of JS types like BigInt (Felt should be the only one having value represented as non CairoType "ByteArray").

Usage related changes

  • At the end, for the Contract Class users, none ( parsing should be abstracted), and an addition should be an option to define a response type based on the cairo type using a strategy map.
  • For the tooling devs, they should now have access to all Cairo representation types. "self-contained composable units".

Development related changes

Instead of functional parsing and utils for api, have self-contained CairoTypes similar to the native JS types (Number, String, BigInt....)

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

tabaktoni and others added 30 commits August 4, 2025 23:48
* feat: reduce TX wait time, and provide known failed reasons based on TX flow

* test: eventless write bytearray xtest

* feat: uint static factory methods

* refactor: cleanup

* feat: missing primitive integers implemented as cairo types

* chore: cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant