@zubari/sdk 0.2.7 → 0.3.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.
Files changed (39) hide show
  1. package/dist/{TransactionService-8xSEGoWA.d.mts → TransactionService-DURp3bRL.d.ts} +34 -10
  2. package/dist/{TransactionService-CaIcCoqY.d.ts → TransactionService-DuMJmrG3.d.mts} +34 -10
  3. package/dist/{WalletManager-B1qvFF4K.d.mts → WalletManager-D0xMpgfo.d.mts} +133 -50
  4. package/dist/{WalletManager-CCs4Jsv7.d.ts → WalletManager-DsAg7MwL.d.ts} +133 -50
  5. package/dist/{index-Cx389p_j.d.mts → index-DF0Gf8NK.d.mts} +7 -1
  6. package/dist/{index-Cx389p_j.d.ts → index-DF0Gf8NK.d.ts} +7 -1
  7. package/dist/{index-xZYY0MEX.d.mts → index-N2u4haqL.d.mts} +23 -11
  8. package/dist/{index-BPojlGT6.d.ts → index-kS-xopkl.d.ts} +23 -11
  9. package/dist/index.d.mts +6 -5
  10. package/dist/index.d.ts +6 -5
  11. package/dist/index.js +3070 -1772
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +3070 -1772
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/protocols/index.d.mts +54 -22
  16. package/dist/protocols/index.d.ts +54 -22
  17. package/dist/protocols/index.js +1008 -76
  18. package/dist/protocols/index.js.map +1 -1
  19. package/dist/protocols/index.mjs +1008 -76
  20. package/dist/protocols/index.mjs.map +1 -1
  21. package/dist/react/index.d.mts +5 -4
  22. package/dist/react/index.d.ts +5 -4
  23. package/dist/react/index.js +884 -884
  24. package/dist/react/index.js.map +1 -1
  25. package/dist/react/index.mjs +884 -884
  26. package/dist/react/index.mjs.map +1 -1
  27. package/dist/services/index.d.mts +2 -2
  28. package/dist/services/index.d.ts +2 -2
  29. package/dist/services/index.js +152 -71
  30. package/dist/services/index.js.map +1 -1
  31. package/dist/services/index.mjs +152 -71
  32. package/dist/services/index.mjs.map +1 -1
  33. package/dist/wallet/index.d.mts +5 -4
  34. package/dist/wallet/index.d.ts +5 -4
  35. package/dist/wallet/index.js +1358 -1107
  36. package/dist/wallet/index.js.map +1 -1
  37. package/dist/wallet/index.mjs +1358 -1107
  38. package/dist/wallet/index.mjs.map +1 -1
  39. package/package.json +9 -6
@@ -1,35 +1,59 @@
1
- import { o as SwapQuote, c as TxResult, a as NetworkType } from './index-Cx389p_j.mjs';
1
+ import { o as SwapQuote, c as TxResult, s as TokenInfo, a as NetworkType } from './index-DF0Gf8NK.js';
2
2
 
3
3
  /**
4
- * SwapService - DEX integration via Velora
4
+ * SwapService - DEX integration via Uniswap V3
5
5
  *
6
6
  * Handles token swaps with slippage protection,
7
7
  * quote fetching, and earnings conversion.
8
8
  */
9
9
  declare class SwapService {
10
- private readonly _chainId;
10
+ private readonly chainId;
11
11
  private readonly isTestnet;
12
+ private readonly addresses;
13
+ private readonly tokens;
12
14
  constructor(chainId: number, isTestnet?: boolean);
13
15
  /**
14
- * Get a swap quote
16
+ * Get a swap quote from Uniswap V3 Quoter
15
17
  */
16
- getQuote(tokenIn: string, tokenOut: string, amountIn: bigint): Promise<SwapQuote>;
18
+ getQuote(tokenIn: string, tokenOut: string, amountIn: bigint, provider?: {
19
+ call: (tx: object) => Promise<string>;
20
+ }): Promise<SwapQuote>;
17
21
  /**
18
- * Execute a swap with slippage protection
22
+ * Execute a swap with slippage protection via Uniswap V3 SwapRouter
19
23
  */
20
- executeSwap(quote: SwapQuote, slippageToleranceBps?: number): Promise<TxResult>;
24
+ executeSwap(quote: SwapQuote, signer: {
25
+ sendTransaction: (tx: object) => Promise<{
26
+ hash: string;
27
+ }>;
28
+ }, recipient: string, slippageToleranceBps?: number): Promise<TxResult>;
21
29
  /**
22
30
  * Convert earnings to USDT, keeping some ETH for gas
23
31
  */
24
- convertEarningsToStable(ethBalance: bigint, reserveForGas?: bigint): Promise<TxResult>;
32
+ convertEarningsToStable(ethBalance: bigint, signer: {
33
+ sendTransaction: (tx: object) => Promise<{
34
+ hash: string;
35
+ }>;
36
+ }, recipient: string, provider?: {
37
+ call: (tx: object) => Promise<string>;
38
+ }, reserveForGas?: bigint): Promise<TxResult>;
25
39
  /**
26
40
  * Check if a swap route exists
27
41
  */
28
- hasRoute(tokenIn: string, tokenOut: string): Promise<boolean>;
42
+ hasRoute(tokenIn: string, tokenOut: string, provider?: {
43
+ call: (tx: object) => Promise<string>;
44
+ }): Promise<boolean>;
29
45
  /**
30
46
  * Get supported tokens for swapping
31
47
  */
32
- getSupportedTokens(): Promise<string[]>;
48
+ getSupportedTokens(): Promise<TokenInfo[]>;
49
+ /**
50
+ * Get Uniswap router address for approvals
51
+ */
52
+ getRouterAddress(): string;
53
+ /**
54
+ * Calculate price impact (simplified)
55
+ */
56
+ private calculatePriceImpact;
33
57
  }
