@@ -3079,14 +3079,16 @@ interface Market {
3079
3079
* it will be automatically activated and deactivated depending on the resource/credits availability.
3080
3080
*
3081
3081
* An order expires in 30 days after its creation, and the remaining market fee is returned.
3082
+ *
3083
+ * @param params A object describing the order.
3084
+ * @returns One of the following codes:
3085
+ * - OK: The operation has been scheduled successfully.
3086
+ * - ERR_NOT_OWNER: You are not the owner of the room's terminal or there is no terminal.
3087
+ * - ERR_NOT_ENOUGH_RESOURCES: You don't have enough credits to pay a fee.
3088
+ * - ERR_FULL: You cannot create more than 50 orders.
3089
+ * - ERR_INVALID_ARGS: The arguments provided are invalid.
3082
3090
*/
3083
- createOrder ( params : {
3084
- type : ORDER_BUY | ORDER_SELL ;
3085
- resourceType : MarketResourceConstant ;
3086
- price : number ;
3087
- totalAmount : number ;
3088
- roomName ?: string ;
3089
- } ) : ScreepsReturnCode ;
3091
+ createOrder ( params : CreateOrderParam ) : ScreepsReturnCode ;
3090
3092
/**
3091
3093
* Execute a trade deal from your Terminal to another player's Terminal using the specified buy/sell order.
3092
3094
*
@@ -3186,6 +3188,37 @@ interface PriceHistory {
3186
3188
avgPrice : number ;
3187
3189
stddevPrice : number ;
3188
3190
}
3191
+
3192
+ /** Parameters to {@link Game.market.createOrder} */
3193
+ interface CreateOrderParam {
3194
+ /**
3195
+ * The order type.
3196
+ */
3197
+ type : ORDER_BUY | ORDER_SELL ;
3198
+ /**
3199
+ * The resource type to trade.
3200
+ *
3201
+ * If your Terminal doesn't have the specified resource, the order will be temporary inactive.
3202
+ */
3203
+ resourceType : MarketResourceConstant ;
3204
+ /**
3205
+ * The price for one resource unit in credits.
3206
+ *
3207
+ * Can be a decimal number.
3208
+ */
3209
+ price : number ;
3210
+ /**
3211
+ * The amount of resources to be traded in total.
3212
+ */
3213
+ totalAmount : number ;
3214
+ /**
3215
+ * The room where your order will be created.
3216
+ *
3217
+ * You must have your own Terminal structure in this room, otherwise the created order will be temporary inactive.
3218
+ * This argument is not used when `resourceType` is one of the {@link InterShardResourceConstant} resources.
3219
+ */
3220
+ roomName ?: string ;
3221
+ }
3189
3222
interface Memory {
3190
3223
creeps : { [ name : string ] : CreepMemory } ;
3191
3224
powerCreeps : { [ name : string ] : PowerCreepMemory } ;
0 commit comments