public Task DecreaseBalance(string address, BigInteger amount) { return(_storage.ReplaceAsync(UserContractEntity.GeneratePartitionKey(), address, entity => { entity.BalanceStr = BigInteger.Max(0, entity.Balance - amount).ToString(); return entity; })); }
public Task SetBalance(string address, BigInteger balance) { return(_storage.ReplaceAsync(UserContractEntity.GeneratePartitionKey(), address, entity => { entity.BalanceStr = balance.ToString(); entity.LastCheck = DateTime.UtcNow; return entity; })); }
public async Task <IEnumerable <IUserContract> > GetUsedContracts() { return(await _storage.GetDataAsync(UserContractEntity.GeneratePartitionKey())); }