Dargon789/sequence.js
Vedi su GitHub# Class diagram for new explicit session config utilities
Open
#215 aperta il 18 gen 2026
dependenciesdocumentationduplicateenhancementgood first issuehelp wantedinvalidjavascriptquestion
Metriche repository
- Star
- (1 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Reviewer's Guide
Implements new dapp-client utilities to build explicit session configs (including native token spending controls) and re-exports additional primitives for EOA login flows, extends login methods to support EOA, adjusts Apple OAuth handling to omit the scope parameter, and bumps multiple package versions and changelogs to 3.0.0-beta.9 with associated changesets.
Class diagram for new explicit session config utilities
classDiagram
class SessionDuration {
number days
number hours
number minutes
}
class NativeTokenSpending {
bigint valueLimit
Address[] allowedRecipients
}
class ExplicitSessionParams {
number chainId
SessionDuration expiresIn
Permission[] permissions
NativeTokenSpending nativeTokenSpending
}
class ExplicitSessionConfig {
number chainId
bigint valueLimit
bigint deadline
Permission[] permissions
}
class DappClientUtils {
createExplicitSessionConfig(params ExplicitSessionParams) ExplicitSessionConfig
}
class LoginMethod {
google
apple
email
passkey
mnemonic
eoa
}
class AuthCodeHandler {
LoginMethod signupKind
buildAuthCodeRequestParams() void
}
SessionDuration <.. ExplicitSessionParams : uses
NativeTokenSpending <.. ExplicitSessionParams : uses
Permission <.. ExplicitSessionParams : uses
Address <.. NativeTokenSpending : uses
ExplicitSessionParams <.. DappClientUtils : input
ExplicitSessionConfig <.. DappClientUtils : output
LoginMethod <.. AuthCodeHandler : config
Flow diagram for createExplicitSessionConfig utility
flowchart TD
Start([Start]) --> Now[Compute nowInSeconds from current time]
Now --> Lifetime[Compute sessionLifetimeSeconds from expiresIn.days, expiresIn.hours, expiresIn.minutes]
Lifetime --> Deadline[Compute deadline = nowInSeconds + sessionLifetimeSeconds]
Deadline --> CheckPerms{Are any permissions provided?}
CheckPerms -- No --> ThrowError[Throw Error: createExplicitSessionConfig requires at least one permission]
CheckPerms -- Yes --> NativeSpending[Read nativeTokenSpending from params]
NativeSpending --> ValueLimit[Set valueLimit = nativeTokenSpending.valueLimit or 0n]
ValueLimit --> Receivers[Copy allowedRecipients into nativeTokenReceivers]
Receivers --> MapPerms[Map each receiver to nativeTokenSpendingPermission with target and empty rules]
MapPerms --> BuildConfig[Build ExplicitSessionConfig with chainId, valueLimit, deadline, combined permissions]
BuildConfig --> End([Return ExplicitSessionConfig])
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Add utilities and exports in dapp-client to construct explicit session configs and expose network/relayer helpers and constants for consumers. | Introduce SessionDuration, NativeTokenSpending, and ExplicitSessionParams types to model explicit session configuration inputs, including optional native token spending constraints.Implement createExplicitSessionConfig to derive ExplicitSessionConfig from human-friendly params, computing a deadline from the current time and duration, enforcing at least one base permission, and merging permission entries for allowed native token recipients and value limits.Update imports to include ExplicitSessionConfig and Permission from wallet-core/wallet-primitives, add Address type from ox, and re-export VALUE_FORWARDER_ADDRESS from constants.Expand dapp-client public API exports to include createExplicitSessionConfig, getNetwork, getRelayerUrl, getRpcUrl, VALUE_FORWARDER_ADDRESS, new session-related types, Network, MessageType, and TransportMessage. | packages/wallet/dapp-client/src/utils/index.tspackages/wallet/dapp-client/src/index.ts |
| Extend login support to EOA and adjust Apple auth OAuth behavior to be compatible with provider expectations. | Add 'eoa' as a supported LoginMethod option for the dapp client.Modify AuthCodeHandler to omit the OAuth scope parameter when signupKind is 'apple', while preserving existing behavior for other providers.Update Apple-specific authcode test to assert that the generated authorization URL does not contain the scope query parameter. | packages/wallet/dapp-client/src/types/index.tspackages/wallet/wdk/src/sequence/handlers/authcode.tspackages/wallet/wdk/test/authcode.test.ts |
| Publish 3.0.0-beta.9 patch release across core, dapp-client, primitives, WDK, and various services with Apple auth fixes, EOA login updates, and dependency bumps. | Add 3.0.0-beta.7 to 3.0.0-beta.9 entries to multiple CHANGELOGs describing Apple auth fixes, dapp-client EOA login updates, and dependency updates across guard, identity-instrument, relayer, wallet-core, and wallet-primitives.Bump versions from 3.0.0-beta.6 to 3.0.0-beta.9 in package.json files for services, utils/abi, wallet-core, dapp-client, wallet-primitives, and wallet-wdk packages.Introduce changeset files documenting patch releases for Apple auth fixes and dapp client updates for EOA login across affected packages.Update pre-release changeset configuration to include the new changesets. | 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/pre.json.changeset/new-turkeys-double.md.changeset/nice-tips-slide.md.changeset/tiny-files-chew.md |
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 https://github.com/Dargon789/sequence.js/issues/214#issuecomment-3765304105