@shipload/sdk 0.7.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.
@@ -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!: string
34
+ declare reveal: string
35
35
  @Struct.field(Checksum256)
36
- commit!: Checksum256
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!: UInt64
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!: UInt64
46
+ declare ship_id: UInt64
47
47
  @Struct.field(UInt64)
48
- good_id!: UInt64
48
+ declare good_id: UInt64
49
49
  @Struct.field(UInt64)
50
- quantity!: UInt64
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!: Name
55
+ declare account: Name
56
56
  @Struct.field('string')
57
- name!: string
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!: UInt64
62
+ declare id: UInt64
63
63
  @Struct.field(UInt64)
64
- ship_id!: UInt64
64
+ declare ship_id: UInt64
65
65
  @Struct.field(UInt64)
66
- good_id!: UInt64
66
+ declare good_id: UInt64
67
67
  @Struct.field(UInt64)
68
- paid!: UInt64
68
+ declare paid: UInt64
69
69
  @Struct.field(UInt32)
70
- owned!: UInt32
70
+ declare owned: UInt32
71
71
  @Struct.field(UInt32)
72
- loaded!: UInt32
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!: 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!: Checksum256
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!: Int64
91
+ declare x: Int64
92
92
  @Struct.field(Int64)
93
- y!: Int64
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!: boolean
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!: UInt16
103
+ declare id: UInt16
104
104
  @Struct.field(UInt64)
105
- price!: UInt64
105
+ declare price: UInt64
106
106
  @Struct.field(UInt64)
107
- supply!: UInt64
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!: string
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!: string
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!: Checksum256
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!: UInt64
127
+ declare ship_id: UInt64
128
128
  @Struct.field(UInt16)
129
- good_id!: UInt16
129
+ declare good_id: UInt16
130
130
  @Struct.field(UInt64)
131
- quantity!: UInt64
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!: Name
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!: UInt32
141
+ declare mass: UInt32
142
142
  @Struct.field(UInt16)
143
- quantity!: UInt16
143
+ declare quantity: UInt16
144
144
  @Struct.field(UInt32)
145
- thrust!: UInt32
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!: UInt64
150
+ declare id: UInt64
151
151
  @Struct.field(coordinates)
152
- coordinates!: coordinates
152
+ declare coordinates: coordinates
153
153
  @Struct.field(UInt64)
154
- epoch!: UInt64
154
+ declare epoch: UInt64
155
155
  @Struct.field(UInt16)
156
- good_id!: UInt16
156
+ declare good_id: UInt16
157
157
  @Struct.field(UInt16)
158
- supply!: UInt16
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!: coordinates
163
+ declare location: coordinates
164
164
  @Struct.field(UInt16)
165
- good_id!: UInt16
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!: coordinates
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!: Name
175
+ declare account: Name
176
176
  @Struct.field(UInt64)
177
- amount!: UInt64
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!: Name
182
+ declare owner: Name
183
183
  @Struct.field(UInt64)
184
- balance!: UInt64
184
+ declare balance: UInt64
185
185
  @Struct.field(UInt64)
186
- debt!: UInt64
186
+ declare debt: UInt64
187
187
  @Struct.field(Int64)
188
- networth!: Int64
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!: UInt64
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!: UInt64
198
+ declare ship_id: UInt64
199
199
  @Struct.field(UInt64)
200
- good_id!: UInt64
200
+ declare good_id: UInt64
201
201
  @Struct.field(UInt64)
202
- quantity!: UInt64
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!: Name
207
+ declare key: Name
208
208
  @Struct.field(UInt64)
209
- value!: UInt64
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!: UInt32
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!: UInt32
219
+ declare capacity: UInt32
220
220
  @Struct.field(UInt32)
221
- drain!: UInt32
221
+ declare drain: UInt32
222
222
  @Struct.field(UInt64)
223
- mass!: UInt64
223
+ declare mass: UInt64
224
224
  @Struct.field(UInt64)
225
- maxmass!: UInt64
225
+ declare maxmass: UInt64
226
226
  @Struct.field(UInt16)
227
- orbit!: UInt16
227
+ declare orbit: UInt16
228
228
  @Struct.field(UInt32)
229
- recharge!: UInt32
229
+ declare recharge: UInt32
230
230
  @Struct.field(UInt64)
231
- thrust!: UInt64
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!: TimePoint
236
+ declare departure: TimePoint
237
237
  @Struct.field(coordinates)
238
- destination!: coordinates
238
+ declare destination: coordinates
239
239
  @Struct.field(UInt64)
240
- distance!: UInt64
240
+ declare distance: UInt64
241
241
  @Struct.field(UInt32)
242
- flighttime!: UInt32
242
+ declare flighttime: UInt32
243
243
  @Struct.field(UInt32)
244
- loadtime!: UInt32
244
+ declare loadtime: UInt32
245
245
  @Struct.field(UInt32)
246
- rechargetime!: UInt32
246
+ declare rechargetime: UInt32
247
247
  @Struct.field(UInt32)
