public override async Task <string> SendCapitulationRequest(GameTypes type, string address, string password = "")
        {
            if (!Players.ContainsKey(address))
            {
                return(await Task.FromResult("Player address is not in the list of players!"));
            }

            try
            {
                var dto = new ChessGameDto()
                {
                    GameId              = Id.ToString(),
                    GameState           = string.Empty,
                    Type                = GameDtoTypes.ChessGame,
                    LastGameRecordTxId  = string.Empty,
                    CapitulationRequest = true,
                };

                dto.Players = new Dictionary <string, ChessPlayer>();

                if (Players.TryGetValue(Player1Address, out var pl1))
                {
                    pl1.FigureType = FigureTypes.White;
                }

                if (Players.TryGetValue(Player1Address, out var pl2))
                {
                    pl2.FigureType = FigureTypes.Black;
                }

                foreach (var pl in Players)
                {
                    dto.Players.TryAdd(pl.Key, pl.Value);
                }

                var moveString = JsonConvert.SerializeObject(dto);

                var tkData = new SendTokenTxData()
                {
                    Amount          = 1,
                    Symbol          = TokenSymbol,
                    SenderAddress   = Player1Address,
                    ReceiverAddress = Player2Address,
                    Id = TokenId
                };

                tkData.Metadata.TryAdd("GameId", Id.ToString());
                tkData.Metadata.TryAdd("GameData", moveString);
                tkData.Password = password;

                var res = await NeblioTransactionHelpers.SendNTP1TokenAPI(tkData, 30000);

                return(await Task.FromResult(res));
            }
            catch (Exception ex)
            {
                log.Error("Chess Game - Cannot write move!", ex);
                return(await Task.FromResult("ERROR"));
            }
        }
        public async Task <string> WriteMove(string stateString, string onMoveAddress, string player2Address, string password = "")
        {
            GameState state = null;

            if (!string.IsNullOrEmpty(stateString))
            {
                state = GetGameStateFromString(stateString);
            }
            else
            {
                return(await Task.FromResult("Cannot load state String. It is empty!"));
            }

            if (!Players.ContainsKey(onMoveAddress) || !Players.ContainsKey(player2Address))
            {
                return(await Task.FromResult("Player address is not in the list of players!"));
            }

            try
            {
                state.LastMovePlayer = onMoveAddress;
                var dto = new ChessGameDto()
                {
                    GameId             = Id.ToString(),
                    GameState          = JsonConvert.SerializeObject(state),
                    Type               = GameDtoTypes.ChessGame,
                    LastGameRecordTxId = ActualStateTxId
                };

                dto.Players = new Dictionary <string, ChessPlayer>();

                foreach (var pl in Players)
                {
                    dto.Players.TryAdd(pl.Key, pl.Value);
                }

                GameHistory.Add(dto);

                var moveString = JsonConvert.SerializeObject(dto);

                var tkData = new SendTokenTxData()
                {
                    Amount          = 1,
                    Symbol          = TokenSymbol,
                    ReceiverAddress = player2Address,
                    SenderAddress   = onMoveAddress,
                    Id = TokenId
                };

                tkData.Metadata.TryAdd("GameId", Id.ToString());
                tkData.Metadata.TryAdd("GameData", moveString);
                tkData.Password = password;

                var res = await NeblioTransactionHelpers.SendNTP1TokenAPI(tkData, 30000);

                if (!string.IsNullOrEmpty(res))
                {
                    ActualStateTxId = res;
                }

                return(await Task.FromResult(res));
            }
            catch (Exception ex)
            {
                log.Error("Chess Game - Cannot write move!", ex);
                return(await Task.FromResult("ERROR"));
            }
        }