Skip to content

docs: Update documentation for JSON-RPC methods#3875

Merged
Mrtenz merged 4 commits intomainfrom
mrtenz/update-docs
Feb 26, 2026
Merged

docs: Update documentation for JSON-RPC methods#3875
Mrtenz merged 4 commits intomainfrom
mrtenz/update-docs

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Feb 26, 2026

This updates the documentation following the changes in #3872. This makes sure we have proper user-facing documentation for the newly extracted data as well.


Note

Medium Risk
Mostly docstring and typing clarifications across exported SDK method types, but there is a small breaking-shape risk where ManageAccountsParams is simplified and Cronjob['request'] is retyped from JsonRpcRequest to a { method, params } shape.

Overview
Updates the Snap SDK’s exported JSON-RPC method type docs to be more explicit/consistent (e.g., “params objects”, when results are always null, and richer field-level JSDoc for dialogs, notifications, web sockets, background events, and client status).

Makes a couple of type-shape adjustments: ManageAccountsParams becomes a single object with optional params (instead of a union), and cronjob request typing in permissions.ts switches to an explicit { method, params?: JsonRpcParams } structure, which flows into scheduling/background-event request types.

Written by Cursor Bugbot for commit 5f64eda. This will update automatically on new commits. Configure here.

@Mrtenz Mrtenz marked this pull request as ready for review February 26, 2026 11:18
@Mrtenz Mrtenz requested a review from a team as a code owner February 26, 2026 11:18
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.57%. Comparing base (da6a7fb) to head (5f64eda).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3875   +/-   ##
=======================================
  Coverage   98.57%   98.57%           
=======================================
  Files         425      425           
  Lines       12314    12314           
  Branches     1921     1921           
=======================================
  Hits        12139    12139           
  Misses        175      175           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
method: string;
params: Json[] | Record<string, Json>;
};
export type ManageAccountsParams = {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if changing this union is gonna have downstream effects

Copy link
Member Author

Choose a reason for hiding this comment

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

I can revert if you want to be sure, but will need to adjust the extraction script then to combine them again. Otherwise the result doesn't make much sense 😅

Copy link
Member

Choose a reason for hiding this comment

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

Do you think it'll cause issues?

Copy link
Member Author

@Mrtenz Mrtenz Feb 26, 2026

Choose a reason for hiding this comment

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

Since snap.request infers the params type as ManageAccountsParams, I don't think it should cause issues. The concern when we implemented this was likely generic Json types, which would only work with exactOptionalPropertyTypes: true (because undefined isn't assignable to Json). I tested this with exactOptionalPropertyTypes: false and it still works fine.

@Mrtenz Mrtenz enabled auto-merge February 26, 2026 13:47
@Mrtenz Mrtenz added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 4f1e6e4 Feb 26, 2026
127 checks passed
@Mrtenz Mrtenz deleted the mrtenz/update-docs branch February 26, 2026 13:49
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