Skip to content

3.0.0#669

Merged
Dargon789 merged 44 commits into
Dargon789:signing-optimisation-masterfrom
0xsequence:master
Jun 11, 2026
Merged

3.0.0#669
Dargon789 merged 44 commits into
Dargon789:signing-optimisation-masterfrom
0xsequence:master

Conversation

@Dargon789

Copy link
Copy Markdown
Owner

No description provided.

taylanpince and others added 30 commits March 4, 2026 16:01
* Update test names

* Fix handling for multiple explicit signers
* Add WDK Google ID token auth flow

* Unify Google WDK auth kinds

* Refine WDK Google id token flow

* Fix id-token auth key cleanup on signer mismatch

* Restore guard error logging

* Unify Google WDK signer kind

* Fix WDK auth flow cleanup and implicit session metadata
* wdk: account federation

* wdk: address review comments; refactor auth commitments

* wdk: update tests

* fix test
Bumps [happy-dom](https://github.com/capricorn86/happy-dom) from 20.7.0 to 20.8.8.
- [Release notes](https://github.com/capricorn86/happy-dom/releases)
- [Commits](capricorn86/happy-dom@v20.7.0...v20.8.8)

---
updated-dependencies:
- dependency-name: happy-dom
  dependency-version: 20.8.8
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [next](https://github.com/vercel/next.js) from 15.5.10 to 15.5.14.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v15.5.10...v15.5.14)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.5.14
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [happy-dom](https://github.com/capricorn86/happy-dom) from 20.8.8 to 20.8.9.
- [Release notes](https://github.com/capricorn86/happy-dom/releases)
- [Commits](capricorn86/happy-dom@v20.8.8...v20.8.9)

---
updated-dependencies:
- dependency-name: happy-dom
  dependency-version: 20.8.9
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot Bot and others added 14 commits May 7, 2026 12:06
Bumps [next](https://github.com/vercel/next.js) from 15.5.14 to 15.5.15.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v15.5.14...v15.5.15)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.5.15
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
#1007)

* feat(relayer): propagate sponsored signal and mark swallowed errors

`RpcRelayer.feeOptions` now forwards the server's `sponsored: boolean` to
callers, and both `feeOptions` and `feeTokens` mark their swallowed-error
returns with `failed: true`. The `Relayer` interface and all bundled
implementations (Rpc, Sequence, Local, EIP6963, Pk) are widened to match.

Additive change: existing consumers ignoring the new fields are unaffected.
Downstream sponsorship classifiers should switch from `!feeOption` inference
to `sponsored === true` so a real subsidy is no longer indistinguishable
from a swallowed `/FeeOptions` error.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(wallet-wdk): carry sponsored/failed on StandardRelayerOption

`StandardRelayerOption` gains optional `sponsored` and `failed` fields,
populated on both construction branches in `transactions.ts` from the
relayer SDK's new `feeOptions` return. `isStandardRelayerOption` /
`isERC4337RelayerOption` are re-exported so consumers can narrow before
reading the new fields.

UI consumers that classified sponsorship by "no fee option attached"
should switch to `sponsored === true` to distinguish a real subsidy from
a swallowed `/FeeOptions` error.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(dapp-client): add isSponsored for explicit sponsorship checks

`DappClient.isSponsored(chainId, transactions)` and
`ChainSessionManager.isSponsored(calls)` return true only when the
relayer's `/FeeOptions` endpoint explicitly reports sponsorship; any
error, network failure, or absence of sponsorship returns false. A true
result is always safe to surface as "free gas" in UI.

Prefer this over inferring sponsorship from an empty `getFeeOptions`
array — a swallowed `/FeeOptions` error produces the same empty shape as
a real subsidy. `getFeeOptions` is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Bumps [turbo](https://github.com/vercel/turborepo) from 2.9.8 to 2.9.14.
- [Release notes](https://github.com/vercel/turborepo/releases)
- [Changelog](https://github.com/vercel/turborepo/blob/main/RELEASE.md)
- [Commits](vercel/turborepo@v2.9.8...v2.9.14)

---
updated-dependencies:
- dependency-name: turbo
  dependency-version: 2.9.14
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @Dargon789, your pull request is larger than the review limit of 150000 diff characters

@snyk-io

snyk-io Bot commented Jun 11, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
🔚 Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codesandbox

codesandbox Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@mergify

mergify Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ The sha of the head commit of this PR conflicts with #653. Mergify cannot evaluate rules on this PR. Once #653 is merged or closed, Mergify will resume processing this PR. ⚠️

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces OIDC ID token login support, account federation, and Arweave state reader integration, alongside explicit transaction sponsorship checks (isSponsored) and safe-mode self-transfer fixes. The code review highlights several critical issues: a missing Signers import in wallets.ts, missing data parameter forwarding in EIP6963Relayer and PkRelayer's feeOptions methods, an async promise executor anti-pattern in IdTokenHandler, and potential runtime crashes in wallets.ts due to unsafe casting of handlers without instanceof AuthCodeHandler checks.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

import { Address, Hex, Provider, RpcTransport } from 'ox'
import { AuthCommitment } from '../dbs/auth-commitments.js'
import { AuthCodeHandler } from './handlers/authcode.js'
import { IdTokenHandler } from './handlers/idtoken.js'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The Signers namespace/class is used in the newly added addLoginSignerFromPrepared method (e.g., Signers.isSapientSigner), but it is not imported in this file. This will cause a TypeScript compilation error. Please import Signers from @0xsequence/wallet-core.

Suggested change
import { IdTokenHandler } from './handlers/idtoken.js'
import { IdTokenHandler } from './handlers/idtoken.js'
import { Signers } from '@0xsequence/wallet-core'

Comment on lines +40 to 41
): Promise<{ options: FeeOption[]; quote?: FeeQuote; sponsored: boolean; failed?: boolean }> {
return this.relayer.feeOptions(wallet, chainId, to, calls)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The feeOptions method in EIP6963Relayer does not accept or forward the optional data parameter to the underlying relayer. This prevents accurate simulation of transactions for undeployed wallets when using an EIP-6963 relayer. Please add the data parameter and forward it.

    data?: Hex.Hex,
  ): Promise<{ options: FeeOption[]; quote?: FeeQuote; sponsored: boolean; failed?: boolean }> {
    return this.relayer.feeOptions(wallet, chainId, to, calls, data)

Comment on lines +124 to 125
): Promise<{ options: FeeOption[]; quote?: FeeQuote; sponsored: boolean; failed?: boolean }> {
return this.relayer.feeOptions(wallet, chainId, to, calls)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The feeOptions method in PkRelayer does not accept or forward the optional data parameter to the underlying relayer. This prevents accurate simulation of transactions for undeployed wallets when using a private key relayer. Please add the data parameter and forward it.

    data?: Hex.Hex,
  ): Promise<{ options: FeeOption[]; quote?: FeeQuote; sponsored: boolean; failed?: boolean }> {
    return this.relayer.feeOptions(wallet, chainId, to, calls, data)

Comment on lines +128 to +144
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve, reject) => {
try {
const respond: RespondFn = async (idToken) => {
try {
const [signer, metadata] = await this.completeAuth(idToken)
resolve({ signer, email: metadata.email || '' })
} catch (error) {
reject(error)
}
}

await onPromptIdToken(this.signupKind, respond)
} catch (error) {
reject(error)
}
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using an async executor in new Promise is an anti-pattern and violates the no-async-promise-executor ESLint rule. Any asynchronous rejection or error thrown inside the executor might not be caught properly. It is cleaner and safer to use a standard synchronous executor and handle promise rejection via .catch(reject).

    return new Promise((resolve, reject) => {
      const respond: RespondFn = async (idToken) => {
        try {
          const [signer, metadata] = await this.completeAuth(idToken)
          resolve({ signer, email: metadata.email || '' })
        } catch (error) {
          reject(error)
        }
      }

      onPromptIdToken(this.signupKind, respond).catch(reject)
    })

Comment on lines +844 to 846
const handler = this.shared.handlers.get(getSignupHandlerKey(args.kind)) as AuthCodeHandler
if (!handler) {
throw new Error('handler-not-registered')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When Google is configured for ID token authentication, the handler returned by getSignupHandlerKey will be an IdTokenHandler instead of an AuthCodeHandler. Casting it as AuthCodeHandler without checking will cause a runtime crash when calling completeAuth because IdTokenHandler.completeAuth has a different signature. Please add an instanceof AuthCodeHandler check.

Suggested change
const handler = this.shared.handlers.get(getSignupHandlerKey(args.kind)) as AuthCodeHandler
if (!handler) {
throw new Error('handler-not-registered')
const handler = this.shared.handlers.get(getSignupHandlerKey(args.kind))
if (!handler) {
throw new Error('handler-not-registered')
}
if (!(handler instanceof AuthCodeHandler)) {
throw new Error('handler-does-not-support-redirect')
}

Comment on lines 876 to 878
const handler = this.shared.handlers.get(args.kind) as AuthCodeHandler
if (!handler) {
throw new Error('handler-not-registered')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If a custom provider is configured as an ID token provider but the caller passes authcode arguments, the handler will not be an AuthCodeHandler. Casting it without checking will cause a runtime crash. Please add an instanceof AuthCodeHandler check.

      const handler = this.shared.handlers.get(args.kind)
      if (!handler) {
        throw new Error('handler-not-registered')
      }
      if (!(handler instanceof AuthCodeHandler)) {
        throw new Error('handler-does-not-support-redirect')
      }

@Dargon789 Dargon789 merged commit 67c1664 into Dargon789:signing-optimisation-master Jun 11, 2026
32 of 35 checks passed
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.

10 participants