34
58
 
35
59
  /**
@@ -1,35 +1,59 @@
1
- import { o as SwapQuote, c as TxResult, a as NetworkType } from './index-Cx389p_j.js';
1
+ import { o as SwapQuote, c as TxResult, s as TokenInfo, a as NetworkType } from './index-DF0Gf8NK.mjs';
2
2
 
3
3
  /**
4
- * SwapService - DEX integration via Velora
4
+ * SwapService - DEX integration via Uniswap V3
5
5
  *
6
6
  * Handles token swaps with slippage protection,
7
7
  * quote fetching, and earnings conversion.
8
8
  */
9
9
  declare class SwapService {
10
- private readonly _chainId;
10
+ private readonly chainId;
11
11
  private readonly isTestnet;
12
+ private readonly addresses;
13
+ private readonly tokens;
12
14
  constructor(chainId: number, isTestnet?: boolean);
13
15
  /**
14
- * Get a swap quote
16
+ * Get a swap quote from Uniswap V3 Quoter
15
17
  */
16
- getQuote(tokenIn: string, tokenOut: string, amountIn: bigint): Promise<SwapQuote>;
18
+ getQuote(tokenIn: string, tokenOut: string, amountIn: bigint, provider?: {
19
+ call: (tx: object) => Promise<string>;
20
+ }): Promise<SwapQuote>;
17
21
  /**
18
- * Execute a swap with slippage protection
22
+ * Execute a swap with slippage protection via Uniswap V3 SwapRouter
19
23
  */
20
- executeSwap(quote: SwapQuote, slippageToleranceBps?: number): Promise<TxResult>;
24
+ executeSwap(quote: SwapQuote, signer: {
25
+ sendTransaction: (tx: object) => Promise<{
26
+ hash: string;
27
+ }>;
28
+ }, recipient: string, slippageToleranceBps?: number): Promise<TxResult>;
21
29
  /**
22
30
  * Convert earnings to USDT, keeping some ETH for gas
23
31
  */
24
- convertEarningsToStable(ethBalance: bigint, reserveForGas?: bigint): Promise<TxResult>;
32
+ convertEarningsToStable(ethBalance: bigint, signer: {
33
+ sendTransaction: (tx: object) => Promise<{
34
+ hash: string;
35
+ }>;
36
+ }, recipient: string, provider?: {
37
+ call: (tx: object) => Promise<string>;
38
+ }, reserveForGas?: bigint): Promise<TxResult>;
25
39
  /**
26
40
  * Check if a swap route exists
27
41
  */
28
- hasRoute(tokenIn: string, tokenOut: string): Promise<boolean>;
42
+ hasRoute(tokenIn: string, tokenOut: string, provider?: {
43
+ call: (tx: object) => Promise<string>;
44
+ }): Promise<boolean>;
29
45
  /**
30
46
  * Get supported tokens for swapping
31
47
  */
32
- getSupportedTokens(): Promise<string[]>;
48
+ getSupportedTokens(): Promise<TokenInfo[]>;
49
+ /**
50
+ * Get Uniswap router address for approvals
51
+ */
52
+ getRouterAddress(): string;
53
+ /**
54
+ * Calculate price impact (simplified)
55
+ */
56
+ private calculatePriceImpact;
33
57
  }
34
58
 
35
59
  /**