Skip to content

Update SDK Docs & Update TS Example App#589

Merged
dimast-x merged 1 commit intomainfrom
feat-v1/update-sdk-docs
Feb 25, 2026
Merged

Update SDK Docs & Update TS Example App#589
dimast-x merged 1 commit intomainfrom
feat-v1/update-sdk-docs

Conversation

@dimast-x
Copy link
Contributor

@dimast-x dimast-x commented Feb 25, 2026

Summary by CodeRabbit

  • New Features

    • Added on-chain governance capabilities: dispute submission, token allowance management, and balance inquiries.
    • Introduced acknowledgment for off-chain state updates.
    • Added channel-scoped session key support.
    • Copy-to-clipboard feature for wallet addresses.
  • Documentation

    • Comprehensive integration guide with setup instructions and signer configuration.
    • Updated API patterns emphasizing off-chain state construction followed by on-chain settlement.
    • Added token allowance and session key lifecycle guidance.

@dimast-x dimast-x requested a review from a team as a code owner February 25, 2026 14:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cea67a5 and 7060e02.

⛔ Files ignored due to path filters (1)
  • sdk/ts/examples/example-app/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • sdk/go/README.md
  • sdk/ts/README.md
  • sdk/ts/examples/example-app/README.md
  • sdk/ts/examples/example-app/src/components/WalletDashboard.tsx

📝 Walkthrough

Walkthrough

This PR updates SDK documentation and examples across Go and TypeScript to reflect new on-chain governance helpers, channel signer patterns, a two-step state-operation workflow, and expanded session-key APIs. The WalletDashboard component UI is simplified by removing acknowledge-modal logic.

Changes

Cohort / File(s) Summary
Go SDK Documentation
sdk/go/README.md
Updated API documentation for new on-chain governance helpers (Challenge, ApproveToken, GetOnChainBalance), refactored state-key APIs with App-session and Channel-scoped variants, introduced ChannelSigner interface and related implementations, and modified NewClient to require core.ChannelSigner for state signing.
TypeScript SDK Documentation
sdk/ts/README.md
Reframed operations as a two-step pattern: build/co-sign off-chain states, then settle on-chain via checkpoint(); updated method signatures to return core.State; added acknowledge() operation; introduced new session-key APIs with channel and app-session variants; expanded error documentation.
Example App Guide
sdk/ts/examples/example-app/README.md
Restructured from "SDK React Demo" to comprehensive "Integration Guide" with step-by-step sections covering Quick Start, Core Concepts (two-signer model, ChannelDefaultSigner), Operations (deposit/transfer/withdraw/checkpoint/acknowledge with code examples), Token Allowance, Session Keys, and Client Options.
Example App Component
sdk/ts/examples/example-app/src/components/WalletDashboard.tsx
Removed acknowledge-modal logic (useRef for lastAckDismissedVersion, showAckModal state); simplified acknowledge handling to banner-only; added copy-to-clipboard feedback with Copy/Check icon toggle for wallet address display.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

ready

Suggested reviewers

  • philanton
  • nksazonov

Poem

🐰 With docs we hop, through states we skip,
Two-step dance—off-chain dips, on-chain trip,
Channel signers, session keys aligned,
APIs refactored, examples refined.
A clearer path for devs to find!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-v1/update-sdk-docs

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dimast-x, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly updates the documentation for both the Go and TypeScript SDKs, clarifying the distinction between off-chain state operations and on-chain blockchain settlement. It introduces new functionalities for blockchain interaction and refines the handling of session keys. Additionally, the TypeScript example application has been overhauled to reflect these new patterns and provide a more robust integration guide, improving the overall developer experience and ensuring consistency across SDKs.

