Skip to content

feat: expose Account Abstraction methods (ENG-6250) - #42

Merged
tysonwil merged 4 commits into
mainfrom
tyson/eng-6250-expose-aa-logic-over-bridge
Apr 24, 2026
Merged

feat: expose Account Abstraction methods (ENG-6250)#42
tysonwil merged 4 commits into
mainfrom
tyson/eng-6250-expose-aa-logic-over-bridge

Conversation

@tysonwil

Copy link
Copy Markdown
Collaborator

Summary

Adds three public methods on ParaManager that mirror the new AA handlers in bridge-v2 (web-sdk PR #1644):

  • createSmartAccount(provider:apiKey:chainId:gasPolicyId:mode:walletId:) -> SmartAccountInfo
  • sendSmartAccountTransaction(smartAccountAddress:chainId:to:value:data:provider:) -> AATransactionReceipt
  • sendSmartAccountBatchTransaction(smartAccountAddress:chainId:calls:provider:) -> AATransactionReceipt

Each uses inline Encodable param structs + postMessage + decodeResult, following the ParaManager+Signing.swift convention.

Also bumps ParaWebView default timeout 30s → 120s

AA UserOp inclusion on Sepolia routinely exceeds 30s (observed ~75s in verification). The timeout is per-request, so non-AA calls are unaffected in practice — a 30s request still returns in 30s even with a 120s limit. Callers who want a tighter bound can still pass a custom requestTimeout to ParaWebView.init.

Test plan

  • swift build / xcodebuild -scheme ParaSwift -sdk iphonesimulator build succeeds.
  • End-to-end verified in the sibling example app (see web-sdk PR #1644): gasless tx 0x44fc3499cb00888e278006169e6b89ab807d55d83e8e485ce6df5e75b2d69554 landed on Sepolia (block 10,680,701).
  • swiftformat --swiftversion 6.1 . — not available on the test host; new code follows 4-space indent + repo conventions by eye. Reviewer to run.

Coordination

Needs to ship + tag a release before the web-sdk example PR can merge — the Swift example references this SDK via SPM semver from github.com/getpara/swift-sdk.

NO DOCS NEEDED
NO EXAMPLES NEEDED

🤖 Generated with Claude Code

Adds ParaManager+SmartAccount extension with three methods mirroring the
bridge-v2 contract: createSmartAccount, sendSmartAccountTransaction,
sendSmartAccountBatchTransaction. Each uses inline Encodable param structs
following the ParaManager+Signing convention.

Adds SmartAccountInfo and AATransactionReceipt models for the serialized
bridge responses. Bigint fields arrive as decimal strings.

Bumps ParaWebView default requestTimeout from 30s to 120s — AA UserOp
inclusion on Sepolia routinely exceeds 30s (observed ~75s), and the timeout
is per-request so non-AA calls are unaffected in practice.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

tysonwil and others added 2 commits April 17, 2026 15:21
The bridge now sends a trimmed receipt with all bigint fields already
stringified by the top-level `convertBigIntsToStrings`, so the
three-way `String / NSNumber / Int` fallback in `decodeReceipt` was
dead code. Collapse to direct `as? String ?? ""`.

Also fix the `30.0` fallback in `ParaWebView`'s timeout task that
diverged from the new 120s default.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codex review caught two gaps:

1. createSmartAccount / sendSmartAccountTransaction /
   sendSmartAccountBatchTransaction didn't call
   ensureTransmissionKeysharesLoaded() before the bridge call. Other
   signing paths (formatAndSignMessage, transfer, signTransaction) all
   call it first — without it, AA UserOps fail to sign when invoked
   before any other signing happens in a session.

2. decodeReceipt went straight to transactionHash without checking for
   the pendingTransactionId / transactionReviewUrl response shape that
   the bridge returns when a permissions policy requires approval. Now
   mirrors the checkForTransactionDenial pattern from Signing: fire the
   transactionReviewHandler if set, then throw
   ParaError.transactionDenied with the review URL so callers can
   surface it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tysonwil
tysonwil requested a review from kwingram25 April 17, 2026 23:24
Match web SDK parity — callers can now pass either walletId or address
to select the signing wallet for the smart account. address takes
precedence when both are supplied; neither falls back to the active EVM
wallet (resolution handled by the underlying web SDK).
@tysonwil
tysonwil merged commit ccbbfeb into main Apr 24, 2026
2 of 3 checks passed
@tysonwil
tysonwil deleted the tyson/eng-6250-expose-aa-logic-over-bridge branch April 24, 2026 22:36
@tysonwil tysonwil mentioned this pull request Apr 24, 2026
2 tasks
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.

2 participants