diff --git a/src/NetscriptFunctions/StockMarket.ts b/src/NetscriptFunctions/StockMarket.ts index 3851ccca2..ace7a8889 100644 --- a/src/NetscriptFunctions/StockMarket.ts +++ b/src/NetscriptFunctions/StockMarket.ts @@ -26,6 +26,15 @@ import { getEnumHelper } from "../utils/EnumHelper"; import { CONSTANTS } from "../Constants"; import { getDarknetVolatilityMult } from "../DarkNet/effects/effects"; +export const getStockFromSymbol = function (ctx: NetscriptContext, symbol: string): Stock { + const stock = SymbolToStockMap[symbol]; + if (stock == null) { + throw helpers.errorMessage(ctx, `Invalid stock symbol: '${symbol}'`); + } + + return stock; +}; + export function NetscriptStockMarket(): InternalAPI { /** Checks if the player has TIX API access. Throws an error if the player does not */ const checkTixApiAccess = function (ctx: NetscriptContext): void { @@ -34,15 +43,6 @@ export function NetscriptStockMarket(): InternalAPI { } }; - const getStockFromSymbol = function (ctx: NetscriptContext, symbol: string): Stock { - const stock = SymbolToStockMap[symbol]; - if (stock == null) { - throw helpers.errorMessage(ctx, `Invalid stock symbol: '${symbol}'`); - } - - return stock; - }; - const stockFunctions: InternalAPI = { getConstants: () => () => structuredClone(StockMarketConstants), hasWseAccount: () => () => Player.hasWseAccount, @@ -353,12 +353,3 @@ export function NetscriptStockMarket(): InternalAPI { return stockFunctions; } - -export const getStockFromSymbol = function (ctx: NetscriptContext, symbol: string): Stock { - const stock = SymbolToStockMap[symbol]; - if (stock == null) { - throw helpers.errorMessage(ctx, `Invalid stock symbol: '${symbol}'`); - } - - return stock; -};