forked from 0xsequence/sequence.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Reviewer's Guide
Adds explicit session configuration helpers and exports in the dapp client to support EOA login flows, exposes additional primitives, and bumps all related package versions/changelogs to 3.0.0-beta.9.
Class diagram for new explicit session helper types
classDiagram
class SessionDuration {
+number days
+number hours
+number minutes
}
class NativeTokenSpending {
+bigint valueLimit
+Address.Address[] allowedRecipients
}
class ExplicitSessionParams {
+number chainId
+SessionDuration expiresIn
+Permission.Permission[] permissions
+NativeTokenSpending nativeTokenSpending
}
class ExplicitSessionConfig {
+number chainId
+bigint valueLimit
+bigint deadline
+Permission.Permission[] permissions
}
class Permission {
}
class Address {
}
ExplicitSessionParams --> SessionDuration : has
ExplicitSessionParams --> NativeTokenSpending : optional
ExplicitSessionParams --> Permission : uses
NativeTokenSpending --> Address : allowedRecipients
ExplicitSessionConfig --> Permission : permissions
Flow diagram for createExplicitSessionConfig helper
flowchart TD
A[start createExplicitSessionConfig] --> B[Read params.chainId, params.expiresIn, params.permissions, params.nativeTokenSpending]
B --> C[Compute nowInSeconds from Date.now]
C --> D[Normalize expiresIn days, hours, minutes with defaults 0]
D --> E[Compute sessionLifetimeSeconds = days*86400 + hours*3600 + minutes*60]
E --> F[Compute deadline = nowInSeconds + BigInt of sessionLifetimeSeconds]
F --> G{params.permissions length > 0?}
G -- no --> H[Throw Error: at least one permission required]
G -- yes --> I[Extract nativeTokenSpending]
I --> J[Set valueLimit = nativeTokenSpending.valueLimit or 0n]
J --> K[Copy nativeTokenReceivers from nativeTokenSpending.allowedRecipients or empty array]
K --> L[Map nativeTokenReceivers to nativeTokenSpendingPermissions with target and empty rules]
L --> M[Build ExplicitSessionConfig object]
M --> M1[chainId = params.chainId]
M1 --> M2[valueLimit = valueLimit]
M2 --> M3[deadline = deadline]
M3 --> M4[permissions = params.permissions concatenated with nativeTokenSpendingPermissions]
M4 --> N[return ExplicitSessionConfig]
N --> O[end createExplicitSessionConfig]
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Introduce helper types and factory for building ExplicitSessionConfig with optional native token spending constraints. |
|
packages/wallet/dapp-client/src/utils/index.ts |
| Expand dapp-client public API surface for session helpers, network utilities, and primitives needed by new login flows. |
|
packages/wallet/dapp-client/src/index.ts |
| Version bump and changelog entries for 3.0.0-beta.9 across services, wallet, and utility packages to reflect dapp client EOA login updates. |
|
packages/wallet/wdk/CHANGELOG.mdpackages/wallet/dapp-client/CHANGELOG.mdpackages/wallet/core/CHANGELOG.mdpackages/services/relayer/CHANGELOG.mdpackages/services/api/CHANGELOG.mdpackages/services/builder/CHANGELOG.mdpackages/services/guard/CHANGELOG.mdpackages/services/identity-instrument/CHANGELOG.mdpackages/services/indexer/CHANGELOG.mdpackages/services/marketplace/CHANGELOG.mdpackages/services/metadata/CHANGELOG.mdpackages/services/userdata/CHANGELOG.mdpackages/utils/abi/CHANGELOG.mdpackages/wallet/primitives/CHANGELOG.mdpackages/services/api/package.jsonpackages/services/builder/package.jsonpackages/services/guard/package.jsonpackages/services/identity-instrument/package.jsonpackages/services/indexer/package.jsonpackages/services/marketplace/package.jsonpackages/services/metadata/package.jsonpackages/services/relayer/package.jsonpackages/services/userdata/package.jsonpackages/utils/abi/package.jsonpackages/wallet/core/package.jsonpackages/wallet/dapp-client/package.jsonpackages/wallet/primitives/package.jsonpackages/wallet/wdk/package.json.changeset/tiny-files-chew.md |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon 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 issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull
request 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. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in
the 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. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull
request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon 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 dismisson 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 reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request
summary, the reviewer's guide, and others. - Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Originally posted by @sourcery-ai[bot] in #220 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Done