Highlights

  • Go SDK Documentation Enhancements: Added new blockchain settlement methods including Challenge, ApproveToken, and GetOnChainBalance. The documentation for session keys has been refined and split into 'App Sessions' and 'Channels' for better clarity. The SubmitAppSessionDeposit method signature was updated, and new files asset_cache.go and doc.go were introduced to the SDK directory structure. Crucially, the usage of the ChannelSigner interface is now explicitly explained, requiring EthereumMsgSigner to be wrapped with core.NewChannelDefaultSigner.
  • TypeScript SDK Documentation Refactoring: The 'High-Level Operations' section was renamed to 'State Operations' to better reflect the off-chain nature of these methods, and a new 'Blockchain Settlement' section was introduced for on-chain interactions via checkpoint(). New methods like challenge, approveToken, checkTokenAllowance, and acknowledge are now documented. The getChannels method was added for comprehensive channel querying. The state management concept is clarified with a two-step pattern: build/co-sign off-chain, then checkpoint on-chain. Session key documentation was also split into 'App Session Keys' and 'Channel Session Keys'.
  • TypeScript Example Application Updates: The example application was renamed from 'nitrolite-react-demo' to 'nitrolite-example-app' and its README was comprehensively updated to align with the new SDK concepts, including detailed integration steps for client creation, various operations, token allowance handling, state change detection, and session key management. Minor UI adjustments were made in WalletDashboard.tsx, removing an acknowledge modal and adding a copy-to-clipboard feature for wallet addresses. The viem dependency was also updated.
Changelog
  • sdk/go/README.md
    • Added new blockchain settlement methods: Challenge, ApproveToken, and GetOnChainBalance.
    • Updated the signature for client.SubmitAppSessionDeposit.
    • Refactored 'Session Keys' documentation into 'Session Keys — App Sessions' and 'Session Keys — Channels'.
    • Introduced asset_cache.go and doc.go to the SDK directory structure.
    • Clarified the usage of ChannelSigner interface and the need to wrap EthereumMsgSigner with core.NewChannelDefaultSigner.
  • sdk/ts/README.md
    • Renamed 'High-Level Operations' to 'State Operations' and introduced 'Blockchain Settlement' section.
    • Added new methods: challenge, approveToken, checkTokenAllowance, and acknowledge.
    • Included client.getChannels for listing all channels.
    • Updated state management explanation to emphasize the two-step pattern (off-chain state building and on-chain checkpointing).
    • Refactored 'Session Keys' documentation into 'App Session Keys' and 'Channel Session Keys'.
    • Updated examples to reflect the new two-step state management pattern.
  • sdk/ts/examples/example-app/README.md
    • Renamed the project from 'Nitrolite SDK React Demo' to 'Nitrolite SDK Integration Guide'.
    • Updated the README with detailed integration steps for creating wallet signers, client creation, various operations (deposit, withdraw, transfer, acknowledge, close, checkpoint), querying data, handling token allowance, detecting state changes, and cleanup.
    • Added a comprehensive section on 'Session Keys (Auto-Sign)' including enablement and revocation.
    • Updated the 'Project Structure' section to reflect current file organization.
  • sdk/ts/examples/example-app/package-lock.json
    • Updated the project name from 'nitrolite-react-demo' to 'nitrolite-example-app'.
    • Updated the version of @erc7824/nitrolite from 1.0.0 to 0.5.3.
    • Updated the viem dependency version from ^2.44.0 to ^2.46.1.
  • sdk/ts/examples/example-app/src/components/WalletDashboard.tsx
    • Removed the showAckModal state and related logic for displaying an acknowledge popup.
    • Removed the lastAckDismissedVersion useRef hook.
    • Added copy-to-clipboard functionality for wallet addresses in the UI.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dimast-x dimast-x merged commit 868b6ea into main Feb 25, 2026
10 of 11 checks passed
@dimast-x dimast-x deleted the feat-v1/update-sdk-docs branch February 25, 2026 14:45
@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a significant update to the SDK documentation for both Go and TypeScript, focusing on a new two-step pattern for blockchain interactions. High-level operations now prepare and co-sign states off-chain, requiring an explicit checkpoint() call for on-chain settlement. New API methods for challenging, token approval, on-chain balance queries, and enhanced session key management have been added and thoroughly documented. The TypeScript example application has been refactored into a comprehensive integration guide, demonstrating the new usage patterns and improving the user experience with UI enhancements like a copy-to-clipboard feature and a simplified acknowledge flow. Overall, these changes greatly improve the clarity and functionality of the SDK, making it more robust and easier to integrate.

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.

1 participant