-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly parse structs in Starknet return types
Currently, starknet.js doesn't do a good job with structs, such as the Uint256 struct returned by the ERC20 contract. Instead of returning all the fields of the struct, it just returns the first field. Concretely, if a user had a balance of 1 in an ERC20 contract, this is what would have been returned from `balance_of` previously: ```json { "res": "0x0" } ``` With this change we properly parse the Uint256 struct, so the method will instead return the following: ```json { "res": { "low": "0x1", "high": "0x0" } } ```
- Loading branch information
Showing
2 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters