Skip to content

chore: bump starknetjs version to v7 #440

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

Merged
merged 2 commits into from
Jul 9, 2025

Conversation

MartianGreed
Copy link
Collaborator

@MartianGreed MartianGreed commented May 9, 2025

Closes #

Introduced changes

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Add a dedicated CI job for new examples
  • Performed self-review of the code

Summary by CodeRabbit

  • Chores
    • Updated dependencies to use the latest versions of starknet and @starknet-io/get-starknet-core.
    • Updated internal package references to use the new scoped package naming convention for get-starknet-core.
  • Bug Fixes
    • Improved account connection logic for better compatibility with updated dependencies.
    • Refined parameter handling in account execution for enhanced reliability.

Copy link

coderabbitai bot commented May 9, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This change updates dependencies and refactors instantiation patterns across multiple packages. It replaces get-starknet-core with the scoped @starknet-io/get-starknet-core, bumps starknet and related package versions, and alters how accounts are instantiated in some modules. No new features or major logic changes are introduced.

Changes

Files/Paths Change Summary
.changeset/long-papers-judge.md Documents patch-level version bumps for multiple @dojoengine packages and a starknetjs version update.
pnpm-workspace.yaml Updates starknet to 7.1.0; replaces get-starknet-core with @starknet-io/get-starknet-core at version 4.0.7.
packages/create-burner/package.json, packages/react/package.json Changes dependency from get-starknet-core to @starknet-io/get-starknet-core.
packages/create-burner/src/connectors/burner.ts, .../dojoBurnerSWO.ts, .../dojoPredeployedSWO.ts, .../useBurnerWindowObject.ts, .../usePredeployedWindowObject.ts Updates import statements to use @starknet-io/get-starknet-core.
packages/core/src/provider/DojoProvider.ts Removes undefined argument from account.execute call, changing parameter passing.
packages/predeployed-connector/src/index.ts Switches from direct instantiation to using PredeployedWalletAccount.connect for account creation.

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant PredeployedWalletAccount
  participant Provider

  App->>Provider: Request accounts
  Provider->>PredeployedWalletAccount: connect(provider, wallet)
  PredeployedWalletAccount-->>Provider: Returns connected account
  Provider-->>App: Returns accounts
Loading

Possibly related PRs

Poem

In the garden of code, dependencies bloom,
Scoped names and versions sweep away gloom.
Connections refactored, imports made neat,
With every fresh package, the update’s complete.
A hop, a skip, a patch-level cheer—
The rabbit approves: the path is clear! 🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rsodre
Copy link
Contributor

rsodre commented May 9, 2025

I think this should wait until @starknet-react/core bumps to 4.0
https://www.npmjs.com/package/@starknet-react/core?activeTab=versions

@MartianGreed MartianGreed marked this pull request as ready for review July 9, 2025 06:07
@MartianGreed MartianGreed force-pushed the chore/bump-starknet-react-version branch from 5dc3697 to 4efe5f7 Compare July 9, 2025 06:08
@MartianGreed MartianGreed changed the base branch from main to release/1.6 July 9, 2025 06:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (6)
packages/create-burner/src/connectors/burner.ts (1)

2-2: Use import type for type-only imports.

The import statement should use import type since StarknetWindowObject is only used as a type in this file.

Apply this diff to use import type:

-import { StarknetWindowObject } from "@starknet-io/get-starknet-core";
+import type { StarknetWindowObject } from "@starknet-io/get-starknet-core";
packages/create-burner/src/hooks/useBurnerWindowObject.ts (1)

2-2: Prefer import type for type-only import

StarknetWindowObject is only used for type assertions and never at runtime, so flagging the import as type-only avoids emitting unnecessary code and satisfies the Biome lint.

-import { StarknetWindowObject } from "@starknet-io/get-starknet-core";
+import type { StarknetWindowObject } from "@starknet-io/get-starknet-core";
packages/create-burner/src/connectors/dojoBurnerSWO.ts (1)

1-1: Mark the interface import as type-only

The class merely implements the interface; the symbol is erased after compilation.

-import { StarknetWindowObject } from "@starknet-io/get-starknet-core";
+import type { StarknetWindowObject } from "@starknet-io/get-starknet-core";
packages/create-burner/src/connectors/dojoPredeployedSWO.ts (1)

1-1: Use import type for compile-time-only symbol

Same rationale as in dojoBurnerSWO.ts; keeps bundle lean and silences the Biome warning.

-import { StarknetWindowObject } from "@starknet-io/get-starknet-core";
+import type { StarknetWindowObject } from "@starknet-io/get-starknet-core";
packages/create-burner/src/hooks/usePredeployedWindowObject.ts (1)

2-2: Flag StarknetWindowObject as type import

The symbol is used only for typing the cast on line 30; import it with type to avoid runtime cost.

-import { StarknetWindowObject } from "@starknet-io/get-starknet-core";
+import type { StarknetWindowObject } from "@starknet-io/get-starknet-core";
.changeset/long-papers-judge.md (1)

15-16: Expand the summary to clarify compatibility constraints

The single-line summary doesn’t mention the known coupling with @starknet-react/core ≥4. Add a note so maintainers and consumers understand the pending external dependency before publishing.

Example:

-chore: bump starknetjs version
+chore: bump starknetjs to v7 (⚠️ requires @starknet-react/core ≥ 4 once released)

This reduces surprise and avoids premature upgrades.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30b6165 and 4efe5f7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .changeset/long-papers-judge.md (1 hunks)
  • packages/core/src/provider/DojoProvider.ts (1 hunks)
  • packages/create-burner/package.json (1 hunks)
  • packages/create-burner/src/connectors/burner.ts (1 hunks)
  • packages/create-burner/src/connectors/dojoBurnerSWO.ts (1 hunks)
  • packages/create-burner/src/connectors/dojoPredeployedSWO.ts (1 hunks)
  • packages/create-burner/src/hooks/useBurnerWindowObject.ts (1 hunks)
  • packages/create-burner/src/hooks/usePredeployedWindowObject.ts (1 hunks)
  • packages/predeployed-connector/src/index.ts (2 hunks)
  • packages/react/package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/create-burner/src/connectors/burner.ts

[error] 2-2: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.

(lint/style/useImportType)

packages/create-burner/src/connectors/dojoPredeployedSWO.ts

[error] 1-1: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.

(lint/style/useImportType)

packages/create-burner/src/connectors/dojoBurnerSWO.ts

[error] 1-1: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.

(lint/style/useImportType)

packages/create-burner/src/hooks/useBurnerWindowObject.ts

[error] 2-2: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.

(lint/style/useImportType)

packages/create-burner/src/hooks/usePredeployedWindowObject.ts

[error] 2-2: All these imports are only used as types.

Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.

(lint/style/useImportType)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: check
  • GitHub Check: build
🔇 Additional comments (6)
pnpm-workspace.yaml (1)

6-7: Ensure @starknet-react/core is compatible with Starknet v7.1.0

  • In pnpm-workspace.yaml you’ve bumped
    starknet from 6.23.1 → 7.1.0
    • replaced get-starknet-core with @starknet-io/get-starknet-core v4.0.7
  • Meanwhile, @starknet-react/core is still at 3.7.4 (latest stable), with a 4.0.1-beta.4 available.
  • Since @starknet-react/core now declares starknet and get-starknet-core as peer dependencies, you must:
    Test your setup with the 4.0.1-beta.4 release (peer deps aligned with Starknet 7.x), or
    Wait for a stable v4.0.0 if you prefer non-beta releases.
  • Refer to the official compatibility table for guidance:
    https://docs.starknet.io/tools/compatibility/?utm_source=openai

Please confirm which path you’ll take and that all tests pass against Starknet 7.1.0.

packages/react/package.json (1)

49-49: LGTM - Consistent dependency update.

The dependency name change from get-starknet-core to @starknet-io/get-starknet-core is consistent with the workspace catalog update and follows the migration to scoped packages.

packages/core/src/provider/DojoProvider.ts (1)

197-197: Verify StarkNet v7 Account.execute signature

- return await account?.execute(calls, undefined, details);
+ return await account?.execute(calls, details);
  • File: packages/core/src/provider/DojoProvider.ts (line 197)
    Please confirm that in the StarkNet v7 client, Account.execute no longer accepts a second (ABI) parameter and its signature is now (calls, details). If this aligns with the upstream v7 API, you’re good to merge; otherwise, adjust the call to match the correct method signature.
packages/predeployed-connector/src/index.ts (1)

253-266: Verify static connect exists on WalletAccount and signature matches

I didn’t find a static connect method defined in packages/predeployed-connector/src/index.ts (it only appears on the base WalletAccount class you extend). Please double-check that in starknet.js v7:

  • WalletAccount (the parent class) exposes a static connect(provider, accountBase) method
  • Its signature accepts (provider: Provider, base: PredeployedWallet) and returns an instance of your subclass
  • Invoking PredeployedWalletAccount.connect(provider, new PredeployedWallet(...)) correctly initializes the account
packages/create-burner/package.json (2)

51-51: Looks good – dependency renamed correctly

The move to the scoped package aligns with upstream changes and prevents duplicate installs.


46-53: No orphaned get-starknet-core imports in source code

The only matches for “get-starknet-core” are in pnpm-workspace.yaml and pnpm-lock.yaml (workspace config and lockfile metadata), not in any .js/.ts source files. No code-level imports or declarations remain, so no further changes are needed.

Comment on lines 2 to 12
"@dojoengine/predeployed-connector": patch
"@dojoengine/create-burner": patch
"@dojoengine/react": patch
"@dojoengine/core": patch
"@dojoengine/create-dojo": patch
"@dojoengine/sdk": patch
"@dojoengine/state": patch
"@dojoengine/torii-client": patch
"@dojoengine/torii-wasm": patch
"@dojoengine/utils": patch
"@dojoengine/utils-wasm": patch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🛠️ Refactor suggestion

