@avaprotocol/sdk-js 1.3.2 → 1.3.4-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +80 -8
- package/dist/index.d.ts +80 -8
- package/dist/index.js +353 -40
- package/dist/index.mjs +353 -40
- 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,
|
|
@@ -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");
|
|
@@ -6347,22 +6593,30 @@ var require_avs_grpc_pb = __commonJS({
|
|
|
6347
6593
|
});
|
|
6348
6594
|
|
|
6349
6595
|
// src/index.ts
|
|
6350
|
-
import
|
|
6596
|
+
import _3 from "lodash";
|
|
6351
6597
|
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());
|
|
6365
|
-
import
|
|
6619
|
+
import _2 from "lodash";
|
|
6366
6620
|
|
|
6367
6621
|
// src/models/edge.ts
|
|
6368
6622
|
var avs_pb = __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;
|
|
@@ -6402,6 +6657,14 @@ var Trigger = class {
|
|
|
6402
6657
|
toRequest() {
|
|
6403
6658
|
throw new Error("Method not implemented.");
|
|
6404
6659
|
}
|
|
6660
|
+
toJson() {
|
|
6661
|
+
return {
|
|
6662
|
+
id: this.id,
|
|
6663
|
+
name: this.name,
|
|
6664
|
+
type: this.type,
|
|
6665
|
+
data: this.data
|
|
6666
|
+
};
|
|
6667
|
+
}
|
|
6405
6668
|
};
|
|
6406
6669
|
var interface_default = Trigger;
|
|
6407
6670
|
|
|
@@ -6436,6 +6699,7 @@ var BlockTrigger = class _BlockTrigger extends interface_default {
|
|
|
6436
6699
|
toRequest() {
|
|
6437
6700
|
const request = new avs_pb3.TaskTrigger();
|
|
6438
6701
|
request.setName(this.name);
|
|
6702
|
+
request.setId(this.id);
|
|
6439
6703
|
if (!this.data) {
|
|
6440
6704
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6441
6705
|
}
|
|
@@ -6469,6 +6733,7 @@ var CronTrigger = class _CronTrigger extends interface_default {
|
|
|
6469
6733
|
toRequest() {
|
|
6470
6734
|
const request = new avs_pb4.TaskTrigger();
|
|
6471
6735
|
request.setName(this.name);
|
|
6736
|
+
request.setId(this.id);
|
|
6472
6737
|
if (!this.data) {
|
|
6473
6738
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6474
6739
|
}
|
|
@@ -6504,11 +6769,25 @@ var EventTrigger = class _EventTrigger extends interface_default {
|
|
|
6504
6769
|
toRequest() {
|
|
6505
6770
|
const request = new avs_pb5.TaskTrigger();
|
|
6506
6771
|
request.setName(this.name);
|
|
6772
|
+
request.setId(this.id);
|
|
6507
6773
|
if (!this.data) {
|
|
6508
6774
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6509
6775
|
}
|
|
6510
6776
|
const condition = new avs_pb5.EventCondition();
|
|
6511
|
-
|
|
6777
|
+
const expression = this.data.expression;
|
|
6778
|
+
const matcher = this.data.matcher;
|
|
6779
|
+
if (expression && expression != "") {
|
|
6780
|
+
condition.setExpression(expression);
|
|
6781
|
+
}
|
|
6782
|
+
if (matcher && matcher.length >= 1) {
|
|
6783
|
+
console.log("hit here", matcher);
|
|
6784
|
+
condition.setMatcherList(matcher.map((element) => {
|
|
6785
|
+
const m = new avs_pb5.EventCondition.Matcher();
|
|
6786
|
+
m.setType(element["type"]);
|
|
6787
|
+
m.setValueList(element["value"]);
|
|
6788
|
+
return m;
|
|
6789
|
+
}));
|
|
6790
|
+
}
|
|
6512
6791
|
request.setEvent(condition);
|
|
6513
6792
|
console.log("EventTrigger.toRequest.request:", request.toObject());
|
|
6514
6793
|
return request;
|
|
@@ -6516,10 +6795,22 @@ var EventTrigger = class _EventTrigger extends interface_default {
|
|
|
6516
6795
|
static fromResponse(raw) {
|
|
6517
6796
|
const obj = raw.toObject();
|
|
6518
6797
|
console.log("EventTrigger.fromResponse.obj:", obj);
|
|
6798
|
+
let data = {};
|
|
6799
|
+
if (raw.getEvent().getExpression()) {
|
|
6800
|
+
data.expression = raw.getEvent().getExpression();
|
|
6801
|
+
}
|
|
6802
|
+
if (raw.getEvent().getMatcherList()) {
|
|
6803
|
+
data.matcher = raw.getEvent().getMatcherList().map((item) => {
|
|
6804
|
+
return {
|
|
6805
|
+
type: item.getType(),
|
|
6806
|
+
value: item.getValueList()
|
|
6807
|
+
};
|
|
6808
|
+
});
|
|
6809
|
+
}
|
|
6519
6810
|
return new _EventTrigger({
|
|
6520
6811
|
...obj,
|
|
6521
6812
|
type: "event" /* Event */,
|
|
6522
|
-
data
|
|
6813
|
+
data
|
|
6523
6814
|
});
|
|
6524
6815
|
}
|
|
6525
6816
|
};
|
|
@@ -6539,6 +6830,7 @@ var FixedTimeTrigger = class _FixedTimeTrigger extends interface_default {
|
|
|
6539
6830
|
toRequest() {
|
|
6540
6831
|
const request = new avs_pb6.TaskTrigger();
|
|
6541
6832
|
request.setName(this.name);
|
|
6833
|
+
request.setId(this.id);
|
|
6542
6834
|
if (!this.data) {
|
|
6543
6835
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6544
6836
|
}
|
|
@@ -6603,12 +6895,11 @@ var TriggerFactory = class {
|
|
|
6603
6895
|
var factory_default = TriggerFactory;
|
|
6604
6896
|
|
|
6605
6897
|
// src/models/node/factory.ts
|
|
6606
|
-
import
|
|
6898
|
+
import _ from "lodash";
|
|
6607
6899
|
|
|
6608
6900
|
// src/models/node/interface.ts
|
|
6609
6901
|
var avs_pb7 = __toESM(require_avs_pb());
|
|
6610
6902
|
import { NodeType } from "@avaprotocol/types";
|
|
6611
|
-
import _ from "lodash";
|
|
6612
6903
|
var Node = class {
|
|
6613
6904
|
constructor(props) {
|
|
6614
6905
|
this.id = props.id;
|
|
@@ -6617,13 +6908,15 @@ var Node = class {
|
|
|
6617
6908
|
this.data = props.data;
|
|
6618
6909
|
}
|
|
6619
6910
|
toRequest() {
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6911
|
+
throw new Error("Method not implemented.");
|
|
6912
|
+
}
|
|
6913
|
+
toJson() {
|
|
6914
|
+
return {
|
|
6915
|
+
id: this.id,
|
|
6916
|
+
name: this.name,
|
|
6917
|
+
type: this.type,
|
|
6918
|
+
data: this.data
|
|
6919
|
+
};
|
|
6627
6920
|
}
|
|
6628
6921
|
};
|
|
6629
6922
|
var interface_default2 = Node;
|
|
@@ -6878,7 +7171,7 @@ var NodeFactory = class {
|
|
|
6878
7171
|
}
|
|
6879
7172
|
}
|
|
6880
7173
|
static createNodes(props) {
|
|
6881
|
-
return
|
|
7174
|
+
return _.map(props, (node) => this.create(node));
|
|
6882
7175
|
}
|
|
6883
7176
|
static fromResponse(raw) {
|
|
6884
7177
|
switch (true) {
|
|
@@ -6948,11 +7241,11 @@ var Workflow = class _Workflow {
|
|
|
6948
7241
|
if (!trigger) {
|
|
6949
7242
|
throw new Error("Trigger is undefined in fromResponse()");
|
|
6950
7243
|
}
|
|
6951
|
-
const nodes =
|
|
7244
|
+
const nodes = _2.map(
|
|
6952
7245
|
obj.getNodesList(),
|
|
6953
7246
|
(node) => factory_default2.fromResponse(node)
|
|
6954
7247
|
);
|
|
6955
|
-
const edges =
|
|
7248
|
+
const edges = _2.map(obj.getEdgesList(), (edge) => edge_default.fromResponse(edge));
|
|
6956
7249
|
const workflow = new _Workflow({
|
|
6957
7250
|
id: obj.getId(),
|
|
6958
7251
|
owner: obj.getOwner(),
|
|
@@ -7001,8 +7294,8 @@ var Workflow = class _Workflow {
|
|
|
7001
7294
|
const request = new avs_pb15.CreateTaskReq();
|
|
7002
7295
|
request.setSmartWalletAddress(this.smartWalletAddress);
|
|
7003
7296
|
request.setTrigger(this.trigger.toRequest());
|
|
7004
|
-
|
|
7005
|
-
|
|
7297
|
+
_2.map(this.nodes, (node) => request.addNodes(node.toRequest()));
|
|
7298
|
+
_2.map(this.edges, (edge) => request.addEdges(edge.toRequest()));
|
|
7006
7299
|
request.setStartAt(this.startAt);
|
|
7007
7300
|
request.setExpiredAt(this.expiredAt);
|
|
7008
7301
|
request.setMaxExecution(this.maxExecution);
|
|
@@ -7223,10 +7516,20 @@ var BaseClient = class {
|
|
|
7223
7516
|
* @param expiredAtEpoch - The expiration epoch
|
|
7224
7517
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
7225
7518
|
*/
|
|
7226
|
-
async authWithAPIKey(
|
|
7519
|
+
async authWithAPIKey({
|
|
7520
|
+
chainId,
|
|
7521
|
+
address,
|
|
7522
|
+
issuedAt,
|
|
7523
|
+
expiredAt,
|
|
7524
|
+
apiKey
|
|
7525
|
+
}) {
|
|
7227
7526
|
const request = new avs_pb19.GetKeyReq();
|
|
7527
|
+
request.setChainId(chainId);
|
|
7228
7528
|
request.setOwner(address);
|
|
7229
|
-
|
|
7529
|
+
const issueTs = Timestamp.fromDate(issuedAt);
|
|
7530
|
+
const expiredTs = Timestamp.fromDate(expiredAt);
|
|
7531
|
+
request.setIssuedAt(issueTs);
|
|
7532
|
+
request.setExpiredAt(expiredTs);
|
|
7230
7533
|
request.setSignature(apiKey);
|
|
7231
7534
|
const result = await this.sendGrpcRequest("getKey", request);
|
|
7232
7535
|
return { authKey: result.getKey() };
|
|
@@ -7238,10 +7541,20 @@ var BaseClient = class {
|
|
|
7238
7541
|
* @param expiredAtEpoch - The expiration epoch
|
|
7239
7542
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
7240
7543
|
*/
|
|
7241
|
-
async authWithSignature(
|
|
7544
|
+
async authWithSignature({
|
|
7545
|
+
chainId,
|
|
7546
|
+
address,
|
|
7547
|
+
issuedAt,
|
|
7548
|
+
expiredAt,
|
|
7549
|
+
signature
|
|
7550
|
+
}) {
|
|
7242
7551
|
const request = new avs_pb19.GetKeyReq();
|
|
7552
|
+
request.setChainId(chainId);
|
|
7243
7553
|
request.setOwner(address);
|
|
7244
|
-
|
|
7554
|
+
const issueTs = Timestamp.fromDate(issuedAt);
|
|
7555
|
+
const expiredTs = Timestamp.fromDate(expiredAt);
|
|
7556
|
+
request.setIssuedAt(issueTs);
|
|
7557
|
+
request.setExpiredAt(expiredTs);
|
|
7245
7558
|
request.setSignature(signature);
|
|
7246
7559
|
const result = await this.sendGrpcRequest(
|
|
7247
7560
|
"getKey",
|
|
@@ -7286,7 +7599,7 @@ var BaseClient = class {
|
|
|
7286
7599
|
* @returns {Promise<TResponse>} - The response from the gRPC call
|
|
7287
7600
|
*/
|
|
7288
7601
|
sendGrpcRequest(method, request, options) {
|
|
7289
|
-
const metadata =
|
|
7602
|
+
const metadata = _3.cloneDeep(this.metadata);
|
|
7290
7603
|
if (options?.authKey) {
|
|
7291
7604
|
metadata.set(AUTH_KEY_HEADER, options.authKey);
|
|
7292
7605
|
} else if (this.authKey) {
|