@paintswap/estfor-definitions 0.1.23 → 0.1.25

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/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Action = exports.ActionChoice = exports.ShopItem = exports.UserItemNFT = exports.Item = exports.QueuedAction = exports.LastAttire = exports.ActivityInfo = exports.Activity = exports.ActivityType = exports.GlobalPlayerStats = exports.User = exports.Player = exports.XPThresholdReward = exports.PendingFlags = exports.PendingOutput = exports.noAttire = exports.defaultInputItem = exports.emptyNonCombatStats = exports.emptyCombatStats = exports.NonCombatStats = exports.CombatStats = exports.InputItem = exports.ActionInput = exports.ActionReward = exports.ActionInfo = exports.QueuedActionInput = exports.Equipment = exports.CombatStyle = exports.ActionQueueStatus = exports.Attire = exports.EquipPosition = exports.Skill = exports.BoostType = void 0;
3
+ exports.RandomWords = exports.Action = exports.ActionChoice = exports.ActionChoiceInput = exports.ShopItem = exports.UserItemNFT = exports.Item = exports.QueuedAction = exports.LastFullEquipment = exports.ActivityInfo = exports.Activity = exports.Direction = exports.ActivityType = exports.GlobalPlayerStats = exports.User = exports.Player = exports.XPThresholdReward = exports.XPThresholdRewardInput = exports.PendingFlags = exports.PendingOutput = exports.noAttire = exports.defaultInputItem = exports.emptyNonCombatStats = exports.emptyCombatStats = exports.NonCombatStats = exports.CombatStats = exports.InputItem = exports.ActionInput = exports.RandomReward = exports.GuaranteedReward = exports.ActionInfo = exports.QueuedActionInput = exports.Equipment = exports.CombatStyle = exports.ActionQueueStatus = exports.Attire = exports.EquipPosition = exports.Skill = exports.BoostType = void 0;
4
4
  var BoostType;
5
5
  (function (BoostType) {
6
6
  BoostType[BoostType["NONE"] = 0] = "NONE";
@@ -36,7 +36,7 @@ var EquipPosition;
36
36
  EquipPosition[EquipPosition["BODY"] = 3] = "BODY";
37
37
  EquipPosition[EquipPosition["ARMS"] = 4] = "ARMS";
38
38
  EquipPosition[EquipPosition["LEGS"] = 5] = "LEGS";
39
- EquipPosition[EquipPosition["BOOTS"] = 6] = "BOOTS";
39
+ EquipPosition[EquipPosition["FEET"] = 6] = "FEET";
40
40
  EquipPosition[EquipPosition["SPARE1"] = 7] = "SPARE1";
41
41
  EquipPosition[EquipPosition["SPARE2"] = 8] = "SPARE2";
42
42
  EquipPosition[EquipPosition["LEFT_HAND"] = 9] = "LEFT_HAND";
@@ -47,7 +47,6 @@ var EquipPosition;
47
47
  EquipPosition[EquipPosition["FOOD"] = 14] = "FOOD";
48
48
  EquipPosition[EquipPosition["AUX"] = 15] = "AUX";
49
49
  EquipPosition[EquipPosition["BOOST_VIAL"] = 16] = "BOOST_VIAL";
50
- EquipPosition[EquipPosition["NO_POSITION"] = 17] = "NO_POSITION";
51
50
  })(EquipPosition = exports.EquipPosition || (exports.EquipPosition = {}));
