Skip to main content
The Web SDK exposes helpers for building, signing, and broadcasting ERC-4337 batch UserOperations in a single call. These methods are available on AA-enabled clients only and require a CAIP-2 chain ID starting with eip155:.
Batch UserOperations require Account Abstraction to be enabled for your organization and client.

sendBatchUserOp

Builds, signs, and broadcasts a batch of token transfers as a single UserOperation. Portal’s paymaster sponsors the gas; the user pays nothing in native tokens.
result.data.userOpHash is a UserOperation hash, not an on-chain transaction hash. To wait for on-chain inclusion call portal.waitForConfirmation(result.data.userOpHash, result.metadata.chainId).

sendBatchedAssets

Like sendBatchUserOp, but appends a gas-reimbursement transfer to the batch. The paymaster still sponsors the gas; the reimbursement call recovers that cost from the user’s smart account, in a fee token of your choice (e.g. USDC). The method runs a two-pass build: the first pass estimates the gas cost of the full batch (including the reimbursement call), and the second pass builds the final batch with the real fee amount.
GasReimbursement fields:
sendBatchedAssets throws if estimatedGasCostWei is 0. Some chains/providers carry no on-chain fee on the UserOperation (e.g. bundler-level sponsorship that covers all fees). On those chains use sendBatchUserOp instead.

Low-level primitives

If you need direct control over the build/sign/broadcast cycle, use the low-level methods:
buildBatchedUserOp returns metadata.estimatedGasCostWei — a build-time upper bound (totalGas × maxFeePerGas). This value is '0' on chains where the UserOperation carries no on-chain fee.

Support

If you encounter any issues or have questions about batch UserOperations, feel free to reach out to our support team.