@zubari/sdk 0.2.8 → 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.
- package/dist/{TransactionService-8xSEGoWA.d.mts → TransactionService-DURp3bRL.d.ts} +34 -10
- package/dist/{TransactionService-CaIcCoqY.d.ts → TransactionService-DuMJmrG3.d.mts} +34 -10
- package/dist/{WalletManager-B1qvFF4K.d.mts → WalletManager-D0xMpgfo.d.mts} +133 -50
- package/dist/{WalletManager-CCs4Jsv7.d.ts → WalletManager-DsAg7MwL.d.ts} +133 -50
- package/dist/{index-Cx389p_j.d.mts → index-DF0Gf8NK.d.mts} +7 -1
- package/dist/{index-Cx389p_j.d.ts → index-DF0Gf8NK.d.ts} +7 -1
- package/dist/{index-Cqrpp3XA.d.ts → index-N2u4haqL.d.mts} +22 -11
- package/dist/{index-BOc9U2TK.d.mts → index-kS-xopkl.d.ts} +22 -11
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +3064 -1770
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3064 -1770
- package/dist/index.mjs.map +1 -1
- package/dist/protocols/index.d.mts +54 -22
- package/dist/protocols/index.d.ts +54 -22
- package/dist/protocols/index.js +1008 -76
- package/dist/protocols/index.js.map +1 -1
- package/dist/protocols/index.mjs +1008 -76
- package/dist/protocols/index.mjs.map +1 -1
- package/dist/react/index.d.mts +5 -4
- package/dist/react/index.d.ts +5 -4
- package/dist/react/index.js +884 -884
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +884 -884
- package/dist/react/index.mjs.map +1 -1
- package/dist/services/index.d.mts +2 -2
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js +152 -75
- package/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs +152 -75
- package/dist/services/index.mjs.map +1 -1
- package/dist/wallet/index.d.mts +5 -4
- package/dist/wallet/index.d.ts +5 -4
- package/dist/wallet/index.js +1352 -1105
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/index.mjs +1352 -1105
- package/dist/wallet/index.mjs.map +1 -1
- package/package.json +9 -6
|
@@ -1,35 +1,59 @@
|
|
|
1
|
-
import { o as SwapQuote, c as TxResult, a as NetworkType } from './index-
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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,
|
|
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
|
|
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<
|
|
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-
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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,
|
|
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
|
|
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<
|
|
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
|
/**
|