@avaprotocol/sdk-js 2.7.0 → 2.7.1

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @avaprotocol/sdk-js
2
2
 
3
+ ## 2.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - aacd631: feat: add execution index field and partial success status support
8
+ - Updated dependencies [aacd631]
9
+ - @avaprotocol/types@2.5.1
10
+
3
11
  ## 2.7.0
4
12
 
5
13
  ### Minor Changes
package/dist/index.js CHANGED
@@ -7010,6 +7010,7 @@ var require_avs_pb = __commonJS({
7010
7010
  endAt: jspb.Message.getFieldWithDefault(msg, 3, 0),
7011
7011
  success: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
7012
7012
  error: jspb.Message.getFieldWithDefault(msg, 5, ""),
7013
+ index: jspb.Message.getFieldWithDefault(msg, 6, 0),
7013
7014
  stepsList: jspb.Message.toObjectList(
7014
7015
  msg.getStepsList(),
7015
7016
  proto.aggregator.Execution.Step.toObject,
@@ -7069,6 +7070,13 @@ var require_avs_pb = __commonJS({
7069
7070
  );
7070
7071
  msg.setError(value);
7071
7072
  break;
7073
+ case 6:
7074
+ var value = (
7075
+ /** @type {number} */
7076
+ reader.readInt64()
7077
+ );
7078
+ msg.setIndex(value);
7079
+ break;
7072
7080
  case 8:
7073
7081
  var value = new proto.aggregator.Execution.Step();
7074
7082
  reader.readMessage(value, proto.aggregator.Execution.Step.deserializeBinaryFromReader);
@@ -7123,6 +7131,13 @@ var require_avs_pb = __commonJS({
7123
7131
  f
7124
7132
  );
7125
7133
  }
7134
+ f = message.getIndex();
7135
+ if (f !== 0) {
7136
+ writer.writeInt64(
7137
+ 6,
7138
+ f
7139
+ );
7140
+ }
7126
7141
  f = message.getStepsList();
7127
7142
  if (f.length > 0) {
7128
7143
  writer.writeRepeatedMessage(
@@ -7957,6 +7972,15 @@ var require_avs_pb = __commonJS({
7957
7972
  proto.aggregator.Execution.prototype.setError = function(value) {
7958
7973
  return jspb.Message.setProto3StringField(this, 5, value);
7959
7974
  };
7975
+ proto.aggregator.Execution.prototype.getIndex = function() {
7976
+ return (
7977
+ /** @type {number} */
7978
+ jspb.Message.getFieldWithDefault(this, 6, 0)
7979
+ );
7980
+ };
7981
+ proto.aggregator.Execution.prototype.setIndex = function(value) {
7982
+ return jspb.Message.setProto3IntField(this, 6, value);
7983
+ };
7960
7984
  proto.aggregator.Execution.prototype.getStepsList = function() {
7961
7985
  return (
7962
7986
  /** @type{!Array<!proto.aggregator.Execution.Step>} */
@@ -15265,7 +15289,8 @@ var require_avs_pb = __commonJS({
15265
15289
  EXECUTION_STATUS_UNSPECIFIED: 0,
15266
15290
  EXECUTION_STATUS_PENDING: 1,
15267
15291
  EXECUTION_STATUS_COMPLETED: 2,
15268
- EXECUTION_STATUS_FAILED: 3
15292
+ EXECUTION_STATUS_FAILED: 3,
15293
+ EXECUTION_STATUS_PARTIAL_SUCCESS: 4
15269
15294
  };
15270
15295
  goog.object.extend(exports2, proto.aggregator);
15271
15296
  }
@@ -18126,6 +18151,7 @@ var Execution2 = class _Execution {
18126
18151
  this.endAt = props.endAt;
18127
18152
  this.success = props.success;
18128
18153
  this.error = props.error;
18154
+ this.index = props.index;
18129
18155
  this.steps = props.steps.map((s) => new step_default(s));
18130
18156
  }
18131
18157
  /**
@@ -18139,6 +18165,7 @@ var Execution2 = class _Execution {
18139
18165
  endAt: this.endAt,
18140
18166
  success: this.success,
18141
18167
  error: this.error,
18168
+ index: this.index,
18142
18169
  steps: this.steps.map((step) => step.toJson())
18143
18170
  };
18144
18171
  }
@@ -18149,6 +18176,7 @@ var Execution2 = class _Execution {
18149
18176
  endAt: execution.getEndAt(),
18150
18177
  success: execution.getSuccess(),
18151
18178
  error: execution.getError(),
18179
+ index: execution.getIndex(),
18152
18180
  steps: execution.getStepsList().map((step) => step_default.fromResponse(step))
18153
18181
  });
18154
18182
  }
package/dist/index.mjs CHANGED
@@ -7010,6 +7010,7 @@ var require_avs_pb = __commonJS({
7010
7010
  endAt: jspb.Message.getFieldWithDefault(msg, 3, 0),
7011
7011
  success: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
7012
7012
  error: jspb.Message.getFieldWithDefault(msg, 5, ""),
7013
+ index: jspb.Message.getFieldWithDefault(msg, 6, 0),
7013
7014
  stepsList: jspb.Message.toObjectList(
7014
7015
  msg.getStepsList(),
7015
7016
  proto.aggregator.Execution.Step.toObject,
@@ -7069,6 +7070,13 @@ var require_avs_pb = __commonJS({
7069
7070
  );
7070
7071
  msg.setError(value);
7071
7072
  break;
7073
+ case 6:
7074
+ var value = (
7075
+ /** @type {number} */
7076
+ reader.readInt64()
7077
+ );
7078
+ msg.setIndex(value);
7079
+ break;
7072
7080
  case 8:
7073
7081
  var value = new proto.aggregator.Execution.Step();
7074
7082
  reader.readMessage(value, proto.aggregator.Execution.Step.deserializeBinaryFromReader);
@@ -7123,6 +7131,13 @@ var require_avs_pb = __commonJS({
7123
7131
  f
7124
7132
  );
7125
7133
  }
7134
+ f = message.getIndex();
7135
+ if (f !== 0) {
7136
+ writer.writeInt64(
7137
+ 6,
7138
+ f
7139
+ );
7140
+ }
7126
7141
  f = message.getStepsList();
7127
7142
  if (f.length > 0) {
7128
7143
  writer.writeRepeatedMessage(
@@ -7957,6 +7972,15 @@ var require_avs_pb = __commonJS({
7957
7972
  proto.aggregator.Execution.prototype.setError = function(value) {
7958
7973
  return jspb.Message.setProto3StringField(this, 5, value);
7959
7974
  };
7975
+ proto.aggregator.Execution.prototype.getIndex = function() {
7976
+ return (
7977
+ /** @type {number} */
7978
+ jspb.Message.getFieldWithDefault(this, 6, 0)
7979
+ );
7980
+ };
7981
+ proto.aggregator.Execution.prototype.setIndex = function(value) {
7982
+ return jspb.Message.setProto3IntField(this, 6, value);
7983
+ };
7960
7984
  proto.aggregator.Execution.prototype.getStepsList = function() {
7961
7985
  return (
7962
7986
  /** @type{!Array<!proto.aggregator.Execution.Step>} */
@@ -15265,7 +15289,8 @@ var require_avs_pb = __commonJS({
15265
15289
  EXECUTION_STATUS_UNSPECIFIED: 0,
15266
15290
  EXECUTION_STATUS_PENDING: 1,
15267
15291
  EXECUTION_STATUS_COMPLETED: 2,
15268
- EXECUTION_STATUS_FAILED: 3
15292
+ EXECUTION_STATUS_FAILED: 3,
15293
+ EXECUTION_STATUS_PARTIAL_SUCCESS: 4
15269
15294
  };
15270
15295
  goog.object.extend(exports, proto.aggregator);
15271
15296
  }
@@ -18133,6 +18158,7 @@ var Execution2 = class _Execution {
18133
18158
  this.endAt = props.endAt;
18134
18159
  this.success = props.success;
18135
18160
  this.error = props.error;
18161
+ this.index = props.index;
18136
18162
  this.steps = props.steps.map((s) => new step_default(s));
18137
18163
  }
18138
18164
  /**
@@ -18146,6 +18172,7 @@ var Execution2 = class _Execution {
18146
18172
  endAt: this.endAt,
18147
18173
  success: this.success,
18148
18174
  error: this.error,
18175
+ index: this.index,
18149
18176
  steps: this.steps.map((step) => step.toJson())
18150
18177
  };
18151
18178
  }
@@ -18156,6 +18183,7 @@ var Execution2 = class _Execution {
18156
18183
  endAt: execution.getEndAt(),
18157
18184
  success: execution.getSuccess(),
18158
18185
  error: execution.getError(),
18186
+ index: execution.getIndex(),
18159
18187
  steps: execution.getStepsList().map((step) => step_default.fromResponse(step))
18160
18188
  });
18161
18189
  }
@@ -0,0 +1,21 @@
1
+ import * as avs_pb from "@/grpc_codegen/avs_pb";
2
+ import { ExecutionProps } from "@avaprotocol/types";
3
+ import Step from "./step";
4
+ declare class Execution implements ExecutionProps {
5
+ id: string;
6
+ startAt: number;
7
+ endAt: number;
8
+ success: boolean;
9
+ error: string;
10
+ index: number;
11
+ steps: Step[];
12
+ constructor(props: ExecutionProps);
13
+ /**
14
+ * Convert Execution instance to plain object (ExecutionProps)
15
+ * This is useful for serialization, especially with Next.js Server Components
16
+ */
17
+ toJson(): ExecutionProps;
18
+ static fromResponse(execution: avs_pb.Execution): Execution;
19
+ }
20
+ export default Execution;
21
+ //# sourceMappingURL=execution.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,MAAM,oBAAoB,CAAC;AAClG,OAAO,IAAI,MAAM,QAAQ,CAAC;AAI1B,cAAM,SAAU,YAAW,cAAc;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;gBAEF,KAAK,EAAE,cAAc;IASjC;;;OAGG;IACH,MAAM,IAAI,cAAc;IAWxB,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;CAc5D;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,MAAM,oBAAoB,CAAC;AAClG,OAAO,IAAI,MAAM,QAAQ,CAAC;AAI1B,cAAM,SAAU,YAAW,cAAc;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;gBAEF,KAAK,EAAE,cAAc;IAUjC;;;OAGG;IACH,MAAM,IAAI,cAAc;IAYxB,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;CAe5D;AAED,eAAe,SAAS,CAAC"}
@@ -6,6 +6,7 @@ class Execution {
6
6
  this.endAt = props.endAt;
7
7
  this.success = props.success;
8
8
  this.error = props.error;
9
+ this.index = props.index;
9
10
  this.steps = props.steps.map(s => new Step(s));
10
11
  }
11
12
  /**
@@ -19,6 +20,7 @@ class Execution {
19
20
  endAt: this.endAt,
20
21
  success: this.success,
21
22
  error: this.error,
23
+ index: this.index,
22
24
  steps: this.steps.map(step => step.toJson()),
23
25
  };
24
26
  }
@@ -29,6 +31,7 @@ class Execution {
29
31
  endAt: execution.getEndAt(),
30
32
  success: execution.getSuccess(),
31
33
  error: execution.getError(),
34
+ index: execution.getIndex(),
32
35
  steps: execution
33
36
  .getStepsList()
34
37
  .map((step) => Step.fromResponse(step)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avaprotocol/sdk-js",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
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.0",
34
+ "@avaprotocol/types": "^2.5.1",
35
35
  "@grpc/grpc-js": "^1.11.3",
36
36
  "@grpc/proto-loader": "^0.7.13",
37
37
  "dotenv": "^16.4.5",