@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.js
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");
|
|
@@ -6377,21 +6623,29 @@ __export(index_exports, {
|
|
|
6377
6623
|
getKeyRequestMessage: () => getKeyRequestMessage
|
|
6378
6624
|
});
|
|
6379
6625
|
module.exports = __toCommonJS(index_exports);
|
|
6380
|
-
var
|
|
6626
|
+
var import_lodash3 = __toESM(require("lodash"));
|
|
6381
6627
|
var grpc = __toESM(require("@grpc/grpc-js"));
|
|
6382
6628
|
var import_grpc_js = require("@grpc/grpc-js");
|
|
6383
6629
|
|
|
6384
6630
|
// src/auth.ts
|
|
6385
|
-
var getKeyRequestMessage = (address, expiredAt) => {
|
|
6386
|
-
return `
|
|
6631
|
+
var getKeyRequestMessage = (chainId, address, issuedAt, expiredAt) => {
|
|
6632
|
+
return `Please sign the below text for ownership verification.
|
|
6633
|
+
|
|
6634
|
+
URI: https://app.avaprotocol.org
|
|
6635
|
+
Chain ID: ${chainId}
|
|
6636
|
+
Version: 1
|
|
6637
|
+
Issued At: ${issuedAt.toISOString()}
|
|
6638
|
+
Expire At: ${expiredAt.toISOString()}
|
|
6639
|
+
Wallet: ${address}`;
|
|
6387
6640
|
};
|
|
6388
6641
|
|
|
6389
6642
|
// src/index.ts
|
|
6390
6643
|
var import_avs_grpc_pb = __toESM(require_avs_grpc_pb());
|
|
6391
6644
|
var avs_pb19 = __toESM(require_avs_pb());
|
|
6645
|
+
var import_timestamp_pb = require("google-protobuf/google/protobuf/timestamp_pb");
|
|
6392
6646
|
|
|
6393
6647
|
// src/models/workflow.ts
|
|
6394
|
-
var
|
|
6648
|
+
var import_lodash2 = __toESM(require("lodash"));
|
|
6395
6649
|
var avs_pb15 = __toESM(require_avs_pb());
|
|
6396
6650
|
|
|
6397
6651
|
// src/models/edge.ts
|
|
@@ -6425,6 +6679,7 @@ var Trigger = class {
|
|
|
6425
6679
|
* @param props
|
|
6426
6680
|
*/
|
|
6427
6681
|
constructor(props) {
|
|
6682
|
+
this.id = props.id;
|
|
6428
6683
|
this.name = props.name;
|
|
6429
6684
|
this.type = props.type;
|
|
6430
6685
|
this.data = props.data;
|
|
@@ -6432,6 +6687,14 @@ var Trigger = class {
|
|
|
6432
6687
|
toRequest() {
|
|
6433
6688
|
throw new Error("Method not implemented.");
|
|
6434
6689
|
}
|
|
6690
|
+
toJson() {
|
|
6691
|
+
return {
|
|
6692
|
+
id: this.id,
|
|
6693
|
+
name: this.name,
|
|
6694
|
+
type: this.type,
|
|
6695
|
+
data: this.data
|
|
6696
|
+
};
|
|
6697
|
+
}
|
|
6435
6698
|
};
|
|
6436
6699
|
var interface_default = Trigger;
|
|
6437
6700
|
|
|
@@ -6466,6 +6729,7 @@ var BlockTrigger = class _BlockTrigger extends interface_default {
|
|
|
6466
6729
|
toRequest() {
|
|
6467
6730
|
const request = new avs_pb3.TaskTrigger();
|
|
6468
6731
|
request.setName(this.name);
|
|
6732
|
+
request.setId(this.id);
|
|
6469
6733
|
if (!this.data) {
|
|
6470
6734
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6471
6735
|
}
|
|
@@ -6499,6 +6763,7 @@ var CronTrigger = class _CronTrigger extends interface_default {
|
|
|
6499
6763
|
toRequest() {
|
|
6500
6764
|
const request = new avs_pb4.TaskTrigger();
|
|
6501
6765
|
request.setName(this.name);
|
|
6766
|
+
request.setId(this.id);
|
|
6502
6767
|
if (!this.data) {
|
|
6503
6768
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6504
6769
|
}
|
|
@@ -6534,11 +6799,25 @@ var EventTrigger = class _EventTrigger extends interface_default {
|
|
|
6534
6799
|
toRequest() {
|
|
6535
6800
|
const request = new avs_pb5.TaskTrigger();
|
|
6536
6801
|
request.setName(this.name);
|
|
6802
|
+
request.setId(this.id);
|
|
6537
6803
|
if (!this.data) {
|
|
6538
6804
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6539
6805
|
}
|
|
6540
6806
|
const condition = new avs_pb5.EventCondition();
|
|
6541
|
-
|
|
6807
|
+
const expression = this.data.expression;
|
|
6808
|
+
const matcher = this.data.matcher;
|
|
6809
|
+
if (expression && expression != "") {
|
|
6810
|
+
condition.setExpression(expression);
|
|
6811
|
+
}
|
|
6812
|
+
if (matcher && matcher.length >= 1) {
|
|
6813
|
+
console.log("hit here", matcher);
|
|
6814
|
+
condition.setMatcherList(matcher.map((element) => {
|
|
6815
|
+
const m = new avs_pb5.EventCondition.Matcher();
|
|
6816
|
+
m.setType(element["type"]);
|
|
6817
|
+
m.setValueList(element["value"]);
|
|
6818
|
+
return m;
|
|
6819
|
+
}));
|
|
6820
|
+
}
|
|
6542
6821
|
request.setEvent(condition);
|
|
6543
6822
|
console.log("EventTrigger.toRequest.request:", request.toObject());
|
|
6544
6823
|
return request;
|
|
@@ -6546,10 +6825,22 @@ var EventTrigger = class _EventTrigger extends interface_default {
|
|
|
6546
6825
|
static fromResponse(raw) {
|
|
6547
6826
|
const obj = raw.toObject();
|
|
6548
6827
|
console.log("EventTrigger.fromResponse.obj:", obj);
|
|
6828
|
+
let data = {};
|
|
6829
|
+
if (raw.getEvent().getExpression()) {
|
|
6830
|
+
data.expression = raw.getEvent().getExpression();
|
|
6831
|
+
}
|
|
6832
|
+
if (raw.getEvent().getMatcherList()) {
|
|
6833
|
+
data.matcher = raw.getEvent().getMatcherList().map((item) => {
|
|
6834
|
+
return {
|
|
6835
|
+
type: item.getType(),
|
|
6836
|
+
value: item.getValueList()
|
|
6837
|
+
};
|
|
6838
|
+
});
|
|
6839
|
+
}
|
|
6549
6840
|
return new _EventTrigger({
|
|
6550
6841
|
...obj,
|
|
6551
6842
|
type: "event" /* Event */,
|
|
6552
|
-
data
|
|
6843
|
+
data
|
|
6553
6844
|
});
|
|
6554
6845
|
}
|
|
6555
6846
|
};
|
|
@@ -6569,6 +6860,7 @@ var FixedTimeTrigger = class _FixedTimeTrigger extends interface_default {
|
|
|
6569
6860
|
toRequest() {
|
|
6570
6861
|
const request = new avs_pb6.TaskTrigger();
|
|
6571
6862
|
request.setName(this.name);
|
|
6863
|
+
request.setId(this.id);
|
|
6572
6864
|
if (!this.data) {
|
|
6573
6865
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
6574
6866
|
}
|
|
@@ -6633,12 +6925,11 @@ var TriggerFactory = class {
|
|
|
6633
6925
|
var factory_default = TriggerFactory;
|
|
6634
6926
|
|
|
6635
6927
|
// src/models/node/factory.ts
|
|
6636
|
-
var
|
|
6928
|
+
var import_lodash = __toESM(require("lodash"));
|
|
6637
6929
|
|
|
6638
6930
|
// src/models/node/interface.ts
|
|
6639
6931
|
var avs_pb7 = __toESM(require_avs_pb());
|
|
6640
6932
|
var import_types6 = require("@avaprotocol/types");
|
|
6641
|
-
var import_lodash = __toESM(require("lodash"));
|
|
6642
6933
|
var Node = class {
|
|
6643
6934
|
constructor(props) {
|
|
6644
6935
|
this.id = props.id;
|
|
@@ -6647,13 +6938,15 @@ var Node = class {
|
|
|
6647
6938
|
this.data = props.data;
|
|
6648
6939
|
}
|
|
6649
6940
|
toRequest() {
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6941
|
+
throw new Error("Method not implemented.");
|
|
6942
|
+
}
|
|
6943
|
+
toJson() {
|
|
6944
|
+
return {
|
|
6945
|
+
id: this.id,
|
|
6946
|
+
name: this.name,
|
|
6947
|
+
type: this.type,
|
|
6948
|
+
data: this.data
|
|
6949
|
+
};
|
|
6657
6950
|
}
|
|
6658
6951
|
};
|
|
6659
6952
|
var interface_default2 = Node;
|
|
@@ -6908,7 +7201,7 @@ var NodeFactory = class {
|
|
|
6908
7201
|
}
|
|
6909
7202
|
}
|
|
6910
7203
|
static createNodes(props) {
|
|
6911
|
-
return
|
|
7204
|
+
return import_lodash.default.map(props, (node) => this.create(node));
|
|
6912
7205
|
}
|
|
6913
7206
|
static fromResponse(raw) {
|
|
6914
7207
|
switch (true) {
|
|
@@ -6978,11 +7271,11 @@ var Workflow = class _Workflow {
|
|
|
6978
7271
|
if (!trigger) {
|
|
6979
7272
|
throw new Error("Trigger is undefined in fromResponse()");
|
|
6980
7273
|
}
|
|
6981
|
-
const nodes =
|
|
7274
|
+
const nodes = import_lodash2.default.map(
|
|
6982
7275
|
obj.getNodesList(),
|
|
6983
7276
|
(node) => factory_default2.fromResponse(node)
|
|
6984
7277
|
);
|
|
6985
|
-
const edges =
|
|
7278
|
+
const edges = import_lodash2.default.map(obj.getEdgesList(), (edge) => edge_default.fromResponse(edge));
|
|
6986
7279
|
const workflow = new _Workflow({
|
|
6987
7280
|
id: obj.getId(),
|
|
6988
7281
|
owner: obj.getOwner(),
|
|
@@ -7031,8 +7324,8 @@ var Workflow = class _Workflow {
|
|
|
7031
7324
|
const request = new avs_pb15.CreateTaskReq();
|
|
7032
7325
|
request.setSmartWalletAddress(this.smartWalletAddress);
|
|
7033
7326
|
request.setTrigger(this.trigger.toRequest());
|
|
7034
|
-
|
|
7035
|
-
|
|
7327
|
+
import_lodash2.default.map(this.nodes, (node) => request.addNodes(node.toRequest()));
|
|
7328
|
+
import_lodash2.default.map(this.edges, (edge) => request.addEdges(edge.toRequest()));
|
|
7036
7329
|
request.setStartAt(this.startAt);
|
|
7037
7330
|
request.setExpiredAt(this.expiredAt);
|
|
7038
7331
|
request.setMaxExecution(this.maxExecution);
|
|
@@ -7253,10 +7546,20 @@ var BaseClient = class {
|
|
|
7253
7546
|
* @param expiredAtEpoch - The expiration epoch
|
|
7254
7547
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
7255
7548
|
*/
|
|
7256
|
-
async authWithAPIKey(
|
|
7549
|
+
async authWithAPIKey({
|
|
7550
|
+
chainId,
|
|
7551
|
+
address,
|
|
7552
|
+
issuedAt,
|
|
7553
|
+
expiredAt,
|
|
7554
|
+
apiKey
|
|
7555
|
+
}) {
|
|
7257
7556
|
const request = new avs_pb19.GetKeyReq();
|
|
7557
|
+
request.setChainId(chainId);
|
|
7258
7558
|
request.setOwner(address);
|
|
7259
|
-
|
|
7559
|
+
const issueTs = import_timestamp_pb.Timestamp.fromDate(issuedAt);
|
|
7560
|
+
const expiredTs = import_timestamp_pb.Timestamp.fromDate(expiredAt);
|
|
7561
|
+
request.setIssuedAt(issueTs);
|
|
7562
|
+
request.setExpiredAt(expiredTs);
|
|
7260
7563
|
request.setSignature(apiKey);
|
|
7261
7564
|
const result = await this.sendGrpcRequest("getKey", request);
|
|
7262
7565
|
return { authKey: result.getKey() };
|
|
@@ -7268,10 +7571,20 @@ var BaseClient = class {
|
|
|
7268
7571
|
* @param expiredAtEpoch - The expiration epoch
|
|
7269
7572
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
7270
7573
|
*/
|
|
7271
|
-
async authWithSignature(
|
|
7574
|
+
async authWithSignature({
|
|
7575
|
+
chainId,
|
|
7576
|
+
address,
|
|
7577
|
+
issuedAt,
|
|
7578
|
+
expiredAt,
|
|
7579
|
+
signature
|
|
7580
|
+
}) {
|
|
7272
7581
|
const request = new avs_pb19.GetKeyReq();
|
|
7582
|
+
request.setChainId(chainId);
|
|
7273
7583
|
request.setOwner(address);
|
|
7274
|
-
|
|
7584
|
+
const issueTs = import_timestamp_pb.Timestamp.fromDate(issuedAt);
|
|
7585
|
+
const expiredTs = import_timestamp_pb.Timestamp.fromDate(expiredAt);
|
|
7586
|
+
request.setIssuedAt(issueTs);
|
|
7587
|
+
request.setExpiredAt(expiredTs);
|
|
7275
7588
|
request.setSignature(signature);
|
|
7276
7589
|
const result = await this.sendGrpcRequest(
|
|
7277
7590
|
"getKey",
|
|
@@ -7316,7 +7629,7 @@ var BaseClient = class {
|
|
|
7316
7629
|
* @returns {Promise<TResponse>} - The response from the gRPC call
|
|
7317
7630
|
*/
|
|
7318
7631
|
sendGrpcRequest(method, request, options) {
|
|
7319
|
-
const metadata =
|
|
7632
|
+
const metadata = import_lodash3.default.cloneDeep(this.metadata);
|
|
7320
7633
|
if (options?.authKey) {
|
|
7321
7634
|
metadata.set(AUTH_KEY_HEADER, options.authKey);
|
|
7322
7635
|
} else if (this.authKey) {
|