NETSCRIPT: Add ns.stock.getConstants (#692)

This commit is contained in:
Snarling
2023-07-31 23:08:42 -04:00
committed by GitHub
parent a85efbc4da
commit 1c6369ffa4
18 changed files with 230 additions and 56 deletions

View File

@@ -393,6 +393,27 @@ interface StockOrder {
[key: string]: StockOrderObject[];
}
/** Constants used for the stockmarket game mechanic.
* @public */
interface StockMarketConstants {
/** Normal time in ms between stock market updates */
msPerStockUpdate: number;
/** Minimum time in ms between stock market updates if there is stored offline/bonus time */
msPerStockUpdateMin: number;
/** An internal constant used while determining when to flip a stock's forecast */
TicksPerCycle: number;
/** Cost of the WSE account */
WSEAccountCost: number;
/** Cost of the TIX API */
TIXAPICost: number;
/** Cost of the 4S Market Data */
MarketData4SCost: number;
/** Cost of the 4S Market Data TIX API integration */
MarketDataTixApi4SCost: number;
/** Commission fee for transactions */
StockMarketCommission: number;
}
/**
* A single process on a server.
* @public
@@ -1077,6 +1098,9 @@ export interface NetscriptPort {
* @public
*/
export interface TIX {
/** Get game constants for the stock market mechanic.
* @remarks RAM cost: 0 GB */
getConstants(): StockMarketConstants;
/**
* Returns true if the player has access to a WSE Account
* @remarks RAM cost: 0.05 GB