myStats method

Future<ReferralStats> myStats({
  1. required String programId,
})

The current user's code, link and counts (referrer_not_found if they have no link yet). Cached for 60 s. Sent at once when an identity token is stored (no wait for the install); the link is saved for myLink.

Implementation

Future<ReferralStats> myStats({required String programId}) async {
  _requireId(programId, 'program_id');
  final saved = await _savedLinks.saved(programId);
  return ReferralStats.fromJson(await _stats(programId, saved.token));
}