wallaby-cash 2.3.3 → 2.3.5
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 +15 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +15 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/lib/wallet/wallet-data.service.d.ts +13 -6
- package/dist/package.json +3 -2
- package/dist/types/wallet.d.ts +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -575,7 +575,7 @@ const env = {
|
|
|
575
575
|
isNative: false,
|
|
576
576
|
isWeb,
|
|
577
577
|
};
|
|
578
|
-
const currentPackageVersion = "2.3.
|
|
578
|
+
const currentPackageVersion = "2.3.5" ;
|
|
579
579
|
|
|
580
580
|
/**
|
|
581
581
|
* Storage keys adapter for Storage interface across different platforms.
|
|
@@ -10605,9 +10605,9 @@ class WalletDataService extends Base {
|
|
|
10605
10605
|
* @param { BlockchainName } chainName the chain name enum. i.e. 'ETHEREUM', 'BITCOIN'
|
|
10606
10606
|
* @returns { TokenBalance } Balance of the token
|
|
10607
10607
|
*/
|
|
10608
|
-
async getTokenBalance({ address,
|
|
10608
|
+
async getTokenBalance({ address, assetSymbol, tokenStandard, chainName }) {
|
|
10609
10609
|
try {
|
|
10610
|
-
if (!address || !
|
|
10610
|
+
if (!address || !assetSymbol || (!chainName && !tokenStandard)) {
|
|
10611
10611
|
throw new WallabyError({
|
|
10612
10612
|
message: 'Missing required parameters',
|
|
10613
10613
|
statusCode: 400,
|
|
@@ -10615,7 +10615,7 @@ class WalletDataService extends Base {
|
|
|
10615
10615
|
});
|
|
10616
10616
|
}
|
|
10617
10617
|
const response = await this.request(WalletRoutes.getTokenBalance, {
|
|
10618
|
-
payload: { address,
|
|
10618
|
+
payload: { address, assetSymbol, chainName, tokenStandard },
|
|
10619
10619
|
});
|
|
10620
10620
|
return response;
|
|
10621
10621
|
}
|
|
@@ -10628,13 +10628,17 @@ class WalletDataService extends Base {
|
|
|
10628
10628
|
*
|
|
10629
10629
|
* @public
|
|
10630
10630
|
* Fetches the balances for a group of tokens in bulk.
|
|
10631
|
-
*
|
|
10632
|
-
* @param { string }
|
|
10633
|
-
* @param {
|
|
10634
|
-
*
|
|
10631
|
+
* Takes an array of addresses and tokens and return their balances.
|
|
10632
|
+
* @param { string } walletId Wallet ID
|
|
10633
|
+
* @param { TokenBalanceRequest[] } tokensAndAddressesList An array of token balance requests.
|
|
10634
|
+
* - address: Wallet address
|
|
10635
|
+
* - symbol: Token symbol
|
|
10636
|
+
* - chainName: Blockchain name (optional)
|
|
10637
|
+
* - tokenStandard: Token standard (optional)
|
|
10638
|
+
* Note: Either chainName or tokenStandard must be provided.
|
|
10635
10639
|
* @returns { FetchBalanceData } Returns an array of the requested tokens balances.
|
|
10636
10640
|
*/
|
|
10637
|
-
async getMultiTokenBalances(tokensAndAddressesList) {
|
|
10641
|
+
async getMultiTokenBalances({ walletId, tokensAndAddressesList }) {
|
|
10638
10642
|
try {
|
|
10639
10643
|
if (!tokensAndAddressesList.length) {
|
|
10640
10644
|
throw new WallabyError({
|
|
@@ -10644,12 +10648,12 @@ class WalletDataService extends Base {
|
|
|
10644
10648
|
});
|
|
10645
10649
|
}
|
|
10646
10650
|
const response = await this.request(WalletRoutes.getMultiTokenBalances, {
|
|
10647
|
-
payload: { assets: tokensAndAddressesList },
|
|
10651
|
+
payload: { assets: tokensAndAddressesList, walletId },
|
|
10648
10652
|
});
|
|
10649
10653
|
return response;
|
|
10650
10654
|
}
|
|
10651
10655
|
catch (error) {
|
|
10652
|
-
logger.error('SDK::WalletDataService::
|
|
10656
|
+
logger.error('SDK::WalletDataService::getMultiTokenBalances::error', error);
|
|
10653
10657
|
throw error;
|
|
10654
10658
|
}
|
|
10655
10659
|
}
|