@zubari/sdk 0.1.5 → 0.1.7

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.
@@ -96,12 +96,12 @@ declare class WalletManager {
96
96
  */
97
97
  static generateSeed(): string;
98
98
  /**
99
- * Generate a new BIP-39 seed phrase using native Tether WDK
99
+ * Generate a new BIP-39 seed phrase using Tether WDK (via API in browser)
100
100
  * This is the recommended method for generating seed phrases
101
101
  */
102
102
  generateSeedWithWdk(): Promise<string>;
103
103
  /**
104
- * Validate seed phrase using native WDK (async, more accurate)
104
+ * Validate seed phrase using WDK (async, more accurate)
105
105
  */
106
106
  validateSeedWithWdk(seed: string): Promise<boolean>;
107
107
  /**
@@ -793,8 +793,8 @@ declare class WalletManager {
793
793
  chainId?: number | undefined;
794
794
  to: abitype.Address | null;
795
795
  hash: viem.Hash;
796
- yParity?: undefined | undefined;
797
796
  from: abitype.Address;
797
+ yParity?: undefined | undefined;
798
798
  gas: bigint;
799
799
  input: viem.Hex;
800
800
  nonce: number;
@@ -818,8 +818,8 @@ declare class WalletManager {
818
818
  chainId: number;
819
819
  to: abitype.Address | null;
820
820
  hash: viem.Hash;
821
- yParity: number;
822
821
  from: abitype.Address;
822
+ yParity: number;
823
823
  gas: bigint;
824
824
  input: viem.Hex;
825
825
  nonce: number;
@@ -843,8 +843,8 @@ declare class WalletManager {
843
843
  chainId: number;
844
844
  to: abitype.Address | null;
845
845
  hash: viem.Hash;
846
- yParity: number;
847
846
  from: abitype.Address;
847
+ yParity: number;
848
848
  gas: bigint;
849
849
  input: viem.Hex;
850
850
  nonce: number;
@@ -868,8 +868,8 @@ declare class WalletManager {
868
868
  chainId: number;
869
869
  to: abitype.Address | null;
870
870
  hash: viem.Hash;
871
- yParity: number;
872
871
  from: abitype.Address;
872
+ yParity: number;
873
873
  gas: bigint;
874
874
  input: viem.Hex;
875
875
  nonce: number;
@@ -893,8 +893,8 @@ declare class WalletManager {
893
893
  chainId: number;
894
894
  to: abitype.Address | null;
895
895
  hash: viem.Hash;
896
- yParity: number;
897
896
  from: abitype.Address;
897
+ yParity: number;
898
898
  gas: bigint;
899
899
  input: viem.Hex;
900
900
  nonce: number;
@@ -1035,8 +1035,8 @@ declare class WalletManager {
1035
1035
  chainId?: number | undefined;
1036
1036
  to: abitype.Address | null;
1037
1037
  hash: viem.Hash;
1038
- yParity?: undefined | undefined;
1039
1038
  from: abitype.Address;
1039
+ yParity?: undefined | undefined;
1040
1040
  gas: bigint;
1041
1041
  input: viem.Hex;
1042
1042
  nonce: number;
@@ -1060,8 +1060,8 @@ declare class WalletManager {
1060
1060
  chainId: number;
1061
1061
  to: abitype.Address | null;
1062
1062
  hash: viem.Hash;
1063
- yParity: number;
1064
1063
  from: abitype.Address;
1064
+ yParity: number;
1065
1065
  gas: bigint;
1066
1066
  input: viem.Hex;
1067
1067
  nonce: number;
@@ -1085,8 +1085,8 @@ declare class WalletManager {
1085
1085
  chainId: number;
1086
1086
  to: abitype.Address | null;
1087
1087
  hash: viem.Hash;
1088
- yParity: number;
1089
1088
  from: abitype.Address;
1089
+ yParity: number;
1090
1090
  gas: bigint;
1091
1091
  input: viem.Hex;
1092
1092
  nonce: number;
@@ -1110,8 +1110,8 @@ declare class WalletManager {
1110
1110
  chainId: number;
1111
1111
  to: abitype.Address | null;
1112
1112
  hash: viem.Hash;
1113
- yParity: number;
1114
1113
  from: abitype.Address;
1114
+ yParity: number;
1115
1115
  gas: bigint;
1116
1116
  input: viem.Hex;
1117
1117
  nonce: number;
@@ -1135,8 +1135,8 @@ declare class WalletManager {
1135
1135
  chainId: number;
1136
1136
  to: abitype.Address | null;
1137
1137
  hash: viem.Hash;
1138
- yParity: number;
1139
1138
  from: abitype.Address;
1139
+ yParity: number;
1140
1140
  gas: bigint;
1141
1141
  input: viem.Hex;
1142
1142
  nonce: number;
@@ -5946,8 +5946,10 @@ declare class WalletManager {
5946
5946
  /**
5947
5947
  * Derive address for a specific chain (async version)
5948
5948
  *
5949
- * Calls the backend WDK API for proper derivation when available.
5950
- * Falls back to local ethers-based derivation if API is unavailable.
5949
+ * Uses the unified WDK service which:
5950
+ * - In browser: Calls the backend API (which has Tether WDK)
5951
+ * - In Node.js: Uses native WDK
5952
+ * - Falls back to browser-compatible derivation if needed
5951
5953
  */
5952
5954
  static deriveAddressForChainAsync(seed: string, chain: NetworkType, network?: 'mainnet' | 'testnet', apiUrl?: string): Promise<string>;
5953
5955
  /**
@@ -5971,14 +5973,17 @@ declare class WalletManager {
5971
5973
  */
5972
5974
  deriveAllAddresses(): Partial<MultiChainAddresses>;
5973
5975
  /**
5974
- * Derive addresses for all enabled chains using native Tether WDK (recommended)
5975
- * This uses the WDK directly without needing a backend API.
5976
+ * Derive addresses for all enabled chains using Tether WDK
5977
+ * In browser: Uses the backend API (which has Tether WDK)
5978
+ * In Node.js: Uses native WDK directly
5976
5979
  * Returns REAL cryptographically valid addresses for all chains.
5977
5980
  */
5978
5981
  deriveAllAddressesWithWdk(): Promise<Partial<MultiChainAddresses>>;
5979
5982
  /**
5980
5983
  * Derive addresses for all enabled chains using Tether WDK
5981
- * Tries native WDK first, then falls back to API, then to placeholders
5984
+ * The unified WDK service handles all fallback strategies automatically:
5985
+ * - Browser: API backend -> Browser derivation
5986
+ * - Node.js: Native WDK -> API backend -> Browser derivation
5982
5987
  */
5983
5988
  deriveAllAddressesAsync(): Promise<Partial<MultiChainAddresses>>;
5984
5989
  /**
@@ -96,12 +96,12 @@ declare class WalletManager {
96
96
  */
97
97
  static generateSeed(): string;
98
98
  /**
99
- * Generate a new BIP-39 seed phrase using native Tether WDK
99
+ * Generate a new BIP-39 seed phrase using Tether WDK (via API in browser)
100
100
  * This is the recommended method for generating seed phrases
101
101
  */
102
102
  generateSeedWithWdk(): Promise<string>;
103
103
  /**
104
- * Validate seed phrase using native WDK (async, more accurate)
104
+ * Validate seed phrase using WDK (async, more accurate)
105
105
  */
106
106
  validateSeedWithWdk(seed: string): Promise<boolean>;
107
107
  /**
@@ -793,8 +793,8 @@ declare class WalletManager {
793
793
  chainId?: number | undefined;
794
794
  to: abitype.Address | null;
795
795
  hash: viem.Hash;
796
- yParity?: undefined | undefined;
797
796
  from: abitype.Address;
797
+ yParity?: undefined | undefined;
798
798
  gas: bigint;
799
799
  input: viem.Hex;
800
800
  nonce: number;
@@ -818,8 +818,8 @@ declare class WalletManager {
818
818
  chainId: number;
819
819
  to: abitype.Address | null;
820
820
  hash: viem.Hash;
821
- yParity: number;
822
821
  from: abitype.Address;
822
+ yParity: number;
823
823
  gas: bigint;
824
824
  input: viem.Hex;
825
825
  nonce: number;
@@ -843,8 +843,8 @@ declare class WalletManager {
843
843
  chainId: number;
844
844
  to: abitype.Address | null;
845
845
  hash: viem.Hash;
846
- yParity: number;
847
846
  from: abitype.Address;
847
+ yParity: number;
848
848
  gas: bigint;
849
849
  input: viem.Hex;
850
850
  nonce: number;
@@ -868,8 +868,8 @@ declare class WalletManager {
868
868
  chainId: number;
869
869
  to: abitype.Address | null;
870
870
  hash: viem.Hash;
871
- yParity: number;
872
871
  from: abitype.Address;
872
+ yParity: number;
873
873
  gas: bigint;
874
874
  input: viem.Hex;
875
875
  nonce: number;
@@ -893,8 +893,8 @@ declare class WalletManager {
893
893
  chainId: number;
894
894
  to: abitype.Address | null;
895
895
  hash: viem.Hash;
896
- yParity: number;
897
896
  from: abitype.Address;
897
+ yParity: number;
898
898
  gas: bigint;
899
899
  input: viem.Hex;
900
900
  nonce: number;
@@ -1035,8 +1035,8 @@ declare class WalletManager {
1035
1035
  chainId?: number | undefined;
1036
1036
  to: abitype.Address | null;
1037
1037
  hash: viem.Hash;
1038
- yParity?: undefined | undefined;
1039
1038
  from: abitype.Address;
1039
+ yParity?: undefined | undefined;
1040
1040
  gas: bigint;
1041
1041
  input: viem.Hex;
1042
1042
  nonce: number;
@@ -1060,8 +1060,8 @@ declare class WalletManager {
1060
1060
  chainId: number;
1061
1061
  to: abitype.Address | null;
1062
1062
  hash: viem.Hash;
1063
- yParity: number;
1064
1063
  from: abitype.Address;
1064
+ yParity: number;
1065
1065
  gas: bigint;
1066
1066
  input: viem.Hex;
1067
1067
  nonce: number;
@@ -1085,8 +1085,8 @@ declare class WalletManager {
1085
1085
  chainId: number;
1086
1086
  to: abitype.Address | null;
1087
1087
  hash: viem.Hash;
1088
- yParity: number;
1089
1088
  from: abitype.Address;
1089
+ yParity: number;
1090
1090
  gas: bigint;
1091
1091
  input: viem.Hex;
1092
1092
  nonce: number;
@@ -1110,8 +1110,8 @@ declare class WalletManager {
1110
1110
  chainId: number;
1111
1111
  to: abitype.Address | null;
1112
1112
  hash: viem.Hash;
1113
- yParity: number;
1114
1113
  from: abitype.Address;
1114
+ yParity: number;
1115
1115
  gas: bigint;
1116
1116
  input: viem.Hex;
1117
1117
  nonce: number;
@@ -1135,8 +1135,8 @@ declare class WalletManager {
1135
1135
  chainId: number;
1136
1136
  to: abitype.Address | null;
1137
1137
  hash: viem.Hash;
1138
- yParity: number;
1139
1138
  from: abitype.Address;
1139
+ yParity: number;
1140
1140
  gas: bigint;
1141
1141
  input: viem.Hex;
1142
1142
  nonce: number;
@@ -5946,8 +5946,10 @@ declare class WalletManager {
5946
5946
  /**
5947
5947
  * Derive address for a specific chain (async version)
5948
5948
  *
5949
- * Calls the backend WDK API for proper derivation when available.
5950
- * Falls back to local ethers-based derivation if API is unavailable.
5949
+ * Uses the unified WDK service which:
5950
+ * - In browser: Calls the backend API (which has Tether WDK)
5951
+ * - In Node.js: Uses native WDK
5952
+ * - Falls back to browser-compatible derivation if needed
5951
5953
  */
5952
5954
  static deriveAddressForChainAsync(seed: string, chain: NetworkType, network?: 'mainnet' | 'testnet', apiUrl?: string): Promise<string>;
5953
5955
  /**
@@ -5971,14 +5973,17 @@ declare class WalletManager {
5971
5973
  */
5972
5974
  deriveAllAddresses(): Partial<MultiChainAddresses>;
5973
5975
  /**
5974
- * Derive addresses for all enabled chains using native Tether WDK (recommended)
5975
- * This uses the WDK directly without needing a backend API.
5976
+ * Derive addresses for all enabled chains using Tether WDK
5977
+ * In browser: Uses the backend API (which has Tether WDK)
5978
+ * In Node.js: Uses native WDK directly
5976
5979
  * Returns REAL cryptographically valid addresses for all chains.
5977
5980
  */
5978
5981
  deriveAllAddressesWithWdk(): Promise<Partial<MultiChainAddresses>>;
5979
5982
  /**
5980
5983
  * Derive addresses for all enabled chains using Tether WDK
5981
- * Tries native WDK first, then falls back to API, then to placeholders
5984
+ * The unified WDK service handles all fallback strategies automatically:
5985
+ * - Browser: API backend -> Browser derivation
5986
+ * - Node.js: Native WDK -> API backend -> Browser derivation
5982
5987
  */
5983
5988
  deriveAllAddressesAsync(): Promise<Partial<MultiChainAddresses>>;
5984
5989
  /**
@@ -1,5 +1,5 @@
1
1
  import { Z as ZubariWalletConfig, N as NetworkType, A as Account, a as NetworkBalance, S as SendParams, b as TxResult } from './index-DhluuR9H.js';
2
- import './WalletManager-CYJNiww6.js';
2
+ import './WalletManager-YnFArqAt.js';
3
3
 
4
4
  interface ContractAddresses {
5
5
  registry: string;
@@ -1,5 +1,5 @@
1
1
  import { Z as ZubariWalletConfig, N as NetworkType, A as Account, a as NetworkBalance, S as SendParams, b as TxResult } from './index-DhluuR9H.mjs';
2
- import './WalletManager-Dmmcbtiw.mjs';
2
+ import './WalletManager-zKc_xew_.mjs';
3
3
 
4
4
  interface ContractAddresses {
5
5
  registry: string;
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- export { P as PLATFORM_CONFIG, a as ZUBARI_CONTRACTS, Z as ZubariWallet, g as getContractAddresses } from './index-poGbMJzn.mjs';
2
- export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, W as WalletManager, b as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-Dmmcbtiw.mjs';
1
+ export { P as PLATFORM_CONFIG, a as ZUBARI_CONTRACTS, Z as ZubariWallet, g as getContractAddresses } from './index-DXTHGOnP.mjs';
2
+ export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, W as WalletManager, b as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-zKc_xew_.mjs';
3
3
  export { M as MemoryStorageAdapter, S as SecureStorageAdapter, W as WebEncryptedStorageAdapter, c as createSecureStorage } from './SecureStorage-jO783AhC.mjs';
4
4
  export { ZubariNFTProtocol, ZubariPayoutsProtocol, ZubariSubscriptionProtocol, ZubariTipsProtocol } from './protocols/index.mjs';
5
- export { F as FeeEstimate, S as SwapService, d as TransactionHistoryItem, a as TransactionParams, b as TransactionResult, T as TransactionService, e as TransactionServiceConfig, c as createTransactionService, g as getTransactionService } from './TransactionService-CxwB1kpN.mjs';
5
+ export { BrowserAddressDerivation, ChainAddress, ChainBalance, FeeEstimate, FeeRates, MultiChainAddresses, SupportedChain, SwapService, TransactionHistoryItem, TransactionParams, TransactionResult, TransactionService, TransactionServiceConfig, WdkApiClient, ZubariWdkService, ZubariWdkServiceConfig, createTransactionService, createZubariWdkService, getTransactionService, getWdkApiClient, getZubariWdkService, isBrowser } from './services/index.mjs';
6
6
  export { A as Account, E as EarningsBreakdown, L as LazyMintVoucher, e as ListingParams, d as NFT, c as NFTMetadata, a as NetworkBalance, N as NetworkType, R as RevenueSplit, S as SendParams, j as Subscription, i as SubscriptionPlan, l as SwapParams, k as SwapQuote, f as TipData, g as TipResult, h as TipStats, T as TokenBalance, b as TxResult, n as ZubariError, m as ZubariErrorCode, Z as ZubariWalletConfig } from './index-DhluuR9H.mjs';
7
7
  export { UseWalletManagerOptions, UseWalletManagerReturn, useWalletManager } from './react/index.mjs';
8
8
  import 'abitype';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { P as PLATFORM_CONFIG, a as ZUBARI_CONTRACTS, Z as ZubariWallet, g as getContractAddresses } from './index-OxzgPoRG.js';
2
- export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, W as WalletManager, b as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-CYJNiww6.js';
1
+ export { P as PLATFORM_CONFIG, a as ZUBARI_CONTRACTS, Z as ZubariWallet, g as getContractAddresses } from './index-CLssrNf2.js';
2
+ export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, W as WalletManager, b as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-YnFArqAt.js';
3
3
  export { M as MemoryStorageAdapter, S as SecureStorageAdapter, W as WebEncryptedStorageAdapter, c as createSecureStorage } from './SecureStorage-jO783AhC.js';
4
4
  export { ZubariNFTProtocol, ZubariPayoutsProtocol, ZubariSubscriptionProtocol, ZubariTipsProtocol } from './protocols/index.js';
5
- export { F as FeeEstimate, S as SwapService, d as TransactionHistoryItem, a as TransactionParams, b as TransactionResult, T as TransactionService, e as TransactionServiceConfig, c as createTransactionService, g as getTransactionService } from './TransactionService-DdL6H6M-.js';
5
+ export { BrowserAddressDerivation, ChainAddress, ChainBalance, FeeEstimate, FeeRates, MultiChainAddresses, SupportedChain, SwapService, TransactionHistoryItem, TransactionParams, TransactionResult, TransactionService, TransactionServiceConfig, WdkApiClient, ZubariWdkService, ZubariWdkServiceConfig, createTransactionService, createZubariWdkService, getTransactionService, getWdkApiClient, getZubariWdkService, isBrowser } from './services/index.js';
6
6
  export { A as Account, E as EarningsBreakdown, L as LazyMintVoucher, e as ListingParams, d as NFT, c as NFTMetadata, a as NetworkBalance, N as NetworkType, R as RevenueSplit, S as SendParams, j as Subscription, i as SubscriptionPlan, l as SwapParams, k as SwapQuote, f as TipData, g as TipResult, h as TipStats, T as TokenBalance, b as TxResult, n as ZubariError, m as ZubariErrorCode, Z as ZubariWalletConfig } from './index-DhluuR9H.js';
7
7
  export { UseWalletManagerOptions, UseWalletManagerReturn, useWalletManager } from './react/index.js';
8
8
  import 'abitype';