@shipload/sdk 1.0.0-next.15 → 1.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/shipload.d.ts +180 -79
- package/lib/shipload.js +155 -124
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +155 -124
- package/lib/shipload.m.js.map +1 -1
- package/lib/testing.d.ts +45 -38
- package/lib/testing.js +136 -117
- package/lib/testing.js.map +1 -1
- package/lib/testing.m.js +136 -117
- package/lib/testing.m.js.map +1 -1
- package/package.json +1 -1
- package/src/contracts/platform.ts +1 -1
- package/src/contracts/server.ts +213 -109
- package/src/managers/actions.ts +22 -2
- package/src/scheduling/projection.ts +0 -4
- package/src/scheduling/task-cargo.ts +0 -1
- package/src/types.ts +0 -2
package/src/managers/actions.ts
CHANGED
|
@@ -187,13 +187,15 @@ export class ActionsManager extends BaseManager {
|
|
|
187
187
|
owner: NameType,
|
|
188
188
|
entityId: UInt64Type,
|
|
189
189
|
nexusId: UInt64Type,
|
|
190
|
-
|
|
190
|
+
cargoId: UInt64Type,
|
|
191
|
+
quantity: UInt64Type
|
|
191
192
|
): Action {
|
|
192
193
|
return this.server.action('wrap', {
|
|
193
194
|
owner: Name.from(owner),
|
|
194
195
|
entity_id: UInt64.from(entityId),
|
|
195
196
|
nexus_id: UInt64.from(nexusId),
|
|
196
|
-
|
|
197
|
+
cargo_id: UInt64.from(cargoId),
|
|
198
|
+
quantity: UInt64.from(quantity),
|
|
197
199
|
})
|
|
198
200
|
}
|
|
199
201
|
|
|
@@ -211,6 +213,24 @@ export class ActionsManager extends BaseManager {
|
|
|
211
213
|
})
|
|
212
214
|
}
|
|
213
215
|
|
|
216
|
+
deploynft(owner: NameType, assetId: UInt64Type, targetNexusId: UInt64Type): Action {
|
|
217
|
+
const params: ServerContract.ActionParams.deploynft = {
|
|
218
|
+
owner: Name.from(owner),
|
|
219
|
+
asset_id: UInt64.from(assetId),
|
|
220
|
+
target_nexus_id: UInt64.from(targetNexusId),
|
|
221
|
+
}
|
|
222
|
+
return this.server.action('deploynft', params)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
unwrapnft(owner: NameType, assetId: UInt64Type, hostId: UInt64Type): Action {
|
|
226
|
+
const params: ServerContract.ActionParams.unwrapnft = {
|
|
227
|
+
owner: Name.from(owner),
|
|
228
|
+
asset_id: UInt64.from(assetId),
|
|
229
|
+
host_id: UInt64.from(hostId),
|
|
230
|
+
}
|
|
231
|
+
return this.server.action('unwrapnft', params)
|
|
232
|
+
}
|
|
233
|
+
|
|
214
234
|
demolish(entityId: UInt64Type): Action {
|
|
215
235
|
return this.server.action('demolish', {
|
|
216
236
|
entity_id: UInt64.from(entityId),
|
|
@@ -255,7 +255,6 @@ function applyTask(projected: ProjectedEntity, task: ServerContract.Types.task):
|
|
|
255
255
|
applyAddCargoTask(projected, task)
|
|
256
256
|
break
|
|
257
257
|
case TaskType.UNLOAD:
|
|
258
|
-
case TaskType.WRAP:
|
|
259
258
|
applyRemoveCargoTask(projected, task)
|
|
260
259
|
break
|
|
261
260
|
case TaskType.GATHER:
|
|
@@ -268,7 +267,6 @@ function applyTask(projected: ProjectedEntity, task: ServerContract.Types.task):
|
|
|
268
267
|
applyDeployTask(projected, task)
|
|
269
268
|
break
|
|
270
269
|
case TaskType.UNDEPLOY:
|
|
271
|
-
case TaskType.WRAP_ENTITY:
|
|
272
270
|
case TaskType.DEMOLISH:
|
|
273
271
|
break
|
|
274
272
|
}
|
|
@@ -440,7 +438,6 @@ export function projectEntityAt(entity: Projectable, now: Date): ProjectedEntity
|
|
|
440
438
|
if (taskComplete) applyAddCargoTask(projected, task)
|
|
441
439
|
break
|
|
442
440
|
case TaskType.UNLOAD:
|
|
443
|
-
case TaskType.WRAP:
|
|
444
441
|
if (taskComplete) applyRemoveCargoTask(projected, task)
|
|
445
442
|
break
|
|
446
443
|
case TaskType.GATHER:
|
|
@@ -453,7 +450,6 @@ export function projectEntityAt(entity: Projectable, now: Date): ProjectedEntity
|
|
|
453
450
|
if (taskComplete) applyDeployTask(projected, task)
|
|
454
451
|
break
|
|
455
452
|
case TaskType.UNDEPLOY:
|
|
456
|
-
case TaskType.WRAP_ENTITY:
|
|
457
453
|
case TaskType.DEMOLISH:
|
|
458
454
|
break
|
|
459
455
|
}
|
|
@@ -34,7 +34,6 @@ export function taskCargoChanges(task: ServerContract.Types.task): TaskCargoChan
|
|
|
34
34
|
case TaskType.GATHER:
|
|
35
35
|
return task.entitytarget ? [] : items.map((i) => toChange(i, 'in'))
|
|
36
36
|
case TaskType.UNLOAD:
|
|
37
|
-
case TaskType.WRAP:
|
|
38
37
|
return items.map((i) => toChange(i, 'out'))
|
|
39
38
|
case TaskType.CRAFT:
|
|
40
39
|
return [
|