@avaprotocol/sdk-js 2.7.3 → 2.7.4
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 +8 -0
- package/dist/auth.d.ts +2 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +10 -0
- package/dist/config.d.ts +9 -0
- package/dist/index.js +177 -6
- package/dist/index.mjs +177 -6
- package/dist/models/edge.d.ts +12 -0
- package/dist/models/execution.d.ts +1 -0
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/execution.js +3 -0
- package/dist/models/node/branch.d.ts +11 -0
- package/dist/models/node/contractRead.d.ts +17 -0
- package/dist/models/node/customCode.d.ts +20 -0
- package/dist/models/node/ethTransfer.d.ts +20 -0
- package/dist/models/node/factory.d.ts +23 -0
- package/dist/models/node/interface.d.ts +20 -0
- package/dist/models/node/loop.d.ts +15 -0
- package/dist/models/node/restApi.d.ts +22 -0
- package/dist/models/secret.d.ts +16 -0
- package/dist/models/step.d.ts +3 -0
- package/dist/models/step.d.ts.map +1 -1
- package/dist/models/step.js +18 -0
- package/dist/models/workflow.d.ts +48 -0
- package/dist/models/workflow.d.ts.map +1 -1
- package/dist/models/workflow.js +10 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @avaprotocol/sdk-js
|
|
2
2
|
|
|
3
|
+
## 2.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b13427a: Added new fields to the Execution and Execution.Step protobuf messages for gas usage: gas_used, gas_price, and total_gas_cost; Introduced a new input_variables map field to the Task and CreateTaskReq protobuf messages, and updated the generated JavaScript code to handle serialization, deserialization, and access to these variables.
|
|
8
|
+
- Updated dependencies [b13427a]
|
|
9
|
+
- @avaprotocol/types@2.5.4
|
|
10
|
+
|
|
3
11
|
## 2.7.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,UAAU,IAAI,EAAE,WAAW,IAAI,KAAG,MAUxG,CAAA"}
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const getKeyRequestMessage = (chainId, address, issuedAt, expiredAt) => {
|
|
2
|
+
return `Please sign the below text for ownership verification.
|
|
3
|
+
|
|
4
|
+
URI: https://app.avaprotocol.org
|
|
5
|
+
Chain ID: ${chainId}
|
|
6
|
+
Version: 1
|
|
7
|
+
Issued At: ${issuedAt.toISOString()}
|
|
8
|
+
Expire At: ${expiredAt.toISOString()}
|
|
9
|
+
Wallet: ${address}`;
|
|
10
|
+
};
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Environment } from "@avaprotocol/types";
|
|
2
|
+
export declare const DEFAULT_JWT_EXPIRATION: number;
|
|
3
|
+
interface Config {
|
|
4
|
+
AVS_RPC_URL: string;
|
|
5
|
+
}
|
|
6
|
+
declare const configs: Record<Environment, Config>;
|
|
7
|
+
export declare function getRpcEndpoint(env: Environment): string;
|
|
8
|
+
export { configs };
|
|
9
|
+
//# sourceMappingURL=config.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -7011,6 +7011,7 @@ var require_avs_pb = __commonJS({
|
|
|
7011
7011
|
status: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
7012
7012
|
error: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
|
7013
7013
|
index: jspb.Message.getFieldWithDefault(msg, 6, 0),
|
|
7014
|
+
totalGasCost: jspb.Message.getFieldWithDefault(msg, 30, ""),
|
|
7014
7015
|
stepsList: jspb.Message.toObjectList(
|
|
7015
7016
|
msg.getStepsList(),
|
|
7016
7017
|
proto.aggregator.Execution.Step.toObject,
|
|
@@ -7077,6 +7078,13 @@ var require_avs_pb = __commonJS({
|
|
|
7077
7078
|
);
|
|
7078
7079
|
msg.setIndex(value);
|
|
7079
7080
|
break;
|
|
7081
|
+
case 30:
|
|
7082
|
+
var value = (
|
|
7083
|
+
/** @type {string} */
|
|
7084
|
+
reader.readString()
|
|
7085
|
+
);
|
|
7086
|
+
msg.setTotalGasCost(value);
|
|
7087
|
+
break;
|
|
7080
7088
|
case 8:
|
|
7081
7089
|
var value = new proto.aggregator.Execution.Step();
|
|
7082
7090
|
reader.readMessage(value, proto.aggregator.Execution.Step.deserializeBinaryFromReader);
|
|
@@ -7138,6 +7146,13 @@ var require_avs_pb = __commonJS({
|
|
|
7138
7146
|
f
|
|
7139
7147
|
);
|
|
7140
7148
|
}
|
|
7149
|
+
f = message.getTotalGasCost();
|
|
7150
|
+
if (f.length > 0) {
|
|
7151
|
+
writer.writeString(
|
|
7152
|
+
30,
|
|
7153
|
+
f
|
|
7154
|
+
);
|
|
7155
|
+
}
|
|
7141
7156
|
f = message.getStepsList();
|
|
7142
7157
|
if (f.length > 0) {
|
|
7143
7158
|
writer.writeRepeatedMessage(
|
|
@@ -7188,6 +7203,9 @@ var require_avs_pb = __commonJS({
|
|
|
7188
7203
|
config: (f = msg.getConfig()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
|
|
7189
7204
|
metadata: (f = msg.getMetadata()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
|
|
7190
7205
|
executionContext: (f = msg.getExecutionContext()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
|
|
7206
|
+
gasUsed: jspb.Message.getFieldWithDefault(msg, 27, ""),
|
|
7207
|
+
gasPrice: jspb.Message.getFieldWithDefault(msg, 28, ""),
|
|
7208
|
+
totalGasCost: jspb.Message.getFieldWithDefault(msg, 29, ""),
|
|
7191
7209
|
blockTrigger: (f = msg.getBlockTrigger()) && proto.aggregator.BlockTrigger.Output.toObject(includeInstance, f),
|
|
7192
7210
|
fixedTimeTrigger: (f = msg.getFixedTimeTrigger()) && proto.aggregator.FixedTimeTrigger.Output.toObject(includeInstance, f),
|
|
7193
7211
|
cronTrigger: (f = msg.getCronTrigger()) && proto.aggregator.CronTrigger.Output.toObject(includeInstance, f),
|
|
@@ -7287,6 +7305,27 @@ var require_avs_pb = __commonJS({
|
|
|
7287
7305
|
reader.readMessage(value, google_protobuf_struct_pb5.Value.deserializeBinaryFromReader);
|
|
7288
7306
|
msg.setExecutionContext(value);
|
|
7289
7307
|
break;
|
|
7308
|
+
case 27:
|
|
7309
|
+
var value = (
|
|
7310
|
+
/** @type {string} */
|
|
7311
|
+
reader.readString()
|
|
7312
|
+
);
|
|
7313
|
+
msg.setGasUsed(value);
|
|
7314
|
+
break;
|
|
7315
|
+
case 28:
|
|
7316
|
+
var value = (
|
|
7317
|
+
/** @type {string} */
|
|
7318
|
+
reader.readString()
|
|
7319
|
+
);
|
|
7320
|
+
msg.setGasPrice(value);
|
|
7321
|
+
break;
|
|
7322
|
+
case 29:
|
|
7323
|
+
var value = (
|
|
7324
|
+
/** @type {string} */
|
|
7325
|
+
reader.readString()
|
|
7326
|
+
);
|
|
7327
|
+
msg.setTotalGasCost(value);
|
|
7328
|
+
break;
|
|
7290
7329
|
case 20:
|
|
7291
7330
|
var value = new proto.aggregator.BlockTrigger.Output();
|
|
7292
7331
|
reader.readMessage(value, proto.aggregator.BlockTrigger.Output.deserializeBinaryFromReader);
|
|
@@ -7458,6 +7497,27 @@ var require_avs_pb = __commonJS({
|
|
|
7458
7497
|
google_protobuf_struct_pb5.Value.serializeBinaryToWriter
|
|
7459
7498
|
);
|
|
7460
7499
|
}
|
|
7500
|
+
f = message.getGasUsed();
|
|
7501
|
+
if (f.length > 0) {
|
|
7502
|
+
writer.writeString(
|
|
7503
|
+
27,
|
|
7504
|
+
f
|
|
7505
|
+
);
|
|
7506
|
+
}
|
|
7507
|
+
f = message.getGasPrice();
|
|
7508
|
+
if (f.length > 0) {
|
|
7509
|
+
writer.writeString(
|
|
7510
|
+
28,
|
|
7511
|
+
f
|
|
7512
|
+
);
|
|
7513
|
+
}
|
|
7514
|
+
f = message.getTotalGasCost();
|
|
7515
|
+
if (f.length > 0) {
|
|
7516
|
+
writer.writeString(
|
|
7517
|
+
29,
|
|
7518
|
+
f
|
|
7519
|
+
);
|
|
7520
|
+
}
|
|
7461
7521
|
f = message.getBlockTrigger();
|
|
7462
7522
|
if (f != null) {
|
|
7463
7523
|
writer.writeMessage(
|
|
@@ -7699,6 +7759,33 @@ var require_avs_pb = __commonJS({
|
|
|
7699
7759
|
proto.aggregator.Execution.Step.prototype.hasExecutionContext = function() {
|
|
7700
7760
|
return jspb.Message.getField(this, 26) != null;
|
|
7701
7761
|
};
|
|
7762
|
+
proto.aggregator.Execution.Step.prototype.getGasUsed = function() {
|
|
7763
|
+
return (
|
|
7764
|
+
/** @type {string} */
|
|
7765
|
+
jspb.Message.getFieldWithDefault(this, 27, "")
|
|
7766
|
+
);
|
|
7767
|
+
};
|
|
7768
|
+
proto.aggregator.Execution.Step.prototype.setGasUsed = function(value) {
|
|
7769
|
+
return jspb.Message.setProto3StringField(this, 27, value);
|
|
7770
|
+
};
|
|
7771
|
+
proto.aggregator.Execution.Step.prototype.getGasPrice = function() {
|
|
7772
|
+
return (
|
|
7773
|
+
/** @type {string} */
|
|
7774
|
+
jspb.Message.getFieldWithDefault(this, 28, "")
|
|
7775
|
+
);
|
|
7776
|
+
};
|
|
7777
|
+
proto.aggregator.Execution.Step.prototype.setGasPrice = function(value) {
|
|
7778
|
+
return jspb.Message.setProto3StringField(this, 28, value);
|
|
7779
|
+
};
|
|
7780
|
+
proto.aggregator.Execution.Step.prototype.getTotalGasCost = function() {
|
|
7781
|
+
return (
|
|
7782
|
+
/** @type {string} */
|
|
7783
|
+
jspb.Message.getFieldWithDefault(this, 29, "")
|
|
7784
|
+
);
|
|
7785
|
+
};
|
|
7786
|
+
proto.aggregator.Execution.Step.prototype.setTotalGasCost = function(value) {
|
|
7787
|
+
return jspb.Message.setProto3StringField(this, 29, value);
|
|
7788
|
+
};
|
|
7702
7789
|
proto.aggregator.Execution.Step.prototype.getBlockTrigger = function() {
|
|
7703
7790
|
return (
|
|
7704
7791
|
/** @type{?proto.aggregator.BlockTrigger.Output} */
|
|
@@ -7981,6 +8068,15 @@ var require_avs_pb = __commonJS({
|
|
|
7981
8068
|
proto.aggregator.Execution.prototype.setIndex = function(value) {
|
|
7982
8069
|
return jspb.Message.setProto3IntField(this, 6, value);
|
|
7983
8070
|
};
|
|
8071
|
+
proto.aggregator.Execution.prototype.getTotalGasCost = function() {
|
|
8072
|
+
return (
|
|
8073
|
+
/** @type {string} */
|
|
8074
|
+
jspb.Message.getFieldWithDefault(this, 30, "")
|
|
8075
|
+
);
|
|
8076
|
+
};
|
|
8077
|
+
proto.aggregator.Execution.prototype.setTotalGasCost = function(value) {
|
|
8078
|
+
return jspb.Message.setProto3StringField(this, 30, value);
|
|
8079
|
+
};
|
|
7984
8080
|
proto.aggregator.Execution.prototype.getStepsList = function() {
|
|
7985
8081
|
return (
|
|
7986
8082
|
/** @type{!Array<!proto.aggregator.Execution.Step>} */
|
|
@@ -8024,7 +8120,8 @@ var require_avs_pb = __commonJS({
|
|
|
8024
8120
|
msg.getEdgesList(),
|
|
8025
8121
|
proto.aggregator.TaskEdge.toObject,
|
|
8026
8122
|
includeInstance
|
|
8027
|
-
)
|
|
8123
|
+
),
|
|
8124
|
+
inputVariablesMap: (f = msg.getInputVariablesMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : []
|
|
8028
8125
|
};
|
|
8029
8126
|
if (includeInstance) {
|
|
8030
8127
|
obj.$jspbMessageInstance = msg;
|
|
@@ -8136,6 +8233,12 @@ var require_avs_pb = __commonJS({
|
|
|
8136
8233
|
reader.readMessage(value, proto.aggregator.TaskEdge.deserializeBinaryFromReader);
|
|
8137
8234
|
msg.addEdges(value);
|
|
8138
8235
|
break;
|
|
8236
|
+
case 15:
|
|
8237
|
+
var value = msg.getInputVariablesMap();
|
|
8238
|
+
reader.readMessage(value, function(message, reader2) {
|
|
8239
|
+
jspb.Map.deserializeBinary(message, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value());
|
|
8240
|
+
});
|
|
8241
|
+
break;
|
|
8139
8242
|
default:
|
|
8140
8243
|
reader.skipField();
|
|
8141
8244
|
break;
|
|
@@ -8251,6 +8354,10 @@ var require_avs_pb = __commonJS({
|
|
|
8251
8354
|
proto.aggregator.TaskEdge.serializeBinaryToWriter
|
|
8252
8355
|
);
|
|
8253
8356
|
}
|
|
8357
|
+
f = message.getInputVariablesMap(true);
|
|
8358
|
+
if (f && f.getLength() > 0) {
|
|
8359
|
+
f.serializeBinary(15, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter);
|
|
8360
|
+
}
|
|
8254
8361
|
};
|
|
8255
8362
|
proto.aggregator.Task.prototype.getId = function() {
|
|
8256
8363
|
return (
|
|
@@ -8396,6 +8503,21 @@ var require_avs_pb = __commonJS({
|
|
|
8396
8503
|
proto.aggregator.Task.prototype.clearEdgesList = function() {
|
|
8397
8504
|
return this.setEdgesList([]);
|
|
8398
8505
|
};
|
|
8506
|
+
proto.aggregator.Task.prototype.getInputVariablesMap = function(opt_noLazyCreate) {
|
|
8507
|
+
return (
|
|
8508
|
+
/** @type {!jspb.Map<string,!proto.google.protobuf.Value>} */
|
|
8509
|
+
jspb.Message.getMapField(
|
|
8510
|
+
this,
|
|
8511
|
+
15,
|
|
8512
|
+
opt_noLazyCreate,
|
|
8513
|
+
proto.google.protobuf.Value
|
|
8514
|
+
)
|
|
8515
|
+
);
|
|
8516
|
+
};
|
|
8517
|
+
proto.aggregator.Task.prototype.clearInputVariablesMap = function() {
|
|
8518
|
+
this.getInputVariablesMap().clear();
|
|
8519
|
+
return this;
|
|
8520
|
+
};
|
|
8399
8521
|
proto.aggregator.CreateTaskReq.repeatedFields_ = [7, 8];
|
|
8400
8522
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
8401
8523
|
proto.aggregator.CreateTaskReq.prototype.toObject = function(opt_includeInstance) {
|
|
@@ -8418,7 +8540,8 @@ var require_avs_pb = __commonJS({
|
|
|
8418
8540
|
msg.getEdgesList(),
|
|
8419
8541
|
proto.aggregator.TaskEdge.toObject,
|
|
8420
8542
|
includeInstance
|
|
8421
|
-
)
|
|
8543
|
+
),
|
|
8544
|
+
inputVariablesMap: (f = msg.getInputVariablesMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : []
|
|
8422
8545
|
};
|
|
8423
8546
|
if (includeInstance) {
|
|
8424
8547
|
obj.$jspbMessageInstance = msg;
|
|
@@ -8488,6 +8611,12 @@ var require_avs_pb = __commonJS({
|
|
|
8488
8611
|
reader.readMessage(value, proto.aggregator.TaskEdge.deserializeBinaryFromReader);
|
|
8489
8612
|
msg.addEdges(value);
|
|
8490
8613
|
break;
|
|
8614
|
+
case 9:
|
|
8615
|
+
var value = msg.getInputVariablesMap();
|
|
8616
|
+
reader.readMessage(value, function(message, reader2) {
|
|
8617
|
+
jspb.Map.deserializeBinary(message, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value());
|
|
8618
|
+
});
|
|
8619
|
+
break;
|
|
8491
8620
|
default:
|
|
8492
8621
|
reader.skipField();
|
|
8493
8622
|
break;
|
|
@@ -8561,6 +8690,10 @@ var require_avs_pb = __commonJS({
|
|
|
8561
8690
|
proto.aggregator.TaskEdge.serializeBinaryToWriter
|
|
8562
8691
|
);
|
|
8563
8692
|
}
|
|
8693
|
+
f = message.getInputVariablesMap(true);
|
|
8694
|
+
if (f && f.getLength() > 0) {
|
|
8695
|
+
f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter);
|
|
8696
|
+
}
|
|
8564
8697
|
};
|
|
8565
8698
|
proto.aggregator.CreateTaskReq.prototype.getTrigger = function() {
|
|
8566
8699
|
return (
|
|
@@ -8652,6 +8785,21 @@ var require_avs_pb = __commonJS({
|
|
|
8652
8785
|
proto.aggregator.CreateTaskReq.prototype.clearEdgesList = function() {
|
|
8653
8786
|
return this.setEdgesList([]);
|
|
8654
8787
|
};
|
|
8788
|
+
proto.aggregator.CreateTaskReq.prototype.getInputVariablesMap = function(opt_noLazyCreate) {
|
|
8789
|
+
return (
|
|
8790
|
+
/** @type {!jspb.Map<string,!proto.google.protobuf.Value>} */
|
|
8791
|
+
jspb.Message.getMapField(
|
|
8792
|
+
this,
|
|
8793
|
+
9,
|
|
8794
|
+
opt_noLazyCreate,
|
|
8795
|
+
proto.google.protobuf.Value
|
|
8796
|
+
)
|
|
8797
|
+
);
|
|
8798
|
+
};
|
|
8799
|
+
proto.aggregator.CreateTaskReq.prototype.clearInputVariablesMap = function() {
|
|
8800
|
+
this.getInputVariablesMap().clear();
|
|
8801
|
+
return this;
|
|
8802
|
+
};
|
|
8655
8803
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
8656
8804
|
proto.aggregator.CreateTaskResp.prototype.toObject = function(opt_includeInstance) {
|
|
8657
8805
|
return proto.aggregator.CreateTaskResp.toObject(opt_includeInstance, this);
|
|
@@ -17839,6 +17987,7 @@ var Workflow = class _Workflow {
|
|
|
17839
17987
|
this.status = props.status;
|
|
17840
17988
|
this.completedAt = props.completedAt;
|
|
17841
17989
|
this.lastRanAt = props.lastRanAt;
|
|
17990
|
+
this.inputVariables = props.inputVariables;
|
|
17842
17991
|
}
|
|
17843
17992
|
/**
|
|
17844
17993
|
* Create an instance of Workflow from AVS getWorkflow response
|
|
@@ -17939,6 +18088,12 @@ var Workflow = class _Workflow {
|
|
|
17939
18088
|
if (this.name) {
|
|
17940
18089
|
request.setName(this.name);
|
|
17941
18090
|
}
|
|
18091
|
+
if (this.inputVariables) {
|
|
18092
|
+
const inputVarsMap = request.getInputVariablesMap();
|
|
18093
|
+
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
18094
|
+
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
18095
|
+
}
|
|
18096
|
+
}
|
|
17942
18097
|
return request;
|
|
17943
18098
|
}
|
|
17944
18099
|
/**
|
|
@@ -17960,7 +18115,8 @@ var Workflow = class _Workflow {
|
|
|
17960
18115
|
name: this.name,
|
|
17961
18116
|
status: this.status,
|
|
17962
18117
|
completedAt: this.completedAt,
|
|
17963
|
-
lastRanAt: this.lastRanAt
|
|
18118
|
+
lastRanAt: this.lastRanAt,
|
|
18119
|
+
inputVariables: this.inputVariables
|
|
17964
18120
|
};
|
|
17965
18121
|
}
|
|
17966
18122
|
};
|
|
@@ -17987,6 +18143,9 @@ var Step = class _Step {
|
|
|
17987
18143
|
this.endAt = props.endAt;
|
|
17988
18144
|
this.metadata = props.metadata;
|
|
17989
18145
|
this.executionContext = props.executionContext;
|
|
18146
|
+
this.gasUsed = props.gasUsed;
|
|
18147
|
+
this.gasPrice = props.gasPrice;
|
|
18148
|
+
this.totalGasCost = props.totalGasCost;
|
|
17990
18149
|
}
|
|
17991
18150
|
/**
|
|
17992
18151
|
* Convert Step instance to plain object (StepProps)
|
|
@@ -18006,7 +18165,10 @@ var Step = class _Step {
|
|
|
18006
18165
|
startAt: this.startAt,
|
|
18007
18166
|
endAt: this.endAt,
|
|
18008
18167
|
metadata: this.metadata,
|
|
18009
|
-
executionContext: this.executionContext
|
|
18168
|
+
executionContext: this.executionContext,
|
|
18169
|
+
...this.gasUsed && { gasUsed: this.gasUsed },
|
|
18170
|
+
...this.gasPrice && { gasPrice: this.gasPrice },
|
|
18171
|
+
...this.totalGasCost && { totalGasCost: this.totalGasCost }
|
|
18010
18172
|
};
|
|
18011
18173
|
}
|
|
18012
18174
|
static getOutput(step) {
|
|
@@ -18123,6 +18285,9 @@ var Step = class _Step {
|
|
|
18123
18285
|
const getInputsList = () => typeof step.getInputsList === "function" ? step.getInputsList() : step.inputsList || [];
|
|
18124
18286
|
const getStartAt = () => typeof step.getStartAt === "function" ? step.getStartAt() : step.startAt;
|
|
18125
18287
|
const getEndAt = () => typeof step.getEndAt === "function" ? step.getEndAt() : step.endAt;
|
|
18288
|
+
const getGasUsed = () => typeof step.getGasUsed === "function" ? step.getGasUsed() : step.gasUsed;
|
|
18289
|
+
const getGasPrice = () => typeof step.getGasPrice === "function" ? step.getGasPrice() : step.gasPrice;
|
|
18290
|
+
const getTotalGasCost = () => typeof step.getTotalGasCost === "function" ? step.getTotalGasCost() : step.totalGasCost;
|
|
18126
18291
|
let stepMetadata = void 0;
|
|
18127
18292
|
if (typeof step.getMetadata === "function" && step.getMetadata()) {
|
|
18128
18293
|
try {
|
|
@@ -18158,7 +18323,10 @@ var Step = class _Step {
|
|
|
18158
18323
|
startAt: getStartAt(),
|
|
18159
18324
|
endAt: getEndAt(),
|
|
18160
18325
|
metadata: stepMetadata,
|
|
18161
|
-
executionContext
|
|
18326
|
+
executionContext,
|
|
18327
|
+
gasUsed: getGasUsed() || void 0,
|
|
18328
|
+
gasPrice: getGasPrice() || void 0,
|
|
18329
|
+
totalGasCost: getTotalGasCost() || void 0
|
|
18162
18330
|
});
|
|
18163
18331
|
}
|
|
18164
18332
|
// Client side does not generate the step, so there's no toRequest() method
|
|
@@ -18190,6 +18358,7 @@ var Execution2 = class _Execution {
|
|
|
18190
18358
|
this.error = props.error;
|
|
18191
18359
|
this.index = props.index;
|
|
18192
18360
|
this.steps = props.steps.map((s) => new step_default(s));
|
|
18361
|
+
this.totalGasCost = props.totalGasCost;
|
|
18193
18362
|
}
|
|
18194
18363
|
/**
|
|
18195
18364
|
* Convert Execution instance to plain object (ExecutionProps)
|
|
@@ -18203,7 +18372,8 @@ var Execution2 = class _Execution {
|
|
|
18203
18372
|
status: this.status,
|
|
18204
18373
|
error: this.error,
|
|
18205
18374
|
index: this.index,
|
|
18206
|
-
steps: this.steps.map((step) => step.toJson())
|
|
18375
|
+
steps: this.steps.map((step) => step.toJson()),
|
|
18376
|
+
...this.totalGasCost && { totalGasCost: this.totalGasCost }
|
|
18207
18377
|
};
|
|
18208
18378
|
}
|
|
18209
18379
|
static fromResponse(execution) {
|
|
@@ -18214,6 +18384,7 @@ var Execution2 = class _Execution {
|
|
|
18214
18384
|
status: convertProtobufExecutionStatusToTypes(execution.getStatus()),
|
|
18215
18385
|
error: execution.getError(),
|
|
18216
18386
|
index: execution.getIndex(),
|
|
18387
|
+
totalGasCost: execution.getTotalGasCost() || void 0,
|
|
18217
18388
|
steps: execution.getStepsList().map((step) => step_default.fromResponse(step))
|
|
18218
18389
|
});
|
|
18219
18390
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -7011,6 +7011,7 @@ var require_avs_pb = __commonJS({
|
|
|
7011
7011
|
status: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
7012
7012
|
error: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
|
7013
7013
|
index: jspb.Message.getFieldWithDefault(msg, 6, 0),
|
|
7014
|
+
totalGasCost: jspb.Message.getFieldWithDefault(msg, 30, ""),
|
|
7014
7015
|
stepsList: jspb.Message.toObjectList(
|
|
7015
7016
|
msg.getStepsList(),
|
|
7016
7017
|
proto.aggregator.Execution.Step.toObject,
|
|
@@ -7077,6 +7078,13 @@ var require_avs_pb = __commonJS({
|
|
|
7077
7078
|
);
|
|
7078
7079
|
msg.setIndex(value);
|
|
7079
7080
|
break;
|
|
7081
|
+
case 30:
|
|
7082
|
+
var value = (
|
|
7083
|
+
/** @type {string} */
|
|
7084
|
+
reader.readString()
|
|
7085
|
+
);
|
|
7086
|
+
msg.setTotalGasCost(value);
|
|
7087
|
+
break;
|
|
7080
7088
|
case 8:
|
|
7081
7089
|
var value = new proto.aggregator.Execution.Step();
|
|
7082
7090
|
reader.readMessage(value, proto.aggregator.Execution.Step.deserializeBinaryFromReader);
|
|
@@ -7138,6 +7146,13 @@ var require_avs_pb = __commonJS({
|
|
|
7138
7146
|
f
|
|
7139
7147
|
);
|
|
7140
7148
|
}
|
|
7149
|
+
f = message.getTotalGasCost();
|
|
7150
|
+
if (f.length > 0) {
|
|
7151
|
+
writer.writeString(
|
|
7152
|
+
30,
|
|
7153
|
+
f
|
|
7154
|
+
);
|
|
7155
|
+
}
|
|
7141
7156
|
f = message.getStepsList();
|
|
7142
7157
|
if (f.length > 0) {
|
|
7143
7158
|
writer.writeRepeatedMessage(
|
|
@@ -7188,6 +7203,9 @@ var require_avs_pb = __commonJS({
|
|
|
7188
7203
|
config: (f = msg.getConfig()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
|
|
7189
7204
|
metadata: (f = msg.getMetadata()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
|
|
7190
7205
|
executionContext: (f = msg.getExecutionContext()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
|
|
7206
|
+
gasUsed: jspb.Message.getFieldWithDefault(msg, 27, ""),
|
|
7207
|
+
gasPrice: jspb.Message.getFieldWithDefault(msg, 28, ""),
|
|
7208
|
+
totalGasCost: jspb.Message.getFieldWithDefault(msg, 29, ""),
|
|
7191
7209
|
blockTrigger: (f = msg.getBlockTrigger()) && proto.aggregator.BlockTrigger.Output.toObject(includeInstance, f),
|
|
7192
7210
|
fixedTimeTrigger: (f = msg.getFixedTimeTrigger()) && proto.aggregator.FixedTimeTrigger.Output.toObject(includeInstance, f),
|
|
7193
7211
|
cronTrigger: (f = msg.getCronTrigger()) && proto.aggregator.CronTrigger.Output.toObject(includeInstance, f),
|
|
@@ -7287,6 +7305,27 @@ var require_avs_pb = __commonJS({
|
|
|
7287
7305
|
reader.readMessage(value, google_protobuf_struct_pb5.Value.deserializeBinaryFromReader);
|
|
7288
7306
|
msg.setExecutionContext(value);
|
|
7289
7307
|
break;
|
|
7308
|
+
case 27:
|
|
7309
|
+
var value = (
|
|
7310
|
+
/** @type {string} */
|
|
7311
|
+
reader.readString()
|
|
7312
|
+
);
|
|
7313
|
+
msg.setGasUsed(value);
|
|
7314
|
+
break;
|
|
7315
|
+
case 28:
|
|
7316
|
+
var value = (
|
|
7317
|
+
/** @type {string} */
|
|
7318
|
+
reader.readString()
|
|
7319
|
+
);
|
|
7320
|
+
msg.setGasPrice(value);
|
|
7321
|
+
break;
|
|
7322
|
+
case 29:
|
|
7323
|
+
var value = (
|
|
7324
|
+
/** @type {string} */
|
|
7325
|
+
reader.readString()
|
|
7326
|
+
);
|
|
7327
|
+
msg.setTotalGasCost(value);
|
|
7328
|
+
break;
|
|
7290
7329
|
case 20:
|
|
7291
7330
|
var value = new proto.aggregator.BlockTrigger.Output();
|
|
7292
7331
|
reader.readMessage(value, proto.aggregator.BlockTrigger.Output.deserializeBinaryFromReader);
|
|
@@ -7458,6 +7497,27 @@ var require_avs_pb = __commonJS({
|
|
|
7458
7497
|
google_protobuf_struct_pb5.Value.serializeBinaryToWriter
|
|
7459
7498
|
);
|
|
7460
7499
|
}
|
|
7500
|
+
f = message.getGasUsed();
|
|
7501
|
+
if (f.length > 0) {
|
|
7502
|
+
writer.writeString(
|
|
7503
|
+
27,
|
|
7504
|
+
f
|
|
7505
|
+
);
|
|
7506
|
+
}
|
|
7507
|
+
f = message.getGasPrice();
|
|
7508
|
+
if (f.length > 0) {
|
|
7509
|
+
writer.writeString(
|
|
7510
|
+
28,
|
|
7511
|
+
f
|
|
7512
|
+
);
|
|
7513
|
+
}
|
|
7514
|
+
f = message.getTotalGasCost();
|
|
7515
|
+
if (f.length > 0) {
|
|
7516
|
+
writer.writeString(
|
|
7517
|
+
29,
|
|
7518
|
+
f
|
|
7519
|
+
);
|
|
7520
|
+
}
|
|
7461
7521
|
f = message.getBlockTrigger();
|
|
7462
7522
|
if (f != null) {
|
|
7463
7523
|
writer.writeMessage(
|
|
@@ -7699,6 +7759,33 @@ var require_avs_pb = __commonJS({
|
|
|
7699
7759
|
proto.aggregator.Execution.Step.prototype.hasExecutionContext = function() {
|
|
7700
7760
|
return jspb.Message.getField(this, 26) != null;
|
|
7701
7761
|
};
|
|
7762
|
+
proto.aggregator.Execution.Step.prototype.getGasUsed = function() {
|
|
7763
|
+
return (
|
|
7764
|
+
/** @type {string} */
|
|
7765
|
+
jspb.Message.getFieldWithDefault(this, 27, "")
|
|
7766
|
+
);
|
|
7767
|
+
};
|
|
7768
|
+
proto.aggregator.Execution.Step.prototype.setGasUsed = function(value) {
|
|
7769
|
+
return jspb.Message.setProto3StringField(this, 27, value);
|
|
7770
|
+
};
|
|
7771
|
+
proto.aggregator.Execution.Step.prototype.getGasPrice = function() {
|
|
7772
|
+
return (
|
|
7773
|
+
/** @type {string} */
|
|
7774
|
+
jspb.Message.getFieldWithDefault(this, 28, "")
|
|
7775
|
+
);
|
|
7776
|
+
};
|
|
7777
|
+
proto.aggregator.Execution.Step.prototype.setGasPrice = function(value) {
|
|
7778
|
+
return jspb.Message.setProto3StringField(this, 28, value);
|
|
7779
|
+
};
|
|
7780
|
+
proto.aggregator.Execution.Step.prototype.getTotalGasCost = function() {
|
|
7781
|
+
return (
|
|
7782
|
+
/** @type {string} */
|
|
7783
|
+
jspb.Message.getFieldWithDefault(this, 29, "")
|
|
7784
|
+
);
|
|
7785
|
+
};
|
|
7786
|
+
proto.aggregator.Execution.Step.prototype.setTotalGasCost = function(value) {
|
|
7787
|
+
return jspb.Message.setProto3StringField(this, 29, value);
|
|
7788
|
+
};
|
|
7702
7789
|
proto.aggregator.Execution.Step.prototype.getBlockTrigger = function() {
|
|
7703
7790
|
return (
|
|
7704
7791
|
/** @type{?proto.aggregator.BlockTrigger.Output} */
|
|
@@ -7981,6 +8068,15 @@ var require_avs_pb = __commonJS({
|
|
|
7981
8068
|
proto.aggregator.Execution.prototype.setIndex = function(value) {
|
|
7982
8069
|
return jspb.Message.setProto3IntField(this, 6, value);
|
|
7983
8070
|
};
|
|
8071
|
+
proto.aggregator.Execution.prototype.getTotalGasCost = function() {
|
|
8072
|
+
return (
|
|
8073
|
+
/** @type {string} */
|
|
8074
|
+
jspb.Message.getFieldWithDefault(this, 30, "")
|
|
8075
|
+
);
|
|
8076
|
+
};
|
|
8077
|
+
proto.aggregator.Execution.prototype.setTotalGasCost = function(value) {
|
|
8078
|
+
return jspb.Message.setProto3StringField(this, 30, value);
|
|
8079
|
+
};
|
|
7984
8080
|
proto.aggregator.Execution.prototype.getStepsList = function() {
|
|
7985
8081
|
return (
|
|
7986
8082
|
/** @type{!Array<!proto.aggregator.Execution.Step>} */
|
|
@@ -8024,7 +8120,8 @@ var require_avs_pb = __commonJS({
|
|
|
8024
8120
|
msg.getEdgesList(),
|
|
8025
8121
|
proto.aggregator.TaskEdge.toObject,
|
|
8026
8122
|
includeInstance
|
|
8027
|
-
)
|
|
8123
|
+
),
|
|
8124
|
+
inputVariablesMap: (f = msg.getInputVariablesMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : []
|
|
8028
8125
|
};
|
|
8029
8126
|
if (includeInstance) {
|
|
8030
8127
|
obj.$jspbMessageInstance = msg;
|
|
@@ -8136,6 +8233,12 @@ var require_avs_pb = __commonJS({
|
|
|
8136
8233
|
reader.readMessage(value, proto.aggregator.TaskEdge.deserializeBinaryFromReader);
|
|
8137
8234
|
msg.addEdges(value);
|
|
8138
8235
|
break;
|
|
8236
|
+
case 15:
|
|
8237
|
+
var value = msg.getInputVariablesMap();
|
|
8238
|
+
reader.readMessage(value, function(message, reader2) {
|
|
8239
|
+
jspb.Map.deserializeBinary(message, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value());
|
|
8240
|
+
});
|
|
8241
|
+
break;
|
|
8139
8242
|
default:
|
|
8140
8243
|
reader.skipField();
|
|
8141
8244
|
break;
|
|
@@ -8251,6 +8354,10 @@ var require_avs_pb = __commonJS({
|
|
|
8251
8354
|
proto.aggregator.TaskEdge.serializeBinaryToWriter
|
|
8252
8355
|
);
|
|
8253
8356
|
}
|
|
8357
|
+
f = message.getInputVariablesMap(true);
|
|
8358
|
+
if (f && f.getLength() > 0) {
|
|
8359
|
+
f.serializeBinary(15, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter);
|
|
8360
|
+
}
|
|
8254
8361
|
};
|
|
8255
8362
|
proto.aggregator.Task.prototype.getId = function() {
|
|
8256
8363
|
return (
|
|
@@ -8396,6 +8503,21 @@ var require_avs_pb = __commonJS({
|
|
|
8396
8503
|
proto.aggregator.Task.prototype.clearEdgesList = function() {
|
|
8397
8504
|
return this.setEdgesList([]);
|
|
8398
8505
|
};
|
|
8506
|
+
proto.aggregator.Task.prototype.getInputVariablesMap = function(opt_noLazyCreate) {
|
|
8507
|
+
return (
|
|
8508
|
+
/** @type {!jspb.Map<string,!proto.google.protobuf.Value>} */
|
|
8509
|
+
jspb.Message.getMapField(
|
|
8510
|
+
this,
|
|
8511
|
+
15,
|
|
8512
|
+
opt_noLazyCreate,
|
|
8513
|
+
proto.google.protobuf.Value
|
|
8514
|
+
)
|
|
8515
|
+
);
|
|
8516
|
+
};
|
|
8517
|
+
proto.aggregator.Task.prototype.clearInputVariablesMap = function() {
|
|
8518
|
+
this.getInputVariablesMap().clear();
|
|
8519
|
+
return this;
|
|
8520
|
+
};
|
|
8399
8521
|
proto.aggregator.CreateTaskReq.repeatedFields_ = [7, 8];
|
|
8400
8522
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
8401
8523
|
proto.aggregator.CreateTaskReq.prototype.toObject = function(opt_includeInstance) {
|
|
@@ -8418,7 +8540,8 @@ var require_avs_pb = __commonJS({
|
|
|
8418
8540
|
msg.getEdgesList(),
|
|
8419
8541
|
proto.aggregator.TaskEdge.toObject,
|
|
8420
8542
|
includeInstance
|
|
8421
|
-
)
|
|
8543
|
+
),
|
|
8544
|
+
inputVariablesMap: (f = msg.getInputVariablesMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : []
|
|
8422
8545
|
};
|
|
8423
8546
|
if (includeInstance) {
|
|
8424
8547
|
obj.$jspbMessageInstance = msg;
|
|
@@ -8488,6 +8611,12 @@ var require_avs_pb = __commonJS({
|
|
|
8488
8611
|
reader.readMessage(value, proto.aggregator.TaskEdge.deserializeBinaryFromReader);
|
|
8489
8612
|
msg.addEdges(value);
|
|
8490
8613
|
break;
|
|
8614
|
+
case 9:
|
|
8615
|
+
var value = msg.getInputVariablesMap();
|
|
8616
|
+
reader.readMessage(value, function(message, reader2) {
|
|
8617
|
+
jspb.Map.deserializeBinary(message, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value());
|
|
8618
|
+
});
|
|
8619
|
+
break;
|
|
8491
8620
|
default:
|
|
8492
8621
|
reader.skipField();
|
|
8493
8622
|
break;
|
|
@@ -8561,6 +8690,10 @@ var require_avs_pb = __commonJS({
|
|
|
8561
8690
|
proto.aggregator.TaskEdge.serializeBinaryToWriter
|
|
8562
8691
|
);
|
|
8563
8692
|
}
|
|
8693
|
+
f = message.getInputVariablesMap(true);
|
|
8694
|
+
if (f && f.getLength() > 0) {
|
|
8695
|
+
f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter);
|
|
8696
|
+
}
|
|
8564
8697
|
};
|
|
8565
8698
|
proto.aggregator.CreateTaskReq.prototype.getTrigger = function() {
|
|
8566
8699
|
return (
|
|
@@ -8652,6 +8785,21 @@ var require_avs_pb = __commonJS({
|
|
|
8652
8785
|
proto.aggregator.CreateTaskReq.prototype.clearEdgesList = function() {
|
|
8653
8786
|
return this.setEdgesList([]);
|
|
8654
8787
|
};
|
|
8788
|
+
proto.aggregator.CreateTaskReq.prototype.getInputVariablesMap = function(opt_noLazyCreate) {
|
|
8789
|
+
return (
|
|
8790
|
+
/** @type {!jspb.Map<string,!proto.google.protobuf.Value>} */
|
|
8791
|
+
jspb.Message.getMapField(
|
|
8792
|
+
this,
|
|
8793
|
+
9,
|
|
8794
|
+
opt_noLazyCreate,
|
|
8795
|
+
proto.google.protobuf.Value
|
|
8796
|
+
)
|
|
8797
|
+
);
|
|
8798
|
+
};
|
|
8799
|
+
proto.aggregator.CreateTaskReq.prototype.clearInputVariablesMap = function() {
|
|
8800
|
+
this.getInputVariablesMap().clear();
|
|
8801
|
+
return this;
|
|
8802
|
+
};
|
|
8655
8803
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
8656
8804
|
proto.aggregator.CreateTaskResp.prototype.toObject = function(opt_includeInstance) {
|
|
8657
8805
|
return proto.aggregator.CreateTaskResp.toObject(opt_includeInstance, this);
|
|
@@ -17845,6 +17993,7 @@ var Workflow = class _Workflow {
|
|
|
17845
17993
|
this.status = props.status;
|
|
17846
17994
|
this.completedAt = props.completedAt;
|
|
17847
17995
|
this.lastRanAt = props.lastRanAt;
|
|
17996
|
+
this.inputVariables = props.inputVariables;
|
|
17848
17997
|
}
|
|
17849
17998
|
/**
|
|
17850
17999
|
* Create an instance of Workflow from AVS getWorkflow response
|
|
@@ -17945,6 +18094,12 @@ var Workflow = class _Workflow {
|
|
|
17945
18094
|
if (this.name) {
|
|
17946
18095
|
request.setName(this.name);
|
|
17947
18096
|
}
|
|
18097
|
+
if (this.inputVariables) {
|
|
18098
|
+
const inputVarsMap = request.getInputVariablesMap();
|
|
18099
|
+
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
18100
|
+
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
18101
|
+
}
|
|
18102
|
+
}
|
|
17948
18103
|
return request;
|
|
17949
18104
|
}
|
|
17950
18105
|
/**
|
|
@@ -17966,7 +18121,8 @@ var Workflow = class _Workflow {
|
|
|
17966
18121
|
name: this.name,
|
|
17967
18122
|
status: this.status,
|
|
17968
18123
|
completedAt: this.completedAt,
|
|
17969
|
-
lastRanAt: this.lastRanAt
|
|
18124
|
+
lastRanAt: this.lastRanAt,
|
|
18125
|
+
inputVariables: this.inputVariables
|
|
17970
18126
|
};
|
|
17971
18127
|
}
|
|
17972
18128
|
};
|
|
@@ -17993,6 +18149,9 @@ var Step = class _Step {
|
|
|
17993
18149
|
this.endAt = props.endAt;
|
|
17994
18150
|
this.metadata = props.metadata;
|
|
17995
18151
|
this.executionContext = props.executionContext;
|
|
18152
|
+
this.gasUsed = props.gasUsed;
|
|
18153
|
+
this.gasPrice = props.gasPrice;
|
|
18154
|
+
this.totalGasCost = props.totalGasCost;
|
|
17996
18155
|
}
|
|
17997
18156
|
/**
|
|
17998
18157
|
* Convert Step instance to plain object (StepProps)
|
|
@@ -18012,7 +18171,10 @@ var Step = class _Step {
|
|
|
18012
18171
|
startAt: this.startAt,
|
|
18013
18172
|
endAt: this.endAt,
|
|
18014
18173
|
metadata: this.metadata,
|
|
18015
|
-
executionContext: this.executionContext
|
|
18174
|
+
executionContext: this.executionContext,
|
|
18175
|
+
...this.gasUsed && { gasUsed: this.gasUsed },
|
|
18176
|
+
...this.gasPrice && { gasPrice: this.gasPrice },
|
|
18177
|
+
...this.totalGasCost && { totalGasCost: this.totalGasCost }
|
|
18016
18178
|
};
|
|
18017
18179
|
}
|
|
18018
18180
|
static getOutput(step) {
|
|
@@ -18129,6 +18291,9 @@ var Step = class _Step {
|
|
|
18129
18291
|
const getInputsList = () => typeof step.getInputsList === "function" ? step.getInputsList() : step.inputsList || [];
|
|
18130
18292
|
const getStartAt = () => typeof step.getStartAt === "function" ? step.getStartAt() : step.startAt;
|
|
18131
18293
|
const getEndAt = () => typeof step.getEndAt === "function" ? step.getEndAt() : step.endAt;
|
|
18294
|
+
const getGasUsed = () => typeof step.getGasUsed === "function" ? step.getGasUsed() : step.gasUsed;
|
|
18295
|
+
const getGasPrice = () => typeof step.getGasPrice === "function" ? step.getGasPrice() : step.gasPrice;
|
|
18296
|
+
const getTotalGasCost = () => typeof step.getTotalGasCost === "function" ? step.getTotalGasCost() : step.totalGasCost;
|
|
18132
18297
|
let stepMetadata = void 0;
|
|
18133
18298
|
if (typeof step.getMetadata === "function" && step.getMetadata()) {
|
|
18134
18299
|
try {
|
|
@@ -18164,7 +18329,10 @@ var Step = class _Step {
|
|
|
18164
18329
|
startAt: getStartAt(),
|
|
18165
18330
|
endAt: getEndAt(),
|
|
18166
18331
|
metadata: stepMetadata,
|
|
18167
|
-
executionContext
|
|
18332
|
+
executionContext,
|
|
18333
|
+
gasUsed: getGasUsed() || void 0,
|
|
18334
|
+
gasPrice: getGasPrice() || void 0,
|
|
18335
|
+
totalGasCost: getTotalGasCost() || void 0
|
|
18168
18336
|
});
|
|
18169
18337
|
}
|
|
18170
18338
|
// Client side does not generate the step, so there's no toRequest() method
|
|
@@ -18196,6 +18364,7 @@ var Execution2 = class _Execution {
|
|
|
18196
18364
|
this.error = props.error;
|
|
18197
18365
|
this.index = props.index;
|
|
18198
18366
|
this.steps = props.steps.map((s) => new step_default(s));
|
|
18367
|
+
this.totalGasCost = props.totalGasCost;
|
|
18199
18368
|
}
|
|
18200
18369
|
/**
|
|
18201
18370
|
* Convert Execution instance to plain object (ExecutionProps)
|
|
@@ -18209,7 +18378,8 @@ var Execution2 = class _Execution {
|
|
|
18209
18378
|
status: this.status,
|
|
18210
18379
|
error: this.error,
|
|
18211
18380
|
index: this.index,
|
|
18212
|
-
steps: this.steps.map((step) => step.toJson())
|
|
18381
|
+
steps: this.steps.map((step) => step.toJson()),
|
|
18382
|
+
...this.totalGasCost && { totalGasCost: this.totalGasCost }
|
|
18213
18383
|
};
|
|
18214
18384
|
}
|
|
18215
18385
|
static fromResponse(execution) {
|
|
@@ -18220,6 +18390,7 @@ var Execution2 = class _Execution {
|
|
|
18220
18390
|
status: convertProtobufExecutionStatusToTypes(execution.getStatus()),
|
|
18221
18391
|
error: execution.getError(),
|
|
18222
18392
|
index: execution.getIndex(),
|
|
18393
|
+
totalGasCost: execution.getTotalGasCost() || void 0,
|
|
18223
18394
|
steps: execution.getStepsList().map((step) => step_default.fromResponse(step))
|
|
18224
18395
|
});
|
|
18225
18396
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { EdgeProps } from "@avaprotocol/types";
|
|
3
|
+
declare class Edge implements EdgeProps {
|
|
4
|
+
id: string;
|
|
5
|
+
source: string;
|
|
6
|
+
target: string;
|
|
7
|
+
constructor(edge: EdgeProps);
|
|
8
|
+
static fromResponse(edge: avs_pb.TaskEdge): Edge;
|
|
9
|
+
toRequest(): avs_pb.TaskEdge;
|
|
10
|
+
}
|
|
11
|
+
export default Edge;
|
|
12
|
+
//# sourceMappingURL=edge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/models/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAqC,cAAc,EAAa,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACnH,OAAO,IAAI,MAAM,QAAQ,CAAC;AAuB1B,cAAM,SAAU,YAAW,cAAc;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/models/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAqC,cAAc,EAAa,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACnH,OAAO,IAAI,MAAM,QAAQ,CAAC;AAuB1B,cAAM,SAAU,YAAW,cAAc;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;gBAEV,KAAK,EAAE,cAAc;IAYjC;;;OAGG;IACH,MAAM,IAAI,cAAc;IAaxB,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;CAgB5D;AAED,eAAe,SAAS,CAAC"}
|
package/dist/models/execution.js
CHANGED
|
@@ -28,6 +28,7 @@ class Execution {
|
|
|
28
28
|
this.error = props.error;
|
|
29
29
|
this.index = props.index;
|
|
30
30
|
this.steps = props.steps.map(s => new Step(s));
|
|
31
|
+
this.totalGasCost = props.totalGasCost;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* Convert Execution instance to plain object (ExecutionProps)
|
|
@@ -42,6 +43,7 @@ class Execution {
|
|
|
42
43
|
error: this.error,
|
|
43
44
|
index: this.index,
|
|
44
45
|
steps: this.steps.map(step => step.toJson()),
|
|
46
|
+
...(this.totalGasCost && { totalGasCost: this.totalGasCost }),
|
|
45
47
|
};
|
|
46
48
|
}
|
|
47
49
|
static fromResponse(execution) {
|
|
@@ -52,6 +54,7 @@ class Execution {
|
|
|
52
54
|
status: convertProtobufExecutionStatusToTypes(execution.getStatus()),
|
|
53
55
|
error: execution.getError(),
|
|
54
56
|
index: execution.getIndex(),
|
|
57
|
+
totalGasCost: execution.getTotalGasCost() || undefined,
|
|
55
58
|
steps: execution
|
|
56
59
|
.getStepsList()
|
|
57
60
|
.map((step) => Step.fromResponse(step)),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BranchNodeProps } from "@avaprotocol/types";
|
|
2
|
+
import Node from "./interface";
|
|
3
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
4
|
+
declare class BranchNode extends Node {
|
|
5
|
+
constructor(props: BranchNodeProps);
|
|
6
|
+
static fromResponse(raw: avs_pb.TaskNode): BranchNode;
|
|
7
|
+
toRequest(): avs_pb.TaskNode;
|
|
8
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
9
|
+
}
|
|
10
|
+
export default BranchNode;
|
|
11
|
+
//# sourceMappingURL=branch.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { ContractReadNodeData, ContractReadNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class ContractReadNode extends Node {
|
|
5
|
+
constructor(props: ContractReadNodeProps);
|
|
6
|
+
/**
|
|
7
|
+
* Create a protobuf ContractReadNode from config data
|
|
8
|
+
* @param configData - The configuration data for the contract read node
|
|
9
|
+
* @returns Configured avs_pb.ContractReadNode
|
|
10
|
+
*/
|
|
11
|
+
static createProtobufNode(configData: ContractReadNodeData): avs_pb.ContractReadNode;
|
|
12
|
+
static fromResponse(raw: avs_pb.TaskNode): ContractReadNode;
|
|
13
|
+
toRequest(): avs_pb.TaskNode;
|
|
14
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): unknown | null;
|
|
15
|
+
}
|
|
16
|
+
export default ContractReadNode;
|
|
17
|
+
//# sourceMappingURL=contractRead.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { CustomCodeLang, CustomCodeNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class CustomCodeNode extends Node {
|
|
5
|
+
constructor(props: CustomCodeNodeProps);
|
|
6
|
+
/**
|
|
7
|
+
* Create a protobuf CustomCodeNode from config data
|
|
8
|
+
* @param configData - The configuration data for the custom code node
|
|
9
|
+
* @returns Configured avs_pb.CustomCodeNode
|
|
10
|
+
*/
|
|
11
|
+
static createProtobufNode(configData: {
|
|
12
|
+
lang: CustomCodeLang | string | number;
|
|
13
|
+
source: string;
|
|
14
|
+
}): avs_pb.CustomCodeNode;
|
|
15
|
+
static fromResponse(raw: avs_pb.TaskNode): CustomCodeNode;
|
|
16
|
+
toRequest(): avs_pb.TaskNode;
|
|
17
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
18
|
+
}
|
|
19
|
+
export default CustomCodeNode;
|
|
20
|
+
//# sourceMappingURL=customCode.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { ETHTransferNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class ETHTransferNode extends Node {
|
|
5
|
+
constructor(props: ETHTransferNodeProps);
|
|
6
|
+
/**
|
|
7
|
+
* Create a protobuf ETHTransferNode from config data
|
|
8
|
+
* @param configData - The configuration data for the ETH transfer node
|
|
9
|
+
* @returns Configured avs_pb.ETHTransferNode
|
|
10
|
+
*/
|
|
11
|
+
static createProtobufNode(configData: {
|
|
12
|
+
destination: string;
|
|
13
|
+
amount: string;
|
|
14
|
+
}): avs_pb.ETHTransferNode;
|
|
15
|
+
static fromResponse(raw: avs_pb.TaskNode): ETHTransferNode;
|
|
16
|
+
toRequest(): avs_pb.TaskNode;
|
|
17
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
18
|
+
}
|
|
19
|
+
export default ETHTransferNode;
|
|
20
|
+
//# sourceMappingURL=ethTransfer.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import ContractWriteNode from "./contractWrite";
|
|
3
|
+
import CustomCodeNode from "./customCode";
|
|
4
|
+
import GraphQLQueryNode from "./graphqlQuery";
|
|
5
|
+
import Node from "./interface";
|
|
6
|
+
import RestAPINode from "./restApi";
|
|
7
|
+
import ContractReadNode from "./contractRead";
|
|
8
|
+
import ETHTransferNode from "./ethTransfer";
|
|
9
|
+
import BranchNode from "./branch";
|
|
10
|
+
import FilterNode from "./filter";
|
|
11
|
+
import LoopNode from "./loop";
|
|
12
|
+
import { ContractWriteNodeData, ContractReadNodeData, BranchNodeData, ETHTransferNodeData, GraphQLQueryNodeData, RestAPINodeData, CustomCodeNodeData, FilterNodeData, LoopNodeData, NodeProps, ContractWriteNodeProps, ContractReadNodeProps, BranchNodeProps, ETHTransferNodeProps, GraphQLQueryNodeProps, RestAPINodeProps, CustomCodeNodeProps, FilterNodeProps, LoopNodeProps } from "@avaprotocol/types";
|
|
13
|
+
declare class NodeFactory {
|
|
14
|
+
static create(props: NodeProps): Node;
|
|
15
|
+
static createNodes(props: NodeProps[]): Node[];
|
|
16
|
+
static fromResponse(raw: avs_pb.TaskNode): Node;
|
|
17
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
18
|
+
}
|
|
19
|
+
export default NodeFactory;
|
|
20
|
+
export { Node, ContractWriteNode, ContractReadNode, BranchNode, ETHTransferNode, GraphQLQueryNode, RestAPINode, CustomCodeNode, FilterNode, LoopNode, };
|
|
21
|
+
export type { ContractWriteNodeData, ContractReadNodeData, BranchNodeData, ETHTransferNodeData, GraphQLQueryNodeData, RestAPINodeData, CustomCodeNodeData, FilterNodeData, LoopNodeData, };
|
|
22
|
+
export type { NodeProps, ContractWriteNodeProps, ContractReadNodeProps, BranchNodeProps, ETHTransferNodeProps, GraphQLQueryNodeProps, RestAPINodeProps, CustomCodeNodeProps, FilterNodeProps, LoopNodeProps, };
|
|
23
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { NodeType, NodeProps, NodeData } from "@avaprotocol/types";
|
|
3
|
+
export declare function covertNodeTypeToString(status: avs_pb.TaskNode.TaskTypeCase): NodeType;
|
|
4
|
+
export type ProtobufNodeProps = Omit<avs_pb.TaskNode.AsObject, "ethTransfer" | "contractWrite" | "contractRead" | "graphqlDataQuery" | "restApi" | "branch" | "filter" | "loop" | "customCode"> & {
|
|
5
|
+
data: any;
|
|
6
|
+
};
|
|
7
|
+
export declare const ProtobufNodePropsUtils: {
|
|
8
|
+
getGoStringType: (props: ProtobufNodeProps) => string;
|
|
9
|
+
fromGoStringType: (goStringType: string, baseProps: Omit<ProtobufNodeProps, "type">) => ProtobufNodeProps;
|
|
10
|
+
};
|
|
11
|
+
export default abstract class Node implements NodeProps {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: NodeType;
|
|
15
|
+
data: NodeData;
|
|
16
|
+
constructor(props: NodeProps);
|
|
17
|
+
toRequest(): avs_pb.TaskNode;
|
|
18
|
+
static fromResponse(raw: avs_pb.TaskNode): Node;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Node from "./interface";
|
|
3
|
+
import { LoopNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class LoopNode extends Node {
|
|
5
|
+
constructor(props: LoopNodeProps);
|
|
6
|
+
static fromResponse(raw: avs_pb.TaskNode): LoopNode;
|
|
7
|
+
private static extractRunnerFromProtobuf;
|
|
8
|
+
private static mapExecutionModeFromProtobuf;
|
|
9
|
+
private mapExecutionModeToProtobuf;
|
|
10
|
+
toRequest(): avs_pb.TaskNode;
|
|
11
|
+
private setRunnerOnProtobuf;
|
|
12
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): unknown;
|
|
13
|
+
}
|
|
14
|
+
export default LoopNode;
|
|
15
|
+
//# sourceMappingURL=loop.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { RestAPINodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class RestAPINode extends Node {
|
|
5
|
+
constructor(props: RestAPINodeProps);
|
|
6
|
+
/**
|
|
7
|
+
* Create a protobuf RestAPINode from config data
|
|
8
|
+
* @param configData - The configuration data for the REST API node
|
|
9
|
+
* @returns Configured avs_pb.RestAPINode
|
|
10
|
+
*/
|
|
11
|
+
static createProtobufNode(configData: {
|
|
12
|
+
url: string;
|
|
13
|
+
method: string;
|
|
14
|
+
body?: string;
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
}): avs_pb.RestAPINode;
|
|
17
|
+
static fromResponse(raw: avs_pb.TaskNode): RestAPINode;
|
|
18
|
+
toRequest(): avs_pb.TaskNode;
|
|
19
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): Record<string, unknown> | null;
|
|
20
|
+
}
|
|
21
|
+
export default RestAPINode;
|
|
22
|
+
//# sourceMappingURL=restApi.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { SecretProps } from "@avaprotocol/types";
|
|
3
|
+
declare class Secret implements SecretProps {
|
|
4
|
+
name: string;
|
|
5
|
+
secret?: string;
|
|
6
|
+
workflowId?: string;
|
|
7
|
+
orgId?: string;
|
|
8
|
+
createdAt?: number;
|
|
9
|
+
updatedAt?: number;
|
|
10
|
+
createdBy?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
constructor(props: SecretProps);
|
|
13
|
+
toRequest(): avs_pb.CreateOrUpdateSecretReq;
|
|
14
|
+
}
|
|
15
|
+
export default Secret;
|
|
16
|
+
//# sourceMappingURL=secret.d.ts.map
|
package/dist/models/step.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ declare class Step implements StepProps {
|
|
|
14
14
|
endAt: number;
|
|
15
15
|
metadata?: any;
|
|
16
16
|
executionContext?: any;
|
|
17
|
+
gasUsed?: string;
|
|
18
|
+
gasPrice?: string;
|
|
19
|
+
totalGasCost?: string;
|
|
17
20
|
constructor(props: StepProps);
|
|
18
21
|
/**
|
|
19
22
|
* Convert Step instance to plain object (StepProps)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAMhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,gBAAgB,CAAC,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAMhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;gBAEV,KAAK,EAAE,SAAS;IAmB5B;;;OAGG;IACH,MAAM,IAAI,SAAS;IAqBnB,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,eAAe;IAoC9D,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAiEhC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAkChC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI;CAsHvD;AAED,eAAe,IAAI,CAAC"}
|
package/dist/models/step.js
CHANGED
|
@@ -15,6 +15,9 @@ class Step {
|
|
|
15
15
|
this.endAt = props.endAt;
|
|
16
16
|
this.metadata = props.metadata;
|
|
17
17
|
this.executionContext = props.executionContext;
|
|
18
|
+
this.gasUsed = props.gasUsed;
|
|
19
|
+
this.gasPrice = props.gasPrice;
|
|
20
|
+
this.totalGasCost = props.totalGasCost;
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* Convert Step instance to plain object (StepProps)
|
|
@@ -35,6 +38,9 @@ class Step {
|
|
|
35
38
|
endAt: this.endAt,
|
|
36
39
|
metadata: this.metadata,
|
|
37
40
|
executionContext: this.executionContext,
|
|
41
|
+
...(this.gasUsed && { gasUsed: this.gasUsed }),
|
|
42
|
+
...(this.gasPrice && { gasPrice: this.gasPrice }),
|
|
43
|
+
...(this.totalGasCost && { totalGasCost: this.totalGasCost }),
|
|
38
44
|
};
|
|
39
45
|
}
|
|
40
46
|
static getOutput(step) {
|
|
@@ -209,6 +215,15 @@ class Step {
|
|
|
209
215
|
const getEndAt = () => typeof step.getEndAt === "function"
|
|
210
216
|
? step.getEndAt()
|
|
211
217
|
: step.endAt;
|
|
218
|
+
const getGasUsed = () => typeof step.getGasUsed === "function"
|
|
219
|
+
? step.getGasUsed()
|
|
220
|
+
: step.gasUsed;
|
|
221
|
+
const getGasPrice = () => typeof step.getGasPrice === "function"
|
|
222
|
+
? step.getGasPrice()
|
|
223
|
+
: step.gasPrice;
|
|
224
|
+
const getTotalGasCost = () => typeof step.getTotalGasCost === "function"
|
|
225
|
+
? step.getTotalGasCost()
|
|
226
|
+
: step.totalGasCost;
|
|
212
227
|
// Extract step-level metadata if present (per protobuf: Execution.Step.metadata)
|
|
213
228
|
let stepMetadata = undefined;
|
|
214
229
|
if (typeof step.getMetadata === "function" &&
|
|
@@ -251,6 +266,9 @@ class Step {
|
|
|
251
266
|
endAt: getEndAt(),
|
|
252
267
|
metadata: stepMetadata,
|
|
253
268
|
executionContext,
|
|
269
|
+
gasUsed: getGasUsed() || undefined,
|
|
270
|
+
gasPrice: getGasPrice() || undefined,
|
|
271
|
+
totalGasCost: getTotalGasCost() || undefined,
|
|
254
272
|
});
|
|
255
273
|
}
|
|
256
274
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Node from "./node/interface";
|
|
3
|
+
import Edge from "./edge";
|
|
4
|
+
import Trigger from "./trigger/interface";
|
|
5
|
+
export declare const DefaultExpiredAt = -1;
|
|
6
|
+
import { WorkflowStatus, WorkflowProps, InputVariables } from "@avaprotocol/types";
|
|
7
|
+
export declare function convertStatusToString(status: avs_pb.TaskStatus): WorkflowStatus;
|
|
8
|
+
declare class Workflow implements WorkflowProps {
|
|
9
|
+
smartWalletAddress: string;
|
|
10
|
+
trigger: Trigger;
|
|
11
|
+
nodes: Node[];
|
|
12
|
+
edges: Edge[];
|
|
13
|
+
startAt: number;
|
|
14
|
+
expiredAt: number;
|
|
15
|
+
maxExecution: number;
|
|
16
|
+
id?: string;
|
|
17
|
+
owner?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
completedAt?: number;
|
|
20
|
+
status?: WorkflowStatus;
|
|
21
|
+
lastRanAt?: number;
|
|
22
|
+
executionCount?: number;
|
|
23
|
+
inputVariables?: InputVariables;
|
|
24
|
+
/**
|
|
25
|
+
* Create an instance of Workflow from user inputs
|
|
26
|
+
* @param props
|
|
27
|
+
*/
|
|
28
|
+
constructor(props: WorkflowProps);
|
|
29
|
+
/**
|
|
30
|
+
* Create an instance of Workflow from AVS getWorkflow response
|
|
31
|
+
* @param res
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
static fromResponse(obj: avs_pb.Task): Workflow;
|
|
35
|
+
/**
|
|
36
|
+
* Create an instance of Workflow with only selected fields
|
|
37
|
+
* @param obj
|
|
38
|
+
*/
|
|
39
|
+
static fromListResponse(obj: avs_pb.Task): Workflow;
|
|
40
|
+
toRequest(): avs_pb.CreateTaskReq;
|
|
41
|
+
/**
|
|
42
|
+
* Convert Workflow instance to plain object (WorkflowProps)
|
|
43
|
+
* This is useful for serialization, especially with Next.js Server Components
|
|
44
|
+
*/
|
|
45
|
+
toJson(): WorkflowProps;
|
|
46
|
+
}
|
|
47
|
+
export default Workflow;
|
|
48
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/models/workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAG1C,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/models/workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAG1C,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAInF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,CAAC,UAAU,GACxB,cAAc,CAUhB;AAED,cAAM,QAAS,YAAW,aAAa;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IAGrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;gBACS,KAAK,EAAE,aAAa;IAwBhC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ;IAkC/C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ;IAyBnD,SAAS,IAAI,MAAM,CAAC,aAAa;IA8DjC;;;OAGG;IACH,MAAM,IAAI,aAAa;CAmBxB;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/models/workflow.js
CHANGED
|
@@ -5,6 +5,7 @@ import TriggerFactory from "./trigger/factory";
|
|
|
5
5
|
import NodeFactory from "./node/factory";
|
|
6
6
|
export const DefaultExpiredAt = -1; // TODO: explain the meaning of -1
|
|
7
7
|
import { WorkflowStatus } from "@avaprotocol/types";
|
|
8
|
+
import { convertJSValueToProtobuf } from "../utils";
|
|
8
9
|
// Function to convert TaskStatus to string
|
|
9
10
|
export function convertStatusToString(status) {
|
|
10
11
|
const conversionMap = {
|
|
@@ -40,6 +41,7 @@ class Workflow {
|
|
|
40
41
|
this.status = props.status;
|
|
41
42
|
this.completedAt = props.completedAt;
|
|
42
43
|
this.lastRanAt = props.lastRanAt;
|
|
44
|
+
this.inputVariables = props.inputVariables;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* Create an instance of Workflow from AVS getWorkflow response
|
|
@@ -145,6 +147,13 @@ class Workflow {
|
|
|
145
147
|
if (this.name) {
|
|
146
148
|
request.setName(this.name);
|
|
147
149
|
}
|
|
150
|
+
// Add input variables if provided
|
|
151
|
+
if (this.inputVariables) {
|
|
152
|
+
const inputVarsMap = request.getInputVariablesMap();
|
|
153
|
+
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
154
|
+
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
148
157
|
return request;
|
|
149
158
|
}
|
|
150
159
|
/**
|
|
@@ -167,6 +176,7 @@ class Workflow {
|
|
|
167
176
|
status: this.status,
|
|
168
177
|
completedAt: this.completedAt,
|
|
169
178
|
lastRanAt: this.lastRanAt,
|
|
179
|
+
inputVariables: this.inputVariables,
|
|
170
180
|
};
|
|
171
181
|
}
|
|
172
182
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.4",
|
|
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.5.
|
|
34
|
+
"@avaprotocol/types": "^2.5.4",
|
|
35
35
|
"@grpc/grpc-js": "^1.11.3",
|
|
36
36
|
"@grpc/proto-loader": "^0.7.13",
|
|
37
37
|
"dotenv": "^16.4.5",
|