getCoinbaseWalletObject method

  1. @override
Future<W3MWalletInfo?> getCoinbaseWalletObject()
override

Implementation

@override
Future<W3MWalletInfo?> getCoinbaseWalletObject() async {
  final results = await _fetchListings(
    params: RequestParams(
      page: 1,
      entries: 1,
      search: 'coinbase wallet',
      // platform: _getPlatformType(),
    ),
    updateCount: false,
  );

  if (results.isNotEmpty) {
    final wallet = W3MWalletInfo.fromJson(results.first.toJson());
    final mobileLink = CoinbaseService.defaultWalletData.listing.mobileLink;
    bool installed = await urlUtils.instance.isInstalled(mobileLink);
    return wallet.copyWith(
      listing: wallet.listing.copyWith(mobileLink: mobileLink),
      installed: installed,
    );
  }
  return null;
}