@shipload/sdk 0.6.0 → 0.7.1
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 +4 -2
- package/lib/shipload.js +1206 -4
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +1206 -5
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/contracts/platform.ts +30 -30
- package/src/contracts/server.ts +117 -117
- package/src/index-module.ts +1 -0
- package/src/shipload.ts +3 -1
- package/src/syllables.ts +1184 -0
- package/src/system.ts +37 -0
- package/src/travel.ts +1 -9
package/src/contracts/server.ts
CHANGED
|
@@ -31,347 +31,347 @@ export namespace Types {
|
|
|
31
31
|
@Struct.type('advance')
|
|
32
32
|
export class advance extends Struct {
|
|
33
33
|
@Struct.field('string')
|
|
34
|
-
reveal
|
|
34
|
+
declare reveal: string
|
|
35
35
|
@Struct.field(Checksum256)
|
|
36
|
-
commit
|
|
36
|
+
declare commit: Checksum256
|
|
37
37
|
}
|
|
38
38
|
@Struct.type('arrive')
|
|
39
39
|
export class arrive extends Struct {
|
|
40
40
|
@Struct.field(UInt64)
|
|
41
|
-
id
|
|
41
|
+
declare id: UInt64
|
|
42
42
|
}
|
|
43
43
|
@Struct.type('buygoods')
|
|
44
44
|
export class buygoods extends Struct {
|
|
45
45
|
@Struct.field(UInt64)
|
|
46
|
-
ship_id
|
|
46
|
+
declare ship_id: UInt64
|
|
47
47
|
@Struct.field(UInt64)
|
|
48
|
-
good_id
|
|
48
|
+
declare good_id: UInt64
|
|
49
49
|
@Struct.field(UInt64)
|
|
50
|
-
quantity
|
|
50
|
+
declare quantity: UInt64
|
|
51
51
|
}
|
|
52
52
|
@Struct.type('buyship')
|
|
53
53
|
export class buyship extends Struct {
|
|
54
54
|
@Struct.field(Name)
|
|
55
|
-
account
|
|
55
|
+
declare account: Name
|
|
56
56
|
@Struct.field('string')
|
|
57
|
-
name
|
|
57
|
+
declare name: string
|
|
58
58
|
}
|
|
59
59
|
@Struct.type('cargo_row')
|
|
60
60
|
export class cargo_row extends Struct {
|
|
61
61
|
@Struct.field(UInt64)
|
|
62
|
-
id
|
|
62
|
+
declare id: UInt64
|
|
63
63
|
@Struct.field(UInt64)
|
|
64
|
-
ship_id
|
|
64
|
+
declare ship_id: UInt64
|
|
65
65
|
@Struct.field(UInt64)
|
|
66
|
-
good_id
|
|
66
|
+
declare good_id: UInt64
|
|
67
67
|
@Struct.field(UInt64)
|
|
68
|
-
paid
|
|
68
|
+
declare paid: UInt64
|
|
69
69
|
@Struct.field(UInt32)
|
|
70
|
-
owned
|
|
70
|
+
declare owned: UInt32
|
|
71
71
|
@Struct.field(UInt32)
|
|
72
|
-
loaded
|
|
72
|
+
declare loaded: UInt32
|
|
73
73
|
}
|
|
74
74
|
@Struct.type('cleartable')
|
|
75
75
|
export class cleartable extends Struct {
|
|
76
76
|
@Struct.field(Name)
|
|
77
|
-
table_name
|
|
77
|
+
declare table_name: Name
|
|
78
78
|
@Struct.field(Name, {optional: true})
|
|
79
|
-
scope?: Name
|
|
79
|
+
declare scope?: Name
|
|
80
80
|
@Struct.field(UInt64, {optional: true})
|
|
81
|
-
max_rows?: UInt64
|
|
81
|
+
declare max_rows?: UInt64
|
|
82
82
|
}
|
|
83
83
|
@Struct.type('commit')
|
|
84
84
|
export class commit extends Struct {
|
|
85
85
|
@Struct.field(Checksum256)
|
|
86
|
-
commit
|
|
86
|
+
declare commit: Checksum256
|
|
87
87
|
}
|
|
88
88
|
@Struct.type('coordinates')
|
|
89
89
|
export class coordinates extends Struct {
|
|
90
90
|
@Struct.field(Int64)
|
|
91
|
-
x
|
|
91
|
+
declare x: Int64
|
|
92
92
|
@Struct.field(Int64)
|
|
93
|
-
y
|
|
93
|
+
declare y: Int64
|
|
94
94
|
}
|
|
95
95
|
@Struct.type('enable')
|
|
96
96
|
export class enable extends Struct {
|
|
97
97
|
@Struct.field('bool')
|
|
98
|
-
enabled
|
|
98
|
+
declare enabled: boolean
|
|
99
99
|
}
|
|
100
100
|
@Struct.type('good_price')
|
|
101
101
|
export class good_price extends Struct {
|
|
102
102
|
@Struct.field(UInt16)
|
|
103
|
-
id
|
|
103
|
+
declare id: UInt16
|
|
104
104
|
@Struct.field(UInt64)
|
|
105
|
-
price
|
|
105
|
+
declare price: UInt64
|
|
106
106
|
@Struct.field(UInt64)
|
|
107
|
-
supply
|
|
107
|
+
declare supply: UInt64
|
|
108
108
|
}
|
|
109
109
|
@Struct.type('hash')
|
|
110
110
|
export class hash extends Struct {
|
|
111
111
|
@Struct.field('string')
|
|
112
|
-
value
|
|
112
|
+
declare value: string
|
|
113
113
|
}
|
|
114
114
|
@Struct.type('hash512')
|
|
115
115
|
export class hash512 extends Struct {
|
|
116
116
|
@Struct.field('string')
|
|
117
|
-
value
|
|
117
|
+
declare value: string
|
|
118
118
|
}
|
|
119
119
|
@Struct.type('init')
|
|
120
120
|
export class init extends Struct {
|
|
121
121
|
@Struct.field(Checksum256)
|
|
122
|
-
seed
|
|
122
|
+
declare seed: Checksum256
|
|
123
123
|
}
|
|
124
124
|
@Struct.type('jettison')
|
|
125
125
|
export class jettison extends Struct {
|
|
126
126
|
@Struct.field(UInt64)
|
|
127
|
-
ship_id
|
|
127
|
+
declare ship_id: UInt64
|
|
128
128
|
@Struct.field(UInt16)
|
|
129
|
-
good_id
|
|
129
|
+
declare good_id: UInt16
|
|
130
130
|
@Struct.field(UInt64)
|
|
131
|
-
quantity
|
|
131
|
+
declare quantity: UInt64
|
|
132
132
|
}
|
|
133
133
|
@Struct.type('join')
|
|
134
134
|
export class join extends Struct {
|
|
135
135
|
@Struct.field(Name)
|
|
136
|
-
account
|
|
136
|
+
declare account: Name
|
|
137
137
|
}
|
|
138
138
|
@Struct.type('loader_stats')
|
|
139
139
|
export class loader_stats extends Struct {
|
|
140
140
|
@Struct.field(UInt32)
|
|
141
|
-
mass
|
|
141
|
+
declare mass: UInt32
|
|
142
142
|
@Struct.field(UInt16)
|
|
143
|
-
quantity
|
|
143
|
+
declare quantity: UInt16
|
|
144
144
|
@Struct.field(UInt32)
|
|
145
|
-
thrust
|
|
145
|
+
declare thrust: UInt32
|
|
146
146
|
}
|
|
147
147
|
@Struct.type('location_row')
|
|
148
148
|
export class location_row extends Struct {
|
|
149
149
|
@Struct.field(UInt64)
|
|
150
|
-
id
|
|
150
|
+
declare id: UInt64
|
|
151
151
|
@Struct.field(coordinates)
|
|
152
|
-
coordinates
|
|
152
|
+
declare coordinates: coordinates
|
|
153
153
|
@Struct.field(UInt64)
|
|
154
|
-
epoch
|
|
154
|
+
declare epoch: UInt64
|
|
155
155
|
@Struct.field(UInt16)
|
|
156
|
-
good_id
|
|
156
|
+
declare good_id: UInt16
|
|
157
157
|
@Struct.field(UInt16)
|
|
158
|
-
supply
|
|
158
|
+
declare supply: UInt16
|
|
159
159
|
}
|
|
160
160
|
@Struct.type('marketprice')
|
|
161
161
|
export class marketprice extends Struct {
|
|
162
162
|
@Struct.field(coordinates)
|
|
163
|
-
location
|
|
163
|
+
declare location: coordinates
|
|
164
164
|
@Struct.field(UInt16)
|
|
165
|
-
good_id
|
|
165
|
+
declare good_id: UInt16
|
|
166
166
|
}
|
|
167
167
|
@Struct.type('marketprices')
|
|
168
168
|
export class marketprices extends Struct {
|
|
169
169
|
@Struct.field(coordinates)
|
|
170
|
-
location
|
|
170
|
+
declare location: coordinates
|
|
171
171
|
}
|
|
172
172
|
@Struct.type('payloan')
|
|
173
173
|
export class payloan extends Struct {
|
|
174
174
|
@Struct.field(Name)
|
|
175
|
-
account
|
|
175
|
+
declare account: Name
|
|
176
176
|
@Struct.field(UInt64)
|
|
177
|
-
amount
|
|
177
|
+
declare amount: UInt64
|
|
178
178
|
}
|
|
179
179
|
@Struct.type('player_row')
|
|
180
180
|
export class player_row extends Struct {
|
|
181
181
|
@Struct.field(Name)
|
|
182
|
-
owner
|
|
182
|
+
declare owner: Name
|
|
183
183
|
@Struct.field(UInt64)
|
|
184
|
-
balance
|
|
184
|
+
declare balance: UInt64
|
|
185
185
|
@Struct.field(UInt64)
|
|
186
|
-
debt
|
|
186
|
+
declare debt: UInt64
|
|
187
187
|
@Struct.field(Int64)
|
|
188
|
-
networth
|
|
188
|
+
declare networth: Int64
|
|
189
189
|
}
|
|
190
190
|
@Struct.type('salt')
|
|
191
191
|
export class salt extends Struct {
|
|
192
192
|
@Struct.field(UInt64)
|
|
193
|
-
salt
|
|
193
|
+
declare salt: UInt64
|
|
194
194
|
}
|
|
195
195
|
@Struct.type('sellgoods')
|
|
196
196
|
export class sellgoods extends Struct {
|
|
197
197
|
@Struct.field(UInt64)
|
|
198
|
-
ship_id
|
|
198
|
+
declare ship_id: UInt64
|
|
199
199
|
@Struct.field(UInt64)
|
|
200
|
-
good_id
|
|
200
|
+
declare good_id: UInt64
|
|
201
201
|
@Struct.field(UInt64)
|
|
202
|
-
quantity
|
|
202
|
+
declare quantity: UInt64
|
|
203
203
|
}
|
|
204
204
|
@Struct.type('sequence_row')
|
|
205
205
|
export class sequence_row extends Struct {
|
|
206
206
|
@Struct.field(Name)
|
|
207
|
-
key
|
|
207
|
+
declare key: Name
|
|
208
208
|
@Struct.field(UInt64)
|
|
209
|
-
value
|
|
209
|
+
declare value: UInt64
|
|
210
210
|
}
|
|
211
211
|
@Struct.type('ship_state')
|
|
212
212
|
export class ship_state extends Struct {
|
|
213
213
|
@Struct.field(UInt32)
|
|
214
|
-
energy
|
|
214
|
+
declare energy: UInt32
|
|
215
215
|
}
|
|
216
216
|
@Struct.type('ship_stats')
|
|
217
217
|
export class ship_stats extends Struct {
|
|
218
218
|
@Struct.field(UInt32)
|
|
219
|
-
capacity
|
|
219
|
+
declare capacity: UInt32
|
|
220
220
|
@Struct.field(UInt32)
|
|
221
|
-
drain
|
|
221
|
+
declare drain: UInt32
|
|
222
222
|
@Struct.field(UInt64)
|
|
223
|
-
mass
|
|
223
|
+
declare mass: UInt64
|
|
224
224
|
@Struct.field(UInt64)
|
|
225
|
-
maxmass
|
|
225
|
+
declare maxmass: UInt64
|
|
226
226
|
@Struct.field(UInt16)
|
|
227
|
-
orbit
|
|
227
|
+
declare orbit: UInt16
|
|
228
228
|
@Struct.field(UInt32)
|
|
229
|
-
recharge
|
|
229
|
+
declare recharge: UInt32
|
|
230
230
|
@Struct.field(UInt64)
|
|
231
|
-
thrust
|
|
231
|
+
declare thrust: UInt64
|
|
232
232
|
}
|
|
233
233
|
@Struct.type('travel_plan')
|
|
234
234
|
export class travel_plan extends Struct {
|
|
235
235
|
@Struct.field(TimePoint)
|
|
236
|
-
departure
|
|
236
|
+
declare departure: TimePoint
|
|
237
237
|
@Struct.field(coordinates)
|
|
238
|
-
destination
|
|
238
|
+
declare destination: coordinates
|
|
239
239
|
@Struct.field(UInt64)
|
|
240
|
-
distance
|
|
240
|
+
declare distance: UInt64
|
|
241
241
|
@Struct.field(UInt32)
|
|
242
|
-
flighttime
|
|
242
|
+
declare flighttime: UInt32
|
|
243
243
|
@Struct.field(UInt32)
|
|
244
|
-
loadtime
|
|
244
|
+
declare loadtime: UInt32
|
|
245
245
|
@Struct.field(UInt32)
|
|
246
|
-
rechargetime
|
|
246
|
+
declare rechargetime: UInt32
|
|
247
247
|
@Struct.field(UInt32)
|
|
248
|
-
masspenalty
|
|
248
|
+
declare masspenalty: UInt32
|
|
249
249
|
@Struct.field(UInt64)
|
|
250
|
-
mass
|
|
250
|
+
declare mass: UInt64
|
|
251
251
|
@Struct.field(UInt32)
|
|
252
|
-
energyusage
|
|
252
|
+
declare energyusage: UInt32
|
|
253
253
|
}
|
|
254
254
|
@Struct.type('ship_row')
|
|
255
255
|
export class ship_row extends Struct {
|
|
256
256
|
@Struct.field(UInt64)
|
|
257
|
-
id
|
|
257
|
+
declare id: UInt64
|
|
258
258
|
@Struct.field(Name)
|
|
259
|
-
owner
|
|
259
|
+
declare owner: Name
|
|
260
260
|
@Struct.field('string')
|
|
261
|
-
name
|
|
261
|
+
declare name: string
|
|
262
262
|
@Struct.field(coordinates)
|
|
263
|
-
location
|
|
263
|
+
declare location: coordinates
|
|
264
264
|
@Struct.field(UInt8)
|
|
265
|
-
skin
|
|
265
|
+
declare skin: UInt8
|
|
266
266
|
@Struct.field(UInt8)
|
|
267
|
-
tier
|
|
267
|
+
declare tier: UInt8
|
|
268
268
|
@Struct.field(ship_state)
|
|
269
|
-
state
|
|
269
|
+
declare state: ship_state
|
|
270
270
|
@Struct.field(ship_stats)
|
|
271
|
-
stats
|
|
271
|
+
declare stats: ship_stats
|
|
272
272
|
@Struct.field(loader_stats)
|
|
273
|
-
loaders
|
|
273
|
+
declare loaders: loader_stats
|
|
274
274
|
@Struct.field(travel_plan, {optional: true})
|
|
275
|
-
travelplan?: travel_plan
|
|
275
|
+
declare travelplan?: travel_plan
|
|
276
276
|
}
|
|
277
277
|
@Struct.type('state_row')
|
|
278
278
|
export class state_row extends Struct {
|
|
279
279
|
@Struct.field('bool')
|
|
280
|
-
enabled
|
|
280
|
+
declare enabled: boolean
|
|
281
281
|
@Struct.field(UInt64)
|
|
282
|
-
epoch
|
|
282
|
+
declare epoch: UInt64
|
|
283
283
|
@Struct.field(UInt64)
|
|
284
|
-
salt
|
|
284
|
+
declare salt: UInt64
|
|
285
285
|
@Struct.field(UInt32)
|
|
286
|
-
ships
|
|
286
|
+
declare ships: UInt32
|
|
287
287
|
@Struct.field(Checksum256)
|
|
288
|
-
seed
|
|
288
|
+
declare seed: Checksum256
|
|
289
289
|
@Struct.field(Checksum256)
|
|
290
|
-
commit
|
|
290
|
+
declare commit: Checksum256
|
|
291
291
|
}
|
|
292
292
|
@Struct.type('takeloan')
|
|
293
293
|
export class takeloan extends Struct {
|
|
294
294
|
@Struct.field(Name)
|
|
295
|
-
account
|
|
295
|
+
declare account: Name
|
|
296
296
|
@Struct.field(UInt64)
|
|
297
|
-
amount
|
|
297
|
+
declare amount: UInt64
|
|
298
298
|
}
|
|
299
299
|
@Struct.type('travel')
|
|
300
300
|
export class travel extends Struct {
|
|
301
301
|
@Struct.field(UInt64)
|
|
302
|
-
id
|
|
302
|
+
declare id: UInt64
|
|
303
303
|
@Struct.field(coordinates)
|
|
304
|
-
destination
|
|
304
|
+
declare destination: coordinates
|
|
305
305
|
@Struct.field('bool')
|
|
306
|
-
recharge
|
|
306
|
+
declare recharge: boolean
|
|
307
307
|
}
|
|
308
308
|
@Struct.type('travel_summary')
|
|
309
309
|
export class travel_summary extends Struct {
|
|
310
310
|
@Struct.field(ship_stats)
|
|
311
|
-
stats
|
|
311
|
+
declare stats: ship_stats
|
|
312
312
|
@Struct.field(loader_stats)
|
|
313
|
-
loaders
|
|
313
|
+
declare loaders: loader_stats
|
|
314
314
|
@Struct.field(coordinates)
|
|
315
|
-
origin
|
|
315
|
+
declare origin: coordinates
|
|
316
316
|
@Struct.field(coordinates)
|
|
317
|
-
destination
|
|
317
|
+
declare destination: coordinates
|
|
318
318
|
@Struct.field(UInt64)
|
|
319
|
-
distance
|
|
319
|
+
declare distance: UInt64
|
|
320
320
|
@Struct.field(UInt64)
|
|
321
|
-
totalmass
|
|
321
|
+
declare totalmass: UInt64
|
|
322
322
|
@Struct.field(Float64)
|
|
323
|
-
acceleration
|
|
323
|
+
declare acceleration: Float64
|
|
324
324
|
@Struct.field(UInt32)
|
|
325
|
-
flighttime
|
|
325
|
+
declare flighttime: UInt32
|
|
326
326
|
@Struct.field(UInt32)
|
|
327
|
-
energyusage
|
|
327
|
+
declare energyusage: UInt32
|
|
328
328
|
@Struct.field(UInt32)
|
|
329
|
-
rechargetime
|
|
329
|
+
declare rechargetime: UInt32
|
|
330
330
|
@Struct.field(UInt32)
|
|
331
|
-
masspenalty
|
|
331
|
+
declare masspenalty: UInt32
|
|
332
332
|
@Struct.field(UInt64)
|
|
333
|
-
loadtime
|
|
333
|
+
declare loadtime: UInt64
|
|
334
334
|
@Struct.field(UInt64)
|
|
335
|
-
time
|
|
335
|
+
declare time: UInt64
|
|
336
336
|
}
|
|
337
337
|
@Struct.type('travelplan')
|
|
338
338
|
export class travelplan extends Struct {
|
|
339
339
|
@Struct.field(UInt64)
|
|
340
|
-
id
|
|
340
|
+
declare id: UInt64
|
|
341
341
|
@Struct.field(coordinates)
|
|
342
|
-
origin
|
|
342
|
+
declare origin: coordinates
|
|
343
343
|
@Struct.field(coordinates)
|
|
344
|
-
destination
|
|
344
|
+
declare destination: coordinates
|
|
345
345
|
@Struct.field('bool')
|
|
346
|
-
recharge
|
|
346
|
+
declare recharge: boolean
|
|
347
347
|
}
|
|
348
348
|
@Struct.type('traveltime')
|
|
349
349
|
export class traveltime extends Struct {
|
|
350
350
|
@Struct.field(UInt64)
|
|
351
|
-
id
|
|
351
|
+
declare id: UInt64
|
|
352
352
|
@Struct.field(coordinates)
|
|
353
|
-
destination
|
|
353
|
+
declare destination: coordinates
|
|
354
354
|
}
|
|
355
355
|
@Struct.type('updatecredit')
|
|
356
356
|
export class updatecredit extends Struct {
|
|
357
357
|
@Struct.field(Name)
|
|
358
|
-
account
|
|
358
|
+
declare account: Name
|
|
359
359
|
@Struct.field(Int64)
|
|
360
|
-
amount
|
|
360
|
+
declare amount: Int64
|
|
361
361
|
}
|
|
362
362
|
@Struct.type('updatedebt')
|
|
363
363
|
export class updatedebt extends Struct {
|
|
364
364
|
@Struct.field(Name)
|
|
365
|
-
account
|
|
365
|
+
declare account: Name
|
|
366
366
|
@Struct.field(Int64)
|
|
367
|
-
amount
|
|
367
|
+
declare amount: Int64
|
|
368
368
|
}
|
|
369
369
|
@Struct.type('upgradeship')
|
|
370
370
|
export class upgradeship extends Struct {
|
|
371
371
|
@Struct.field(Name)
|
|
372
|
-
account
|
|
372
|
+
declare account: Name
|
|
373
373
|
@Struct.field(UInt64)
|
|
374
|
-
id
|
|
374
|
+
declare id: UInt64
|
|
375
375
|
}
|
|
376
376
|
@Struct.type('wipe')
|
|
377
377
|
export class wipe extends Struct {}
|
package/src/index-module.ts
CHANGED
package/src/shipload.ts
CHANGED
|
@@ -15,9 +15,11 @@ import {PlatformContract, ServerContract} from './contracts'
|
|
|
15
15
|
import {ERROR_SYSTEM_NOT_INITIALIZED} from './errors'
|
|
16
16
|
import {ChainDefinition} from '@wharfkit/session'
|
|
17
17
|
import ContractKit, {Contract} from '@wharfkit/contract'
|
|
18
|
-
import {findNearbyPlanets,
|
|
18
|
+
import {findNearbyPlanets, travelplan} from './travel'
|
|
19
|
+
|
|
19
20
|
import {Ship} from './ship'
|
|
20
21
|
import {EpochInfo, getCurrentEpoch, getEpochInfo} from './epoch'
|
|
22
|
+
import {hasSystem} from './system'
|
|
21
23
|
|
|
22
24
|
interface ShiploadOptions {
|
|
23
25
|
platformContractName?: string
|