@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.
@@ -2007,7 +2007,9 @@ var WalletManager = class _WalletManager {
2007
2007
  storage: config.storage || createSecureStorage(),
2008
2008
  enabledChains: config.enabledChains || SUPPORTED_CHAINS,
2009
2009
  apiUrl: config.apiUrl || process.env.NEXT_PUBLIC_API_URL || "https://ckgwifsxka.us-east-2.awsapprunner.com",
2010
- accessToken: config.accessToken
2010
+ accessToken: config.accessToken,
2011
+ chainRpcUrls: config.chainRpcUrls || {},
2012
+ tronApiKey: config.tronApiKey
2011
2013
  };
2012
2014
  this.storage = this.config.storage;
2013
2015
  this.wdkService = getZubariWdkService({
@@ -2569,7 +2571,7 @@ var WalletManager = class _WalletManager {
2569
2571
  }
2570
2572
  }
2571
2573
  } else if (chain === "solana") {
2572
- const rpcUrl = this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com";
2574
+ const rpcUrl = this.config.chainRpcUrls.solana || (this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com");
2573
2575
  try {
2574
2576
  const response = await fetch(rpcUrl, {
2575
2577
  method: "POST",
@@ -2626,8 +2628,12 @@ var WalletManager = class _WalletManager {
2626
2628
  const tronConfig = getNetworkConfig("tron", this.config.network !== "mainnet");
2627
2629
  const baseUrl = tronConfig.rpcUrl;
2628
2630
  try {
2631
+ const tronHeaders = { "Accept": "application/json" };
2632
+ if (this.config.tronApiKey) {
2633
+ tronHeaders["TRON-PRO-API-KEY"] = this.config.tronApiKey;
2634
+ }
2629
2635
  const response = await fetch(`${baseUrl}/v1/accounts/${address}`, {
2630
- headers: { "Accept": "application/json" }
2636
+ headers: tronHeaders
2631
2637
  });
2632
2638
  if (response.ok) {
2633
2639
  const data = await response.json();
@@ -2753,7 +2759,7 @@ var WalletManager = class _WalletManager {
2753
2759
  if (result.status === "fulfilled") {
2754
2760
  return result.value;
2755
2761
  }
2756
- console.error(`Failed to fetch balance for ${chain}:`, result.reason);
2762
+ console.warn(`Failed to fetch balance for ${chain}:`, result.reason);
2757
2763
  const networkConfig = this.getChainConfig(chain);
2758
2764
  return {
2759
2765
  chain,