@avaprotocol/sdk-js 2.6.9 → 2.6.10
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 +6 -0
- package/dist/index.js +28 -7
- package/dist/index.mjs +28 -7
- package/dist/models/node/branch.d.ts.map +1 -1
- package/dist/models/node/branch.js +10 -1
- 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
package/dist/index.js
CHANGED
|
@@ -16651,7 +16651,14 @@ var GraphQLQueryNode2 = class _GraphQLQueryNode extends Node {
|
|
|
16651
16651
|
}
|
|
16652
16652
|
static fromOutputData(outputData) {
|
|
16653
16653
|
const graphqlOutput = outputData.getGraphql();
|
|
16654
|
-
|
|
16654
|
+
if (!graphqlOutput) {
|
|
16655
|
+
return null;
|
|
16656
|
+
}
|
|
16657
|
+
const rawData = graphqlOutput.getData();
|
|
16658
|
+
if (rawData) {
|
|
16659
|
+
return convertProtobufValueToJs(rawData);
|
|
16660
|
+
}
|
|
16661
|
+
return null;
|
|
16655
16662
|
}
|
|
16656
16663
|
};
|
|
16657
16664
|
var graphqlQuery_default = GraphQLQueryNode2;
|
|
@@ -16852,7 +16859,14 @@ var ETHTransferNode2 = class _ETHTransferNode extends Node {
|
|
|
16852
16859
|
}
|
|
16853
16860
|
static fromOutputData(outputData) {
|
|
16854
16861
|
const ethTransferOutput = outputData.getEthTransfer();
|
|
16855
|
-
|
|
16862
|
+
if (!ethTransferOutput) {
|
|
16863
|
+
return null;
|
|
16864
|
+
}
|
|
16865
|
+
const rawData = ethTransferOutput.getData();
|
|
16866
|
+
if (rawData) {
|
|
16867
|
+
return convertProtobufValueToJs(rawData);
|
|
16868
|
+
}
|
|
16869
|
+
return null;
|
|
16856
16870
|
}
|
|
16857
16871
|
};
|
|
16858
16872
|
var ethTransfer_default = ETHTransferNode2;
|
|
@@ -16904,7 +16918,14 @@ var BranchNode2 = class _BranchNode extends Node {
|
|
|
16904
16918
|
}
|
|
16905
16919
|
static fromOutputData(outputData) {
|
|
16906
16920
|
const branchOutput = outputData.getBranch();
|
|
16907
|
-
|
|
16921
|
+
if (!branchOutput) {
|
|
16922
|
+
return null;
|
|
16923
|
+
}
|
|
16924
|
+
const rawData = branchOutput.getData();
|
|
16925
|
+
if (rawData) {
|
|
16926
|
+
return convertProtobufValueToJs(rawData);
|
|
16927
|
+
}
|
|
16928
|
+
return null;
|
|
16908
16929
|
}
|
|
16909
16930
|
// TODO: do we need a getConditionId() to avoid exporting BranchNodeData?
|
|
16910
16931
|
};
|
|
@@ -17154,11 +17175,11 @@ var LoopNode2 = class _LoopNode extends Node {
|
|
|
17154
17175
|
}
|
|
17155
17176
|
const customCodeOutput = outputData.getCustomCode();
|
|
17156
17177
|
if (customCodeOutput) {
|
|
17157
|
-
const
|
|
17158
|
-
if (
|
|
17159
|
-
return
|
|
17178
|
+
const rawData = customCodeOutput.getData();
|
|
17179
|
+
if (rawData) {
|
|
17180
|
+
return convertProtobufValueToJs(rawData);
|
|
17160
17181
|
}
|
|
17161
|
-
return
|
|
17182
|
+
return null;
|
|
17162
17183
|
}
|
|
17163
17184
|
return null;
|
|
17164
17185
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -16643,7 +16643,14 @@ var GraphQLQueryNode2 = class _GraphQLQueryNode extends Node {
|
|
|
16643
16643
|
}
|
|
16644
16644
|
static fromOutputData(outputData) {
|
|
16645
16645
|
const graphqlOutput = outputData.getGraphql();
|
|
16646
|
-
|
|
16646
|
+
if (!graphqlOutput) {
|
|
16647
|
+
return null;
|
|
16648
|
+
}
|
|
16649
|
+
const rawData = graphqlOutput.getData();
|
|
16650
|
+
if (rawData) {
|
|
16651
|
+
return convertProtobufValueToJs(rawData);
|
|
16652
|
+
}
|
|
16653
|
+
return null;
|
|
16647
16654
|
}
|
|
16648
16655
|
};
|
|
16649
16656
|
var graphqlQuery_default = GraphQLQueryNode2;
|
|
@@ -16850,7 +16857,14 @@ var ETHTransferNode2 = class _ETHTransferNode extends Node {
|
|
|
16850
16857
|
}
|
|
16851
16858
|
static fromOutputData(outputData) {
|
|
16852
16859
|
const ethTransferOutput = outputData.getEthTransfer();
|
|
16853
|
-
|
|
16860
|
+
if (!ethTransferOutput) {
|
|
16861
|
+
return null;
|
|
16862
|
+
}
|
|
16863
|
+
const rawData = ethTransferOutput.getData();
|
|
16864
|
+
if (rawData) {
|
|
16865
|
+
return convertProtobufValueToJs(rawData);
|
|
16866
|
+
}
|
|
16867
|
+
return null;
|
|
16854
16868
|
}
|
|
16855
16869
|
};
|
|
16856
16870
|
var ethTransfer_default = ETHTransferNode2;
|
|
@@ -16904,7 +16918,14 @@ var BranchNode2 = class _BranchNode extends Node {
|
|
|
16904
16918
|
}
|
|
16905
16919
|
static fromOutputData(outputData) {
|
|
16906
16920
|
const branchOutput = outputData.getBranch();
|
|
16907
|
-
|
|
16921
|
+
if (!branchOutput) {
|
|
16922
|
+
return null;
|
|
16923
|
+
}
|
|
16924
|
+
const rawData = branchOutput.getData();
|
|
16925
|
+
if (rawData) {
|
|
16926
|
+
return convertProtobufValueToJs(rawData);
|
|
16927
|
+
}
|
|
16928
|
+
return null;
|
|
16908
16929
|
}
|
|
16909
16930
|
// TODO: do we need a getConditionId() to avoid exporting BranchNodeData?
|
|
16910
16931
|
};
|
|
@@ -17159,11 +17180,11 @@ var LoopNode2 = class _LoopNode extends Node {
|
|
|
17159
17180
|
}
|
|
17160
17181
|
const customCodeOutput = outputData.getCustomCode();
|
|
17161
17182
|
if (customCodeOutput) {
|
|
17162
|
-
const
|
|
17163
|
-
if (
|
|
17164
|
-
return
|
|
17183
|
+
const rawData = customCodeOutput.getData();
|
|
17184
|
+
if (rawData) {
|
|
17185
|
+
return convertProtobufValueToJs(rawData);
|
|
17165
17186
|
}
|
|
17166
|
-
return
|
|
17187
|
+
return null;
|
|
17167
17188
|
}
|
|
17168
17189
|
return null;
|
|
17169
17190
|
}
|
|
@@ -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;
|
|
@@ -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