@imtbl/dex-sdk 2.0.0-alpha.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/LICENSE.md +176 -0
- package/README.md +3 -0
- package/dist/browser/index.js +2 -0
- package/dist/node/index.cjs +2 -0
- package/dist/node/index.js +2 -0
- package/dist/types/config/config.test.d.ts +1 -0
- package/dist/types/config/index.d.ts +18 -0
- package/dist/types/constants/chains/immutable-mainnet.d.ts +2 -0
- package/dist/types/constants/chains/immutable-testnet.d.ts +2 -0
- package/dist/types/constants/chains/index.d.ts +2 -0
- package/dist/types/constants/index.d.ts +3 -0
- package/dist/types/constants/router.d.ts +8 -0
- package/dist/types/constants/tokens/immutable-mainnet.d.ts +5 -0
- package/dist/types/constants/tokens/immutable-testnet.d.ts +4 -0
- package/dist/types/constants/tokens/index.d.ts +2 -0
- package/dist/types/constants/wrapping.d.ts +2 -0
- package/dist/types/contracts/types/ERC20.d.ts +141 -0
- package/dist/types/contracts/types/ImmutableSwapProxy.d.ts +469 -0
- package/dist/types/contracts/types/Multicall.d.ts +83 -0
- package/dist/types/contracts/types/QuoterV2.d.ts +219 -0
- package/dist/types/contracts/types/UniswapV3Pool.d.ts +732 -0
- package/dist/types/contracts/types/WIMX.d.ts +179 -0
- package/dist/types/contracts/types/common.d.ts +50 -0
- package/dist/types/contracts/types/factories/ERC20__factory.d.ts +174 -0
- package/dist/types/contracts/types/factories/ImmutableSwapProxy__factory.d.ts +612 -0
- package/dist/types/contracts/types/factories/Multicall__factory.d.ts +90 -0
- package/dist/types/contracts/types/factories/QuoterV2__factory.d.ts +226 -0
- package/dist/types/contracts/types/factories/UniswapV3Pool__factory.d.ts +795 -0
- package/dist/types/contracts/types/factories/WIMX__factory.d.ts +219 -0
- package/dist/types/contracts/types/factories/index.d.ts +6 -0
- package/dist/types/contracts/types/index.d.ts +13 -0
- package/dist/types/errors/exchangeError.d.ts +61 -0
- package/dist/types/errors/index.d.ts +1 -0
- package/dist/types/exchange.d.ts +50 -0
- package/dist/types/exchange.getUnsignedSwapTxFromAmountIn.test.d.ts +1 -0
- package/dist/types/exchange.getUnsignedSwapTxFromAmountOut.test.d.ts +1 -0
- package/dist/types/exchange.test.d.ts +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/lib/fees.d.ts +16 -0
- package/dist/types/lib/fees.test.d.ts +1 -0
- package/dist/types/lib/getQuotesForRoutes.d.ts +14 -0
- package/dist/types/lib/getQuotesForRoutes.test.d.ts +1 -0
- package/dist/types/lib/index.d.ts +3 -0
- package/dist/types/lib/multicall.d.ts +12 -0
- package/dist/types/lib/multicall.test.d.ts +1 -0
- package/dist/types/lib/nativeTokenService.d.ts +13 -0
- package/dist/types/lib/nativeTokenService.test.d.ts +1 -0
- package/dist/types/lib/poolUtils/computePoolAddress.d.ts +9 -0
- package/dist/types/lib/poolUtils/ensureCorrectERC20AddressOrder.test.d.ts +1 -0
- package/dist/types/lib/poolUtils/fetchValidPools.d.ts +14 -0
- package/dist/types/lib/poolUtils/fetchValidPools.test.d.ts +1 -0
- package/dist/types/lib/poolUtils/generateAllAcyclicPaths.test.d.ts +1 -0
- package/dist/types/lib/poolUtils/generateERC20Pairs.d.ts +7 -0
- package/dist/types/lib/poolUtils/generateERC20Pairs.test.d.ts +1 -0
- package/dist/types/lib/poolUtils/generatePossiblePoolsFromERC20Pairs.d.ts +11 -0
- package/dist/types/lib/poolUtils/generatePossiblePoolsFromERC20Pairs.test.d.ts +1 -0
- package/dist/types/lib/router.d.ts +24 -0
- package/dist/types/lib/router.test.d.ts +1 -0
- package/dist/types/lib/transactionUtils/approval.d.ts +25 -0
- package/dist/types/lib/transactionUtils/approval.test.d.ts +1 -0
- package/dist/types/lib/transactionUtils/gas.d.ts +18 -0
- package/dist/types/lib/transactionUtils/gas.test.d.ts +1 -0
- package/dist/types/lib/transactionUtils/getQuote.d.ts +13 -0
- package/dist/types/lib/transactionUtils/getQuote.test.d.ts +1 -0
- package/dist/types/lib/transactionUtils/slippage.d.ts +2 -0
- package/dist/types/lib/transactionUtils/slippage.test.d.ts +1 -0
- package/dist/types/lib/transactionUtils/swap.d.ts +16 -0
- package/dist/types/lib/transactionUtils/swap.test.d.ts +1 -0
- package/dist/types/lib/utils.d.ts +60 -0
- package/dist/types/lib/utils.test.d.ts +1 -0
- package/dist/types/test/utils.d.ts +134 -0
- package/dist/types/test/utils.test.d.ts +1 -0
- package/dist/types/types/index.d.ts +174 -0
- package/package.json +74 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers";
|
|
2
|
+
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedListener, TypedContractMethod } from "./common";
|
|
3
|
+
export declare namespace IQuoterV2 {
|
|
4
|
+
type QuoteExactInputSingleParamsStruct = {
|
|
5
|
+
tokenIn: AddressLike;
|
|
6
|
+
tokenOut: AddressLike;
|
|
7
|
+
amountIn: BigNumberish;
|
|
8
|
+
fee: BigNumberish;
|
|
9
|
+
sqrtPriceLimitX96: BigNumberish;
|
|
10
|
+
};
|
|
11
|
+
type QuoteExactInputSingleParamsStructOutput = [
|
|
12
|
+
tokenIn: string,
|
|
13
|
+
tokenOut: string,
|
|
14
|
+
amountIn: bigint,
|
|
15
|
+
fee: bigint,
|
|
16
|
+
sqrtPriceLimitX96: bigint
|
|
17
|
+
] & {
|
|
18
|
+
tokenIn: string;
|
|
19
|
+
tokenOut: string;
|
|
20
|
+
amountIn: bigint;
|
|
21
|
+
fee: bigint;
|
|
22
|
+
sqrtPriceLimitX96: bigint;
|
|
23
|
+
};
|
|
24
|
+
type QuoteExactOutputSingleParamsStruct = {
|
|
25
|
+
tokenIn: AddressLike;
|
|
26
|
+
tokenOut: AddressLike;
|
|
27
|
+
amount: BigNumberish;
|
|
28
|
+
fee: BigNumberish;
|
|
29
|
+
sqrtPriceLimitX96: BigNumberish;
|
|
30
|
+
};
|
|
31
|
+
type QuoteExactOutputSingleParamsStructOutput = [
|
|
32
|
+
tokenIn: string,
|
|
33
|
+
tokenOut: string,
|
|
34
|
+
amount: bigint,
|
|
35
|
+
fee: bigint,
|
|
36
|
+
sqrtPriceLimitX96: bigint
|
|
37
|
+
] & {
|
|
38
|
+
tokenIn: string;
|
|
39
|
+
tokenOut: string;
|
|
40
|
+
amount: bigint;
|
|
41
|
+
fee: bigint;
|
|
42
|
+
sqrtPriceLimitX96: bigint;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface QuoterV2Interface extends Interface {
|
|
46
|
+
getFunction(nameOrSignature: "WETH9" | "factory" | "quoteExactInput" | "quoteExactInputSingle" | "quoteExactOutput" | "quoteExactOutputSingle" | "uniswapV3SwapCallback"): FunctionFragment;
|
|
47
|
+
encodeFunctionData(functionFragment: "WETH9", values?: undefined): string;
|
|
48
|
+
encodeFunctionData(functionFragment: "factory", values?: undefined): string;
|
|
49
|
+
encodeFunctionData(functionFragment: "quoteExactInput", values: [BytesLike, BigNumberish]): string;
|
|
50
|
+
encodeFunctionData(functionFragment: "quoteExactInputSingle", values: [IQuoterV2.QuoteExactInputSingleParamsStruct]): string;
|
|
51
|
+
encodeFunctionData(functionFragment: "quoteExactOutput", values: [BytesLike, BigNumberish]): string;
|
|
52
|
+
encodeFunctionData(functionFragment: "quoteExactOutputSingle", values: [IQuoterV2.QuoteExactOutputSingleParamsStruct]): string;
|
|
53
|
+
encodeFunctionData(functionFragment: "uniswapV3SwapCallback", values: [BigNumberish, BigNumberish, BytesLike]): string;
|
|
54
|
+
decodeFunctionResult(functionFragment: "WETH9", data: BytesLike): Result;
|
|
55
|
+
decodeFunctionResult(functionFragment: "factory", data: BytesLike): Result;
|
|
56
|
+
decodeFunctionResult(functionFragment: "quoteExactInput", data: BytesLike): Result;
|
|
57
|
+
decodeFunctionResult(functionFragment: "quoteExactInputSingle", data: BytesLike): Result;
|
|
58
|
+
decodeFunctionResult(functionFragment: "quoteExactOutput", data: BytesLike): Result;
|
|
59
|
+
decodeFunctionResult(functionFragment: "quoteExactOutputSingle", data: BytesLike): Result;
|
|
60
|
+
decodeFunctionResult(functionFragment: "uniswapV3SwapCallback", data: BytesLike): Result;
|
|
61
|
+
}
|
|
62
|
+
export interface QuoterV2 extends BaseContract {
|
|
63
|
+
connect(runner?: ContractRunner | null): QuoterV2;
|
|
64
|
+
waitForDeployment(): Promise<this>;
|
|
65
|
+
interface: QuoterV2Interface;
|
|
66
|
+
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
67
|
+
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
68
|
+
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
69
|
+
on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
70
|
+
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
71
|
+
once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
72
|
+
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
|
|
73
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
74
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
75
|
+
WETH9: TypedContractMethod<[], [string], "view">;
|
|
76
|
+
factory: TypedContractMethod<[], [string], "view">;
|
|
77
|
+
quoteExactInput: TypedContractMethod<[
|
|
78
|
+
path: BytesLike,
|
|
79
|
+
amountIn: BigNumberish
|
|
80
|
+
], [
|
|
81
|
+
[
|
|
82
|
+
bigint,
|
|
83
|
+
bigint[],
|
|
84
|
+
bigint[],
|
|
85
|
+
bigint
|
|
86
|
+
] & {
|
|
87
|
+
amountOut: bigint;
|
|
88
|
+
sqrtPriceX96AfterList: bigint[];
|
|
89
|
+
initializedTicksCrossedList: bigint[];
|
|
90
|
+
gasEstimate: bigint;
|
|
91
|
+
}
|
|
92
|
+
], "nonpayable">;
|
|
93
|
+
quoteExactInputSingle: TypedContractMethod<[
|
|
94
|
+
params: IQuoterV2.QuoteExactInputSingleParamsStruct
|
|
95
|
+
], [
|
|
96
|
+
[
|
|
97
|
+
bigint,
|
|
98
|
+
bigint,
|
|
99
|
+
bigint,
|
|
100
|
+
bigint
|
|
101
|
+
] & {
|
|
102
|
+
amountOut: bigint;
|
|
103
|
+
sqrtPriceX96After: bigint;
|
|
104
|
+
initializedTicksCrossed: bigint;
|
|
105
|
+
gasEstimate: bigint;
|
|
106
|
+
}
|
|
107
|
+
], "nonpayable">;
|
|
108
|
+
quoteExactOutput: TypedContractMethod<[
|
|
109
|
+
path: BytesLike,
|
|
110
|
+
amountOut: BigNumberish
|
|
111
|
+
], [
|
|
112
|
+
[
|
|
113
|
+
bigint,
|
|
114
|
+
bigint[],
|
|
115
|
+
bigint[],
|
|
116
|
+
bigint
|
|
117
|
+
] & {
|
|
118
|
+
amountIn: bigint;
|
|
119
|
+
sqrtPriceX96AfterList: bigint[];
|
|
120
|
+
initializedTicksCrossedList: bigint[];
|
|
121
|
+
gasEstimate: bigint;
|
|
122
|
+
}
|
|
123
|
+
], "nonpayable">;
|
|
124
|
+
quoteExactOutputSingle: TypedContractMethod<[
|
|
125
|
+
params: IQuoterV2.QuoteExactOutputSingleParamsStruct
|
|
126
|
+
], [
|
|
127
|
+
[
|
|
128
|
+
bigint,
|
|
129
|
+
bigint,
|
|
130
|
+
bigint,
|
|
131
|
+
bigint
|
|
132
|
+
] & {
|
|
133
|
+
amountIn: bigint;
|
|
134
|
+
sqrtPriceX96After: bigint;
|
|
135
|
+
initializedTicksCrossed: bigint;
|
|
136
|
+
gasEstimate: bigint;
|
|
137
|
+
}
|
|
138
|
+
], "nonpayable">;
|
|
139
|
+
uniswapV3SwapCallback: TypedContractMethod<[
|
|
140
|
+
amount0Delta: BigNumberish,
|
|
141
|
+
amount1Delta: BigNumberish,
|
|
142
|
+
path: BytesLike
|
|
143
|
+
], [
|
|
144
|
+
void
|
|
145
|
+
], "view">;
|
|
146
|
+
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
147
|
+
getFunction(nameOrSignature: "WETH9"): TypedContractMethod<[], [string], "view">;
|
|
148
|
+
getFunction(nameOrSignature: "factory"): TypedContractMethod<[], [string], "view">;
|
|
149
|
+
getFunction(nameOrSignature: "quoteExactInput"): TypedContractMethod<[
|
|
150
|
+
path: BytesLike,
|
|
151
|
+
amountIn: BigNumberish
|
|
152
|
+
], [
|
|
153
|
+
[
|
|
154
|
+
bigint,
|
|
155
|
+
bigint[],
|
|
156
|
+
bigint[],
|
|
157
|
+
bigint
|
|
158
|
+
] & {
|
|
159
|
+
amountOut: bigint;
|
|
160
|
+
sqrtPriceX96AfterList: bigint[];
|
|
161
|
+
initializedTicksCrossedList: bigint[];
|
|
162
|
+
gasEstimate: bigint;
|
|
163
|
+
}
|
|
164
|
+
], "nonpayable">;
|
|
165
|
+
getFunction(nameOrSignature: "quoteExactInputSingle"): TypedContractMethod<[
|
|
166
|
+
params: IQuoterV2.QuoteExactInputSingleParamsStruct
|
|
167
|
+
], [
|
|
168
|
+
[
|
|
169
|
+
bigint,
|
|
170
|
+
bigint,
|
|
171
|
+
bigint,
|
|
172
|
+
bigint
|
|
173
|
+
] & {
|
|
174
|
+
amountOut: bigint;
|
|
175
|
+
sqrtPriceX96After: bigint;
|
|
176
|
+
initializedTicksCrossed: bigint;
|
|
177
|
+
gasEstimate: bigint;
|
|
178
|
+
}
|
|
179
|
+
], "nonpayable">;
|
|
180
|
+
getFunction(nameOrSignature: "quoteExactOutput"): TypedContractMethod<[
|
|
181
|
+
path: BytesLike,
|
|
182
|
+
amountOut: BigNumberish
|
|
183
|
+
], [
|
|
184
|
+
[
|
|
185
|
+
bigint,
|
|
186
|
+
bigint[],
|
|
187
|
+
bigint[],
|
|
188
|
+
bigint
|
|
189
|
+
] & {
|
|
190
|
+
amountIn: bigint;
|
|
191
|
+
sqrtPriceX96AfterList: bigint[];
|
|
192
|
+
initializedTicksCrossedList: bigint[];
|
|
193
|
+
gasEstimate: bigint;
|
|
194
|
+
}
|
|
195
|
+
], "nonpayable">;
|
|
196
|
+
getFunction(nameOrSignature: "quoteExactOutputSingle"): TypedContractMethod<[
|
|
197
|
+
params: IQuoterV2.QuoteExactOutputSingleParamsStruct
|
|
198
|
+
], [
|
|
199
|
+
[
|
|
200
|
+
bigint,
|
|
201
|
+
bigint,
|
|
202
|
+
bigint,
|
|
203
|
+
bigint
|
|
204
|
+
] & {
|
|
205
|
+
amountIn: bigint;
|
|
206
|
+
sqrtPriceX96After: bigint;
|
|
207
|
+
initializedTicksCrossed: bigint;
|
|
208
|
+
gasEstimate: bigint;
|
|
209
|
+
}
|
|
210
|
+
], "nonpayable">;
|
|
211
|
+
getFunction(nameOrSignature: "uniswapV3SwapCallback"): TypedContractMethod<[
|
|
212
|
+
amount0Delta: BigNumberish,
|
|
213
|
+
amount1Delta: BigNumberish,
|
|
214
|
+
path: BytesLike
|
|
215
|
+
], [
|
|
216
|
+
void
|
|
217
|
+
], "view">;
|
|
218
|
+
filters: {};
|
|
219
|
+
}
|