Skip to content
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

feat(ts): add Starknet data types #1523

Merged
merged 1 commit into from Dec 6, 2023

Conversation

xJonathanLEI
Copy link
Contributor

This is the first of a series of PRs for adding Starknet support into graph-tooling, following the addition of Starknet support in graph-node. This first PR adds support on the ts side, which is essentially mapped from the corresponding parts in graph-node.

This PR also adds a type Felt. This type is added because unlike in Ethereum where bytes and integers and distinct types (and hence have different representations in ABI), in Starknet the type felt252 (or felt in Cairo Zero) is often used to represent both addresses and numbers. If we simply use Bytes for it, users might find it difficult to convert them into BigInt, as BigInt only takes little-endian arrays.

Once this gets merged, I will submit follow-up PRs that add Starknet subgraph initialization, codegen, and compilation support on the cli side. I figured following the "ts first then cli" approach should be easier.

Copy link

changeset-bot bot commented Nov 29, 2023

🦋 Changeset detected

Latest commit: f8be947

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-ts Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@saihaj
Copy link
Member

saihaj commented Dec 4, 2023

hey @xJonathanLEI if you can please rebase or merge main I fixed the broken tests CI. This will fix all these tests and then we can merge this

@xJonathanLEI
Copy link
Contributor Author

xJonathanLEI commented Dec 4, 2023

Rebased. Thanks!

(Edit: CI seems to still be failing on main though?)

@saihaj
Copy link
Member

saihaj commented Dec 4, 2023

(Edit: CI seems to still be failing on main though?)

so on the PR that I merged CI was green #1527 .... investigating issue more seems like I have to pin pnpm version #1528

@xJonathanLEI
Copy link
Contributor Author

Yeah saw the green CI on PR too.. weird that it fails on main.

@saihaj
Copy link
Member

saihaj commented Dec 5, 2023

ok @xJonathanLEI if you can merge main to this branch it should work 🤞🏼

@saihaj saihaj enabled auto-merge (squash) December 5, 2023 21:02
auto-merge was automatically disabled December 6, 2023 04:14

Head branch was pushed to by a user without write access

@xJonathanLEI
Copy link
Contributor Author

Rebased. Let's see if it works :)

@saihaj saihaj enabled auto-merge (squash) December 6, 2023 15:03
@saihaj saihaj merged commit 167696e into graphprotocol:main Dec 6, 2023
7 checks passed
@xJonathanLEI xJonathanLEI deleted the dev/starknet_types branch December 6, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants