@avaprotocol/sdk-js 2.6.6 → 2.6.9
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/CHANGELOG.md +23 -0
- package/dist/index.js +112 -31
- package/dist/index.mjs +112 -31
- package/dist/models/node/contractRead.d.ts.map +1 -1
- package/dist/models/node/contractRead.js +9 -10
- package/dist/models/trigger/event.d.ts.map +1 -1
- package/dist/models/trigger/event.js +10 -5
- package/dist/models/trigger/factory.d.ts.map +1 -1
- package/dist/models/trigger/factory.js +1 -1
- package/dist/models/trigger/manual.d.ts.map +1 -1
- package/dist/models/trigger/manual.js +0 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @avaprotocol/sdk-js
|
|
2
2
|
|
|
3
|
+
## 2.6.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 83af57c: Updated MethodCallType type definitions
|
|
8
|
+
- Updated dependencies [83af57c]
|
|
9
|
+
- @avaprotocol/types@2.4.9
|
|
10
|
+
|
|
11
|
+
## 2.6.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 8a767da: Remove input from both TriggerProps and NodeProps
|
|
16
|
+
- Updated dependencies [8a767da]
|
|
17
|
+
- @avaprotocol/types@2.4.8
|
|
18
|
+
|
|
19
|
+
## 2.6.7
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [1f8948b]
|
|
24
|
+
- @avaprotocol/types@2.4.7
|
|
25
|
+
|
|
3
26
|
## 2.6.6
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -2210,7 +2210,7 @@ var require_avs_pb = __commonJS({
|
|
|
2210
2210
|
proto.aggregator.EventTrigger.Query.prototype.clearMethodCallsList = function() {
|
|
2211
2211
|
return this.setMethodCallsList([]);
|
|
2212
2212
|
};
|
|
2213
|
-
proto.aggregator.EventTrigger.MethodCall.repeatedFields_ = [3];
|
|
2213
|
+
proto.aggregator.EventTrigger.MethodCall.repeatedFields_ = [3, 4];
|
|
2214
2214
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
2215
2215
|
proto.aggregator.EventTrigger.MethodCall.prototype.toObject = function(opt_includeInstance) {
|
|
2216
2216
|
return proto.aggregator.EventTrigger.MethodCall.toObject(opt_includeInstance, this);
|
|
@@ -2219,7 +2219,8 @@ var require_avs_pb = __commonJS({
|
|
|
2219
2219
|
var f, obj = {
|
|
2220
2220
|
methodName: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
2221
2221
|
callData: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
2222
|
-
applyToFieldsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? void 0 : f
|
|
2222
|
+
applyToFieldsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? void 0 : f,
|
|
2223
|
+
methodParamsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? void 0 : f
|
|
2223
2224
|
};
|
|
2224
2225
|
if (includeInstance) {
|
|
2225
2226
|
obj.$jspbMessageInstance = msg;
|
|
@@ -2260,6 +2261,13 @@ var require_avs_pb = __commonJS({
|
|
|
2260
2261
|
);
|
|
2261
2262
|
msg.addApplyToFields(value);
|
|
2262
2263
|
break;
|
|
2264
|
+
case 4:
|
|
2265
|
+
var value = (
|
|
2266
|
+
/** @type {string} */
|
|
2267
|
+
reader.readString()
|
|
2268
|
+
);
|
|
2269
|
+
msg.addMethodParams(value);
|
|
2270
|
+
break;
|
|
2263
2271
|
default:
|
|
2264
2272
|
reader.skipField();
|
|
2265
2273
|
break;
|
|
@@ -2281,8 +2289,9 @@ var require_avs_pb = __commonJS({
|
|
|
2281
2289
|
f
|
|
2282
2290
|
);
|
|
2283
2291
|
}
|
|
2284
|
-
f =
|
|
2285
|
-
|
|
2292
|
+
f = /** @type {string} */
|
|
2293
|
+
jspb.Message.getField(message, 2);
|
|
2294
|
+
if (f != null) {
|
|
2286
2295
|
writer.writeString(
|
|
2287
2296
|
2,
|
|
2288
2297
|
f
|
|
@@ -2295,6 +2304,13 @@ var require_avs_pb = __commonJS({
|
|
|
2295
2304
|
f
|
|
2296
2305
|
);
|
|
2297
2306
|
}
|
|
2307
|
+
f = message.getMethodParamsList();
|
|
2308
|
+
if (f.length > 0) {
|
|
2309
|
+
writer.writeRepeatedString(
|
|
2310
|
+
4,
|
|
2311
|
+
f
|
|
2312
|
+
);
|
|
2313
|
+
}
|
|
2298
2314
|
};
|
|
2299
2315
|
proto.aggregator.EventTrigger.MethodCall.prototype.getMethodName = function() {
|
|
2300
2316
|
return (
|
|
@@ -2312,7 +2328,13 @@ var require_avs_pb = __commonJS({
|
|
|
2312
2328
|
);
|
|
2313
2329
|
};
|
|
2314
2330
|
proto.aggregator.EventTrigger.MethodCall.prototype.setCallData = function(value) {
|
|
2315
|
-
return jspb.Message.
|
|
2331
|
+
return jspb.Message.setField(this, 2, value);
|
|
2332
|
+
};
|
|
2333
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.clearCallData = function() {
|
|
2334
|
+
return jspb.Message.setField(this, 2, void 0);
|
|
2335
|
+
};
|
|
2336
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.hasCallData = function() {
|
|
2337
|
+
return jspb.Message.getField(this, 2) != null;
|
|
2316
2338
|
};
|
|
2317
2339
|
proto.aggregator.EventTrigger.MethodCall.prototype.getApplyToFieldsList = function() {
|
|
2318
2340
|
return (
|
|
@@ -2329,6 +2351,21 @@ var require_avs_pb = __commonJS({
|
|
|
2329
2351
|
proto.aggregator.EventTrigger.MethodCall.prototype.clearApplyToFieldsList = function() {
|
|
2330
2352
|
return this.setApplyToFieldsList([]);
|
|
2331
2353
|
};
|
|
2354
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.getMethodParamsList = function() {
|
|
2355
|
+
return (
|
|
2356
|
+
/** @type {!Array<string>} */
|
|
2357
|
+
jspb.Message.getRepeatedField(this, 4)
|
|
2358
|
+
);
|
|
2359
|
+
};
|
|
2360
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.setMethodParamsList = function(value) {
|
|
2361
|
+
return jspb.Message.setField(this, 4, value || []);
|
|
2362
|
+
};
|
|
2363
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.addMethodParams = function(value, opt_index) {
|
|
2364
|
+
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
|
|
2365
|
+
};
|
|
2366
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.clearMethodParamsList = function() {
|
|
2367
|
+
return this.setMethodParamsList([]);
|
|
2368
|
+
};
|
|
2332
2369
|
proto.aggregator.EventTrigger.Topics.repeatedFields_ = [1];
|
|
2333
2370
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
2334
2371
|
proto.aggregator.EventTrigger.Topics.prototype.toObject = function(opt_includeInstance) {
|
|
@@ -3524,7 +3561,7 @@ var require_avs_pb = __commonJS({
|
|
|
3524
3561
|
proto.aggregator.ContractWriteNode.Config.prototype.clearMethodCallsList = function() {
|
|
3525
3562
|
return this.setMethodCallsList([]);
|
|
3526
3563
|
};
|
|
3527
|
-
proto.aggregator.ContractWriteNode.MethodCall.repeatedFields_ = [3];
|
|
3564
|
+
proto.aggregator.ContractWriteNode.MethodCall.repeatedFields_ = [3, 4];
|
|
3528
3565
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
3529
3566
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.toObject = function(opt_includeInstance) {
|
|
3530
3567
|
return proto.aggregator.ContractWriteNode.MethodCall.toObject(opt_includeInstance, this);
|
|
@@ -3533,7 +3570,8 @@ var require_avs_pb = __commonJS({
|
|
|
3533
3570
|
var f, obj = {
|
|
3534
3571
|
callData: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
3535
3572
|
methodName: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
3536
|
-
|
|
3573
|
+
applyToFieldsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? void 0 : f,
|
|
3574
|
+
methodParamsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? void 0 : f
|
|
3537
3575
|
};
|
|
3538
3576
|
if (includeInstance) {
|
|
3539
3577
|
obj.$jspbMessageInstance = msg;
|
|
@@ -3568,6 +3606,13 @@ var require_avs_pb = __commonJS({
|
|
|
3568
3606
|
msg.setMethodName(value);
|
|
3569
3607
|
break;
|
|
3570
3608
|
case 3:
|
|
3609
|
+
var value = (
|
|
3610
|
+
/** @type {string} */
|
|
3611
|
+
reader.readString()
|
|
3612
|
+
);
|
|
3613
|
+
msg.addApplyToFields(value);
|
|
3614
|
+
break;
|
|
3615
|
+
case 4:
|
|
3571
3616
|
var value = (
|
|
3572
3617
|
/** @type {string} */
|
|
3573
3618
|
reader.readString()
|
|
@@ -3588,8 +3633,9 @@ var require_avs_pb = __commonJS({
|
|
|
3588
3633
|
};
|
|
3589
3634
|
proto.aggregator.ContractWriteNode.MethodCall.serializeBinaryToWriter = function(message, writer) {
|
|
3590
3635
|
var f = void 0;
|
|
3591
|
-
f =
|
|
3592
|
-
|
|
3636
|
+
f = /** @type {string} */
|
|
3637
|
+
jspb.Message.getField(message, 1);
|
|
3638
|
+
if (f != null) {
|
|
3593
3639
|
writer.writeString(
|
|
3594
3640
|
1,
|
|
3595
3641
|
f
|
|
@@ -3602,13 +3648,20 @@ var require_avs_pb = __commonJS({
|
|
|
3602
3648
|
f
|
|
3603
3649
|
);
|
|
3604
3650
|
}
|
|
3605
|
-
f = message.
|
|
3651
|
+
f = message.getApplyToFieldsList();
|
|
3606
3652
|
if (f.length > 0) {
|
|
3607
3653
|
writer.writeRepeatedString(
|
|
3608
3654
|
3,
|
|
3609
3655
|
f
|
|
3610
3656
|
);
|
|
3611
3657
|
}
|
|
3658
|
+
f = message.getMethodParamsList();
|
|
3659
|
+
if (f.length > 0) {
|
|
3660
|
+
writer.writeRepeatedString(
|
|
3661
|
+
4,
|
|
3662
|
+
f
|
|
3663
|
+
);
|
|
3664
|
+
}
|
|
3612
3665
|
};
|
|
3613
3666
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.getCallData = function() {
|
|
3614
3667
|
return (
|
|
@@ -3617,7 +3670,13 @@ var require_avs_pb = __commonJS({
|
|
|
3617
3670
|
);
|
|
3618
3671
|
};
|
|
3619
3672
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.setCallData = function(value) {
|
|
3620
|
-
return jspb.Message.
|
|
3673
|
+
return jspb.Message.setField(this, 1, value);
|
|
3674
|
+
};
|
|
3675
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.clearCallData = function() {
|
|
3676
|
+
return jspb.Message.setField(this, 1, void 0);
|
|
3677
|
+
};
|
|
3678
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.hasCallData = function() {
|
|
3679
|
+
return jspb.Message.getField(this, 1) != null;
|
|
3621
3680
|
};
|
|
3622
3681
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.getMethodName = function() {
|
|
3623
3682
|
return (
|
|
@@ -3628,18 +3687,33 @@ var require_avs_pb = __commonJS({
|
|
|
3628
3687
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.setMethodName = function(value) {
|
|
3629
3688
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
3630
3689
|
};
|
|
3631
|
-
proto.aggregator.ContractWriteNode.MethodCall.prototype.
|
|
3690
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.getApplyToFieldsList = function() {
|
|
3632
3691
|
return (
|
|
3633
3692
|
/** @type {!Array<string>} */
|
|
3634
3693
|
jspb.Message.getRepeatedField(this, 3)
|
|
3635
3694
|
);
|
|
3636
3695
|
};
|
|
3637
|
-
proto.aggregator.ContractWriteNode.MethodCall.prototype.
|
|
3696
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.setApplyToFieldsList = function(value) {
|
|
3638
3697
|
return jspb.Message.setField(this, 3, value || []);
|
|
3639
3698
|
};
|
|
3640
|
-
proto.aggregator.ContractWriteNode.MethodCall.prototype.
|
|
3699
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.addApplyToFields = function(value, opt_index) {
|
|
3641
3700
|
return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
|
|
3642
3701
|
};
|
|
3702
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.clearApplyToFieldsList = function() {
|
|
3703
|
+
return this.setApplyToFieldsList([]);
|
|
3704
|
+
};
|
|
3705
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.getMethodParamsList = function() {
|
|
3706
|
+
return (
|
|
3707
|
+
/** @type {!Array<string>} */
|
|
3708
|
+
jspb.Message.getRepeatedField(this, 4)
|
|
3709
|
+
);
|
|
3710
|
+
};
|
|
3711
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.setMethodParamsList = function(value) {
|
|
3712
|
+
return jspb.Message.setField(this, 4, value || []);
|
|
3713
|
+
};
|
|
3714
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.addMethodParams = function(value, opt_index) {
|
|
3715
|
+
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
|
|
3716
|
+
};
|
|
3643
3717
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.clearMethodParamsList = function() {
|
|
3644
3718
|
return this.setMethodParamsList([]);
|
|
3645
3719
|
};
|
|
@@ -4083,8 +4157,9 @@ var require_avs_pb = __commonJS({
|
|
|
4083
4157
|
};
|
|
4084
4158
|
proto.aggregator.ContractReadNode.MethodCall.serializeBinaryToWriter = function(message, writer) {
|
|
4085
4159
|
var f = void 0;
|
|
4086
|
-
f =
|
|
4087
|
-
|
|
4160
|
+
f = /** @type {string} */
|
|
4161
|
+
jspb.Message.getField(message, 1);
|
|
4162
|
+
if (f != null) {
|
|
4088
4163
|
writer.writeString(
|
|
4089
4164
|
1,
|
|
4090
4165
|
f
|
|
@@ -4119,7 +4194,13 @@ var require_avs_pb = __commonJS({
|
|
|
4119
4194
|
);
|
|
4120
4195
|
};
|
|
4121
4196
|
proto.aggregator.ContractReadNode.MethodCall.prototype.setCallData = function(value) {
|
|
4122
|
-
return jspb.Message.
|
|
4197
|
+
return jspb.Message.setField(this, 1, value);
|
|
4198
|
+
};
|
|
4199
|
+
proto.aggregator.ContractReadNode.MethodCall.prototype.clearCallData = function() {
|
|
4200
|
+
return jspb.Message.setField(this, 1, void 0);
|
|
4201
|
+
};
|
|
4202
|
+
proto.aggregator.ContractReadNode.MethodCall.prototype.hasCallData = function() {
|
|
4203
|
+
return jspb.Message.getField(this, 1) != null;
|
|
4123
4204
|
};
|
|
4124
4205
|
proto.aggregator.ContractReadNode.MethodCall.prototype.getMethodName = function() {
|
|
4125
4206
|
return (
|
|
@@ -15945,7 +16026,9 @@ var EventTrigger2 = class _EventTrigger extends Trigger {
|
|
|
15945
16026
|
}
|
|
15946
16027
|
const abiValueList = queryData.contractAbi.map((item) => {
|
|
15947
16028
|
const value = new google_protobuf_struct_pb.Value();
|
|
15948
|
-
value.setStructValue(
|
|
16029
|
+
value.setStructValue(
|
|
16030
|
+
google_protobuf_struct_pb.Struct.fromJavaScript(item)
|
|
16031
|
+
);
|
|
15949
16032
|
return value;
|
|
15950
16033
|
});
|
|
15951
16034
|
query.setContractAbiList(abiValueList);
|
|
@@ -15966,7 +16049,10 @@ var EventTrigger2 = class _EventTrigger extends Trigger {
|
|
|
15966
16049
|
(methodCallData) => {
|
|
15967
16050
|
const methodCall = new avs_pb4.EventTrigger.MethodCall();
|
|
15968
16051
|
methodCall.setMethodName(methodCallData.methodName);
|
|
15969
|
-
methodCall.
|
|
16052
|
+
methodCall.setMethodParamsList(methodCallData.methodParams);
|
|
16053
|
+
if (methodCallData.callData) {
|
|
16054
|
+
methodCall.setCallData(methodCallData.callData);
|
|
16055
|
+
}
|
|
15970
16056
|
if (methodCallData.applyToFields && methodCallData.applyToFields.length > 0) {
|
|
15971
16057
|
methodCall.setApplyToFieldsList(methodCallData.applyToFields);
|
|
15972
16058
|
}
|
|
@@ -16158,8 +16244,7 @@ var ManualTrigger2 = class _ManualTrigger extends Trigger {
|
|
|
16158
16244
|
super({
|
|
16159
16245
|
...props,
|
|
16160
16246
|
type: import_types6.TriggerType.Manual,
|
|
16161
|
-
data: props.data
|
|
16162
|
-
input: props.input
|
|
16247
|
+
data: props.data
|
|
16163
16248
|
});
|
|
16164
16249
|
}
|
|
16165
16250
|
toRequest() {
|
|
@@ -16662,25 +16747,23 @@ var ContractReadNode2 = class _ContractReadNode extends Node {
|
|
|
16662
16747
|
config.setContractAddress(configData.contractAddress);
|
|
16663
16748
|
const abiValueList = configData.contractAbi.map((item) => {
|
|
16664
16749
|
const value = new google_protobuf_struct_pb3.Value();
|
|
16665
|
-
value.setStructValue(
|
|
16750
|
+
value.setStructValue(
|
|
16751
|
+
google_protobuf_struct_pb3.Struct.fromJavaScript(item)
|
|
16752
|
+
);
|
|
16666
16753
|
return value;
|
|
16667
16754
|
});
|
|
16668
16755
|
config.setContractAbiList(abiValueList);
|
|
16669
16756
|
const methodCalls = configData.methodCalls || [];
|
|
16670
16757
|
methodCalls.forEach((methodCall) => {
|
|
16671
16758
|
const methodCallMsg = new avs_pb13.ContractReadNode.MethodCall();
|
|
16759
|
+
methodCallMsg.setMethodName(methodCall.methodName);
|
|
16760
|
+
methodCallMsg.setMethodParamsList(methodCall.methodParams);
|
|
16672
16761
|
if (methodCall.callData) {
|
|
16673
16762
|
methodCallMsg.setCallData(methodCall.callData);
|
|
16674
16763
|
}
|
|
16675
|
-
if (methodCall.methodName) {
|
|
16676
|
-
methodCallMsg.setMethodName(methodCall.methodName);
|
|
16677
|
-
}
|
|
16678
16764
|
if (methodCall.applyToFields) {
|
|
16679
16765
|
methodCallMsg.setApplyToFieldsList(methodCall.applyToFields);
|
|
16680
16766
|
}
|
|
16681
|
-
if (methodCall.methodParams) {
|
|
16682
|
-
methodCallMsg.setMethodParamsList(methodCall.methodParams);
|
|
16683
|
-
}
|
|
16684
16767
|
config.addMethodCalls(methodCallMsg);
|
|
16685
16768
|
});
|
|
16686
16769
|
node.setConfig(config);
|
|
@@ -16693,9 +16776,7 @@ var ContractReadNode2 = class _ContractReadNode extends Node {
|
|
|
16693
16776
|
const protobufData = config.toObject();
|
|
16694
16777
|
const data = {
|
|
16695
16778
|
contractAddress: protobufData.contractAddress,
|
|
16696
|
-
contractAbi: config.getContractAbiList().map(
|
|
16697
|
-
(value) => convertProtobufValueToJs(value)
|
|
16698
|
-
),
|
|
16779
|
+
contractAbi: config.getContractAbiList().map((value) => convertProtobufValueToJs(value)),
|
|
16699
16780
|
methodCalls: protobufData.methodCallsList?.map((call) => ({
|
|
16700
16781
|
methodName: call.methodName,
|
|
16701
16782
|
applyToFields: call.applyToFieldsList || [],
|
package/dist/index.mjs
CHANGED
|
@@ -2210,7 +2210,7 @@ var require_avs_pb = __commonJS({
|
|
|
2210
2210
|
proto.aggregator.EventTrigger.Query.prototype.clearMethodCallsList = function() {
|
|
2211
2211
|
return this.setMethodCallsList([]);
|
|
2212
2212
|
};
|
|
2213
|
-
proto.aggregator.EventTrigger.MethodCall.repeatedFields_ = [3];
|
|
2213
|
+
proto.aggregator.EventTrigger.MethodCall.repeatedFields_ = [3, 4];
|
|
2214
2214
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
2215
2215
|
proto.aggregator.EventTrigger.MethodCall.prototype.toObject = function(opt_includeInstance) {
|
|
2216
2216
|
return proto.aggregator.EventTrigger.MethodCall.toObject(opt_includeInstance, this);
|
|
@@ -2219,7 +2219,8 @@ var require_avs_pb = __commonJS({
|
|
|
2219
2219
|
var f, obj = {
|
|
2220
2220
|
methodName: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
2221
2221
|
callData: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
2222
|
-
applyToFieldsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? void 0 : f
|
|
2222
|
+
applyToFieldsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? void 0 : f,
|
|
2223
|
+
methodParamsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? void 0 : f
|
|
2223
2224
|
};
|
|
2224
2225
|
if (includeInstance) {
|
|
2225
2226
|
obj.$jspbMessageInstance = msg;
|
|
@@ -2260,6 +2261,13 @@ var require_avs_pb = __commonJS({
|
|
|
2260
2261
|
);
|
|
2261
2262
|
msg.addApplyToFields(value);
|
|
2262
2263
|
break;
|
|
2264
|
+
case 4:
|
|
2265
|
+
var value = (
|
|
2266
|
+
/** @type {string} */
|
|
2267
|
+
reader.readString()
|
|
2268
|
+
);
|
|
2269
|
+
msg.addMethodParams(value);
|
|
2270
|
+
break;
|
|
2263
2271
|
default:
|
|
2264
2272
|
reader.skipField();
|
|
2265
2273
|
break;
|
|
@@ -2281,8 +2289,9 @@ var require_avs_pb = __commonJS({
|
|
|
2281
2289
|
f
|
|
2282
2290
|
);
|
|
2283
2291
|
}
|
|
2284
|
-
f =
|
|
2285
|
-
|
|
2292
|
+
f = /** @type {string} */
|
|
2293
|
+
jspb.Message.getField(message, 2);
|
|
2294
|
+
if (f != null) {
|
|
2286
2295
|
writer.writeString(
|
|
2287
2296
|
2,
|
|
2288
2297
|
f
|
|
@@ -2295,6 +2304,13 @@ var require_avs_pb = __commonJS({
|
|
|
2295
2304
|
f
|
|
2296
2305
|
);
|
|
2297
2306
|
}
|
|
2307
|
+
f = message.getMethodParamsList();
|
|
2308
|
+
if (f.length > 0) {
|
|
2309
|
+
writer.writeRepeatedString(
|
|
2310
|
+
4,
|
|
2311
|
+
f
|
|
2312
|
+
);
|
|
2313
|
+
}
|
|
2298
2314
|
};
|
|
2299
2315
|
proto.aggregator.EventTrigger.MethodCall.prototype.getMethodName = function() {
|
|
2300
2316
|
return (
|
|
@@ -2312,7 +2328,13 @@ var require_avs_pb = __commonJS({
|
|
|
2312
2328
|
);
|
|
2313
2329
|
};
|
|
2314
2330
|
proto.aggregator.EventTrigger.MethodCall.prototype.setCallData = function(value) {
|
|
2315
|
-
return jspb.Message.
|
|
2331
|
+
return jspb.Message.setField(this, 2, value);
|
|
2332
|
+
};
|
|
2333
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.clearCallData = function() {
|
|
2334
|
+
return jspb.Message.setField(this, 2, void 0);
|
|
2335
|
+
};
|
|
2336
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.hasCallData = function() {
|
|
2337
|
+
return jspb.Message.getField(this, 2) != null;
|
|
2316
2338
|
};
|
|
2317
2339
|
proto.aggregator.EventTrigger.MethodCall.prototype.getApplyToFieldsList = function() {
|
|
2318
2340
|
return (
|
|
@@ -2329,6 +2351,21 @@ var require_avs_pb = __commonJS({
|
|
|
2329
2351
|
proto.aggregator.EventTrigger.MethodCall.prototype.clearApplyToFieldsList = function() {
|
|
2330
2352
|
return this.setApplyToFieldsList([]);
|
|
2331
2353
|
};
|
|
2354
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.getMethodParamsList = function() {
|
|
2355
|
+
return (
|
|
2356
|
+
/** @type {!Array<string>} */
|
|
2357
|
+
jspb.Message.getRepeatedField(this, 4)
|
|
2358
|
+
);
|
|
2359
|
+
};
|
|
2360
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.setMethodParamsList = function(value) {
|
|
2361
|
+
return jspb.Message.setField(this, 4, value || []);
|
|
2362
|
+
};
|
|
2363
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.addMethodParams = function(value, opt_index) {
|
|
2364
|
+
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
|
|
2365
|
+
};
|
|
2366
|
+
proto.aggregator.EventTrigger.MethodCall.prototype.clearMethodParamsList = function() {
|
|
2367
|
+
return this.setMethodParamsList([]);
|
|
2368
|
+
};
|
|
2332
2369
|
proto.aggregator.EventTrigger.Topics.repeatedFields_ = [1];
|
|
2333
2370
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
2334
2371
|
proto.aggregator.EventTrigger.Topics.prototype.toObject = function(opt_includeInstance) {
|
|
@@ -3524,7 +3561,7 @@ var require_avs_pb = __commonJS({
|
|
|
3524
3561
|
proto.aggregator.ContractWriteNode.Config.prototype.clearMethodCallsList = function() {
|
|
3525
3562
|
return this.setMethodCallsList([]);
|
|
3526
3563
|
};
|
|
3527
|
-
proto.aggregator.ContractWriteNode.MethodCall.repeatedFields_ = [3];
|
|
3564
|
+
proto.aggregator.ContractWriteNode.MethodCall.repeatedFields_ = [3, 4];
|
|
3528
3565
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
3529
3566
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.toObject = function(opt_includeInstance) {
|
|
3530
3567
|
return proto.aggregator.ContractWriteNode.MethodCall.toObject(opt_includeInstance, this);
|
|
@@ -3533,7 +3570,8 @@ var require_avs_pb = __commonJS({
|
|
|
3533
3570
|
var f, obj = {
|
|
3534
3571
|
callData: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
3535
3572
|
methodName: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
3536
|
-
|
|
3573
|
+
applyToFieldsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? void 0 : f,
|
|
3574
|
+
methodParamsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? void 0 : f
|
|
3537
3575
|
};
|
|
3538
3576
|
if (includeInstance) {
|
|
3539
3577
|
obj.$jspbMessageInstance = msg;
|
|
@@ -3568,6 +3606,13 @@ var require_avs_pb = __commonJS({
|
|
|
3568
3606
|
msg.setMethodName(value);
|
|
3569
3607
|
break;
|
|
3570
3608
|
case 3:
|
|
3609
|
+
var value = (
|
|
3610
|
+
/** @type {string} */
|
|
3611
|
+
reader.readString()
|
|
3612
|
+
);
|
|
3613
|
+
msg.addApplyToFields(value);
|
|
3614
|
+
break;
|
|
3615
|
+
case 4:
|
|
3571
3616
|
var value = (
|
|
3572
3617
|
/** @type {string} */
|
|
3573
3618
|
reader.readString()
|
|
@@ -3588,8 +3633,9 @@ var require_avs_pb = __commonJS({
|
|
|
3588
3633
|
};
|
|
3589
3634
|
proto.aggregator.ContractWriteNode.MethodCall.serializeBinaryToWriter = function(message, writer) {
|
|
3590
3635
|
var f = void 0;
|
|
3591
|
-
f =
|
|
3592
|
-
|
|
3636
|
+
f = /** @type {string} */
|
|
3637
|
+
jspb.Message.getField(message, 1);
|
|
3638
|
+
if (f != null) {
|
|
3593
3639
|
writer.writeString(
|
|
3594
3640
|
1,
|
|
3595
3641
|
f
|
|
@@ -3602,13 +3648,20 @@ var require_avs_pb = __commonJS({
|
|
|
3602
3648
|
f
|
|
3603
3649
|
);
|
|
3604
3650
|
}
|
|
3605
|
-
f = message.
|
|
3651
|
+
f = message.getApplyToFieldsList();
|
|
3606
3652
|
if (f.length > 0) {
|
|
3607
3653
|
writer.writeRepeatedString(
|
|
3608
3654
|
3,
|
|
3609
3655
|
f
|
|
3610
3656
|
);
|
|
3611
3657
|
}
|
|
3658
|
+
f = message.getMethodParamsList();
|
|
3659
|
+
if (f.length > 0) {
|
|
3660
|
+
writer.writeRepeatedString(
|
|
3661
|
+
4,
|
|
3662
|
+
f
|
|
3663
|
+
);
|
|
3664
|
+
}
|
|
3612
3665
|
};
|
|
3613
3666
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.getCallData = function() {
|
|
3614
3667
|
return (
|
|
@@ -3617,7 +3670,13 @@ var require_avs_pb = __commonJS({
|
|
|
3617
3670
|
);
|
|
3618
3671
|
};
|
|
3619
3672
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.setCallData = function(value) {
|
|
3620
|
-
return jspb.Message.
|
|
3673
|
+
return jspb.Message.setField(this, 1, value);
|
|
3674
|
+
};
|
|
3675
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.clearCallData = function() {
|
|
3676
|
+
return jspb.Message.setField(this, 1, void 0);
|
|
3677
|
+
};
|
|
3678
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.hasCallData = function() {
|
|
3679
|
+
return jspb.Message.getField(this, 1) != null;
|
|
3621
3680
|
};
|
|
3622
3681
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.getMethodName = function() {
|
|
3623
3682
|
return (
|
|
@@ -3628,18 +3687,33 @@ var require_avs_pb = __commonJS({
|
|
|
3628
3687
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.setMethodName = function(value) {
|
|
3629
3688
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
3630
3689
|
};
|
|
3631
|
-
proto.aggregator.ContractWriteNode.MethodCall.prototype.
|
|
3690
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.getApplyToFieldsList = function() {
|
|
3632
3691
|
return (
|
|
3633
3692
|
/** @type {!Array<string>} */
|
|
3634
3693
|
jspb.Message.getRepeatedField(this, 3)
|
|
3635
3694
|
);
|
|
3636
3695
|
};
|
|
3637
|
-
proto.aggregator.ContractWriteNode.MethodCall.prototype.
|
|
3696
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.setApplyToFieldsList = function(value) {
|
|
3638
3697
|
return jspb.Message.setField(this, 3, value || []);
|
|
3639
3698
|
};
|
|
3640
|
-
proto.aggregator.ContractWriteNode.MethodCall.prototype.
|
|
3699
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.addApplyToFields = function(value, opt_index) {
|
|
3641
3700
|
return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
|
|
3642
3701
|
};
|
|
3702
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.clearApplyToFieldsList = function() {
|
|
3703
|
+
return this.setApplyToFieldsList([]);
|
|
3704
|
+
};
|
|
3705
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.getMethodParamsList = function() {
|
|
3706
|
+
return (
|
|
3707
|
+
/** @type {!Array<string>} */
|
|
3708
|
+
jspb.Message.getRepeatedField(this, 4)
|
|
3709
|
+
);
|
|
3710
|
+
};
|
|
3711
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.setMethodParamsList = function(value) {
|
|
3712
|
+
return jspb.Message.setField(this, 4, value || []);
|
|
3713
|
+
};
|
|
3714
|
+
proto.aggregator.ContractWriteNode.MethodCall.prototype.addMethodParams = function(value, opt_index) {
|
|
3715
|
+
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
|
|
3716
|
+
};
|
|
3643
3717
|
proto.aggregator.ContractWriteNode.MethodCall.prototype.clearMethodParamsList = function() {
|
|
3644
3718
|
return this.setMethodParamsList([]);
|
|
3645
3719
|
};
|
|
@@ -4083,8 +4157,9 @@ var require_avs_pb = __commonJS({
|
|
|
4083
4157
|
};
|
|
4084
4158
|
proto.aggregator.ContractReadNode.MethodCall.serializeBinaryToWriter = function(message, writer) {
|
|
4085
4159
|
var f = void 0;
|
|
4086
|
-
f =
|
|
4087
|
-
|
|
4160
|
+
f = /** @type {string} */
|
|
4161
|
+
jspb.Message.getField(message, 1);
|
|
4162
|
+
if (f != null) {
|
|
4088
4163
|
writer.writeString(
|
|
4089
4164
|
1,
|
|
4090
4165
|
f
|
|
@@ -4119,7 +4194,13 @@ var require_avs_pb = __commonJS({
|
|
|
4119
4194
|
);
|
|
4120
4195
|
};
|
|
4121
4196
|
proto.aggregator.ContractReadNode.MethodCall.prototype.setCallData = function(value) {
|
|
4122
|
-
return jspb.Message.
|
|
4197
|
+
return jspb.Message.setField(this, 1, value);
|
|
4198
|
+
};
|
|
4199
|
+
proto.aggregator.ContractReadNode.MethodCall.prototype.clearCallData = function() {
|
|
4200
|
+
return jspb.Message.setField(this, 1, void 0);
|
|
4201
|
+
};
|
|
4202
|
+
proto.aggregator.ContractReadNode.MethodCall.prototype.hasCallData = function() {
|
|
4203
|
+
return jspb.Message.getField(this, 1) != null;
|
|
4123
4204
|
};
|
|
4124
4205
|
proto.aggregator.ContractReadNode.MethodCall.prototype.getMethodName = function() {
|
|
4125
4206
|
return (
|
|
@@ -15925,7 +16006,9 @@ var EventTrigger2 = class _EventTrigger extends Trigger {
|
|
|
15925
16006
|
}
|
|
15926
16007
|
const abiValueList = queryData.contractAbi.map((item) => {
|
|
15927
16008
|
const value = new google_protobuf_struct_pb.Value();
|
|
15928
|
-
value.setStructValue(
|
|
16009
|
+
value.setStructValue(
|
|
16010
|
+
google_protobuf_struct_pb.Struct.fromJavaScript(item)
|
|
16011
|
+
);
|
|
15929
16012
|
return value;
|
|
15930
16013
|
});
|
|
15931
16014
|
query.setContractAbiList(abiValueList);
|
|
@@ -15946,7 +16029,10 @@ var EventTrigger2 = class _EventTrigger extends Trigger {
|
|
|
15946
16029
|
(methodCallData) => {
|
|
15947
16030
|
const methodCall = new avs_pb4.EventTrigger.MethodCall();
|
|
15948
16031
|
methodCall.setMethodName(methodCallData.methodName);
|
|
15949
|
-
methodCall.
|
|
16032
|
+
methodCall.setMethodParamsList(methodCallData.methodParams);
|
|
16033
|
+
if (methodCallData.callData) {
|
|
16034
|
+
methodCall.setCallData(methodCallData.callData);
|
|
16035
|
+
}
|
|
15950
16036
|
if (methodCallData.applyToFields && methodCallData.applyToFields.length > 0) {
|
|
15951
16037
|
methodCall.setApplyToFieldsList(methodCallData.applyToFields);
|
|
15952
16038
|
}
|
|
@@ -16142,8 +16228,7 @@ var ManualTrigger2 = class _ManualTrigger extends Trigger {
|
|
|
16142
16228
|
super({
|
|
16143
16229
|
...props,
|
|
16144
16230
|
type: TriggerType11.Manual,
|
|
16145
|
-
data: props.data
|
|
16146
|
-
input: props.input
|
|
16231
|
+
data: props.data
|
|
16147
16232
|
});
|
|
16148
16233
|
}
|
|
16149
16234
|
toRequest() {
|
|
@@ -16658,25 +16743,23 @@ var ContractReadNode2 = class _ContractReadNode extends Node {
|
|
|
16658
16743
|
config.setContractAddress(configData.contractAddress);
|
|
16659
16744
|
const abiValueList = configData.contractAbi.map((item) => {
|
|
16660
16745
|
const value = new google_protobuf_struct_pb3.Value();
|
|
16661
|
-
value.setStructValue(
|
|
16746
|
+
value.setStructValue(
|
|
16747
|
+
google_protobuf_struct_pb3.Struct.fromJavaScript(item)
|
|
16748
|
+
);
|
|
16662
16749
|
return value;
|
|
16663
16750
|
});
|
|
16664
16751
|
config.setContractAbiList(abiValueList);
|
|
16665
16752
|
const methodCalls = configData.methodCalls || [];
|
|
16666
16753
|
methodCalls.forEach((methodCall) => {
|
|
16667
16754
|
const methodCallMsg = new avs_pb13.ContractReadNode.MethodCall();
|
|
16755
|
+
methodCallMsg.setMethodName(methodCall.methodName);
|
|
16756
|
+
methodCallMsg.setMethodParamsList(methodCall.methodParams);
|
|
16668
16757
|
if (methodCall.callData) {
|
|
16669
16758
|
methodCallMsg.setCallData(methodCall.callData);
|
|
16670
16759
|
}
|
|
16671
|
-
if (methodCall.methodName) {
|
|
16672
|
-
methodCallMsg.setMethodName(methodCall.methodName);
|
|
16673
|
-
}
|
|
16674
16760
|
if (methodCall.applyToFields) {
|
|
16675
16761
|
methodCallMsg.setApplyToFieldsList(methodCall.applyToFields);
|
|
16676
16762
|
}
|
|
16677
|
-
if (methodCall.methodParams) {
|
|
16678
|
-
methodCallMsg.setMethodParamsList(methodCall.methodParams);
|
|
16679
|
-
}
|
|
16680
16763
|
config.addMethodCalls(methodCallMsg);
|
|
16681
16764
|
});
|
|
16682
16765
|
node.setConfig(config);
|
|
@@ -16689,9 +16772,7 @@ var ContractReadNode2 = class _ContractReadNode extends Node {
|
|
|
16689
16772
|
const protobufData = config.toObject();
|
|
16690
16773
|
const data = {
|
|
16691
16774
|
contractAddress: protobufData.contractAddress,
|
|
16692
|
-
contractAbi: config.getContractAbiList().map(
|
|
16693
|
-
(value) => convertProtobufValueToJs(value)
|
|
16694
|
-
),
|
|
16775
|
+
contractAbi: config.getContractAbiList().map((value) => convertProtobufValueToJs(value)),
|
|
16695
16776
|
methodCalls: protobufData.methodCallsList?.map((call) => ({
|
|
16696
16777
|
methodName: call.methodName,
|
|
16697
16778
|
applyToFields: call.applyToFieldsList || [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractRead.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractRead.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"contractRead.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractRead.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAIxC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CACvB,UAAU,EAAE,oBAAoB,GAC/B,MAAM,CAAC,gBAAgB;IAuC1B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IA8B3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CACnB,UAAU,EAAE,MAAM,CAAC,qBAAqB,GACvC,OAAO,GAAG,IAAI;CAUlB;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import Node from "./interface";
|
|
|
2
2
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
3
|
import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
|
|
4
4
|
import { NodeType, } from "@avaprotocol/types";
|
|
5
|
-
import { convertProtobufValueToJs
|
|
5
|
+
import { convertProtobufValueToJs } from "../../utils";
|
|
6
6
|
// Required props for constructor: id, name, type and data
|
|
7
7
|
class ContractReadNode extends Node {
|
|
8
8
|
constructor(props) {
|
|
@@ -18,7 +18,7 @@ class ContractReadNode extends Node {
|
|
|
18
18
|
const config = new avs_pb.ContractReadNode.Config();
|
|
19
19
|
config.setContractAddress(configData.contractAddress);
|
|
20
20
|
// Convert array to protobuf Value list
|
|
21
|
-
const abiValueList = configData.contractAbi.map(item => {
|
|
21
|
+
const abiValueList = configData.contractAbi.map((item) => {
|
|
22
22
|
const value = new google_protobuf_struct_pb.Value();
|
|
23
23
|
value.setStructValue(google_protobuf_struct_pb.Struct.fromJavaScript(item));
|
|
24
24
|
return value;
|
|
@@ -28,19 +28,16 @@ class ContractReadNode extends Node {
|
|
|
28
28
|
const methodCalls = configData.methodCalls || [];
|
|
29
29
|
methodCalls.forEach((methodCall) => {
|
|
30
30
|
const methodCallMsg = new avs_pb.ContractReadNode.MethodCall();
|
|
31
|
-
|
|
31
|
+
methodCallMsg.setMethodName(methodCall.methodName);
|
|
32
|
+
methodCallMsg.setMethodParamsList(methodCall.methodParams);
|
|
33
|
+
// Optional: Set callData if provided
|
|
32
34
|
if (methodCall.callData) {
|
|
33
35
|
methodCallMsg.setCallData(methodCall.callData);
|
|
34
36
|
}
|
|
35
|
-
if
|
|
36
|
-
methodCallMsg.setMethodName(methodCall.methodName);
|
|
37
|
-
}
|
|
37
|
+
// Optional: Set applyToFields if provided
|
|
38
38
|
if (methodCall.applyToFields) {
|
|
39
39
|
methodCallMsg.setApplyToFieldsList(methodCall.applyToFields);
|
|
40
40
|
}
|
|
41
|
-
if (methodCall.methodParams) {
|
|
42
|
-
methodCallMsg.setMethodParamsList(methodCall.methodParams);
|
|
43
|
-
}
|
|
44
41
|
config.addMethodCalls(methodCallMsg);
|
|
45
42
|
});
|
|
46
43
|
node.setConfig(config);
|
|
@@ -55,7 +52,9 @@ class ContractReadNode extends Node {
|
|
|
55
52
|
// Convert protobuf data to our custom interface
|
|
56
53
|
const data = {
|
|
57
54
|
contractAddress: protobufData.contractAddress,
|
|
58
|
-
contractAbi: config
|
|
55
|
+
contractAbi: config
|
|
56
|
+
.getContractAbiList()
|
|
57
|
+
.map((value) => convertProtobufValueToJs(value)),
|
|
59
58
|
methodCalls: protobufData.methodCallsList?.map((call) => ({
|
|
60
59
|
methodName: call.methodName,
|
|
61
60
|
applyToFields: call.applyToFieldsList || [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAGL,kBAAkB,EAClB,iBAAiB,EAIlB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAGL,kBAAkB,EAClB,iBAAiB,EAIlB,MAAM,oBAAoB,CAAC;AA8C5B,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAsH/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAoF1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CA0B9D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -2,7 +2,7 @@ import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
|
2
2
|
import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
|
|
3
3
|
import Trigger from "./interface";
|
|
4
4
|
import { TriggerType, } from "@avaprotocol/types";
|
|
5
|
-
import { convertProtobufValueToJs
|
|
5
|
+
import { convertProtobufValueToJs } from "../../utils";
|
|
6
6
|
// Ref: https://github.com/AvaProtocol/EigenLayer-AVS/issues/94
|
|
7
7
|
// The trigger is an array of Condition, which can be topics, dateRage, etc.
|
|
8
8
|
// We imply or operator among all conditions.
|
|
@@ -90,10 +90,10 @@ class EventTrigger extends Trigger {
|
|
|
90
90
|
if (queryData.contractAbi) {
|
|
91
91
|
// Strictly require array format (no string support)
|
|
92
92
|
if (!Array.isArray(queryData.contractAbi)) {
|
|
93
|
-
throw new Error(
|
|
93
|
+
throw new Error("contractAbi must be an array of ABI elements");
|
|
94
94
|
}
|
|
95
95
|
// Convert array to protobuf Value list
|
|
96
|
-
const abiValueList = queryData.contractAbi.map(item => {
|
|
96
|
+
const abiValueList = queryData.contractAbi.map((item) => {
|
|
97
97
|
const value = new google_protobuf_struct_pb.Value();
|
|
98
98
|
value.setStructValue(google_protobuf_struct_pb.Struct.fromJavaScript(item));
|
|
99
99
|
return value;
|
|
@@ -117,7 +117,12 @@ class EventTrigger extends Trigger {
|
|
|
117
117
|
const methodCallMessages = queryData.methodCalls.map((methodCallData) => {
|
|
118
118
|
const methodCall = new avs_pb.EventTrigger.MethodCall();
|
|
119
119
|
methodCall.setMethodName(methodCallData.methodName);
|
|
120
|
-
methodCall.
|
|
120
|
+
methodCall.setMethodParamsList(methodCallData.methodParams);
|
|
121
|
+
// Optional: Set callData if provided
|
|
122
|
+
if (methodCallData.callData) {
|
|
123
|
+
methodCall.setCallData(methodCallData.callData);
|
|
124
|
+
}
|
|
125
|
+
// Optional: Set applyToFields if provided
|
|
121
126
|
if (methodCallData.applyToFields &&
|
|
122
127
|
methodCallData.applyToFields.length > 0) {
|
|
123
128
|
methodCall.setApplyToFieldsList(methodCallData.applyToFields);
|
|
@@ -169,7 +174,7 @@ class EventTrigger extends Trigger {
|
|
|
169
174
|
// Extract contractAbi
|
|
170
175
|
const contractAbi = query.getContractAbiList();
|
|
171
176
|
if (contractAbi && contractAbi.length > 0) {
|
|
172
|
-
queryData.contractAbi = contractAbi.map(value => convertProtobufValueToJs(value));
|
|
177
|
+
queryData.contractAbi = contractAbi.map((value) => convertProtobufValueToJs(value));
|
|
173
178
|
}
|
|
174
179
|
// Extract conditions
|
|
175
180
|
const conditions = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,WAAW,MAAM,QAAQ,CAAC;AACjC,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAC3C,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAEL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,WAAW,MAAM,QAAQ,CAAC;AACjC,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAC3C,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAEL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,cAAM,cAAc;IAClB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAkB3C;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO;IAiBrD,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAkB9D;AAED,eAAe,cAAc,CAAC;AAG9B,OAAO,EACL,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,CAAC;AAGF,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import EventTrigger from "./event";
|
|
|
5
5
|
import FixedTimeTrigger from "./fixedTime";
|
|
6
6
|
import ManualTrigger from "./manual";
|
|
7
7
|
import Trigger from "./interface";
|
|
8
|
-
import { TriggerType } from "@avaprotocol/types";
|
|
8
|
+
import { TriggerType, } from "@avaprotocol/types";
|
|
9
9
|
class TriggerFactory {
|
|
10
10
|
/**
|
|
11
11
|
* Static factory method to create Trigger instances
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manual.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/manual.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,MAAM,aAAa,CAAC;AAMlC,OAAO,EAEL,kBAAkB,EAGnB,MAAM,oBAAoB,CAAC;AAE5B,cAAM,aAAc,SAAQ,OAAO;gBACrB,KAAK,EAAE,kBAAkB;
|
|
1
|
+
{"version":3,"file":"manual.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/manual.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,MAAM,aAAa,CAAC;AAMlC,OAAO,EAEL,kBAAkB,EAGnB,MAAM,oBAAoB,CAAC;AAE5B,cAAM,aAAc,SAAQ,OAAO;gBACrB,KAAK,EAAE,kBAAkB;IAQrC,SAAS,IAAI,MAAM,CAAC,WAAW;IAgE/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,aAAa;IA4C3D;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,OAAO;CAuBlE;AAED,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.9",
|
|
4
4
|
"description": "A JavaScript/TypeScript SDK designed to simplify integration with Ava Protocol's AVS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prepare": "node ../../scripts/prepare-package.js"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@avaprotocol/types": "^2.4.
|
|
34
|
+
"@avaprotocol/types": "^2.4.9",
|
|
35
35
|
"@grpc/grpc-js": "^1.11.3",
|
|
36
36
|
"@grpc/proto-loader": "^0.7.13",
|
|
37
37
|
"dotenv": "^16.4.5",
|