@audius/sdk 3.0.3-beta110hotfix.0 → 3.0.3-beta110hotfix.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.cjs.js CHANGED
@@ -33822,7 +33822,7 @@ var EthWeb3Manager = /*#__PURE__*/function () {
33822
33822
  }();
33823
33823
 
33824
33824
  var name = "@audius/sdk";
33825
- var version = "3.0.3-beta.109";
33825
+ var version = "3.0.3-beta110hotfix.0";
33826
33826
  var audius = {
33827
33827
  releaseSHA: "e9e322a2ed5a616a1018c8797bcd8728119489dc"
33828
33828
  };
@@ -59245,6 +59245,7 @@ var CreatorNode = /*#__PURE__*/function () {
59245
59245
  var passList = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
59246
59246
  var blockList = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
59247
59247
  var monitoringCallbacks = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
59248
+ var storageNodeSelector = arguments.length > 8 ? arguments[8] : undefined;
59248
59249
 
59249
59250
  _classCallCheck(this, CreatorNode);
59250
59251
 
@@ -59258,6 +59259,7 @@ var CreatorNode = /*#__PURE__*/function () {
59258
59259
  this.passList = passList;
59259
59260
  this.blockList = blockList;
59260
59261
  this.monitoringCallbacks = monitoringCallbacks;
59262
+ this.storageNodeSelector = storageNodeSelector;
59261
59263
  }
59262
59264
 
59263
59265
  _createClass(CreatorNode, [{
@@ -59922,7 +59924,8 @@ var CreatorNode = /*#__PURE__*/function () {
59922
59924
  key: "_makeRequestV2",
59923
59925
  value: function () {
59924
59926
  var _makeRequestV = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16(axiosRequestObj) {
59925
- var requestId, msg;
59927
+ var _this$userStateManage, wallet, storageNodes, _iterator, _step, storageNode, requestId, msg;
59928
+
59926
59929
  return regeneratorRuntime.wrap(function _callee16$(_context16) {
59927
59930
  while (1) {
59928
59931
  switch (_context16.prev = _context16.next) {
@@ -59940,17 +59943,65 @@ var CreatorNode = /*#__PURE__*/function () {
59940
59943
  case 7:
59941
59944
  _context16.prev = 7;
59942
59945
  _context16.t0 = _context16["catch"](1);
59946
+ wallet = (_this$userStateManage = this.userStateManager.getCurrentUser()) === null || _this$userStateManage === void 0 ? void 0 : _this$userStateManage.wallet;
59947
+ storageNodes = this.storageNodeSelector.getNodes(wallet !== null && wallet !== void 0 ? wallet : '');
59948
+ _iterator = _createForOfIteratorHelper(storageNodes);
59949
+ _context16.prev = 12;
59950
+
59951
+ _iterator.s();
59952
+
59953
+ case 14:
59954
+ if ((_step = _iterator.n()).done) {
59955
+ _context16.next = 27;
59956
+ break;
59957
+ }
59958
+
59959
+ storageNode = _step.value;
59960
+ _context16.prev = 16;
59961
+ axiosRequestObj.baseURL = storageNode;
59962
+ _context16.next = 20;
59963
+ return axios__default["default"](axiosRequestObj);
59964
+
59965
+ case 20:
59966
+ return _context16.abrupt("return", _context16.sent);
59967
+
59968
+ case 23:
59969
+ _context16.prev = 23;
59970
+ _context16.t1 = _context16["catch"](16);
59971
+
59972
+ case 25:
59973
+ _context16.next = 14;
59974
+ break;
59975
+
59976
+ case 27:
59977
+ _context16.next = 32;
59978
+ break;
59979
+
59980
+ case 29:
59981
+ _context16.prev = 29;
59982
+ _context16.t2 = _context16["catch"](12);
59983
+
59984
+ _iterator.e(_context16.t2);
59985
+
59986
+ case 32:
59987
+ _context16.prev = 32;
59988
+
59989
+ _iterator.f();
59990
+
59991
+ return _context16.finish(32);
59992
+
59993
+ case 35:
59943
59994
  requestId = axiosRequestObj.headers['X-Request-ID'];
59944
- msg = "Error sending storagev2 request for X-Request-ID=".concat(requestId, ": ").concat(_context16.t0);
59995
+ msg = "Error sending storagev2 request for X-Request-ID=".concat(requestId, ", tried all storage nodes: ").concat(_context16.t0);
59945
59996
  console.error(msg);
59946
59997
  throw new Error(msg);
59947
59998
 
59948
- case 13:
59999
+ case 39:
59949
60000
  case "end":
59950
60001
  return _context16.stop();
59951
60002
  }
59952
60003
  }
59953
- }, _callee16, this, [[1, 7]]);
60004
+ }, _callee16, this, [[1, 7], [12, 29, 32, 35], [16, 23]]);
59954
60005
  }));
59955
60006
 
59956
60007
  function _makeRequestV2(_x19) {
@@ -71516,7 +71567,7 @@ var AudiusLibs = /*#__PURE__*/function () {
71516
71567
  creatorNodeEndpoint = randomNodes[0];
71517
71568
 
71518
71569
  case 51:
71519
- this.creatorNode = new CreatorNode(this.web3Manager, creatorNodeEndpoint, this.isServer, this.userStateManager, this.schemas, this.creatorNodeConfig.passList, this.creatorNodeConfig.blockList, this.creatorNodeConfig.monitoringCallbacks);
71570
+ this.creatorNode = new CreatorNode(this.web3Manager, creatorNodeEndpoint, this.isServer, this.userStateManager, this.schemas, this.creatorNodeConfig.passList, this.creatorNodeConfig.blockList, this.creatorNodeConfig.monitoringCallbacks, this.creatorNodeConfig.storageNodeSelector);
71520
71571
  _context.next = 54;
71521
71572
  return this.creatorNode.init();
71522
71573