Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

feat: add sendTransactionSync and writeContractSync to AbstractClient and SessionClient#397

Merged
coffeexcoin merged 4 commits intomainfrom
feat/send-transaction-sync
Mar 4, 2026
Merged

feat: add sendTransactionSync and writeContractSync to AbstractClient and SessionClient#397
coffeexcoin merged 4 commits intomainfrom
feat/send-transaction-sync

Conversation

@coffeexcoin
Copy link
Copy Markdown
Collaborator

@coffeexcoin coffeexcoin commented Mar 3, 2026

Add sync transaction submission variants that use EIP-7966 eth_sendRawTransactionSync to wait for mining and return full transaction receipts instead of just hashes.

  • Add sendTransactionSync and writeContractSync to AbstractClient and SessionClient, enabling EIP-7966 (eth_sendRawTransactionSync) support that waits for mining and returns a full transaction receipt instead of just a hash.
  • Extend sendTransactionInternal with a generic TReturnType parameter and optional sendSerializedTransaction callback, keeping it fully backward compatible with all existing callers.
  • Export sendTransactionSync, writeContractSync, sendTransactionForSessionSync, and writeContractForSessionSync from @abstract-foundation/agw-client/actions for direct usage.

PR-Codex overview

This PR introduces synchronous transaction handling methods in the AbstractClient and SessionClient to support EIP-7966. It enhances the transaction capabilities by adding sendTransactionSync and writeContractSync, improving usability for synchronous operations.

Detailed summary

  • Added sendTransactionSync and writeContractSync methods to AbstractClient and SessionClient.
  • Exported new synchronous transaction methods in actions.ts.
  • Updated sendTransactionInternal to accept a custom callback for serialized transactions.
  • Created tests for new synchronous methods in writeContractSync.test.ts and sendTransactionSync.test.ts.
  • Enhanced error handling in the synchronous transaction flow.
  • Integrated sendTransactionForSessionSync for session-based transactions.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

… and SessionClient

Add sync transaction submission variants that use EIP-7966 eth_sendRawTransactionSync
to wait for mining and return full transaction receipts instead of just hashes.

Approach: inject a generic TReturnType and optional sendSerializedTransaction callback
into sendTransactionInternal, keeping it fully backward compatible. Sync actions pass
a callback that invokes sendRawTransactionSync; existing async callers are unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 3, 2026

🦋 Changeset detected

Latest commit: 9465d6b

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

This PR includes changesets to release 4 packages
Name Type
@abstract-foundation/agw-client Minor
@abstract-foundation/agw-react Patch
@abstract-foundation/agw-web Patch
@abstract-foundation/web3-react-agw 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

@coffeexcoin coffeexcoin marked this pull request as ready for review March 3, 2026 04:08
@coffeexcoin coffeexcoin requested a review from cygaar as a code owner March 3, 2026 04:08
@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 3, 2026

PR Summary

Medium Risk
Touches core transaction submission by generalizing sendTransactionInternal and adding new synchronous send/write paths, which could impact signing/sending behavior if callback wiring is incorrect. Existing async behavior is intended to remain unchanged when the new callback is not provided.

Overview
Adds EIP-7966 synchronous transaction submission to @abstract-foundation/agw-client via new sendTransactionSync/writeContractSync actions (and session equivalents) that use eth_sendRawTransactionSync to return full receipts.

Updates sendTransactionInternal to accept an optional sendSerializedTransaction callback and generic return type, allowing callers to swap eth_sendRawTransaction for sync submission without changing the signing/prep pipeline.

Exposes these new methods on AbstractClient and SessionClient, exports them from actions, adds a changeset for a minor bump, and includes new unit tests covering sync flows (including Privy cross-app paymaster handling) and the new internal callback behavior.

Written by Cursor Bugbot for commit 9465d6b. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread packages/agw-client/src/actions/writeContractSync.ts
Comment thread packages/agw-client/src/actions/sendTransactionSync.ts
@coffeexcoin coffeexcoin merged commit 8b09879 into main Mar 4, 2026
8 checks passed
@coffeexcoin coffeexcoin deleted the feat/send-transaction-sync branch March 4, 2026 22:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant