STOCK: ns.stock.getOrganization added for getting org from stock symbol (#234)

Authored-by: SamuraiNinjaGuy <branmiller+bitburner@gmail.com>
This commit is contained in:
Snarling
2022-11-28 10:33:28 -05:00
committed by GitHub
parent 837c6bd1c2
commit 0fb7200b4b
3 changed files with 48 additions and 0 deletions
+7
View File
@@ -60,6 +60,13 @@ export function NetscriptStockMarket(): InternalAPI<TIX> {
return stock.price;
},
getOrganization: (ctx) => (_symbol) => {
const symbol = helpers.string(ctx, "symbol", _symbol);
checkTixApiAccess(ctx);
const stock = getStockFromSymbol(ctx, symbol);
return stock.name;
},
getAskPrice: (ctx) => (_symbol) => {
const symbol = helpers.string(ctx, "symbol", _symbol);
checkTixApiAccess(ctx);