@avaprotocol/sdk-js 2.7.2 → 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/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);
@@ -14062,6 +14210,7 @@ var require_avs_pb = __commonJS({
14062
14210
  error: jspb.Message.getFieldWithDefault(msg, 3, ""),
14063
14211
  metadata: (f = msg.getMetadata()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
14064
14212
  executionContext: (f = msg.getExecutionContext()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
14213
+ errorCode: jspb.Message.getFieldWithDefault(msg, 7, 0),
14065
14214
  ethTransfer: (f = msg.getEthTransfer()) && proto.aggregator.ETHTransferNode.Output.toObject(includeInstance, f),
14066
14215
  graphql: (f = msg.getGraphql()) && proto.aggregator.GraphQLQueryNode.Output.toObject(includeInstance, f),
14067
14216
  contractRead: (f = msg.getContractRead()) && proto.aggregator.ContractReadNode.Output.toObject(includeInstance, f),
@@ -14114,6 +14263,13 @@ var require_avs_pb = __commonJS({
14114
14263
  reader.readMessage(value, google_protobuf_struct_pb5.Value.deserializeBinaryFromReader);
14115
14264
  msg.setExecutionContext(value);
14116
14265
  break;
14266
+ case 7:
14267
+ var value = (
14268
+ /** @type {!proto.aggregator.ErrorCode} */
14269
+ reader.readEnum()
14270
+ );
14271
+ msg.setErrorCode(value);
14272
+ break;
14117
14273
  case 10:
14118
14274
  var value = new proto.aggregator.ETHTransferNode.Output();
14119
14275
  reader.readMessage(value, proto.aggregator.ETHTransferNode.Output.deserializeBinaryFromReader);
@@ -14203,6 +14359,13 @@ var require_avs_pb = __commonJS({
14203
14359
  google_protobuf_struct_pb5.Value.serializeBinaryToWriter
14204
14360
  );
14205
14361
  }
14362
+ f = message.getErrorCode();
14363
+ if (f !== 0) {
14364
+ writer.writeEnum(
14365
+ 7,
14366
+ f
14367
+ );
14368
+ }
14206
14369
  f = message.getEthTransfer();
14207
14370
  if (f != null) {
14208
14371
  writer.writeMessage(
@@ -14324,6 +14487,15 @@ var require_avs_pb = __commonJS({
14324
14487
  proto.aggregator.RunNodeWithInputsResp.prototype.hasExecutionContext = function() {
14325
14488
  return jspb.Message.getField(this, 6) != null;
14326
14489
  };
14490
+ proto.aggregator.RunNodeWithInputsResp.prototype.getErrorCode = function() {
14491
+ return (
14492
+ /** @type {!proto.aggregator.ErrorCode} */
14493
+ jspb.Message.getFieldWithDefault(this, 7, 0)
14494
+ );
14495
+ };
14496
+ proto.aggregator.RunNodeWithInputsResp.prototype.setErrorCode = function(value) {
14497
+ return jspb.Message.setProto3EnumField(this, 7, value);
14498
+ };
14327
14499
  proto.aggregator.RunNodeWithInputsResp.prototype.getEthTransfer = function() {
14328
14500
  return (
14329
14501
  /** @type{?proto.aggregator.ETHTransferNode.Output} */
@@ -14600,6 +14772,7 @@ var require_avs_pb = __commonJS({
14600
14772
  error: jspb.Message.getFieldWithDefault(msg, 2, ""),
14601
14773
  metadata: (f = msg.getMetadata()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
14602
14774
  executionContext: (f = msg.getExecutionContext()) && google_protobuf_struct_pb5.Value.toObject(includeInstance, f),
14775
+ errorCode: jspb.Message.getFieldWithDefault(msg, 6, 0),
14603
14776
  blockTrigger: (f = msg.getBlockTrigger()) && proto.aggregator.BlockTrigger.Output.toObject(includeInstance, f),
14604
14777
  fixedTimeTrigger: (f = msg.getFixedTimeTrigger()) && proto.aggregator.FixedTimeTrigger.Output.toObject(includeInstance, f),
14605
14778
  cronTrigger: (f = msg.getCronTrigger()) && proto.aggregator.CronTrigger.Output.toObject(includeInstance, f),
@@ -14648,6 +14821,13 @@ var require_avs_pb = __commonJS({
14648
14821
  reader.readMessage(value, google_protobuf_struct_pb5.Value.deserializeBinaryFromReader);
14649
14822
  msg.setExecutionContext(value);
14650
14823
  break;
14824
+ case 6:
14825
+ var value = (
14826
+ /** @type {!proto.aggregator.ErrorCode} */
14827
+ reader.readEnum()
14828
+ );
14829
+ msg.setErrorCode(value);
14830
+ break;
14651
14831
  case 10:
14652
14832
  var value = new proto.aggregator.BlockTrigger.Output();
14653
14833
  reader.readMessage(value, proto.aggregator.BlockTrigger.Output.deserializeBinaryFromReader);
@@ -14717,6 +14897,13 @@ var require_avs_pb = __commonJS({
14717
14897
  google_protobuf_struct_pb5.Value.serializeBinaryToWriter
14718
14898
  );
14719
14899
  }
14900
+ f = message.getErrorCode();
14901
+ if (f !== 0) {
14902
+ writer.writeEnum(
14903
+ 6,
14904
+ f
14905
+ );
14906
+ }
14720
14907
  f = message.getBlockTrigger();
14721
14908
  if (f != null) {
14722
14909
  writer.writeMessage(
@@ -14806,6 +14993,15 @@ var require_avs_pb = __commonJS({
14806
14993
  proto.aggregator.RunTriggerResp.prototype.hasExecutionContext = function() {
14807
14994
  return jspb.Message.getField(this, 5) != null;
14808
14995
  };
14996
+ proto.aggregator.RunTriggerResp.prototype.getErrorCode = function() {
14997
+ return (
14998
+ /** @type {!proto.aggregator.ErrorCode} */
14999
+ jspb.Message.getFieldWithDefault(this, 6, 0)
15000
+ );
15001
+ };
15002
+ proto.aggregator.RunTriggerResp.prototype.setErrorCode = function(value) {
15003
+ return jspb.Message.setProto3EnumField(this, 6, value);
15004
+ };
14809
15005
  proto.aggregator.RunTriggerResp.prototype.getBlockTrigger = function() {
14810
15006
  return (
14811
15007
  /** @type{?proto.aggregator.BlockTrigger.Output} */
@@ -17797,6 +17993,7 @@ var Workflow = class _Workflow {
17797
17993
  this.status = props.status;
17798
17994
  this.completedAt = props.completedAt;
17799
17995
  this.lastRanAt = props.lastRanAt;
17996
+ this.inputVariables = props.inputVariables;
17800
17997
  }
17801
17998
  /**
17802
17999
  * Create an instance of Workflow from AVS getWorkflow response
@@ -17897,6 +18094,12 @@ var Workflow = class _Workflow {
17897
18094
  if (this.name) {
17898
18095
  request.setName(this.name);
17899
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
+ }
17900
18103
  return request;
17901
18104
  }
17902
18105
  /**
@@ -17918,7 +18121,8 @@ var Workflow = class _Workflow {
17918
18121
  name: this.name,
17919
18122
  status: this.status,
17920
18123
  completedAt: this.completedAt,
17921
- lastRanAt: this.lastRanAt
18124
+ lastRanAt: this.lastRanAt,
18125
+ inputVariables: this.inputVariables
17922
18126
  };
17923
18127
  }
17924
18128
  };
@@ -17945,6 +18149,9 @@ var Step = class _Step {
17945
18149
  this.endAt = props.endAt;
17946
18150
  this.metadata = props.metadata;
17947
18151
  this.executionContext = props.executionContext;
18152
+ this.gasUsed = props.gasUsed;
18153
+ this.gasPrice = props.gasPrice;
18154
+ this.totalGasCost = props.totalGasCost;
17948
18155
  }
17949
18156
  /**
17950
18157
  * Convert Step instance to plain object (StepProps)
@@ -17964,7 +18171,10 @@ var Step = class _Step {
17964
18171
  startAt: this.startAt,
17965
18172
  endAt: this.endAt,
17966
18173
  metadata: this.metadata,
17967
- 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 }
17968
18178
  };
17969
18179
  }
17970
18180
  static getOutput(step) {
@@ -18081,6 +18291,9 @@ var Step = class _Step {
18081
18291
  const getInputsList = () => typeof step.getInputsList === "function" ? step.getInputsList() : step.inputsList || [];
18082
18292
  const getStartAt = () => typeof step.getStartAt === "function" ? step.getStartAt() : step.startAt;
18083
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;
18084
18297
  let stepMetadata = void 0;
18085
18298
  if (typeof step.getMetadata === "function" && step.getMetadata()) {
18086
18299
  try {
@@ -18116,7 +18329,10 @@ var Step = class _Step {
18116
18329
  startAt: getStartAt(),
18117
18330
  endAt: getEndAt(),
18118
18331
  metadata: stepMetadata,
18119
- executionContext
18332
+ executionContext,
18333
+ gasUsed: getGasUsed() || void 0,
18334
+ gasPrice: getGasPrice() || void 0,
18335
+ totalGasCost: getTotalGasCost() || void 0
18120
18336
  });
18121
18337
  }
18122
18338
  // Client side does not generate the step, so there's no toRequest() method
@@ -18148,6 +18364,7 @@ var Execution2 = class _Execution {
18148
18364
  this.error = props.error;
18149
18365
  this.index = props.index;
18150
18366
  this.steps = props.steps.map((s) => new step_default(s));
18367
+ this.totalGasCost = props.totalGasCost;
18151
18368
  }
18152
18369
  /**
18153
18370
  * Convert Execution instance to plain object (ExecutionProps)
@@ -18161,7 +18378,8 @@ var Execution2 = class _Execution {
18161
18378
  status: this.status,
18162
18379
  error: this.error,
18163
18380
  index: this.index,
18164
- steps: this.steps.map((step) => step.toJson())
18381
+ steps: this.steps.map((step) => step.toJson()),
18382
+ ...this.totalGasCost && { totalGasCost: this.totalGasCost }
18165
18383
  };
18166
18384
  }
18167
18385
  static fromResponse(execution) {
@@ -18172,6 +18390,7 @@ var Execution2 = class _Execution {
18172
18390
  status: convertProtobufExecutionStatusToTypes(execution.getStatus()),
18173
18391
  error: execution.getError(),
18174
18392
  index: execution.getIndex(),
18393
+ totalGasCost: execution.getTotalGasCost() || void 0,
18175
18394
  steps: execution.getStepsList().map((step) => step_default.fromResponse(step))
18176
18395
  });
18177
18396
  }
@@ -18218,6 +18437,7 @@ import {
18218
18437
  TriggerTypeConverter as TriggerTypeConverter2,
18219
18438
  AUTH_KEY_HEADER,
18220
18439
  DEFAULT_LIMIT,
18440
+ ErrorCode,
18221
18441
  TimeoutPresets,
18222
18442
  ExecutionStatus as ExecutionStatus3
18223
18443
  } from "@avaprotocol/types";
@@ -19136,6 +19356,7 @@ var Client = class extends BaseClient {
19136
19356
  return {
19137
19357
  success: false,
19138
19358
  error: `Trigger type "${nodeType}" should use the runTrigger() method instead of runNodeWithInputs()`,
19359
+ errorCode: ErrorCode.INVALID_REQUEST,
19139
19360
  data: null
19140
19361
  };
19141
19362
  }
@@ -19157,6 +19378,7 @@ var Client = class extends BaseClient {
19157
19378
  success: result.getSuccess(),
19158
19379
  data: toCamelCaseKeys(factory_default2.fromOutputData(result)),
19159
19380
  error: result.getError(),
19381
+ errorCode: result.getErrorCode() || void 0,
19160
19382
  metadata: result.hasMetadata() ? toCamelCaseKeys(convertProtobufValueToJs(result.getMetadata())) : void 0,
19161
19383
  executionContext: result.hasExecutionContext() ? toCamelCaseKeys(convertProtobufValueToJs(result.getExecutionContext())) : void 0
19162
19384
  };
@@ -19192,6 +19414,7 @@ var Client = class extends BaseClient {
19192
19414
  success: result.getSuccess(),
19193
19415
  data: toCamelCaseKeys(factory_default.fromOutputData(result)),
19194
19416
  error: result.getError(),
19417
+ errorCode: result.getErrorCode() || void 0,
19195
19418
  metadata: toCamelCaseKeys(metadata),
19196
19419
  executionContext: result.hasExecutionContext() ? toCamelCaseKeys(convertProtobufValueToJs(result.getExecutionContext())) : void 0
19197
19420
  };
@@ -19262,6 +19485,7 @@ export {
19262
19485
  customCode_default as CustomCodeNode,
19263
19486
  ethTransfer_default as ETHTransferNode,
19264
19487
  edge_default as Edge,
19488
+ ErrorCode,
19265
19489
  event_default as EventTrigger,
19266
19490
  execution_default as Execution,
19267
19491
  filter_default as FilterNode,
@@ -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
@@ -9,6 +9,7 @@ declare class Execution implements ExecutionProps {
9
9
  error: string;
10
10
  index: number;
11
11
  steps: Step[];
12
+ totalGasCost?: string;
12
13
  constructor(props: ExecutionProps);
13
14
  /**
14
15
  * Convert Execution instance to plain object (ExecutionProps)
@@ -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;gBAEF,KAAK,EAAE,cAAc;IAWjC;;;OAGG;IACH,MAAM,IAAI,cAAc;IAYxB,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;CAe5D;AAED,eAAe,SAAS,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"}
@@ -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