@audius/sdk 3.0.3-beta.76 → 3.0.3-beta.77

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/legacy.js CHANGED
@@ -31873,9 +31873,9 @@ var EthWeb3Manager = /*#__PURE__*/function () {
31873
31873
  }();
31874
31874
 
31875
31875
  var name = "@audius/sdk";
31876
- var version = "3.0.3-beta.76";
31876
+ var version = "3.0.3-beta.77";
31877
31877
  var audius = {
31878
- releaseSHA: "07f7bd9792bda432d89e46e2bfb4912afab8a223"
31878
+ releaseSHA: "b23d5a6956c2cc4882e10534b00f9c169d03d73a"
31879
31879
  };
31880
31880
  var description = "Audius SDK";
31881
31881
  var main = "dist/index.cjs.js";
@@ -47691,17 +47691,6 @@ var EthContracts = /*#__PURE__*/function () {
47691
47691
  value: function isValidSPVersion(version1, version2) {
47692
47692
  return semver__default["default"].major(version1) === semver__default["default"].major(version2) && semver__default["default"].minor(version1) === semver__default["default"].minor(version2) && semver__default["default"].patch(version2) >= semver__default["default"].patch(version1);
47693
47693
  }
47694
- /**
47695
- * Determines whether the major and minor versions are equal
47696
- * @param version1 string 1
47697
- * @param version2 string 2
47698
- */
47699
-
47700
- }, {
47701
- key: "hasSameMajorAndMinorVersion",
47702
- value: function hasSameMajorAndMinorVersion(version1, version2) {
47703
- return semver__default["default"].major(version1) === semver__default["default"].major(version2) && semver__default["default"].minor(version1) === semver__default["default"].minor(version2);
47704
- }
47705
47694
  }, {
47706
47695
  key: "getServiceProviderList",
47707
47696
  value: function () {
@@ -47818,6 +47807,18 @@ var EthContracts = /*#__PURE__*/function () {
47818
47807
 
47819
47808
  return EthContracts;
47820
47809
  }();
47810
+ /**
47811
+ * Determines whether version2's major/minor versions are greater than or
47812
+ * equal to version1's major/minor.
47813
+ * @param version1 string 1
47814
+ * @param version2 string 2
47815
+ */
47816
+
47817
+ var isVersionAtLeastSameMajorMinor = function isVersionAtLeastSameMajorMinor(version1, version2) {
47818
+ var version1MajorMinor = "".concat(semver__default["default"].major(version1), ".").concat(semver__default["default"].minor(version1), ".0");
47819
+ var version2MajorMinor = "".concat(semver__default["default"].major(version2), ".").concat(semver__default["default"].minor(version2), ".0");
47820
+ return semver__default["default"].gte(version2MajorMinor, version1MajorMinor);
47821
+ };
47821
47822
 
47822
47823
  /**
47823
47824
  * Converts a BN to a Uint8Array of length 8, in little endian notation.
@@ -58117,9 +58118,7 @@ var CreatorNodeSelection = /*#__PURE__*/function (_ServiceSelection) {
58117
58118
 
58118
58119
  if (resp.response) {
58119
58120
  var isUp = resp.response.status === 200;
58120
-
58121
- var versionIsUpToDate = _this2.ethContracts.hasSameMajorAndMinorVersion(_this2.currentVersion, resp.response.data.data.version);
58122
-
58121
+ var versionIsUpToDate = isVersionAtLeastSameMajorMinor(_this2.currentVersion, resp.response.data.data.version);
58123
58122
  var isHealthyStatus = resp.response.data.data.healthy;
58124
58123
  var _resp$response$data$d = resp.response.data.data,
58125
58124
  storagePathSize = _resp$response$data$d.storagePathSize,
@@ -59352,9 +59351,9 @@ var DiscoveryProviderSelection = /*#__PURE__*/function (_ServiceSelection) {
59352
59351
 
59353
59352
  if (status !== 200) return false;
59354
59353
  if (service !== DISCOVERY_SERVICE_NAME) return false;
59355
- if (!semver__default["default"].valid(version)) return false; // If this service is not the same major/minor as what's on chain, reject
59354
+ if (!semver__default["default"].valid(version)) return false; // If this service is not at least the version on chain, reject
59356
59355
 
59357
- if (!this.ethContracts.hasSameMajorAndMinorVersion(this.currentVersion, version)) {
59356
+ if (!isVersionAtLeastSameMajorMinor(this.currentVersion, version)) {
59358
59357
  return false;
59359
59358
  } // If this service is behind by patches, add it as a backup and reject
59360
59359
 
@@ -59485,7 +59484,7 @@ var DiscoveryProviderSelection = /*#__PURE__*/function (_ServiceSelection) {
59485
59484
  for (var _i = 0; _i < _this3.validVersions.length; ++_i) {
59486
59485
  var _this3$validVersions;
59487
59486
 
59488
- if (_this3.ethContracts.hasSameMajorAndMinorVersion((_this3$validVersions = _this3.validVersions) === null || _this3$validVersions === void 0 ? void 0 : _this3$validVersions[_i], version)) {
59487
+ if (isVersionAtLeastSameMajorMinor((_this3$validVersions = _this3.validVersions) === null || _this3$validVersions === void 0 ? void 0 : _this3$validVersions[_i], version)) {
59489
59488
  isVersionOk = true;
59490
59489
  break;
59491
59490
  }