- Improved .curtrs (It will now have a lot more useful data in the database, show Tx ids, and be partially localized)

- Added .curtr command which lets you see full information about one of your own transactions with the specified id
- Added .WithAuthor(IUser) extension for embedbuilder
This commit is contained in:
Kwoth
2022-01-25 05:55:38 +01:00
parent 81533b7f69
commit 3910dc7499
18 changed files with 3077 additions and 70 deletions

View File

@@ -5,19 +5,19 @@ public interface IWallet : IDisposable, IAsyncDisposable
public ulong UserId { get; }
public Task<long> GetBalance();
public Task<bool> Take(long amount, Extra extra);
public Task Add(long amount, Extra extra);
public Task<bool> Take(long amount, TxData txData);
public Task Add(long amount, TxData txData);
public async Task<bool> Transfer(
long amount,
IWallet to,
Extra extra)
TxData txData)
{
if (amount <= 0)
throw new ArgumentOutOfRangeException(nameof(amount), "Amount must be greater than 0.");
var succ = await Take(amount,
extra with
txData with
{
OtherId = to.UserId
});
@@ -26,7 +26,7 @@ public interface IWallet : IDisposable, IAsyncDisposable
return false;
await to.Add(amount,
extra with
txData with
{
OtherId = UserId
});