@avaprotocol/sdk-js 2.9.0 → 2.9.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.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4aeb505: Added token_addresses to BalanceNode
8
+ - Updated dependencies [4aeb505]
9
+ - @avaprotocol/types@2.7.1
10
+
3
11
  ## 2.9.0
4
12
 
5
13
  ### Minor Changes
package/dist/index.js CHANGED
@@ -516,7 +516,7 @@ var require_avs_pb = __commonJS({
516
516
  proto.aggregator.BalanceNode.displayName = "proto.aggregator.BalanceNode";
517
517
  }
518
518
  proto.aggregator.BalanceNode.Config = function(opt_data) {
519
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
519
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.BalanceNode.Config.repeatedFields_, null);
520
520
  };
521
521
  goog.inherits(proto.aggregator.BalanceNode.Config, jspb.Message);
522
522
  if (goog.DEBUG && !COMPILED) {
@@ -5646,6 +5646,7 @@ var require_avs_pb = __commonJS({
5646
5646
  );
5647
5647
  }
5648
5648
  };
5649
+ proto.aggregator.BalanceNode.Config.repeatedFields_ = [6];
5649
5650
  if (jspb.Message.GENERATE_TO_OBJECT) {
5650
5651
  proto.aggregator.BalanceNode.Config.prototype.toObject = function(opt_includeInstance) {
5651
5652
  return proto.aggregator.BalanceNode.Config.toObject(opt_includeInstance, this);
@@ -5656,7 +5657,8 @@ var require_avs_pb = __commonJS({
5656
5657
  chain: jspb.Message.getFieldWithDefault(msg, 2, ""),
5657
5658
  includeSpam: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
5658
5659
  includeZeroBalances: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
5659
- minUsdValueCents: jspb.Message.getFieldWithDefault(msg, 5, 0)
5660
+ minUsdValueCents: jspb.Message.getFieldWithDefault(msg, 5, 0),
5661
+ tokenAddressesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? void 0 : f
5660
5662
  };
5661
5663
  if (includeInstance) {
5662
5664
  obj.$jspbMessageInstance = msg;
@@ -5711,6 +5713,13 @@ var require_avs_pb = __commonJS({
5711
5713
  );
5712
5714
  msg.setMinUsdValueCents(value);
5713
5715
  break;
5716
+ case 6:
5717
+ var value = (
5718
+ /** @type {string} */
5719
+ reader.readString()
5720
+ );
5721
+ msg.addTokenAddresses(value);
5722
+ break;
5714
5723
  default:
5715
5724
  reader.skipField();
5716
5725
  break;
@@ -5760,6 +5769,13 @@ var require_avs_pb = __commonJS({
5760
5769
  f
5761
5770
  );
5762
5771
  }
5772
+ f = message.getTokenAddressesList();
5773
+ if (f.length > 0) {
5774
+ writer.writeRepeatedString(
5775
+ 6,
5776
+ f
5777
+ );
5778
+ }
5763
5779
  };
5764
5780
  proto.aggregator.BalanceNode.Config.prototype.getAddress = function() {
5765
5781
  return (
@@ -5806,6 +5822,21 @@ var require_avs_pb = __commonJS({
5806
5822
  proto.aggregator.BalanceNode.Config.prototype.setMinUsdValueCents = function(value) {
5807
5823
  return jspb.Message.setProto3IntField(this, 5, value);
5808
5824
  };
5825
+ proto.aggregator.BalanceNode.Config.prototype.getTokenAddressesList = function() {
5826
+ return (
5827
+ /** @type {!Array<string>} */
5828
+ jspb.Message.getRepeatedField(this, 6)
5829
+ );
5830
+ };
5831
+ proto.aggregator.BalanceNode.Config.prototype.setTokenAddressesList = function(value) {
5832
+ return jspb.Message.setField(this, 6, value || []);
5833
+ };
5834
+ proto.aggregator.BalanceNode.Config.prototype.addTokenAddresses = function(value, opt_index) {
5835
+ return jspb.Message.addToRepeatedField(this, 6, value, opt_index);
5836
+ };
5837
+ proto.aggregator.BalanceNode.Config.prototype.clearTokenAddressesList = function() {
5838
+ return this.setTokenAddressesList([]);
5839
+ };
5809
5840
  if (jspb.Message.GENERATE_TO_OBJECT) {
5810
5841
  proto.aggregator.BalanceNode.Output.prototype.toObject = function(opt_includeInstance) {
5811
5842
  return proto.aggregator.BalanceNode.Output.toObject(opt_includeInstance, this);
@@ -20289,6 +20320,9 @@ var BalanceNode2 = class _BalanceNode extends Node {
20289
20320
  if (configData.minUsdValue !== void 0) {
20290
20321
  config.setMinUsdValueCents(Math.round(configData.minUsdValue * 100));
20291
20322
  }
20323
+ if (configData.tokenAddresses !== void 0 && configData.tokenAddresses.length > 0) {
20324
+ config.setTokenAddressesList(configData.tokenAddresses);
20325
+ }
20292
20326
  node.setConfig(config);
20293
20327
  return node;
20294
20328
  }
@@ -20302,7 +20336,8 @@ var BalanceNode2 = class _BalanceNode extends Node {
20302
20336
  chain: protobufData.chain,
20303
20337
  includeSpam: protobufData.includeSpam,
20304
20338
  includeZeroBalances: protobufData.includeZeroBalances,
20305
- minUsdValue: protobufData.minUsdValueCents / 100
20339
+ minUsdValue: protobufData.minUsdValueCents / 100,
20340
+ tokenAddresses: protobufData.tokenAddressesList
20306
20341
  };
20307
20342
  return new _BalanceNode({
20308
20343
  ...obj,
@@ -20314,9 +20349,7 @@ var BalanceNode2 = class _BalanceNode extends Node {
20314
20349
  const request = new avs_pb18.TaskNode();
20315
20350
  request.setId(this.id);
20316
20351
  request.setName(this.name);
20317
- const node = _BalanceNode.createProtobufNode(
20318
- this.data
20319
- );
20352
+ const node = _BalanceNode.createProtobufNode(this.data);
20320
20353
  request.setBalance(node);
20321
20354
  return request;
20322
20355
  }
@@ -20325,7 +20358,7 @@ var BalanceNode2 = class _BalanceNode extends Node {
20325
20358
  if (!balanceOutput) return null;
20326
20359
  const dataValue = balanceOutput.getData();
20327
20360
  const balanceData = dataValue ? convertProtobufValueToJs(dataValue) : [];
20328
- return { data: balanceData };
20361
+ return balanceData;
20329
20362
  }
20330
20363
  };
20331
20364
  var balance_default = BalanceNode2;
package/dist/index.mjs CHANGED
@@ -516,7 +516,7 @@ var require_avs_pb = __commonJS({
516
516
  proto.aggregator.BalanceNode.displayName = "proto.aggregator.BalanceNode";
517
517
  }
518
518
  proto.aggregator.BalanceNode.Config = function(opt_data) {
519
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
519
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.BalanceNode.Config.repeatedFields_, null);
520
520
  };
521
521
  goog.inherits(proto.aggregator.BalanceNode.Config, jspb.Message);
522
522
  if (goog.DEBUG && !COMPILED) {
@@ -5646,6 +5646,7 @@ var require_avs_pb = __commonJS({
5646
5646
  );
5647
5647
  }
5648
5648
  };
5649
+ proto.aggregator.BalanceNode.Config.repeatedFields_ = [6];
5649
5650
  if (jspb.Message.GENERATE_TO_OBJECT) {
5650
5651
  proto.aggregator.BalanceNode.Config.prototype.toObject = function(opt_includeInstance) {
5651
5652
  return proto.aggregator.BalanceNode.Config.toObject(opt_includeInstance, this);
@@ -5656,7 +5657,8 @@ var require_avs_pb = __commonJS({
5656
5657
  chain: jspb.Message.getFieldWithDefault(msg, 2, ""),
5657
5658
  includeSpam: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
5658
5659
  includeZeroBalances: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
5659
- minUsdValueCents: jspb.Message.getFieldWithDefault(msg, 5, 0)
5660
+ minUsdValueCents: jspb.Message.getFieldWithDefault(msg, 5, 0),
5661
+ tokenAddressesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? void 0 : f
5660
5662
  };
5661
5663
  if (includeInstance) {
5662
5664
  obj.$jspbMessageInstance = msg;
@@ -5711,6 +5713,13 @@ var require_avs_pb = __commonJS({
5711
5713
  );
5712
5714
  msg.setMinUsdValueCents(value);
5713
5715
  break;
5716
+ case 6:
5717
+ var value = (
5718
+ /** @type {string} */
5719
+ reader.readString()
5720
+ );
5721
+ msg.addTokenAddresses(value);
5722
+ break;
5714
5723
  default:
5715
5724
  reader.skipField();
5716
5725
  break;
@@ -5760,6 +5769,13 @@ var require_avs_pb = __commonJS({
5760
5769
  f
5761
5770
  );
5762
5771
  }
5772
+ f = message.getTokenAddressesList();
5773
+ if (f.length > 0) {
5774
+ writer.writeRepeatedString(
5775
+ 6,
5776
+ f
5777
+ );
5778
+ }
5763
5779
  };
5764
5780
  proto.aggregator.BalanceNode.Config.prototype.getAddress = function() {
5765
5781
  return (
@@ -5806,6 +5822,21 @@ var require_avs_pb = __commonJS({
5806
5822
  proto.aggregator.BalanceNode.Config.prototype.setMinUsdValueCents = function(value) {
5807
5823
  return jspb.Message.setProto3IntField(this, 5, value);
5808
5824
  };
5825
+ proto.aggregator.BalanceNode.Config.prototype.getTokenAddressesList = function() {
5826
+ return (
5827
+ /** @type {!Array<string>} */
5828
+ jspb.Message.getRepeatedField(this, 6)
5829
+ );
5830
+ };
5831
+ proto.aggregator.BalanceNode.Config.prototype.setTokenAddressesList = function(value) {
5832
+ return jspb.Message.setField(this, 6, value || []);
5833
+ };
5834
+ proto.aggregator.BalanceNode.Config.prototype.addTokenAddresses = function(value, opt_index) {
5835
+ return jspb.Message.addToRepeatedField(this, 6, value, opt_index);
5836
+ };
5837
+ proto.aggregator.BalanceNode.Config.prototype.clearTokenAddressesList = function() {
5838
+ return this.setTokenAddressesList([]);
5839
+ };
5809
5840
  if (jspb.Message.GENERATE_TO_OBJECT) {
5810
5841
  proto.aggregator.BalanceNode.Output.prototype.toObject = function(opt_includeInstance) {
5811
5842
  return proto.aggregator.BalanceNode.Output.toObject(opt_includeInstance, this);
@@ -20298,6 +20329,9 @@ var BalanceNode2 = class _BalanceNode extends Node {
20298
20329
  if (configData.minUsdValue !== void 0) {
20299
20330
  config.setMinUsdValueCents(Math.round(configData.minUsdValue * 100));
20300
20331
  }
20332
+ if (configData.tokenAddresses !== void 0 && configData.tokenAddresses.length > 0) {
20333
+ config.setTokenAddressesList(configData.tokenAddresses);
20334
+ }
20301
20335
  node.setConfig(config);
20302
20336
  return node;
20303
20337
  }
@@ -20311,7 +20345,8 @@ var BalanceNode2 = class _BalanceNode extends Node {
20311
20345
  chain: protobufData.chain,
20312
20346
  includeSpam: protobufData.includeSpam,
20313
20347
  includeZeroBalances: protobufData.includeZeroBalances,
20314
- minUsdValue: protobufData.minUsdValueCents / 100
20348
+ minUsdValue: protobufData.minUsdValueCents / 100,
20349
+ tokenAddresses: protobufData.tokenAddressesList
20315
20350
  };
20316
20351
  return new _BalanceNode({
20317
20352
  ...obj,
@@ -20323,9 +20358,7 @@ var BalanceNode2 = class _BalanceNode extends Node {
20323
20358
  const request = new avs_pb18.TaskNode();
20324
20359
  request.setId(this.id);
20325
20360
  request.setName(this.name);
20326
- const node = _BalanceNode.createProtobufNode(
20327
- this.data
20328
- );
20361
+ const node = _BalanceNode.createProtobufNode(this.data);
20329
20362
  request.setBalance(node);
20330
20363
  return request;
20331
20364
  }
@@ -20334,7 +20367,7 @@ var BalanceNode2 = class _BalanceNode extends Node {
20334
20367
  if (!balanceOutput) return null;
20335
20368
  const dataValue = balanceOutput.getData();
20336
20369
  const balanceData = dataValue ? convertProtobufValueToJs(dataValue) : [];
20337
- return { data: balanceData };
20370
+ return balanceData;
20338
20371
  }
20339
20372
  };
20340
20373
  var balance_default = BalanceNode2;
@@ -1 +1 @@
1
- {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../src/models/node/balance.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAEL,eAAe,EACf,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,WAAY,SAAQ,IAAI;gBAChB,KAAK,EAAE,gBAAgB;IAInC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAAC,WAAW;IAwB1E,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,WAAW;IAuBtD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CACnB,UAAU,EAAE,MAAM,CAAC,qBAAqB,GACvC,OAAO,GAAG,IAAI;CAUlB;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../src/models/node/balance.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAEL,eAAe,EACf,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,WAAY,SAAQ,IAAI;gBAChB,KAAK,EAAE,gBAAgB;IAInC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAAC,WAAW;IA+B1E,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,WAAW;IAwBtD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAa5B,MAAM,CAAC,cAAc,CACnB,UAAU,EAAE,MAAM,CAAC,qBAAqB,GACvC,OAAO,GAAG,IAAI;CAWlB;AAED,eAAe,WAAW,CAAC"}
@@ -27,6 +27,10 @@ class BalanceNode extends Node {
27
27
  // Convert dollars to cents for protobuf (validation happens on backend)
28
28
  config.setMinUsdValueCents(Math.round(configData.minUsdValue * 100));
29
29
  }
30
+ if (configData.tokenAddresses !== undefined &&
31
+ configData.tokenAddresses.length > 0) {
32
+ config.setTokenAddressesList(configData.tokenAddresses);
33
+ }
30
34
  node.setConfig(config);
31
35
  return node;
32
36
  }
@@ -43,6 +47,7 @@ class BalanceNode extends Node {
43
47
  includeSpam: protobufData.includeSpam,
44
48
  includeZeroBalances: protobufData.includeZeroBalances,
45
49
  minUsdValue: protobufData.minUsdValueCents / 100,
50
+ tokenAddresses: protobufData.tokenAddressesList,
46
51
  };
47
52
  return new BalanceNode({
48
53
  ...obj,
@@ -65,7 +70,8 @@ class BalanceNode extends Node {
65
70
  // Get the data from the data field (array of token balances)
66
71
  const dataValue = balanceOutput.getData();
67
72
  const balanceData = dataValue ? convertProtobufValueToJs(dataValue) : [];
68
- return { data: balanceData };
73
+ // Return the array directly without wrapping
74
+ return balanceData;
69
75
  }
70
76
  }
71
77
  export default BalanceNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avaprotocol/sdk-js",
3
- "version": "2.9.0",
3
+ "version": "2.9.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.7.0",
34
+ "@avaprotocol/types": "2.7.1",
35
35
  "@grpc/grpc-js": "^1.11.3",
36
36
  "@grpc/proto-loader": "^0.7.13",
37
37
  "dotenv": "^16.4.5",