@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.
@@ -36,7 +36,7 @@ import fetch from 'cross-fetch';
36
36
  import 'node-abort-controller';
37
37
  import { Transaction } from 'ethereumjs-tx';
38
38
  import BN from 'bn.js';
39
- import splToken, { ASSOCIATED_TOKEN_PROGRAM_ID, Token, TOKEN_PROGRAM_ID } from '@solana/spl-token';
39
+ import splToken, { ASSOCIATED_TOKEN_PROGRAM_ID, getAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token';
40
40
  import { serialize, deserialize } from 'borsh';
41
41
  import keccak256 from 'keccak256';
42
42
  import secp256k1 from 'secp256k1';
@@ -601,9 +601,9 @@ if (typeof window !== 'undefined' && window && window.Web3) {
601
601
  var LibsWeb3 = Web3;
602
602
 
603
603
  var name = "@audius/sdk";
604
- var version$1 = "3.0.8-beta.11";
604
+ var version$1 = "3.0.8-beta.13";
605
605
  var audius = {
606
- releaseSHA: "94503e85377fab74d3b3f490b927c5a3bc12fd1f"
606
+ releaseSHA: "473c515045520b748c27a58060a426eba8a3fc19"
607
607
  };
608
608
  var description = "Audius SDK";
609
609
  var keywords = [
@@ -672,8 +672,8 @@ var dependencies = {
672
672
  "@noble/secp256k1": "1.7.0",
673
673
  "@project-serum/anchor": "0.24.1",
674
674
  "@scure/base": "1.1.1",
675
- "@solana/spl-token": "0.1.8",
676
- "@solana/web3.js": "1.37.1",
675
+ "@solana/spl-token": "0.3.8",
676
+ "@solana/web3.js": "1.78.4",
677
677
  "abi-decoder": "2.4.0",
678
678
  ajv: "6.12.2",
679
679
  assert: "2.0.0",
@@ -3777,7 +3777,7 @@ function _allRequests() {
3777
3777
  return _allRequests.apply(this, arguments);
3778
3778
  }
3779
3779
 
3780
- var randomKeyPair = Keypair.generate();
3780
+ Keypair.generate();
3781
3781
 
3782
3782
  var crc32c = {};
3783
3783
 
@@ -5394,7 +5394,7 @@ var CreatorNode = /*#__PURE__*/function () {
5394
5394
  while (1) {
5395
5395
  switch (_context4.prev = _context4.next) {
5396
5396
  case 0:
5397
- if (metadata.preview_start_seconds) {
5397
+ if (!(metadata.preview_start_seconds == null)) {
5398
5398
  _context4.next = 2;
5399
5399
  break;
5400
5400
  }
@@ -5473,7 +5473,7 @@ var CreatorNode = /*#__PURE__*/function () {
5473
5473
  updatedMetadata = _objectSpread2({}, metadata);
5474
5474
  audioUploadOpts = {};
5475
5475
 
5476
- if (updatedMetadata.preview_start_seconds) {
5476
+ if (updatedMetadata.preview_start_seconds != null) {
5477
5477
  audioUploadOpts['previewStartSeconds'] = updatedMetadata.preview_start_seconds.toString();
5478
5478
  } // Upload audio and cover art
5479
5479
 
@@ -5535,7 +5535,7 @@ var CreatorNode = /*#__PURE__*/function () {
5535
5535
  updatedMetadata.duration = parseInt(audioResp.probe.format.duration, 10);
5536
5536
  updatedMetadata.track_cid = audioResp.results['320'];
5537
5537
 
5538
- if (updatedMetadata.preview_start_seconds) {
5538
+ if (updatedMetadata.preview_start_seconds != null) {
5539
5539
  previewKey = "320_preview|".concat(updatedMetadata.preview_start_seconds);
5540
5540
  updatedMetadata.preview_cid = audioResp.results[previewKey];
5541
5541
  }
@@ -33909,26 +33909,20 @@ function getTokenAccountInfo(_x2) {
33909
33909
 
33910
33910
  function _getTokenAccountInfo() {
33911
33911
  _getTokenAccountInfo = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2) {
33912
- var tokenAccountAddressKey, mintKey, solanaTokenProgramKey, connection, token, info;
33912
+ var tokenAccountAddressKey, connection, info;
33913
33913
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
33914
33914
  while (1) {
33915
33915
  switch (_context2.prev = _context2.next) {
33916
33916
  case 0:
33917
- tokenAccountAddressKey = _ref2.tokenAccountAddressKey, mintKey = _ref2.mintKey, solanaTokenProgramKey = _ref2.solanaTokenProgramKey, connection = _ref2.connection;
33918
- token = new Token(connection, mintKey, solanaTokenProgramKey, randomKeyPair); // Fetch token info with 'processed commitment to get any recently changed amounts.
33919
- // NOTE: Our version of spl-token omits the second argument
33920
- // in the type definitions even though it's actually available,
33921
- // so we suppress error until we can upgrade.
33922
- // @ts-expect-error
33923
-
33924
- _context2.next = 4;
33925
- return token.getAccountInfo(tokenAccountAddressKey, 'processed');
33917
+ tokenAccountAddressKey = _ref2.tokenAccountAddressKey, connection = _ref2.connection;
33918
+ _context2.next = 3;
33919
+ return getAccount(connection, tokenAccountAddressKey, 'processed');
33926
33920
 
33927
- case 4:
33921
+ case 3:
33928
33922
  info = _context2.sent;
33929
33923
  return _context2.abrupt("return", info);
33930
33924
 
33931
- case 6:
33925
+ case 5:
33932
33926
  case "end":
33933
33927
  return _context2.stop();
33934
33928
  }
@@ -35764,7 +35758,7 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
35764
35758
  case 3:
35765
35759
  userbank = _context2.sent;
35766
35760
  _context2.next = 6;
35767
- return this.getTokenAccountInfo(userbank.toString(), mint);
35761
+ return this.getTokenAccountInfo(userbank.toString());
35768
35762
 
35769
35763
  case 6:
35770
35764
  tokenAccount = _context2.sent;
@@ -36055,38 +36049,33 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
36055
36049
  key: "getTokenAccountInfo",
36056
36050
  value: function () {
36057
36051
  var _getTokenAccountInfo2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(solanaAddress) {
36058
- var mint,
36059
- res,
36060
- _args8 = arguments;
36052
+ var res;
36061
36053
  return regeneratorRuntime.wrap(function _callee8$(_context8) {
36062
36054
  while (1) {
36063
36055
  switch (_context8.prev = _context8.next) {
36064
36056
  case 0:
36065
- mint = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : DEFAULT_MINT;
36066
- _context8.prev = 1;
36067
- _context8.next = 4;
36057
+ _context8.prev = 0;
36058
+ _context8.next = 3;
36068
36059
  return getTokenAccountInfo({
36069
36060
  tokenAccountAddressKey: new PublicKey(solanaAddress),
36070
- mintKey: this.mints[mint],
36071
- solanaTokenProgramKey: this.solanaTokenKey,
36072
36061
  connection: this.connection
36073
36062
  });
36074
36063
 
36075
- case 4:
36064
+ case 3:
36076
36065
  res = _context8.sent;
36077
36066
  return _context8.abrupt("return", res);
36078
36067
 
36079
- case 8:
36080
- _context8.prev = 8;
36081
- _context8.t0 = _context8["catch"](1);
36068
+ case 7:
36069
+ _context8.prev = 7;
36070
+ _context8.t0 = _context8["catch"](0);
36082
36071
  return _context8.abrupt("return", null);
36083
36072
 
36084
- case 11:
36073
+ case 10:
36085
36074
  case "end":
36086
36075
  return _context8.stop();
36087
36076
  }
36088
36077
  }
36089
- }, _callee8, this, [[1, 8]]);
36078
+ }, _callee8, this, [[0, 7]]);
36090
36079
  }));
36091
36080
 
36092
36081
  function getTokenAccountInfo$1(_x5) {
@@ -36141,7 +36130,7 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
36141
36130
  case 13:
36142
36131
  // Multiply by 10^10 to maintain same decimals as eth $AUDIO
36143
36132
  decimals = AUDIO_DECMIALS - WAUDIO_DECMIALS;
36144
- return _context9.abrupt("return", tokenAccount.amount.mul(Utils.toBN('1'.padEnd(decimals + 1, '0'))));
36133
+ return _context9.abrupt("return", tokenAccount.amount * BigInt('1'.padEnd(decimals + 1, '0')));
36145
36134
 
36146
36135
  case 17:
36147
36136
  _context9.prev = 17;
@@ -43872,7 +43861,7 @@ var Track = /*#__PURE__*/function (_Base) {
43872
43861
  break;
43873
43862
  }
43874
43863
 
43875
- if (metadata.preview_start_seconds) {
43864
+ if (!(metadata.preview_start_seconds == null)) {
43876
43865
  _context22.next = 12;
43877
43866
  break;
43878
43867
  }