@farcaster/hub-web 0.11.0 → 0.11.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/dist/index.js CHANGED
@@ -1028,7 +1028,7 @@ var require_minimal = __commonJS({
1028
1028
  util.isString = function isString(value) {
1029
1029
  return typeof value === "string" || value instanceof String;
1030
1030
  };
1031
- util.isObject = function isObject(value) {
1031
+ util.isObject = function isObject2(value) {
1032
1032
  return value && typeof value === "object";
1033
1033
  };
1034
1034
  util.isset = /**
@@ -6803,7 +6803,14 @@ var RevokeMessageBody = {
6803
6803
  }
6804
6804
  };
6805
6805
  function createBaseBlockConfirmedBody() {
6806
- return { blockNumber: 0, shardIndex: 0, timestamp: 0, blockHash: new Uint8Array(), totalEvents: 0 };
6806
+ return {
6807
+ blockNumber: 0,
6808
+ shardIndex: 0,
6809
+ timestamp: 0,
6810
+ blockHash: new Uint8Array(),
6811
+ totalEvents: 0,
6812
+ eventCountsByType: {}
6813
+ };
6807
6814
  }
6808
6815
  var BlockConfirmedBody = {
6809
6816
  encode(message, writer = import_minimal5.default.Writer.create()) {
@@ -6822,6 +6829,9 @@ var BlockConfirmedBody = {
6822
6829
  if (message.totalEvents !== 0) {
6823
6830
  writer.uint32(40).uint64(message.totalEvents);
6824
6831
  }
6832
+ Object.entries(message.eventCountsByType).forEach(([key, value]) => {
6833
+ BlockConfirmedBody_EventCountsByTypeEntry.encode({ key, value }, writer.uint32(50).fork()).ldelim();
6834
+ });
6825
6835
  return writer;
6826
6836
  },
6827
6837
  decode(input, length) {
@@ -6861,6 +6871,15 @@ var BlockConfirmedBody = {
6861
6871
  }
6862
6872
  message.totalEvents = longToNumber5(reader.uint64());
6863
6873
  continue;
6874
+ case 6:
6875
+ if (tag != 50) {
6876
+ break;
6877
+ }
6878
+ const entry6 = BlockConfirmedBody_EventCountsByTypeEntry.decode(reader, reader.uint32());
6879
+ if (entry6.value !== void 0) {
6880
+ message.eventCountsByType[entry6.key] = entry6.value;
6881
+ }
6882
+ continue;
6864
6883
  }
6865
6884
  if ((tag & 7) == 4 || tag == 0) {
6866
6885
  break;
@@ -6875,7 +6894,11 @@ var BlockConfirmedBody = {
6875
6894
  shardIndex: isSet5(object.shardIndex) ? Number(object.shardIndex) : 0,
6876
6895
  timestamp: isSet5(object.timestamp) ? Number(object.timestamp) : 0,
6877
6896
  blockHash: isSet5(object.blockHash) ? bytesFromBase645(object.blockHash) : new Uint8Array(),
6878
- totalEvents: isSet5(object.totalEvents) ? Number(object.totalEvents) : 0
6897
+ totalEvents: isSet5(object.totalEvents) ? Number(object.totalEvents) : 0,
6898
+ eventCountsByType: isObject(object.eventCountsByType) ? Object.entries(object.eventCountsByType).reduce((acc, [key, value]) => {
6899
+ acc[Number(key)] = Number(value);
6900
+ return acc;
6901
+ }, {}) : {}
6879
6902
  };
6880
6903
  },
6881
6904
  toJSON(message) {
@@ -6885,19 +6908,94 @@ var BlockConfirmedBody = {
6885
6908
  message.timestamp !== void 0 && (obj.timestamp = Math.round(message.timestamp));
6886
6909
  message.blockHash !== void 0 && (obj.blockHash = base64FromBytes5(message.blockHash !== void 0 ? message.blockHash : new Uint8Array()));
6887
6910
  message.totalEvents !== void 0 && (obj.totalEvents = Math.round(message.totalEvents));
6911
+ obj.eventCountsByType = {};
6912
+ if (message.eventCountsByType) {
6913
+ Object.entries(message.eventCountsByType).forEach(([k, v]) => {
6914
+ obj.eventCountsByType[k] = Math.round(v);
6915
+ });
6916
+ }
6888
6917
  return obj;
6889
6918
  },
6890
6919
  create(base) {
6891
6920
  return BlockConfirmedBody.fromPartial(base != null ? base : {});
6892
6921
  },
6893
6922
  fromPartial(object) {
6894
- var _a, _b, _c, _d, _e;
6923
+ var _a, _b, _c, _d, _e, _f;
6895
6924
  const message = createBaseBlockConfirmedBody();
6896
6925
  message.blockNumber = (_a = object.blockNumber) != null ? _a : 0;
6897
6926
  message.shardIndex = (_b = object.shardIndex) != null ? _b : 0;
6898
6927
  message.timestamp = (_c = object.timestamp) != null ? _c : 0;
6899
6928
  message.blockHash = (_d = object.blockHash) != null ? _d : new Uint8Array();
6900
6929
  message.totalEvents = (_e = object.totalEvents) != null ? _e : 0;
6930
+ message.eventCountsByType = Object.entries((_f = object.eventCountsByType) != null ? _f : {}).reduce(
6931
+ (acc, [key, value]) => {
6932
+ if (value !== void 0) {
6933
+ acc[Number(key)] = Number(value);
6934
+ }
6935
+ return acc;
6936
+ },
6937
+ {}
6938
+ );
6939
+ return message;
6940
+ }
6941
+ };
6942
+ function createBaseBlockConfirmedBody_EventCountsByTypeEntry() {
6943
+ return { key: 0, value: 0 };
6944
+ }
6945
+ var BlockConfirmedBody_EventCountsByTypeEntry = {
6946
+ encode(message, writer = import_minimal5.default.Writer.create()) {
6947
+ if (message.key !== 0) {
6948
+ writer.uint32(8).int32(message.key);
6949
+ }
6950
+ if (message.value !== 0) {
6951
+ writer.uint32(16).uint64(message.value);
6952
+ }
6953
+ return writer;
6954
+ },
6955
+ decode(input, length) {
6956
+ const reader = input instanceof import_minimal5.default.Reader ? input : import_minimal5.default.Reader.create(input);
6957
+ let end = length === void 0 ? reader.len : reader.pos + length;
6958
+ const message = createBaseBlockConfirmedBody_EventCountsByTypeEntry();
6959
+ while (reader.pos < end) {
6960
+ const tag = reader.uint32();
6961
+ switch (tag >>> 3) {
6962
+ case 1:
6963
+ if (tag != 8) {
6964
+ break;
6965
+ }
6966
+ message.key = reader.int32();
6967
+ continue;
6968
+ case 2:
6969
+ if (tag != 16) {
6970
+ break;
6971
+ }
6972
+ message.value = longToNumber5(reader.uint64());
6973
+ continue;
6974
+ }
6975
+ if ((tag & 7) == 4 || tag == 0) {
6976
+ break;
6977
+ }
6978
+ reader.skipType(tag & 7);
6979
+ }
6980
+ return message;
6981
+ },
6982
+ fromJSON(object) {
6983
+ return { key: isSet5(object.key) ? Number(object.key) : 0, value: isSet5(object.value) ? Number(object.value) : 0 };
6984
+ },
6985
+ toJSON(message) {
6986
+ const obj = {};
6987
+ message.key !== void 0 && (obj.key = Math.round(message.key));
6988
+ message.value !== void 0 && (obj.value = Math.round(message.value));
6989
+ return obj;
6990
+ },
6991
+ create(base) {
6992
+ return BlockConfirmedBody_EventCountsByTypeEntry.fromPartial(base != null ? base : {});
6993
+ },
6994
+ fromPartial(object) {
6995
+ var _a, _b;
6996
+ const message = createBaseBlockConfirmedBody_EventCountsByTypeEntry();
6997
+ message.key = (_a = object.key) != null ? _a : 0;
6998
+ message.value = (_b = object.value) != null ? _b : 0;
6901
6999
  return message;
6902
7000
  }
6903
7001
  };
@@ -7284,6 +7382,9 @@ if (import_minimal5.default.util.Long !== long_default) {
7284
7382
  import_minimal5.default.util.Long = long_default;
7285
7383
  import_minimal5.default.configure();
7286
7384
  }
7385
+ function isObject(value) {
7386
+ return typeof value === "object" && value !== null;
7387
+ }
7287
7388
  function isSet5(value) {
7288
7389
  return value !== null && value !== void 0;
7289
7390
  }
package/dist/index.mjs CHANGED
@@ -1021,7 +1021,7 @@ var require_minimal = __commonJS({
1021
1021
  util.isString = function isString(value) {
1022
1022
  return typeof value === "string" || value instanceof String;
1023
1023
  };
1024
- util.isObject = function isObject(value) {
1024
+ util.isObject = function isObject2(value) {
1025
1025
  return value && typeof value === "object";
1026
1026
  };
1027
1027
  util.isset = /**
@@ -6744,7 +6744,14 @@ var RevokeMessageBody = {
6744
6744
  }
6745
6745
  };
6746
6746
  function createBaseBlockConfirmedBody() {
6747
- return { blockNumber: 0, shardIndex: 0, timestamp: 0, blockHash: new Uint8Array(), totalEvents: 0 };
6747
+ return {
6748
+ blockNumber: 0,
6749
+ shardIndex: 0,
6750
+ timestamp: 0,
6751
+ blockHash: new Uint8Array(),
6752
+ totalEvents: 0,
6753
+ eventCountsByType: {}
6754
+ };
6748
6755
  }
6749
6756
  var BlockConfirmedBody = {
6750
6757
  encode(message, writer = import_minimal5.default.Writer.create()) {
@@ -6763,6 +6770,9 @@ var BlockConfirmedBody = {
6763
6770
  if (message.totalEvents !== 0) {
6764
6771
  writer.uint32(40).uint64(message.totalEvents);
6765
6772
  }
6773
+ Object.entries(message.eventCountsByType).forEach(([key, value]) => {
6774
+ BlockConfirmedBody_EventCountsByTypeEntry.encode({ key, value }, writer.uint32(50).fork()).ldelim();
6775
+ });
6766
6776
  return writer;
6767
6777
  },
6768
6778
  decode(input, length) {
@@ -6802,6 +6812,15 @@ var BlockConfirmedBody = {
6802
6812
  }
6803
6813
  message.totalEvents = longToNumber5(reader.uint64());
6804
6814
  continue;
6815
+ case 6:
6816
+ if (tag != 50) {
6817
+ break;
6818
+ }
6819
+ const entry6 = BlockConfirmedBody_EventCountsByTypeEntry.decode(reader, reader.uint32());
6820
+ if (entry6.value !== void 0) {
6821
+ message.eventCountsByType[entry6.key] = entry6.value;
6822
+ }
6823
+ continue;
6805
6824
  }
6806
6825
  if ((tag & 7) == 4 || tag == 0) {
6807
6826
  break;
@@ -6816,7 +6835,11 @@ var BlockConfirmedBody = {
6816
6835
  shardIndex: isSet5(object.shardIndex) ? Number(object.shardIndex) : 0,
6817
6836
  timestamp: isSet5(object.timestamp) ? Number(object.timestamp) : 0,
6818
6837
  blockHash: isSet5(object.blockHash) ? bytesFromBase645(object.blockHash) : new Uint8Array(),
6819
- totalEvents: isSet5(object.totalEvents) ? Number(object.totalEvents) : 0
6838
+ totalEvents: isSet5(object.totalEvents) ? Number(object.totalEvents) : 0,
6839
+ eventCountsByType: isObject(object.eventCountsByType) ? Object.entries(object.eventCountsByType).reduce((acc, [key, value]) => {
6840
+ acc[Number(key)] = Number(value);
6841
+ return acc;
6842
+ }, {}) : {}
6820
6843
  };
6821
6844
  },
6822
6845
  toJSON(message) {
@@ -6826,19 +6849,94 @@ var BlockConfirmedBody = {
6826
6849
  message.timestamp !== void 0 && (obj.timestamp = Math.round(message.timestamp));
6827
6850
  message.blockHash !== void 0 && (obj.blockHash = base64FromBytes5(message.blockHash !== void 0 ? message.blockHash : new Uint8Array()));
6828
6851
  message.totalEvents !== void 0 && (obj.totalEvents = Math.round(message.totalEvents));
6852
+ obj.eventCountsByType = {};
6853
+ if (message.eventCountsByType) {
6854
+ Object.entries(message.eventCountsByType).forEach(([k, v]) => {
6855
+ obj.eventCountsByType[k] = Math.round(v);
6856
+ });
6857
+ }
6829
6858
  return obj;
6830
6859
  },
6831
6860
  create(base) {
6832
6861
  return BlockConfirmedBody.fromPartial(base != null ? base : {});
6833
6862
  },
6834
6863
  fromPartial(object) {
6835
- var _a, _b, _c, _d, _e;
6864
+ var _a, _b, _c, _d, _e, _f;
6836
6865
  const message = createBaseBlockConfirmedBody();
6837
6866
  message.blockNumber = (_a = object.blockNumber) != null ? _a : 0;
6838
6867
  message.shardIndex = (_b = object.shardIndex) != null ? _b : 0;
6839
6868
  message.timestamp = (_c = object.timestamp) != null ? _c : 0;
6840
6869
  message.blockHash = (_d = object.blockHash) != null ? _d : new Uint8Array();
6841
6870
  message.totalEvents = (_e = object.totalEvents) != null ? _e : 0;
6871
+ message.eventCountsByType = Object.entries((_f = object.eventCountsByType) != null ? _f : {}).reduce(
6872
+ (acc, [key, value]) => {
6873
+ if (value !== void 0) {
6874
+ acc[Number(key)] = Number(value);
6875
+ }
6876
+ return acc;
6877
+ },
6878
+ {}
6879
+ );
6880
+ return message;
6881
+ }
6882
+ };
6883
+ function createBaseBlockConfirmedBody_EventCountsByTypeEntry() {
6884
+ return { key: 0, value: 0 };
6885
+ }
6886
+ var BlockConfirmedBody_EventCountsByTypeEntry = {
6887
+ encode(message, writer = import_minimal5.default.Writer.create()) {
6888
+ if (message.key !== 0) {
6889
+ writer.uint32(8).int32(message.key);
6890
+ }
6891
+ if (message.value !== 0) {
6892
+ writer.uint32(16).uint64(message.value);
6893
+ }
6894
+ return writer;
6895
+ },
6896
+ decode(input, length) {
6897
+ const reader = input instanceof import_minimal5.default.Reader ? input : import_minimal5.default.Reader.create(input);
6898
+ let end = length === void 0 ? reader.len : reader.pos + length;
6899
+ const message = createBaseBlockConfirmedBody_EventCountsByTypeEntry();
6900
+ while (reader.pos < end) {
6901
+ const tag = reader.uint32();
6902
+ switch (tag >>> 3) {
6903
+ case 1:
6904
+ if (tag != 8) {
6905
+ break;
6906
+ }
6907
+ message.key = reader.int32();
6908
+ continue;
6909
+ case 2:
6910
+ if (tag != 16) {
6911
+ break;
6912
+ }
6913
+ message.value = longToNumber5(reader.uint64());
6914
+ continue;
6915
+ }
6916
+ if ((tag & 7) == 4 || tag == 0) {
6917
+ break;
6918
+ }
6919
+ reader.skipType(tag & 7);
6920
+ }
6921
+ return message;
6922
+ },
6923
+ fromJSON(object) {
6924
+ return { key: isSet5(object.key) ? Number(object.key) : 0, value: isSet5(object.value) ? Number(object.value) : 0 };
6925
+ },
6926
+ toJSON(message) {
6927
+ const obj = {};
6928
+ message.key !== void 0 && (obj.key = Math.round(message.key));
6929
+ message.value !== void 0 && (obj.value = Math.round(message.value));
6930
+ return obj;
6931
+ },
6932
+ create(base) {
6933
+ return BlockConfirmedBody_EventCountsByTypeEntry.fromPartial(base != null ? base : {});
6934
+ },
6935
+ fromPartial(object) {
6936
+ var _a, _b;
6937
+ const message = createBaseBlockConfirmedBody_EventCountsByTypeEntry();
6938
+ message.key = (_a = object.key) != null ? _a : 0;
6939
+ message.value = (_b = object.value) != null ? _b : 0;
6842
6940
  return message;
6843
6941
  }
6844
6942
  };
@@ -7225,6 +7323,9 @@ if (import_minimal5.default.util.Long !== long_default) {
7225
7323
  import_minimal5.default.util.Long = long_default;
7226
7324
  import_minimal5.default.configure();
7227
7325
  }
7326
+ function isObject(value) {
7327
+ return typeof value === "object" && value !== null;
7328
+ }
7228
7329
  function isSet5(value) {
7229
7330
  return value !== null && value !== void 0;
7230
7331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farcaster/hub-web",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "ts-proto": "^1.146.0"
33
33
  },
34
34
  "dependencies": {
35
- "@farcaster/core": "^0.18.0",
35
+ "@farcaster/core": "^0.18.1",
36
36
  "@improbable-eng/grpc-web": "^0.15.0",
37
37
  "rxjs": "^7.8.0"
38
38
  }