@zubari/sdk 0.5.7 → 0.5.8

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
@@ -2220,7 +2220,9 @@ var WalletManager = class _WalletManager {
2220
2220
  storage: config.storage || createSecureStorage(),
2221
2221
  enabledChains: config.enabledChains || SUPPORTED_CHAINS,
2222
2222
  apiUrl: config.apiUrl || process.env.NEXT_PUBLIC_API_URL || "https://ckgwifsxka.us-east-2.awsapprunner.com",
2223
- accessToken: config.accessToken
2223
+ accessToken: config.accessToken,
2224
+ chainRpcUrls: config.chainRpcUrls || {},
2225
+ tronApiKey: config.tronApiKey
2224
2226
  };
2225
2227
  this.storage = this.config.storage;
2226
2228
  this.wdkService = getZubariWdkService({
@@ -2782,7 +2784,7 @@ var WalletManager = class _WalletManager {
2782
2784
  }
2783
2785
  }
2784
2786
  } else if (chain === "solana") {
2785
- const rpcUrl = this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com";
2787
+ const rpcUrl = this.config.chainRpcUrls.solana || (this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com");
2786
2788
  try {
2787
2789
  const response = await fetch(rpcUrl, {
2788
2790
  method: "POST",
@@ -2839,8 +2841,12 @@ var WalletManager = class _WalletManager {
2839
2841
  const tronConfig = getNetworkConfig("tron", this.config.network !== "mainnet");
2840
2842
  const baseUrl = tronConfig.rpcUrl;
2841
2843
  try {
2844
+ const tronHeaders = { "Accept": "application/json" };
2845
+ if (this.config.tronApiKey) {
2846
+ tronHeaders["TRON-PRO-API-KEY"] = this.config.tronApiKey;
2847
+ }
2842
2848
  const response = await fetch(`${baseUrl}/v1/accounts/${address}`, {
2843
- headers: { "Accept": "application/json" }
2849
+ headers: tronHeaders
2844
2850
  });
2845
2851
  if (response.ok) {
2846
2852
  const data = await response.json();
@@ -2966,7 +2972,7 @@ var WalletManager = class _WalletManager {
2966
2972
  if (result.status === "fulfilled") {
2967
2973
  return result.value;
2968
2974
  }
2969
- console.error(`Failed to fetch balance for ${chain}:`, result.reason);
2975
+ console.warn(`Failed to fetch balance for ${chain}:`, result.reason);
2970
2976
  const networkConfig = this.getChainConfig(chain);
2971
2977
  return {
2972
2978
  chain,