features/wallet/wallet_config library

Extensions

WalletConfigBirthday on WalletConfig
Copy this config with a different restore birthdayHeight (the SDK's WalletConfig is FRB-generated and carries no copyWith). This is the ONE place a config field is overridden after buildWalletConfig, so the field list lives in a single file (DRY). Every other field is carried: the config test copies a config with EVERY field set and compares it with the generated ==, so a field added to WalletConfig and missed here fails that test.

Constants

referenceBroadcastJitterMaxMs → const int
Broadcast-timing decorrelation window: a uniform random delay in 0..=10s before each tx broadcast, so a send doesn't timestamp-correlate with other host-app traffic (privacy posture; the SDK's documented default window). No send path ships in this slice, but the policy is wallet-wide so it is set at config time.
referenceMainnetEndpoint → const String
The example-app wallet host-policy (spec §3.2g iii-B-2-b; ADR-0526). Builds the one WalletConfig this example wallet runs under — the endpoint, network, transport, and seed-persistence decisions live HERE, in the host, so the SDK stays policy-free (it validates the config; it does not choose it).
referenceTestnetEndpoint → const String
The TESTNET lightwalletd endpoint — the same operator's testnet rail. Used only under the ZEC_NETWORK=testnet build (the v-5c device proof: the textest1… TEX HRP is testnet-only).
referenceTorPolicy → const TorPolicy
Tor policy for the example app: OFF / direct — the example matches Zashi's direct default. NOTE this is an EXAMPLE-app choice; a production host would typically route the wallet through the host's own Tor infrastructure.
zecEndpointDefine → const String
Optional endpoint override for either network: --dart-define=ZEC_ENDPOINT=https://… (e.g. a local lightwalletd). Empty ⇒ the network's reference endpoint.
zecNetworkDefine → const String
Build-time network switch: flutter build/run --dart-define=ZEC_NETWORK= testnet runs the example wallet on testnet; the default (unset or mainnet) is mainnet. Any OTHER value fails LOUD at provisioning via networkForDefine — a typo'd define silently running MAINNET would point a money proof at real funds.

Properties

kZcashSaplingActivationDate → DateTime
Zcash Sapling activation (2018-10-22) — the earliest USEFUL wallet birthday: the SDK floors any earlier date to it, so it is the firstDate bound on every "how far back to scan" date picker (restore birthday + rescan recovery). One source of truth for the floor (DRY) so the two pickers can never drift; pinned by a boundary test (gate 7 — no magic numbers).
final

Functions

buildWalletConfig({required String dbDir, List<Uint8List> machineMemoPrefixes = const [], List<SyncServer>? syncServers, TorPolicy tor = referenceTorPolicy}) → WalletConfig
Build the reference-app WalletConfig for the wallet rooted at dbDir.
dbDirLeafForNetwork(Network network) → String
The wallet data-dir LEAF per network: a testnet proof wallet lives BESIDE a mainnet wallet, never over it — switching defines must not hit the SDK's NetworkMismatch on an existing mainnet DB, nor invite wiping it. Mainnet keeps the historical zec_wallet leaf (zero migration).
endpointForNetwork(Network network, {required String override}) → String
Resolve the endpoint for a network + optional ZEC_ENDPOINT override (pure, unit-pinned like networkForDefine).
networkForDefine(String define) → Network
Map a ZEC_NETWORK define value to the SDK network. Pure so every arm is pinned by a unit test (the const define can't vary inside one test binary); the throw is the fail-loud arm — never default a typo to mainnet.
referenceDbDirLeaf() → String
The data-dir leaf this build uses (see dbDirLeafForNetwork).
referenceNetwork() → Network
The network this build runs on (from zecNetworkDefine).
referenceOfferedServers() → List<SyncServer>
The servers the reference app OFFERS: the SDK's public catalog for the build's network. The SDK ships no gated server and no key (ADR-0568). A host that offers servers of its own appends them, each with its own key, and passes the list to buildWalletConfig's syncServers: