@audius/sdk 3.0.8-beta.11 → 3.0.8-beta.13

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
@@ -35736,7 +35736,7 @@ function _allRequests() {
35736
35736
  return _allRequests.apply(this, arguments);
35737
35737
  }
35738
35738
 
35739
- var randomKeyPair = solanaWeb3.Keypair.generate();
35739
+ solanaWeb3.Keypair.generate();
35740
35740
 
35741
35741
  var MIN_GAS_PRICE = Math.pow(10, 9); // 1 GWei, ETH minimum allowed gas price
35742
35742
 
@@ -36180,9 +36180,9 @@ var EthWeb3Manager = /*#__PURE__*/function () {
36180
36180
  }();
36181
36181
 
36182
36182
  var name = "@audius/sdk";
36183
- var version = "3.0.8-beta.11";
36183
+ var version = "3.0.8-beta.13";
36184
36184
  var audius = {
36185
- releaseSHA: "94503e85377fab74d3b3f490b927c5a3bc12fd1f"
36185
+ releaseSHA: "473c515045520b748c27a58060a426eba8a3fc19"
36186
36186
  };
36187
36187
  var description = "Audius SDK";
36188
36188
  var keywords = [
@@ -36251,8 +36251,8 @@ var dependencies = {
36251
36251
  "@noble/secp256k1": "1.7.0",
36252
36252
  "@project-serum/anchor": "0.24.1",
36253
36253
  "@scure/base": "1.1.1",
36254
- "@solana/spl-token": "0.1.8",
36255
- "@solana/web3.js": "1.37.1",
36254
+ "@solana/spl-token": "0.3.8",
36255
+ "@solana/web3.js": "1.78.4",
36256
36256
  "abi-decoder": "2.4.0",
36257
36257
  ajv: "6.12.2",
36258
36258
  assert: "2.0.0",
@@ -53119,26 +53119,20 @@ function getTokenAccountInfo(_x2) {
53119
53119
 
53120
53120
  function _getTokenAccountInfo() {
53121
53121
  _getTokenAccountInfo = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2) {
53122
- var tokenAccountAddressKey, mintKey, solanaTokenProgramKey, connection, token, info;
53122
+ var tokenAccountAddressKey, connection, info;
53123
53123
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
53124
53124
  while (1) {
53125
53125
  switch (_context2.prev = _context2.next) {
53126
53126
  case 0:
53127
- tokenAccountAddressKey = _ref2.tokenAccountAddressKey, mintKey = _ref2.mintKey, solanaTokenProgramKey = _ref2.solanaTokenProgramKey, connection = _ref2.connection;
53128
- token = new splToken.Token(connection, mintKey, solanaTokenProgramKey, randomKeyPair); // Fetch token info with 'processed commitment to get any recently changed amounts.
53129
- // NOTE: Our version of spl-token omits the second argument
53130
- // in the type definitions even though it's actually available,
53131
- // so we suppress error until we can upgrade.
53132
- // @ts-expect-error
53133
-
53134
- _context2.next = 4;
53135
- return token.getAccountInfo(tokenAccountAddressKey, 'processed');
53127
+ tokenAccountAddressKey = _ref2.tokenAccountAddressKey, connection = _ref2.connection;
53128
+ _context2.next = 3;
53129
+ return splToken.getAccount(connection, tokenAccountAddressKey, 'processed');
53136
53130
 
53137
- case 4:
53131
+ case 3:
53138
53132
  info = _context2.sent;
53139
53133
  return _context2.abrupt("return", info);
53140
53134
 
53141
- case 6:
53135
+ case 5:
53142
53136
  case "end":
53143
53137
  return _context2.stop();
53144
53138
  }
@@ -54974,7 +54968,7 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
54974
54968
  case 3:
54975
54969
  userbank = _context2.sent;
54976
54970
  _context2.next = 6;
54977
- return this.getTokenAccountInfo(userbank.toString(), mint);
54971
+ return this.getTokenAccountInfo(userbank.toString());
54978
54972
 
54979
54973
  case 6:
54980
54974
  tokenAccount = _context2.sent;
@@ -55265,38 +55259,33 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
55265
55259
  key: "getTokenAccountInfo",
55266
55260
  value: function () {
55267
55261
  var _getTokenAccountInfo2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(solanaAddress) {
55268
- var mint,
55269
- res,
55270
- _args8 = arguments;
55262
+ var res;
55271
55263
  return regeneratorRuntime.wrap(function _callee8$(_context8) {
55272
55264
  while (1) {
55273
55265
  switch (_context8.prev = _context8.next) {
55274
55266
  case 0:
55275
- mint = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : DEFAULT_MINT;
55276
- _context8.prev = 1;
55277
- _context8.next = 4;
55267
+ _context8.prev = 0;
55268
+ _context8.next = 3;
55278
55269
  return getTokenAccountInfo({
55279
55270
  tokenAccountAddressKey: new solanaWeb3.PublicKey(solanaAddress),
55280
- mintKey: this.mints[mint],
55281
- solanaTokenProgramKey: this.solanaTokenKey,
55282
55271
  connection: this.connection
55283
55272
  });
55284
55273
 
55285
- case 4:
55274
+ case 3:
55286
55275
  res = _context8.sent;
55287
55276
  return _context8.abrupt("return", res);
55288
55277
 
55289
- case 8:
55290
- _context8.prev = 8;
55291
- _context8.t0 = _context8["catch"](1);
55278
+ case 7:
55279
+ _context8.prev = 7;
55280
+ _context8.t0 = _context8["catch"](0);
55292
55281
  return _context8.abrupt("return", null);
55293
55282
 
55294
- case 11:
55283
+ case 10:
55295
55284
  case "end":
55296
55285
  return _context8.stop();
55297
55286
  }
55298
55287
  }
55299
- }, _callee8, this, [[1, 8]]);
55288
+ }, _callee8, this, [[0, 7]]);
55300
55289
  }));
55301
55290
 
55302
55291
  function getTokenAccountInfo$1(_x5) {
@@ -55351,7 +55340,7 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
55351
55340
  case 13:
55352
55341
  // Multiply by 10^10 to maintain same decimals as eth $AUDIO
55353
55342
  decimals = AUDIO_DECMIALS - WAUDIO_DECMIALS;
55354
- return _context9.abrupt("return", tokenAccount.amount.mul(Utils.toBN('1'.padEnd(decimals + 1, '0'))));
55343
+ return _context9.abrupt("return", tokenAccount.amount * BigInt('1'.padEnd(decimals + 1, '0')));
55355
55344
 
55356
55345
  case 17:
55357
55346
  _context9.prev = 17;
@@ -62272,7 +62261,7 @@ var CreatorNode = /*#__PURE__*/function () {
62272
62261
  while (1) {
62273
62262
  switch (_context4.prev = _context4.next) {
62274
62263
  case 0:
62275
- if (metadata.preview_start_seconds) {
62264
+ if (!(metadata.preview_start_seconds == null)) {
62276
62265
  _context4.next = 2;
62277
62266
  break;
62278
62267
  }
@@ -62351,7 +62340,7 @@ var CreatorNode = /*#__PURE__*/function () {
62351
62340
  updatedMetadata = _objectSpread2({}, metadata);
62352
62341
  audioUploadOpts = {};
62353
62342
 
62354
- if (updatedMetadata.preview_start_seconds) {
62343
+ if (updatedMetadata.preview_start_seconds != null) {
62355
62344
  audioUploadOpts['previewStartSeconds'] = updatedMetadata.preview_start_seconds.toString();
62356
62345
  } // Upload audio and cover art
62357
62346
 
@@ -62413,7 +62402,7 @@ var CreatorNode = /*#__PURE__*/function () {
62413
62402
  updatedMetadata.duration = parseInt(audioResp.probe.format.duration, 10);
62414
62403
  updatedMetadata.track_cid = audioResp.results['320'];
62415
62404
 
62416
- if (updatedMetadata.preview_start_seconds) {
62405
+ if (updatedMetadata.preview_start_seconds != null) {
62417
62406
  previewKey = "320_preview|".concat(updatedMetadata.preview_start_seconds);
62418
62407
  updatedMetadata.preview_cid = audioResp.results[previewKey];
62419
62408
  }
@@ -72644,7 +72633,7 @@ var Track = /*#__PURE__*/function (_Base) {
72644
72633
  break;
72645
72634
  }
72646
72635
 
72647
- if (metadata.preview_start_seconds) {
72636
+ if (!(metadata.preview_start_seconds == null)) {
72648
72637
  _context22.next = 12;
72649
72638
  break;
72650
72639
  }