248
- masspenalty!: UInt32
248
+ declare masspenalty: UInt32
249
249
  @Struct.field(UInt64)
250
- mass!: UInt64
250
+ declare mass: UInt64
251
251
  @Struct.field(UInt32)
252
- energyusage!: UInt32
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!: UInt64
257
+ declare id: UInt64
258
258
  @Struct.field(Name)
259
- owner!: Name
259
+ declare owner: Name
260
260
  @Struct.field('string')
261
- name!: string
261
+ declare name: string
262
262
  @Struct.field(coordinates)
263
- location!: coordinates
263
+ declare location: coordinates
264
264
  @Struct.field(UInt8)
265
- skin!: UInt8
265
+ declare skin: UInt8
266
266
  @Struct.field(UInt8)
267
- tier!: UInt8
267
+ declare tier: UInt8
268
268
  @Struct.field(ship_state)
269
- state!: ship_state
269
+ declare state: ship_state
270
270
  @Struct.field(ship_stats)
271
- stats!: ship_stats
271
+ declare stats: ship_stats
272
272
  @Struct.field(loader_stats)
273
- loaders!: loader_stats
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!: boolean
280
+ declare enabled: boolean
281
281
  @Struct.field(UInt64)
282
- epoch!: UInt64
282
+ declare epoch: UInt64
283
283
  @Struct.field(UInt64)
284
- salt!: UInt64
284
+ declare salt: UInt64
285
285
  @Struct.field(UInt32)
286
- ships!: UInt32
286
+ declare ships: UInt32
287
287
  @Struct.field(Checksum256)
288
- seed!: Checksum256
288
+ declare seed: Checksum256
289
289
  @Struct.field(Checksum256)
290
- commit!: Checksum256
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!: Name
295
+ declare account: Name
296
296
  @Struct.field(UInt64)
297
- amount!: UInt64
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!: UInt64
302
+ declare id: UInt64
303
303
  @Struct.field(coordinates)
304
- destination!: coordinates
304
+ declare destination: coordinates
305
305
  @Struct.field('bool')
306
- recharge!: boolean
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!: ship_stats
311
+ declare stats: ship_stats
312
312
  @Struct.field(loader_stats)
313
- loaders!: loader_stats
313
+ declare loaders: loader_stats
314
314
  @Struct.field(coordinates)
315
- origin!: coordinates
315
+ declare origin: coordinates
316
316
  @Struct.field(coordinates)
317
- destination!: coordinates
317
+ declare destination: coordinates
318
318
  @Struct.field(UInt64)
319
- distance!: UInt64
319
+ declare distance: UInt64
320
320
  @Struct.field(UInt64)
321
- totalmass!: UInt64
321
+ declare totalmass: UInt64
322
322
  @Struct.field(Float64)
323
- acceleration!: Float64
323
+ declare acceleration: Float64
324
324
  @Struct.field(UInt32)
325
- flighttime!: UInt32
325
+ declare flighttime: UInt32
326
326
  @Struct.field(UInt32)
327
- energyusage!: UInt32
327
+ declare energyusage: UInt32
328
328
  @Struct.field(UInt32)
329
- rechargetime!: UInt32
329
+ declare rechargetime: UInt32
330
330
  @Struct.field(UInt32)
331
- masspenalty!: UInt32
331
+ declare masspenalty: UInt32
332
332
  @Struct.field(UInt64)
333
- loadtime!: UInt64
333
+ declare loadtime: UInt64
334
334
  @Struct.field(UInt64)
335
- time!: UInt64
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!: UInt64
340
+ declare id: UInt64
341
341
  @Struct.field(coordinates)
342
- origin!: coordinates
342
+ declare origin: coordinates
343
343
  @Struct.field(coordinates)
344
- destination!: coordinates
344
+ declare destination: coordinates
345
345
  @Struct.field('bool')
346
- recharge!: boolean
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!: UInt64
351
+ declare id: UInt64
352
352
  @Struct.field(coordinates)
353
- destination!: coordinates
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!: Name
358
+ declare account: Name
359
359
  @Struct.field(Int64)
360
- amount!: Int64
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!: Name
365
+ declare account: Name
366
366
  @Struct.field(Int64)
367
- amount!: Int64
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!: Name
372
+ declare account: Name
373
373
  @Struct.field(UInt64)
374
- id!: UInt64
374
+ declare id: UInt64
375
375
  }
376
376
  @Struct.type('wipe')
377
377
  export class wipe extends Struct {}
package/src/system.ts CHANGED
@@ -21,7 +21,8 @@ export function getSystemName(gameSeed: Checksum256, location: Coordinates): str
21
21
  const name: string[] = []
22
22
  for (let i = 0; i < syllableCount; i++) {
23
23
  const index = hash.array[i] % syllables.length
24
- name.push(syllables[index])
24
+ const syllable = syllables[index]
25
+ name.push(i > 0 ? syllable.toLowerCase() : syllable)
25
26
  }
26
27
 
27
28
  return name.join('')