Skip to content

[Portal] EIP-7702 Session Key Docs (.NET) #7448

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 1 commit into from
Jun 26, 2025

Conversation

0xFirekeeper
Copy link
Member

@0xFirekeeper 0xFirekeeper commented Jun 26, 2025

Closes TOOL-4880


PR-Codex overview

This PR introduces new functionalities for managing session keys in the EcosystemWallet for the EIP-7702 standard, including new actions, metadata, and usage examples for various wallet operations.

Detailed summary

  • Added new sidebar links in sidebar.tsx for EIP-7702 actions.
  • Created metadata and documentation for:
    • SignerHasFullPermissions
    • GetCallPoliciesForSigner
    • GetSessionExpirationForSigner
    • GetTransferPoliciesForSigner
    • GetSessionStateForSigner
    • CreateSessionKey
  • Provided detailed usage examples and parameters for each new action in page.mdx files.

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

Summary by CodeRabbit

  • New Features

    • Expanded sidebar navigation with new links for EIP-7702 session key actions under the wallet section.
    • Added documentation for EIP-7702 session key management, including creating session keys, checking signer permissions, retrieving call and transfer policies, session expiration, and session state.
  • Documentation

    • Introduced detailed guides and usage examples for new EIP-7702 wallet session key features and related methods in the .NET SDK.
    • Clarified sidebar link names to distinguish between EIP-4337 and EIP-7702 session key creation.

@0xFirekeeper 0xFirekeeper requested review from a team as code owners June 26, 2025 15:43
Copy link

linear bot commented Jun 26, 2025

Copy link

changeset-bot bot commented Jun 26, 2025

⚠️ No Changeset found

Latest commit: 102a8c8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jun 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2025 4:21pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
nebula ⬜️ Skipped (Inspect) Jun 26, 2025 4:21pm
thirdweb_playground ⬜️ Skipped (Inspect) Jun 26, 2025 4:21pm
thirdweb-www ⬜️ Skipped (Inspect) Jun 26, 2025 4:21pm
wallet-ui ⬜️ Skipped (Inspect) Jun 26, 2025 4:21pm

Copy link
Contributor

coderabbitai bot commented Jun 26, 2025

Walkthrough

This change adds comprehensive documentation for EIP-7702 session key management in the .NET SDK portal. It introduces new sidebar navigation links and six new documentation pages covering session key creation, permission checks, policy retrieval, session expiration, and session state queries for EIP-7702-compatible ecosystem wallets.

Changes

File(s) Change Summary
apps/portal/src/app/dotnet/sidebar.tsx Added new sidebar group and links for EIP-7702 session key methods; renamed an existing link for clarity.
apps/portal/src/app/dotnet/wallets/actions/createsessionkey7702/page.mdx Added documentation for EcosystemWallet.CreateSessionKey (EIP-7702) and related session key management methods.
apps/portal/src/app/dotnet/wallets/actions/signerhaspermissions7702/page.mdx Added documentation for EcosystemWallet.SignerHasFullPermissions.
apps/portal/src/app/dotnet/wallets/actions/getcallpolicies7702/page.mdx Added documentation for EcosystemWallet.GetCallPoliciesForSigner.
apps/portal/src/app/dotnet/wallets/actions/gettransferpolicies7702/page.mdx Added documentation for EcosystemWallet.GetTransferPoliciesForSigner.
apps/portal/src/app/dotnet/wallets/actions/getsessionexpiration7702/page.mdx Added documentation for EcosystemWallet.GetSessionExpirationForSigner.
apps/portal/src/app/dotnet/wallets/actions/getsessionstate7702/page.mdx Added documentation for EcosystemWallet.GetSessionStateForSigner.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PortalDoc
    participant EcosystemWallet

    User->>PortalDoc: Navigate to EIP-7702 session key doc page
    PortalDoc->>EcosystemWallet: Call CreateSessionKey/CheckPermissions/QueryPolicies/Expiration/State
    EcosystemWallet-->>PortalDoc: Return result (receipt, boolean, policy list, timestamp, or state)
    PortalDoc-->>User: Display documentation, usage, and examples