🧩 Analysis chain

Patch bumps may be insufficient for a transitive major‐version upgrade

starknetjs jumps from v6 → v7 (major). Even if no public APIs of the Dojo packages changed, consumers can still face breaking changes because their own code now links against a different major of a peer/dep. According to semver best-practice, that normally warrants at least a minor bump (or major if you expose starknetjs types/classes) rather than a patch.

Consider promoting each affected package’s version increment from patchminor to signal the potential risk to downstream users.


🏁 Script executed:

#!/bin/bash
# Search for StarkNet library dependencies and versions in all package.json files
rg -n '"starknet' -C2 -g '*.json'

Length of output: 8577


Use minor bumps for packages depending on a new major of starknetjs
Patch bumps won’t signal the transitive upgrade of starknet from v6→v7 and may hide breaking changes for downstream consumers. Please update the bump type in .changeset/long-papers-judge.md from patchminor for each Dojo package that lists starknet as a peerDependency/dependency:

• @dojoengine/create-burner
• @dojoengine/react
• @dojoengine/core
• @dojoengine/sdk
• @dojoengine/state
• @dojoengine/utils
• @dojoengine/predeployed-connector

- "@dojoengine/create-burner": patch
- "@dojoengine/react":        patch
- "@dojoengine/core":         patch
- "@dojoengine/sdk":          patch
- "@dojoengine/state":        patch
- "@dojoengine/utils":        patch
- "@dojoengine/predeployed-connector": patch
+ "@dojoengine/create-burner": minor
+ "@dojoengine/react":        minor
+ "@dojoengine/core":         minor
+ "@dojoengine/sdk":          minor
+ "@dojoengine/state":        minor
+ "@dojoengine/utils":        minor
+ "@dojoengine/predeployed-connector": minor
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@dojoengine/predeployed-connector": patch
"@dojoengine/create-burner": patch
"@dojoengine/react": patch
"@dojoengine/core": patch
"@dojoengine/create-dojo": patch
"@dojoengine/sdk": patch
"@dojoengine/state": patch
"@dojoengine/torii-client": patch
"@dojoengine/torii-wasm": patch
"@dojoengine/utils": patch
"@dojoengine/utils-wasm": patch
"@dojoengine/predeployed-connector": minor
"@dojoengine/create-burner": minor
"@dojoengine/react": minor
"@dojoengine/core": minor
"@dojoengine/create-dojo": patch
"@dojoengine/sdk": minor
"@dojoengine/state": minor
"@dojoengine/torii-client": patch
"@dojoengine/torii-wasm": patch
"@dojoengine/utils": minor
"@dojoengine/utils-wasm": patch
🤖 Prompt for AI Agents
In .changeset/long-papers-judge.md lines 2 to 12, the version bumps for several
Dojo packages are marked as patch, but since these packages depend on a new
major version of starknetjs, the bumps should be minor to properly signal the
breaking change. Change the bump type from patch to minor for the listed
packages: @dojoengine/create-burner, @dojoengine/react, @dojoengine/core,
@dojoengine/sdk, @dojoengine/state, @dojoengine/utils, and
@dojoengine/predeployed-connector.

@MartianGreed MartianGreed force-pushed the chore/bump-starknet-react-version branch from 87a861e to f0ccf04 Compare July 9, 2025 09:31
@MartianGreed MartianGreed merged commit b9817aa into release/1.6 Jul 9, 2025
2 checks passed
@MartianGreed MartianGreed deleted the chore/bump-starknet-react-version branch July 9, 2025 09:35
MartianGreed added a commit that referenced this pull request Jul 25, 2025
* chore: bump starknetjs version to v7 (#440)

* chore: bump starknetjs version to v7

* chore: bump starknet-react

* fix: typedoc run

* feat: improve release

* chore: release

* chore: exit prerelease mode

* feat: improve release

* chore: release

* chore: exit prerelease mode

* fix: github workflow improvement

* chore: release

* chore: exit prerelease mode

* chore: bump starknet.js to 7.6.2

* feat: remove grpc client lock

* chore: bump dojo.c

* chore: release

* chore: exit prerelease mode

* chore: bump dojo.c

* chore: release

* chore: exit prerelease mode

* feat: historical zustand (#463)

* feat: historical zustand

* feat: add react hook

* chore: release

* chore: exit prerelease mode

* fix(sdk): zustand historical hook

* chore: release

* chore: exit prerelease mode

* fix(sdk): deduplicate historical_entities

* chore: release

* chore: exit prerelease mode

* fix(sdk): remove useless JSON parse

* chore: bump dojo & dojo-starter

* chore(sdk): add effect schema

* fix(torii-wasm): add type module to package.json

* chore: bump dojo.c

---------

Co-authored-by: MartianGreed <[email protected]>
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.

2 participants