starknet-io / starknet.js

JavaScript library for StarkNet
https://www.starknetjs.com
MIT License
1.22k stars 747 forks source link

Calldata decoder & API Encoder (with ABI) #952

Open tabaktoni opened 9 months ago

tabaktoni commented 9 months ago

Is your feature request related to a problem? Please describe. This feature is nice to have as tools could use it and build on it. Currently, we support encoding &. decoding with ABI: JSC types -> calldata responsedata -> JSC types

Describe the solution you'd like It would also be nice to have a calldata decoder: calldata -> JSC types and api data encoder: JSC types -> responsedata Internally we do not need such a flow other than maybe adding additional validation options/ testing, but this could help

  1. case: describe calldata parameters for various explorers &. tools.
  2. case: encode response for rpc node & tools.

Additional context With ABI this would complete a circle of data conversion as so one could do: calldata -> JSC types -> responsedata We could improve the test with excepted results for echo test methods

AryanGodara commented 8 months ago

Hi @tabaktoni ; Can I work on this issue? I've been reading up on the repo, for some time now. I initially saw it on OnlyDust, and asked @ivpavici if I could work on this one. Looks like no one else has picked this issue yet :D

AryanGodara commented 8 months ago

@ivpavici Thanks for assigning this to me. :D I won't be able to get to it before coming Monday, because of some other obligations 😅 But this is in my list and I'll try to push the relevant changes in a few days.

ivpavici commented 8 months ago

no worries, take your time!