Skip to content

Add sequencer wallet extension#141

Draft
tuler wants to merge 1 commit into
prerelease/v2-alphafrom
feature/sequencer
Draft

Add sequencer wallet extension#141
tuler wants to merge 1 commit into
prerelease/v2-alphafrom
feature/sequencer

Conversation

@tuler

@tuler tuler commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Add @cartesi/viem/sequencer, a viem Wallet Client extension for EIP-712 signed Cartesi sequencer transactions
  • Provide sendSequencerTransaction, signSequencerTransaction, and submitSequencerTransaction actions for combined and split sign/submit flows
  • Support both JSON-RPC accounts such as MetaMask and viem local accounts through viem's signTypedData action
  • Validate transaction fields and expose structured request, response, and sequencer rejection errors
  • Export the sequencer entrypoint in both ESM and CommonJS builds and add a release changeset
  • Document browser-wallet and local-account setup, action semantics, EIP-712 fields, configuration, errors, and retry considerations

Testing

  • Biome checks pass
  • TypeScript checks pass
  • Sequencer test suite passes (9 tests), including the MetaMask/EIP-1193 signing path
  • ESM and CommonJS builds pass, including package export smoke checks
  • Vocs production documentation build passes

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 580fddf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cartesi/viem Minor
@cartesi/wagmi Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tuler
tuler changed the base branch from main to prerelease/v2-alpha July 17, 2026 21:07
@tuler

tuler commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Example usage snippet (in the docs).

import { sequencerActions } from "@cartesi/viem/sequencer";
import { createWalletClient, custom, type Address } from "viem";
import { mainnet } from "viem/chains";

const [account] = (await window.ethereum.request({
  method: "eth_requestAccounts",
})) as [Address, ...Address[]];

const walletClient = createWalletClient({
  account,
  chain: mainnet,
  transport: custom(window.ethereum),
}).extend(
  sequencerActions({
    application: "0x...",
    url: "https://sequencer.example.com",
  }),
);

const receipt = await walletClient.sendSequencerTransaction({
  data: "0x...",
  maxFee: 1_200,
  nonce: 0,
});

@tuler tuler changed the title Add sequencer release notes and docs updates Add sequencer wallet extension Jul 17, 2026
@tuler

tuler commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

I see there is a placeholder for a typescript client at https://github.com/cartesi/sequencer/tree/main/sdk/ts-client
If you think it makes more sense to move this code there let me know.

@tuler
tuler requested review from GCdePaula, edubart and guidanoli July 18, 2026 04:31
@tuler
tuler force-pushed the feature/sequencer branch from fd5810e to ebdda8b Compare July 18, 2026 20:23
@tuler
tuler force-pushed the feature/sequencer branch from ebdda8b to 580fddf Compare July 20, 2026 15:12
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.

1 participant