@audius/sdk 3.0.8-beta.12 → 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 +22 -33
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +23 -34
- package/dist/index.esm.js.map +1 -1
- package/dist/legacy.js +22 -33
- package/dist/legacy.js.map +1 -1
- package/dist/native-libs.js +23 -34
- 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 +22 -33
- package/dist/web-libs.js.map +1 -1
- package/package.json +4 -4
- package/src/services/solana/SolanaWeb3Manager.ts +4 -12
- package/src/services/solana/tokenAccount.ts +3 -18
|
@@ -96,7 +96,7 @@ export declare class SolanaWeb3Manager {
|
|
|
96
96
|
errorCode: string | number | null;
|
|
97
97
|
} | {
|
|
98
98
|
didExist: boolean;
|
|
99
|
-
userbank:
|
|
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
|
|
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<
|
|
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,
|
|
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
|
-
|
|
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.
|
|
35987
|
+
var version = "3.0.8-beta.13";
|
|
35988
35988
|
var audius = {
|
|
35989
|
-
releaseSHA: "
|
|
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.
|
|
36059
|
-
"@solana/web3.js": "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,
|
|
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,
|
|
52932
|
-
|
|
52933
|
-
|
|
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
|
|
52935
|
+
case 3:
|
|
52942
52936
|
info = _context2.sent;
|
|
52943
52937
|
return _context2.abrupt("return", info);
|
|
52944
52938
|
|
|
52945
|
-
case
|
|
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()
|
|
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
|
|
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
|
-
|
|
55080
|
-
_context8.
|
|
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
|
|
55078
|
+
case 3:
|
|
55090
55079
|
res = _context8.sent;
|
|
55091
55080
|
return _context8.abrupt("return", res);
|
|
55092
55081
|
|
|
55093
|
-
case
|
|
55094
|
-
_context8.prev =
|
|
55095
|
-
_context8.t0 = _context8["catch"](
|
|
55082
|
+
case 7:
|
|
55083
|
+
_context8.prev = 7;
|
|
55084
|
+
_context8.t0 = _context8["catch"](0);
|
|
55096
55085
|
return _context8.abrupt("return", null);
|
|
55097
55086
|
|
|
55098
|
-
case
|
|
55087
|
+
case 10:
|
|
55099
55088
|
case "end":
|
|
55100
55089
|
return _context8.stop();
|
|
55101
55090
|
}
|
|
55102
55091
|
}
|
|
55103
|
-
}, _callee8, this, [[
|
|
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
|
|
55147
|
+
return _context9.abrupt("return", tokenAccount.amount * BigInt('1'.padEnd(decimals + 1, '0')));
|
|
55159
55148
|
|
|
55160
55149
|
case 17:
|
|
55161
55150
|
_context9.prev = 17;
|