new Structure(character, structureId)
Create a new Structure for the given character
and specific
structureId
. Requires a character with access to the structure.
Parameters:
Name | Type | Description |
---|---|---|
character |
Character | The character with access to the structure |
structureId |
Number | The structure id that is used for all requests |
Methods
-
buyOrdersFor(typeId)
-
Get all buy market orders in the region for the particular item type. This is equivalent to ordersFor except that it additionally filters orders to have
is_buy_order
set totrue
.Parameters:
Name Type Description typeId
Number The type id to query from the market
Returns:
A Promise that resolves to the response of the request
- Type
- Promise.<Array.<Object>>
-
info()
-
Returns information on requested structure, if you are on the ACL. Otherwise, returns "Forbidden" for all inputs. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/universe/structures/{structure_id}/
. The route version isv1
.On success, this resolves to data about a structure. An example result is:
{ "name": "V-3YG7 VI - The Capital", "position": { "x": 0, "y": 0, "z": 0 }, "solar_system_id": 30000142, "type_id": 0 }
This function must be used with an SSO token that has the following scopes:
esi-universe.read_structures.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Object>
-
orders(page)
-
Return all orders in a structure. This route is cached for up to 300 seconds.
This makes an HTTP GET request to
/markets/structures/{structure_id}/
. The route version isv1
.On success, this resolves to a list of orders. An example result is:
[ { "duration": 90, "is_buy_order": false, "issued": "2016-09-03T05:12:25Z", "location_id": 60005599, "min_volume": 1, "order_id": 4623824223, "price": 9.9, "range": "region", "type_id": 34, "volume_remain": 1296000, "volume_total": 2000000 } ]
This function must be used with an SSO token that has the following scopes:
esi-markets.structure_markets.v1
Parameters:
Name Type Default Description page
Number 0 Optional; which page to query, starting at 1. If
0
, all pages of orders are returned as a concatenated array.Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
ordersFor(typeId)
-
Get all market orders in the region for the given item type from the ESI endpoint. Orders include buy and sell, but are restricted to the selected type id.
While the ESI endpoints support native type filtering for regions, this type filtering is implemented in-library for structures. This means that all orders for the structure are requested via orders and then filtered.
Parameters:
Name Type Description typeId
Number The type id to query from the market
Returns:
A Promise that resolves to the response of the request
- Type
- Promise.<Array.<Object>>
-
sellOrdersFor(typeId)
-
Get all sell market orders in the region for the particular item type. This is equivalent to ordersFor except that it additionally filters orders to have
is_buy_order
set tofalse
.Parameters:
Name Type Description typeId
Number The type id to query from the market
Returns:
A Promise that resolves to the response of the request
- Type
- Promise.<Array.<Object>>
-
vulnerability(newSchedule)
-
Update the vulnerability window schedule of a corporation structure.
This makes an HTTP PUT request to
/corporations/{corporation_id}/structures/{structure_id}/
. The route version isv1
.An example value for
newSchedule
is shown below:[ { "day": 0, "hour": 0 } ]
The array length of
newSchedule
must be between1
and168
.On success, this resolves to an empty object.
This function must be used with an SSO token that has the following scopes:
esi-corporations.write_structures.v1
Parameters:
Name Type Description newSchedule
Array.<Object> New vulnerability window schedule for the structure.
Returns:
A Promise that resolves to an empty object.
- Type
- Promise.<Object>