@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.
@@ -96,7 +96,7 @@ export declare class SolanaWeb3Manager {
96
96
  errorCode: string | number | null;
97
97
  } | {
98
98
  didExist: boolean;
99
- userbank: solanaWeb3.PublicKey;
99
+ userbank: PublicKey;
100
100
  }>;
101
101
  /**
102
102
  * Creates a token account for the provided solana address (a wallet)
@@ -119,11 +119,11 @@ export declare class SolanaWeb3Manager {
119
119
  * Gets the info for a user bank/wAudio token account given a spl-token address.
120
120
  * If the address is not a valid token account, returns `null`
121
121
  */
122
- getTokenAccountInfo(solanaAddress: string, mint?: MintName): Promise<splToken.AccountInfo | null>;
122
+ getTokenAccountInfo(solanaAddress: string): Promise<splToken.Account | null>;
123
123
  /**
124
124
  * Gets the SPL waudio balance for a solana address in wei with 18 decimals
125
125
  */
126
- getWAudioBalance(solanaAddress: string): Promise<BN | null>;
126
+ getWAudioBalance(solanaAddress: string): Promise<bigint | null>;
127
127
  /**
128
128
  * Transfers audio from the web3 provider's eth address
129
129
  * @param {string} recipientSolanaAddress
@@ -1,6 +1,5 @@
1
- /// <reference types="@solana/spl-token" />
2
1
  import { PublicKey, Connection } from '@solana/web3.js';
3
- import { Nullable } from '../../utils';
2
+ import type { Nullable } from '../../utils';
4
3
  import type { IdentityService } from '../identity';
5
4
  declare type FindAssociatedTokenAddressConfig = {
6
5
  solanaWalletKey: PublicKey;
@@ -13,14 +12,12 @@ declare type FindAssociatedTokenAddressConfig = {
13
12
  export declare function findAssociatedTokenAddress({ solanaWalletKey, mintKey, solanaTokenProgramKey }: FindAssociatedTokenAddressConfig): Promise<PublicKey>;
14
13
  declare type GetTokenAccountInfoConfig = {
15
14
  tokenAccountAddressKey: PublicKey;
16
- mintKey: PublicKey;
17
- solanaTokenProgramKey: PublicKey;
18
15
  connection: Connection;
19
16
  };
20
17
  /**
21
18
  * Gets token account information (e.g. balance, ownership, etc.)
22
19
  */