Loading

Assessment against linked issues

Objective Addressed Explanation
Add session key docs for .NET SDK (TOOL-4880)

Possibly related PRs

Suggested labels

Portal

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • EIP-7702: Entity not found: Issue - Could not find referenced Issue.
  • EIP-4337: Entity not found: Issue - Could not find referenced Issue.
✨ 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.

@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Jun 26, 2025
Copy link
Contributor

graphite-app bot commented Jun 26, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link

codecov bot commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.92%. Comparing base (472e737) to head (102a8c8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7448   +/-   ##
=======================================
  Coverage   51.92%   51.92%           
=======================================
  Files         947      947           
  Lines       63875    63875           
  Branches     4214     4214           
=======================================
  Hits        33166    33166           
  Misses      30603    30603           
  Partials      106      106           
Flag Coverage Δ
packages 51.92% <ø> (ø)
🚀 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.

Copy link
Contributor

@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: 0

🧹 Nitpick comments (12)
apps/portal/src/app/dotnet/wallets/actions/signerhaspermissions7702/page.mdx (2)

15-21: Code sample is missing the System.Numerics import

BigInteger lives under System.Numerics; without the using directive, the snippet will not compile in a blank file.
Quick win: prepend the snippet with the import (or fully-qualify BigInteger).

+using System.Numerics;
 
 // Check if a signer has full permissions
 bool hasFullPermissions = await ecosystemWallet.SignerHasFullPermissions(
     chainId: 1,
     signerAddress: "0x1234567890123456789012345678901234567890"
 );

31-42: Headings render as plain text inside <Details>

MDX often swallows leading spaces after an opening tag.
To guarantee Markdown parsing (and avoid the LanguageTool “loose punctuation” alert) insert a blank line after <Details …>.

 <Details summary="Parameters">
+
 ### chainId

Repeat for the “Return Value” and “Exceptions” blocks.

apps/portal/src/app/dotnet/sidebar.tsx (1)

107-131: Consider making this subsection collapsible

The “InAppWallet & EcosystemWallet” list now contains 8 items and is likely to keep growing.
Setting isCollapsible: true would keep the sidebar compact and consistent with other long groups.

-    isCollapsible: false,
+    isCollapsible: true,
apps/portal/src/app/dotnet/wallets/actions/getcallpolicies7702/page.mdx (2)

15-21: Add System.Numerics import for completeness

Same rationale as the previous file—readers copying the snippet will hit a compilation error otherwise.

+using System.Numerics;
 
 // Get call policies for a signer
 var callPolicies = await ecosystemWallet.GetCallPoliciesForSigner(
     chainId: 1,
     signerAddress: "0x1234567890123456789012345678901234567890"
 );

31-41: Blank line inside <Details> improves MDX rendering

Insert a blank line after the opening <Details> tag to ensure headings render properly (same issue as flagged in the previous doc page).

apps/portal/src/app/dotnet/wallets/actions/gettransferpolicies7702/page.mdx (2)

15-21: Import for BigInteger missing

Mirror the earlier suggestion: add using System.Numerics; so the snippet compiles out-of-box.


35-45: Insert blank line after <Details> tags

Same rendering concern as the other pages—add an empty line after the <Details> opening tag for “Parameters”, “Return Value”, and “Exceptions”.

apps/portal/src/app/dotnet/wallets/actions/getsessionexpiration7702/page.mdx (1)

38-48: Add blank line after <Details> tag

Consistent MDX rendering / fixes LanguageTool warning:

<Details summary="Parameters">
+
### chainId

Repeat for each <Details> block.

apps/portal/src/app/dotnet/wallets/actions/getsessionstate7702/page.mdx (1)

32-37: Prefer ToHex() over BitConverter.ToString for selector output

BitConverter.ToString(limit.Selector) prints a dash-separated string ("A9-05-9C-BB").
Elsewhere in the docs you use .ToHex() which yields the canonical "0xa9059cbb" form. Staying consistent avoids confusing readers and removes the need for manual post-processing.

-Console.WriteLine($"  {limit.Target}.{BitConverter.ToString(limit.Selector)}: {limit.Remaining} ETH remaining");
+Console.WriteLine($"  {limit.Target}.{limit.Selector.ToHex()}: {limit.Remaining} ETH remaining");
apps/portal/src/app/dotnet/wallets/actions/createsessionkey7702/page.mdx (3)

34-40: Period should be 0 when LimitType is Lifetime

A lifetime limit (LimitType = 1) ignores Period, but the sample sets it to 86400, which may mislead readers into thinking the field is used. Either set Period = 0 or switch to an allowance (LimitType = 2) if you want a resettable daily cap.

-        ValueLimit = new UsageLimit
-        {
-            LimitType = 1, // Lifetime limit
-            Limit = BigInteger.Parse("1000000000000000000"), // 1 ETH total
-            Period = 86400 // 1 day period
-        },
+        ValueLimit = new UsageLimit
+        {
+            LimitType = 1, // Lifetime limit
+            Limit = BigInteger.Parse("1000000000000000000"), // 1 ETH total
+            Period = 0 // Period unused for lifetime limits
+        },

63-70: Same inconsistency for transfer policy example

The transfer policy below repeats the LimitType = 1 + non-zero Period combination. Align it with the correction above.

-        ValueLimit = new UsageLimit
-        {
-            LimitType = 1, // Lifetime limit
-            Limit = BigInteger.Parse("1000000000000000000"), // 1 ETH total
-            Period = 86400 // 1 day
-        }
+        ValueLimit = new UsageLimit
+        {
+            LimitType = 1, // Lifetime limit
+            Limit = BigInteger.Parse("1000000000000000000"), // 1 ETH total
+            Period = 0 // Unused for lifetime limits
+        }

227-233: Clarify the interplay between grantFullPermissions and “wildcard” signer

The paragraph states that grantFullPermissions = true creates a wildcard session that ignores call/transfer policies, yet a separate sample uses the zero address signer to achieve “wildcard” behaviour. Explicitly distinguishing “wildcard signer address” from “wildcard permission scope” would help prevent misunderstandings.

Consider adding a short note such as:

“Wildcard signer (0x000…000) controls who may use the session, whereas grantFullPermissions controls what that signer can do.”

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 472e737 and 53ad188.

📒 Files selected for processing (7)
  • apps/portal/src/app/dotnet/sidebar.tsx (2 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/createsessionkey7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/getcallpolicies7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/getsessionexpiration7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/getsessionstate7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/gettransferpolicies7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/signerhaspermissions7702/page.mdx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.@(ts|tsx)`: Accept a typed 'props' object and export a named function (e.g...

**/*.@(ts|tsx): Accept a typed 'props' object and export a named function (e.g., export function MyComponent()).
Combine class names via 'cn', expose 'className' prop if useful.
Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Local state or effects live inside; data fetching happens in hooks.
Merge class names with 'cn' from '@/lib/utils' to keep conditional logic readable.
Stick to design-tokens: background ('bg-card'), borders ('border-border'), muted text ('text-muted-foreground') etc.
Use the 'container' class with a 'max-w-7xl' cap for page width consistency.
Spacing utilities ('px-', 'py-', 'gap-*') are preferred over custom margins.
Responsive helpers follow mobile-first ('max-sm', 'md', 'lg', 'xl').
Never hard-code colors – always go through Tailwind variables.
Tailwind CSS is the styling system – avoid inline styles or CSS modules.
Prefix files with 'import "server-only";' so they never end up in the client bundle (for server-only code).

📄 Source: CodeRabbit Inference Engine (.cursor/rules/dashboard.mdc)

List of files the instruction was applied to:

  • apps/portal/src/app/dotnet/sidebar.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: joaquim-verges
PR: thirdweb-dev/js#7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-25T02:13:08.257Z
Learning: Wallet architecture should unify Wallet and Account interfaces, support in-app wallets (social/email login), smart wallets with account abstraction, and EIP-1193, EIP-5792, EIP-7702 standards.
apps/portal/src/app/dotnet/sidebar.tsx (2)
Learnt from: joaquim-verges
PR: thirdweb-dev/js#7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: MananTank
PR: thirdweb-dev/js#7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:155-160
Timestamp: 2025-06-10T00:46:58.580Z
Learning: In the dashboard application, the route structure for team and project navigation is `/team/[team_slug]/[project_slug]/...` without a `/project/` segment. Contract links should be formatted as `/team/${teamSlug}/${projectSlug}/contract/${chainId}/${contractAddress}`.
🪛 LanguageTool
apps/portal/src/app/dotnet/wallets/actions/signerhaspermissions7702/page.mdx

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~40-~40: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to check perm...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/getcallpolicies7702/page.mdx

[uncategorized] ~35-~35: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~39-~39: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to get call p...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/gettransferpolicies7702/page.mdx

[uncategorized] ~39-~39: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~43-~43: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to get transf...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/getsessionexpiration7702/page.mdx

[uncategorized] ~42-~42: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~46-~46: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to get sessio...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/getsessionstate7702/page.mdx

[uncategorized] ~51-~51: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~55-~55: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to get sessio...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/createsessionkey7702/page.mdx

[uncategorized] ~217-~217: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID for the session key. ### ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~221-~221: Loose punctuation mark.
Context: ...ession key. ### signerAddress string: The address of the signer for the sessi...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~225-~225: Loose punctuation mark.
Context: ... address. ### durationInSeconds long: Duration in seconds for which the sessi...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/portal/src/app/dotnet/wallets/actions/getsessionexpiration7702/page.mdx (1)

22-30: Potential overflow when casting BigInteger to long

BigIntegerlong cast can throw if the timestamp exceeds Int64.MaxValue.
Safer pattern:

if (expirationTimestamp > long.MaxValue)
{
    throw new OverflowException("Timestamp exceeds long.MaxValue");
}
var expirationDateTime = DateTimeOffset.FromUnixTimeSeconds((long)expirationTimestamp);

Worth noting in the sample or a cautionary note.

@0xFirekeeper 0xFirekeeper added the merge-queue Adds the pull request to Graphite's merge queue. label Jun 26, 2025
Copy link
Member Author

0xFirekeeper commented Jun 26, 2025

Merge activity

Copy link
Contributor

github-actions bot commented Jun 26, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 62.75 KB (0%) 1.3 s (0%) 289 ms (+163.42% 🔺) 1.6 s
thirdweb (cjs) 351.77 KB (0%) 7.1 s (0%) 1.1 s (+14.97% 🔺) 8.1 s
thirdweb (minimal + tree-shaking) 5.72 KB (0%) 115 ms (0%) 122 ms (+1491.13% 🔺) 237 ms
thirdweb/chains (tree-shaking) 530 B (0%) 11 ms (0%) 67 ms (+2184.65% 🔺) 78 ms
thirdweb/react (minimal + tree-shaking) 19.61 KB (0%) 393 ms (0%) 143 ms (+683.24% 🔺) 536 ms

Closes TOOL-4880

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces new features and updates for the `EcosystemWallet` in the Thirdweb .NET SDK, focusing on EIP-7702 functionalities, including session management and permissions.

### Detailed summary
- Added new sidebar links for EIP-7702 actions.
- Updated `CreateSessionKey` function to include EIP-7702 functionalities.
- Introduced detailed documentation for new methods: `SignerHasFullPermissions`, `GetCallPoliciesForSigner`, `GetTransferPoliciesForSigner`, `GetSessionExpirationForSigner`, and `GetSessionStateForSigner`.
- Each method includes usage examples, parameter details, return values, and exception handling.

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

<!-- end pr-codex -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Expanded sidebar navigation with new links for EIP-7702 session key actions under the wallet section.
  * Added documentation for EIP-7702 session key management, including creating session keys, checking signer permissions, retrieving call and transfer policies, session expiration, and session state.

* **Documentation**
  * Introduced detailed guides and usage examples for new EIP-7702 wallet session key features and related methods in the .NET SDK.
  * Clarified sidebar link names to distinguish between EIP-4337 and EIP-7702 session key creation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the firekeeper/dotnet-7702-docs branch from 53ad188 to 102a8c8 Compare June 26, 2025 16:19
@vercel vercel bot temporarily deployed to Preview – thirdweb-www June 26, 2025 16:19 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 26, 2025 16:19 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula June 26, 2025 16:19 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 26, 2025 16:19 Inactive
@graphite-app graphite-app bot merged commit 102a8c8 into main Jun 26, 2025
22 of 23 checks passed
@graphite-app graphite-app bot deleted the firekeeper/dotnet-7702-docs branch June 26, 2025 16:22
@graphite-app graphite-app bot removed the merge-queue Adds the pull request to Graphite's merge queue. label Jun 26, 2025
Copy link
Contributor

@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: 0

🧹 Nitpick comments (7)
apps/portal/src/app/dotnet/wallets/actions/signerhaspermissions7702/page.mdx (1)

15-30: Add missing using System.Numerics; in the snippet

The example relies on BigInteger, but the snippet omits the corresponding using directive. Newcomers copying the code verbatim will hit a compile-time error.

 ```csharp
+using System.Numerics;

 // Check if a signer has full permissions
 bool hasFullPermissions = await ecosystemWallet.SignerHasFullPermissions(
     chainId: 1,
     signerAddress: "0x1234567890123456789012345678901234567890"
 );
apps/portal/src/app/dotnet/wallets/actions/getcallpolicies7702/page.mdx (1)

17-29: Prefer Convert.ToHexString over BitConverter.ToString for selector display

BitConverter.ToString(byte[]) inserts dashes and uses upper-case, producing output like 12-34-56-78, which is uncommon for function selectors. Convert.ToHexString (NET 5+) gives a compact hex string without separators.

-Console.WriteLine($"Can call {policy.Target} with selector {BitConverter.ToString(policy.Selector)}");
+Console.WriteLine($"Can call {policy.Target} with selector 0x{Convert.ToHexString(policy.Selector)}");
apps/portal/src/app/dotnet/wallets/actions/gettransferpolicies7702/page.mdx (1)

25-32: Use case-insensitive address comparison to detect ETH transfers

Ethereum addresses are case-insensitive. A strict string equality check may fail if policy.Target comes back in mixed-case checksum format.

-    string tokenType = policy.Target == "0x0000000000000000000000000000000000000000" 
+    string tokenType = policy.Target.Equals(
+        "0x0000000000000000000000000000000000000000",
+        StringComparison.OrdinalIgnoreCase)
         ? "ETH" 
         : $"Token {policy.Target}";
apps/portal/src/app/dotnet/wallets/actions/getsessionstate7702/page.mdx (1)

32-37: Consistent selector formatting

See earlier note on Convert.ToHexString for cleaner selector output.

-Console.WriteLine($"  {limit.Target}.{BitConverter.ToString(limit.Selector)}: {limit.Remaining} ETH remaining");
+Console.WriteLine($"  {limit.Target}.0x{Convert.ToHexString(limit.Selector)}: {limit.Remaining} ETH remaining");
apps/portal/src/app/dotnet/wallets/actions/createsessionkey7702/page.mdx (3)

42-46: Clarify the constraint comment to avoid contradictory wording

Condition = 1 maps to “Equal”.
The inline comment “(not 0)” suggests “Not Equal / Non-zero”, which is the opposite semantic.
Consider re-phrasing to remove the ambiguity:

-Condition = 1, // Equal to (not 0)
+Condition = 1, // Equal (parameter must match RefValue)

73-74: Use EIP-55 checksum addresses in docs

The sample token address is not checksummed (0xA0b86…C0c).
Using checksum-case in documentation reduces accidental copy-paste errors and increases readability.
Recommend converting all hard-coded addresses in the examples to their checksummed form.


349-355: Document using System.Numerics; for BigInteger-based snippets

Every code snippet that instantiates BigInteger will fail to compile unless the caller imports System.Numerics.
Add a short note (or prepend using System.Numerics;) in the first snippet to prevent friction for readers copying the sample.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 53ad188 and 102a8c8.

📒 Files selected for processing (7)
  • apps/portal/src/app/dotnet/sidebar.tsx (2 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/createsessionkey7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/getcallpolicies7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/getsessionexpiration7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/getsessionstate7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/gettransferpolicies7702/page.mdx (1 hunks)
  • apps/portal/src/app/dotnet/wallets/actions/signerhaspermissions7702/page.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/portal/src/app/dotnet/sidebar.tsx
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: joaquim-verges
PR: thirdweb-dev/js#7268
File: packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts:210-216
Timestamp: 2025-06-03T23:44:40.243Z
Learning: EIP7702 wallets do not need special handling for switching chains, unlike EIP4337 wallets which require reconnection when switching chains. In the switchChain method condition, EIP7702 should be intentionally excluded from the reconnection logic.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-25T02:13:08.257Z
Learning: Wallet architecture should unify Wallet and Account interfaces, support in-app wallets (social/email login), smart wallets with account abstraction, and EIP-1193, EIP-5792, EIP-7702 standards.
🪛 LanguageTool
apps/portal/src/app/dotnet/wallets/actions/createsessionkey7702/page.mdx

[uncategorized] ~217-~217: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID for the session key. ### ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~221-~221: Loose punctuation mark.
Context: ...ession key. ### signerAddress string: The address of the signer for the sessi...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~225-~225: Loose punctuation mark.
Context: ... address. ### durationInSeconds long: Duration in seconds for which the sessi...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/getcallpolicies7702/page.mdx

[uncategorized] ~35-~35: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~39-~39: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to get call p...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/getsessionexpiration7702/page.mdx

[uncategorized] ~42-~42: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~46-~46: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to get sessio...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/getsessionstate7702/page.mdx

[uncategorized] ~51-~51: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~55-~55: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to get sessio...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/gettransferpolicies7702/page.mdx

[uncategorized] ~39-~39: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~43-~43: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to get transf...

(UNLIKELY_OPENING_PUNCTUATION)

apps/portal/src/app/dotnet/wallets/actions/signerhaspermissions7702/page.mdx

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ..."Parameters"> ### chainId BigInteger: The chain ID of the EIP-7702 account. ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~40-~40: Loose punctuation mark.
Context: ...02 account. ### signerAddress string: The address of the signer to check perm...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Unit Tests
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/portal/src/app/dotnet/wallets/actions/getsessionexpiration7702/page.mdx (1)

22-35: Guard against BigIntegerlong overflow when converting timestamps

Casting an unbounded BigInteger to long will throw if the value exceeds long.MaxValue (e.g., corrupted on-chain data). A safe-guard avoids unexpected crashes in sample code.

-var expirationDateTime = DateTimeOffset.FromUnixTimeSeconds((long)expirationTimestamp);
+long ts;
+try
+{
+    ts = (long)expirationTimestamp;
+}
+catch (OverflowException)
+{
+    throw new InvalidOperationException($"Timestamp {expirationTimestamp} is out of range.");
+}
+var expirationDateTime = DateTimeOffset.FromUnixTimeSeconds(ts);

@vercel vercel bot temporarily deployed to Production – thirdweb_playground June 26, 2025 16:22 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb-www June 26, 2025 16:22 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui June 26, 2025 16:22 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Portal Involves changes to the Portal (docs) codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants