@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,6 +1,6 @@
1
1
  import { b as NetworkType } from '../index-c90msmwW.mjs';
2
- import { W as WalletManagerConfig, a as WalletState, C as ChainBalance, M as MultiChainAddresses, b as WalletManager } from '../WalletManager-BTewpMGA.mjs';
3
- export { S as SUPPORTED_CHAINS } from '../WalletManager-BTewpMGA.mjs';
2
+ import { W as WalletManagerConfig, a as WalletState, C as ChainBalance, M as MultiChainAddresses, b as WalletManager } from '../WalletManager-i2BBu6uz.mjs';
3
+ export { S as SUPPORTED_CHAINS } from '../WalletManager-i2BBu6uz.mjs';
4
4
  import 'node_modules/viem/_types/actions/siwe/verifySiweMessage';
5
5
  import 'node_modules/viem/_types/utils/ccip';
6
6
  import 'viem';
@@ -1,6 +1,6 @@
1
1
  import { b as NetworkType } from '../index-c90msmwW.js';
2
- import { W as WalletManagerConfig, a as WalletState, C as ChainBalance, M as MultiChainAddresses, b as WalletManager } from '../WalletManager-BV1QA08D.js';
3
- export { S as SUPPORTED_CHAINS } from '../WalletManager-BV1QA08D.js';
2
+ import { W as WalletManagerConfig, a as WalletState, C as ChainBalance, M as MultiChainAddresses, b as WalletManager } from '../WalletManager-Csfokchy.js';
3
+ export { S as SUPPORTED_CHAINS } from '../WalletManager-Csfokchy.js';
4
4
  import 'node_modules/viem/_types/actions/siwe/verifySiweMessage';
5
5
  import 'node_modules/viem/_types/utils/ccip';
6
6
  import 'viem';
@@ -1468,7 +1468,9 @@ var WalletManager = class _WalletManager {
1468
1468
  storage: config.storage || createSecureStorage(),
1469
1469
  enabledChains: config.enabledChains || SUPPORTED_CHAINS,
1470
1470
  apiUrl: config.apiUrl || process.env.NEXT_PUBLIC_API_URL || "https://ckgwifsxka.us-east-2.awsapprunner.com",
1471
- accessToken: config.accessToken
1471
+ accessToken: config.accessToken,
1472
+ chainRpcUrls: config.chainRpcUrls || {},
1473
+ tronApiKey: config.tronApiKey
1472
1474
  };
1473
1475
  this.storage = this.config.storage;
1474
1476
  this.wdkService = getZubariWdkService({
@@ -2030,7 +2032,7 @@ var WalletManager = class _WalletManager {
2030
2032
  }
2031
2033
  }
2032
2034
  } else if (chain === "solana") {
2033
- const rpcUrl = this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com";
2035
+ const rpcUrl = this.config.chainRpcUrls.solana || (this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com");
2034
2036
  try {
2035
2037
  const response = await fetch(rpcUrl, {
2036
2038
  method: "POST",
@@ -2087,8 +2089,12 @@ var WalletManager = class _WalletManager {
2087
2089
  const tronConfig = getNetworkConfig("tron", this.config.network !== "mainnet");
2088
2090
  const baseUrl = tronConfig.rpcUrl;
2089
2091
  try {
2092
+ const tronHeaders = { "Accept": "application/json" };
2093
+ if (this.config.tronApiKey) {
2094
+ tronHeaders["TRON-PRO-API-KEY"] = this.config.tronApiKey;
2095
+ }
2090
2096
  const response = await fetch(`${baseUrl}/v1/accounts/${address}`, {
2091
- headers: { "Accept": "application/json" }
2097
+ headers: tronHeaders
2092
2098
  });
2093
2099
  if (response.ok) {
2094
2100
  const data = await response.json();
@@ -2214,7 +2220,7 @@ var WalletManager = class _WalletManager {
2214
2220
  if (result.status === "fulfilled") {
2215
2221
  return result.value;
2216
2222
  }
2217
- console.error(`Failed to fetch balance for ${chain}:`, result.reason);
2223
+ console.warn(`Failed to fetch balance for ${chain}:`, result.reason);
2218
2224
  const networkConfig = this.getChainConfig(chain);
2219
2225
  return {
2220
2226
  chain,