IRpgEconomyApi
Interface
Members
8
BuyAsync
method
Buys quantity of a shop item for a joined viewer, or null on any rejection/failure.ValueTask<RpgPurchaseInfo> BuyAsync(string twitchUserId, string itemSlug, int quantity = default, CancellationToken cancellationToken = default)CreditAsync
method
Credits copper to a joined viewer and returns the new balance, or null on failure.ValueTask<long?> CreditAsync(string twitchUserId, long amountCopper, CancellationToken cancellationToken = default)DebitAsync
method
Debits copper from a joined viewer and returns the new balance, or null when they can't afford it / on failure.ValueTask<long?> DebitAsync(string twitchUserId, long amountCopper, CancellationToken cancellationToken = default)DefineShopEntryAsync
method
Creates or updates a shop listing (streamer authoring), or null on failure. Nullable knobs mean unconstrained.ValueTask<RpgShopEntryInfo> DefineShopEntryAsync(string itemSlug, long priceCopper, int? perViewerLimit = default, int? globalStock = default, DateTimeOffset? availableFrom = default, DateTimeOffset? availableUntil = default, bool isActive = default, CancellationToken cancellationToken = default)GetLedgerAsync
method
A joined viewer's most-recent wallet ledger rows (newest first), or an empty list when unavailable.ValueTask<IReadOnlyList<RpgLedgerEntryInfo>> GetLedgerAsync(string twitchUserId, int limit = default, CancellationToken cancellationToken = default)GetShopAsync
method
The streamer's currently-purchasable shop, or an empty list when unavailable.ValueTask<IReadOnlyList<RpgShopEntryInfo>> GetShopAsync(CancellationToken cancellationToken = default)GetWalletAsync
method
The viewer's balance in copper; 0 when not joined / unavailable.ValueTask<long> GetWalletAsync(string twitchUserId, CancellationToken cancellationToken = default)SellAsync
method
Sells quantity of a held item back for currency, or null when not held / capped / on failure.ValueTask<RpgSellInfo> SellAsync(string twitchUserId, string itemSlug, int quantity = default, CancellationToken cancellationToken = default)
