mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 18:50:56 +02:00
API: Standardize names of Stock APIs (#2173)
This commit is contained in:
@@ -16,9 +16,9 @@ import {
|
||||
getStockMarketWseCost,
|
||||
getStockMarketTixApiCost,
|
||||
} from "../StockMarket/StockMarketCosts";
|
||||
import { Stock } from "../StockMarket/Stock";
|
||||
import { StockOrder, TIX } from "@nsdefs";
|
||||
import { InternalAPI, NetscriptContext } from "../Netscript/APIWrapper";
|
||||
import type { Stock } from "../StockMarket/Stock";
|
||||
import type { StockOrder, TIX } from "@nsdefs";
|
||||
import { setRemovedFunctions, type InternalAPI, type NetscriptContext } from "../Netscript/APIWrapper";
|
||||
import { helpers } from "../Netscript/NetscriptHelpers";
|
||||
import { StockMarketConstants } from "../StockMarket/data/Constants";
|
||||
import { getEnumHelper } from "../utils/EnumHelper";
|
||||
@@ -43,12 +43,12 @@ export function NetscriptStockMarket(): InternalAPI<TIX> {
|
||||
return stock;
|
||||
};
|
||||
|
||||
return {
|
||||
const stockFunctions: InternalAPI<TIX> = {
|
||||
getConstants: () => () => structuredClone(StockMarketConstants),
|
||||
hasWSEAccount: () => () => Player.hasWseAccount,
|
||||
hasTIXAPIAccess: () => () => Player.hasTixApiAccess,
|
||||
hasWseAccount: () => () => Player.hasWseAccount,
|
||||
hasTixApiAccess: () => () => Player.hasTixApiAccess,
|
||||
has4SData: () => () => Player.has4SData,
|
||||
has4SDataTIXAPI: () => () => Player.has4SDataTixApi,
|
||||
has4SDataTixApi: () => () => Player.has4SDataTixApi,
|
||||
getSymbols: (ctx) => () => {
|
||||
checkTixApiAccess(ctx);
|
||||
return Object.values(StockSymbol);
|
||||
@@ -333,4 +333,12 @@ export function NetscriptStockMarket(): InternalAPI<TIX> {
|
||||
return StockMarketPromise.promise;
|
||||
},
|
||||
};
|
||||
|
||||
setRemovedFunctions(stockFunctions, {
|
||||
hasWSEAccount: { version: "3.0.0", replacement: "stock.hasWseAccount()" },
|
||||
hasTIXAPIAccess: { version: "3.0.0", replacement: "stock.hasTixApiAccess()" },
|
||||
has4SDataTIXAPI: { version: "3.0.0", replacement: "stock.has4SDataTixApi()" },
|
||||
});
|
||||
|
||||
return stockFunctions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user