@shipload/sdk 0.0.0

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/README.md ADDED
@@ -0,0 +1 @@
1
+ # SDK
@@ -0,0 +1,332 @@
1
+ import { Checksum256Type, Blob, ABI, Struct, Name, UInt64, NameType, UInt64Type, Action, Int64, Checksum256, UInt16, UInt32, UInt8, BlockTimestamp, Int64Type, Checksum512 } from '@wharfkit/antelope';
2
+ import { Contract as Contract$2, PartialBy, ContractArgs, ActionOptions, Table } from '@wharfkit/contract';
3
+
4
+ declare function hash(seed: Checksum256Type, string: string): string;
5
+
6
+ declare const abiBlob$1: Blob;
7
+ declare const abi$1: ABI;
8
+ declare namespace Types$1 {
9
+ class cleartable extends Struct {
10
+ table_name: Name;
11
+ scope?: Name;
12
+ max_rows?: UInt64;
13
+ }
14
+ class company_row extends Struct {
15
+ account: Name;
16
+ name: string;
17
+ }
18
+ class enable extends Struct {
19
+ enabled: boolean;
20
+ }
21
+ class foundcompany extends Struct {
22
+ account: Name;
23
+ name: string;
24
+ }
25
+ class state_row extends Struct {
26
+ enabled: boolean;
27
+ }
28
+ class test extends Struct {
29
+ data: string;
30
+ }
31
+ class wipe extends Struct {
32
+ }
33
+ }
34
+ declare const TableMap$1: {
35
+ company: typeof Types$1.company_row;
36
+ state: typeof Types$1.state_row;
37
+ };
38
+ interface TableTypes$1 {
39
+ company: Types$1.company_row;
40
+ state: Types$1.state_row;
41
+ }
42
+ type RowType$1<T> = T extends keyof TableTypes$1 ? TableTypes$1[T] : any;
43
+ type TableNames$1 = keyof TableTypes$1;
44
+ declare namespace ActionParams$1 {
45
+ namespace Type { }
46
+ interface cleartable {
47
+ table_name: NameType;
48
+ scope?: NameType;
49
+ max_rows?: UInt64Type;
50
+ }
51
+ interface enable {
52
+ enabled: boolean;
53
+ }
54
+ interface foundcompany {
55
+ account: NameType;
56
+ name: string;
57
+ }
58
+ interface test {
59
+ data: string;
60
+ }
61
+ interface wipe {
62
+ }
63
+ }
64
+ interface ActionNameParams$1 {
65
+ cleartable: ActionParams$1.cleartable;
66
+ enable: ActionParams$1.enable;
67
+ foundcompany: ActionParams$1.foundcompany;
68
+ test: ActionParams$1.test;
69
+ wipe: ActionParams$1.wipe;
70
+ }
71
+ type ActionNames$1 = keyof ActionNameParams$1;
72
+ declare class Contract$1 extends Contract$2 {
73
+ constructor(args: PartialBy<ContractArgs, 'abi' | 'account'>);
74
+ action<T extends ActionNames$1>(name: T, data: ActionNameParams$1[T], options?: ActionOptions): Action;
75
+ table<T extends TableNames$1>(name: T, scope?: NameType): Table<RowType$1<T>>;
76
+ }
77
+
78
+ declare namespace platform {
79
+ export {
80
+ abiBlob$1 as abiBlob,
81
+ abi$1 as abi,
82
+ Types$1 as Types,
83
+ TableMap$1 as TableMap,
84
+ TableTypes$1 as TableTypes,
85
+ RowType$1 as RowType,
86
+ TableNames$1 as TableNames,
87
+ ActionParams$1 as ActionParams,
88
+ ActionNameParams$1 as ActionNameParams,
89
+ ActionNames$1 as ActionNames,
90
+ Contract$1 as Contract,
91
+ };
92
+ }
93
+
94
+ declare const abiBlob: Blob;
95
+ declare const abi: ABI;
96
+ declare namespace Types {
97
+ class advance extends Struct {
98
+ }
99
+ class arrive extends Struct {
100
+ owner: Name;
101
+ id: UInt64;
102
+ }
103
+ class cleartable extends Struct {
104
+ table_name: Name;
105
+ scope?: Name;
106
+ max_rows?: UInt64;
107
+ }
108
+ class coordinates extends Struct {
109
+ x: Int64;
110
+ y: Int64;
111
+ }
112
+ class enable extends Struct {
113
+ enabled: boolean;
114
+ }
115
+ class esttravel extends Struct {
116
+ id: UInt64;
117
+ destination: coordinates;
118
+ }
119
+ class hash extends Struct {
120
+ value: string;
121
+ }
122
+ class init extends Struct {
123
+ seed: Checksum256;
124
+ epochseed: Checksum256;
125
+ }
126
+ class join extends Struct {
127
+ account: Name;
128
+ }
129
+ class loader_stats extends Struct {
130
+ capacity: UInt16;
131
+ mass: UInt32;
132
+ quantity: UInt16;
133
+ thrust: UInt32;
134
+ }
135
+ class player_row extends Struct {
136
+ owner: Name;
137
+ balance: UInt64;
138
+ debt: UInt64;
139
+ }
140
+ class sequence_row extends Struct {
141
+ key: Name;
142
+ value: UInt64;
143
+ }
144
+ class ship_stats extends Struct {
145
+ capacity: UInt32;
146
+ drain: UInt32;
147
+ energy: UInt32;
148
+ mass: UInt64;
149
+ orbit: UInt16;
150
+ recharge: UInt32;
151
+ thrust: UInt64;
152
+ }
153
+ class ship_row extends Struct {
154
+ id: UInt64;
155
+ owner: Name;
156
+ name: string;
157
+ location: coordinates;
158
+ skin: UInt8;
159
+ tier: UInt8;
160
+ stats: ship_stats;
161
+ loaders: loader_stats;
162
+ }
163
+ class state_row extends Struct {
164
+ enabled: boolean;
165
+ epoch: UInt64;
166
+ epochseed: Checksum256;
167
+ genesis: BlockTimestamp;
168
+ seed: Checksum256;
169
+ }
170
+ class travel_summary extends Struct {
171
+ stats: ship_stats;
172
+ loaders: loader_stats;
173
+ origin: coordinates;
174
+ destination: coordinates;
175
+ distance: UInt64;
176
+ totalmass: UInt64;
177
+ acceleration: UInt64;
178
+ flighttime: UInt64;
179
+ energyusage: UInt64;
180
+ rechargetime: UInt64;
181
+ loadtime: UInt64;
182
+ time: UInt64;
183
+ }
184
+ class summary_row extends Struct {
185
+ key: Name;
186
+ value: travel_summary;
187
+ }
188
+ class test extends Struct {
189
+ data: string;
190
+ }
191
+ class travel extends Struct {
192
+ owner: Name;
193
+ id: UInt64;
194
+ destination: coordinates;
195
+ recharge: boolean;
196
+ }
197
+ class travelplan_row extends Struct {
198
+ id: UInt64;
199
+ departure: BlockTimestamp;
200
+ destination: coordinates;
201
+ duration: UInt32;
202
+ }
203
+ class wipe extends Struct {
204
+ }
205
+ }
206
+ declare const TableMap: {
207
+ player: typeof Types.player_row;
208
+ sequence: typeof Types.sequence_row;
209
+ ship: typeof Types.ship_row;
210
+ state: typeof Types.state_row;
211
+ summary: typeof Types.summary_row;
212
+ travelplan: typeof Types.travelplan_row;
213
+ };
214
+ interface TableTypes {
215
+ player: Types.player_row;
216
+ sequence: Types.sequence_row;
217
+ ship: Types.ship_row;
218
+ state: Types.state_row;
219
+ summary: Types.summary_row;
220
+ travelplan: Types.travelplan_row;
221
+ }
222
+ type RowType<T> = T extends keyof TableTypes ? TableTypes[T] : any;
223
+ type TableNames = keyof TableTypes;
224
+ declare namespace ActionParams {
225
+ namespace Type {
226
+ interface coordinates {
227
+ x: Int64Type;
228
+ y: Int64Type;
229
+ }
230
+ }
231
+ interface advance {
232
+ }
233
+ interface arrive {
234
+ owner: NameType;
235
+ id: UInt64Type;
236
+ }
237
+ interface cleartable {
238
+ table_name: NameType;
239
+ scope?: NameType;
240
+ max_rows?: UInt64Type;
241
+ }
242
+ interface enable {
243
+ enabled: boolean;
244
+ }
245
+ interface esttravel {
246
+ id: UInt64Type;
247
+ destination: Type.coordinates;
248
+ }
249
+ interface hash {
250
+ value: string;
251
+ }
252
+ interface init {
253
+ seed: Checksum256Type;
254
+ epochseed: Checksum256Type;
255
+ }
256
+ interface join {
257
+ account: NameType;
258
+ }
259
+ interface test {
260
+ data: string;
261
+ }
262
+ interface travel {
263
+ owner: NameType;
264
+ id: UInt64Type;
265
+ destination: Type.coordinates;
266
+ recharge: boolean;
267
+ }
268
+ interface wipe {
269
+ }
270
+ }
271
+ interface ActionNameParams {
272
+ advance: ActionParams.advance;
273
+ arrive: ActionParams.arrive;
274
+ cleartable: ActionParams.cleartable;
275
+ enable: ActionParams.enable;
276
+ esttravel: ActionParams.esttravel;
277
+ hash: ActionParams.hash;
278
+ init: ActionParams.init;
279
+ join: ActionParams.join;
280
+ test: ActionParams.test;
281
+ travel: ActionParams.travel;
282
+ wipe: ActionParams.wipe;
283
+ }
284
+ type ActionNames = keyof ActionNameParams;
285
+ interface ActionReturnValues {
286
+ esttravel: Types.travel_summary;
287
+ hash: Checksum512;
288
+ }
289
+ type ActionReturnNames = keyof ActionReturnValues;
290
+ declare class Contract extends Contract$2 {
291
+ constructor(args: PartialBy<ContractArgs, 'abi' | 'account'>);
292
+ action<T extends ActionNames>(name: T, data: ActionNameParams[T], options?: ActionOptions): Action;
293
+ readonly<T extends ActionReturnNames>(name: T, data?: ActionNameParams[T]): ActionReturnValues[T];
294
+ table<T extends TableNames>(name: T, scope?: NameType): Table<RowType<T>>;
295
+ }
296
+
297
+ declare const server_abiBlob: typeof abiBlob;
298
+ declare const server_abi: typeof abi;
299
+ declare const server_Types: typeof Types;
300
+ declare const server_TableMap: typeof TableMap;
301
+ type server_TableTypes = TableTypes;
302
+ type server_RowType<T> = RowType<T>;
303
+ type server_TableNames = TableNames;
304
+ declare const server_ActionParams: typeof ActionParams;
305
+ type server_ActionNameParams = ActionNameParams;
306
+ type server_ActionNames = ActionNames;
307
+ type server_ActionReturnValues = ActionReturnValues;
308
+ type server_ActionReturnNames = ActionReturnNames;
309
+ type server_Contract = Contract;
310
+ declare const server_Contract: typeof Contract;
311
+ declare namespace server {
312
+ export {
313
+ server_abiBlob as abiBlob,
314
+ server_abi as abi,
315
+ server_Types as Types,
316
+ server_TableMap as TableMap,
317
+ server_TableTypes as TableTypes,
318
+ server_RowType as RowType,
319
+ server_TableNames as TableNames,
320
+ server_ActionParams as ActionParams,
321
+ server_ActionNameParams as ActionNameParams,
322
+ server_ActionNames as ActionNames,
323
+ server_ActionReturnValues as ActionReturnValues,
324
+ server_ActionReturnNames as ActionReturnNames,
325
+ server_Contract as Contract,
326
+ };
327
+ }
328
+
329
+ declare class Shipload {
330
+ }
331
+
332
+ export { platform as PlatformContract, server as ServerContract, Shipload as default, hash };