@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/index.esm.js CHANGED
@@ -31822,9 +31822,9 @@ var EthWeb3Manager = /*#__PURE__*/function () {
31822
31822
  }();
31823
31823
 
31824
31824
  var name = "@audius/sdk";
31825
- var version = "3.0.3-beta.76";
31825
+ var version = "3.0.3-beta.77";
31826
31826
  var audius = {
31827
- releaseSHA: "07f7bd9792bda432d89e46e2bfb4912afab8a223"
31827
+ releaseSHA: "b23d5a6956c2cc4882e10534b00f9c169d03d73a"
31828
31828
  };
31829
31829
  var description = "Audius SDK";
31830
31830
  var main = "dist/index.cjs.js";
@@ -47640,17 +47640,6 @@ var EthContracts = /*#__PURE__*/function () {
47640
47640
  value: function isValidSPVersion(version1, version2) {
47641
47641
  return semver.major(version1) === semver.major(version2) && semver.minor(version1) === semver.minor(version2) && semver.patch(version2) >= semver.patch(version1);
47642
47642
  }
47643
- /**
47644
- * Determines whether the major and minor versions are equal
47645
- * @param version1 string 1
47646
- * @param version2 string 2
47647
- */
47648
-
47649
- }, {
47650
- key: "hasSameMajorAndMinorVersion",
47651
- value: function hasSameMajorAndMinorVersion(version1, version2) {
47652
- return semver.major(version1) === semver.major(version2) && semver.minor(version1) === semver.minor(version2);
47653
- }
47654
47643
  }, {
47655
47644
  key: "getServiceProviderList",
47656
47645
  value: function () {
@@ -47767,6 +47756,18 @@ var EthContracts = /*#__PURE__*/function () {
47767
47756
 
47768
47757
  return EthContracts;
47769
47758
  }();
47759
+ /**
47760
+ * Determines whether version2's major/minor versions are greater than or
47761
+ * equal to version1's major/minor.
47762
+ * @param version1 string 1
47763
+ * @param version2 string 2
47764
+ */
47765
+
47766
+ var isVersionAtLeastSameMajorMinor = function isVersionAtLeastSameMajorMinor(version1, version2) {
47767
+ var version1MajorMinor = "".concat(semver.major(version1), ".").concat(semver.minor(version1), ".0");
47768
+ var version2MajorMinor = "".concat(semver.major(version2), ".").concat(semver.minor(version2), ".0");
47769
+ return semver.gte(version2MajorMinor, version1MajorMinor);
47770
+ };
47770
47771
 
47771
47772
  /**
47772
47773
  * Converts a BN to a Uint8Array of length 8, in little endian notation.
@@ -58066,9 +58067,7 @@ var CreatorNodeSelection = /*#__PURE__*/function (_ServiceSelection) {
58066
58067
 
58067
58068
  if (resp.response) {
58068
58069
  var isUp = resp.response.status === 200;
58069
-
58070
- var versionIsUpToDate = _this2.ethContracts.hasSameMajorAndMinorVersion(_this2.currentVersion, resp.response.data.data.version);
58071
-
58070
+ var versionIsUpToDate = isVersionAtLeastSameMajorMinor(_this2.currentVersion, resp.response.data.data.version);
58072
58071
  var isHealthyStatus = resp.response.data.data.healthy;
58073
58072
  var _resp$response$data$d = resp.response.data.data,
58074
58073
  storagePathSize = _resp$response$data$d.storagePathSize,
@@ -59301,9 +59300,9 @@ var DiscoveryProviderSelection = /*#__PURE__*/function (_ServiceSelection) {
59301
59300
 
59302
59301
  if (status !== 200) return false;
59303
59302
  if (service !== DISCOVERY_SERVICE_NAME) return false;
59304
- if (!semver.valid(version)) return false; // If this service is not the same major/minor as what's on chain, reject
59303
+ if (!semver.valid(version)) return false; // If this service is not at least the version on chain, reject
59305
59304
 
59306
- if (!this.ethContracts.hasSameMajorAndMinorVersion(this.currentVersion, version)) {
59305
+ if (!isVersionAtLeastSameMajorMinor(this.currentVersion, version)) {
59307
59306
  return false;
59308
59307
  } // If this service is behind by patches, add it as a backup and reject
59309
59308
 
@@ -59434,7 +59433,7 @@ var DiscoveryProviderSelection = /*#__PURE__*/function (_ServiceSelection) {
59434
59433
  for (var _i = 0; _i < _this3.validVersions.length; ++_i) {
59435
59434
  var _this3$validVersions;
59436
59435
 
59437
- if (_this3.ethContracts.hasSameMajorAndMinorVersion((_this3$validVersions = _this3.validVersions) === null || _this3$validVersions === void 0 ? void 0 : _this3$validVersions[_i], version)) {
59436
+ if (isVersionAtLeastSameMajorMinor((_this3$validVersions = _this3.validVersions) === null || _this3$validVersions === void 0 ? void 0 : _this3$validVersions[_i], version)) {
59438
59437
  isVersionOk = true;
59439
59438
  break;
59440
59439
  }