swapListTokens method

  1. @override
Future<SwapTokenList> swapListTokens()
override

The dynamic source-asset list for the IntoZec picker (spec §3.3b D5/L6). LAZY — called when the user opens the IntoZec form (NOT on launch: §5.2 honest-off, an idle user emits no token traffic). The SDK fetches /v0/tokens over the swap dialer (Tor-optional, its OWN circuit), filters the ZEC asset + $0/null-price entries, and caches the result. On a fetch fault it serves the LAST good list with SwapTokenList.fresh = false (the host shows a "couldn't refresh, showing cached" banner — honest degradation, never a blank picker); a first-ever fault with no cache throws a typed SwapApiError. An empty tokens with fresh == true is the honest "no assets available right now". No wallet key material crosses — token metadata is §5.4 never-logged.

Implementation

@override
Future<SwapTokenList> swapListTokens() async {
  swapListTokensCount++;
  if (swapListTokensThrows != null) throw swapListTokensThrows!;
  return swapListTokensResult ?? swapTokenListFixture();
}