@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.
@@ -1,5 +1,5 @@
1
- export { Z as ZubariWallet } from '../contracts-i0GG-cBt.mjs';
2
- export { C as ChainBalance, M as MultiChainAddresses, S as SUPPORTED_CHAINS, b as WalletManager, W as WalletManagerConfig, a as WalletState } from '../WalletManager-BTewpMGA.mjs';
1
+ export { Z as ZubariWallet } from '../contracts-ITj7CkiV.mjs';
2
+ export { C as ChainBalance, M as MultiChainAddresses, S as SUPPORTED_CHAINS, b as WalletManager, W as WalletManagerConfig, a as WalletState } from '../WalletManager-i2BBu6uz.mjs';
3
3
  import '../index-c90msmwW.mjs';
4
4
  import 'node_modules/viem/_types/actions/siwe/verifySiweMessage';
5
5
  import 'node_modules/viem/_types/utils/ccip';
@@ -1,5 +1,5 @@
1
- export { Z as ZubariWallet } from '../contracts-CyIOTDtT.js';
2
- export { C as ChainBalance, M as MultiChainAddresses, S as SUPPORTED_CHAINS, b as WalletManager, W as WalletManagerConfig, a as WalletState } from '../WalletManager-BV1QA08D.js';
1
+ export { Z as ZubariWallet } from '../contracts-BHI5gorb.js';
2
+ export { C as ChainBalance, M as MultiChainAddresses, S as SUPPORTED_CHAINS, b as WalletManager, W as WalletManagerConfig, a as WalletState } from '../WalletManager-Csfokchy.js';
3
3
  import '../index-c90msmwW.js';
4
4
  import 'node_modules/viem/_types/actions/siwe/verifySiweMessage';
5
5
  import 'node_modules/viem/_types/utils/ccip';
@@ -2009,7 +2009,9 @@ var WalletManager = class _WalletManager {
2009
2009
  storage: config.storage || createSecureStorage(),
2010
2010
  enabledChains: config.enabledChains || SUPPORTED_CHAINS,
2011
2011
  apiUrl: config.apiUrl || process.env.NEXT_PUBLIC_API_URL || "https://ckgwifsxka.us-east-2.awsapprunner.com",
2012
- accessToken: config.accessToken
2012
+ accessToken: config.accessToken,
2013
+ chainRpcUrls: config.chainRpcUrls || {},
2014
+ tronApiKey: config.tronApiKey
2013
2015
  };
2014
2016
  this.storage = this.config.storage;
2015
2017
  this.wdkService = getZubariWdkService({
@@ -2571,7 +2573,7 @@ var WalletManager = class _WalletManager {
2571
2573
  }
2572
2574
  }
2573
2575
  } else if (chain === "solana") {
2574
- const rpcUrl = this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com";
2576
+ const rpcUrl = this.config.chainRpcUrls.solana || (this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com");
2575
2577
  try {
2576
2578
  const response = await fetch(rpcUrl, {
2577
2579
  method: "POST",
@@ -2628,8 +2630,12 @@ var WalletManager = class _WalletManager {
2628
2630
  const tronConfig = getNetworkConfig("tron", this.config.network !== "mainnet");
2629
2631
  const baseUrl = tronConfig.rpcUrl;
2630
2632
  try {
2633
+ const tronHeaders = { "Accept": "application/json" };
2634
+ if (this.config.tronApiKey) {
2635
+ tronHeaders["TRON-PRO-API-KEY"] = this.config.tronApiKey;
2636
+ }
2631
2637
  const response = await fetch(`${baseUrl}/v1/accounts/${address}`, {
2632
- headers: { "Accept": "application/json" }
2638
+ headers: tronHeaders
2633
2639
  });
2634
2640
  if (response.ok) {
2635
2641
  const data = await response.json();
@@ -2755,7 +2761,7 @@ var WalletManager = class _WalletManager {
2755
2761
  if (result.status === "fulfilled") {
2756
2762
  return result.value;
2757
2763
  }
2758
- console.error(`Failed to fetch balance for ${chain}:`, result.reason);
2764
+ console.warn(`Failed to fetch balance for ${chain}:`, result.reason);
2759
2765
  const networkConfig = this.getChainConfig(chain);
2760
2766
  return {
2761
2767
  chain,