import { type KitBlueprint, type KitOwnerIdKind, type KitTrustedAuthority } from './core.js'; /** Options for {@link economyBlueprint}. */ export interface EconomyBlueprintOptions { /** * Prefix applied to the container type names (`'Black'` → `BlackWallet` / * `BlackShopListing` / …) and, snake-cased, to the function names * (`black_earn_gold`, …). Lets several economies coexist. Defaults to none. */ typePrefix?: string; /** * Currency property names on the wallet, one int property (default 0) per * entry, each with `earn_` / `spend_` functions. Defaults to * `['gold']`. */ currencies?: string[]; /** * The wallet currency shops and market listings are priced in. Defaults to * the first entry of `currencies`. (Expressions cannot pick a wallet * property dynamically, so one deployment trades in one currency; deploy a * prefixed second blueprint for a second shop currency.) */ shopCurrency?: string; /** * Who may mint currency via `earn_`. Trusted grants should be `'server'` * (app admins / studio backend, the default), `'host'`, or * `'automation'` — never plain players. Defaults to `'server'`. */ earnAuthority?: KitTrustedAuthority; /** * How `owner_user_id` mirrors are typed on the stack containers this * economy guards (see the kit owner-mirroring convention). Defaults to * `'int'` (the kit standard). */ ownerIdKind?: KitOwnerIdKind; /** * When set, adds a `restock_listing` automation that periodically raises * every listing's `stock` (by `amount`, clamped to `max_stock`) — the NPC * trader restock pattern. */ restock?: { intervalMs: number; amount?: number; }; } /** Names derived by {@link economyBlueprint} for a given prefix. */ export interface EconomyNames { walletType: string; listingType: string; tradeType: string; marketType: string; /** Snake-cased function-name prefix (empty without a `typePrefix`). */ fnPrefix: string; buyListingFn: string; acceptTradeFn: string; cancelTradeFn: string; buyMarketFn: string; cancelMarketFn: string; restockFn: string; restockAutomation: string; } /** Compute the type/function names an economy blueprint (and its runtime helper) uses. */ export declare function economyNames(typePrefix?: string): EconomyNames; /** The earn/spend function name for one currency. */ export declare function economyCurrencyFn(verb: 'earn' | 'spend', currency: string, typePrefix?: string): string; /** * Blueprint for a server-authoritative **economy**: per-player `Wallet` * containers (one int property per currency), an admin `ShopListing` catalog * with an atomic `buy_listing` (wallet debit + stock decrement + item grant * in ONE invoke), escrow `TradeOffer` swaps, and a player-to-player * `MarketListing` flow (buyer wallet → seller wallet + stack transfer, all * in one transaction). * * Anti-duplication is structural: every movement of currency or items is a * single function invocation whose condition guards check balances, stock, * item identity, and ownership mirrors server-side — never split a spend and * a grant across two invokes. Trusted mints (`earn_`) default to * `invokeScope: "server"` (app admins only). * * Trade/market guards verify stack ownership through the kit-standard * `owner_user_id` mirror property on the stack type (the inventory blueprint * defines it; set it via `InventoryKit.createStack({ ownerUserId })`), and * pin the offer creator via the injected `$self_owner_id` — the server-truth * owner of the offer/listing container. * * Runtime counterpart: `client.kit(appId).economy`. */ export declare function economyBlueprint(options?: EconomyBlueprintOptions): KitBlueprint; //# sourceMappingURL=economy.d.ts.map