Dargon789/sequence.js
View on GitHubSequence diagram for dapp sponsorship check via relayer feeOptions
Open
#654 opened on Jun 5, 2026
bugdependenciesdocumentationduplicateenhancementgood first issue
Repository metrics
- Stars
- (1 star)
- PR merge metrics
- (PR metrics pending)
Description
Reviewer's Guide
Introduces explicit sponsorship and failure signalling throughout the relayer fee-options pipeline, adds a dedicated sponsorship check API for dapps, updates wallet fee-option transaction building (including undeployed wallets), extends userdata with active device management, removes several unsupported networks, tightens relayer tests, and bumps various package/tooling versions.
Sequence diagram for dapp sponsorship check via relayer feeOptions
sequenceDiagram
actor User
participant DappClient
participant ChainSessionManager
participant Wallet
participant Relayer
participant RpcRelayer
participant RelayerClient
User->>DappClient: isSponsored(chainId, transactions)
DappClient->>ChainSessionManager: isSponsored(calls)
ChainSessionManager->>ChainSessionManager: _buildAndSignCalls(callsToSend)
ChainSessionManager->>Wallet: buildFeeOptionsTransaction(provider, payload)
Wallet-->>ChainSessionManager: { to, data }
ChainSessionManager->>Relayer: feeOptions(walletAddress, chainId, to, callsToSend, data)
Relayer->>RpcRelayer: feeOptions(wallet, chainId, to, calls, data)
RpcRelayer->>RelayerClient: feeOptions({ wallet, to, data })
RelayerClient-->>RpcRelayer: FeeOptionsReturn(sponsored, options, quote)
RpcRelayer-->>Relayer: { options, quote, sponsored, failed? }
Relayer-->>ChainSessionManager: { options, quote, sponsored, failed? }
ChainSessionManager-->>DappClient: sponsored === true && !failed
DappClient-->>User: boolean isSponsored
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Propagate explicit sponsorship and failure flags through relayer fee options/tokens and update all relayer implementations and consumers accordingly. | Extend Relayer interface feeTokens/feeOptions to return sponsored and failed markers alongside existing fields.Update RpcRelayer, SequenceRelayer, LocalRelayer, PkRelayer, and EIP6963Relayer to implement the new contract, including error handling paths for feeTokens/feeOptions.Adjust RpcRelayer.feeOptions to accept prebuilt transaction data, forward sponsored flag from server, and return failed:true on error.Update relayer tests to assert new behavior for non-object inputs, sponsored propagation, and error handling in feeOptions/feeTokens. | packages/services/relayer/src/relayer/relayer.tspackages/services/relayer/src/relayer/rpc-relayer/index.tspackages/services/relayer/src/relayer/standard/sequence.tspackages/services/relayer/src/relayer/standard/local.tspackages/services/relayer/src/relayer/standard/eip6963.tspackages/services/relayer/src/relayer/standard/pk-relayer.tspackages/services/relayer/test/relayer/relayer.test.tspackages/services/relayer/src/relayer/rpc-relayer/relayer.gen.ts |
| Add wallet-side fee-options transaction construction with stub signatures, including support for undeployed wallets, and wire it into WDK transaction relayer option discovery. | Introduce FeeOptionsStubSignature and utilities to stub topology signatures and build a serialized signature with unrecovered signer leaves.Add Wallet.buildFeeOptionsTransaction to build the correct execute call data and route through guest module plus deploy call for undeployed wallets.Change Transactions.update to operate on calls payloads only, using buildFeeOptionsTransaction output when calling relayer.feeOptions and passing along sponsored/failed flags onto StandardRelayerOption.Add dedicated tests to verify Wallet.buildFeeOptionsTransaction behavior for deployed vs undeployed wallets and that StandardRelayerOption sponsored/failed defaults for local/PK relayers are correct. | packages/wallet/core/src/wallet.tspackages/wallet/wdk/src/sequence/transactions.tspackages/wallet/wdk/src/sequence/types/transaction-request.tspackages/wallet/wdk/src/sequence/types/index.tspackages/wallet/wdk/test/transactions.test.tspackages/wallet/core/test/wallet-fee-options.test.ts |
| Expose high-level sponsorship checking APIs in the dapp client and chain session manager, relying on the new sponsored/failed semantics, and ensure feeOptions requests use prebuilt transaction data. | Update ChainSessionManager.getFeeOptions to pass signedCall.data through to relayer.feeOptions.Add ChainSessionManager.isSponsored to build/sign calls, cache fingerprints, call relayer.feeOptions with transaction data, and interpret sponsored:true && !failed as positive sponsorship.Add DappClient.isSponsored to delegate to ChainSessionManager.isSponsored, with clear docs warning against inferring sponsorship from empty fee options.Extend dapp-client tests/CHANGLEOG to cover the new API and behavior. | packages/wallet/dapp-client/src/ChainSessionManager.tspackages/wallet/dapp-client/src/DappClient.tspackages/wallet/dapp-client/CHANGELOG.md |
| Extend userdata service client with active device management and update generated schema metadata. | Regenerate userdata.gen.ts to include ActiveDevice and ActiveDeviceProps models and related request/response types.Add listActiveDevices, putActiveDevice, and deleteActiveDevice methods to the UserData client interface and implementation.Update Webrpc schema hash and header comment to reflect the new RIDL schema version. | packages/services/userdata/src/userdata.gen.ts |
| Remove support for several deprecated or unused networks from wallet primitives and associated network list, and update network-related changelog entries. | Delete chain IDs and Network entries for Polygon zkEVM, Xai (mainnet & Sepolia), Blast (mainnet & Sepolia), TOY testnet, Monad testnet, Incentiv (mainnet & testnets), Sandbox testnet, and Etherlink testnet.Ensure ALL network array aligns with the reduced ChainId set, keeping remaining networks intact.Document the network updates in relevant changelogs as part of broader relayer/network maintenance. | packages/wallet/primitives/src/network.tspackages/wallet/primitives/CHANGELOG.mdpackages/wallet/wdk/CHANGELOG.mdpackages/wallet/core/CHANGELOG.mdpackages/wallet/dapp-client/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.md |
| Align tooling, TypeScript, Next.js, and workspace configuration for the monorepo. | Bump various devDependencies (lefthook, prettier, syncpack, turbo, typescript) and update pnpm and pnpm-workspace minimumReleaseAge and overrides.Update multiple package.json files across services, wallet packages, extras, and repo tooling to use TypeScript 6.0.3 and bump versions reflecting relayer/sponsorship changes.Adjust Next.js tsconfig includes to account for CSS side-effect typings, and add a shared next-css-side-effect.d.ts module declaration.Tighten primitives-cli tsconfig to include Node types and bump its typescript devDependency, and add a CLAUDE GitHub workflow for bot assistance. | package.jsonpnpm-workspace.yamlextras/docs/tsconfig.jsonextras/web/tsconfig.jsonpackages/wallet/primitives-cli/tsconfig.jsonpackages/wallet/primitives-cli/package.jsonextras/docs/package.jsonextras/web/package.jsonpackages/services/*/package.jsonpackages/utils/abi/package.jsonpackages/wallet/*/package.jsonrepo/eslint-config/package.jsonrepo/ui/package.json.github/workflows/claude.ymlrepo/typescript-config/next-css-side-effect.d.ts |
Possibly linked issues
- #560: The PR implements the Claude Code workflow, Next.js bumps, and pnpm release-age configuration described in the issue.
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/653#issuecomment-4629560671