Skip to content

Commit

Permalink
set token pending
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <phuoc@bitmark.com>
  • Loading branch information
phuocbitmark committed Nov 6, 2023
1 parent 824ee21 commit a533aa8
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@ import 'package:autonomy_flutter/util/wallet_utils.dart';
import 'package:dio/dio.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:nft_collection/models/models.dart';
import "package:nft_collection/nft_collection.dart";
import 'package:nft_collection/services/tokens_service.dart';

import 'claim_empty_postcard_state.dart';

@@ -24,6 +26,7 @@ class ClaimEmptyPostCardBloc
final configService = injector<ConfigurationService>();
final accountService = injector<AccountService>();
final navigationService = injector.get<NavigationService>();
final _tokensService = injector.get<TokensService>();

ClaimEmptyPostCardBloc() : super(ClaimEmptyPostCardState()) {
on<GetTokenEvent>((event, emit) async {
@@ -67,6 +70,12 @@ class ClaimEmptyPostCardBloc
payToMintRequest.address: 1,
},
);
await _tokensService.setCustomTokens([token]);
_tokensService.reindexAddresses([payToMintRequest.address]);
injector.get<ConfigurationService>().setListPostcardMint([tokenId]);
NftCollectionBloc.eventController.add(
GetTokensByOwnerEvent(pageKey: PageKey.init()),
);
emit(state.copyWith(assetToken: token));
} else {
final token = AssetToken(

0 comments on commit a533aa8

Please sign in to comment.