Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Jun 30, 2025

Changes

How this PR will be tested

  • Open the dashboard and click X. Result: A modal should appear.
  • Call the /foo/bar API. Result: Returns 200 with "baz" in the response body.

Output

(Example: Screenshot/GIF for UI changes, cURL output for API changes)


PR-Codex overview

This PR introduces a new optional tokenId field to the NFT schema and related functionality in the erc1155SignatureGenerate method, allowing for the specification of a token ID during the signature generation process.

Detailed summary

  • Added tokenId as an optional field to the schema in src/server/schemas/nft/index.ts.
  • Updated erc1155SignatureGenerate function to accept tokenId in its arguments.
  • Modified request handling to include tokenId in the payload.
  • Adjusted contract call to include tokenId when generating the signature.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Added support for an optional token ID when generating ERC-1155 signatures. Users can now specify a token ID to mint, or allow the system to generate one automatically.
  • API Changes

    • The ERC-1155 signature generation endpoints now accept and return a token ID field in the request and response payloads.

@coderabbitai
Copy link

coderabbitai bot commented Jun 30, 2025

Walkthrough

The changes introduce support for an optional tokenId field in the ERC-1155 signature generation endpoint for both v4 and v5 SDKs. This involves updating the request schema, extracting and processing tokenId in the handler, and including it in the response payload. The schema for ERC-1155 signature input is also updated accordingly.

Changes

File(s) Change Summary
src/server/routes/contract/extensions/erc1155/read/signature-generate.ts Added support for optional tokenId in ERC-1155 signature generation for v4 and v5 SDKs.
src/server/schemas/nft/index.ts Added optional tokenId field to the signature1155InputSchema.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Server
    participant SignatureGenV4
    participant SignatureGenV5

    Client->>Server: POST /erc1155/signature-generate (with optional tokenId)
    alt v5 SDK flow
        Server->>SignatureGenV5: Generate signature (include tokenId if provided)
        SignatureGenV5-->>Server: Signature response (with tokenId)
    else v4 SDK flow
        Server->>SignatureGenV4: Validate and generate signature (include tokenId if provided)
        SignatureGenV4-->>Server: Signature response (with tokenId)
    end
    Server-->>Client: Response (includes tokenId if present)
Loading

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • INF-171: Entity not found: Issue - Could not find referenced Issue.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4851842 and d915a9e.

📒 Files selected for processing (2)
  • src/server/routes/contract/extensions/erc1155/read/signature-generate.ts (5 hunks)
  • src/server/schemas/nft/index.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/server/routes/contract/extensions/erc1155/read/signature-generate.ts (1)
src/shared/utils/primitive-types.ts (1)
  • maybeBigInt (5-5)
🔇 Additional comments (6)
src/server/schemas/nft/index.ts (1)

305-310: LGTM! Clean schema addition with clear documentation.

The optional tokenId field addition follows the established schema patterns and includes helpful documentation explaining the field's purpose and default behavior.

src/server/routes/contract/extensions/erc1155/read/signature-generate.ts (5)

58-58: LGTM! Consistent schema extension for v5 SDK.

The optional tokenId field addition to the v5 request schema is consistent with the schema changes and properly typed.


149-149: LGTM! Proper destructuring for v5 tokenId.

The tokenId is correctly extracted from the request body alongside other parameters.


188-188: LGTM! Correct type conversion for v5 tokenId.

The maybeBigInt utility correctly converts the optional string tokenId to a BigInt for the v5 SDK mint request, handling the undefined case appropriately.


229-229: LGTM! Proper destructuring for v4 tokenId.

The tokenId is correctly extracted from the v4 request body with other parameters.


254-254: LGTM! Consistent payload handling for v4 tokenId.

The tokenId is properly included in the payload validation function call, maintaining consistency with the established parameter passing pattern.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@joaquim-verges joaquim-verges marked this pull request as ready for review June 30, 2025 23:12
@joaquim-verges joaquim-verges enabled auto-merge (squash) June 30, 2025 23:18
@joaquim-verges joaquim-verges disabled auto-merge June 30, 2025 23:18
@joaquim-verges joaquim-verges merged commit 857090a into main Jun 30, 2025
9 checks passed
@joaquim-verges joaquim-verges deleted the Add_tokenId_support_to_ERC1155_signature_generation branch June 30, 2025 23:18
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