@avaprotocol/sdk-js 1.2.1-dev.6 → 1.2.1-dev.7

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/dist/index.js CHANGED
@@ -70,6 +70,7 @@ var require_avs_pb = __commonJS({
70
70
  goog.exportSymbol("proto.aggregator.Execution.Step", null, global);
71
71
  goog.exportSymbol("proto.aggregator.FilterNode", null, global);
72
72
  goog.exportSymbol("proto.aggregator.FixedTimeCondition", null, global);
73
+ goog.exportSymbol("proto.aggregator.GetExecutionReq", null, global);
73
74
  goog.exportSymbol("proto.aggregator.GetKeyReq", null, global);
74
75
  goog.exportSymbol("proto.aggregator.GetWalletReq", null, global);
75
76
  goog.exportSymbol("proto.aggregator.GetWalletResp", null, global);
@@ -97,6 +98,7 @@ var require_avs_pb = __commonJS({
97
98
  goog.exportSymbol("proto.aggregator.TaskTrigger", null, global);
98
99
  goog.exportSymbol("proto.aggregator.TaskTrigger.TriggerTypeCase", null, global);
99
100
  goog.exportSymbol("proto.aggregator.TriggerMetadata", null, global);
101
+ goog.exportSymbol("proto.aggregator.TriggerMetadata.TriggerType", null, global);
100
102
  goog.exportSymbol("proto.aggregator.UserTriggerTaskReq", null, global);
101
103
  goog.exportSymbol("proto.aggregator.UserTriggerTaskResp", null, global);
102
104
  proto.aggregator.IdReq = function(opt_data) {
@@ -296,7 +298,7 @@ var require_avs_pb = __commonJS({
296
298
  proto.aggregator.ListWalletResp.displayName = "proto.aggregator.ListWalletResp";
297
299
  }
298
300
  proto.aggregator.ListTasksReq = function(opt_data) {
299
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
301
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.ListTasksReq.repeatedFields_, null);
300
302
  };
301
303
  goog.inherits(proto.aggregator.ListTasksReq, jspb.Message);
302
304
  if (goog.DEBUG && !COMPILED) {
@@ -317,7 +319,7 @@ var require_avs_pb = __commonJS({
317
319
  proto.aggregator.ListTasksResp.Item.displayName = "proto.aggregator.ListTasksResp.Item";
318
320
  }
319
321
  proto.aggregator.ListExecutionsReq = function(opt_data) {
320
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
322
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.ListExecutionsReq.repeatedFields_, null);
321
323
  };
322
324
  goog.inherits(proto.aggregator.ListExecutionsReq, jspb.Message);
323
325
  if (goog.DEBUG && !COMPILED) {
@@ -330,6 +332,13 @@ var require_avs_pb = __commonJS({
330
332
  if (goog.DEBUG && !COMPILED) {
331
333
  proto.aggregator.ListExecutionsResp.displayName = "proto.aggregator.ListExecutionsResp";
332
334
  }
335
+ proto.aggregator.GetExecutionReq = function(opt_data) {
336
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
337
+ };
338
+ goog.inherits(proto.aggregator.GetExecutionReq, jspb.Message);
339
+ if (goog.DEBUG && !COMPILED) {
340
+ proto.aggregator.GetExecutionReq.displayName = "proto.aggregator.GetExecutionReq";
341
+ }
333
342
  proto.aggregator.GetKeyReq = function(opt_data) {
334
343
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
335
344
  };
@@ -4226,13 +4235,14 @@ var require_avs_pb = __commonJS({
4226
4235
  proto.aggregator.ListWalletResp.prototype.clearItemsList = function() {
4227
4236
  return this.setItemsList([]);
4228
4237
  };
4238
+ proto.aggregator.ListTasksReq.repeatedFields_ = [1];
4229
4239
  if (jspb.Message.GENERATE_TO_OBJECT) {
4230
4240
  proto.aggregator.ListTasksReq.prototype.toObject = function(opt_includeInstance) {
4231
4241
  return proto.aggregator.ListTasksReq.toObject(opt_includeInstance, this);
4232
4242
  };
4233
4243
  proto.aggregator.ListTasksReq.toObject = function(includeInstance, msg) {
4234
4244
  var f, obj = {
4235
- smartWalletAddress: jspb.Message.getFieldWithDefault(msg, 1, ""),
4245
+ smartWalletAddressList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? void 0 : f,
4236
4246
  cursor: jspb.Message.getFieldWithDefault(msg, 2, ""),
4237
4247
  itemPerPage: jspb.Message.getFieldWithDefault(msg, 3, 0)
4238
4248
  };
@@ -4259,7 +4269,7 @@ var require_avs_pb = __commonJS({
4259
4269
  /** @type {string} */
4260
4270
  reader.readString()
4261
4271
  );
4262
- msg.setSmartWalletAddress(value);
4272
+ msg.addSmartWalletAddress(value);
4263
4273
  break;
4264
4274
  case 2:
4265
4275
  var value = (
@@ -4289,9 +4299,9 @@ var require_avs_pb = __commonJS({
4289
4299
  };
4290
4300
  proto.aggregator.ListTasksReq.serializeBinaryToWriter = function(message, writer) {
4291
4301
  var f = void 0;
4292
- f = message.getSmartWalletAddress();
4302
+ f = message.getSmartWalletAddressList();
4293
4303
  if (f.length > 0) {
4294
- writer.writeString(
4304
+ writer.writeRepeatedString(
4295
4305
  1,
4296
4306
  f
4297
4307
  );
@@ -4311,14 +4321,20 @@ var require_avs_pb = __commonJS({
4311
4321
  );
4312
4322
  }
4313
4323
  };
4314
- proto.aggregator.ListTasksReq.prototype.getSmartWalletAddress = function() {
4324
+ proto.aggregator.ListTasksReq.prototype.getSmartWalletAddressList = function() {
4315
4325
  return (
4316
- /** @type {string} */
4317
- jspb.Message.getFieldWithDefault(this, 1, "")
4326
+ /** @type {!Array<string>} */
4327
+ jspb.Message.getRepeatedField(this, 1)
4318
4328
  );
4319
4329
  };
4320
- proto.aggregator.ListTasksReq.prototype.setSmartWalletAddress = function(value) {
4321
- return jspb.Message.setProto3StringField(this, 1, value);
4330
+ proto.aggregator.ListTasksReq.prototype.setSmartWalletAddressList = function(value) {
4331
+ return jspb.Message.setField(this, 1, value || []);
4332
+ };
4333
+ proto.aggregator.ListTasksReq.prototype.addSmartWalletAddress = function(value, opt_index) {
4334
+ return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
4335
+ };
4336
+ proto.aggregator.ListTasksReq.prototype.clearSmartWalletAddressList = function() {
4337
+ return this.setSmartWalletAddressList([]);
4322
4338
  };
4323
4339
  proto.aggregator.ListTasksReq.prototype.getCursor = function() {
4324
4340
  return (
@@ -4350,7 +4366,8 @@ var require_avs_pb = __commonJS({
4350
4366
  proto.aggregator.ListTasksResp.Item.toObject,
4351
4367
  includeInstance
4352
4368
  ),
4353
- cursor: jspb.Message.getFieldWithDefault(msg, 2, "")
4369
+ cursor: jspb.Message.getFieldWithDefault(msg, 2, ""),
4370
+ hasMore: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
4354
4371
  };
4355
4372
  if (includeInstance) {
4356
4373
  obj.$jspbMessageInstance = msg;
@@ -4382,6 +4399,13 @@ var require_avs_pb = __commonJS({
4382
4399
  );
4383
4400
  msg.setCursor(value);
4384
4401
  break;
4402
+ case 3:
4403
+ var value = (
4404
+ /** @type {boolean} */
4405
+ reader.readBool()
4406
+ );
4407
+ msg.setHasMore(value);
4408
+ break;
4385
4409
  default:
4386
4410
  reader.skipField();
4387
4411
  break;
@@ -4411,6 +4435,13 @@ var require_avs_pb = __commonJS({
4411
4435
  f
4412
4436
  );
4413
4437
  }
4438
+ f = message.getHasMore();
4439
+ if (f) {
4440
+ writer.writeBool(
4441
+ 3,
4442
+ f
4443
+ );
4444
+ }
4414
4445
  };
4415
4446
  if (jspb.Message.GENERATE_TO_OBJECT) {
4416
4447
  proto.aggregator.ListTasksResp.Item.prototype.toObject = function(opt_includeInstance) {
@@ -4769,13 +4800,23 @@ var require_avs_pb = __commonJS({
4769
4800
  proto.aggregator.ListTasksResp.prototype.setCursor = function(value) {
4770
4801
  return jspb.Message.setProto3StringField(this, 2, value);
4771
4802
  };
4803
+ proto.aggregator.ListTasksResp.prototype.getHasMore = function() {
4804
+ return (
4805
+ /** @type {boolean} */
4806
+ jspb.Message.getBooleanFieldWithDefault(this, 3, false)
4807
+ );
4808
+ };
4809
+ proto.aggregator.ListTasksResp.prototype.setHasMore = function(value) {
4810
+ return jspb.Message.setProto3BooleanField(this, 3, value);
4811
+ };
4812
+ proto.aggregator.ListExecutionsReq.repeatedFields_ = [1];
4772
4813
  if (jspb.Message.GENERATE_TO_OBJECT) {
4773
4814
  proto.aggregator.ListExecutionsReq.prototype.toObject = function(opt_includeInstance) {
4774
4815
  return proto.aggregator.ListExecutionsReq.toObject(opt_includeInstance, this);
4775
4816
  };
4776
4817
  proto.aggregator.ListExecutionsReq.toObject = function(includeInstance, msg) {
4777
4818
  var f, obj = {
4778
- id: jspb.Message.getFieldWithDefault(msg, 1, ""),
4819
+ taskIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? void 0 : f,
4779
4820
  cursor: jspb.Message.getFieldWithDefault(msg, 2, ""),
4780
4821
  itemPerPage: jspb.Message.getFieldWithDefault(msg, 3, 0)
4781
4822
  };
@@ -4802,7 +4843,7 @@ var require_avs_pb = __commonJS({
4802
4843
  /** @type {string} */
4803
4844
  reader.readString()
4804
4845
  );
4805
- msg.setId(value);
4846
+ msg.addTaskIds(value);
4806
4847
  break;
4807
4848
  case 2:
4808
4849
  var value = (
@@ -4832,9 +4873,9 @@ var require_avs_pb = __commonJS({
4832
4873
  };
4833
4874
  proto.aggregator.ListExecutionsReq.serializeBinaryToWriter = function(message, writer) {
4834
4875
  var f = void 0;
4835
- f = message.getId();
4876
+ f = message.getTaskIdsList();
4836
4877
  if (f.length > 0) {
4837
- writer.writeString(
4878
+ writer.writeRepeatedString(
4838
4879
  1,
4839
4880
  f
4840
4881
  );
@@ -4854,14 +4895,20 @@ var require_avs_pb = __commonJS({
4854
4895
  );
4855
4896
  }
4856
4897
  };
4857
- proto.aggregator.ListExecutionsReq.prototype.getId = function() {
4898
+ proto.aggregator.ListExecutionsReq.prototype.getTaskIdsList = function() {
4858
4899
  return (
4859
- /** @type {string} */
4860
- jspb.Message.getFieldWithDefault(this, 1, "")
4900
+ /** @type {!Array<string>} */
4901
+ jspb.Message.getRepeatedField(this, 1)
4861
4902
  );
4862
4903
  };
4863
- proto.aggregator.ListExecutionsReq.prototype.setId = function(value) {
4864
- return jspb.Message.setProto3StringField(this, 1, value);
4904
+ proto.aggregator.ListExecutionsReq.prototype.setTaskIdsList = function(value) {
4905
+ return jspb.Message.setField(this, 1, value || []);
4906
+ };
4907
+ proto.aggregator.ListExecutionsReq.prototype.addTaskIds = function(value, opt_index) {
4908
+ return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
4909
+ };
4910
+ proto.aggregator.ListExecutionsReq.prototype.clearTaskIdsList = function() {
4911
+ return this.setTaskIdsList([]);
4865
4912
  };
4866
4913
  proto.aggregator.ListExecutionsReq.prototype.getCursor = function() {
4867
4914
  return (
@@ -4893,7 +4940,8 @@ var require_avs_pb = __commonJS({
4893
4940
  proto.aggregator.Execution.toObject,
4894
4941
  includeInstance
4895
4942
  ),
4896
- cursor: jspb.Message.getFieldWithDefault(msg, 2, "")
4943
+ cursor: jspb.Message.getFieldWithDefault(msg, 2, ""),
4944
+ hasMore: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
4897
4945
  };
4898
4946
  if (includeInstance) {
4899
4947
  obj.$jspbMessageInstance = msg;
@@ -4925,6 +4973,13 @@ var require_avs_pb = __commonJS({
4925
4973
  );
4926
4974
  msg.setCursor(value);
4927
4975
  break;
4976
+ case 4:
4977
+ var value = (
4978
+ /** @type {boolean} */
4979
+ reader.readBool()
4980
+ );
4981
+ msg.setHasMore(value);
4982
+ break;
4928
4983
  default:
4929
4984
  reader.skipField();
4930
4985
  break;
@@ -4954,6 +5009,13 @@ var require_avs_pb = __commonJS({
4954
5009
  f
4955
5010
  );
4956
5011
  }
5012
+ f = message.getHasMore();
5013
+ if (f) {
5014
+ writer.writeBool(
5015
+ 4,
5016
+ f
5017
+ );
5018
+ }
4957
5019
  };
4958
5020
  proto.aggregator.ListExecutionsResp.prototype.getItemsList = function() {
4959
5021
  return (
@@ -4979,6 +5041,103 @@ var require_avs_pb = __commonJS({
4979
5041
  proto.aggregator.ListExecutionsResp.prototype.setCursor = function(value) {
4980
5042
  return jspb.Message.setProto3StringField(this, 2, value);
4981
5043
  };
5044
+ proto.aggregator.ListExecutionsResp.prototype.getHasMore = function() {
5045
+ return (
5046
+ /** @type {boolean} */
5047
+ jspb.Message.getBooleanFieldWithDefault(this, 4, false)
5048
+ );
5049
+ };
5050
+ proto.aggregator.ListExecutionsResp.prototype.setHasMore = function(value) {
5051
+ return jspb.Message.setProto3BooleanField(this, 4, value);
5052
+ };
5053
+ if (jspb.Message.GENERATE_TO_OBJECT) {
5054
+ proto.aggregator.GetExecutionReq.prototype.toObject = function(opt_includeInstance) {
5055
+ return proto.aggregator.GetExecutionReq.toObject(opt_includeInstance, this);
5056
+ };
5057
+ proto.aggregator.GetExecutionReq.toObject = function(includeInstance, msg) {
5058
+ var f, obj = {
5059
+ taskId: jspb.Message.getFieldWithDefault(msg, 1, ""),
5060
+ executionId: jspb.Message.getFieldWithDefault(msg, 2, "")
5061
+ };
5062
+ if (includeInstance) {
5063
+ obj.$jspbMessageInstance = msg;
5064
+ }
5065
+ return obj;
5066
+ };
5067
+ }
5068
+ proto.aggregator.GetExecutionReq.deserializeBinary = function(bytes) {
5069
+ var reader = new jspb.BinaryReader(bytes);
5070
+ var msg = new proto.aggregator.GetExecutionReq();
5071
+ return proto.aggregator.GetExecutionReq.deserializeBinaryFromReader(msg, reader);
5072
+ };
5073
+ proto.aggregator.GetExecutionReq.deserializeBinaryFromReader = function(msg, reader) {
5074
+ while (reader.nextField()) {
5075
+ if (reader.isEndGroup()) {
5076
+ break;
5077
+ }
5078
+ var field = reader.getFieldNumber();
5079
+ switch (field) {
5080
+ case 1:
5081
+ var value = (
5082
+ /** @type {string} */
5083
+ reader.readString()
5084
+ );
5085
+ msg.setTaskId(value);
5086
+ break;
5087
+ case 2:
5088
+ var value = (
5089
+ /** @type {string} */
5090
+ reader.readString()
5091
+ );
5092
+ msg.setExecutionId(value);
5093
+ break;
5094
+ default:
5095
+ reader.skipField();
5096
+ break;
5097
+ }
5098
+ }
5099
+ return msg;
5100
+ };
5101
+ proto.aggregator.GetExecutionReq.prototype.serializeBinary = function() {
5102
+ var writer = new jspb.BinaryWriter();
5103
+ proto.aggregator.GetExecutionReq.serializeBinaryToWriter(this, writer);
5104
+ return writer.getResultBuffer();
5105
+ };
5106
+ proto.aggregator.GetExecutionReq.serializeBinaryToWriter = function(message, writer) {
5107
+ var f = void 0;
5108
+ f = message.getTaskId();
5109
+ if (f.length > 0) {
5110
+ writer.writeString(
5111
+ 1,
5112
+ f
5113
+ );
5114
+ }
5115
+ f = message.getExecutionId();
5116
+ if (f.length > 0) {
5117
+ writer.writeString(
5118
+ 2,
5119
+ f
5120
+ );
5121
+ }
5122
+ };
5123
+ proto.aggregator.GetExecutionReq.prototype.getTaskId = function() {
5124
+ return (
5125
+ /** @type {string} */
5126
+ jspb.Message.getFieldWithDefault(this, 1, "")
5127
+ );
5128
+ };
5129
+ proto.aggregator.GetExecutionReq.prototype.setTaskId = function(value) {
5130
+ return jspb.Message.setProto3StringField(this, 1, value);
5131
+ };
5132
+ proto.aggregator.GetExecutionReq.prototype.getExecutionId = function() {
5133
+ return (
5134
+ /** @type {string} */
5135
+ jspb.Message.getFieldWithDefault(this, 2, "")
5136
+ );
5137
+ };
5138
+ proto.aggregator.GetExecutionReq.prototype.setExecutionId = function(value) {
5139
+ return jspb.Message.setProto3StringField(this, 2, value);
5140
+ };
4982
5141
  if (jspb.Message.GENERATE_TO_OBJECT) {
4983
5142
  proto.aggregator.GetKeyReq.prototype.toObject = function(opt_includeInstance) {
4984
5143
  return proto.aggregator.GetKeyReq.toObject(opt_includeInstance, this);
@@ -5164,7 +5323,8 @@ var require_avs_pb = __commonJS({
5164
5323
  blockNumber: jspb.Message.getFieldWithDefault(msg, 1, 0),
5165
5324
  logIndex: jspb.Message.getFieldWithDefault(msg, 2, 0),
5166
5325
  txHash: jspb.Message.getFieldWithDefault(msg, 3, ""),
5167
- epoch: jspb.Message.getFieldWithDefault(msg, 4, 0)
5326
+ epoch: jspb.Message.getFieldWithDefault(msg, 4, 0),
5327
+ type: jspb.Message.getFieldWithDefault(msg, 5, 0)
5168
5328
  };
5169
5329
  if (includeInstance) {
5170
5330
  obj.$jspbMessageInstance = msg;
@@ -5212,6 +5372,13 @@ var require_avs_pb = __commonJS({
5212
5372
  );
5213
5373
  msg.setEpoch(value);
5214
5374
  break;
5375
+ case 5:
5376
+ var value = (
5377
+ /** @type {!proto.aggregator.TriggerMetadata.TriggerType} */
5378
+ reader.readEnum()
5379
+ );
5380
+ msg.setType(value);
5381
+ break;
5215
5382
  default:
5216
5383
  reader.skipField();
5217
5384
  break;
@@ -5254,6 +5421,21 @@ var require_avs_pb = __commonJS({
5254
5421
  f
5255
5422
  );
5256
5423
  }
5424
+ f = message.getType();
5425
+ if (f !== 0) {
5426
+ writer.writeEnum(
5427
+ 5,
5428
+ f
5429
+ );
5430
+ }
5431
+ };
5432
+ proto.aggregator.TriggerMetadata.TriggerType = {
5433
+ UNSET: 0,
5434
+ MANUAL: 2,
5435
+ FIXEDTIME: 3,
5436
+ CRON: 4,
5437
+ BLOCK: 5,
5438
+ EVENT: 6
5257
5439
  };
5258
5440
  proto.aggregator.TriggerMetadata.prototype.getBlockNumber = function() {
5259
5441
  return (
@@ -5291,6 +5473,15 @@ var require_avs_pb = __commonJS({
5291
5473
  proto.aggregator.TriggerMetadata.prototype.setEpoch = function(value) {
5292
5474
  return jspb.Message.setProto3IntField(this, 4, value);
5293
5475
  };
5476
+ proto.aggregator.TriggerMetadata.prototype.getType = function() {
5477
+ return (
5478
+ /** @type {!proto.aggregator.TriggerMetadata.TriggerType} */
5479
+ jspb.Message.getFieldWithDefault(this, 5, 0)
5480
+ );
5481
+ };
5482
+ proto.aggregator.TriggerMetadata.prototype.setType = function(value) {
5483
+ return jspb.Message.setProto3EnumField(this, 5, value);
5484
+ };
5294
5485
  if (jspb.Message.GENERATE_TO_OBJECT) {
5295
5486
  proto.aggregator.GetWalletReq.prototype.toObject = function(opt_includeInstance) {
5296
5487
  return proto.aggregator.GetWalletReq.toObject(opt_includeInstance, this);
@@ -5615,8 +5806,7 @@ var require_avs_pb = __commonJS({
5615
5806
  proto.aggregator.UserTriggerTaskResp.toObject = function(includeInstance, msg) {
5616
5807
  var f, obj = {
5617
5808
  result: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
5618
- executionId: jspb.Message.getFieldWithDefault(msg, 2, ""),
5619
- jobId: jspb.Message.getFieldWithDefault(msg, 3, "")
5809
+ executionId: jspb.Message.getFieldWithDefault(msg, 2, "")
5620
5810
  };
5621
5811
  if (includeInstance) {
5622
5812
  obj.$jspbMessageInstance = msg;
@@ -5650,13 +5840,6 @@ var require_avs_pb = __commonJS({
5650
5840
  );
5651
5841
  msg.setExecutionId(value);
5652
5842
  break;
5653
- case 3:
5654
- var value = (
5655
- /** @type {string} */
5656
- reader.readString()
5657
- );
5658
- msg.setJobId(value);
5659
- break;
5660
5843
  default:
5661
5844
  reader.skipField();
5662
5845
  break;
@@ -5685,13 +5868,6 @@ var require_avs_pb = __commonJS({
5685
5868
  f
5686
5869
  );
5687
5870
  }
5688
- f = message.getJobId();
5689
- if (f.length > 0) {
5690
- writer.writeString(
5691
- 3,
5692
- f
5693
- );
5694
- }
5695
5871
  };
5696
5872
  proto.aggregator.UserTriggerTaskResp.prototype.getResult = function() {
5697
5873
  return (
@@ -5711,15 +5887,6 @@ var require_avs_pb = __commonJS({
5711
5887
  proto.aggregator.UserTriggerTaskResp.prototype.setExecutionId = function(value) {
5712
5888
  return jspb.Message.setProto3StringField(this, 2, value);
5713
5889
  };
5714
- proto.aggregator.UserTriggerTaskResp.prototype.getJobId = function() {
5715
- return (
5716
- /** @type {string} */
5717
- jspb.Message.getFieldWithDefault(this, 3, "")
5718
- );
5719
- };
5720
- proto.aggregator.UserTriggerTaskResp.prototype.setJobId = function(value) {
5721
- return jspb.Message.setProto3StringField(this, 3, value);
5722
- };
5723
5890
  proto.aggregator.Error = {
5724
5891
  UNKNOWERROR: 0,
5725
5892
  RPCNODEERROR: 1e3,
@@ -5769,6 +5936,24 @@ var require_avs_grpc_pb = __commonJS({
5769
5936
  function deserialize_aggregator_CreateTaskResp(buffer_arg) {
5770
5937
  return avs_pb20.CreateTaskResp.deserializeBinary(new Uint8Array(buffer_arg));
5771
5938
  }
5939
+ function serialize_aggregator_Execution(arg) {
5940
+ if (!(arg instanceof avs_pb20.Execution)) {
5941
+ throw new Error("Expected argument of type aggregator.Execution");
5942
+ }
5943
+ return Buffer.from(arg.serializeBinary());
5944
+ }
5945
+ function deserialize_aggregator_Execution(buffer_arg) {
5946
+ return avs_pb20.Execution.deserializeBinary(new Uint8Array(buffer_arg));
5947
+ }
5948
+ function serialize_aggregator_GetExecutionReq(arg) {
5949
+ if (!(arg instanceof avs_pb20.GetExecutionReq)) {
5950
+ throw new Error("Expected argument of type aggregator.GetExecutionReq");
5951
+ }
5952
+ return Buffer.from(arg.serializeBinary());
5953
+ }
5954
+ function deserialize_aggregator_GetExecutionReq(buffer_arg) {
5955
+ return avs_pb20.GetExecutionReq.deserializeBinary(new Uint8Array(buffer_arg));
5956
+ }
5772
5957
  function serialize_aggregator_GetKeyReq(arg) {
5773
5958
  if (!(arg instanceof avs_pb20.GetKeyReq)) {
5774
5959
  throw new Error("Expected argument of type aggregator.GetKeyReq");
@@ -6014,6 +6199,17 @@ var require_avs_grpc_pb = __commonJS({
6014
6199
  responseSerialize: serialize_aggregator_ListExecutionsResp,
6015
6200
  responseDeserialize: deserialize_aggregator_ListExecutionsResp
6016
6201
  },
6202
+ getExecution: {
6203
+ path: "/aggregator.Aggregator/GetExecution",
6204
+ requestStream: false,
6205
+ responseStream: false,
6206
+ requestType: avs_pb20.GetExecutionReq,
6207
+ responseType: avs_pb20.Execution,
6208
+ requestSerialize: serialize_aggregator_GetExecutionReq,
6209
+ requestDeserialize: deserialize_aggregator_GetExecutionReq,
6210
+ responseSerialize: serialize_aggregator_Execution,
6211
+ responseDeserialize: deserialize_aggregator_Execution
6212
+ },
6017
6213
  cancelTask: {
6018
6214
  path: "/aggregator.Aggregator/CancelTask",
6019
6215
  requestStream: false,
@@ -6083,7 +6279,7 @@ __export(src_exports, {
6083
6279
  getKeyRequestMessage: () => getKeyRequestMessage
6084
6280
  });
6085
6281
  module.exports = __toCommonJS(src_exports);
6086
- var import_lodash5 = __toESM(require("lodash"));
6282
+ var import_lodash4 = __toESM(require("lodash"));
6087
6283
  var grpc = __toESM(require("@grpc/grpc-js"));
6088
6284
  var import_grpc_js = require("@grpc/grpc-js");
6089
6285
 
@@ -6718,10 +6914,8 @@ var avs_pb18 = __toESM(require_avs_pb());
6718
6914
 
6719
6915
  // src/models/trigger/metadata.ts
6720
6916
  var avs_pb16 = __toESM(require_avs_pb());
6721
- var import_lodash4 = __toESM(require("lodash"));
6722
6917
  var TriggerMetadata2 = class _TriggerMetadata {
6723
6918
  constructor(props) {
6724
- console.log("constructor.props", props);
6725
6919
  this.type = props.type;
6726
6920
  switch (props.type) {
6727
6921
  case TriggerTypes.FIXED_TIME:
@@ -6744,17 +6938,8 @@ var TriggerMetadata2 = class _TriggerMetadata {
6744
6938
  if (!data) {
6745
6939
  return void 0;
6746
6940
  }
6747
- console.log("fromResponse.data", data.toObject());
6748
- let type;
6749
- if (data.getEpoch() !== 0) {
6750
- type = TriggerTypes.FIXED_TIME;
6751
- } else if (data.getBlockNumber() !== 0) {
6752
- if (data.getLogIndex() !== 0 && !import_lodash4.default.isEmpty(data.getTxHash())) {
6753
- type = TriggerTypes.EVENT;
6754
- } else {
6755
- type = TriggerTypes.BLOCK;
6756
- }
6757
- } else {
6941
+ let type = data.getType();
6942
+ if (type != avs_pb16.TaskTrigger.TriggerTypeCase.FIXED_TIME && type != avs_pb16.TaskTrigger.TriggerTypeCase.CRON && type != avs_pb16.TaskTrigger.TriggerTypeCase.BLOCK && type != avs_pb16.TaskTrigger.TriggerTypeCase.EVENT) {
6758
6943
  throw new Error("Unable to determine trigger type from response");
6759
6944
  }
6760
6945
  return new _TriggerMetadata({
@@ -6979,7 +7164,7 @@ var BaseClient = class {
6979
7164
  * @returns {Promise<TResponse>} - The response from the gRPC call
6980
7165
  */
6981
7166
  sendGrpcRequest(method, request, options) {
6982
- const metadata = import_lodash5.default.cloneDeep(this.metadata);
7167
+ const metadata = import_lodash4.default.cloneDeep(this.metadata);
6983
7168
  if (options?.authKey) {
6984
7169
  metadata.set(AUTH_KEY_HEADER, options.authKey);
6985
7170
  } else if (this.authKey) {
@@ -7055,42 +7240,59 @@ var Client = class extends BaseClient {
7055
7240
  * @param {RequestOptions} options - Request options
7056
7241
  * @returns {Promise<{ cursor: string; result: Workflow[] }>} - The list of Workflow objects
7057
7242
  */
7058
- async getWorkflows(address, options) {
7243
+ async getWorkflows(addresses, options) {
7059
7244
  const request = new avs_pb19.ListTasksReq();
7060
- request.setSmartWalletAddress(address);
7245
+ for (const a of addresses) {
7246
+ request.addSmartWalletAddress(a);
7247
+ }
7061
7248
  if (options?.cursor) {
7062
7249
  request.setCursor(options.cursor);
7063
7250
  }
7064
7251
  request.setItemPerPage(options?.limit || DEFAULT_LIMIT);
7065
7252
  const result = await this.sendGrpcRequest("listTasks", request, options);
7066
- console.log("result", result.toObject());
7067
7253
  return {
7068
7254
  cursor: result.getCursor(),
7255
+ hasMore: result.getHasMore(),
7069
7256
  result: result.getItemsList().map((item) => workflow_default.fromListResponse(item))
7070
7257
  };
7071
7258
  }
7072
7259
  /**
7073
- * Get the list of executions for a workflow
7074
- * @param {string} workflowId - The Id of the workflow
7260
+ * Get the list of executions for multiple workflow given in the workflows argument.
7261
+ * @param {string[]} workflows - The list of workflow ids to fetch execution for
7075
7262
  * @param {GetExecutionsRequest} options - Request options
7076
7263
  * @param {string} [options.cursor] - The cursor for pagination
7077
7264
  * @param {number} [options.limit] - The page limit of the response; default is 10
7078
7265
  * @param {string} [options.authKey] - The auth key for the request
7079
7266
  * @returns {Promise<{ cursor: string; result: Execution[] }>} - The list of Executions
7080
7267
  */
7081
- async getExecutions(workflowId, options) {
7268
+ async getExecutions(workflows, options) {
7082
7269
  const request = new avs_pb19.ListExecutionsReq();
7083
- request.setId(workflowId);
7084
- if (options?.cursor) {
7270
+ request.setTaskIdsList(workflows);
7271
+ if (options?.cursor && options?.cursor != "") {
7085
7272
  request.setCursor(options.cursor);
7086
7273
  }
7087
7274
  request.setItemPerPage(options?.limit || DEFAULT_LIMIT);
7088
7275
  const result = await this.sendGrpcRequest("listExecutions", request, options);
7089
7276
  return {
7090
7277
  cursor: result.getCursor(),
7091
- result: result.getItemsList().map((item) => execution_default.fromResponse(item))
7278
+ result: result.getItemsList().map((item) => execution_default.fromResponse(item)),
7279
+ hasMore: result.getHasMore()
7092
7280
  };
7093
7281
  }
7282
+ /**
7283
+ * Get a single execution for given workflow and execution id
7284
+ * @param {string} workflowId - The workflow id
7285
+ * @param {string} executionId - The exectuion id
7286
+ * @param {GetExecutionsRequest} options - Request options
7287
+ * @returns {Promise<Execution>} - The result execution if it is existed
7288
+ */
7289
+ async getExecution(taskId, executionId, options) {
7290
+ const request = new avs_pb19.GetExecutionReq();
7291
+ request.setTaskId(taskId);
7292
+ request.setExecutionId(executionId);
7293
+ const result = await this.sendGrpcRequest("getExecution", request, options);
7294
+ return execution_default.fromResponse(result);
7295
+ }
7094
7296
  /**
7095
7297
  * Get a workflow by its Id
7096
7298
  * @param {string} id - The Id of the workflow