SIGN IN SIGN UP

refactor(sdk): move subaccounts() to PrivateTransfersBuilder (#905)

`subaccounts(dappName)` hung on `PrivateTransfersInterface`, but a sub-account
`invoke(nonce, {calls})` produces builder operations — so it belongs in the
builder namespace. Moving it there also fixes a latent bug: the old
`SubAccountsBuilderImpl.invoke` spun up its own `transfers.build()` internally,
discarding any `ExecuteOptions` the caller passed. Now `subaccounts` is reached
via `transfers.build(options).subaccounts(dappName)` and its `invoke` chains onto
that same builder, so options/context flow through.

`build()` threads the sub-account deps (anonymizer address + viewing-key getter)
into the builder; the anonymizer-address requirement now throws from
`builder.subaccounts(...)`. Reads (`partialCommitment`/`commitment`) are unchanged.

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

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/starkware-libs/starknet-privacy/905)
<!-- Reviewable:end -->
I
Ittay Dror committed
7a4233dce2eb746f306ef628774b8555200bb558
Parent: 91a54f1
Committed by GitHub <noreply@github.com> on 7/15/2026, 4:55:01 PM