23
- export declare function getTokenAccountInfo({ tokenAccountAddressKey, mintKey, solanaTokenProgramKey, connection }: GetTokenAccountInfoConfig): Promise<import("@solana/spl-token").AccountInfo>;
20
+ export declare function getTokenAccountInfo({ tokenAccountAddressKey, connection }: GetTokenAccountInfoConfig): Promise<import("@solana/spl-token").Account>;
24
21
  declare type CreateAssociatedTokenAccountParams = {
25
22
  feePayerKey: PublicKey;
26
23
  solanaWalletKey: PublicKey;
package/dist/web-libs.js CHANGED
@@ -35540,7 +35540,7 @@ function _allRequests() {
35540
35540
  return _allRequests.apply(this, arguments);
35541
35541
  }
35542
35542
 
35543
- var randomKeyPair = solanaWeb3.Keypair.generate();
35543
+ solanaWeb3.Keypair.generate();
35544
35544
 
35545
35545
  var MIN_GAS_PRICE = Math.pow(10, 9); // 1 GWei, ETH minimum allowed gas price
35546
35546
 
@@ -35984,9 +35984,9 @@ var EthWeb3Manager = /*#__PURE__*/function () {
35984
35984
  }();
35985
35985
 
35986
35986
  var name = "@audius/sdk";
35987
- var version = "3.0.8-beta.11";
35987
+ var version = "3.0.8-beta.13";
35988
35988
  var audius = {
35989
- releaseSHA: "94503e85377fab74d3b3f490b927c5a3bc12fd1f"
35989
+ releaseSHA: "473c515045520b748c27a58060a426eba8a3fc19"
35990
35990
  };
35991
35991
  var description = "Audius SDK";
35992
35992
  var keywords = [
@@ -36055,8 +36055,8 @@ var dependencies = {
36055
36055
  "@noble/secp256k1": "1.7.0",
36056
36056
  "@project-serum/anchor": "0.24.1",
36057
36057
  "@scure/base": "1.1.1",
36058
- "@solana/spl-token": "0.1.8",
36059
- "@solana/web3.js": "1.37.1",
36058
+ "@solana/spl-token": "0.3.8",
36059
+ "@solana/web3.js": "1.78.4",
36060
36060
  "abi-decoder": "2.4.0",
36061
36061
  ajv: "6.12.2",
36062
36062
  assert: "2.0.0",
@@ -52923,26 +52923,20 @@ function getTokenAccountInfo(_x2) {
52923
52923
 
52924
52924
  function _getTokenAccountInfo() {
52925
52925
  _getTokenAccountInfo = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2) {
52926
- var tokenAccountAddressKey, mintKey, solanaTokenProgramKey, connection, token, info;
52926
+ var tokenAccountAddressKey, connection, info;
52927
52927
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
52928
52928
  while (1) {
52929
52929
  switch (_context2.prev = _context2.next) {
52930
52930
  case 0:
52931
- tokenAccountAddressKey = _ref2.tokenAccountAddressKey, mintKey = _ref2.mintKey, solanaTokenProgramKey = _ref2.solanaTokenProgramKey, connection = _ref2.connection;
52932
- token = new splToken.Token(connection, mintKey, solanaTokenProgramKey, randomKeyPair); // Fetch token info with 'processed commitment to get any recently changed amounts.
52933
- // NOTE: Our version of spl-token omits the second argument
52934
- // in the type definitions even though it's actually available,
52935
- // so we suppress error until we can upgrade.
52936
- // @ts-expect-error
52937
-
52938
- _context2.next = 4;
52939
- return token.getAccountInfo(tokenAccountAddressKey, 'processed');
52931
+ tokenAccountAddressKey = _ref2.tokenAccountAddressKey, connection = _ref2.connection;
52932
+ _context2.next = 3;
52933
+ return splToken.getAccount(connection, tokenAccountAddressKey, 'processed');
52940
52934
 
52941
- case 4:
52935
+ case 3:
52942
52936
  info = _context2.sent;
52943
52937
  return _context2.abrupt("return", info);
52944
52938
 
52945
- case 6:
52939
+ case 5:
52946
52940
  case "end":
52947
52941
  return _context2.stop();
52948
52942
  }
@@ -54778,7 +54772,7 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
54778
54772
  case 3:
54779
54773
  userbank = _context2.sent;
54780
54774
  _context2.next = 6;
54781
- return this.getTokenAccountInfo(userbank.toString(), mint);
54775
+ return this.getTokenAccountInfo(userbank.toString());
54782
54776
 
54783
54777
  case 6:
54784
54778
  tokenAccount = _context2.sent;
@@ -55069,38 +55063,33 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
55069
55063
  key: "getTokenAccountInfo",
55070
55064
  value: function () {
55071
55065
  var _getTokenAccountInfo2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(solanaAddress) {
55072
- var mint,
55073
- res,
55074
- _args8 = arguments;
55066
+ var res;
55075
55067
  return regeneratorRuntime.wrap(function _callee8$(_context8) {
55076
55068
  while (1) {
55077
55069
  switch (_context8.prev = _context8.next) {
55078
55070
  case 0:
55079
- mint = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : DEFAULT_MINT;
55080
- _context8.prev = 1;
55081
- _context8.next = 4;
55071
+ _context8.prev = 0;
55072
+ _context8.next = 3;
55082
55073
  return getTokenAccountInfo({
55083
55074
  tokenAccountAddressKey: new solanaWeb3.PublicKey(solanaAddress),
55084
- mintKey: this.mints[mint],
55085
- solanaTokenProgramKey: this.solanaTokenKey,
55086
55075
  connection: this.connection
55087
55076
  });
55088
55077
 
55089
- case 4:
55078
+ case 3:
55090
55079
  res = _context8.sent;
55091
55080
  return _context8.abrupt("return", res);
55092
55081
 
55093
- case 8:
55094
- _context8.prev = 8;
55095
- _context8.t0 = _context8["catch"](1);
55082
+ case 7:
55083
+ _context8.prev = 7;
55084
+ _context8.t0 = _context8["catch"](0);
55096
55085
  return _context8.abrupt("return", null);
55097
55086
 
55098
- case 11:
55087
+ case 10:
55099
55088
  case "end":
55100
55089
  return _context8.stop();
55101
55090
  }
55102
55091
  }
55103
- }, _callee8, this, [[1, 8]]);
55092
+ }, _callee8, this, [[0, 7]]);
55104
55093
  }));
55105
55094
 
55106
55095
  function getTokenAccountInfo$1(_x5) {
@@ -55155,7 +55144,7 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
55155
55144
  case 13:
55156
55145
  // Multiply by 10^10 to maintain same decimals as eth $AUDIO
55157
55146
  decimals = AUDIO_DECMIALS - WAUDIO_DECMIALS;
55158
- return _context9.abrupt("return", tokenAccount.amount.mul(Utils.toBN('1'.padEnd(decimals + 1, '0'))));
55147
+ return _context9.abrupt("return", tokenAccount.amount * BigInt('1'.padEnd(decimals + 1, '0')));
55159
55148
 
55160
55149
  case 17:
55161
55150
  _context9.prev = 17;
@@ -62076,7 +62065,7 @@ var CreatorNode = /*#__PURE__*/function () {
62076
62065
  while (1) {
62077
62066
  switch (_context4.prev = _context4.next) {
62078
62067
  case 0:
62079
- if (metadata.preview_start_seconds) {
62068
+ if (!(metadata.preview_start_seconds == null)) {
62080
62069
  _context4.next = 2;
62081
62070
  break;
62082
62071
  }
@@ -62155,7 +62144,7 @@ var CreatorNode = /*#__PURE__*/function () {
62155
62144
  updatedMetadata = _objectSpread2({}, metadata);
62156
62145
  audioUploadOpts = {};
62157
62146
 
62158
- if (updatedMetadata.preview_start_seconds) {
62147
+ if (updatedMetadata.preview_start_seconds != null) {
62159
62148
  audioUploadOpts['previewStartSeconds'] = updatedMetadata.preview_start_seconds.toString();
62160
62149
  } // Upload audio and cover art
62161
62150
 
@@ -62217,7 +62206,7 @@ var CreatorNode = /*#__PURE__*/function () {
62217
62206
  updatedMetadata.duration = parseInt(audioResp.probe.format.duration, 10);
62218
62207
  updatedMetadata.track_cid = audioResp.results['320'];
62219
62208
 
62220
- if (updatedMetadata.preview_start_seconds) {
62209
+ if (updatedMetadata.preview_start_seconds != null) {
62221
62210
  previewKey = "320_preview|".concat(updatedMetadata.preview_start_seconds);
62222
62211
  updatedMetadata.preview_cid = audioResp.results[previewKey];
62223
62212
  }
@@ -71809,7 +71798,7 @@ var Track = /*#__PURE__*/function (_Base) {
71809
71798
  break;
71810
71799
  }
71811
71800
 
71812
- if (metadata.preview_start_seconds) {
71801
+ if (!(metadata.preview_start_seconds == null)) {
71813
71802
  _context22.next = 12;
71814
71803
  break;
71815
71804
  }