clawcash 0.1.0

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.
@@ -0,0 +1,918 @@
1
+ /**
2
+ * Core type definitions for ClawCash wallet
3
+ */
4
+ /**
5
+ * Supported blockchain networks
6
+ */
7
+ type Chain = 'ethereum' | 'polygon' | 'bsc' | 'arbitrum' | 'bitcoin';
8
+ /**
9
+ * Supported token symbols
10
+ */
11
+ type TokenSymbol = 'ETH' | 'BTC' | 'MATIC' | 'BNB' | 'USDT' | 'USDC';
12
+ /**
13
+ * Wallet configuration options
14
+ */
15
+ interface WalletConfig {
16
+ /** BIP39 mnemonic phrase (if not provided, a new one will be generated) */
17
+ mnemonic?: string;
18
+ /** Password for encrypting private keys */
19
+ password?: string;
20
+ /** Custom RPC endpoints for each chain */
21
+ rpcUrls?: Partial<Record<Chain, string>>;
22
+ }
23
+ /**
24
+ * Wallet addresses for all supported chains
25
+ */
26
+ interface WalletAddresses {
27
+ ethereum: string;
28
+ polygon: string;
29
+ bsc: string;
30
+ arbitrum: string;
31
+ bitcoin: string;
32
+ }
33
+ /**
34
+ * Token configuration
35
+ */
36
+ interface TokenConfig {
37
+ symbol: TokenSymbol;
38
+ decimals: number;
39
+ address?: string;
40
+ chainId: number;
41
+ }
42
+ /**
43
+ * Chain configuration
44
+ */
45
+ interface ChainConfig {
46
+ chainId: number;
47
+ name: string;
48
+ rpcUrl: string;
49
+ explorerUrl: string;
50
+ nativeCurrency: {
51
+ name: string;
52
+ symbol: string;
53
+ decimals: number;
54
+ };
55
+ }
56
+ /**
57
+ * Balance information
58
+ */
59
+ interface Balance {
60
+ amount: bigint;
61
+ formatted: string;
62
+ symbol: TokenSymbol;
63
+ decimals: number;
64
+ }
65
+ /**
66
+ * Payment/transfer parameters
67
+ */
68
+ interface PaymentParams {
69
+ /** Source chain */
70
+ chain: Chain;
71
+ /** Sender address */
72
+ from: string;
73
+ /** Recipient address */
74
+ to: string;
75
+ /** Amount to send (as decimal string) */
76
+ amount: string;
77
+ /** Token symbol (e.g., 'ETH', 'USDT') */
78
+ token: TokenSymbol;
79
+ /** Optional gas price for EVM chains */
80
+ gasPrice?: string;
81
+ /** Optional gas limit for EVM chains */
82
+ gasLimit?: string;
83
+ }
84
+ /**
85
+ * Transaction result
86
+ */
87
+ interface TransactionResult {
88
+ /** Transaction hash */
89
+ hash: string;
90
+ /** Block number (if confirmed) */
91
+ blockNumber?: number;
92
+ /** Transaction status */
93
+ status: 'pending' | 'confirmed' | 'failed';
94
+ /** Explorer URL */
95
+ explorerUrl?: string;
96
+ }
97
+ /**
98
+ * Fee estimate for a transaction
99
+ */
100
+ interface FeeEstimate {
101
+ /** Estimated gas fee in wei */
102
+ gasFee: bigint;
103
+ /** Estimated gas price */
104
+ gasPrice: bigint;
105
+ /** Estimated gas limit */
106
+ gasLimit: bigint;
107
+ /** Total fee formatted */
108
+ formatted: string;
109
+ }
110
+ /**
111
+ * Transaction history entry
112
+ */
113
+ interface Transaction {
114
+ hash: string;
115
+ from: string;
116
+ to: string;
117
+ amount: bigint;
118
+ formatted: string;
119
+ symbol: TokenSymbol;
120
+ timestamp: number;
121
+ blockNumber?: number;
122
+ status: 'pending' | 'confirmed' | 'failed';
123
+ }
124
+ /**
125
+ * Trade configuration (for exchange trading)
126
+ */
127
+ interface TradeConfig {
128
+ /** Exchange name (e.g., 'binance', 'coinbase') */
129
+ exchange: string;
130
+ /** Trading pair (e.g., 'BTC/USDT') */
131
+ symbol: string;
132
+ /** Amount to trade */
133
+ amount: string;
134
+ /** Limit price (undefined for market order) */
135
+ price?: string;
136
+ /** Order type */
137
+ type?: 'market' | 'limit';
138
+ }
139
+ /**
140
+ * Trade result
141
+ */
142
+ interface TradeResult {
143
+ /** Order ID */
144
+ orderId: string;
145
+ /** Exchange name */
146
+ exchange: string;
147
+ /** Trading pair */
148
+ symbol: string;
149
+ /** Side (buy/sell) */
150
+ side: 'buy' | 'sell';
151
+ /** Amount traded */
152
+ amount: string;
153
+ /** Price */
154
+ price: string;
155
+ /** Order status */
156
+ status: 'open' | 'filled' | 'canceled';
157
+ /** Timestamp */
158
+ timestamp: number;
159
+ }
160
+ /**
161
+ * Market information
162
+ */
163
+ interface MarketInfo {
164
+ symbol: string;
165
+ bidPrice: string;
166
+ askPrice: string;
167
+ lastPrice: string;
168
+ volume24h: string;
169
+ }
170
+ /**
171
+ * Agent-friendly error class
172
+ */
173
+ declare class AgentError extends Error {
174
+ code: string;
175
+ suggestion?: string | undefined;
176
+ constructor(message: string, code: string, suggestion?: string | undefined);
177
+ }
178
+ /**
179
+ * Result wrapper for agent operations
180
+ */
181
+ interface AgentResult<T = void> {
182
+ success: boolean;
183
+ data?: T;
184
+ error?: string;
185
+ code?: string;
186
+ }
187
+
188
+ /**
189
+ * Main ClawCash Wallet class
190
+ * Orchestrates all wallet functionality across multiple chains
191
+ */
192
+
193
+ /**
194
+ * Main ClawCash wallet class
195
+ */
196
+ declare class ClawCashWallet {
197
+ private keyManager;
198
+ private config;
199
+ /**
200
+ * Create a new wallet instance
201
+ * @param config - Wallet configuration
202
+ */
203
+ constructor(config?: WalletConfig);
204
+ /**
205
+ * Get wallet addresses for all supported chains
206
+ */
207
+ getAddresses(): Promise<WalletAddresses>;
208
+ /**
209
+ * Get Bitcoin address (simplified version)
210
+ */
211
+ private getBitcoinAddress;
212
+ /**
213
+ * Get balance for a specific chain and token
214
+ * @param chain - The blockchain network
215
+ * @param token - Optional token symbol (defaults to native)
216
+ */
217
+ getBalance(chain: Chain, _token?: TokenSymbol): Promise<Balance>;
218
+ /**
219
+ * Estimate transaction fee
220
+ * @param params - Payment parameters
221
+ */
222
+ estimateFee(params: PaymentParams): Promise<FeeEstimate>;
223
+ /**
224
+ * Send a payment
225
+ * @param params - Payment parameters
226
+ */
227
+ sendPayment(params: PaymentParams): Promise<string>;
228
+ /**
229
+ * Sign a message
230
+ * @param message - The message to sign
231
+ * @param chain - The chain to sign with
232
+ */
233
+ signMessage(message: string, chain: Chain): Promise<string>;
234
+ /**
235
+ * Export the mnemonic (handle with care!)
236
+ */
237
+ exportMnemonic(): string;
238
+ /**
239
+ * Export all private keys (for backup only)
240
+ */
241
+ exportPrivateKeys(): Record<Chain, string>;
242
+ /**
243
+ * Get wallet info
244
+ */
245
+ getInfo(): {
246
+ mnemonic: string;
247
+ };
248
+ }
249
+ /**
250
+ * Create a new wallet
251
+ * @param mnemonic - Optional mnemonic phrase
252
+ */
253
+ declare function createWallet(mnemonic?: string): ClawCashWallet;
254
+ /**
255
+ * Import a wallet from mnemonic
256
+ * @param mnemonic - BIP39 mnemonic phrase
257
+ */
258
+ declare function importWallet(mnemonic: string): ClawCashWallet;
259
+
260
+ /**
261
+ * Key management for ClawCash wallet
262
+ * Handles BIP-32/BIP-44 key derivation for multiple chains
263
+ */
264
+
265
+ /**
266
+ * Key manager for handling private key derivation
267
+ */
268
+ declare class KeyManager {
269
+ private mnemonic;
270
+ private derivedKeys;
271
+ /**
272
+ * Create a new KeyManager from a mnemonic
273
+ * @param mnemonic - BIP39 mnemonic phrase
274
+ */
275
+ constructor(mnemonic: string);
276
+ /**
277
+ * Derive a private key for a specific chain
278
+ * @param chain - The blockchain network
279
+ * @returns The derived private key (never exposed in API)
280
+ */
281
+ derivePrivateKey(chain: Chain): string;
282
+ /**
283
+ * Get the master mnemonic
284
+ * @returns The mnemonic phrase (handle with care!)
285
+ */
286
+ getMnemonic(): string;
287
+ /**
288
+ * Export all derived private keys (for backup only)
289
+ * @returns Record of chain to private key
290
+ */
291
+ exportPrivateKeys(): Record<Chain, string>;
292
+ /**
293
+ * Clear all derived keys from memory
294
+ */
295
+ clear(): void;
296
+ /**
297
+ * Get the extended public key (xpub) for the wallet
298
+ * @returns The extended public key
299
+ */
300
+ getExtendedPublicKey(): string;
301
+ }
302
+
303
+ /**
304
+ * BIP39 Mnemonic generation and validation
305
+ * Uses ethers.js which has built-in BIP39 support
306
+ */
307
+ /**
308
+ * Generate a new BIP39 mnemonic phrase
309
+ * @returns 12 word mnemonic phrase
310
+ */
311
+ declare function generateMnemonic(): string;
312
+ /**
313
+ * Validate a mnemonic phrase
314
+ * @param mnemonic - The mnemonic phrase to validate
315
+ * @returns True if valid
316
+ */
317
+ declare function validateMnemonic(mnemonic: string): boolean;
318
+ /**
319
+ * Get the entropy from a mnemonic (for backup/encryption)
320
+ * @param mnemonic - The mnemonic phrase
321
+ * @returns The entropy as a hex string
322
+ */
323
+ declare function mnemonicToEntropy(mnemonic: string): string;
324
+ /**
325
+ * Create mnemonic from entropy
326
+ * @param entropy - The entropy hex string
327
+ * @returns The mnemonic phrase
328
+ */
329
+ declare function entropyToMnemonic(entropy: string): string;
330
+
331
+ /**
332
+ * Base chain interface for all blockchain implementations
333
+ */
334
+
335
+ /**
336
+ * Abstract base class for all chain implementations
337
+ */
338
+ declare abstract class BaseChain {
339
+ /** Chain identifier */
340
+ readonly chainId: string;
341
+ /** Chain name */
342
+ readonly name: string;
343
+ /** RPC URL */
344
+ protected rpcUrl: string;
345
+ /** Block explorer URL */
346
+ protected explorerUrl: string;
347
+ constructor(chainId: string, name: string, rpcUrl: string, explorerUrl: string);
348
+ /**
349
+ * Connect to the chain (establish provider connection)
350
+ */
351
+ abstract connect(): Promise<void>;
352
+ /**
353
+ * Disconnect from the chain
354
+ */
355
+ abstract disconnect(): void;
356
+ /**
357
+ * Get the wallet address for this chain
358
+ */
359
+ abstract getAddress(): string;
360
+ /**
361
+ * Validate an address format for this chain
362
+ * @param address - The address to validate
363
+ */
364
+ abstract validateAddress(address: string): boolean;
365
+ /**
366
+ * Get balance for native or token
367
+ * @param tokenAddress - Optional token address (undefined for native)
368
+ */
369
+ abstract getBalance(tokenAddress?: string): Promise<Balance>;
370
+ /**
371
+ * Estimate transaction fee
372
+ * @param params - Payment parameters
373
+ */
374
+ abstract estimateFee(params: PaymentParams): Promise<FeeEstimate>;
375
+ /**
376
+ * Send a transaction
377
+ * @param params - Payment parameters
378
+ */
379
+ abstract sendTransaction(params: PaymentParams): Promise<string>;
380
+ /**
381
+ * Sign a message
382
+ * @param message - The message to sign
383
+ */
384
+ abstract signMessage(message: string): Promise<string>;
385
+ /**
386
+ * Get block explorer URL for a transaction
387
+ * @param txHash - Transaction hash
388
+ */
389
+ getExplorerUrl(txHash?: string): string;
390
+ /**
391
+ * Get block explorer URL for an address
392
+ * @param address - Wallet address
393
+ */
394
+ getAddressExplorerUrl(address: string): string;
395
+ /**
396
+ * Get chain info
397
+ */
398
+ getInfo(): {
399
+ chainId: string;
400
+ name: string;
401
+ rpcUrl: string;
402
+ explorerUrl: string;
403
+ };
404
+ }
405
+ /**
406
+ * Chain factory type
407
+ */
408
+ type ChainFactory = (privateKey: string, rpcUrl?: string) => BaseChain;
409
+ /**
410
+ * Register a chain implementation
411
+ */
412
+ declare function registerChain(chain: Chain, factory: ChainFactory): void;
413
+ /**
414
+ * Get a chain instance
415
+ */
416
+ declare function getChain(chain: Chain, privateKey: string, rpcUrl?: string): BaseChain;
417
+
418
+ /**
419
+ * Ethereum chain implementation using ethers.js v6
420
+ */
421
+
422
+ /**
423
+ * Ethereum chain implementation
424
+ */
425
+ declare class EthereumChain extends BaseChain {
426
+ private privateKey;
427
+ private wallet;
428
+ private provider;
429
+ constructor(chain: 'ethereum' | 'polygon' | 'bsc' | 'arbitrum', privateKey: string, rpcUrl?: string);
430
+ /**
431
+ * Connect to the chain
432
+ */
433
+ connect(): Promise<void>;
434
+ /**
435
+ * Disconnect from the chain
436
+ */
437
+ disconnect(): void;
438
+ /**
439
+ * Get the wallet address
440
+ */
441
+ getAddress(): string;
442
+ /**
443
+ * Validate an Ethereum address
444
+ */
445
+ validateAddress(address: string): boolean;
446
+ /**
447
+ * Get balance (native or ERC-20 token)
448
+ */
449
+ getBalance(tokenAddress?: string): Promise<Balance>;
450
+ /**
451
+ * Estimate transaction fee
452
+ */
453
+ estimateFee(params: PaymentParams): Promise<FeeEstimate>;
454
+ /**
455
+ * Send a transaction
456
+ */
457
+ sendTransaction(params: PaymentParams): Promise<string>;
458
+ /**
459
+ * Sign a message
460
+ */
461
+ signMessage(message: string): Promise<string>;
462
+ }
463
+
464
+ /**
465
+ * Bitcoin chain implementation
466
+ * Note: This is a simplified implementation. For production, use bitcoinjs-lib
467
+ */
468
+
469
+ /**
470
+ * Bitcoin chain implementation
471
+ */
472
+ declare class BitcoinChain extends BaseChain {
473
+ private privateKey;
474
+ private address;
475
+ constructor(privateKey: string, rpcUrl?: string);
476
+ /**
477
+ * Connect to Bitcoin network (uses block explorer API)
478
+ */
479
+ connect(): Promise<void>;
480
+ /**
481
+ * Disconnect (no-op for Bitcoin)
482
+ */
483
+ disconnect(): void;
484
+ /**
485
+ * Derive Bitcoin address from private key
486
+ */
487
+ private deriveAddress;
488
+ /**
489
+ * Get Bitcoin address
490
+ */
491
+ getAddress(): string;
492
+ /**
493
+ * Validate Bitcoin address
494
+ */
495
+ validateAddress(address: string): boolean;
496
+ /**
497
+ * Get Bitcoin balance (using block explorer API)
498
+ */
499
+ getBalance(): Promise<Balance>;
500
+ /**
501
+ * Estimate Bitcoin transaction fee
502
+ */
503
+ estimateFee(_params: PaymentParams): Promise<FeeEstimate>;
504
+ /**
505
+ * Send Bitcoin transaction
506
+ * Note: This requires full implementation with bitcoinjs-lib
507
+ */
508
+ sendTransaction(_params: PaymentParams): Promise<string>;
509
+ /**
510
+ * Sign a message with Bitcoin private key
511
+ */
512
+ signMessage(message: string): Promise<string>;
513
+ /**
514
+ * Get transaction history from block explorer
515
+ */
516
+ getTransactionHistory(): Promise<Array<{
517
+ hash: string;
518
+ amount: number;
519
+ }>>;
520
+ }
521
+
522
+ /**
523
+ * Trading module types
524
+ */
525
+
526
+ /**
527
+ * Exchange configuration
528
+ */
529
+ interface ExchangeConfig {
530
+ name: string;
531
+ apiKey?: string;
532
+ apiSecret?: string;
533
+ passphrase?: string;
534
+ sandbox?: boolean;
535
+ }
536
+ /**
537
+ * Order book data
538
+ */
539
+ interface OrderBook {
540
+ bids: [string, string][];
541
+ asks: [string, string][];
542
+ timestamp: number;
543
+ }
544
+ /**
545
+ * Ticker data
546
+ */
547
+ interface Ticker {
548
+ symbol: string;
549
+ bid: string;
550
+ ask: string;
551
+ last: string;
552
+ volume: string;
553
+ change: string;
554
+ percentage: string;
555
+ }
556
+ /**
557
+ * Order status
558
+ */
559
+ type OrderStatus = 'open' | 'closed' | 'canceled' | 'rejected';
560
+
561
+ /**
562
+ * Base exchange adapter interface
563
+ */
564
+
565
+ /**
566
+ * Abstract base class for exchange adapters
567
+ */
568
+ declare abstract class BaseExchange {
569
+ protected config: ExchangeConfig;
570
+ protected connected: boolean;
571
+ constructor(config: ExchangeConfig);
572
+ /**
573
+ * Connect to the exchange
574
+ */
575
+ abstract connect(): Promise<void>;
576
+ /**
577
+ * Disconnect from the exchange
578
+ */
579
+ abstract disconnect(): void;
580
+ /**
581
+ * Get available markets/trading pairs
582
+ */
583
+ abstract getMarkets(): Promise<string[]>;
584
+ /**
585
+ * Get market info for a symbol
586
+ */
587
+ abstract getMarketInfo(symbol: string): Promise<MarketInfo>;
588
+ /**
589
+ * Get ticker for a symbol
590
+ */
591
+ abstract getTicker(symbol: string): Promise<Ticker>;
592
+ /**
593
+ * Get order book for a symbol
594
+ */
595
+ abstract getOrderBook(symbol: string, limit?: number): Promise<OrderBook>;
596
+ /**
597
+ * Get account balance
598
+ */
599
+ abstract getBalance(): Promise<Record<string, string>>;
600
+ /**
601
+ * Place a buy order
602
+ */
603
+ abstract buy(config: TradeConfig): Promise<TradeResult>;
604
+ /**
605
+ * Place a sell order
606
+ */
607
+ abstract sell(config: TradeConfig): Promise<TradeResult>;
608
+ /**
609
+ * Cancel an order
610
+ */
611
+ abstract cancelOrder(orderId: string, symbol?: string): Promise<boolean>;
612
+ /**
613
+ * Get order status
614
+ */
615
+ abstract getOrderStatus(orderId: string): Promise<OrderStatus>;
616
+ /**
617
+ * Check if connected
618
+ */
619
+ isConnected(): boolean;
620
+ /**
621
+ * Get exchange name
622
+ */
623
+ getName(): string;
624
+ }
625
+
626
+ /**
627
+ * Trading manager for handling exchange operations
628
+ */
629
+
630
+ /**
631
+ * Trading manager class
632
+ */
633
+ declare class TradingManager {
634
+ private exchanges;
635
+ /**
636
+ * Add an exchange connection
637
+ */
638
+ addExchange(name: string, config: ExchangeConfig): void;
639
+ /**
640
+ * Connect to an exchange
641
+ */
642
+ connect(name: string): Promise<void>;
643
+ /**
644
+ * Disconnect from an exchange
645
+ */
646
+ disconnect(name: string): void;
647
+ /**
648
+ * Get available markets from an exchange
649
+ */
650
+ getMarkets(exchange: string): Promise<string[]>;
651
+ /**
652
+ * Get market info
653
+ */
654
+ getMarketInfo(exchange: string, symbol: string): Promise<MarketInfo>;
655
+ /**
656
+ * Get ticker
657
+ */
658
+ getTicker(exchange: string, symbol: string): Promise<Ticker>;
659
+ /**
660
+ * Get order book
661
+ */
662
+ getOrderBook(exchange: string, symbol: string, limit?: number): Promise<OrderBook>;
663
+ /**
664
+ * Get account balance
665
+ */
666
+ getBalance(exchange: string): Promise<Record<string, string>>;
667
+ /**
668
+ * Place a buy order
669
+ */
670
+ buy(config: TradeConfig): Promise<TradeResult>;
671
+ /**
672
+ * Place a sell order
673
+ */
674
+ sell(config: TradeConfig): Promise<TradeResult>;
675
+ /**
676
+ * Cancel an order
677
+ */
678
+ cancelOrder(exchange: string, orderId: string, symbol?: string): Promise<boolean>;
679
+ /**
680
+ * Get exchange instance
681
+ */
682
+ private getExchange;
683
+ /**
684
+ * Check if exchange is connected
685
+ */
686
+ isConnected(exchange: string): boolean;
687
+ }
688
+ /**
689
+ * Create a new trading manager
690
+ */
691
+ declare function createTradingManager(): TradingManager;
692
+
693
+ /**
694
+ * Binance exchange adapter
695
+ * Note: This is a simplified implementation using public APIs
696
+ * For full trading functionality, integrate with CCXT library
697
+ */
698
+
699
+ /**
700
+ * Binance exchange adapter
701
+ */
702
+ declare class BinanceExchange extends BaseExchange {
703
+ private baseUrl;
704
+ private apiKey?;
705
+ private apiSecret?;
706
+ constructor(config: ExchangeConfig);
707
+ /**
708
+ * Connect to Binance
709
+ */
710
+ connect(): Promise<void>;
711
+ /**
712
+ * Disconnect
713
+ */
714
+ disconnect(): void;
715
+ /**
716
+ * Get available markets
717
+ */
718
+ getMarkets(): Promise<string[]>;
719
+ /**
720
+ * Get market info
721
+ */
722
+ getMarketInfo(symbol: string): Promise<MarketInfo>;
723
+ /**
724
+ * Get ticker for a symbol
725
+ */
726
+ getTicker(symbol: string): Promise<Ticker>;
727
+ /**
728
+ * Get order book
729
+ */
730
+ getOrderBook(symbol: string, limit?: number): Promise<OrderBook>;
731
+ /**
732
+ * Get account balance
733
+ */
734
+ getBalance(): Promise<Record<string, string>>;
735
+ /**
736
+ * Place a buy order
737
+ */
738
+ buy(config: TradeConfig): Promise<TradeResult>;
739
+ /**
740
+ * Place a sell order
741
+ */
742
+ sell(config: TradeConfig): Promise<TradeResult>;
743
+ /**
744
+ * Cancel an order
745
+ */
746
+ cancelOrder(_orderId: string, _symbol?: string): Promise<boolean>;
747
+ /**
748
+ * Get order status
749
+ */
750
+ getOrderStatus(_orderId: string): Promise<OrderStatus>;
751
+ }
752
+
753
+ /**
754
+ * Balance manager for tracking balances across chains
755
+ */
756
+
757
+ /**
758
+ * Balance summary across all chains
759
+ */
760
+ interface BalanceSummary {
761
+ chain: Chain;
762
+ address: string;
763
+ balances: Array<{
764
+ symbol: TokenSymbol;
765
+ amount: string;
766
+ formatted: string;
767
+ }>;
768
+ totalValueUsd?: string;
769
+ }
770
+ /**
771
+ * Balance manager class
772
+ */
773
+ declare class BalanceManager {
774
+ private wallet;
775
+ private cache;
776
+ private cacheTtl;
777
+ constructor(wallet: ClawCashWallet);
778
+ /**
779
+ * Get balance for a specific chain
780
+ * @param chain - The blockchain network
781
+ * @param token - Optional token symbol
782
+ * @param useCache - Whether to use cached balance (default: true)
783
+ */
784
+ getBalance(chain: Chain, token?: TokenSymbol, useCache?: boolean): Promise<Balance>;
785
+ /**
786
+ * Get balances for all chains
787
+ */
788
+ getAllBalances(): Promise<BalanceSummary[]>;
789
+ /**
790
+ * Get total balance across all chains for a specific token
791
+ */
792
+ getTotalBalance(token: TokenSymbol): Promise<{
793
+ amount: string;
794
+ formatted: string;
795
+ chains: Array<{
796
+ chain: Chain;
797
+ amount: string;
798
+ }>;
799
+ }>;
800
+ /**
801
+ * Clear the balance cache
802
+ */
803
+ clearCache(): void;
804
+ /**
805
+ * Set cache TTL
806
+ */
807
+ setCacheTtl(milliseconds: number): void;
808
+ }
809
+ /**
810
+ * Create a balance manager
811
+ */
812
+ declare function createBalanceManager(wallet: ClawCashWallet): BalanceManager;
813
+
814
+ /**
815
+ * Token address registry for multi-chain tokens
816
+ */
817
+
818
+ /**
819
+ * Token configuration
820
+ */
821
+ interface TokenInfo {
822
+ symbol: TokenSymbol;
823
+ name: string;
824
+ decimals: number;
825
+ address: string;
826
+ chainId: number;
827
+ }
828
+ /**
829
+ * Token addresses across chains
830
+ */
831
+ declare const TOKEN_ADDRESSES: Record<string, Partial<Record<Chain, string>>>;
832
+ /**
833
+ * Chain IDs
834
+ */
835
+ declare const CHAIN_IDS: Record<Chain, number>;
836
+ /**
837
+ * Get token address for a chain
838
+ */
839
+ declare function getTokenAddress(token: string, chain: Chain): string | undefined;
840
+ /**
841
+ * Check if token exists on chain
842
+ */
843
+ declare function hasToken(token: string, chain: Chain): boolean;
844
+ /**
845
+ * Get all tokens for a chain
846
+ */
847
+ declare function getTokensForChain(chain: Chain): string[];
848
+ /**
849
+ * Get all supported tokens
850
+ */
851
+ declare function getAllSupportedTokens(): string[];
852
+
853
+ /**
854
+ * Public Wallet API
855
+ * Simple, agent-friendly functions for wallet operations
856
+ */
857
+
858
+ /**
859
+ * Create a new wallet
860
+ * @param config - Optional wallet configuration
861
+ * @returns Wallet addresses for all supported chains
862
+ */
863
+ declare function createWalletAPI(config?: WalletConfig): Promise<{
864
+ wallet: ClawCashWallet;
865
+ addresses: WalletAddresses;
866
+ }>;
867
+ /**
868
+ * Import a wallet from mnemonic
869
+ * @param mnemonic - BIP39 mnemonic phrase
870
+ * @returns Wallet addresses for all supported chains
871
+ */
872
+ declare function importWalletAPI(mnemonic: string): Promise<{
873
+ wallet: ClawCashWallet;
874
+ addresses: WalletAddresses;
875
+ }>;
876
+ /**
877
+ * Get wallet balance
878
+ * @param wallet - The wallet instance
879
+ * @param chain - The blockchain network
880
+ * @param token - Optional token symbol
881
+ */
882
+ declare function getBalanceAPI(wallet: ClawCashWallet, chain: Chain, token?: TokenSymbol): Promise<Balance>;
883
+ /**
884
+ * Export wallet mnemonic (use carefully!)
885
+ * @param wallet - The wallet instance
886
+ */
887
+ declare function exportMnemonicAPI(wallet: ClawCashWallet): string;
888
+
889
+ /**
890
+ * Public Payment API
891
+ * Simple, agent-friendly functions for payments
892
+ */
893
+
894
+ /**
895
+ * Send a payment
896
+ * @param wallet - The wallet instance
897
+ * @param params - Payment parameters
898
+ * @returns Transaction hash
899
+ */
900
+ declare function sendPaymentAPI(wallet: ClawCashWallet, params: PaymentParams): Promise<string>;
901
+ /**
902
+ * Estimate transaction fee
903
+ * @param wallet - The wallet instance
904
+ * @param params - Payment parameters
905
+ * @returns Fee estimate
906
+ */
907
+ declare function estimateFeesAPI(wallet: ClawCashWallet, params: PaymentParams): Promise<FeeEstimate>;
908
+ /**
909
+ * Quick payment - simplified interface
910
+ * @param wallet - The wallet instance
911
+ * @param chain - The blockchain network
912
+ * @param to - Recipient address
913
+ * @param amount - Amount to send (as decimal string)
914
+ * @param token - Token symbol (defaults to native)
915
+ */
916
+ declare function quickSend(wallet: ClawCashWallet, chain: 'ethereum' | 'polygon' | 'bsc' | 'arbitrum', to: string, amount: string, token?: 'ETH' | 'MATIC' | 'BNB'): Promise<string>;
917
+
918
+ export { AgentError, type AgentResult, type Balance, BalanceManager, type BalanceSummary, BaseChain, BaseExchange, BinanceExchange, BitcoinChain, CHAIN_IDS, type Chain, type ChainConfig, ClawCashWallet, EthereumChain, type ExchangeConfig, type FeeEstimate, KeyManager, type MarketInfo, type OrderBook, type OrderStatus, type PaymentParams, TOKEN_ADDRESSES, type Ticker, type TokenConfig, type TokenInfo, type TokenSymbol, type TradeConfig, type TradeResult, TradingManager, type Transaction, type TransactionResult, type WalletAddresses, type WalletConfig, createBalanceManager, createTradingManager, createWallet, createWalletAPI, entropyToMnemonic, estimateFeesAPI, exportMnemonicAPI, generateMnemonic, getAllSupportedTokens, getBalanceAPI, getChain, getTokenAddress, getTokensForChain, hasToken, importWallet, importWalletAPI, mnemonicToEntropy, quickSend, registerChain, sendPaymentAPI, validateMnemonic };