@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/{WalletManager-BV1QA08D.d.ts → WalletManager-Csfokchy.d.ts} +4 -0
- package/dist/{WalletManager-BTewpMGA.d.mts → WalletManager-i2BBu6uz.d.mts} +4 -0
- package/dist/{contracts-CyIOTDtT.d.ts → contracts-BHI5gorb.d.ts} +1 -1
- package/dist/{contracts-i0GG-cBt.d.mts → contracts-ITj7CkiV.d.mts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +10 -4
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +10 -4
- package/dist/react/index.mjs.map +1 -1
- package/dist/wallet/index.d.mts +2 -2
- package/dist/wallet/index.d.ts +2 -2
- package/dist/wallet/index.js +10 -4
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/index.mjs +10 -4
- package/dist/wallet/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -88,6 +88,10 @@ interface WalletManagerConfig {
|
|
|
88
88
|
apiUrl?: string;
|
|
89
89
|
/** Access token for authenticated API requests */
|
|
90
90
|
accessToken?: string;
|
|
91
|
+
/** Per-chain RPC URL overrides (e.g. for Solana private RPC) */
|
|
92
|
+
chainRpcUrls?: Partial<Record<NetworkType, string>>;
|
|
93
|
+
/** TronGrid API key to avoid rate limiting */
|
|
94
|
+
tronApiKey?: string;
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
97
|
* WalletManager - Handles BIP-39 seed generation, address derivation, and secure storage
|
|
@@ -88,6 +88,10 @@ interface WalletManagerConfig {
|
|
|
88
88
|
apiUrl?: string;
|
|
89
89
|
/** Access token for authenticated API requests */
|
|
90
90
|
accessToken?: string;
|
|
91
|
+
/** Per-chain RPC URL overrides (e.g. for Solana private RPC) */
|
|
92
|
+
chainRpcUrls?: Partial<Record<NetworkType, string>>;
|
|
93
|
+
/** TronGrid API key to avoid rate limiting */
|
|
94
|
+
tronApiKey?: string;
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
97
|
* WalletManager - Handles BIP-39 seed generation, address derivation, and secure storage
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Z as ZubariWalletConfig, b as NetworkType, A as Account, c as NetworkBalance, e as SendParams, T as TxResult } from './index-c90msmwW.js';
|
|
2
|
-
import './WalletManager-
|
|
2
|
+
import './WalletManager-Csfokchy.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ZubariWallet - Multi-chain self-custodial wallet
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Z as ZubariWalletConfig, b as NetworkType, A as Account, c as NetworkBalance, e as SendParams, T as TxResult } from './index-c90msmwW.mjs';
|
|
2
|
-
import './WalletManager-
|
|
2
|
+
import './WalletManager-i2BBu6uz.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ZubariWallet - Multi-chain self-custodial wallet
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as CURRENCY_ADDRESSES, l as ContractAddresses, D as DEFAULT_CONTRACTS, F as FeeWalletConfig, M as MAINNET_FEE_WALLETS, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, S as SupportedFeeChain, T as TESTNET_FEE_WALLETS, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, k as getAllFeeWallets, g as getContractAddresses, d as getCurrentContractAddresses, i as getCurrentCurrencyAddresses, h as getCurrentFeeWallet, f as getCurrentFeeWallets, e as getDefaultSubscriptionAddress, j as getFeeWallet } from './contracts-
|
|
2
|
-
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-
|
|
1
|
+
export { C as CURRENCY_ADDRESSES, l as ContractAddresses, D as DEFAULT_CONTRACTS, F as FeeWalletConfig, M as MAINNET_FEE_WALLETS, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, S as SupportedFeeChain, T as TESTNET_FEE_WALLETS, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, k as getAllFeeWallets, g as getContractAddresses, d as getCurrentContractAddresses, i as getCurrentCurrencyAddresses, h as getCurrentFeeWallet, f as getCurrentFeeWallets, e as getDefaultSubscriptionAddress, j as getFeeWallet } from './contracts-ITj7CkiV.mjs';
|
|
2
|
+
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-i2BBu6uz.mjs';
|
|
3
3
|
export { M as MemoryStorageAdapter, S as SecureStorageAdapter, W as WebEncryptedStorageAdapter, c as createSecureStorage } from './SecureStorage-jO783AhC.mjs';
|
|
4
4
|
export { a as ZubariMarketProtocol, Z as ZubariNFTProtocol, d as ZubariPayoutsProtocol, c as ZubariSubscriptionProtocol, b as ZubariTipsProtocol } from './PayoutsProtocol-DKEQhwYH.mjs';
|
|
5
5
|
export { A as Account, B as BuyParams, h as CreateVoucherParams, E as EarningsBreakdown, L as LazyMintVoucher, k as Listing, j as ListingParams, i as NFT, f as NFTAttribute, N as NFTCurrency, g as NFTMetadata, c as NetworkBalance, b as NetworkType, R as RevenueSplit, e as SendParams, a as Subscription, S as SubscriptionPlan, q as SwapParams, p as SwapQuote, o as Tip, l as TipData, m as TipResult, n as TipStats, d as TokenBalance, T as TxResult, W as WatermarkingData, s as ZubariError, r as ZubariErrorCode, Z as ZubariWalletConfig } from './index-c90msmwW.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as CURRENCY_ADDRESSES, l as ContractAddresses, D as DEFAULT_CONTRACTS, F as FeeWalletConfig, M as MAINNET_FEE_WALLETS, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, S as SupportedFeeChain, T as TESTNET_FEE_WALLETS, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, k as getAllFeeWallets, g as getContractAddresses, d as getCurrentContractAddresses, i as getCurrentCurrencyAddresses, h as getCurrentFeeWallet, f as getCurrentFeeWallets, e as getDefaultSubscriptionAddress, j as getFeeWallet } from './contracts-
|
|
2
|
-
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-
|
|
1
|
+
export { C as CURRENCY_ADDRESSES, l as ContractAddresses, D as DEFAULT_CONTRACTS, F as FeeWalletConfig, M as MAINNET_FEE_WALLETS, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, S as SupportedFeeChain, T as TESTNET_FEE_WALLETS, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, k as getAllFeeWallets, g as getContractAddresses, d as getCurrentContractAddresses, i as getCurrentCurrencyAddresses, h as getCurrentFeeWallet, f as getCurrentFeeWallets, e as getDefaultSubscriptionAddress, j as getFeeWallet } from './contracts-BHI5gorb.js';
|
|
2
|
+
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-Csfokchy.js';
|
|
3
3
|
export { M as MemoryStorageAdapter, S as SecureStorageAdapter, W as WebEncryptedStorageAdapter, c as createSecureStorage } from './SecureStorage-jO783AhC.js';
|
|
4
4
|
export { a as ZubariMarketProtocol, Z as ZubariNFTProtocol, d as ZubariPayoutsProtocol, c as ZubariSubscriptionProtocol, b as ZubariTipsProtocol } from './PayoutsProtocol-DAa-9A5C.js';
|
|
5
5
|
export { A as Account, B as BuyParams, h as CreateVoucherParams, E as EarningsBreakdown, L as LazyMintVoucher, k as Listing, j as ListingParams, i as NFT, f as NFTAttribute, N as NFTCurrency, g as NFTMetadata, c as NetworkBalance, b as NetworkType, R as RevenueSplit, e as SendParams, a as Subscription, S as SubscriptionPlan, q as SwapParams, p as SwapQuote, o as Tip, l as TipData, m as TipResult, n as TipStats, d as TokenBalance, T as TxResult, W as WatermarkingData, s as ZubariError, r as ZubariErrorCode, Z as ZubariWalletConfig } from './index-c90msmwW.js';
|
package/dist/index.js
CHANGED
|
@@ -2222,7 +2222,9 @@ var WalletManager = class _WalletManager {
|
|
|
2222
2222
|
storage: config.storage || createSecureStorage(),
|
|
2223
2223
|
enabledChains: config.enabledChains || SUPPORTED_CHAINS,
|
|
2224
2224
|
apiUrl: config.apiUrl || process.env.NEXT_PUBLIC_API_URL || "https://ckgwifsxka.us-east-2.awsapprunner.com",
|
|
2225
|
-
accessToken: config.accessToken
|
|
2225
|
+
accessToken: config.accessToken,
|
|
2226
|
+
chainRpcUrls: config.chainRpcUrls || {},
|
|
2227
|
+
tronApiKey: config.tronApiKey
|
|
2226
2228
|
};
|
|
2227
2229
|
this.storage = this.config.storage;
|
|
2228
2230
|
this.wdkService = getZubariWdkService({
|
|
@@ -2784,7 +2786,7 @@ var WalletManager = class _WalletManager {
|
|
|
2784
2786
|
}
|
|
2785
2787
|
}
|
|
2786
2788
|
} else if (chain === "solana") {
|
|
2787
|
-
const rpcUrl = this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com";
|
|
2789
|
+
const rpcUrl = this.config.chainRpcUrls.solana || (this.config.network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com");
|
|
2788
2790
|
try {
|
|
2789
2791
|
const response = await fetch(rpcUrl, {
|
|
2790
2792
|
method: "POST",
|
|
@@ -2841,8 +2843,12 @@ var WalletManager = class _WalletManager {
|
|
|
2841
2843
|
const tronConfig = getNetworkConfig("tron", this.config.network !== "mainnet");
|
|
2842
2844
|
const baseUrl = tronConfig.rpcUrl;
|
|
2843
2845
|
try {
|
|
2846
|
+
const tronHeaders = { "Accept": "application/json" };
|
|
2847
|
+
if (this.config.tronApiKey) {
|
|
2848
|
+
tronHeaders["TRON-PRO-API-KEY"] = this.config.tronApiKey;
|
|
2849
|
+
}
|
|
2844
2850
|
const response = await fetch(`${baseUrl}/v1/accounts/${address}`, {
|
|
2845
|
-
headers:
|
|
2851
|
+
headers: tronHeaders
|
|
2846
2852
|
});
|
|
2847
2853
|
if (response.ok) {
|
|
2848
2854
|
const data = await response.json();
|
|
@@ -2968,7 +2974,7 @@ var WalletManager = class _WalletManager {
|
|
|
2968
2974
|
if (result.status === "fulfilled") {
|
|
2969
2975
|
return result.value;
|
|
2970
2976
|
}
|
|
2971
|
-
console.
|
|
2977
|
+
console.warn(`Failed to fetch balance for ${chain}:`, result.reason);
|
|
2972
2978
|
const networkConfig = this.getChainConfig(chain);
|
|
2973
2979
|
return {
|
|
2974
2980
|
chain,
|