apiParachain.dart 893 B

1234567891011121314151617181920212223242526272829
  1. import 'dart:async';
  2. import 'package:polkawallet_sdk/api/api.dart';
  3. import 'package:polkawallet_sdk/api/types/parachain/auctionData.dart';
  4. import 'package:polkawallet_sdk/api/types/parachain/parasOverviewData.dart';
  5. import 'package:polkawallet_sdk/service/parachain.dart';
  6. class ApiParachain {
  7. ApiParachain(this.apiRoot, this.service);
  8. final PolkawalletApi apiRoot;
  9. final ServiceParachain service;
  10. Future<ParasOverviewData> queryParasOverview() async {
  11. final res = await service.queryParasOverview();
  12. return ParasOverviewData.fromJson(res ?? {});
  13. }
  14. Future<AuctionData> queryAuctionWithWinners() async {
  15. final res = await service.queryAuctionWithWinners();
  16. return AuctionData.fromJson(res!);
  17. }
  18. Future<List<String>> queryUserContributions(
  19. List<String> paraIds, String pubKey) async {
  20. return service.queryUserContributions(paraIds, pubKey);
  21. }
  22. }