@avaprotocol/sdk-js 0.6.11 → 0.6.12

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.mjs CHANGED
@@ -28,15 +28,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
28
28
  // grpc_codegen/avs_pb.js
29
29
  var avs_pb_exports = {};
30
30
  __export(avs_pb_exports, {
31
+ ActionType: () => ActionType,
32
+ AddressRequest: () => AddressRequest,
33
+ AddressResp: () => AddressResp,
34
+ ContractExecution: () => ContractExecution,
31
35
  CreateTaskReq: () => CreateTaskReq,
32
36
  CreateTaskResp: () => CreateTaskResp,
37
+ ExpressionCondition: () => ExpressionCondition,
33
38
  GetKeyReq: () => GetKeyReq,
34
39
  KeyResp: () => KeyResp,
40
+ ListTasksReq: () => ListTasksReq,
41
+ ListTasksResp: () => ListTasksResp,
35
42
  Task: () => Task,
43
+ TaskAction: () => TaskAction,
44
+ TaskTrigger: () => TaskTrigger,
45
+ TaskType: () => TaskType,
46
+ TriggerType: () => TriggerType,
47
+ UUID: () => UUID,
36
48
  UpdateChecksReq: () => UpdateChecksReq,
37
49
  UpdateChecksResp: () => UpdateChecksResp
38
50
  });
