Smart Wallet Kit

Smart Wallet Attribution Kit

Ship Builder Codes through Base Account, Privy, and custom smart wallets without guessing whether attribution survived the UserOperation pipeline.

pnpm add @base-attribution-os/wallet

01 Discover

Check dataSuffix for this account and chain.

02 Inject

Add one required capability without changing inner calls.

03 Build

Merge wallet and app codes into the final userOp.callData.

04 Verify

Decode every expected code before or after submission.

Capability-aware batches

const sent = await sendAttributedCalls( provider, { chainId: "0x2105", from, calls }, { codes: ["bc_app"] }, );

Bao Toolkit checks wallet_getCapabilities before the first send and preserves paymaster, atomic, and application-defined capabilities.

One suffix, every contributor

attributeUserOperation(userOp, { walletCodes: ["bc_wallet"], appDataSuffix, }); // decoded: bc_wallet, bc_app

Existing suffixes are normalized, duplicates are removed, and the result is appended to the final userOp.callData before signing.

Every downgrade is visible

attributed

Capability supported

wallet_sendCalls receives a required dataSuffix capability.

blocked

Unsupported · strict

The request stops before submission. No silent attribution loss.

unattributed

Unsupported · best effort

The unchanged batch is sent only after an explicit opt-in.

bao check-user-op --input user-op.json --expect bc_wallet,bc_app
Read the integration guide