You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improves security and infrastructure around the wallet app while adding a new wagmi-based demo project. Key changes include a cryptographically secure ID generator in the dapp client, safer JSON-RPC error responses, CI/config updates, and the introduction of a standalone Vite+wagmi React example app with basic wallet connectivity and UI wiring.
Sequence diagram for JSON-RPC parse error handling in handleHttpRequest
sequenceDiagram
participant Client
participant Server
participant handleHttpRequest
participant errorResponse
Client->>Server: HTTP request with JSON body
Server->>handleHttpRequest: handleHttpRequest(req, res, debug)
handleHttpRequest->>handleHttpRequest: JSON.parse(body)
alt parse error
handleHttpRequest-->>handleHttpRequest: [throw SyntaxError]
handleHttpRequest->>errorResponse: errorResponse(undefined, -32700, Parse_error)
errorResponse-->>handleHttpRequest: generic_error_payload
handleHttpRequest->>Client: HTTP 400 with generic Parse error JSON
else valid JSON
handleHttpRequest-->>Client: normal JSON-RPC response
end
Loading
File-Level Changes
Change
Details
Files
Switch ID generation in the dapp transport to cryptographically secure randomness.
Replace Math.random-based ID suffix with crypto.getRandomValues using a Uint32Array
Generate a base-36 random string from two 32-bit values, padded and sliced to fixed length
Preserve existing Date.now-based prefix while improving entropy and predictability resistance
packages/wallet/dapp-client/src/DappTransport.ts
Harden HTTP JSON parse error handling in the primitives CLI server.
Catch JSON parse errors during request handling and log them server-side
Return a standardized JSON-RPC parse error response without echoing internal error details to clients
Introduce CircleCI configuration for Foundry-based solidity tests.
Define a CircleCI job that uses the foundry Docker image
Checkout code and initialize git submodules recursively
Run forge build and forge test -vvv as part of the test workflow
.circleci/config.yml
Add a new wagmi-based Vite React demo project with basic wallet connectivity.
Create a Vite+React TypeScript app scaffolded by create-wagmi with strict TS config and Biome linting
Configure wagmi with mainnet and sepolia chains plus injected, Coinbase Wallet, and WalletConnect connectors
Set up React Query client and WagmiProvider in main entry point
Define a large App component that initializes the Sequence wallet, manages environment/network selection, and exposes many demo actions (connect/auth flows, signing, transactions, token queries, and advanced wallet actions) via a button-driven UI
Add basic theming styles, HTML shell, vite config, and project metadata files including package.json, tsconfigs, README, .gitignore, and biome config
Fix merge branch 0xsequence/master #86: PR adds the wagmi-project app and wagmi.ts config implementing the chains/connectors relationships described in the issue.
Tips and commands
Interacting with Sourcery
Trigger a new review: Comment @sourcery-ai review on the pull request.
Continue discussions: Reply directly to Sourcery's review comments.
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with @sourcery-ai issue to create an issue from it.
Generate a pull request title: Write @sourcery-ai anywhere in the pull
request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
Generate a pull request summary: Write @sourcery-ai summary anywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment @sourcery-ai summary on the pull request to
(re-)generate the summary at any time.
Generate reviewer's guide: Comment @sourcery-ai guide on the pull
request to (re-)generate the reviewer's guide at any time.
Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!
Reviewer's Guide
Improves security and infrastructure around the wallet app while adding a new wagmi-based demo project. Key changes include a cryptographically secure ID generator in the dapp client, safer JSON-RPC error responses, CI/config updates, and the introduction of a standalone Vite+wagmi React example app with basic wallet connectivity and UI wiring.
Sequence diagram for JSON-RPC parse error handling in handleHttpRequest
sequenceDiagram participant Client participant Server participant handleHttpRequest participant errorResponse Client->>Server: HTTP request with JSON body Server->>handleHttpRequest: handleHttpRequest(req, res, debug) handleHttpRequest->>handleHttpRequest: JSON.parse(body) alt parse error handleHttpRequest-->>handleHttpRequest: [throw SyntaxError] handleHttpRequest->>errorResponse: errorResponse(undefined, -32700, Parse_error) errorResponse-->>handleHttpRequest: generic_error_payload handleHttpRequest->>Client: HTTP 400 with generic Parse error JSON else valid JSON handleHttpRequest-->>Client: normal JSON-RPC response endFile-Level Changes
packages/wallet/dapp-client/src/DappTransport.tspackages/wallet/primitives-cli/src/subcommands/server.ts.github/workflows/on_pr_pnpm-format-label.yml.github/workflows/tests.yml.circleci/config.ymlwagmi-project/package.jsonwagmi-project/tsconfig.jsonwagmi-project/tsconfig.node.jsonwagmi-project/src/App.tsxwagmi-project/src/main.tsxwagmi-project/src/wagmi.tswagmi-project/src/index.csswagmi-project/src/vite-env.d.tswagmi-project/index.htmlwagmi-project/vite.config.tswagmi-project/README.mdwagmi-project/.gitignorewagmi-project/.npmrcwagmi-project/biome.jsonlib/signals-implicit-mode/lib/sequence-v3/lib/account-abstraction/yarn.lockv8-compile-cache-0/x64/11.3.244.8-node.19/zSprojectzSsequence.jszSnode_moduleszS.pnpmzS@preconstruct+cli@2.8.7zSnode_moduleszS@preconstructzSclizSbin.js.MAPv8-compile-cache-0/x64/11.3.244.8-node.19/zSprojectzSworkspacezSnode_moduleszS.pnpmzS@preconstruct+cli@2.8.7zSnode_moduleszS@preconstructzSclizSbin.js.MAPPossibly linked issues
Tips and commands
Interacting with Sourcery
@sourcery-ai reviewon the pull request.issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it.@sourcery-aianywhere in the pullrequest title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time.@sourcery-ai summaryanywhere inthe pull request body to generate a PR summary at any time exactly where you
want it. You can also comment
@sourcery-ai summaryon the pull request to(re-)generate the summary at any time.
@sourcery-ai guideon the pullrequest to (re-)generate the reviewer's guide at any time.
@sourcery-ai resolveon thepull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
@sourcery-ai dismisson the pullrequest to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai reviewto trigger a new review!Customizing Your Experience
Access your dashboard to:
summary, the reviewer's guide, and others.
Getting Help
Originally posted by @sourcery-ai[bot] in #611 (comment)