@orderly.network/default-solana-adapter 2.11.0 → 2.11.1

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.mjs CHANGED
@@ -42,13 +42,13 @@ var __async = (__this, __arguments, generator) => {
42
42
  // src/version.ts
43
43
  if (typeof window !== "undefined") {
44
44
  window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
45
- window.__ORDERLY_VERSION__["@orderly.network/default-solana-adapter"] = "2.11.0";
45
+ window.__ORDERLY_VERSION__["@orderly.network/default-solana-adapter"] = "2.11.1";
46
46
  }
47
- var version_default = "2.11.0";
47
+ var version_default = "2.11.1";
48
48
 
49
49
  // src/walletAdapter.ts
50
50
  import * as ed from "@noble/ed25519";
51
- import { getAccount, getMultipleAccounts } from "@solana/spl-token";
51
+ import { getAccount } from "@solana/spl-token";
52
52
  import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
53
53
  import {
54
54
  clusterApiUrl,
@@ -3581,12 +3581,23 @@ var DefaultSolanaWalletAdapter = class extends BaseWalletAdapter {
3581
3581
  const userTokenAccounts = tokenPublicKeys.map(
3582
3582
  (tokenPublicKey) => getTokenAccounts(tokenPublicKey, userPublicKey)
3583
3583
  );
3584
- const tokenAmount = yield getMultipleAccounts(
3585
- connection,
3586
- userTokenAccounts,
3587
- "confirmed"
3584
+ splTokenBalances = yield Promise.all(
3585
+ userTokenAccounts.map((account) => __async(this, null, function* () {
3586
+ try {
3587
+ const tokenAccount = yield getAccount(
3588
+ connection,
3589
+ account,
3590
+ "confirmed"
3591
+ );
3592
+ return tokenAccount.amount;
3593
+ } catch (err) {
3594
+ if ((err == null ? void 0 : err.name) === "TokenAccountNotFoundError") {
3595
+ return /* @__PURE__ */ BigInt("0");
3596
+ }
3597
+ throw err;
3598
+ }
3599
+ }))
3588
3600
  );
3589
- splTokenBalances = tokenAmount.map((item) => item.amount);
3590
3601
  }
3591
3602
  const results = [];
3592
3603
  let splIndex = 0;