@avaprotocol/sdk-js 2.6.9 → 2.6.11
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 +12 -0
- package/dist/index.js +60 -36
- package/dist/index.mjs +60 -36
- package/dist/models/node/branch.d.ts.map +1 -1
- package/dist/models/node/branch.js +10 -1
- package/dist/models/node/contractWrite.d.ts +17 -0
- package/dist/models/node/contractWrite.d.ts.map +1 -1
- package/dist/models/node/contractWrite.js +5 -33
- package/dist/models/node/ethTransfer.d.ts.map +1 -1
- package/dist/models/node/ethTransfer.js +10 -1
- package/dist/models/node/graphqlQuery.d.ts.map +1 -1
- package/dist/models/node/graphqlQuery.js +10 -1
- package/dist/models/node/loop.d.ts.map +1 -1
- package/dist/models/node/loop.js +5 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @avaprotocol/sdk-js
|
|
2
2
|
|
|
3
|
+
## 2.6.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9261ba8: Update response of ContractWriteNode to fix metadata
|
|
8
|
+
|
|
9
|
+
## 2.6.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- c0afaa3: Fix BranchNode runNodeImmediately response format
|
|
14
|
+
|
|
3
15
|
## 2.6.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -3723,7 +3723,8 @@ var require_avs_pb = __commonJS({
|
|
|
3723
3723
|
};
|
|
3724
3724
|
proto.aggregator.ContractWriteNode.Output.toObject = function(includeInstance, msg) {
|
|
3725
3725
|
var f, obj = {
|
|
3726
|
-
data: (f = msg.getData()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f)
|
|
3726
|
+
data: (f = msg.getData()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
|
|
3727
|
+
metadata: (f = msg.getMetadata()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f)
|
|
3727
3728
|
};
|
|
3728
3729
|
if (includeInstance) {
|
|
3729
3730
|
obj.$jspbMessageInstance = msg;
|
|
@@ -3748,6 +3749,11 @@ var require_avs_pb = __commonJS({
|
|
|
3748
3749
|
reader.readMessage(value, google_protobuf_struct_pb5.Value.deserializeBinaryFromReader);
|
|
3749
3750
|
msg.setData(value);
|
|
3750
3751
|
break;
|
|
3752
|
+
case 2:
|
|
3753
|
+
var value = new google_protobuf_struct_pb5.Value();
|
|
3754
|
+
reader.readMessage(value, google_protobuf_struct_pb5.Value.deserializeBinaryFromReader);
|
|
3755
|
+
msg.setMetadata(value);
|
|
3756
|
+
break;
|
|
3751
3757
|
default:
|
|
3752
3758
|
reader.skipField();
|
|
3753
3759
|
break;
|
|
@@ -3770,6 +3776,14 @@ var require_avs_pb = __commonJS({
|
|
|
3770
3776
|
google_protobuf_struct_pb5.Value.serializeBinaryToWriter
|
|
3771
3777
|
);
|
|
3772
3778
|
}
|
|
3779
|
+
f = message.getMetadata();
|
|
3780
|
+
if (f != null) {
|
|
3781
|
+
writer.writeMessage(
|
|
3782
|
+
2,
|
|
3783
|
+
f,
|
|
3784
|
+
google_protobuf_struct_pb5.Value.serializeBinaryToWriter
|
|
3785
|
+
);
|
|
3786
|
+
}
|
|
3773
3787
|
};
|
|
3774
3788
|
proto.aggregator.ContractWriteNode.Output.prototype.getData = function() {
|
|
3775
3789
|
return (
|
|
@@ -3786,6 +3800,21 @@ var require_avs_pb = __commonJS({
|
|
|
3786
3800
|
proto.aggregator.ContractWriteNode.Output.prototype.hasData = function() {
|
|
3787
3801
|
return jspb.Message.getField(this, 1) != null;
|
|
3788
3802
|
};
|
|
3803
|
+
proto.aggregator.ContractWriteNode.Output.prototype.getMetadata = function() {
|
|
3804
|
+
return (
|
|
3805
|
+
/** @type{?proto.google.protobuf.Value} */
|
|
3806
|
+
jspb.Message.getWrapperField(this, google_protobuf_struct_pb5.Value, 2)
|
|
3807
|
+
);
|
|
3808
|
+
};
|
|
3809
|
+
proto.aggregator.ContractWriteNode.Output.prototype.setMetadata = function(value) {
|
|
3810
|
+
return jspb.Message.setWrapperField(this, 2, value);
|
|
3811
|
+
};
|
|
3812
|
+
proto.aggregator.ContractWriteNode.Output.prototype.clearMetadata = function() {
|
|
3813
|
+
return this.setMetadata(void 0);
|
|
3814
|
+
};
|
|
3815
|
+
proto.aggregator.ContractWriteNode.Output.prototype.hasMetadata = function() {
|
|
3816
|
+
return jspb.Message.getField(this, 2) != null;
|
|
3817
|
+
};
|
|
3789
3818
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
3790
3819
|
proto.aggregator.ContractWriteNode.MethodResult.prototype.toObject = function(opt_includeInstance) {
|
|
3791
3820
|
return proto.aggregator.ContractWriteNode.MethodResult.toObject(opt_includeInstance, this);
|
|
@@ -16512,34 +16541,8 @@ var ContractWriteNode2 = class _ContractWriteNode extends Node {
|
|
|
16512
16541
|
static fromOutputData(outputData) {
|
|
16513
16542
|
const contractWriteOutput = outputData.getContractWrite();
|
|
16514
16543
|
if (!contractWriteOutput) return null;
|
|
16515
|
-
const
|
|
16516
|
-
|
|
16517
|
-
const jsData = convertProtobufValueToJs(data);
|
|
16518
|
-
if (Array.isArray(jsData)) {
|
|
16519
|
-
return jsData.map((result) => {
|
|
16520
|
-
const methodName = result.method_name || result.methodName;
|
|
16521
|
-
return {
|
|
16522
|
-
methodName,
|
|
16523
|
-
methodABI: result.method_abi || null,
|
|
16524
|
-
success: result.success,
|
|
16525
|
-
error: result.error || "",
|
|
16526
|
-
value: result.value,
|
|
16527
|
-
receipt: result.receipt || null
|
|
16528
|
-
// Add receipt field
|
|
16529
|
-
};
|
|
16530
|
-
});
|
|
16531
|
-
} else {
|
|
16532
|
-
const methodName = jsData.method_name || jsData.methodName;
|
|
16533
|
-
return [{
|
|
16534
|
-
methodName,
|
|
16535
|
-
methodABI: jsData.method_abi || null,
|
|
16536
|
-
success: jsData.success,
|
|
16537
|
-
error: jsData.error || "",
|
|
16538
|
-
value: jsData.value,
|
|
16539
|
-
receipt: jsData.receipt || null
|
|
16540
|
-
// Add receipt field
|
|
16541
|
-
}];
|
|
16542
|
-
}
|
|
16544
|
+
const dataValue = contractWriteOutput.getData();
|
|
16545
|
+
return dataValue ? convertProtobufValueToJs(dataValue) : {};
|
|
16543
16546
|
}
|
|
16544
16547
|
};
|
|
16545
16548
|
var contractWrite_default = ContractWriteNode2;
|
|
@@ -16651,7 +16654,14 @@ var GraphQLQueryNode2 = class _GraphQLQueryNode extends Node {
|
|
|
16651
16654
|
}
|
|
16652
16655
|
static fromOutputData(outputData) {
|
|
16653
16656
|
const graphqlOutput = outputData.getGraphql();
|
|
16654
|
-
|
|
16657
|
+
if (!graphqlOutput) {
|
|
16658
|
+
return null;
|
|
16659
|
+
}
|
|
16660
|
+
const rawData = graphqlOutput.getData();
|
|
16661
|
+
if (rawData) {
|
|
16662
|
+
return convertProtobufValueToJs(rawData);
|
|
16663
|
+
}
|
|
16664
|
+
return null;
|
|
16655
16665
|
}
|
|
16656
16666
|
};
|
|
16657
16667
|
var graphqlQuery_default = GraphQLQueryNode2;
|
|
@@ -16852,7 +16862,14 @@ var ETHTransferNode2 = class _ETHTransferNode extends Node {
|
|
|
16852
16862
|
}
|
|
16853
16863
|
static fromOutputData(outputData) {
|
|
16854
16864
|
const ethTransferOutput = outputData.getEthTransfer();
|
|
16855
|
-
|
|
16865
|
+
if (!ethTransferOutput) {
|
|
16866
|
+
return null;
|
|
16867
|
+
}
|
|
16868
|
+
const rawData = ethTransferOutput.getData();
|
|
16869
|
+
if (rawData) {
|
|
16870
|
+
return convertProtobufValueToJs(rawData);
|
|
16871
|
+
}
|
|
16872
|
+
return null;
|
|
16856
16873
|
}
|
|
16857
16874
|
};
|
|
16858
16875
|
var ethTransfer_default = ETHTransferNode2;
|
|
@@ -16904,7 +16921,14 @@ var BranchNode2 = class _BranchNode extends Node {
|
|
|
16904
16921
|
}
|
|
16905
16922
|
static fromOutputData(outputData) {
|
|
16906
16923
|
const branchOutput = outputData.getBranch();
|
|
16907
|
-
|
|
16924
|
+
if (!branchOutput) {
|
|
16925
|
+
return null;
|
|
16926
|
+
}
|
|
16927
|
+
const rawData = branchOutput.getData();
|
|
16928
|
+
if (rawData) {
|
|
16929
|
+
return convertProtobufValueToJs(rawData);
|
|
16930
|
+
}
|
|
16931
|
+
return null;
|
|
16908
16932
|
}
|
|
16909
16933
|
// TODO: do we need a getConditionId() to avoid exporting BranchNodeData?
|
|
16910
16934
|
};
|
|
@@ -17154,11 +17178,11 @@ var LoopNode2 = class _LoopNode extends Node {
|
|
|
17154
17178
|
}
|
|
17155
17179
|
const customCodeOutput = outputData.getCustomCode();
|
|
17156
17180
|
if (customCodeOutput) {
|
|
17157
|
-
const
|
|
17158
|
-
if (
|
|
17159
|
-
return
|
|
17181
|
+
const rawData = customCodeOutput.getData();
|
|
17182
|
+
if (rawData) {
|
|
17183
|
+
return convertProtobufValueToJs(rawData);
|
|
17160
17184
|
}
|
|
17161
|
-
return
|
|
17185
|
+
return null;
|
|
17162
17186
|
}
|
|
17163
17187
|
return null;
|
|
17164
17188
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -3723,7 +3723,8 @@ var require_avs_pb = __commonJS({
|
|
|
3723
3723
|
};
|
|
3724
3724
|
proto.aggregator.ContractWriteNode.Output.toObject = function(includeInstance, msg) {
|
|
3725
3725
|
var f, obj = {
|
|
3726
|
-
data: (f = msg.getData()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f)
|
|
3726
|
+
data: (f = msg.getData()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
|
|
3727
|
+
metadata: (f = msg.getMetadata()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f)
|
|
3727
3728
|
};
|
|
3728
3729
|
if (includeInstance) {
|
|
3729
3730
|
obj.$jspbMessageInstance = msg;
|
|
@@ -3748,6 +3749,11 @@ var require_avs_pb = __commonJS({
|
|
|
3748
3749
|
reader.readMessage(value, google_protobuf_struct_pb5.Value.deserializeBinaryFromReader);
|
|
3749
3750
|
msg.setData(value);
|
|
3750
3751
|
break;
|
|
3752
|
+
case 2:
|
|
3753
|
+
var value = new google_protobuf_struct_pb5.Value();
|
|
3754
|
+
reader.readMessage(value, google_protobuf_struct_pb5.Value.deserializeBinaryFromReader);
|
|
3755
|
+
msg.setMetadata(value);
|
|
3756
|
+
break;
|
|
3751
3757
|
default:
|
|
3752
3758
|
reader.skipField();
|
|
3753
3759
|
break;
|
|
@@ -3770,6 +3776,14 @@ var require_avs_pb = __commonJS({
|
|
|
3770
3776
|
google_protobuf_struct_pb5.Value.serializeBinaryToWriter
|
|
3771
3777
|
);
|
|
3772
3778
|
}
|
|
3779
|
+
f = message.getMetadata();
|
|
3780
|
+
if (f != null) {
|
|
3781
|
+
writer.writeMessage(
|
|
3782
|
+
2,
|
|
3783
|
+
f,
|
|
3784
|
+
google_protobuf_struct_pb5.Value.serializeBinaryToWriter
|
|
3785
|
+
);
|
|
3786
|
+
}
|
|
3773
3787
|
};
|
|
3774
3788
|
proto.aggregator.ContractWriteNode.Output.prototype.getData = function() {
|
|
3775
3789
|
return (
|
|
@@ -3786,6 +3800,21 @@ var require_avs_pb = __commonJS({
|
|
|
3786
3800
|
proto.aggregator.ContractWriteNode.Output.prototype.hasData = function() {
|
|
3787
3801
|
return jspb.Message.getField(this, 1) != null;
|
|
3788
3802
|
};
|
|
3803
|
+
proto.aggregator.ContractWriteNode.Output.prototype.getMetadata = function() {
|
|
3804
|
+
return (
|
|
3805
|
+
/** @type{?proto.google.protobuf.Value} */
|
|
3806
|
+
jspb.Message.getWrapperField(this, google_protobuf_struct_pb5.Value, 2)
|
|
3807
|
+
);
|
|
3808
|
+
};
|
|
3809
|
+
proto.aggregator.ContractWriteNode.Output.prototype.setMetadata = function(value) {
|
|
3810
|
+
return jspb.Message.setWrapperField(this, 2, value);
|
|
3811
|
+
};
|
|
3812
|
+
proto.aggregator.ContractWriteNode.Output.prototype.clearMetadata = function() {
|
|
3813
|
+
return this.setMetadata(void 0);
|
|
3814
|
+
};
|
|
3815
|
+
proto.aggregator.ContractWriteNode.Output.prototype.hasMetadata = function() {
|
|
3816
|
+
return jspb.Message.getField(this, 2) != null;
|
|
3817
|
+
};
|
|
3789
3818
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
3790
3819
|
proto.aggregator.ContractWriteNode.MethodResult.prototype.toObject = function(opt_includeInstance) {
|
|
3791
3820
|
return proto.aggregator.ContractWriteNode.MethodResult.toObject(opt_includeInstance, this);
|
|
@@ -16500,34 +16529,8 @@ var ContractWriteNode2 = class _ContractWriteNode extends Node {
|
|
|
16500
16529
|
static fromOutputData(outputData) {
|
|
16501
16530
|
const contractWriteOutput = outputData.getContractWrite();
|
|
16502
16531
|
if (!contractWriteOutput) return null;
|
|
16503
|
-
const
|
|
16504
|
-
|
|
16505
|
-
const jsData = convertProtobufValueToJs(data);
|
|
16506
|
-
if (Array.isArray(jsData)) {
|
|
16507
|
-
return jsData.map((result) => {
|
|
16508
|
-
const methodName = result.method_name || result.methodName;
|
|
16509
|
-
return {
|
|
16510
|
-
methodName,
|
|
16511
|
-
methodABI: result.method_abi || null,
|
|
16512
|
-
success: result.success,
|
|
16513
|
-
error: result.error || "",
|
|
16514
|
-
value: result.value,
|
|
16515
|
-
receipt: result.receipt || null
|
|
16516
|
-
// Add receipt field
|
|
16517
|
-
};
|
|
16518
|
-
});
|
|
16519
|
-
} else {
|
|
16520
|
-
const methodName = jsData.method_name || jsData.methodName;
|
|
16521
|
-
return [{
|
|
16522
|
-
methodName,
|
|
16523
|
-
methodABI: jsData.method_abi || null,
|
|
16524
|
-
success: jsData.success,
|
|
16525
|
-
error: jsData.error || "",
|
|
16526
|
-
value: jsData.value,
|
|
16527
|
-
receipt: jsData.receipt || null
|
|
16528
|
-
// Add receipt field
|
|
16529
|
-
}];
|
|
16530
|
-
}
|
|
16532
|
+
const dataValue = contractWriteOutput.getData();
|
|
16533
|
+
return dataValue ? convertProtobufValueToJs(dataValue) : {};
|
|
16531
16534
|
}
|
|
16532
16535
|
};
|
|
16533
16536
|
var contractWrite_default = ContractWriteNode2;
|
|
@@ -16643,7 +16646,14 @@ var GraphQLQueryNode2 = class _GraphQLQueryNode extends Node {
|
|
|
16643
16646
|
}
|
|
16644
16647
|
static fromOutputData(outputData) {
|
|
16645
16648
|
const graphqlOutput = outputData.getGraphql();
|
|
16646
|
-
|
|
16649
|
+
if (!graphqlOutput) {
|
|
16650
|
+
return null;
|
|
16651
|
+
}
|
|
16652
|
+
const rawData = graphqlOutput.getData();
|
|
16653
|
+
if (rawData) {
|
|
16654
|
+
return convertProtobufValueToJs(rawData);
|
|
16655
|
+
}
|
|
16656
|
+
return null;
|
|
16647
16657
|
}
|
|
16648
16658
|
};
|
|
16649
16659
|
var graphqlQuery_default = GraphQLQueryNode2;
|
|
@@ -16850,7 +16860,14 @@ var ETHTransferNode2 = class _ETHTransferNode extends Node {
|
|
|
16850
16860
|
}
|
|
16851
16861
|
static fromOutputData(outputData) {
|
|
16852
16862
|
const ethTransferOutput = outputData.getEthTransfer();
|
|
16853
|
-
|
|
16863
|
+
if (!ethTransferOutput) {
|
|
16864
|
+
return null;
|
|
16865
|
+
}
|
|
16866
|
+
const rawData = ethTransferOutput.getData();
|
|
16867
|
+
if (rawData) {
|
|
16868
|
+
return convertProtobufValueToJs(rawData);
|
|
16869
|
+
}
|
|
16870
|
+
return null;
|
|
16854
16871
|
}
|
|
16855
16872
|
};
|
|
16856
16873
|
var ethTransfer_default = ETHTransferNode2;
|
|
@@ -16904,7 +16921,14 @@ var BranchNode2 = class _BranchNode extends Node {
|
|
|
16904
16921
|
}
|
|
16905
16922
|
static fromOutputData(outputData) {
|
|
16906
16923
|
const branchOutput = outputData.getBranch();
|
|
16907
|
-
|
|
16924
|
+
if (!branchOutput) {
|
|
16925
|
+
return null;
|
|
16926
|
+
}
|
|
16927
|
+
const rawData = branchOutput.getData();
|
|
16928
|
+
if (rawData) {
|
|
16929
|
+
return convertProtobufValueToJs(rawData);
|
|
16930
|
+
}
|
|
16931
|
+
return null;
|
|
16908
16932
|
}
|
|
16909
16933
|
// TODO: do we need a getConditionId() to avoid exporting BranchNodeData?
|
|
16910
16934
|
};
|
|
@@ -17159,11 +17183,11 @@ var LoopNode2 = class _LoopNode extends Node {
|
|
|
17159
17183
|
}
|
|
17160
17184
|
const customCodeOutput = outputData.getCustomCode();
|
|
17161
17185
|
if (customCodeOutput) {
|
|
17162
|
-
const
|
|
17163
|
-
if (
|
|
17164
|
-
return
|
|
17186
|
+
const rawData = customCodeOutput.getData();
|
|
17187
|
+
if (rawData) {
|
|
17188
|
+
return convertProtobufValueToJs(rawData);
|
|
17165
17189
|
}
|
|
17166
|
-
return
|
|
17190
|
+
return null;
|
|
17167
17191
|
}
|
|
17168
17192
|
return null;
|
|
17169
17193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/models/node/branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAKhD,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAsBrD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAiC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/models/node/branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAKhD,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAsBrD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAiC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAgBrE;AACD,eAAe,UAAU,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NodeType, } from "@avaprotocol/types";
|
|
2
2
|
import Node from "./interface";
|
|
3
3
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
4
|
+
import { convertProtobufValueToJs } from "../../utils";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { conditions }
|
|
5
6
|
class BranchNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -47,7 +48,15 @@ class BranchNode extends Node {
|
|
|
47
48
|
}
|
|
48
49
|
static fromOutputData(outputData) {
|
|
49
50
|
const branchOutput = outputData.getBranch();
|
|
50
|
-
|
|
51
|
+
if (!branchOutput) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
// Use convertProtobufValueToJs to get clean JavaScript objects
|
|
55
|
+
const rawData = branchOutput.getData();
|
|
56
|
+
if (rawData) {
|
|
57
|
+
return convertProtobufValueToJs(rawData);
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
62
|
export default BranchNode;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { ContractWriteNodeData, ContractWriteNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class ContractWriteNode extends Node {
|
|
5
|
+
constructor(props: ContractWriteNodeProps);
|
|
6
|
+
/**
|
|
7
|
+
* Create a protobuf ContractWriteNode from config data
|
|
8
|
+
* @param configData - The configuration data for the contract write node
|
|
9
|
+
* @returns Configured avs_pb.ContractWriteNode
|
|
10
|
+
*/
|
|
11
|
+
static createProtobufNode(configData: ContractWriteNodeData): avs_pb.ContractWriteNode;
|
|
12
|
+
static fromResponse(raw: avs_pb.TaskNode): ContractWriteNode;
|
|
13
|
+
toRequest(): avs_pb.TaskNode;
|
|
14
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
15
|
+
}
|
|
16
|
+
export default ContractWriteNode;
|
|
17
|
+
//# sourceMappingURL=contractWrite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractWrite.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractWrite.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAEL,qBAAqB,EACrB,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,qBAAqB,GAAG,MAAM,CAAC,iBAAiB;IAuCtF,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IA8B5D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,
|
|
1
|
+
{"version":3,"file":"contractWrite.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractWrite.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAEL,qBAAqB,EACrB,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,qBAAqB,GAAG,MAAM,CAAC,iBAAiB;IAuCtF,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IA8B5D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAWrE;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -81,39 +81,11 @@ class ContractWriteNode extends Node {
|
|
|
81
81
|
const contractWriteOutput = outputData.getContractWrite();
|
|
82
82
|
if (!contractWriteOutput)
|
|
83
83
|
return null;
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const jsData = convertProtobufValueToJs(data);
|
|
90
|
-
// Format response for consistency with ContractRead
|
|
91
|
-
if (Array.isArray(jsData)) {
|
|
92
|
-
return jsData.map((result) => {
|
|
93
|
-
// ContractWrite already uses the consistent format with method_abi and value
|
|
94
|
-
const methodName = result.method_name || result.methodName;
|
|
95
|
-
return {
|
|
96
|
-
methodName: methodName,
|
|
97
|
-
methodABI: result.method_abi || null,
|
|
98
|
-
success: result.success,
|
|
99
|
-
error: result.error || "",
|
|
100
|
-
value: result.value,
|
|
101
|
-
receipt: result.receipt || null, // Add receipt field
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
// Single result - wrap in array for consistency
|
|
107
|
-
const methodName = jsData.method_name || jsData.methodName;
|
|
108
|
-
return [{
|
|
109
|
-
methodName: methodName,
|
|
110
|
-
methodABI: jsData.method_abi || null,
|
|
111
|
-
success: jsData.success,
|
|
112
|
-
error: jsData.error || "",
|
|
113
|
-
value: jsData.value,
|
|
114
|
-
receipt: jsData.receipt || null, // Add receipt field
|
|
115
|
-
}];
|
|
116
|
-
}
|
|
84
|
+
// NEW: Only return the data part (decoded events, like ContractRead)
|
|
85
|
+
// The metadata is handled at the protobuf response level by the client
|
|
86
|
+
const dataValue = contractWriteOutput.getData();
|
|
87
|
+
// Convert protobuf Value to JavaScript object (flattened decoded event data)
|
|
88
|
+
return dataValue ? convertProtobufValueToJs(dataValue) : {};
|
|
117
89
|
}
|
|
118
90
|
}
|
|
119
91
|
export default ContractWriteNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethTransfer.d.ts","sourceRoot":"","sources":["../../../src/models/node/ethTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,oBAAoB,EAErB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,eAAgB,SAAQ,IAAI;gBACpB,KAAK,EAAE,oBAAoB;IAIvC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,MAAM,CAAC,eAAe;IAW1B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,eAAe;IAgB1D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"ethTransfer.d.ts","sourceRoot":"","sources":["../../../src/models/node/ethTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,oBAAoB,EAErB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,eAAgB,SAAQ,IAAI;gBACpB,KAAK,EAAE,oBAAoB;IAIvC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,MAAM,CAAC,eAAe;IAW1B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,eAAe;IAgB1D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAcrE;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Node from "./interface";
|
|
2
2
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
3
|
import { NodeType, } from "@avaprotocol/types";
|
|
4
|
+
import { convertProtobufValueToJs } from "../../utils";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { destination, amount }
|
|
5
6
|
class ETHTransferNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -42,7 +43,15 @@ class ETHTransferNode extends Node {
|
|
|
42
43
|
}
|
|
43
44
|
static fromOutputData(outputData) {
|
|
44
45
|
const ethTransferOutput = outputData.getEthTransfer();
|
|
45
|
-
|
|
46
|
+
if (!ethTransferOutput) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
// Use convertProtobufValueToJs to get clean JavaScript objects
|
|
50
|
+
const rawData = ethTransferOutput.getData();
|
|
51
|
+
if (rawData) {
|
|
52
|
+
return convertProtobufValueToJs(rawData);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
46
55
|
}
|
|
47
56
|
}
|
|
48
57
|
export default ETHTransferNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlQuery.d.ts","sourceRoot":"","sources":["../../../src/models/node/graphqlQuery.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAQxC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACxC,GAAG,MAAM,CAAC,gBAAgB;IAkB3B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAc3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"graphqlQuery.d.ts","sourceRoot":"","sources":["../../../src/models/node/graphqlQuery.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAQxC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACxC,GAAG,MAAM,CAAC,gBAAgB;IAkB3B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAc3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAcrE;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Node from "./interface";
|
|
2
2
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
3
|
import { NodeType, } from "@avaprotocol/types";
|
|
4
|
+
import { convertProtobufValueToJs } from "../../utils";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { url, query, variablesMap }
|
|
5
6
|
class GraphQLQueryNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -51,7 +52,15 @@ class GraphQLQueryNode extends Node {
|
|
|
51
52
|
}
|
|
52
53
|
static fromOutputData(outputData) {
|
|
53
54
|
const graphqlOutput = outputData.getGraphql();
|
|
54
|
-
|
|
55
|
+
if (!graphqlOutput) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
// Use convertProtobufValueToJs to get clean JavaScript objects
|
|
59
|
+
const rawData = graphqlOutput.getData();
|
|
60
|
+
if (rawData) {
|
|
61
|
+
return convertProtobufValueToJs(rawData);
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
export default GraphQLQueryNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,MAAM,aAAa,CAAC;AAO/B,OAAO,EAGL,aAAa,EAId,MAAM,oBAAoB,CAAC;AAG5B,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA8BnD,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAsBxC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAe3C,OAAO,CAAC,0BAA0B;IA4BlC,SAAS,IAAI,MAAM,CAAC,QAAQ;IA8B5B,OAAO,CAAC,mBAAmB;IA+G3B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,MAAM,aAAa,CAAC;AAO/B,OAAO,EAGL,aAAa,EAId,MAAM,oBAAoB,CAAC;AAG5B,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA8BnD,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAsBxC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAe3C,OAAO,CAAC,0BAA0B;IA4BlC,SAAS,IAAI,MAAM,CAAC,QAAQ;IA8B5B,OAAO,CAAC,mBAAmB;IA+G3B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,OAAO;CAkCzE;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/models/node/loop.js
CHANGED
|
@@ -213,15 +213,12 @@ class LoopNode extends Node {
|
|
|
213
213
|
// Fallback: For immediate execution, data might come as CustomCode format
|
|
214
214
|
const customCodeOutput = outputData.getCustomCode();
|
|
215
215
|
if (customCodeOutput) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (
|
|
219
|
-
|
|
220
|
-
Object.keys(result).length === 1 &&
|
|
221
|
-
"data" in result) {
|
|
222
|
-
return result.data;
|
|
216
|
+
// Use convertProtobufValueToJs to get clean JavaScript objects
|
|
217
|
+
const rawData = customCodeOutput.getData();
|
|
218
|
+
if (rawData) {
|
|
219
|
+
return convertProtobufValueToJs(rawData);
|
|
223
220
|
}
|
|
224
|
-
return
|
|
221
|
+
return null;
|
|
225
222
|
}
|
|
226
223
|
return null;
|
|
227
224
|
}
|
package/package.json
CHANGED