39
- var jspb, goog, global, google_protobuf_timestamp_pb, google_protobuf_wrappers_pb, Task, CreateTaskReq, CreateTaskResp, GetKeyReq, KeyResp, UpdateChecksReq, UpdateChecksResp;
51
+ var jspb, goog, global, google_protobuf_timestamp_pb, google_protobuf_wrappers_pb, Task, CreateTaskReq, CreateTaskResp, GetKeyReq, KeyResp, UpdateChecksReq, UpdateChecksResp, AddressResp, AddressRequest, ListTasksReq, ListTasksResp, TaskTrigger, TriggerType, ExpressionCondition, TaskAction, ActionType, ContractExecution, TaskType, UUID;
40
52
  var init_avs_pb = __esm({
41
53
  "grpc_codegen/avs_pb.js"() {
42
54
  "use strict";
@@ -141,7 +153,14 @@ var init_avs_pb = __esm({
141
153
  proto.aggregator.TaskTrigger.displayName = "proto.aggregator.TaskTrigger";
142
154
  }
143
155
  proto.aggregator.TimeCondition = function(opt_data) {
144
- jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.TimeCondition.repeatedFields_, null);
156
+ jspb.Message.initialize(
157
+ this,
158
+ opt_data,
159
+ 0,
160
+ -1,
161
+ proto.aggregator.TimeCondition.repeatedFields_,
162
+ null
163
+ );
145
164
  };
146
165
  goog.inherits(proto.aggregator.TimeCondition, jspb.Message);
147
166
  if (goog.DEBUG && !COMPILED) {
@@ -211,14 +230,28 @@ var init_avs_pb = __esm({
211
230
  proto.aggregator.ConditionJump.displayName = "proto.aggregator.ConditionJump";
212
231
  }
213
232
  proto.aggregator.BranchAction = function(opt_data) {
214
- jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.BranchAction.repeatedFields_, null);
233
+ jspb.Message.initialize(
234
+ this,
235
+ opt_data,
236
+ 0,
237
+ -1,
238
+ proto.aggregator.BranchAction.repeatedFields_,
239
+ null
240
+ );
215
241
  };
216
242
  goog.inherits(proto.aggregator.BranchAction, jspb.Message);
217
243
  if (goog.DEBUG && !COMPILED) {
218
244
  proto.aggregator.BranchAction.displayName = "proto.aggregator.BranchAction";
219
245
  }
220
246
  proto.aggregator.TaskAction = function(opt_data) {
221
- jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.TaskAction.repeatedFields_, null);
247
+ jspb.Message.initialize(
248
+ this,
249
+ opt_data,
250
+ 0,
251
+ -1,
252
+ proto.aggregator.TaskAction.repeatedFields_,
253
+ null
254
+ );
222
255
  };
223
256
  goog.inherits(proto.aggregator.TaskAction, jspb.Message);
224
257
  if (goog.DEBUG && !COMPILED) {
@@ -232,14 +265,28 @@ var init_avs_pb = __esm({
232
265
  proto.aggregator.Execution.displayName = "proto.aggregator.Execution";
233
266
  }
234
267
  proto.aggregator.Task = function(opt_data) {
235
- jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.Task.repeatedFields_, null);
268
+ jspb.Message.initialize(
269
+ this,
270
+ opt_data,
271
+ 0,
272
+ -1,
273
+ proto.aggregator.Task.repeatedFields_,
274
+ null
275
+ );
236
276
  };
237
277
  goog.inherits(proto.aggregator.Task, jspb.Message);
238
278
  if (goog.DEBUG && !COMPILED) {
239
279
  proto.aggregator.Task.displayName = "proto.aggregator.Task";
240
280
  }
241
281
  proto.aggregator.CreateTaskReq = function(opt_data) {
242
- jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.CreateTaskReq.repeatedFields_, null);
282
+ jspb.Message.initialize(
283
+ this,
284
+ opt_data,
285
+ 0,
286
+ -1,
287
+ proto.aggregator.CreateTaskReq.repeatedFields_,
288
+ null
289
+ );
243
290
  };
244
291
  goog.inherits(proto.aggregator.CreateTaskReq, jspb.Message);
245
292
  if (goog.DEBUG && !COMPILED) {
@@ -288,7 +335,14 @@ var init_avs_pb = __esm({
288
335
  proto.aggregator.ListTasksReq.displayName = "proto.aggregator.ListTasksReq";
289
336
  }
290
337
  proto.aggregator.ListTasksResp = function(opt_data) {
291
- jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.ListTasksResp.repeatedFields_, null);
338
+ jspb.Message.initialize(
339
+ this,
340
+ opt_data,
341
+ 0,
342
+ -1,
343
+ proto.aggregator.ListTasksResp.repeatedFields_,
344
+ null
345
+ );
292
346
  };
293
347
  goog.inherits(proto.aggregator.ListTasksResp, jspb.Message);
294
348
  if (goog.DEBUG && !COMPILED) {
@@ -316,7 +370,14 @@ var init_avs_pb = __esm({
316
370
  proto.aggregator.KeyResp.displayName = "proto.aggregator.KeyResp";
317
371
  }
318
372
  proto.aggregator.UpdateChecksReq = function(opt_data) {
319
- jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.UpdateChecksReq.repeatedFields_, null);
373
+ jspb.Message.initialize(
374
+ this,
375
+ opt_data,
376
+ 0,
377
+ -1,
378
+ proto.aggregator.UpdateChecksReq.repeatedFields_,
379
+ null
380
+ );
320
381
  };
321
382
  goog.inherits(proto.aggregator.UpdateChecksReq, jspb.Message);
322
383
  if (goog.DEBUG && !COMPILED) {
@@ -378,10 +439,7 @@ var init_avs_pb = __esm({
378
439
  var f = void 0;
379
440
  f = message.getBytes();
380
441
  if (f.length > 0) {
381
- writer.writeString(
382
- 1,
383
- f
384
- );
442
+ writer.writeString(1, f);
385
443
  }
386
444
  };
387
445
  proto.aggregator.UUID.prototype.getBytes = function() {
@@ -448,7 +506,10 @@ var init_avs_pb = __esm({
448
506
  break;
449
507
  case 4:
450
508
  var value = new proto.aggregator.Checkin.Status();
451
- reader.readMessage(value, proto.aggregator.Checkin.Status.deserializeBinaryFromReader);
509
+ reader.readMessage(
510
+ value,
511
+ proto.aggregator.Checkin.Status.deserializeBinaryFromReader
512
+ );
452
513
  msg.setStatus(value);
453
514
  break;
454
515
  case 5:
@@ -488,24 +549,15 @@ var init_avs_pb = __esm({
488
549
  var f = void 0;
489
550
  f = message.getId();
490
551
  if (f.length > 0) {
491
- writer.writeString(
492
- 1,
493
- f
494
- );
552
+ writer.writeString(1, f);
495
553
  }
496
554
  f = message.getAddress();
497
555
  if (f.length > 0) {
498
- writer.writeString(
499
- 2,
500
- f
501
- );
556
+ writer.writeString(2, f);
502
557
  }
503
558
  f = message.getSignature();
504
559
  if (f.length > 0) {
505
- writer.writeString(
506
- 3,
507
- f
508
- );
560
+ writer.writeString(3, f);
509
561
  }
510
562
  f = message.getStatus();
511
563
  if (f != null) {
@@ -517,24 +569,15 @@ var init_avs_pb = __esm({
517
569
  }
518
570
  f = message.getVersion();
519
571
  if (f.length > 0) {
520
- writer.writeString(
521
- 5,
522
- f
523
- );
572
+ writer.writeString(5, f);
524
573
  }
525
574
  f = message.getMetricsport();
526
575
  if (f !== 0) {
527
- writer.writeInt32(
528
- 6,
529
- f
530
- );
576
+ writer.writeInt32(6, f);
531
577
  }
532
578
  f = message.getRemoteip();
533
579
  if (f.length > 0) {
534
- writer.writeString(
535
- 7,
536
- f
537
- );
580
+ writer.writeString(7, f);
538
581
  }
539
582
  };
540
583
  if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -556,7 +599,10 @@ var init_avs_pb = __esm({
556
599
  proto.aggregator.Checkin.Status.deserializeBinary = function(bytes) {
557
600
  var reader = new jspb.BinaryReader(bytes);
558
601
  var msg = new proto.aggregator.Checkin.Status();
559
- return proto.aggregator.Checkin.Status.deserializeBinaryFromReader(msg, reader);
602
+ return proto.aggregator.Checkin.Status.deserializeBinaryFromReader(
603
+ msg,
604
+ reader
605
+ );
560
606
  };
561
607
  proto.aggregator.Checkin.Status.deserializeBinaryFromReader = function(msg, reader) {
562
608
  while (reader.nextField()) {
@@ -581,7 +627,10 @@ var init_avs_pb = __esm({
581
627
  break;
582
628
  case 3:
583
629
  var value = new google_protobuf_timestamp_pb.Timestamp();
584
- reader.readMessage(value, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
630
+ reader.readMessage(
631
+ value,
632
+ google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader
633
+ );
585
634
  msg.setLastHeartbeat(value);
586
635
  break;
587
636
  default:
@@ -600,17 +649,11 @@ var init_avs_pb = __esm({
600
649
  var f = void 0;
601
650
  f = message.getUptime();
602
651
  if (f !== 0) {
603
- writer.writeInt64(
604
- 1,
605
- f
606
- );
652
+ writer.writeInt64(1, f);
607
653
  }
608
654
  f = message.getQueuedepth();
609
655
  if (f !== 0) {
610
- writer.writeInt64(
611
- 2,
612
- f
613
- );
656
+ writer.writeInt64(2, f);
614
657
  }
615
658
  f = message.getLastHeartbeat();
616
659
  if (f != null) {
@@ -642,7 +685,11 @@ var init_avs_pb = __esm({
642
685
  proto.aggregator.Checkin.Status.prototype.getLastHeartbeat = function() {
643
686
  return (
644
687
  /** @type{?proto.google.protobuf.Timestamp} */
645
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)
688
+ jspb.Message.getWrapperField(
689
+ this,
690
+ google_protobuf_timestamp_pb.Timestamp,
691
+ 3
692
+ )
646
693
  );
647
694
  };
648
695
  proto.aggregator.Checkin.Status.prototype.setLastHeartbeat = function(value) {
@@ -751,7 +798,10 @@ var init_avs_pb = __esm({
751
798
  switch (field) {
752
799
  case 1:
753
800
  var value = new google_protobuf_timestamp_pb.Timestamp();
754
- reader.readMessage(value, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
801
+ reader.readMessage(
802
+ value,
803
+ google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader
804
+ );
755
805
  msg.setUpdatedAt(value);
756
806
  break;
757
807
  default:
@@ -780,7 +830,11 @@ var init_avs_pb = __esm({
780
830
  proto.aggregator.CheckinResp.prototype.getUpdatedAt = function() {
781
831
  return (
782
832
  /** @type{?proto.google.protobuf.Timestamp} */
783
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1)
833
+ jspb.Message.getWrapperField(
834
+ this,
835
+ google_protobuf_timestamp_pb.Timestamp,
836
+ 1
837
+ )
784
838
  );
785
839
  };
786
840
  proto.aggregator.CheckinResp.prototype.setUpdatedAt = function(value) {
@@ -865,31 +919,19 @@ var init_avs_pb = __esm({
865
919
  var f = void 0;
866
920
  f = message.getId();
867
921
  if (f.length > 0) {
868
- writer.writeString(
869
- 1,
870
- f
871
- );
922
+ writer.writeString(1, f);
872
923
  }
873
924
  f = message.getAddress();
874
925
  if (f.length > 0) {
875
- writer.writeString(
876
- 2,
877
- f
878
- );
926
+ writer.writeString(2, f);
879
927
  }
880
928
  f = message.getSignature();
881
929
  if (f.length > 0) {
882
- writer.writeString(
883
- 3,
884
- f
885
- );
930
+ writer.writeString(3, f);
886
931
  }
887
932
  f = message.getMonotonicClock();
888
933
  if (f !== 0) {
889
- writer.writeInt64(
890
- 4,
891
- f
892
- );
934
+ writer.writeInt64(4, f);
893
935
  }
894
936
  };
895
937
  proto.aggregator.SyncTasksReq.prototype.getId = function() {
@@ -966,17 +1008,26 @@ var init_avs_pb = __esm({
966
1008
  break;
967
1009
  case 2:
968
1010
  var value = new proto.aggregator.TimeCondition();
969
- reader.readMessage(value, proto.aggregator.TimeCondition.deserializeBinaryFromReader);
1011
+ reader.readMessage(
1012
+ value,
1013
+ proto.aggregator.TimeCondition.deserializeBinaryFromReader
1014
+ );
970
1015
  msg.setSchedule(value);
971
1016
  break;
972
1017
  case 3:
973
1018
  var value = new proto.aggregator.ContractQueryCondition();
974
- reader.readMessage(value, proto.aggregator.ContractQueryCondition.deserializeBinaryFromReader);
1019
+ reader.readMessage(
1020
+ value,
1021
+ proto.aggregator.ContractQueryCondition.deserializeBinaryFromReader
1022
+ );
975
1023
  msg.setContractQuery(value);
976
1024
  break;
977
1025
  case 4:
978
1026
  var value = new proto.aggregator.ExpressionCondition();
979
- reader.readMessage(value, proto.aggregator.ExpressionCondition.deserializeBinaryFromReader);
1027
+ reader.readMessage(
1028
+ value,
1029
+ proto.aggregator.ExpressionCondition.deserializeBinaryFromReader
1030
+ );
980
1031
  msg.setExpression(value);
981
1032
  break;
982
1033
  default:
@@ -995,10 +1046,7 @@ var init_avs_pb = __esm({
995
1046
  var f = void 0;
996
1047
  f = message.getTriggerType();
997
1048
  if (f !== 0) {
998
- writer.writeEnum(
999
- 1,
1000
- f
1001
- );
1049
+ writer.writeEnum(1, f);
1002
1050
  }
1003
1051
  f = message.getSchedule();
1004
1052
  if (f != null) {
@@ -1052,7 +1100,11 @@ var init_avs_pb = __esm({
1052
1100
  proto.aggregator.TaskTrigger.prototype.getContractQuery = function() {
1053
1101
  return (
1054
1102
  /** @type{?proto.aggregator.ContractQueryCondition} */
1055
- jspb.Message.getWrapperField(this, proto.aggregator.ContractQueryCondition, 3)
1103
+ jspb.Message.getWrapperField(
1104
+ this,
1105
+ proto.aggregator.ContractQueryCondition,
1106
+ 3
1107
+ )
1056
1108
  );
1057
1109
  };
1058
1110
  proto.aggregator.TaskTrigger.prototype.setContractQuery = function(value) {
@@ -1098,7 +1150,10 @@ var init_avs_pb = __esm({
1098
1150
  proto.aggregator.TimeCondition.deserializeBinary = function(bytes) {
1099
1151
  var reader = new jspb.BinaryReader(bytes);
1100
1152
  var msg = new proto.aggregator.TimeCondition();
1101
- return proto.aggregator.TimeCondition.deserializeBinaryFromReader(msg, reader);
1153
+ return proto.aggregator.TimeCondition.deserializeBinaryFromReader(
1154
+ msg,
1155
+ reader
1156
+ );
1102
1157
  };
1103
1158
  proto.aggregator.TimeCondition.deserializeBinaryFromReader = function(msg, reader) {
1104
1159
  while (reader.nextField()) {
@@ -1139,17 +1194,11 @@ var init_avs_pb = __esm({
1139
1194
  var f = void 0;
1140
1195
  f = message.getFixedList();
1141
1196
  if (f.length > 0) {
1142
- writer.writePackedInt64(
1143
- 1,
1144
- f
1145
- );
1197
+ writer.writePackedInt64(1, f);
1146
1198
  }
1147
1199
  f = message.getCron();
1148
1200
  if (f.length > 0) {
1149
- writer.writeString(
1150
- 2,
1151
- f
1152
- );
1201
+ writer.writeString(2, f);
1153
1202
  }
1154
1203
  };
1155
1204
  proto.aggregator.TimeCondition.prototype.getFixedList = function() {
@@ -1178,7 +1227,10 @@ var init_avs_pb = __esm({
1178
1227
  };
1179
1228
  if (jspb.Message.GENERATE_TO_OBJECT) {
1180
1229
  proto.aggregator.ContractQueryCondition.prototype.toObject = function(opt_includeInstance) {
1181
- return proto.aggregator.ContractQueryCondition.toObject(opt_includeInstance, this);
1230
+ return proto.aggregator.ContractQueryCondition.toObject(
1231
+ opt_includeInstance,
1232
+ this
1233
+ );
1182
1234
  };
1183
1235
  proto.aggregator.ContractQueryCondition.toObject = function(includeInstance, msg) {
1184
1236
  var f, obj = {
@@ -1194,7 +1246,10 @@ var init_avs_pb = __esm({
1194
1246
  proto.aggregator.ContractQueryCondition.deserializeBinary = function(bytes) {
1195
1247
  var reader = new jspb.BinaryReader(bytes);
1196
1248
  var msg = new proto.aggregator.ContractQueryCondition();
1197
- return proto.aggregator.ContractQueryCondition.deserializeBinaryFromReader(msg, reader);
1249
+ return proto.aggregator.ContractQueryCondition.deserializeBinaryFromReader(
1250
+ msg,
1251
+ reader
1252
+ );
1198
1253
  };
1199
1254
  proto.aggregator.ContractQueryCondition.deserializeBinaryFromReader = function(msg, reader) {
1200
1255
  while (reader.nextField()) {
@@ -1226,24 +1281,21 @@ var init_avs_pb = __esm({
1226
1281
  };
1227
1282
  proto.aggregator.ContractQueryCondition.prototype.serializeBinary = function() {
1228
1283
  var writer = new jspb.BinaryWriter();
1229
- proto.aggregator.ContractQueryCondition.serializeBinaryToWriter(this, writer);
1284
+ proto.aggregator.ContractQueryCondition.serializeBinaryToWriter(
1285
+ this,
1286
+ writer
1287
+ );
1230
1288
  return writer.getResultBuffer();
1231
1289
  };
1232
1290
  proto.aggregator.ContractQueryCondition.serializeBinaryToWriter = function(message, writer) {
1233
1291
  var f = void 0;
1234
1292
  f = message.getContractAddress();
1235
1293
  if (f.length > 0) {
1236
- writer.writeString(
1237
- 1,
1238
- f
1239
- );
1294
+ writer.writeString(1, f);
1240
1295
  }
1241
1296
  f = message.getCallmsg();
1242
1297
  if (f.length > 0) {
1243
- writer.writeString(
1244
- 2,
1245
- f
1246
- );
1298
+ writer.writeString(2, f);
1247
1299
  }
1248
1300
  };
1249
1301
  proto.aggregator.ContractQueryCondition.prototype.getContractAddress = function() {
@@ -1266,7 +1318,10 @@ var init_avs_pb = __esm({
1266
1318
  };
1267
1319
  if (jspb.Message.GENERATE_TO_OBJECT) {
1268
1320
  proto.aggregator.ExpressionCondition.prototype.toObject = function(opt_includeInstance) {
1269
- return proto.aggregator.ExpressionCondition.toObject(opt_includeInstance, this);
1321
+ return proto.aggregator.ExpressionCondition.toObject(
1322
+ opt_includeInstance,
1323
+ this
1324
+ );
1270
1325
  };
1271
1326
  proto.aggregator.ExpressionCondition.toObject = function(includeInstance, msg) {
1272
1327
  var f, obj = {
@@ -1281,7 +1336,10 @@ var init_avs_pb = __esm({
1281
1336
  proto.aggregator.ExpressionCondition.deserializeBinary = function(bytes) {
1282
1337
  var reader = new jspb.BinaryReader(bytes);
1283
1338
  var msg = new proto.aggregator.ExpressionCondition();
1284
- return proto.aggregator.ExpressionCondition.deserializeBinaryFromReader(msg, reader);
1339
+ return proto.aggregator.ExpressionCondition.deserializeBinaryFromReader(
1340
+ msg,
1341
+ reader
1342
+ );
1285
1343
  };
1286
1344
  proto.aggregator.ExpressionCondition.deserializeBinaryFromReader = function(msg, reader) {
1287
1345
  while (reader.nextField()) {
@@ -1313,10 +1371,7 @@ var init_avs_pb = __esm({
1313
1371
  var f = void 0;
1314
1372
  f = message.getExpression();
1315
1373
  if (f.length > 0) {
1316
- writer.writeString(
1317
- 1,
1318
- f
1319
- );
1374
+ writer.writeString(1, f);
1320
1375
  }
1321
1376
  };
1322
1377
  proto.aggregator.ExpressionCondition.prototype.getExpression = function() {
@@ -1347,7 +1402,10 @@ var init_avs_pb = __esm({
1347
1402
  proto.aggregator.SyncTasksResp.deserializeBinary = function(bytes) {
1348
1403
  var reader = new jspb.BinaryReader(bytes);
1349
1404
  var msg = new proto.aggregator.SyncTasksResp();
1350
- return proto.aggregator.SyncTasksResp.deserializeBinaryFromReader(msg, reader);
1405
+ return proto.aggregator.SyncTasksResp.deserializeBinaryFromReader(
1406
+ msg,
1407
+ reader
1408
+ );
1351
1409
  };
1352
1410
  proto.aggregator.SyncTasksResp.deserializeBinaryFromReader = function(msg, reader) {
1353
1411
  while (reader.nextField()) {
@@ -1372,7 +1430,10 @@ var init_avs_pb = __esm({
1372
1430
  break;
1373
1431
  case 3:
1374
1432
  var value = new proto.aggregator.TaskTrigger();
1375
- reader.readMessage(value, proto.aggregator.TaskTrigger.deserializeBinaryFromReader);
1433
+ reader.readMessage(
1434
+ value,
1435
+ proto.aggregator.TaskTrigger.deserializeBinaryFromReader
1436
+ );
1376
1437
  msg.setTrigger(value);
1377
1438
  break;
1378
1439
  default:
@@ -1391,17 +1452,11 @@ var init_avs_pb = __esm({
1391
1452
  var f = void 0;
1392
1453
  f = message.getId();
1393
1454
  if (f.length > 0) {
1394
- writer.writeString(
1395
- 1,
1396
- f
1397
- );
1455
+ writer.writeString(1, f);
1398
1456
  }
1399
1457
  f = message.getChecktype();
1400
1458
  if (f.length > 0) {
1401
- writer.writeString(
1402
- 2,
1403
- f
1404
- );
1459
+ writer.writeString(2, f);
1405
1460
  }
1406
1461
  f = message.getTrigger();
1407
1462
  if (f != null) {
@@ -1502,17 +1557,11 @@ var init_avs_pb = __esm({
1502
1557
  var f = void 0;
1503
1558
  f = message.getDestination();
1504
1559
  if (f.length > 0) {
1505
- writer.writeString(
1506
- 1,
1507
- f
1508
- );
1560
+ writer.writeString(1, f);
1509
1561
  }
1510
1562
  f = message.getAmount();
1511
1563
  if (f.length > 0) {
1512
- writer.writeString(
1513
- 2,
1514
- f
1515
- );
1564
+ writer.writeString(2, f);
1516
1565
  }
1517
1566
  };
1518
1567
  proto.aggregator.ETHTransfer.prototype.getDestination = function() {
@@ -1535,7 +1584,10 @@ var init_avs_pb = __esm({
1535
1584
  };
1536
1585
  if (jspb.Message.GENERATE_TO_OBJECT) {
1537
1586
  proto.aggregator.ContractExecution.prototype.toObject = function(opt_includeInstance) {
1538
- return proto.aggregator.ContractExecution.toObject(opt_includeInstance, this);
1587
+ return proto.aggregator.ContractExecution.toObject(
1588
+ opt_includeInstance,
1589
+ this
1590
+ );
1539
1591
  };
1540
1592
  proto.aggregator.ContractExecution.toObject = function(includeInstance, msg) {
1541
1593
  var f, obj = {
@@ -1553,7 +1605,10 @@ var init_avs_pb = __esm({
1553
1605
  proto.aggregator.ContractExecution.deserializeBinary = function(bytes) {
1554
1606
  var reader = new jspb.BinaryReader(bytes);
1555
1607
  var msg = new proto.aggregator.ContractExecution();
1556
- return proto.aggregator.ContractExecution.deserializeBinaryFromReader(msg, reader);
1608
+ return proto.aggregator.ContractExecution.deserializeBinaryFromReader(
1609
+ msg,
1610
+ reader
1611
+ );
1557
1612
  };
1558
1613
  proto.aggregator.ContractExecution.deserializeBinaryFromReader = function(msg, reader) {
1559
1614
  while (reader.nextField()) {
@@ -1606,31 +1661,19 @@ var init_avs_pb = __esm({
1606
1661
  var f = void 0;
1607
1662
  f = message.getContractAddress();
1608
1663
  if (f.length > 0) {
1609
- writer.writeString(
1610
- 1,
1611
- f
1612
- );
1664
+ writer.writeString(1, f);
1613
1665
  }
1614
1666
  f = message.getCallData();
1615
1667
  if (f.length > 0) {
1616
- writer.writeString(
1617
- 2,
1618
- f
1619
- );
1668
+ writer.writeString(2, f);
1620
1669
  }
1621
1670
  f = message.getMethod();
1622
1671
  if (f.length > 0) {
1623
- writer.writeString(
1624
- 3,
1625
- f
1626
- );
1672
+ writer.writeString(3, f);
1627
1673
  }
1628
1674
  f = message.getEncodedParams();
1629
1675
  if (f.length > 0) {
1630
- writer.writeString(
1631
- 4,
1632
- f
1633
- );
1676
+ writer.writeString(4, f);
1634
1677
  }
1635
1678
  };
1636
1679
  proto.aggregator.ContractExecution.prototype.getContractAddress = function() {
@@ -1671,7 +1714,10 @@ var init_avs_pb = __esm({
1671
1714
  };
1672
1715
  if (jspb.Message.GENERATE_TO_OBJECT) {
1673
1716
  proto.aggregator.GraphQLDataQuery.prototype.toObject = function(opt_includeInstance) {
1674
- return proto.aggregator.GraphQLDataQuery.toObject(opt_includeInstance, this);
1717
+ return proto.aggregator.GraphQLDataQuery.toObject(
1718
+ opt_includeInstance,
1719
+ this
1720
+ );
1675
1721
  };
1676
1722
  proto.aggregator.GraphQLDataQuery.toObject = function(includeInstance, msg) {
1677
1723
  var f, obj = {
@@ -1687,7 +1733,10 @@ var init_avs_pb = __esm({
1687
1733
  proto.aggregator.GraphQLDataQuery.deserializeBinary = function(bytes) {
1688
1734
  var reader = new jspb.BinaryReader(bytes);
1689
1735
  var msg = new proto.aggregator.GraphQLDataQuery();
1690
- return proto.aggregator.GraphQLDataQuery.deserializeBinaryFromReader(msg, reader);
1736
+ return proto.aggregator.GraphQLDataQuery.deserializeBinaryFromReader(
1737
+ msg,
1738
+ reader
1739
+ );
1691
1740
  };
1692
1741
  proto.aggregator.GraphQLDataQuery.deserializeBinaryFromReader = function(msg, reader) {
1693
1742
  while (reader.nextField()) {
@@ -1726,17 +1775,11 @@ var init_avs_pb = __esm({
1726
1775
  var f = void 0;
1727
1776
  f = message.getUrl();
1728
1777
  if (f.length > 0) {
1729
- writer.writeString(
1730
- 1,
1731
- f
1732
- );
1778
+ writer.writeString(1, f);
1733
1779
  }
1734
1780
  f = message.getQuery();
1735
1781
  if (f.length > 0) {
1736
- writer.writeString(
1737
- 2,
1738
- f
1739
- );
1782
+ writer.writeString(2, f);
1740
1783
  }
1741
1784
  };
1742
1785
  proto.aggregator.GraphQLDataQuery.prototype.getUrl = function() {
@@ -1795,7 +1838,15 @@ var init_avs_pb = __esm({
1795
1838
  case 2:
1796
1839
  var value = msg.getHeadersMap();
1797
1840
  reader.readMessage(value, function(message, reader2) {
1798
- jspb.Map.deserializeBinary(message, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
1841
+ jspb.Map.deserializeBinary(
1842
+ message,
1843
+ reader2,
1844
+ jspb.BinaryReader.prototype.readString,
1845
+ jspb.BinaryReader.prototype.readString,
1846
+ null,
1847
+ "",
1848
+ ""
1849
+ );
1799
1850
  });
1800
1851
  break;
1801
1852
  case 3:
@@ -1821,21 +1872,20 @@ var init_avs_pb = __esm({
1821
1872
  var f = void 0;
1822
1873
  f = message.getUrl();
1823
1874
  if (f.length > 0) {
1824
- writer.writeString(
1825
- 1,
1826
- f
1827
- );
1875
+ writer.writeString(1, f);
1828
1876
  }
1829
1877
  f = message.getHeadersMap(true);
1830
1878
  if (f && f.getLength() > 0) {
1831
- f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
1879
+ f.serializeBinary(
1880
+ 2,
1881
+ writer,
1882
+ jspb.BinaryWriter.prototype.writeString,
1883
+ jspb.BinaryWriter.prototype.writeString
1884
+ );
1832
1885
  }
1833
1886
  f = message.getBody();
1834
1887
  if (f.length > 0) {
1835
- writer.writeString(
1836
- 3,
1837
- f
1838
- );
1888
+ writer.writeString(3, f);
1839
1889
  }
1840
1890
  };
1841
1891
  proto.aggregator.HTTPAPICall.prototype.getUrl = function() {
@@ -1850,12 +1900,7 @@ var init_avs_pb = __esm({
1850
1900
  proto.aggregator.HTTPAPICall.prototype.getHeadersMap = function(opt_noLazyCreate) {
1851
1901
  return (
1852
1902
  /** @type {!jspb.Map<string,string>} */
1853
- jspb.Message.getMapField(
1854
- this,
1855
- 2,
1856
- opt_noLazyCreate,
1857
- null
1858
- )
1903
+ jspb.Message.getMapField(this, 2, opt_noLazyCreate, null)
1859
1904
  );
1860
1905
  };
1861
1906
  proto.aggregator.HTTPAPICall.prototype.clearHeadersMap = function() {
@@ -1928,17 +1973,11 @@ var init_avs_pb = __esm({
1928
1973
  var f = void 0;
1929
1974
  f = message.getType();
1930
1975
  if (f !== 0) {
1931
- writer.writeEnum(
1932
- 1,
1933
- f
1934
- );
1976
+ writer.writeEnum(1, f);
1935
1977
  }
1936
1978
  f = message.getBody();
1937
1979
  if (f.length > 0) {
1938
- writer.writeString(
1939
- 2,
1940
- f
1941
- );
1980
+ writer.writeString(2, f);
1942
1981
  }
1943
1982
  };
1944
1983
  proto.aggregator.CustomCode.prototype.getType = function() {
@@ -1977,7 +2016,10 @@ var init_avs_pb = __esm({
1977
2016
  proto.aggregator.ConditionJump.deserializeBinary = function(bytes) {
1978
2017
  var reader = new jspb.BinaryReader(bytes);
1979
2018
  var msg = new proto.aggregator.ConditionJump();
1980
- return proto.aggregator.ConditionJump.deserializeBinaryFromReader(msg, reader);
2019
+ return proto.aggregator.ConditionJump.deserializeBinaryFromReader(
2020
+ msg,
2021
+ reader
2022
+ );
1981
2023
  };
1982
2024
  proto.aggregator.ConditionJump.deserializeBinaryFromReader = function(msg, reader) {
1983
2025
  while (reader.nextField()) {
@@ -2016,17 +2058,11 @@ var init_avs_pb = __esm({
2016
2058
  var f = void 0;
2017
2059
  f = message.getExpression();
2018
2060
  if (f.length > 0) {
2019
- writer.writeString(
2020
- 1,
2021
- f
2022
- );
2061
+ writer.writeString(1, f);
2023
2062
  }
2024
2063
  f = message.getNext();
2025
2064
  if (f.length > 0) {
2026
- writer.writeString(
2027
- 2,
2028
- f
2029
- );
2065
+ writer.writeString(2, f);
2030
2066
  }
2031
2067
  };
2032
2068
  proto.aggregator.ConditionJump.prototype.getExpression = function() {
@@ -2082,17 +2118,26 @@ var init_avs_pb = __esm({
2082
2118
  switch (field) {
2083
2119
  case 1:
2084
2120
  var value = new proto.aggregator.ConditionJump();
2085
- reader.readMessage(value, proto.aggregator.ConditionJump.deserializeBinaryFromReader);
2121
+ reader.readMessage(
2122
+ value,
2123
+ proto.aggregator.ConditionJump.deserializeBinaryFromReader
2124
+ );
2086
2125
  msg.setIf(value);
2087
2126
  break;
2088
2127
  case 2:
2089
2128
  var value = new proto.aggregator.ConditionJump();
2090
- reader.readMessage(value, proto.aggregator.ConditionJump.deserializeBinaryFromReader);
2129
+ reader.readMessage(
2130
+ value,
2131
+ proto.aggregator.ConditionJump.deserializeBinaryFromReader
2132
+ );
2091
2133
  msg.addElseifs(value);
2092
2134
  break;
2093
2135
  case 3:
2094
2136
  var value = new proto.aggregator.ConditionJump();
2095
- reader.readMessage(value, proto.aggregator.ConditionJump.deserializeBinaryFromReader);
2137
+ reader.readMessage(
2138
+ value,
2139
+ proto.aggregator.ConditionJump.deserializeBinaryFromReader
2140
+ );
2096
2141
  msg.setElse(value);
2097
2142
  break;
2098
2143
  default:
@@ -2152,14 +2197,24 @@ var init_avs_pb = __esm({
2152
2197
  proto.aggregator.BranchAction.prototype.getElseifsList = function() {
2153
2198
  return (
2154
2199
  /** @type{!Array<!proto.aggregator.ConditionJump>} */
2155
- jspb.Message.getRepeatedWrapperField(this, proto.aggregator.ConditionJump, 2)
2200
+ jspb.Message.getRepeatedWrapperField(
2201
+ this,
2202
+ proto.aggregator.ConditionJump,
2203
+ 2
2204
+ )
2156
2205
  );
2157
2206
  };
2158
2207
  proto.aggregator.BranchAction.prototype.setElseifsList = function(value) {
2159
2208
  return jspb.Message.setRepeatedWrapperField(this, 2, value);
2160
2209
  };
2161
2210
  proto.aggregator.BranchAction.prototype.addElseifs = function(opt_value, opt_index) {
2162
- return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.aggregator.ConditionJump, opt_index);
2211
+ return jspb.Message.addToRepeatedWrapperField(
2212
+ this,
2213
+ 2,
2214
+ opt_value,
2215
+ proto.aggregator.ConditionJump,
2216
+ opt_index
2217
+ );
2163
2218
  };
2164
2219
  proto.aggregator.BranchAction.prototype.clearElseifsList = function() {
2165
2220
  return this.setElseifsList([]);
@@ -2245,32 +2300,50 @@ var init_avs_pb = __esm({
2245
2300
  break;
2246
2301
  case 10:
2247
2302
  var value = new proto.aggregator.ETHTransfer();
2248
- reader.readMessage(value, proto.aggregator.ETHTransfer.deserializeBinaryFromReader);
2303
+ reader.readMessage(
2304
+ value,
2305
+ proto.aggregator.ETHTransfer.deserializeBinaryFromReader
2306
+ );
2249
2307
  msg.setEthTransfer(value);
2250
2308
  break;
2251
2309
  case 11:
2252
2310
  var value = new proto.aggregator.ContractExecution();
2253
- reader.readMessage(value, proto.aggregator.ContractExecution.deserializeBinaryFromReader);
2311
+ reader.readMessage(
2312
+ value,
2313
+ proto.aggregator.ContractExecution.deserializeBinaryFromReader
2314
+ );
2254
2315
  msg.setContractExecution(value);
2255
2316
  break;
2256
2317
  case 12:
2257
2318
  var value = new proto.aggregator.GraphQLDataQuery();
2258
- reader.readMessage(value, proto.aggregator.GraphQLDataQuery.deserializeBinaryFromReader);
2319
+ reader.readMessage(
2320
+ value,
2321
+ proto.aggregator.GraphQLDataQuery.deserializeBinaryFromReader
2322
+ );
2259
2323
  msg.setGraphqlDataQuery(value);
2260
2324
  break;
2261
2325
  case 13:
2262
2326
  var value = new proto.aggregator.HTTPAPICall();
2263
- reader.readMessage(value, proto.aggregator.HTTPAPICall.deserializeBinaryFromReader);
2327
+ reader.readMessage(
2328
+ value,
2329
+ proto.aggregator.HTTPAPICall.deserializeBinaryFromReader
2330
+ );
2264
2331
  msg.setHttpDataQuery(value);
2265
2332
  break;
2266
2333
  case 14:
2267
2334
  var value = new proto.aggregator.CustomCode();
2268
- reader.readMessage(value, proto.aggregator.CustomCode.deserializeBinaryFromReader);
2335
+ reader.readMessage(
2336
+ value,
2337
+ proto.aggregator.CustomCode.deserializeBinaryFromReader
2338
+ );
2269
2339
  msg.setCustomCode(value);
2270
2340
  break;
2271
2341
  case 15:
2272
2342
  var value = new proto.aggregator.BranchAction();
2273
- reader.readMessage(value, proto.aggregator.BranchAction.deserializeBinaryFromReader);
2343
+ reader.readMessage(
2344
+ value,
2345
+ proto.aggregator.BranchAction.deserializeBinaryFromReader
2346
+ );
2274
2347
  msg.setBranch(value);
2275
2348
  break;
2276
2349
  default:
@@ -2289,31 +2362,19 @@ var init_avs_pb = __esm({
2289
2362
  var f = void 0;
2290
2363
  f = message.getTaskType();
2291
2364
  if (f !== 0) {
2292
- writer.writeEnum(
2293
- 1,
2294
- f
2295
- );
2365
+ writer.writeEnum(1, f);
2296
2366
  }
2297
2367
  f = message.getId();
2298
2368
  if (f.length > 0) {
2299
- writer.writeString(
2300
- 2,
2301
- f
2302
- );
2369
+ writer.writeString(2, f);
2303
2370
  }
2304
2371
  f = message.getName();
2305
2372
  if (f.length > 0) {
2306
- writer.writeString(
2307
- 3,
2308
- f
2309
- );
2373
+ writer.writeString(3, f);
2310
2374
  }
2311
2375
  f = message.getNextList();
2312
2376
  if (f.length > 0) {
2313
- writer.writeRepeatedString(
2314
- 4,
2315
- f
2316
- );
2377
+ writer.writeRepeatedString(4, f);
2317
2378
  }
2318
2379
  f = message.getEthTransfer();
2319
2380
  if (f != null) {
@@ -2561,24 +2622,15 @@ var init_avs_pb = __esm({
2561
2622
  var f = void 0;
2562
2623
  f = message.getEpoch();
2563
2624
  if (f !== 0) {
2564
- writer.writeInt64(
2565
- 1,
2566
- f
2567
- );
2625
+ writer.writeInt64(1, f);
2568
2626
  }
2569
2627
  f = message.getUserOpHash();
2570
2628
  if (f.length > 0) {
2571
- writer.writeString(
2572
- 2,
2573
- f
2574
- );
2629
+ writer.writeString(2, f);
2575
2630
  }
2576
2631
  f = message.getError();
2577
2632
  if (f.length > 0) {
2578
- writer.writeString(
2579
- 3,
2580
- f
2581
- );
2633
+ writer.writeString(3, f);
2582
2634
  }
2583
2635
  };
2584
2636
  proto.aggregator.Execution.prototype.getEpoch = function() {
@@ -2656,7 +2708,10 @@ var init_avs_pb = __esm({
2656
2708
  switch (field) {
2657
2709
  case 1:
2658
2710
  var value = new proto.aggregator.UUID();
2659
- reader.readMessage(value, proto.aggregator.UUID.deserializeBinaryFromReader);
2711
+ reader.readMessage(
2712
+ value,
2713
+ proto.aggregator.UUID.deserializeBinaryFromReader
2714
+ );
2660
2715
  msg.setId(value);
2661
2716
  break;
2662
2717
  case 2:
@@ -2675,12 +2730,18 @@ var init_avs_pb = __esm({
2675
2730
  break;
2676
2731
  case 4:
2677
2732
  var value = new proto.aggregator.TaskTrigger();
2678
- reader.readMessage(value, proto.aggregator.TaskTrigger.deserializeBinaryFromReader);
2733
+ reader.readMessage(
2734
+ value,
2735
+ proto.aggregator.TaskTrigger.deserializeBinaryFromReader
2736
+ );
2679
2737
  msg.setTrigger(value);
2680
2738
  break;
2681
2739
  case 5:
2682
2740
  var value = new proto.aggregator.TaskAction();
2683
- reader.readMessage(value, proto.aggregator.TaskAction.deserializeBinaryFromReader);
2741
+ reader.readMessage(
2742
+ value,
2743
+ proto.aggregator.TaskAction.deserializeBinaryFromReader
2744
+ );
2684
2745
  msg.addNodes(value);
2685
2746
  break;
2686
2747
  case 6:
@@ -2727,7 +2788,10 @@ var init_avs_pb = __esm({
2727
2788
  break;
2728
2789
  case 12:
2729
2790
  var value = new proto.aggregator.Execution();
2730
- reader.readMessage(value, proto.aggregator.Execution.deserializeBinaryFromReader);
2791
+ reader.readMessage(
2792
+ value,
2793
+ proto.aggregator.Execution.deserializeBinaryFromReader
2794
+ );
2731
2795
  msg.addExecutions(value);
2732
2796
  break;
2733
2797
  default:
@@ -2746,25 +2810,15 @@ var init_avs_pb = __esm({
2746
2810
  var f = void 0;
2747
2811
  f = message.getId();
2748
2812
  if (f != null) {
2749
- writer.writeMessage(
2750
- 1,
2751
- f,
2752
- proto.aggregator.UUID.serializeBinaryToWriter
2753
- );
2813
+ writer.writeMessage(1, f, proto.aggregator.UUID.serializeBinaryToWriter);
2754
2814
  }
2755
2815
  f = message.getOwner();
2756
2816
  if (f.length > 0) {
2757
- writer.writeString(
2758
- 2,
2759
- f
2760
- );
2817
+ writer.writeString(2, f);
2761
2818
  }
2762
2819
  f = message.getSmartAccountAddress();
2763
2820
  if (f.length > 0) {
2764
- writer.writeString(
2765
- 3,
2766
- f
2767
- );
2821
+ writer.writeString(3, f);
2768
2822
  }
2769
2823
  f = message.getTrigger();
2770
2824
  if (f != null) {
@@ -2784,45 +2838,27 @@ var init_avs_pb = __esm({
2784
2838
  }
2785
2839
  f = message.getStartAt();
2786
2840
  if (f !== 0) {
2787
- writer.writeInt64(
2788
- 6,
2789
- f
2790
- );
2841
+ writer.writeInt64(6, f);
2791
2842
  }
2792
2843
  f = message.getExpiredAt();
2793
2844
  if (f !== 0) {
2794
- writer.writeInt64(
2795
- 7,
2796
- f
2797
- );
2845
+ writer.writeInt64(7, f);
2798
2846
  }
2799
2847
  f = message.getMemo();
2800
2848
  if (f.length > 0) {
2801
- writer.writeString(
2802
- 8,
2803
- f
2804
- );
2849
+ writer.writeString(8, f);
2805
2850
  }
2806
2851
  f = message.getCompletedAt();
2807
2852
  if (f !== 0) {
2808
- writer.writeInt64(
2809
- 9,
2810
- f
2811
- );
2853
+ writer.writeInt64(9, f);
2812
2854
  }
2813
2855
  f = message.getStatus();
2814
2856
  if (f !== 0) {
2815
- writer.writeEnum(
2816
- 10,
2817
- f
2818
- );
2857
+ writer.writeEnum(10, f);
2819
2858
  }
2820
2859
  f = message.getRepeatable();
2821
2860
  if (f) {
2822
- writer.writeBool(
2823
- 11,
2824
- f
2825
- );
2861
+ writer.writeBool(11, f);
2826
2862
  }
2827
2863
  f = message.getExecutionsList();
2828
2864
  if (f.length > 0) {
@@ -2891,7 +2927,13 @@ var init_avs_pb = __esm({
2891
2927
  return jspb.Message.setRepeatedWrapperField(this, 5, value);
2892
2928
  };
2893
2929
  proto.aggregator.Task.prototype.addNodes = function(opt_value, opt_index) {
2894
- return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.aggregator.TaskAction, opt_index);
2930
+ return jspb.Message.addToRepeatedWrapperField(
2931
+ this,
2932
+ 5,
2933
+ opt_value,
2934
+ proto.aggregator.TaskAction,
2935
+ opt_index
2936
+ );
2895
2937
  };
2896
2938
  proto.aggregator.Task.prototype.clearNodesList = function() {
2897
2939
  return this.setNodesList([]);
@@ -2960,7 +3002,13 @@ var init_avs_pb = __esm({
2960
3002
  return jspb.Message.setRepeatedWrapperField(this, 12, value);
2961
3003
  };
2962
3004
  proto.aggregator.Task.prototype.addExecutions = function(opt_value, opt_index) {
2963
- return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.aggregator.Execution, opt_index);
3005
+ return jspb.Message.addToRepeatedWrapperField(
3006
+ this,
3007
+ 12,
3008
+ opt_value,
3009
+ proto.aggregator.Execution,
3010
+ opt_index
3011
+ );
2964
3012
  };
2965
3013
  proto.aggregator.Task.prototype.clearExecutionsList = function() {
2966
3014
  return this.setExecutionsList([]);
@@ -2992,7 +3040,10 @@ var init_avs_pb = __esm({
2992
3040
  proto.aggregator.CreateTaskReq.deserializeBinary = function(bytes) {
2993
3041
  var reader = new jspb.BinaryReader(bytes);
2994
3042
  var msg = new proto.aggregator.CreateTaskReq();
2995
- return proto.aggregator.CreateTaskReq.deserializeBinaryFromReader(msg, reader);
3043
+ return proto.aggregator.CreateTaskReq.deserializeBinaryFromReader(
3044
+ msg,
3045
+ reader
3046
+ );
2996
3047
  };
2997
3048
  proto.aggregator.CreateTaskReq.deserializeBinaryFromReader = function(msg, reader) {
2998
3049
  while (reader.nextField()) {
@@ -3003,12 +3054,18 @@ var init_avs_pb = __esm({
3003
3054
  switch (field) {
3004
3055
  case 1:
3005
3056
  var value = new proto.aggregator.TaskTrigger();
3006
- reader.readMessage(value, proto.aggregator.TaskTrigger.deserializeBinaryFromReader);
3057
+ reader.readMessage(
3058
+ value,
3059
+ proto.aggregator.TaskTrigger.deserializeBinaryFromReader
3060
+ );
3007
3061
  msg.setTrigger(value);
3008
3062
  break;
3009
3063
  case 2:
3010
3064
  var value = new proto.aggregator.TaskAction();
3011
- reader.readMessage(value, proto.aggregator.TaskAction.deserializeBinaryFromReader);
3065
+ reader.readMessage(
3066
+ value,
3067
+ proto.aggregator.TaskAction.deserializeBinaryFromReader
3068
+ );
3012
3069
  msg.addActions(value);
3013
3070
  break;
3014
3071
  case 3:
@@ -3071,31 +3128,19 @@ var init_avs_pb = __esm({
3071
3128
  }
3072
3129
  f = message.getStartAt();
3073
3130
  if (f !== 0) {
3074
- writer.writeInt64(
3075
- 3,
3076
- f
3077
- );
3131
+ writer.writeInt64(3, f);
3078
3132
  }
3079
3133
  f = message.getExpiredAt();
3080
3134
  if (f !== 0) {
3081
- writer.writeInt64(
3082
- 4,
3083
- f
3084
- );
3135
+ writer.writeInt64(4, f);
3085
3136
  }
3086
3137
  f = message.getMemo();
3087
3138
  if (f.length > 0) {
3088
- writer.writeString(
3089
- 5,
3090
- f
3091
- );
3139
+ writer.writeString(5, f);
3092
3140
  }
3093
3141
  f = message.getRepeatable();
3094
3142
  if (f) {
3095
- writer.writeBool(
3096
- 6,
3097
- f
3098
- );
3143
+ writer.writeBool(6, f);
3099
3144
  }
3100
3145
  };
3101
3146
  proto.aggregator.CreateTaskReq.prototype.getTrigger = function() {
@@ -3123,7 +3168,13 @@ var init_avs_pb = __esm({
3123
3168
  return jspb.Message.setRepeatedWrapperField(this, 2, value);
3124
3169
  };
3125
3170
  proto.aggregator.CreateTaskReq.prototype.addActions = function(opt_value, opt_index) {
3126
- return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.aggregator.TaskAction, opt_index);
3171
+ return jspb.Message.addToRepeatedWrapperField(
3172
+ this,
3173
+ 2,
3174
+ opt_value,
3175
+ proto.aggregator.TaskAction,
3176
+ opt_index
3177
+ );
3127
3178
  };
3128
3179
  proto.aggregator.CreateTaskReq.prototype.clearActionsList = function() {
3129
3180
  return this.setActionsList([]);
@@ -3181,7 +3232,10 @@ var init_avs_pb = __esm({
3181
3232
  proto.aggregator.CreateTaskResp.deserializeBinary = function(bytes) {
3182
3233
  var reader = new jspb.BinaryReader(bytes);
3183
3234
  var msg = new proto.aggregator.CreateTaskResp();
3184
- return proto.aggregator.CreateTaskResp.deserializeBinaryFromReader(msg, reader);
3235
+ return proto.aggregator.CreateTaskResp.deserializeBinaryFromReader(
3236
+ msg,
3237
+ reader
3238
+ );
3185
3239
  };
3186
3240
  proto.aggregator.CreateTaskResp.deserializeBinaryFromReader = function(msg, reader) {
3187
3241
  while (reader.nextField()) {
@@ -3213,10 +3267,7 @@ var init_avs_pb = __esm({
3213
3267
  var f = void 0;
3214
3268
  f = message.getId();
3215
3269
  if (f.length > 0) {
3216
- writer.writeString(
3217
- 1,
3218
- f
3219
- );
3270
+ writer.writeString(1, f);
3220
3271
  }
3221
3272
  };
3222
3273
  proto.aggregator.CreateTaskResp.prototype.getId = function() {
@@ -3277,10 +3328,7 @@ var init_avs_pb = __esm({
3277
3328
  var f = void 0;
3278
3329
  f = message.getOwner();
3279
3330
  if (f.length > 0) {
3280
- writer.writeString(
3281
- 1,
3282
- f
3283
- );
3331
+ writer.writeString(1, f);
3284
3332
  }
3285
3333
  };
3286
3334
  proto.aggregator.NonceRequest.prototype.getOwner = function() {
@@ -3341,10 +3389,7 @@ var init_avs_pb = __esm({
3341
3389
  var f = void 0;
3342
3390
  f = message.getNonce();
3343
3391
  if (f.length > 0) {
3344
- writer.writeString(
3345
- 1,
3346
- f
3347
- );
3392
+ writer.writeString(1, f);
3348
3393
  }
3349
3394
  };
3350
3395
  proto.aggregator.NonceResp.prototype.getNonce = function() {
@@ -3373,7 +3418,10 @@ var init_avs_pb = __esm({
3373
3418
  proto.aggregator.AddressRequest.deserializeBinary = function(bytes) {
3374
3419
  var reader = new jspb.BinaryReader(bytes);
3375
3420
  var msg = new proto.aggregator.AddressRequest();
3376
- return proto.aggregator.AddressRequest.deserializeBinaryFromReader(msg, reader);
3421
+ return proto.aggregator.AddressRequest.deserializeBinaryFromReader(
3422
+ msg,
3423
+ reader
3424
+ );
3377
3425
  };
3378
3426
  proto.aggregator.AddressRequest.deserializeBinaryFromReader = function(msg, reader) {
3379
3427
  while (reader.nextField()) {
@@ -3405,10 +3453,7 @@ var init_avs_pb = __esm({
3405
3453
  var f = void 0;
3406
3454
  f = message.getOwner();
3407
3455
  if (f.length > 0) {
3408
- writer.writeString(
3409
- 1,
3410
- f
3411
- );
3456
+ writer.writeString(1, f);
3412
3457
  }
3413
3458
  };
3414
3459
  proto.aggregator.AddressRequest.prototype.getOwner = function() {
@@ -3477,17 +3522,11 @@ var init_avs_pb = __esm({
3477
3522
  var f = void 0;
3478
3523
  f = message.getSmartAccountAddress();
3479
3524
  if (f.length > 0) {
3480
- writer.writeString(
3481
- 1,
3482
- f
3483
- );
3525
+ writer.writeString(1, f);
3484
3526
  }
3485
3527
  f = message.getNonce();
3486
3528
  if (f.length > 0) {
3487
- writer.writeString(
3488
- 2,
3489
- f
3490
- );
3529
+ writer.writeString(2, f);
3491
3530
  }
3492
3531
  };
3493
3532
  proto.aggregator.AddressResp.prototype.getSmartAccountAddress = function() {
@@ -3569,7 +3608,10 @@ var init_avs_pb = __esm({
3569
3608
  proto.aggregator.ListTasksResp.deserializeBinary = function(bytes) {
3570
3609
  var reader = new jspb.BinaryReader(bytes);
3571
3610
  var msg = new proto.aggregator.ListTasksResp();
3572
- return proto.aggregator.ListTasksResp.deserializeBinaryFromReader(msg, reader);
3611
+ return proto.aggregator.ListTasksResp.deserializeBinaryFromReader(
3612
+ msg,
3613
+ reader
3614
+ );
3573
3615
  };
3574
3616
  proto.aggregator.ListTasksResp.deserializeBinaryFromReader = function(msg, reader) {
3575
3617
  while (reader.nextField()) {
@@ -3580,7 +3622,10 @@ var init_avs_pb = __esm({
3580
3622
  switch (field) {
3581
3623
  case 1:
3582
3624
  var value = new proto.aggregator.ListTasksResp.TaskItemResp();
3583
- reader.readMessage(value, proto.aggregator.ListTasksResp.TaskItemResp.deserializeBinaryFromReader);
3625
+ reader.readMessage(
3626
+ value,
3627
+ proto.aggregator.ListTasksResp.TaskItemResp.deserializeBinaryFromReader
3628
+ );
3584
3629
  msg.addTasks(value);
3585
3630
  break;
3586
3631
  default:
@@ -3608,7 +3653,10 @@ var init_avs_pb = __esm({
3608
3653
  };
3609
3654
  if (jspb.Message.GENERATE_TO_OBJECT) {
3610
3655
  proto.aggregator.ListTasksResp.TaskItemResp.prototype.toObject = function(opt_includeInstance) {
3611
- return proto.aggregator.ListTasksResp.TaskItemResp.toObject(opt_includeInstance, this);
3656
+ return proto.aggregator.ListTasksResp.TaskItemResp.toObject(
3657
+ opt_includeInstance,
3658
+ this
3659
+ );
3612
3660
  };
3613
3661
  proto.aggregator.ListTasksResp.TaskItemResp.toObject = function(includeInstance, msg) {
3614
3662
  var f, obj = {
@@ -3624,7 +3672,10 @@ var init_avs_pb = __esm({
3624
3672
  proto.aggregator.ListTasksResp.TaskItemResp.deserializeBinary = function(bytes) {
3625
3673
  var reader = new jspb.BinaryReader(bytes);
3626
3674
  var msg = new proto.aggregator.ListTasksResp.TaskItemResp();
3627
- return proto.aggregator.ListTasksResp.TaskItemResp.deserializeBinaryFromReader(msg, reader);
3675
+ return proto.aggregator.ListTasksResp.TaskItemResp.deserializeBinaryFromReader(
3676
+ msg,
3677
+ reader
3678
+ );
3628
3679
  };
3629
3680
  proto.aggregator.ListTasksResp.TaskItemResp.deserializeBinaryFromReader = function(msg, reader) {
3630
3681
  while (reader.nextField()) {
@@ -3656,24 +3707,21 @@ var init_avs_pb = __esm({
3656
3707
  };
3657
3708
  proto.aggregator.ListTasksResp.TaskItemResp.prototype.serializeBinary = function() {
3658
3709
  var writer = new jspb.BinaryWriter();
3659
- proto.aggregator.ListTasksResp.TaskItemResp.serializeBinaryToWriter(this, writer);
3710
+ proto.aggregator.ListTasksResp.TaskItemResp.serializeBinaryToWriter(
3711
+ this,
3712
+ writer
3713
+ );
3660
3714
  return writer.getResultBuffer();
3661
3715
  };
3662
3716
  proto.aggregator.ListTasksResp.TaskItemResp.serializeBinaryToWriter = function(message, writer) {
3663
3717
  var f = void 0;
3664
3718
  f = message.getId();
3665
3719
  if (f.length > 0) {
3666
- writer.writeString(
3667
- 1,
3668
- f
3669
- );
3720
+ writer.writeString(1, f);
3670
3721
  }
3671
3722
  f = message.getStatus();
3672
3723
  if (f !== 0) {
3673
- writer.writeEnum(
3674
- 2,
3675
- f
3676
- );
3724
+ writer.writeEnum(2, f);
3677
3725
  }
3678
3726
  };
3679
3727
  proto.aggregator.ListTasksResp.TaskItemResp.prototype.getId = function() {
@@ -3697,14 +3745,24 @@ var init_avs_pb = __esm({
3697
3745
  proto.aggregator.ListTasksResp.prototype.getTasksList = function() {
3698
3746
  return (
3699
3747
  /** @type{!Array<!proto.aggregator.ListTasksResp.TaskItemResp>} */
3700
- jspb.Message.getRepeatedWrapperField(this, proto.aggregator.ListTasksResp.TaskItemResp, 1)
3748
+ jspb.Message.getRepeatedWrapperField(
3749
+ this,
3750
+ proto.aggregator.ListTasksResp.TaskItemResp,
3751
+ 1
3752
+ )
3701
3753
  );
3702
3754
  };
3703
3755
  proto.aggregator.ListTasksResp.prototype.setTasksList = function(value) {
3704
3756
  return jspb.Message.setRepeatedWrapperField(this, 1, value);
3705
3757
  };
3706
3758
  proto.aggregator.ListTasksResp.prototype.addTasks = function(opt_value, opt_index) {
3707
- return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.aggregator.ListTasksResp.TaskItemResp, opt_index);
3759
+ return jspb.Message.addToRepeatedWrapperField(
3760
+ this,
3761
+ 1,
3762
+ opt_value,
3763
+ proto.aggregator.ListTasksResp.TaskItemResp,
3764
+ opt_index
3765
+ );
3708
3766
  };
3709
3767
  proto.aggregator.ListTasksResp.prototype.clearTasksList = function() {
3710
3768
  return this.setTasksList([]);
@@ -3774,24 +3832,15 @@ var init_avs_pb = __esm({
3774
3832
  var f = void 0;
3775
3833
  f = message.getOwner();
3776
3834
  if (f.length > 0) {
3777
- writer.writeString(
3778
- 1,
3779
- f
3780
- );
3835
+ writer.writeString(1, f);
3781
3836
  }
3782
3837
  f = message.getExpiredAt();
3783
3838
  if (f !== 0) {
3784
- writer.writeInt64(
3785
- 2,
3786
- f
3787
- );
3839
+ writer.writeInt64(2, f);
3788
3840
  }
3789
3841
  f = message.getSignature();
3790
3842
  if (f.length > 0) {
3791
- writer.writeString(
3792
- 3,
3793
- f
3794
- );
3843
+ writer.writeString(3, f);
3795
3844
  }
3796
3845
  };
3797
3846
  proto.aggregator.GetKeyReq.prototype.getOwner = function() {
@@ -3870,10 +3919,7 @@ var init_avs_pb = __esm({
3870
3919
  var f = void 0;
3871
3920
  f = message.getKey();
3872
3921
  if (f.length > 0) {
3873
- writer.writeString(
3874
- 1,
3875
- f
3876
- );
3922
+ writer.writeString(1, f);
3877
3923
  }
3878
3924
  };
3879
3925
  proto.aggregator.KeyResp.prototype.getKey = function() {
@@ -3905,7 +3951,10 @@ var init_avs_pb = __esm({
3905
3951
  proto.aggregator.UpdateChecksReq.deserializeBinary = function(bytes) {
3906
3952
  var reader = new jspb.BinaryReader(bytes);
3907
3953
  var msg = new proto.aggregator.UpdateChecksReq();
3908
- return proto.aggregator.UpdateChecksReq.deserializeBinaryFromReader(msg, reader);
3954
+ return proto.aggregator.UpdateChecksReq.deserializeBinaryFromReader(
3955
+ msg,
3956
+ reader
3957
+ );
3909
3958
  };
3910
3959
  proto.aggregator.UpdateChecksReq.deserializeBinaryFromReader = function(msg, reader) {
3911
3960
  while (reader.nextField()) {
@@ -3951,24 +4000,15 @@ var init_avs_pb = __esm({
3951
4000
  var f = void 0;
3952
4001
  f = message.getAddress();
3953
4002
  if (f.length > 0) {
3954
- writer.writeString(
3955
- 1,
3956
- f
3957
- );
4003
+ writer.writeString(1, f);
3958
4004
  }
3959
4005
  f = message.getSignature();
3960
4006
  if (f.length > 0) {
3961
- writer.writeString(
3962
- 2,
3963
- f
3964
- );
4007
+ writer.writeString(2, f);
3965
4008
  }
3966
4009
  f = message.getIdList();
3967
4010
  if (f.length > 0) {
3968
- writer.writeRepeatedString(
3969
- 3,
3970
- f
3971
- );
4011
+ writer.writeRepeatedString(3, f);
3972
4012
  }
3973
4013
  };
3974
4014
  proto.aggregator.UpdateChecksReq.prototype.getAddress = function() {
@@ -4006,7 +4046,10 @@ var init_avs_pb = __esm({
4006
4046
  };
4007
4047
  if (jspb.Message.GENERATE_TO_OBJECT) {
4008
4048
  proto.aggregator.UpdateChecksResp.prototype.toObject = function(opt_includeInstance) {
4009
- return proto.aggregator.UpdateChecksResp.toObject(opt_includeInstance, this);
4049
+ return proto.aggregator.UpdateChecksResp.toObject(
4050
+ opt_includeInstance,
4051
+ this
4052
+ );
4010
4053
  };
4011
4054
  proto.aggregator.UpdateChecksResp.toObject = function(includeInstance, msg) {
4012
4055
  var f, obj = {
@@ -4021,7 +4064,10 @@ var init_avs_pb = __esm({
4021
4064
  proto.aggregator.UpdateChecksResp.deserializeBinary = function(bytes) {
4022
4065
  var reader = new jspb.BinaryReader(bytes);
4023
4066
  var msg = new proto.aggregator.UpdateChecksResp();
4024
- return proto.aggregator.UpdateChecksResp.deserializeBinaryFromReader(msg, reader);
4067
+ return proto.aggregator.UpdateChecksResp.deserializeBinaryFromReader(
4068
+ msg,
4069
+ reader
4070
+ );
4025
4071
  };
4026
4072
  proto.aggregator.UpdateChecksResp.deserializeBinaryFromReader = function(msg, reader) {
4027
4073
  while (reader.nextField()) {
@@ -4032,7 +4078,10 @@ var init_avs_pb = __esm({
4032
4078
  switch (field) {
4033
4079
  case 1:
4034
4080
  var value = new google_protobuf_timestamp_pb.Timestamp();
4035
- reader.readMessage(value, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
4081
+ reader.readMessage(
4082
+ value,
4083
+ google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader
4084
+ );
4036
4085
  msg.setUpdatedAt(value);
4037
4086
  break;
4038
4087
  default:
@@ -4061,7 +4110,11 @@ var init_avs_pb = __esm({
4061
4110
  proto.aggregator.UpdateChecksResp.prototype.getUpdatedAt = function() {
4062
4111
  return (
4063
4112
  /** @type{?proto.google.protobuf.Timestamp} */
4064
- jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1)
4113
+ jspb.Message.getWrapperField(
4114
+ this,
4115
+ google_protobuf_timestamp_pb.Timestamp,
4116
+ 1
4117
+ )
4065
4118
  );
4066
4119
  };
4067
4120
  proto.aggregator.UpdateChecksResp.prototype.setUpdatedAt = function(value) {
@@ -4097,12 +4150,35 @@ var init_avs_pb = __esm({
4097
4150
  JAVASCRIPT: 0
4098
4151
  };
4099
4152
  goog.object.extend(exports, proto.aggregator);
4100
- ({ Task, CreateTaskReq, CreateTaskResp, GetKeyReq, KeyResp, UpdateChecksReq, UpdateChecksResp } = proto.aggregator);
4153
+ ({
4154
+ Task,
4155
+ CreateTaskReq,
4156
+ CreateTaskResp,
4157
+ GetKeyReq,
4158
+ KeyResp,
4159
+ UpdateChecksReq,
4160
+ UpdateChecksResp,
4161
+ AddressResp,
4162
+ AddressRequest,
4163
+ ListTasksReq,
4164
+ ListTasksResp,
4165
+ TaskTrigger,
4166
+ TriggerType,
4167
+ ExpressionCondition,
4168
+ TaskAction,
4169
+ ActionType,
4170
+ ContractExecution,
4171
+ TaskType,
4172
+ UUID
4173
+ } = proto.aggregator);
4101
4174
  }
4102
4175
  });
4103
4176
 
4104
4177
  // src/index.ts
4178
+ import _ from "lodash";
4179
+ import { ethers } from "ethers";
4105
4180
  import * as grpc2 from "@grpc/grpc-js";
4181
+ import { Metadata as Metadata2 } from "@grpc/grpc-js";
4106
4182
 
4107
4183
  // src/auth.ts
4108
4184
  var getKeyRequestMessage = (address, expiredAt) => {
@@ -4416,17 +4492,46 @@ var AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
4416
4492
 
4417
4493
  // src/index.ts
4418
4494
  init_avs_pb();
4495
+
4496
+ // src/task.ts
4497
+ var Task2 = class {
4498
+ // result?: any;
4499
+ // error?: string;
4500
+ constructor(task) {
4501
+ this.id = task.getId();
4502
+ this.status = task.getStatus().toString();
4503
+ console.log("task.constructor:", task.toObject());
4504
+ }
4505
+ };
4506
+ var task_default = Task2;
4507
+
4508
+ // src/index.ts
4419
4509
  var metadata = new grpc2.Metadata();
4420
4510
  var BaseClient = class {
4421
- // protected wallet?: any;
4422
4511
  constructor(opts) {
4423
4512
  this.endpoint = opts.endpoint;
4424
4513
  this.rpcClient = new AggregatorClient(
4425
4514
  this.endpoint,
4426
- // TODO: switch to the TLS after we're able to update all the operator
4427
4515
  grpc2.credentials.createInsecure()
4428
4516
  );
4429
- console.log("this.rpcClient:", this.rpcClient);
4517
+ this.metadata = new Metadata2();
4518
+ }
4519
+ setAuthKey(jwtToken) {
4520
+ metadata.add("authkey", jwtToken);
4521
+ }
4522
+ isAuthenticated() {
4523
+ if (!metadata.get("authkey")) {
4524
+ return false;
4525
+ }
4526
+ try {
4527
+ const [, payload] = metadata.get("authkey")[0].toString().split(".");
4528
+ const decodedPayload = JSON.parse(atob(payload));
4529
+ const currentTimestamp = Math.floor(Date.now() / 1e3);
4530
+ return decodedPayload.exp > currentTimestamp;
4531
+ } catch (error) {
4532
+ console.error("Error validating JWT token:", error);
4533
+ return false;
4534
+ }
4430
4535
  }
4431
4536
  // async authWithJwtToken(
4432
4537
  // address: string,
@@ -4445,7 +4550,7 @@ var BaseClient = class {
4445
4550
  // expired_at: expirationTime,
4446
4551
  // signature: jwtToken,
4447
4552
  // });
4448
- // this.authkey = result.getKey();
4553
+ // this.jwtToken = result.getKey();
4449
4554
  // return { key: result.getKey() };
4450
4555
  // }
4451
4556
  // This flow can be used where the signature is generate from outside, such as in front-end and pass in
@@ -4464,12 +4569,8 @@ var BaseClient = class {
4464
4569
  "getKey",
4465
4570
  request
4466
4571
  );
4467
- console.log("result:", result);
4468
- this.authkey = result.getKey();
4469
- return { key: result.getKey() };
4470
- }
4471
- isAuthenticated() {
4472
- return !!this.authkey;
4572
+ this.setAuthKey(result.getKey());
4573
+ return { jwtToken: result.getKey() };
4473
4574
  }
4474
4575
  _callRPC(method, request) {
4475
4576
  return new Promise((resolve, reject) => {
@@ -4488,6 +4589,95 @@ var Client = class extends BaseClient {
4488
4589
  constructor(config) {
4489
4590
  super(config);
4490
4591
  }
4592
+ async getAddresses(address) {
4593
+ const request = new AddressRequest();
4594
+ request.setOwner(address);
4595
+ const result = await this._callRPC("getSmartAccountAddress", request);
4596
+ console.log("getAddresses.result:", result);
4597
+ return {
4598
+ owner: address,
4599
+ smart_account_address: result.getSmartAccountAddress()
4600
+ };
4601
+ }
4602
+ async createTask({
4603
+ address,
4604
+ oracleContract,
4605
+ tokenContract
4606
+ }) {
4607
+ const trigger = new TaskTrigger();
4608
+ trigger.setTriggerType(TriggerType.EXPRESSIONTRIGGER);
4609
+ trigger.setExpression(
4610
+ new ExpressionCondition().setExpression(`
4611
+ bigCmp(
4612
+ priceChainlink("${oracleContract}"),
4613
+ toBigInt("10000")
4614
+ ) > 0`)
4615
+ );
4616
+ const action = new TaskAction();
4617
+ action.setTaskType(TaskType.CONTRACTEXECUTIONTASK);
4618
+ action.setId("transfer_erc20_1");
4619
+ action.setName("Transfer Test Token");
4620
+ const execution = new ContractExecution();
4621
+ execution.setContractAddress(tokenContract);
4622
+ let ABI = ["function transfer(address to, uint amount)"];
4623
+ let iface = new ethers.Interface(ABI);
4624
+ const callData = iface.encodeFunctionData("transfer", [
4625
+ address,
4626
+ ethers.parseUnits("12", 18)
4627
+ ]);
4628
+ execution.setCallData(callData);
4629
+ console.log("execution:", execution.toObject());
4630
+ action.setContractExecution(execution);
4631
+ const request = new CreateTaskReq().setTrigger(trigger).setActionsList([action]).setExpiredAt(Math.floor(Date.now() / 1e3) + 1e6);
4632
+ const result = await this._callRPC("createTask", request);
4633
+ console.log("createTask.result:", result.toObject());
4634
+ return {
4635
+ id: result.getId()
4636
+ };
4637
+ }
4638
+ async listTasks(address) {
4639
+ const request = new ListTasksReq();
4640
+ const result = await this._callRPC("listTasks", request);
4641
+ console.log("listTasks.result:", result.toObject());
4642
+ const tasks = _.map(
4643
+ result.getTasksList(),
4644
+ (obj) => new task_default(obj)
4645
+ );
4646
+ console.log("listTasks.tasks:", tasks);
4647
+ return {
4648
+ tasks
4649
+ };
4650
+ }
4651
+ // TODO: specify the return type to match client’s requirements
4652
+ // Right now we simply return the original object from the server
4653
+ async getTask(id) {
4654
+ const request = new UUID();
4655
+ request.setBytes(id);
4656
+ const result = await this._callRPC(
4657
+ "getTask",
4658
+ request
4659
+ );
4660
+ console.log("getTask.result:", result.toObject());
4661
+ return result.toObject();
4662
+ }
4663
+ async cancelTask(id) {
4664
+ const request = new UUID();
4665
+ request.setBytes(id);
4666
+ const result = await this._callRPC(
4667
+ "cancelTask",
4668
+ request
4669
+ );
4670
+ return result.getValue();
4671
+ }
4672
+ async deleteTask(id) {
4673
+ const request = new UUID();
4674
+ request.setBytes(id);
4675
+ const result = await this._callRPC(
4676
+ "deleteTask",
4677
+ request
4678
+ );
4679
+ return result.getValue();
4680
+ }
4491
4681
  };
4492
4682
  export {
4493
4683
  Client as default,