52
51
  class Attire {
53
52
  head = 0;
@@ -55,7 +54,7 @@ class Attire {
55
54
  body = 0;
56
55
  arms = 0;
57
56
  legs = 0;
58
- boots = 0;
57
+ feet = 0;
59
58
  ring = 0;
60
59
  reserved1 = 0;
61
60
  queueId = 0;
@@ -70,12 +69,8 @@ var ActionQueueStatus;
70
69
  var CombatStyle;
71
70
  (function (CombatStyle) {
72
71
  CombatStyle[CombatStyle["NONE"] = 0] = "NONE";
73
- CombatStyle[CombatStyle["MELEE"] = 1] = "MELEE";
74
- CombatStyle[CombatStyle["RANGE"] = 2] = "RANGE";
75
- CombatStyle[CombatStyle["MAGIC"] = 3] = "MAGIC";
76
- CombatStyle[CombatStyle["MELEE_DEFENCE"] = 4] = "MELEE_DEFENCE";
77
- CombatStyle[CombatStyle["RANGE_DEFENCE"] = 5] = "RANGE_DEFENCE";
78
- CombatStyle[CombatStyle["MAGIC_DEFENCE"] = 6] = "MAGIC_DEFENCE";
72
+ CombatStyle[CombatStyle["ATTACK"] = 1] = "ATTACK";
73
+ CombatStyle[CombatStyle["DEFENCE"] = 2] = "DEFENCE";
79
74
  })(CombatStyle = exports.CombatStyle || (exports.CombatStyle = {}));
80
75
  class Equipment {
81
76
  itemTokenId = 0;
@@ -93,8 +88,7 @@ class QueuedActionInput {
93
88
  timespan = 0; // How long to queue the action for
94
89
  rightHandEquipmentTokenId = 0;
95
90
  leftHandEquipmentTokenId = 0;
96
- startTime = '0'; // Filled in by the smart contract, can be "0"
97
- isValid = true; // If we still have the item, TODO: Not used yet
91
+ skill = Skill.NONE;
98
92
  }
99
93
  exports.QueuedActionInput = QueuedActionInput;
100
94
  class ActionInfo {
@@ -103,17 +97,24 @@ class ActionInfo {
103
97
  isDynamic = false;
104
98
  actionChoiceRequired = false;
105
99
  xpPerHour = 0;
106
- numSpawn = 0;
100
+ numSpawned = 0;
107
101
  minXP = 0;
108
102
  handItemTokenIdRangeMin = 0;
109
103
  handItemTokenIdRangeMax = 0;
104
+ successPercent = 0;
110
105
  }
111
106
  exports.ActionInfo = ActionInfo;
112
- class ActionReward {
107
+ class GuaranteedReward {
113
108
  itemTokenId = 0;
114
109
  rate = 0; // base 100, 2 decimal places
115
110
  }
116
- exports.ActionReward = ActionReward;
111
+ exports.GuaranteedReward = GuaranteedReward;
112
+ class RandomReward {
113
+ itemTokenId = 0;
114
+ chance = 0; // out of 65335
115
+ amount = 0;
116
+ }
117
+ exports.RandomReward = RandomReward;
117
118
  class ActionInput {
118
119
  actionId = 0;
119
120
  info = new ActionInfo();
@@ -177,10 +178,17 @@ class PendingFlags {
177
178
  includeXPRewards = true; // Passing any xp thresholds gives you extra rewards
178
179
  }
179
180
  exports.PendingFlags = PendingFlags;
180
- class XPThresholdReward {
181
+ class XPThresholdRewardInput {
181
182
  xpThreshold = 0;
182
183
  equipments = [];
183
184
  }
185
+ exports.XPThresholdRewardInput = XPThresholdRewardInput;
186
+ class XPThresholdReward {
187
+ id = ''; // XP for the reward
188
+ xp = ''; // same as id
189
+ rewardItemAmounts = [];
190
+ rewardItemTokenIds = [];
191
+ }
184
192
  exports.XPThresholdReward = XPThresholdReward;
185
193
  class Player {
186
194
  id = '0';
@@ -194,22 +202,23 @@ class Player {
194
202
  isActive = false; // Is this player the active one for the owner
195
203
  numActivities = 0; // Not used yet
196
204
  pendingRandomRewards = []; // Timestamps for any rewards which are waiting on the next seed
205
+ speedMultiplier = 1;
197
206
  /* Action XP */
198
- woodcuttingXP = 0;
199
- firemakingXP = 0;
200
- fishingXP = 0;
201
- cookingXP = 0;
202
- miningXP = 0;
203
- smithingXP = 0;
204
- craftingXP = 0;
205
- thievingXP = 0;
207
+ woodcuttingXP = '0';
208
+ firemakingXP = '0';
209
+ fishingXP = '0';
210
+ cookingXP = '0';
211
+ miningXP = '0';
212
+ smithingXP = '0';
213
+ craftingXP = '0';
214
+ thievingXP = '0';
206
215
  totalXP = '0';
207
216
  /* Combat XP */
208
- healthXP = 0;
209
- meleeXP = 0;
210
- defenceXP = 0;
211
- magicXP = 0;
212
- rangeXP = 0;
217
+ healthXP = '0';
218
+ meleeXP = '0';
219
+ defenceXP = '0';
220
+ magicXP = '0';
221
+ rangeXP = '0';
213
222
  /** Ranks */
214
223
  woodcuttingRank = 0;
215
224
  firemakingRank = 0;
@@ -246,23 +255,25 @@ class GlobalPlayerStats {
246
255
  exports.GlobalPlayerStats = GlobalPlayerStats;
247
256
  var ActivityType;
248
257
  (function (ActivityType) {
249
- ActivityType[ActivityType["LevelUp"] = 0] = "LevelUp";
250
- ActivityType[ActivityType["Buy"] = 1] = "Buy";
251
- ActivityType[ActivityType["Sell"] = 2] = "Sell";
252
- ActivityType[ActivityType["Died"] = 3] = "Died";
253
- ActivityType[ActivityType["Consumed"] = 4] = "Consumed";
254
- ActivityType[ActivityType["Rewards"] = 5] = "Rewards";
255
- ActivityType[ActivityType["ClaimedXPThresholdRewards"] = 6] = "ClaimedXPThresholdRewards";
256
- ActivityType[ActivityType["ActionPartiallyFinished"] = 7] = "ActionPartiallyFinished";
257
- ActivityType[ActivityType["ActionsQueued"] = 8] = "ActionsQueued";
258
- ActivityType[ActivityType["ActionFinished"] = 9] = "ActionFinished";
258
+ ActivityType[ActivityType["Buy"] = 0] = "Buy";
259
+ ActivityType[ActivityType["Sell"] = 1] = "Sell";
260
+ ActivityType[ActivityType["ActionPartiallyFinished"] = 2] = "ActionPartiallyFinished";
261
+ ActivityType[ActivityType["ActionFinished"] = 3] = "ActionFinished";
262
+ ActivityType[ActivityType["PendingRandomRewardsClaimed"] = 4] = "PendingRandomRewardsClaimed";
259
263
  })(ActivityType = exports.ActivityType || (exports.ActivityType = {}));
264
+ var Direction;
265
+ (function (Direction) {
266
+ Direction[Direction["Consumed"] = 0] = "Consumed";
267
+ Direction[Direction["Produced"] = 1] = "Produced";
268
+ })(Direction = exports.Direction || (exports.Direction = {}));
260
269
  class Activity {
261
270
  id = '';
262
271
  type = ''; // ActivityType
263
272
  itemTokenIds = [];
264
273
  amounts = [];
274
+ directions = []; // Direction
265
275
  prices = [];
276
+ actionId = '';
266
277
  queueId = '';
267
278
  timestamp = '';
268
279
  hash = '';
@@ -275,19 +286,31 @@ class ActivityInfo {
275
286
  numActivities = '';
276
287
  }
277
288
  exports.ActivityInfo = ActivityInfo;
278
- class LastAttire {
279
- id = ''; // playerId
280
- playerId = '';
289
+ class LastFullEquipment {
290
+ id = '0'; // playerId
291
+ playerId = '0';
281
292
  user = '';
293
+ actionId = 0;
294
+ regenerateId = 0;
295
+ choiceId = 0;
296
+ choiceId1 = 0;
297
+ choiceId2 = 0;
298
+ rightHandEquipmentTokenId = 0;
299
+ leftHandEquipmentTokenId = 0;
300
+ startTime = '';
301
+ timespan = 0;
302
+ isValid = true;
303
+ skill = Skill.NONE;
282
304
  headEquipped = 0;
283
305
  neckEquipped = 0;
284
306
  bodyEquipped = 0;
285
307
  armsEquipped = 0;
286
308
  legsEquipped = 0;
287
- bootsEquipped = 0;
309
+ feetEquipped = 0;
288
310
  ringEquipped = 0;
311
+ timestamp = '0';
289
312
  }
290
- exports.LastAttire = LastAttire;
313
+ exports.LastFullEquipment = LastFullEquipment;
291
314
  class QueuedAction {
292
315
  id = ''; // queueId
293
316
  actionId = 0;
@@ -301,12 +324,13 @@ class QueuedAction {
301
324
  startTime = '';
302
325
  timespan = 0;
303
326
  isValid = true;
327
+ skill = Skill.NONE;
304
328
  headEquipped = 0;
305
329
  neckEquipped = 0;
306
330
  bodyEquipped = 0;
307
331
  armsEquipped = 0;
308
332
  legsEquipped = 0;
309
- bootsEquipped = 0;
333
+ feetEquipped = 0;
310
334
  ringEquipped = 0;
311
335
  }
312
336
  exports.QueuedAction = QueuedAction;
@@ -347,6 +371,23 @@ class ShopItem {
347
371
  price = '0';
348
372
  }
349
373
  exports.ShopItem = ShopItem;
374
+ class ActionChoiceInput {
375
+ skill = Skill.NONE;
376
+ diff = 0;
377
+ rate = 0;
378
+ xpPerHour = 0;
379
+ minXP = 0;
380
+ inputTokenId1 = 0;
381
+ num1 = 0;
382
+ inputTokenId2 = 0;
383
+ num2 = 0;
384
+ inputTokenId3 = 0;
385
+ num3 = 0;
386
+ outputTokenId = 0;
387
+ outputNum = 1;
388
+ successPercent = 100;
389
+ }
390
+ exports.ActionChoiceInput = ActionChoiceInput;
350
391
  class ActionChoice {
351
392
  id = '';
352
393
  actionId = 0;
@@ -362,6 +403,8 @@ class ActionChoice {
362
403
  inputTokenId3 = 0;
363
404
  num3 = 0;
364
405
  outputTokenId = 0;
406
+ outputNum = 1;
407
+ successPercent = 100;
365
408
  }
366
409
  exports.ActionChoice = ActionChoice;
367
410
  class Action {
@@ -369,7 +412,7 @@ class Action {
369
412
  actionId = 0;
370
413
  skill = Skill.NONE;
371
414
  xpPerHour = 0;
372
- numSpawn = 0;
415
+ numSpawned = 0;
373
416
  minXP = '0';
374
417
  guaranteedRewardItemTokenIds = [];
375
418
  guaranteedRewardRates = [];
@@ -379,6 +422,8 @@ class Action {
379
422
  handItemTokenIdRangeMax = 0;
380
423
  isAvailable = false;
381
424
  isDynamic = false;
425
+ actionChoiceRequired = false;
426
+ successPercent = 100;
382
427
  /* Combat Stats */
383
428
  melee = 0;
384
429
  magic = 0;
@@ -389,3 +434,8 @@ class Action {
389
434
  health = 0;
390
435
  }
391
436
  exports.Action = Action;
437
+ class RandomWords {
438
+ lastRandomWordRequestedTimestamp;
439
+ lastRandomWordsReceived = ''; // Bytes
440
+ }
441
+ exports.RandomWords = RandomWords;