@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 +26 -37
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +27 -38
- package/dist/index.esm.js.map +1 -1
- package/dist/legacy.js +26 -37
- package/dist/legacy.js.map +1 -1
- package/dist/native-libs.js +27 -38
- package/dist/native-libs.js.map +1 -1
- package/dist/services/solana/SolanaWeb3Manager.d.ts +3 -3
- package/dist/services/solana/tokenAccount.d.ts +2 -5
- package/dist/web-libs.js +26 -37
- package/dist/web-libs.js.map +1 -1
- package/package.json +4 -4
- package/src/api/Track.ts +1 -1
- package/src/services/creatorNode/CreatorNode.ts +3 -3
- package/src/services/solana/SolanaWeb3Manager.ts +4 -12
- package/src/services/solana/tokenAccount.ts +3 -18
package/dist/index.esm.js
CHANGED
|
@@ -34,7 +34,7 @@ import abiDecoder from 'abi-decoder';
|
|
|
34
34
|
import EthereumWallet from 'ethereumjs-wallet';
|
|
35
35
|
import urlJoin from 'proper-url-join';
|
|
36
36
|
import BN from 'bn.js';
|
|
37
|
-
import splToken, { ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
37
|
+
import splToken, { ASSOCIATED_TOKEN_PROGRAM_ID, getAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
|
38
38
|
import { serialize, deserialize } from 'borsh';
|
|
39
39
|
import keccak256 from 'keccak256';
|
|
40
40
|
import secp256k1 from 'secp256k1';
|
|
@@ -35493,7 +35493,7 @@ function _allRequests() {
|
|
|
35493
35493
|
return _allRequests.apply(this, arguments);
|
|
35494
35494
|
}
|
|
35495
35495
|
|
|
35496
|
-
|
|
35496
|
+
Keypair.generate();
|
|
35497
35497
|
|
|
35498
35498
|
var MIN_GAS_PRICE = Math.pow(10, 9); // 1 GWei, ETH minimum allowed gas price
|
|
35499
35499
|
|
|
@@ -35937,9 +35937,9 @@ var EthWeb3Manager = /*#__PURE__*/function () {
|
|
|
35937
35937
|
}();
|
|
35938
35938
|
|
|
35939
35939
|
var name = "@audius/sdk";
|
|
35940
|
-
var version = "3.0.8-beta.
|
|
35940
|
+
var version = "3.0.8-beta.13";
|
|
35941
35941
|
var audius = {
|
|
35942
|
-
releaseSHA: "
|
|
35942
|
+
releaseSHA: "473c515045520b748c27a58060a426eba8a3fc19"
|
|
35943
35943
|
};
|
|
35944
35944
|
var description = "Audius SDK";
|
|
35945
35945
|
var keywords = [
|
|
@@ -36008,8 +36008,8 @@ var dependencies = {
|
|
|
36008
36008
|
"@noble/secp256k1": "1.7.0",
|
|
36009
36009
|
"@project-serum/anchor": "0.24.1",
|
|
36010
36010
|
"@scure/base": "1.1.1",
|
|
36011
|
-
"@solana/spl-token": "0.
|
|
36012
|
-
"@solana/web3.js": "1.
|
|
36011
|
+
"@solana/spl-token": "0.3.8",
|
|
36012
|
+
"@solana/web3.js": "1.78.4",
|
|
36013
36013
|
"abi-decoder": "2.4.0",
|
|
36014
36014
|
ajv: "6.12.2",
|
|
36015
36015
|
assert: "2.0.0",
|
|
@@ -52876,26 +52876,20 @@ function getTokenAccountInfo(_x2) {
|
|
|
52876
52876
|
|
|
52877
52877
|
function _getTokenAccountInfo() {
|
|
52878
52878
|
_getTokenAccountInfo = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
52879
|
-
var tokenAccountAddressKey,
|
|
52879
|
+
var tokenAccountAddressKey, connection, info;
|
|
52880
52880
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
52881
52881
|
while (1) {
|
|
52882
52882
|
switch (_context2.prev = _context2.next) {
|
|
52883
52883
|
case 0:
|
|
52884
|
-
tokenAccountAddressKey = _ref2.tokenAccountAddressKey,
|
|
52885
|
-
|
|
52886
|
-
|
|
52887
|
-
// in the type definitions even though it's actually available,
|
|
52888
|
-
// so we suppress error until we can upgrade.
|
|
52889
|
-
// @ts-expect-error
|
|
52890
|
-
|
|
52891
|
-
_context2.next = 4;
|
|
52892
|
-
return token.getAccountInfo(tokenAccountAddressKey, 'processed');
|
|
52884
|
+
tokenAccountAddressKey = _ref2.tokenAccountAddressKey, connection = _ref2.connection;
|
|
52885
|
+
_context2.next = 3;
|
|
52886
|
+
return getAccount(connection, tokenAccountAddressKey, 'processed');
|
|
52893
52887
|
|
|
52894
|
-
case
|
|
52888
|
+
case 3:
|
|
52895
52889
|
info = _context2.sent;
|
|
52896
52890
|
return _context2.abrupt("return", info);
|
|
52897
52891
|
|
|
52898
|
-
case
|
|
52892
|
+
case 5:
|
|
52899
52893
|
case "end":
|
|
52900
52894
|
return _context2.stop();
|
|
52901
52895
|
}
|
|
@@ -54731,7 +54725,7 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
|
|
|
54731
54725
|
case 3:
|
|
54732
54726
|
userbank = _context2.sent;
|
|
54733
54727
|
_context2.next = 6;
|
|
54734
|
-
return this.getTokenAccountInfo(userbank.toString()
|
|
54728
|
+
return this.getTokenAccountInfo(userbank.toString());
|
|
54735
54729
|
|
|
54736
54730
|
case 6:
|
|
54737
54731
|
tokenAccount = _context2.sent;
|
|
@@ -55022,38 +55016,33 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
|
|
|
55022
55016
|
key: "getTokenAccountInfo",
|
|
55023
55017
|
value: function () {
|
|
55024
55018
|
var _getTokenAccountInfo2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(solanaAddress) {
|
|
55025
|
-
var
|
|
55026
|
-
res,
|
|
55027
|
-
_args8 = arguments;
|
|
55019
|
+
var res;
|
|
55028
55020
|
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
55029
55021
|
while (1) {
|
|
55030
55022
|
switch (_context8.prev = _context8.next) {
|
|
55031
55023
|
case 0:
|
|
55032
|
-
|
|
55033
|
-
_context8.
|
|
55034
|
-
_context8.next = 4;
|
|
55024
|
+
_context8.prev = 0;
|
|
55025
|
+
_context8.next = 3;
|
|
55035
55026
|
return getTokenAccountInfo({
|
|
55036
55027
|
tokenAccountAddressKey: new PublicKey(solanaAddress),
|
|
55037
|
-
mintKey: this.mints[mint],
|
|
55038
|
-
solanaTokenProgramKey: this.solanaTokenKey,
|
|
55039
55028
|
connection: this.connection
|
|
55040
55029
|
});
|
|
55041
55030
|
|
|
55042
|
-
case
|
|
55031
|
+
case 3:
|
|
55043
55032
|
res = _context8.sent;
|
|
55044
55033
|
return _context8.abrupt("return", res);
|
|
55045
55034
|
|
|
55046
|
-
case
|
|
55047
|
-
_context8.prev =
|
|
55048
|
-
_context8.t0 = _context8["catch"](
|
|
55035
|
+
case 7:
|
|
55036
|
+
_context8.prev = 7;
|
|
55037
|
+
_context8.t0 = _context8["catch"](0);
|
|
55049
55038
|
return _context8.abrupt("return", null);
|
|
55050
55039
|
|
|
55051
|
-
case
|
|
55040
|
+
case 10:
|
|
55052
55041
|
case "end":
|
|
55053
55042
|
return _context8.stop();
|
|
55054
55043
|
}
|
|
55055
55044
|
}
|
|
55056
|
-
}, _callee8, this, [[
|
|
55045
|
+
}, _callee8, this, [[0, 7]]);
|
|
55057
55046
|
}));
|
|
55058
55047
|
|
|
55059
55048
|
function getTokenAccountInfo$1(_x5) {
|
|
@@ -55108,7 +55097,7 @@ var SolanaWeb3Manager = /*#__PURE__*/function () {
|
|
|
55108
55097
|
case 13:
|
|
55109
55098
|
// Multiply by 10^10 to maintain same decimals as eth $AUDIO
|
|
55110
55099
|
decimals = AUDIO_DECMIALS - WAUDIO_DECMIALS;
|
|
55111
|
-
return _context9.abrupt("return", tokenAccount.amount
|
|
55100
|
+
return _context9.abrupt("return", tokenAccount.amount * BigInt('1'.padEnd(decimals + 1, '0')));
|
|
55112
55101
|
|
|
55113
55102
|
case 17:
|
|
55114
55103
|
_context9.prev = 17;
|
|
@@ -62029,7 +62018,7 @@ var CreatorNode = /*#__PURE__*/function () {
|
|
|
62029
62018
|
while (1) {
|
|
62030
62019
|
switch (_context4.prev = _context4.next) {
|
|
62031
62020
|
case 0:
|
|
62032
|
-
if (metadata.preview_start_seconds) {
|
|
62021
|
+
if (!(metadata.preview_start_seconds == null)) {
|
|
62033
62022
|
_context4.next = 2;
|
|
62034
62023
|
break;
|
|
62035
62024
|
}
|
|
@@ -62108,7 +62097,7 @@ var CreatorNode = /*#__PURE__*/function () {
|
|
|
62108
62097
|
updatedMetadata = _objectSpread2({}, metadata);
|
|
62109
62098
|
audioUploadOpts = {};
|
|
62110
62099
|
|
|
62111
|
-
if (updatedMetadata.preview_start_seconds) {
|
|
62100
|
+
if (updatedMetadata.preview_start_seconds != null) {
|
|
62112
62101
|
audioUploadOpts['previewStartSeconds'] = updatedMetadata.preview_start_seconds.toString();
|
|
62113
62102
|
} // Upload audio and cover art
|
|
62114
62103
|
|
|
@@ -62170,7 +62159,7 @@ var CreatorNode = /*#__PURE__*/function () {
|
|
|
62170
62159
|
updatedMetadata.duration = parseInt(audioResp.probe.format.duration, 10);
|
|
62171
62160
|
updatedMetadata.track_cid = audioResp.results['320'];
|
|
62172
62161
|
|
|
62173
|
-
if (updatedMetadata.preview_start_seconds) {
|
|
62162
|
+
if (updatedMetadata.preview_start_seconds != null) {
|
|
62174
62163
|
previewKey = "320_preview|".concat(updatedMetadata.preview_start_seconds);
|
|
62175
62164
|
updatedMetadata.preview_cid = audioResp.results[previewKey];
|
|
62176
62165
|
}
|
|
@@ -72401,7 +72390,7 @@ var Track = /*#__PURE__*/function (_Base) {
|
|
|
72401
72390
|
break;
|
|
72402
72391
|
}
|
|
72403
72392
|
|
|
72404
|
-
if (metadata.preview_start_seconds) {
|
|
72393
|
+
if (!(metadata.preview_start_seconds == null)) {
|
|
72405
72394
|
_context22.next = 12;
|
|
72406
72395
|
break;
|
|
72407
72396
|
}
|