Skip to content

Commit

Permalink
added ticket stamp feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Raviramnani1 committed Aug 22, 2024
1 parent 8222aa6 commit 3843417
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions wallet/lib/services/data_stores/remote_data_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,25 @@ class RemoteDataStoreImp implements RemoteDataStore {
return _signAndBroadcast(msgUpdateRecipe);
}

Future<String> stampTicket({
required CookbookId cookBookId,
required RecipeId recipeId,
required Address creatorAddress,
}) async {
final recipe = await getRecipe(cookBookId: cookBookId, recipeId: recipeId);

final recipeProto3Json = recipe.toProto3Json()! as Map;
recipeProto3Json.remove(kCreatedAtCamelCase);
recipeProto3Json.remove(kUpdatedAtCamelCase);
recipeProto3Json.putIfAbsent("isStamped", true)

final msgUpdateRecipe = pylons.MsgUpdateRecipe.create()..mergeFromProto3Json(recipeProto3Json);
msgUpdateRecipe.version = msgUpdateRecipe.version.incrementRecipeVersion();
msgUpdateRecipe.creator = creatorAddress.toString();

return _signAndBroadcast(msgUpdateRecipe);
}

@override
Future<String> createDynamicLinkForItemNftShare({
required String address,
Expand Down
6 changes: 6 additions & 0 deletions wallet/lib/services/repository/repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,12 @@ abstract class Repository {
required Address creatorAddress,
});

Future<Either<Failure, void>> stampTicket({
required CookbookId cookBookId,
required RecipeId recipeId,
required Address creatorAddress,
});

Future<Either<Failure, void>> createTrade({required pylons.MsgCreateTrade msgCreateTrade});

Future<Either<Failure, void>> cancelTrade({required TradeId tradeId, required Address address});
Expand Down

0 comments on commit 3843417

Please sign in to comment.