You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Loading
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])
Loading
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.
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.
Trigger a new review: Comment @sourcery-ai review on 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 issue to create an issue from it.
Generate a pull request title: Write @sourcery-ai anywhere in the pull
request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
Generate a pull request summary: Write @sourcery-ai summary anywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment @sourcery-ai summary on the pull request to
(re-)generate the summary at any time.
Generate reviewer's guide: Comment @sourcery-ai guide on the pull
request to (re-)generate the reviewer's guide at any time.
Resolve all Sourcery comments: Comment @sourcery-ai resolve on 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 dismiss on 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 review to trigger a new review!
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
scopeparameter, 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 : configFlow 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
packages/wallet/dapp-client/src/utils/index.tspackages/wallet/dapp-client/src/index.tspackages/wallet/dapp-client/src/types/index.tspackages/wallet/wdk/src/sequence/handlers/authcode.tspackages/wallet/wdk/test/authcode.test.tspackages/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.mdTips and commands
Interacting with Sourcery
@sourcery-ai reviewon the pull request.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.@sourcery-aianywhere in the pullrequest 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.@sourcery-ai summaryanywhere inthe 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.
@sourcery-ai guideon the pullrequest to (re-)generate the reviewer's guide at any time.
@sourcery-ai resolveon thepull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
@sourcery-ai dismisson the pullrequest 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:
summary, the reviewer's guide, and others.
Getting Help
Originally posted by @sourcery-ai[bot] in #214 (comment)