@avaprotocol/sdk-js 1.3.1 → 1.3.3
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.d.mts +89 -19
- package/dist/index.d.ts +89 -19
- package/dist/index.js +347 -43
- package/dist/index.mjs +347 -43
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -53,6 +53,8 @@ var require_avs_pb = __commonJS({
|
|
|
53
53
|
}.call(null);
|
|
54
54
|
var google_protobuf_wrappers_pb = __require("google-protobuf/google/protobuf/wrappers_pb.js");
|
|
55
55
|
goog.object.extend(proto, google_protobuf_wrappers_pb);
|
|
56
|
+
var google_protobuf_timestamp_pb = __require("google-protobuf/google/protobuf/timestamp_pb.js");
|
|
57
|
+
goog.object.extend(proto, google_protobuf_timestamp_pb);
|
|
56
58
|
goog.exportSymbol("proto.aggregator.BlockCondition", null, global);
|
|
57
59
|
goog.exportSymbol("proto.aggregator.BranchNode", null, global);
|
|
58
60
|
goog.exportSymbol("proto.aggregator.Condition", null, global);
|
|
@@ -66,6 +68,7 @@ var require_avs_pb = __commonJS({
|
|
|
66
68
|
goog.exportSymbol("proto.aggregator.ETHTransferNode", null, global);
|
|
67
69
|
goog.exportSymbol("proto.aggregator.Error", null, global);
|
|
68
70
|
goog.exportSymbol("proto.aggregator.EventCondition", null, global);
|
|
71
|
+
goog.exportSymbol("proto.aggregator.EventCondition.Matcher", null, global);
|
|
69
72
|
goog.exportSymbol("proto.aggregator.Execution", null, global);
|
|
70
73
|
goog.exportSymbol("proto.aggregator.Execution.Step", null, global);
|
|
71
74
|
goog.exportSymbol("proto.aggregator.ExecutionReq", null, global);
|
|
@@ -132,12 +135,19 @@ var require_avs_pb = __commonJS({
|
|
|
132
135
|
proto.aggregator.BlockCondition.displayName = "proto.aggregator.BlockCondition";
|
|
133
136
|
}
|
|
134
137
|
proto.aggregator.EventCondition = function(opt_data) {
|
|
135
|
-
jspb.Message.initialize(this, opt_data, 0, -1,
|
|
138
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.EventCondition.repeatedFields_, null);
|
|
136
139
|
};
|
|
137
140
|
goog.inherits(proto.aggregator.EventCondition, jspb.Message);
|
|
138
141
|
if (goog.DEBUG && !COMPILED) {
|
|
139
142
|
proto.aggregator.EventCondition.displayName = "proto.aggregator.EventCondition";
|
|
140
143
|
}
|
|
144
|
+
proto.aggregator.EventCondition.Matcher = function(opt_data) {
|
|
145
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.EventCondition.Matcher.repeatedFields_, null);
|
|
146
|
+
};
|
|
147
|
+
goog.inherits(proto.aggregator.EventCondition.Matcher, jspb.Message);
|
|
148
|
+
if (goog.DEBUG && !COMPILED) {
|
|
149
|
+
proto.aggregator.EventCondition.Matcher.displayName = "proto.aggregator.EventCondition.Matcher";
|
|
150
|
+
}
|
|
141
151
|
proto.aggregator.TaskTrigger = function(opt_data) {
|
|
142
152
|
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.aggregator.TaskTrigger.oneofGroups_);
|
|
143
153
|
};
|
|
@@ -669,13 +679,19 @@ var require_avs_pb = __commonJS({
|
|
|
669
679
|
proto.aggregator.BlockCondition.prototype.setInterval = function(value) {
|
|
670
680
|
return jspb.Message.setProto3IntField(this, 1, value);
|
|
671
681
|
};
|
|
682
|
+
proto.aggregator.EventCondition.repeatedFields_ = [1];
|
|
672
683
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
673
684
|
proto.aggregator.EventCondition.prototype.toObject = function(opt_includeInstance) {
|
|
674
685
|
return proto.aggregator.EventCondition.toObject(opt_includeInstance, this);
|
|
675
686
|
};
|
|
676
687
|
proto.aggregator.EventCondition.toObject = function(includeInstance, msg) {
|
|
677
688
|
var f, obj = {
|
|
678
|
-
|
|
689
|
+
matcherList: jspb.Message.toObjectList(
|
|
690
|
+
msg.getMatcherList(),
|
|
691
|
+
proto.aggregator.EventCondition.Matcher.toObject,
|
|
692
|
+
includeInstance
|
|
693
|
+
),
|
|
694
|
+
expression: jspb.Message.getFieldWithDefault(msg, 2, "")
|
|
679
695
|
};
|
|
680
696
|
if (includeInstance) {
|
|
681
697
|
obj.$jspbMessageInstance = msg;
|
|
@@ -696,6 +712,11 @@ var require_avs_pb = __commonJS({
|
|
|
696
712
|
var field = reader.getFieldNumber();
|
|
697
713
|
switch (field) {
|
|
698
714
|
case 1:
|
|
715
|
+
var value = new proto.aggregator.EventCondition.Matcher();
|
|
716
|
+
reader.readMessage(value, proto.aggregator.EventCondition.Matcher.deserializeBinaryFromReader);
|
|
717
|
+
msg.addMatcher(value);
|
|
718
|
+
break;
|
|
719
|
+
case 2:
|
|
699
720
|
var value = (
|
|
700
721
|
/** @type {string} */
|
|
701
722
|
reader.readString()
|
|
@@ -716,23 +737,141 @@ var require_avs_pb = __commonJS({
|
|
|
716
737
|
};
|
|
717
738
|
proto.aggregator.EventCondition.serializeBinaryToWriter = function(message, writer) {
|
|
718
739
|
var f = void 0;
|
|
740
|
+
f = message.getMatcherList();
|
|
741
|
+
if (f.length > 0) {
|
|
742
|
+
writer.writeRepeatedMessage(
|
|
743
|
+
1,
|
|
744
|
+
f,
|
|
745
|
+
proto.aggregator.EventCondition.Matcher.serializeBinaryToWriter
|
|
746
|
+
);
|
|
747
|
+
}
|
|
719
748
|
f = message.getExpression();
|
|
749
|
+
if (f.length > 0) {
|
|
750
|
+
writer.writeString(
|
|
751
|
+
2,
|
|
752
|
+
f
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
proto.aggregator.EventCondition.Matcher.repeatedFields_ = [2];
|
|
757
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
758
|
+
proto.aggregator.EventCondition.Matcher.prototype.toObject = function(opt_includeInstance) {
|
|
759
|
+
return proto.aggregator.EventCondition.Matcher.toObject(opt_includeInstance, this);
|
|
760
|
+
};
|
|
761
|
+
proto.aggregator.EventCondition.Matcher.toObject = function(includeInstance, msg) {
|
|
762
|
+
var f, obj = {
|
|
763
|
+
type: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
764
|
+
valueList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? void 0 : f
|
|
765
|
+
};
|
|
766
|
+
if (includeInstance) {
|
|
767
|
+
obj.$jspbMessageInstance = msg;
|
|
768
|
+
}
|
|
769
|
+
return obj;
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
proto.aggregator.EventCondition.Matcher.deserializeBinary = function(bytes) {
|
|
773
|
+
var reader = new jspb.BinaryReader(bytes);
|
|
774
|
+
var msg = new proto.aggregator.EventCondition.Matcher();
|
|
775
|
+
return proto.aggregator.EventCondition.Matcher.deserializeBinaryFromReader(msg, reader);
|
|
776
|
+
};
|
|
777
|
+
proto.aggregator.EventCondition.Matcher.deserializeBinaryFromReader = function(msg, reader) {
|
|
778
|
+
while (reader.nextField()) {
|
|
779
|
+
if (reader.isEndGroup()) {
|
|
780
|
+
break;
|
|
781
|
+
}
|
|
782
|
+
var field = reader.getFieldNumber();
|
|
783
|
+
switch (field) {
|
|
784
|
+
case 1:
|
|
785
|
+
var value = (
|
|
786
|
+
/** @type {string} */
|
|
787
|
+
reader.readString()
|
|
788
|
+
);
|
|
789
|
+
msg.setType(value);
|
|
790
|
+
break;
|
|
791
|
+
case 2:
|
|
792
|
+
var value = (
|
|
793
|
+
/** @type {string} */
|
|
794
|
+
reader.readString()
|
|
795
|
+
);
|
|
796
|
+
msg.addValue(value);
|
|
797
|
+
break;
|
|
798
|
+
default:
|
|
799
|
+
reader.skipField();
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
return msg;
|
|
804
|
+
};
|
|
805
|
+
proto.aggregator.EventCondition.Matcher.prototype.serializeBinary = function() {
|
|
806
|
+
var writer = new jspb.BinaryWriter();
|
|
807
|
+
proto.aggregator.EventCondition.Matcher.serializeBinaryToWriter(this, writer);
|
|
808
|
+
return writer.getResultBuffer();
|
|
809
|
+
};
|
|
810
|
+
proto.aggregator.EventCondition.Matcher.serializeBinaryToWriter = function(message, writer) {
|
|
811
|
+
var f = void 0;
|
|
812
|
+
f = message.getType();
|
|
720
813
|
if (f.length > 0) {
|
|
721
814
|
writer.writeString(
|
|
722
815
|
1,
|
|
723
816
|
f
|
|
724
817
|
);
|
|
725
818
|
}
|
|
819
|
+
f = message.getValueList();
|
|
820
|
+
if (f.length > 0) {
|
|
821
|
+
writer.writeRepeatedString(
|
|
822
|
+
2,
|
|
823
|
+
f
|
|
824
|
+
);
|
|
825
|
+
}
|
|
726
826
|
};
|
|
727
|
-
proto.aggregator.EventCondition.prototype.
|
|
827
|
+
proto.aggregator.EventCondition.Matcher.prototype.getType = function() {
|
|
728
828
|
return (
|
|
729
829
|
/** @type {string} */
|
|
730
830
|
jspb.Message.getFieldWithDefault(this, 1, "")
|
|
731
831
|
);
|
|
732
832
|
};
|
|
733
|
-
proto.aggregator.EventCondition.prototype.
|
|
833
|
+
proto.aggregator.EventCondition.Matcher.prototype.setType = function(value) {
|
|
734
834
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
735
835
|
};
|
|
836
|
+
proto.aggregator.EventCondition.Matcher.prototype.getValueList = function() {
|
|
837
|
+
return (
|
|
838
|
+
/** @type {!Array<string>} */
|
|
839
|
+
jspb.Message.getRepeatedField(this, 2)
|
|
840
|
+
);
|
|
841
|
+
};
|
|
842
|
+
proto.aggregator.EventCondition.Matcher.prototype.setValueList = function(value) {
|
|
843
|
+
return jspb.Message.setField(this, 2, value || []);
|
|
844
|
+
};
|
|
845
|
+
proto.aggregator.EventCondition.Matcher.prototype.addValue = function(value, opt_index) {
|
|
846
|
+
return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
|
|
847
|
+
};
|
|
848
|
+
proto.aggregator.EventCondition.Matcher.prototype.clearValueList = function() {
|
|
849
|
+
return this.setValueList([]);
|
|
850
|
+
};
|
|
851
|
+
proto.aggregator.EventCondition.prototype.getMatcherList = function() {
|
|
852
|
+
return (
|
|
853
|
+
/** @type{!Array<!proto.aggregator.EventCondition.Matcher>} */
|
|
854
|
+
jspb.Message.getRepeatedWrapperField(this, proto.aggregator.EventCondition.Matcher, 1)
|
|
855
|
+
);
|
|
856
|
+
};
|
|
857
|
+
proto.aggregator.EventCondition.prototype.setMatcherList = function(value) {
|
|
858
|
+
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
|
859
|
+
};
|
|
860
|
+
proto.aggregator.EventCondition.prototype.addMatcher = function(opt_value, opt_index) {
|
|
861
|
+
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.aggregator.EventCondition.Matcher, opt_index);
|
|
862
|
+
};
|
|
863
|
+
proto.aggregator.EventCondition.prototype.clearMatcherList = function() {
|
|
864
|
+
return this.setMatcherList([]);
|
|
865
|
+
};
|
|
866
|
+
proto.aggregator.EventCondition.prototype.getExpression = function() {
|
|
867
|
+
return (
|
|
868
|
+
/** @type {string} */
|
|
869
|
+
jspb.Message.getFieldWithDefault(this, 2, "")
|
|
870
|
+
);
|
|
871
|
+
};
|
|
872
|
+
proto.aggregator.EventCondition.prototype.setExpression = function(value) {
|
|
873
|
+
return jspb.Message.setProto3StringField(this, 2, value);
|
|
874
|
+
};
|
|
736
875
|
proto.aggregator.TaskTrigger.oneofGroups_ = [[2, 3, 4, 5, 6]];
|
|
737
876
|
proto.aggregator.TaskTrigger.TriggerTypeCase = {
|
|
738
877
|
TRIGGER_TYPE_NOT_SET: 0,
|
|
@@ -759,7 +898,8 @@ var require_avs_pb = __commonJS({
|
|
|
759
898
|
fixedTime: (f = msg.getFixedTime()) && proto.aggregator.FixedTimeCondition.toObject(includeInstance, f),
|
|
760
899
|
cron: (f = msg.getCron()) && proto.aggregator.CronCondition.toObject(includeInstance, f),
|
|
761
900
|
block: (f = msg.getBlock()) && proto.aggregator.BlockCondition.toObject(includeInstance, f),
|
|
762
|
-
event: (f = msg.getEvent()) && proto.aggregator.EventCondition.toObject(includeInstance, f)
|
|
901
|
+
event: (f = msg.getEvent()) && proto.aggregator.EventCondition.toObject(includeInstance, f),
|
|
902
|
+
id: jspb.Message.getFieldWithDefault(msg, 7, "")
|
|
763
903
|
};
|
|
764
904
|
if (includeInstance) {
|
|
765
905
|
obj.$jspbMessageInstance = msg;
|
|
@@ -813,6 +953,13 @@ var require_avs_pb = __commonJS({
|
|
|
813
953
|
reader.readMessage(value, proto.aggregator.EventCondition.deserializeBinaryFromReader);
|
|
814
954
|
msg.setEvent(value);
|
|
815
955
|
break;
|
|
956
|
+
case 7:
|
|
957
|
+
var value = (
|
|
958
|
+
/** @type {string} */
|
|
959
|
+
reader.readString()
|
|
960
|
+
);
|
|
961
|
+
msg.setId(value);
|
|
962
|
+
break;
|
|
816
963
|
default:
|
|
817
964
|
reader.skipField();
|
|
818
965
|
break;
|
|
@@ -874,6 +1021,13 @@ var require_avs_pb = __commonJS({
|
|
|
874
1021
|
proto.aggregator.EventCondition.serializeBinaryToWriter
|
|
875
1022
|
);
|
|
876
1023
|
}
|
|
1024
|
+
f = message.getId();
|
|
1025
|
+
if (f.length > 0) {
|
|
1026
|
+
writer.writeString(
|
|
1027
|
+
7,
|
|
1028
|
+
f
|
|
1029
|
+
);
|
|
1030
|
+
}
|
|
877
1031
|
};
|
|
878
1032
|
proto.aggregator.TaskTrigger.prototype.getName = function() {
|
|
879
1033
|
return (
|
|
@@ -959,6 +1113,15 @@ var require_avs_pb = __commonJS({
|
|
|
959
1113
|
proto.aggregator.TaskTrigger.prototype.hasEvent = function() {
|
|
960
1114
|
return jspb.Message.getField(this, 6) != null;
|
|
961
1115
|
};
|
|
1116
|
+
proto.aggregator.TaskTrigger.prototype.getId = function() {
|
|
1117
|
+
return (
|
|
1118
|
+
/** @type {string} */
|
|
1119
|
+
jspb.Message.getFieldWithDefault(this, 7, "")
|
|
1120
|
+
);
|
|
1121
|
+
};
|
|
1122
|
+
proto.aggregator.TaskTrigger.prototype.setId = function(value) {
|
|
1123
|
+
return jspb.Message.setProto3StringField(this, 7, value);
|
|
1124
|
+
};
|
|
962
1125
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
963
1126
|
proto.aggregator.ETHTransferNode.prototype.toObject = function(opt_includeInstance) {
|
|
964
1127
|
return proto.aggregator.ETHTransferNode.toObject(opt_includeInstance, this);
|
|
@@ -1827,7 +1990,8 @@ var require_avs_pb = __commonJS({
|
|
|
1827
1990
|
};
|
|
1828
1991
|
proto.aggregator.FilterNode.toObject = function(includeInstance, msg) {
|
|
1829
1992
|
var f, obj = {
|
|
1830
|
-
expression: jspb.Message.getFieldWithDefault(msg, 1, "")
|
|
1993
|
+
expression: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
1994
|
+
input: jspb.Message.getFieldWithDefault(msg, 2, "")
|
|
1831
1995
|
};
|
|
1832
1996
|
if (includeInstance) {
|
|
1833
1997
|
obj.$jspbMessageInstance = msg;
|
|
@@ -1854,6 +2018,13 @@ var require_avs_pb = __commonJS({
|
|
|
1854
2018
|
);
|
|
1855
2019
|
msg.setExpression(value);
|
|
1856
2020
|
break;
|
|
2021
|
+
case 2:
|
|
2022
|
+
var value = (
|
|
2023
|
+
/** @type {string} */
|
|
2024
|
+
reader.readString()
|
|
2025
|
+
);
|
|
2026
|
+
msg.setInput(value);
|
|
2027
|
+
break;
|
|
1857
2028
|
default:
|
|
1858
2029
|
reader.skipField();
|
|
1859
2030
|
break;
|
|
@@ -1875,6 +2046,13 @@ var require_avs_pb = __commonJS({
|
|
|
1875
2046
|
f
|
|
1876
2047
|
);
|
|
1877
2048
|
}
|
|
2049
|
+
f = message.getInput();
|
|
2050
|
+
if (f.length > 0) {
|
|
2051
|
+
writer.writeString(
|
|
2052
|
+
2,
|
|
2053
|
+
f
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
1878
2056
|
};
|
|
1879
2057
|
proto.aggregator.FilterNode.prototype.getExpression = function() {
|
|
1880
2058
|
return (
|
|
@@ -1885,6 +2063,15 @@ var require_avs_pb = __commonJS({
|
|
|
1885
2063
|
proto.aggregator.FilterNode.prototype.setExpression = function(value) {
|
|
1886
2064
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
1887
2065
|
};
|
|
2066
|
+
proto.aggregator.FilterNode.prototype.getInput = function() {
|
|
2067
|
+
return (
|
|
2068
|
+
/** @type {string} */
|
|
2069
|
+
jspb.Message.getFieldWithDefault(this, 2, "")
|
|
2070
|
+
);
|
|
2071
|
+
};
|
|
2072
|
+
proto.aggregator.FilterNode.prototype.setInput = function(value) {
|
|
2073
|
+
return jspb.Message.setProto3StringField(this, 2, value);
|
|
2074
|
+
};
|
|
1888
2075
|
proto.aggregator.LoopNode.oneofGroups_ = [[10, 11, 12, 13, 14, 15]];
|
|
1889
2076
|
proto.aggregator.LoopNode.RunnerCase = {
|
|
1890
2077
|
RUNNER_NOT_SET: 0,
|
|
@@ -3134,7 +3321,7 @@ var require_avs_pb = __commonJS({
|
|
|
3134
3321
|
smartWalletAddress: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
3135
3322
|
startAt: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
3136
3323
|
expiredAt: jspb.Message.getFieldWithDefault(msg, 5, 0),
|
|
3137
|
-
|
|
3324
|
+
name: jspb.Message.getFieldWithDefault(msg, 6, ""),
|
|
3138
3325
|
completedAt: jspb.Message.getFieldWithDefault(msg, 7, 0),
|
|
3139
3326
|
maxExecution: jspb.Message.getFieldWithDefault(msg, 8, 0),
|
|
3140
3327
|
totalExecution: jspb.Message.getFieldWithDefault(msg, 9, 0),
|
|
@@ -3210,7 +3397,7 @@ var require_avs_pb = __commonJS({
|
|
|
3210
3397
|
/** @type {string} */
|
|
3211
3398
|
reader.readString()
|
|
3212
3399
|
);
|
|
3213
|
-
msg.
|
|
3400
|
+
msg.setName(value);
|
|
3214
3401
|
break;
|
|
3215
3402
|
case 7:
|
|
3216
3403
|
var value = (
|
|
@@ -3311,7 +3498,7 @@ var require_avs_pb = __commonJS({
|
|
|
3311
3498
|
f
|
|
3312
3499
|
);
|
|
3313
3500
|
}
|
|
3314
|
-
f = message.
|
|
3501
|
+
f = message.getName();
|
|
3315
3502
|
if (f.length > 0) {
|
|
3316
3503
|
writer.writeString(
|
|
3317
3504
|
6,
|
|
@@ -3423,13 +3610,13 @@ var require_avs_pb = __commonJS({
|
|
|
3423
3610
|
proto.aggregator.Task.prototype.setExpiredAt = function(value) {
|
|
3424
3611
|
return jspb.Message.setProto3IntField(this, 5, value);
|
|
3425
3612
|
};
|
|
3426
|
-
proto.aggregator.Task.prototype.
|
|
3613
|
+
proto.aggregator.Task.prototype.getName = function() {
|
|
3427
3614
|
return (
|
|
3428
3615
|
/** @type {string} */
|
|
3429
3616
|
jspb.Message.getFieldWithDefault(this, 6, "")
|
|
3430
3617
|
);
|
|
3431
3618
|
};
|
|
3432
|
-
proto.aggregator.Task.prototype.
|
|
3619
|
+
proto.aggregator.Task.prototype.setName = function(value) {
|
|
3433
3620
|
return jspb.Message.setProto3StringField(this, 6, value);
|
|
3434
3621
|
};
|
|
3435
3622
|
proto.aggregator.Task.prototype.getCompletedAt = function() {
|
|
@@ -3534,7 +3721,7 @@ var require_avs_pb = __commonJS({
|
|
|
3534
3721
|
expiredAt: jspb.Message.getFieldWithDefault(msg, 3, 0),
|
|
3535
3722
|
maxExecution: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
3536
3723
|
smartWalletAddress: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
|
3537
|
-
|
|
3724
|
+
name: jspb.Message.getFieldWithDefault(msg, 6, ""),
|
|
3538
3725
|
nodesList: jspb.Message.toObjectList(
|
|
3539
3726
|
msg.getNodesList(),
|
|
3540
3727
|
proto.aggregator.TaskNode.toObject,
|
|
@@ -3602,7 +3789,7 @@ var require_avs_pb = __commonJS({
|
|
|
3602
3789
|
/** @type {string} */
|
|
3603
3790
|
reader.readString()
|
|
3604
3791
|
);
|
|
3605
|
-
msg.
|
|
3792
|
+
msg.setName(value);
|
|
3606
3793
|
break;
|
|
3607
3794
|
case 7:
|
|
3608
3795
|
var value = new proto.aggregator.TaskNode();
|
|
@@ -3664,7 +3851,7 @@ var require_avs_pb = __commonJS({
|
|
|
3664
3851
|
f
|
|
3665
3852
|
);
|
|
3666
3853
|
}
|
|
3667
|
-
f = message.
|
|
3854
|
+
f = message.getName();
|
|
3668
3855
|
if (f.length > 0) {
|
|
3669
3856
|
writer.writeString(
|
|
3670
3857
|
6,
|
|
@@ -3739,13 +3926,13 @@ var require_avs_pb = __commonJS({
|
|
|
3739
3926
|
proto.aggregator.CreateTaskReq.prototype.setSmartWalletAddress = function(value) {
|
|
3740
3927
|
return jspb.Message.setProto3StringField(this, 5, value);
|
|
3741
3928
|
};
|
|
3742
|
-
proto.aggregator.CreateTaskReq.prototype.
|
|
3929
|
+
proto.aggregator.CreateTaskReq.prototype.getName = function() {
|
|
3743
3930
|
return (
|
|
3744
3931
|
/** @type {string} */
|
|
3745
3932
|
jspb.Message.getFieldWithDefault(this, 6, "")
|
|
3746
3933
|
);
|
|
3747
3934
|
};
|
|
3748
|
-
proto.aggregator.CreateTaskReq.prototype.
|
|
3935
|
+
proto.aggregator.CreateTaskReq.prototype.setName = function(value) {
|
|
3749
3936
|
return jspb.Message.setProto3StringField(this, 6, value);
|
|
3750
3937
|
};
|
|
3751
3938
|
proto.aggregator.CreateTaskReq.prototype.getNodesList = function() {
|
|
@@ -4463,7 +4650,7 @@ var require_avs_pb = __commonJS({
|
|
|
4463
4650
|
smartWalletAddress: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
4464
4651
|
startAt: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
4465
4652
|
expiredAt: jspb.Message.getFieldWithDefault(msg, 5, 0),
|
|
4466
|
-
|
|
4653
|
+
name: jspb.Message.getFieldWithDefault(msg, 6, ""),
|
|
4467
4654
|
completedAt: jspb.Message.getFieldWithDefault(msg, 7, 0),
|
|
4468
4655
|
maxExecution: jspb.Message.getFieldWithDefault(msg, 8, 0),
|
|
4469
4656
|
totalExecution: jspb.Message.getFieldWithDefault(msg, 9, 0),
|
|
@@ -4529,7 +4716,7 @@ var require_avs_pb = __commonJS({
|
|
|
4529
4716
|
/** @type {string} */
|
|
4530
4717
|
reader.readString()
|
|
4531
4718
|
);
|
|
4532
|
-
msg.
|
|
4719
|
+
msg.setName(value);
|
|
4533
4720
|
break;
|
|
4534
4721
|
case 7:
|
|
4535
4722
|
var value = (
|
|
@@ -4620,7 +4807,7 @@ var require_avs_pb = __commonJS({
|
|
|
4620
4807
|
f
|
|
4621
4808
|
);
|
|
4622
4809
|
}
|
|
4623
|
-
f = message.
|
|
4810
|
+
f = message.getName();
|
|
4624
4811
|
if (f.length > 0) {
|
|
4625
4812
|
writer.writeString(
|
|
4626
4813
|
6,
|
|
@@ -4716,13 +4903,13 @@ var require_avs_pb = __commonJS({
|
|
|
4716
4903
|
proto.aggregator.ListTasksResp.Item.prototype.setExpiredAt = function(value) {
|
|
4717
4904
|
return jspb.Message.setProto3IntField(this, 5, value);
|
|
4718
4905
|
};
|
|
4719
|
-
proto.aggregator.ListTasksResp.Item.prototype.
|
|
4906
|
+
proto.aggregator.ListTasksResp.Item.prototype.getName = function() {
|
|
4720
4907
|
return (
|
|
4721
4908
|
/** @type {string} */
|
|
4722
4909
|
jspb.Message.getFieldWithDefault(this, 6, "")
|
|
4723
4910
|
);
|
|
4724
4911
|
};
|
|
4725
|
-
proto.aggregator.ListTasksResp.Item.prototype.
|
|
4912
|
+
proto.aggregator.ListTasksResp.Item.prototype.setName = function(value) {
|
|
4726
4913
|
return jspb.Message.setProto3StringField(this, 6, value);
|
|
4727
4914
|
};
|
|
4728
4915
|
proto.aggregator.ListTasksResp.Item.prototype.getCompletedAt = function() {
|
|
@@ -5218,8 +5405,10 @@ var require_avs_pb = __commonJS({
|
|
|
5218
5405
|
proto.aggregator.GetKeyReq.toObject = function(includeInstance, msg) {
|
|
5219
5406
|
var f, obj = {
|
|
5220
5407
|
owner: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
5221
|
-
|
|
5222
|
-
|
|
5408
|
+
chainId: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
|
5409
|
+
issuedAt: (f = msg.getIssuedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
|
|
5410
|
+
expiredAt: (f = msg.getExpiredAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
|
|
5411
|
+
signature: jspb.Message.getFieldWithDefault(msg, 5, "")
|
|
5223
5412
|
};
|
|
5224
5413
|
if (includeInstance) {
|
|
5225
5414
|
obj.$jspbMessageInstance = msg;
|
|
@@ -5251,9 +5440,19 @@ var require_avs_pb = __commonJS({
|
|
|
5251
5440
|
/** @type {number} */
|
|
5252
5441
|
reader.readInt64()
|
|
5253
5442
|
);
|
|
5254
|
-
msg.
|
|
5443
|
+
msg.setChainId(value);
|
|
5255
5444
|
break;
|
|
5256
5445
|
case 3:
|
|
5446
|
+
var value = new google_protobuf_timestamp_pb.Timestamp();
|
|
5447
|
+
reader.readMessage(value, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
|
|
5448
|
+
msg.setIssuedAt(value);
|
|
5449
|
+
break;
|
|
5450
|
+
case 4:
|
|
5451
|
+
var value = new google_protobuf_timestamp_pb.Timestamp();
|
|
5452
|
+
reader.readMessage(value, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
|
|
5453
|
+
msg.setExpiredAt(value);
|
|
5454
|
+
break;
|
|
5455
|
+
case 5:
|
|
5257
5456
|
var value = (
|
|
5258
5457
|
/** @type {string} */
|
|
5259
5458
|
reader.readString()
|
|
@@ -5281,17 +5480,33 @@ var require_avs_pb = __commonJS({
|
|
|
5281
5480
|
f
|
|
5282
5481
|
);
|
|
5283
5482
|
}
|
|
5284
|
-
f = message.
|
|
5483
|
+
f = message.getChainId();
|
|
5285
5484
|
if (f !== 0) {
|
|
5286
5485
|
writer.writeInt64(
|
|
5287
5486
|
2,
|
|
5288
5487
|
f
|
|
5289
5488
|
);
|
|
5290
5489
|
}
|
|
5490
|
+
f = message.getIssuedAt();
|
|
5491
|
+
if (f != null) {
|
|
5492
|
+
writer.writeMessage(
|
|
5493
|
+
3,
|
|
5494
|
+
f,
|
|
5495
|
+
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
|
|
5496
|
+
);
|
|
5497
|
+
}
|
|
5498
|
+
f = message.getExpiredAt();
|
|
5499
|
+
if (f != null) {
|
|
5500
|
+
writer.writeMessage(
|
|
5501
|
+
4,
|
|
5502
|
+
f,
|
|
5503
|
+
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
|
|
5504
|
+
);
|
|
5505
|
+
}
|
|
5291
5506
|
f = message.getSignature();
|
|
5292
5507
|
if (f.length > 0) {
|
|
5293
5508
|
writer.writeString(
|
|
5294
|
-
|
|
5509
|
+
5,
|
|
5295
5510
|
f
|
|
5296
5511
|
);
|
|
5297
5512
|
}
|
|
@@ -5305,23 +5520,53 @@ var require_avs_pb = __commonJS({
|
|
|
5305
5520
|
proto.aggregator.GetKeyReq.prototype.setOwner = function(value) {
|
|
5306
5521
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
5307
5522
|
};
|
|
5308
|
-
proto.aggregator.GetKeyReq.prototype.
|
|
5523
|
+
proto.aggregator.GetKeyReq.prototype.getChainId = function() {
|
|
5309
5524
|
return (
|
|
5310
5525
|
/** @type {number} */
|
|
5311
5526
|
jspb.Message.getFieldWithDefault(this, 2, 0)
|
|
5312
5527
|
);
|
|
5313
5528
|
};
|
|
5314
|
-
proto.aggregator.GetKeyReq.prototype.
|
|
5529
|
+
proto.aggregator.GetKeyReq.prototype.setChainId = function(value) {
|
|
5315
5530
|
return jspb.Message.setProto3IntField(this, 2, value);
|
|
5316
5531
|
};
|
|
5532
|
+
proto.aggregator.GetKeyReq.prototype.getIssuedAt = function() {
|
|
5533
|
+
return (
|
|
5534
|
+
/** @type{?proto.google.protobuf.Timestamp} */
|
|
5535
|
+
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)
|
|
5536
|
+
);
|
|
5537
|
+
};
|
|
5538
|
+
proto.aggregator.GetKeyReq.prototype.setIssuedAt = function(value) {
|
|
5539
|
+
return jspb.Message.setWrapperField(this, 3, value);
|
|
5540
|
+
};
|
|
5541
|
+
proto.aggregator.GetKeyReq.prototype.clearIssuedAt = function() {
|
|
5542
|
+
return this.setIssuedAt(void 0);
|
|
5543
|
+
};
|
|
5544
|
+
proto.aggregator.GetKeyReq.prototype.hasIssuedAt = function() {
|
|
5545
|
+
return jspb.Message.getField(this, 3) != null;
|
|
5546
|
+
};
|
|
5547
|
+
proto.aggregator.GetKeyReq.prototype.getExpiredAt = function() {
|
|
5548
|
+
return (
|
|
5549
|
+
/** @type{?proto.google.protobuf.Timestamp} */
|
|
5550
|
+
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4)
|
|
5551
|
+
);
|
|
5552
|
+
};
|
|
5553
|
+
proto.aggregator.GetKeyReq.prototype.setExpiredAt = function(value) {
|
|
5554
|
+
return jspb.Message.setWrapperField(this, 4, value);
|
|
5555
|
+
};
|
|
5556
|
+
proto.aggregator.GetKeyReq.prototype.clearExpiredAt = function() {
|
|
5557
|
+
return this.setExpiredAt(void 0);
|
|
5558
|
+
};
|
|
5559
|
+
proto.aggregator.GetKeyReq.prototype.hasExpiredAt = function() {
|
|
5560
|
+
return jspb.Message.getField(this, 4) != null;
|
|
5561
|
+
};
|
|
5317
5562
|
proto.aggregator.GetKeyReq.prototype.getSignature = function() {
|
|
5318
5563
|
return (
|
|
5319
5564
|
/** @type {string} */
|
|
5320
|
-
jspb.Message.getFieldWithDefault(this,
|
|
5565
|
+
jspb.Message.getFieldWithDefault(this, 5, "")
|
|
5321
5566
|
);
|
|
5322
5567
|
};
|
|
5323
5568
|
proto.aggregator.GetKeyReq.prototype.setSignature = function(value) {
|
|
5324
|
-
return jspb.Message.setProto3StringField(this,
|
|
5569
|
+
return jspb.Message.setProto3StringField(this, 5, value);
|
|
5325
5570
|
};
|
|
5326
5571
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
5327
5572
|
proto.aggregator.KeyResp.prototype.toObject = function(opt_includeInstance) {
|
|
@@ -5996,6 +6241,7 @@ var require_avs_grpc_pb = __commonJS({
|
|
|
5996
6241
|
var grpc2 = __require("@grpc/grpc-js");
|
|
5997
6242
|
var avs_pb20 = require_avs_pb();
|
|
5998
6243
|
var google_protobuf_wrappers_pb = __require("google-protobuf/google/protobuf/wrappers_pb.js");
|
|
6244
|
+
var google_protobuf_timestamp_pb = __require("google-protobuf/google/protobuf/timestamp_pb.js");
|
|
5999
6245
|
function serialize_aggregator_CreateTaskReq(arg) {
|
|
6000
6246
|
if (!(arg instanceof avs_pb20.CreateTaskReq)) {
|
|
6001
6247
|
throw new Error("Expected argument of type aggregator.CreateTaskReq");
|
|
@@ -6352,13 +6598,21 @@ import * as grpc from "@grpc/grpc-js";
|
|
|
6352
6598
|
import { Metadata } from "@grpc/grpc-js";
|
|
6353
6599
|
|
|
6354
6600
|
// src/auth.ts
|
|
6355
|
-
var getKeyRequestMessage = (address, expiredAt) => {
|
|
6356
|
-
return `
|
|
6601
|
+
var getKeyRequestMessage = (chainId, address, issuedAt, expiredAt) => {
|
|
6602
|
+
return `Please sign the below text for ownership verification.
|
|
6603
|
+
|
|
6604
|
+
URI: https://app.avaprotocol.org
|
|
6605
|
+
Chain ID: ${chainId}
|
|
6606
|
+
Version: 1
|
|
6607
|
+
Issued At: ${issuedAt.toISOString()}
|
|
6608
|
+
Expire At: ${expiredAt.toISOString()}
|
|
6609
|
+
Wallet: ${address}`;
|
|
6357
6610
|
};
|
|
6358
6611
|
|
|
6359
6612
|
// src/index.ts
|
|
6360
6613
|
var import_avs_grpc_pb = __toESM(require_avs_grpc_pb());
|
|
6361
6614
|
var avs_pb19 = __toESM(require_avs_pb());
|
|
6615
|
+
import { Timestamp } from "google-protobuf/google/protobuf/timestamp_pb";
|
|
6362
6616
|
|
|
6363
6617
|
// src/models/workflow.ts
|
|
6364
6618
|
var avs_pb15 = __toESM(require_avs_pb());
|
|
@@ -6395,6 +6649,7 @@ var Trigger = class {
|
|
|
6395
6649
|
* @param props
|
|
6396
6650
|
*/
|
|
6397
6651
|
constructor(props) {
|
|
6652
|
+
this.id = props.id;
|
|
6398
6653
|
this.name = props.name;
|
|
6399
6654
|
this.type = props.type;
|
|
6400
6655
|
this.data = props.data;
|
|
@@ -6436,6 +6691,7 @@ var BlockTrigger = class _BlockTrigger extends interface_default {
|
|
|
6436
6691
|
toRequest() {
|
|
6437
6692
|
const request = new avs_pb3.TaskTrigger();
|
|
6438
6693
|
request.setName(this.name);
|
|
6694
|
+
request.setId(this.id);
|
|
6439
6695
|
if (!this.data) {
|
|
6440
6696
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6441
6697
|
}
|
|
@@ -6469,6 +6725,7 @@ var CronTrigger = class _CronTrigger extends interface_default {
|
|
|
6469
6725
|
toRequest() {
|
|
6470
6726
|
const request = new avs_pb4.TaskTrigger();
|
|
6471
6727
|
request.setName(this.name);
|
|
6728
|
+
request.setId(this.id);
|
|
6472
6729
|
if (!this.data) {
|
|
6473
6730
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6474
6731
|
}
|
|
@@ -6504,11 +6761,25 @@ var EventTrigger = class _EventTrigger extends interface_default {
|
|
|
6504
6761
|
toRequest() {
|
|
6505
6762
|
const request = new avs_pb5.TaskTrigger();
|
|
6506
6763
|
request.setName(this.name);
|
|
6764
|
+
request.setId(this.id);
|
|
6507
6765
|
if (!this.data) {
|
|
6508
6766
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6509
6767
|
}
|
|
6510
6768
|
const condition = new avs_pb5.EventCondition();
|
|
6511
|
-
|
|
6769
|
+
const expression = this.data.expression;
|
|
6770
|
+
const matcher = this.data.matcher;
|
|
6771
|
+
if (expression && expression != "") {
|
|
6772
|
+
condition.setExpression(expression);
|
|
6773
|
+
}
|
|
6774
|
+
if (matcher && matcher.length >= 1) {
|
|
6775
|
+
console.log("hit here", matcher);
|
|
6776
|
+
condition.setMatcherList(matcher.map((element) => {
|
|
6777
|
+
const m = new avs_pb5.EventCondition.Matcher();
|
|
6778
|
+
m.setType(element["type"]);
|
|
6779
|
+
m.setValueList(element["value"]);
|
|
6780
|
+
return m;
|
|
6781
|
+
}));
|
|
6782
|
+
}
|
|
6512
6783
|
request.setEvent(condition);
|
|
6513
6784
|
console.log("EventTrigger.toRequest.request:", request.toObject());
|
|
6514
6785
|
return request;
|
|
@@ -6516,10 +6787,22 @@ var EventTrigger = class _EventTrigger extends interface_default {
|
|
|
6516
6787
|
static fromResponse(raw) {
|
|
6517
6788
|
const obj = raw.toObject();
|
|
6518
6789
|
console.log("EventTrigger.fromResponse.obj:", obj);
|
|
6790
|
+
let data = {};
|
|
6791
|
+
if (raw.getEvent().getExpression()) {
|
|
6792
|
+
data.expression = raw.getEvent().getExpression();
|
|
6793
|
+
}
|
|
6794
|
+
if (raw.getEvent().getMatcherList()) {
|
|
6795
|
+
data.matcher = raw.getEvent().getMatcherList().map((item) => {
|
|
6796
|
+
return {
|
|
6797
|
+
type: item.getType(),
|
|
6798
|
+
value: item.getValueList()
|
|
6799
|
+
};
|
|
6800
|
+
});
|
|
6801
|
+
}
|
|
6519
6802
|
return new _EventTrigger({
|
|
6520
6803
|
...obj,
|
|
6521
6804
|
type: "event" /* Event */,
|
|
6522
|
-
data
|
|
6805
|
+
data
|
|
6523
6806
|
});
|
|
6524
6807
|
}
|
|
6525
6808
|
};
|
|
@@ -6539,6 +6822,7 @@ var FixedTimeTrigger = class _FixedTimeTrigger extends interface_default {
|
|
|
6539
6822
|
toRequest() {
|
|
6540
6823
|
const request = new avs_pb6.TaskTrigger();
|
|
6541
6824
|
request.setName(this.name);
|
|
6825
|
+
request.setId(this.id);
|
|
6542
6826
|
if (!this.data) {
|
|
6543
6827
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6544
6828
|
}
|
|
@@ -6932,7 +7216,7 @@ var Workflow = class _Workflow {
|
|
|
6932
7216
|
this.maxExecution = props.maxExecution;
|
|
6933
7217
|
this.id = props.id;
|
|
6934
7218
|
this.owner = props.owner;
|
|
6935
|
-
this.
|
|
7219
|
+
this.name = props.name;
|
|
6936
7220
|
this.status = props.status;
|
|
6937
7221
|
this.completedAt = props.completedAt;
|
|
6938
7222
|
this.totalExecution = props.totalExecution;
|
|
@@ -6963,7 +7247,7 @@ var Workflow = class _Workflow {
|
|
|
6963
7247
|
startAt: obj.getStartAt(),
|
|
6964
7248
|
expiredAt: obj.getExpiredAt(),
|
|
6965
7249
|
maxExecution: obj.getMaxExecution(),
|
|
6966
|
-
|
|
7250
|
+
name: obj.getName(),
|
|
6967
7251
|
status: convertStatusToString(obj.getStatus()),
|
|
6968
7252
|
completedAt: obj.getCompletedAt(),
|
|
6969
7253
|
totalExecution: obj.getTotalExecution(),
|
|
@@ -6992,7 +7276,7 @@ var Workflow = class _Workflow {
|
|
|
6992
7276
|
edges: [],
|
|
6993
7277
|
completedAt: obj.getCompletedAt(),
|
|
6994
7278
|
status: convertStatusToString(obj.getStatus()),
|
|
6995
|
-
|
|
7279
|
+
name: obj.getName(),
|
|
6996
7280
|
totalExecution: obj.getTotalExecution(),
|
|
6997
7281
|
lastRanAt: obj.getLastRanAt()
|
|
6998
7282
|
});
|
|
@@ -7006,8 +7290,8 @@ var Workflow = class _Workflow {
|
|
|
7006
7290
|
request.setStartAt(this.startAt);
|
|
7007
7291
|
request.setExpiredAt(this.expiredAt);
|
|
7008
7292
|
request.setMaxExecution(this.maxExecution);
|
|
7009
|
-
if (this.
|
|
7010
|
-
request.
|
|
7293
|
+
if (this.name) {
|
|
7294
|
+
request.setName(this.name);
|
|
7011
7295
|
}
|
|
7012
7296
|
return request;
|
|
7013
7297
|
}
|
|
@@ -7223,10 +7507,20 @@ var BaseClient = class {
|
|
|
7223
7507
|
* @param expiredAtEpoch - The expiration epoch
|
|
7224
7508
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
7225
7509
|
*/
|
|
7226
|
-
async authWithAPIKey(
|
|
7510
|
+
async authWithAPIKey({
|
|
7511
|
+
chainId,
|
|
7512
|
+
address,
|
|
7513
|
+
issuedAt,
|
|
7514
|
+
expiredAt,
|
|
7515
|
+
apiKey
|
|
7516
|
+
}) {
|
|
7227
7517
|
const request = new avs_pb19.GetKeyReq();
|
|
7518
|
+
request.setChainId(chainId);
|
|
7228
7519
|
request.setOwner(address);
|
|
7229
|
-
|
|
7520
|
+
const issueTs = Timestamp.fromDate(issuedAt);
|
|
7521
|
+
const expiredTs = Timestamp.fromDate(expiredAt);
|
|
7522
|
+
request.setIssuedAt(issueTs);
|
|
7523
|
+
request.setExpiredAt(expiredTs);
|
|
7230
7524
|
request.setSignature(apiKey);
|
|
7231
7525
|
const result = await this.sendGrpcRequest("getKey", request);
|
|
7232
7526
|
return { authKey: result.getKey() };
|
|
@@ -7238,10 +7532,20 @@ var BaseClient = class {
|
|
|
7238
7532
|
* @param expiredAtEpoch - The expiration epoch
|
|
7239
7533
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
7240
7534
|
*/
|
|
7241
|
-
async authWithSignature(
|
|
7535
|
+
async authWithSignature({
|
|
7536
|
+
chainId,
|
|
7537
|
+
address,
|
|
7538
|
+
issuedAt,
|
|
7539
|
+
expiredAt,
|
|
7540
|
+
signature
|
|
7541
|
+
}) {
|
|
7242
7542
|
const request = new avs_pb19.GetKeyReq();
|
|
7543
|
+
request.setChainId(chainId);
|
|
7243
7544
|
request.setOwner(address);
|
|
7244
|
-
|
|
7545
|
+
const issueTs = Timestamp.fromDate(issuedAt);
|
|
7546
|
+
const expiredTs = Timestamp.fromDate(expiredAt);
|
|
7547
|
+
request.setIssuedAt(issueTs);
|
|
7548
|
+
request.setExpiredAt(expiredTs);
|
|
7245
7549
|
request.setSignature(signature);
|
|
7246
7550
|
const result = await this.sendGrpcRequest(
|
|
7247
7551
|
"getKey",
|