@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.cjs.js CHANGED
@@ -32065,9 +32065,9 @@ var EthWeb3Manager = /*#__PURE__*/function () {
32065
32065
  }();
32066
32066
 
32067
32067
  var name = "@audius/sdk";
32068
- var version = "3.0.3-beta.76";
32068
+ var version = "3.0.3-beta.77";
32069
32069
  var audius = {
32070
- releaseSHA: "07f7bd9792bda432d89e46e2bfb4912afab8a223"
32070
+ releaseSHA: "b23d5a6956c2cc4882e10534b00f9c169d03d73a"
32071
32071
  };
32072
32072
  var description = "Audius SDK";
32073
32073
  var main = "dist/index.cjs.js";
@@ -47883,17 +47883,6 @@ var EthContracts = /*#__PURE__*/function () {
47883
47883
  value: function isValidSPVersion(version1, version2) {
47884
47884
  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);
47885
47885
  }
47886
- /**
47887
- * Determines whether the major and minor versions are equal
47888
- * @param version1 string 1
47889
- * @param version2 string 2
47890
- */
47891
-
47892
- }, {
47893
- key: "hasSameMajorAndMinorVersion",
47894
- value: function hasSameMajorAndMinorVersion(version1, version2) {
47895
- return semver__default["default"].major(version1) === semver__default["default"].major(version2) && semver__default["default"].minor(version1) === semver__default["default"].minor(version2);
47896
- }
47897
47886
  }, {
47898
47887
  key: "getServiceProviderList",
47899
47888
  value: function () {
@@ -48010,6 +47999,18 @@ var EthContracts = /*#__PURE__*/function () {
48010
47999
 
48011
48000
  return EthContracts;
48012
48001
  }();
48002
+ /**
48003
+ * Determines whether version2's major/minor versions are greater than or
48004
+ * equal to version1's major/minor.
48005
+ * @param version1 string 1
48006
+ * @param version2 string 2
48007
+ */
48008
+
48009
+ var isVersionAtLeastSameMajorMinor = function isVersionAtLeastSameMajorMinor(version1, version2) {
48010
+ var version1MajorMinor = "".concat(semver__default["default"].major(version1), ".").concat(semver__default["default"].minor(version1), ".0");
48011
+ var version2MajorMinor = "".concat(semver__default["default"].major(version2), ".").concat(semver__default["default"].minor(version2), ".0");
48012
+ return semver__default["default"].gte(version2MajorMinor, version1MajorMinor);
48013
+ };
48013
48014
 
48014
48015
  /**
48015
48016
  * Converts a BN to a Uint8Array of length 8, in little endian notation.
@@ -58309,9 +58310,7 @@ var CreatorNodeSelection = /*#__PURE__*/function (_ServiceSelection) {
58309
58310
 
58310
58311
  if (resp.response) {
58311
58312
  var isUp = resp.response.status === 200;
58312
-
58313
- var versionIsUpToDate = _this2.ethContracts.hasSameMajorAndMinorVersion(_this2.currentVersion, resp.response.data.data.version);
58314
-
58313
+ var versionIsUpToDate = isVersionAtLeastSameMajorMinor(_this2.currentVersion, resp.response.data.data.version);
58315
58314
  var isHealthyStatus = resp.response.data.data.healthy;
58316
58315
  var _resp$response$data$d = resp.response.data.data,
58317
58316
  storagePathSize = _resp$response$data$d.storagePathSize,
@@ -59544,9 +59543,9 @@ var DiscoveryProviderSelection = /*#__PURE__*/function (_ServiceSelection) {
59544
59543
 
59545
59544
  if (status !== 200) return false;
59546
59545
  if (service !== DISCOVERY_SERVICE_NAME) return false;
59547
- if (!semver__default["default"].valid(version)) return false; // If this service is not the same major/minor as what's on chain, reject
59546
+ if (!semver__default["default"].valid(version)) return false; // If this service is not at least the version on chain, reject
59548
59547
 
59549
- if (!this.ethContracts.hasSameMajorAndMinorVersion(this.currentVersion, version)) {
59548
+ if (!isVersionAtLeastSameMajorMinor(this.currentVersion, version)) {
59550
59549
  return false;
59551
59550
  } // If this service is behind by patches, add it as a backup and reject
59552
59551
 
@@ -59677,7 +59676,7 @@ var DiscoveryProviderSelection = /*#__PURE__*/function (_ServiceSelection) {
59677
59676
  for (var _i = 0; _i < _this3.validVersions.length; ++_i) {
59678
59677
  var _this3$validVersions;
59679
59678
 
59680
- if (_this3.ethContracts.hasSameMajorAndMinorVersion((_this3$validVersions = _this3.validVersions) === null || _this3$validVersions === void 0 ? void 0 : _this3$validVersions[_i], version)) {
59679
+ if (isVersionAtLeastSameMajorMinor((_this3$validVersions = _this3.validVersions) === null || _this3$validVersions === void 0 ? void 0 : _this3$validVersions[_i], version)) {
59681
59680
  isVersionOk = true;
59682
59681
  break;
59683
59682
  }