@dodoex/dodo-contract-request 1.14.0 → 1.15.0-morph-holesky.2

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 (43) hide show
  1. package/.cache/contract-info/VE33NonfungiblePositionManager.json +1312 -0
  2. package/.cache/contract-info/VE33V2Pair.json +1357 -0
  3. package/.cache/contract-info/VE33V2Router.json +1660 -0
  4. package/CHANGELOG.md +7 -0
  5. package/contract-config/arbitrum.json +6 -2
  6. package/contract-config/base.json +6 -2
  7. package/contract-config/bsc.json +6 -2
  8. package/contract-config/eth.json +6 -2
  9. package/contract-config/morph-holesky.json +69 -0
  10. package/contract-config/polygon.json +6 -2
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/types/config/arbitrum.d.ts +4 -0
  14. package/dist/types/config/base.d.ts +4 -0
  15. package/dist/types/config/bsc.d.ts +4 -0
  16. package/dist/types/config/ethereum.d.ts +4 -0
  17. package/dist/types/config/index.d.ts +31 -19
  18. package/dist/types/config/morph-holesky.d.ts +8 -0
  19. package/dist/types/config/polygon.d.ts +4 -0
  20. package/dist/types/contract/VE33NonfungiblePositionManager.d.ts +460 -0
  21. package/dist/types/contract/VE33V2Pair.d.ts +667 -0
  22. package/dist/types/contract/VE33V2Router.d.ts +436 -0
  23. package/dist/types/index.d.ts +3 -0
  24. package/package.json +2 -1
  25. package/scripts/contract-generate.ts +1 -0
  26. package/src/config/arbitrum.ts +1 -1
  27. package/src/config/base.ts +1 -1
  28. package/src/config/bsc.ts +1 -1
  29. package/src/config/ethereum.ts +1 -1
  30. package/src/config/index.ts +5 -1
  31. package/src/config/morph-holesky.ts +4 -0
  32. package/src/config/polygon.ts +1 -1
  33. package/src/contract/DODOApprove.ts +1 -1
  34. package/src/contract/ERC20Helper.ts +1 -1
  35. package/src/contract/MulticallWithValid.ts +1 -1
  36. package/src/contract/NonfungiblePositionManager.ts +1 -1
  37. package/src/contract/UniswapV2Factory.ts +1 -1
  38. package/src/contract/UniswapV2Router02.ts +1 -1
  39. package/src/contract/UniswapV3Factory.ts +1 -1
  40. package/src/contract/VE33NonfungiblePositionManager.ts +734 -0
  41. package/src/contract/VE33V2Pair.ts +1061 -0
  42. package/src/contract/VE33V2Router.ts +647 -0
  43. package/src/index.ts +3 -0
@@ -0,0 +1,647 @@
1
+ import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
2
+
3
+ import { contractRequests } from '../contractRequests';
4
+
5
+ export function getVE33V2RouterContractAddressByChainId(chainId: number) {
6
+ const contractAddressObject = {"2810":"0x468e60B84b11B3B1532D7C41FcBb79DA352aa12d"};
7
+ const result = contractAddressObject[String(chainId) as keyof typeof contractAddressObject];
8
+ return result
9
+ }
10
+
11
+ /**
12
+ * fetch ETHER
13
+ * @param {number} chainId - number
14
+ * @returns {string} __output0 - address
15
+ */
16
+ export function fetchVE33V2RouterETHER(chainId: number): Promise<string> {
17
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
18
+
19
+ const __encodeData = defaultAbiCoder.encode([], []);
20
+ const __data = hexlify(concat(['0x42cb1fbc', __encodeData]));
21
+ return contractRequests.batchCall<string>(chainId, __to, __data, [{"internalType":"address","name":"","type":"address"}])
22
+ }
23
+ export function getFetchVE33V2RouterETHERQueryOptions(chainId: number | undefined) {
24
+ return {
25
+ queryKey: ['contract-request', 'fetchVE33V2RouterETHER', chainId],
26
+ enabled: chainId !== undefined && chainId !== null,
27
+ queryFn: () => {
28
+ return fetchVE33V2RouterETHER(chainId as number);
29
+ }
30
+ }
31
+ }
32
+
33
+ /**
34
+ * fetch defaultFactory
35
+ * @param {number} chainId - number
36
+ * @returns {string} __output0 - address
37
+ */
38
+ export function fetchVE33V2RouterDefaultFactory(chainId: number): Promise<string> {
39
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
40
+
41
+ const __encodeData = defaultAbiCoder.encode([], []);
42
+ const __data = hexlify(concat(['0xd4b6846d', __encodeData]));
43
+ return contractRequests.batchCall<string>(chainId, __to, __data, [{"internalType":"address","name":"","type":"address"}])
44
+ }
45
+ export function getFetchVE33V2RouterDefaultFactoryQueryOptions(chainId: number | undefined) {
46
+ return {
47
+ queryKey: ['contract-request', 'fetchVE33V2RouterDefaultFactory', chainId],
48
+ enabled: chainId !== undefined && chainId !== null,
49
+ queryFn: () => {
50
+ return fetchVE33V2RouterDefaultFactory(chainId as number);
51
+ }
52
+ }
53
+ }
54
+
55
+ /**
56
+ * fetch factoryRegistry
57
+ * @param {number} chainId - number
58
+ * @returns {string} __output0 - address
59
+ */
60
+ export function fetchVE33V2RouterFactoryRegistry(chainId: number): Promise<string> {
61
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
62
+
63
+ const __encodeData = defaultAbiCoder.encode([], []);
64
+ const __data = hexlify(concat(['0x3bf0c9fb', __encodeData]));
65
+ return contractRequests.batchCall<string>(chainId, __to, __data, [{"internalType":"address","name":"","type":"address"}])
66
+ }
67
+ export function getFetchVE33V2RouterFactoryRegistryQueryOptions(chainId: number | undefined) {
68
+ return {
69
+ queryKey: ['contract-request', 'fetchVE33V2RouterFactoryRegistry', chainId],
70
+ enabled: chainId !== undefined && chainId !== null,
71
+ queryFn: () => {
72
+ return fetchVE33V2RouterFactoryRegistry(chainId as number);
73
+ }
74
+ }
75
+ }
76
+
77
+ /**
78
+ * fetch generateZapInParams
79
+ * @param {number} chainId - number
80
+ * @param {string} tokenA - address
81
+ * @param {string} tokenB - address
82
+ * @param {boolean} stable - bool
83
+ * @param {string} _factory - address
84
+ * @param {number} amountInA - uint256
85
+ * @param {number} amountInB - uint256
86
+ * @param {[string, string, boolean, string]} routesA - tuple[]
87
+ * @param {[string, string, boolean, string]} routesB - tuple[]
88
+ * @returns {bigint} amountOutMinA - uint256
89
+ * @returns {bigint} amountOutMinB - uint256
90
+ * @returns {bigint} amountAMin - uint256
91
+ * @returns {bigint} amountBMin - uint256
92
+ */
93
+ export function fetchVE33V2RouterGenerateZapInParams(chainId: number, tokenA: string, tokenB: string, stable: boolean, _factory: string, amountInA: number, amountInB: number, routesA: [string, string, boolean, string], routesB: [string, string, boolean, string]): Promise<{
94
+ amountOutMinA: bigint;
95
+ amountOutMinB: bigint;
96
+ amountAMin: bigint;
97
+ amountBMin: bigint;
98
+ }> {
99
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
100
+
101
+ const __encodeData = defaultAbiCoder.encode(["address","address","bool","address","uint256","uint256","tuple(address, address, bool, address)[]","tuple(address, address, bool, address)[]"], [tokenA,tokenB,stable,_factory,amountInA,amountInB,routesA,routesB]);
102
+ const __data = hexlify(concat(['0x07db50fa', __encodeData]));
103
+ return contractRequests.batchCall<{
104
+ amountOutMinA: bigint;
105
+ amountOutMinB: bigint;
106
+ amountAMin: bigint;
107
+ amountBMin: bigint;
108
+ }>(chainId, __to, __data, [{"internalType":"uint256","name":"amountOutMinA","type":"uint256"},{"internalType":"uint256","name":"amountOutMinB","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"}])
109
+ }
110
+ export function getFetchVE33V2RouterGenerateZapInParamsQueryOptions(chainId: number | undefined, tokenA: string | undefined, tokenB: string | undefined, stable: boolean | undefined, _factory: string | undefined, amountInA: number | undefined, amountInB: number | undefined, routesA: [string, string, boolean, string] | undefined, routesB: [string, string, boolean, string] | undefined) {
111
+ return {
112
+ queryKey: ['contract-request', 'fetchVE33V2RouterGenerateZapInParams', chainId, tokenA, tokenB, stable, _factory, amountInA, amountInB, routesA, routesB],
113
+ enabled: chainId !== undefined && chainId !== null && tokenA !== undefined && tokenA !== null && tokenB !== undefined && tokenB !== null && stable !== undefined && stable !== null && _factory !== undefined && _factory !== null && amountInA !== undefined && amountInA !== null && amountInB !== undefined && amountInB !== null && routesA !== undefined && routesA !== null && routesB !== undefined && routesB !== null,
114
+ queryFn: () => {
115
+ return fetchVE33V2RouterGenerateZapInParams(chainId as number,tokenA as string,tokenB as string,stable as boolean,_factory as string,amountInA as number,amountInB as number,routesA as [string, string, boolean, string],routesB as [string, string, boolean, string]);
116
+ }
117
+ }
118
+ }
119
+
120
+ /**
121
+ * fetch generateZapOutParams
122
+ * @param {number} chainId - number
123
+ * @param {string} tokenA - address
124
+ * @param {string} tokenB - address
125
+ * @param {boolean} stable - bool
126
+ * @param {string} _factory - address
127
+ * @param {number} liquidity - uint256
128
+ * @param {[string, string, boolean, string]} routesA - tuple[]
129
+ * @param {[string, string, boolean, string]} routesB - tuple[]
130
+ * @returns {bigint} amountOutMinA - uint256
131
+ * @returns {bigint} amountOutMinB - uint256
132
+ * @returns {bigint} amountAMin - uint256
133
+ * @returns {bigint} amountBMin - uint256
134
+ */
135
+ export function fetchVE33V2RouterGenerateZapOutParams(chainId: number, tokenA: string, tokenB: string, stable: boolean, _factory: string, liquidity: number, routesA: [string, string, boolean, string], routesB: [string, string, boolean, string]): Promise<{
136
+ amountOutMinA: bigint;
137
+ amountOutMinB: bigint;
138
+ amountAMin: bigint;
139
+ amountBMin: bigint;
140
+ }> {
141
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
142
+
143
+ const __encodeData = defaultAbiCoder.encode(["address","address","bool","address","uint256","tuple(address, address, bool, address)[]","tuple(address, address, bool, address)[]"], [tokenA,tokenB,stable,_factory,liquidity,routesA,routesB]);
144
+ const __data = hexlify(concat(['0x7539d413', __encodeData]));
145
+ return contractRequests.batchCall<{
146
+ amountOutMinA: bigint;
147
+ amountOutMinB: bigint;
148
+ amountAMin: bigint;
149
+ amountBMin: bigint;
150
+ }>(chainId, __to, __data, [{"internalType":"uint256","name":"amountOutMinA","type":"uint256"},{"internalType":"uint256","name":"amountOutMinB","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"}])
151
+ }
152
+ export function getFetchVE33V2RouterGenerateZapOutParamsQueryOptions(chainId: number | undefined, tokenA: string | undefined, tokenB: string | undefined, stable: boolean | undefined, _factory: string | undefined, liquidity: number | undefined, routesA: [string, string, boolean, string] | undefined, routesB: [string, string, boolean, string] | undefined) {
153
+ return {
154
+ queryKey: ['contract-request', 'fetchVE33V2RouterGenerateZapOutParams', chainId, tokenA, tokenB, stable, _factory, liquidity, routesA, routesB],
155
+ enabled: chainId !== undefined && chainId !== null && tokenA !== undefined && tokenA !== null && tokenB !== undefined && tokenB !== null && stable !== undefined && stable !== null && _factory !== undefined && _factory !== null && liquidity !== undefined && liquidity !== null && routesA !== undefined && routesA !== null && routesB !== undefined && routesB !== null,
156
+ queryFn: () => {
157
+ return fetchVE33V2RouterGenerateZapOutParams(chainId as number,tokenA as string,tokenB as string,stable as boolean,_factory as string,liquidity as number,routesA as [string, string, boolean, string],routesB as [string, string, boolean, string]);
158
+ }
159
+ }
160
+ }
161
+
162
+ /**
163
+ * fetch getAmountsOut
164
+ * @param {number} chainId - number
165
+ * @param {number} amountIn - uint256
166
+ * @param {[string, string, boolean, string]} routes - tuple[]
167
+ * @returns {Array<bigint>} amounts - uint256[]
168
+ */
169
+ export function fetchVE33V2RouterGetAmountsOut(chainId: number, amountIn: number, routes: [string, string, boolean, string]): Promise<Array<bigint>> {
170
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
171
+
172
+ const __encodeData = defaultAbiCoder.encode(["uint256","tuple(address, address, bool, address)[]"], [amountIn,routes]);
173
+ const __data = hexlify(concat(['0x5509a1ac', __encodeData]));
174
+ return contractRequests.batchCall<Array<bigint>>(chainId, __to, __data, [{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}])
175
+ }
176
+ export function getFetchVE33V2RouterGetAmountsOutQueryOptions(chainId: number | undefined, amountIn: number | undefined, routes: [string, string, boolean, string] | undefined) {
177
+ return {
178
+ queryKey: ['contract-request', 'fetchVE33V2RouterGetAmountsOut', chainId, amountIn, routes],
179
+ enabled: chainId !== undefined && chainId !== null && amountIn !== undefined && amountIn !== null && routes !== undefined && routes !== null,
180
+ queryFn: () => {
181
+ return fetchVE33V2RouterGetAmountsOut(chainId as number,amountIn as number,routes as [string, string, boolean, string]);
182
+ }
183
+ }
184
+ }
185
+
186
+ /**
187
+ * fetch getReserves
188
+ * @param {number} chainId - number
189
+ * @param {string} tokenA - address
190
+ * @param {string} tokenB - address
191
+ * @param {boolean} stable - bool
192
+ * @param {string} _factory - address
193
+ * @returns {bigint} reserveA - uint256
194
+ * @returns {bigint} reserveB - uint256
195
+ */
196
+ export function fetchVE33V2RouterGetReserves(chainId: number, tokenA: string, tokenB: string, stable: boolean, _factory: string): Promise<{
197
+ reserveA: bigint;
198
+ reserveB: bigint;
199
+ }> {
200
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
201
+
202
+ const __encodeData = defaultAbiCoder.encode(["address","address","bool","address"], [tokenA,tokenB,stable,_factory]);
203
+ const __data = hexlify(concat(['0x8c0037dc', __encodeData]));
204
+ return contractRequests.batchCall<{
205
+ reserveA: bigint;
206
+ reserveB: bigint;
207
+ }>(chainId, __to, __data, [{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}])
208
+ }
209
+ export function getFetchVE33V2RouterGetReservesQueryOptions(chainId: number | undefined, tokenA: string | undefined, tokenB: string | undefined, stable: boolean | undefined, _factory: string | undefined) {
210
+ return {
211
+ queryKey: ['contract-request', 'fetchVE33V2RouterGetReserves', chainId, tokenA, tokenB, stable, _factory],
212
+ enabled: chainId !== undefined && chainId !== null && tokenA !== undefined && tokenA !== null && tokenB !== undefined && tokenB !== null && stable !== undefined && stable !== null && _factory !== undefined && _factory !== null,
213
+ queryFn: () => {
214
+ return fetchVE33V2RouterGetReserves(chainId as number,tokenA as string,tokenB as string,stable as boolean,_factory as string);
215
+ }
216
+ }
217
+ }
218
+
219
+ /**
220
+ * fetch isTrustedForwarder
221
+ * @param {number} chainId - number
222
+ * @param {string} forwarder - address
223
+ * @returns {boolean} __output0 - bool
224
+ */
225
+ export function fetchVE33V2RouterIsTrustedForwarder(chainId: number, forwarder: string): Promise<boolean> {
226
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
227
+
228
+ const __encodeData = defaultAbiCoder.encode(["address"], [forwarder]);
229
+ const __data = hexlify(concat(['0x572b6c05', __encodeData]));
230
+ return contractRequests.batchCall<boolean>(chainId, __to, __data, [{"internalType":"bool","name":"","type":"bool"}])
231
+ }
232
+ export function getFetchVE33V2RouterIsTrustedForwarderQueryOptions(chainId: number | undefined, forwarder: string | undefined) {
233
+ return {
234
+ queryKey: ['contract-request', 'fetchVE33V2RouterIsTrustedForwarder', chainId, forwarder],
235
+ enabled: chainId !== undefined && chainId !== null && forwarder !== undefined && forwarder !== null,
236
+ queryFn: () => {
237
+ return fetchVE33V2RouterIsTrustedForwarder(chainId as number,forwarder as string);
238
+ }
239
+ }
240
+ }
241
+
242
+ /**
243
+ * fetch poolFor
244
+ * @param {number} chainId - number
245
+ * @param {string} tokenA - address
246
+ * @param {string} tokenB - address
247
+ * @param {boolean} stable - bool
248
+ * @param {string} _factory - address
249
+ * @returns {string} pool - address
250
+ */
251
+ export function fetchVE33V2RouterPoolFor(chainId: number, tokenA: string, tokenB: string, stable: boolean, _factory: string): Promise<string> {
252
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
253
+
254
+ const __encodeData = defaultAbiCoder.encode(["address","address","bool","address"], [tokenA,tokenB,stable,_factory]);
255
+ const __data = hexlify(concat(['0x874029d9', __encodeData]));
256
+ return contractRequests.batchCall<string>(chainId, __to, __data, [{"internalType":"address","name":"pool","type":"address"}])
257
+ }
258
+ export function getFetchVE33V2RouterPoolForQueryOptions(chainId: number | undefined, tokenA: string | undefined, tokenB: string | undefined, stable: boolean | undefined, _factory: string | undefined) {
259
+ return {
260
+ queryKey: ['contract-request', 'fetchVE33V2RouterPoolFor', chainId, tokenA, tokenB, stable, _factory],
261
+ enabled: chainId !== undefined && chainId !== null && tokenA !== undefined && tokenA !== null && tokenB !== undefined && tokenB !== null && stable !== undefined && stable !== null && _factory !== undefined && _factory !== null,
262
+ queryFn: () => {
263
+ return fetchVE33V2RouterPoolFor(chainId as number,tokenA as string,tokenB as string,stable as boolean,_factory as string);
264
+ }
265
+ }
266
+ }
267
+
268
+ /**
269
+ * fetch quoteAddLiquidity
270
+ * @param {number} chainId - number
271
+ * @param {string} tokenA - address
272
+ * @param {string} tokenB - address
273
+ * @param {boolean} stable - bool
274
+ * @param {string} _factory - address
275
+ * @param {number} amountADesired - uint256
276
+ * @param {number} amountBDesired - uint256
277
+ * @returns {bigint} amountA - uint256
278
+ * @returns {bigint} amountB - uint256
279
+ * @returns {bigint} liquidity - uint256
280
+ */
281
+ export function fetchVE33V2RouterQuoteAddLiquidity(chainId: number, tokenA: string, tokenB: string, stable: boolean, _factory: string, amountADesired: number, amountBDesired: number): Promise<{
282
+ amountA: bigint;
283
+ amountB: bigint;
284
+ liquidity: bigint;
285
+ }> {
286
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
287
+
288
+ const __encodeData = defaultAbiCoder.encode(["address","address","bool","address","uint256","uint256"], [tokenA,tokenB,stable,_factory,amountADesired,amountBDesired]);
289
+ const __data = hexlify(concat(['0xce700c29', __encodeData]));
290
+ return contractRequests.batchCall<{
291
+ amountA: bigint;
292
+ amountB: bigint;
293
+ liquidity: bigint;
294
+ }>(chainId, __to, __data, [{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}])
295
+ }
296
+ export function getFetchVE33V2RouterQuoteAddLiquidityQueryOptions(chainId: number | undefined, tokenA: string | undefined, tokenB: string | undefined, stable: boolean | undefined, _factory: string | undefined, amountADesired: number | undefined, amountBDesired: number | undefined) {
297
+ return {
298
+ queryKey: ['contract-request', 'fetchVE33V2RouterQuoteAddLiquidity', chainId, tokenA, tokenB, stable, _factory, amountADesired, amountBDesired],
299
+ enabled: chainId !== undefined && chainId !== null && tokenA !== undefined && tokenA !== null && tokenB !== undefined && tokenB !== null && stable !== undefined && stable !== null && _factory !== undefined && _factory !== null && amountADesired !== undefined && amountADesired !== null && amountBDesired !== undefined && amountBDesired !== null,
300
+ queryFn: () => {
301
+ return fetchVE33V2RouterQuoteAddLiquidity(chainId as number,tokenA as string,tokenB as string,stable as boolean,_factory as string,amountADesired as number,amountBDesired as number);
302
+ }
303
+ }
304
+ }
305
+
306
+ /**
307
+ * fetch quoteRemoveLiquidity
308
+ * @param {number} chainId - number
309
+ * @param {string} tokenA - address
310
+ * @param {string} tokenB - address
311
+ * @param {boolean} stable - bool
312
+ * @param {string} _factory - address
313
+ * @param {number} liquidity - uint256
314
+ * @returns {bigint} amountA - uint256
315
+ * @returns {bigint} amountB - uint256
316
+ */
317
+ export function fetchVE33V2RouterQuoteRemoveLiquidity(chainId: number, tokenA: string, tokenB: string, stable: boolean, _factory: string, liquidity: number): Promise<{
318
+ amountA: bigint;
319
+ amountB: bigint;
320
+ }> {
321
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
322
+
323
+ const __encodeData = defaultAbiCoder.encode(["address","address","bool","address","uint256"], [tokenA,tokenB,stable,_factory,liquidity]);
324
+ const __data = hexlify(concat(['0xc92de3ec', __encodeData]));
325
+ return contractRequests.batchCall<{
326
+ amountA: bigint;
327
+ amountB: bigint;
328
+ }>(chainId, __to, __data, [{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}])
329
+ }
330
+ export function getFetchVE33V2RouterQuoteRemoveLiquidityQueryOptions(chainId: number | undefined, tokenA: string | undefined, tokenB: string | undefined, stable: boolean | undefined, _factory: string | undefined, liquidity: number | undefined) {
331
+ return {
332
+ queryKey: ['contract-request', 'fetchVE33V2RouterQuoteRemoveLiquidity', chainId, tokenA, tokenB, stable, _factory, liquidity],
333
+ enabled: chainId !== undefined && chainId !== null && tokenA !== undefined && tokenA !== null && tokenB !== undefined && tokenB !== null && stable !== undefined && stable !== null && _factory !== undefined && _factory !== null && liquidity !== undefined && liquidity !== null,
334
+ queryFn: () => {
335
+ return fetchVE33V2RouterQuoteRemoveLiquidity(chainId as number,tokenA as string,tokenB as string,stable as boolean,_factory as string,liquidity as number);
336
+ }
337
+ }
338
+ }
339
+
340
+ /**
341
+ * fetch quoteStableLiquidityRatio
342
+ * @param {number} chainId - number
343
+ * @param {string} tokenA - address
344
+ * @param {string} tokenB - address
345
+ * @param {string} _factory - address
346
+ * @returns {bigint} ratio - uint256
347
+ */
348
+ export function fetchVE33V2RouterQuoteStableLiquidityRatio(chainId: number, tokenA: string, tokenB: string, _factory: string): Promise<bigint> {
349
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
350
+
351
+ const __encodeData = defaultAbiCoder.encode(["address","address","address"], [tokenA,tokenB,_factory]);
352
+ const __data = hexlify(concat(['0xf5ba53c7', __encodeData]));
353
+ return contractRequests.batchCall<bigint>(chainId, __to, __data, [{"internalType":"uint256","name":"ratio","type":"uint256"}])
354
+ }
355
+ export function getFetchVE33V2RouterQuoteStableLiquidityRatioQueryOptions(chainId: number | undefined, tokenA: string | undefined, tokenB: string | undefined, _factory: string | undefined) {
356
+ return {
357
+ queryKey: ['contract-request', 'fetchVE33V2RouterQuoteStableLiquidityRatio', chainId, tokenA, tokenB, _factory],
358
+ enabled: chainId !== undefined && chainId !== null && tokenA !== undefined && tokenA !== null && tokenB !== undefined && tokenB !== null && _factory !== undefined && _factory !== null,
359
+ queryFn: () => {
360
+ return fetchVE33V2RouterQuoteStableLiquidityRatio(chainId as number,tokenA as string,tokenB as string,_factory as string);
361
+ }
362
+ }
363
+ }
364
+
365
+ /**
366
+ * fetch sortTokens
367
+ * @param {number} chainId - number
368
+ * @param {string} tokenA - address
369
+ * @param {string} tokenB - address
370
+ * @returns {string} token0 - address
371
+ * @returns {string} token1 - address
372
+ */
373
+ export function fetchVE33V2RouterSortTokens(chainId: number, tokenA: string, tokenB: string): Promise<{
374
+ token0: string;
375
+ token1: string;
376
+ }> {
377
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
378
+
379
+ const __encodeData = defaultAbiCoder.encode(["address","address"], [tokenA,tokenB]);
380
+ const __data = hexlify(concat(['0x544caa56', __encodeData]));
381
+ return contractRequests.batchCall<{
382
+ token0: string;
383
+ token1: string;
384
+ }>(chainId, __to, __data, [{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"}])
385
+ }
386
+ export function getFetchVE33V2RouterSortTokensQueryOptions(chainId: number | undefined, tokenA: string | undefined, tokenB: string | undefined) {
387
+ return {
388
+ queryKey: ['contract-request', 'fetchVE33V2RouterSortTokens', chainId, tokenA, tokenB],
389
+ enabled: chainId !== undefined && chainId !== null && tokenA !== undefined && tokenA !== null && tokenB !== undefined && tokenB !== null,
390
+ queryFn: () => {
391
+ return fetchVE33V2RouterSortTokens(chainId as number,tokenA as string,tokenB as string);
392
+ }
393
+ }
394
+ }
395
+
396
+ /**
397
+ * fetch voter
398
+ * @param {number} chainId - number
399
+ * @returns {string} __output0 - address
400
+ */
401
+ export function fetchVE33V2RouterVoter(chainId: number): Promise<string> {
402
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
403
+
404
+ const __encodeData = defaultAbiCoder.encode([], []);
405
+ const __data = hexlify(concat(['0x46c96aac', __encodeData]));
406
+ return contractRequests.batchCall<string>(chainId, __to, __data, [{"internalType":"address","name":"","type":"address"}])
407
+ }
408
+ export function getFetchVE33V2RouterVoterQueryOptions(chainId: number | undefined) {
409
+ return {
410
+ queryKey: ['contract-request', 'fetchVE33V2RouterVoter', chainId],
411
+ enabled: chainId !== undefined && chainId !== null,
412
+ queryFn: () => {
413
+ return fetchVE33V2RouterVoter(chainId as number);
414
+ }
415
+ }
416
+ }
417
+
418
+ /**
419
+ * fetch weth
420
+ * @param {number} chainId - number
421
+ * @returns {string} __output0 - address
422
+ */
423
+ export function fetchVE33V2RouterWeth(chainId: number): Promise<string> {
424
+ const __to = getVE33V2RouterContractAddressByChainId(chainId);
425
+
426
+ const __encodeData = defaultAbiCoder.encode([], []);
427
+ const __data = hexlify(concat(['0x3fc8cef3', __encodeData]));
428
+ return contractRequests.batchCall<string>(chainId, __to, __data, [{"internalType":"contract IWETH","name":"","type":"address"}])
429
+ }
430
+ export function getFetchVE33V2RouterWethQueryOptions(chainId: number | undefined) {
431
+ return {
432
+ queryKey: ['contract-request', 'fetchVE33V2RouterWeth', chainId],
433
+ enabled: chainId !== undefined && chainId !== null,
434
+ queryFn: () => {
435
+ return fetchVE33V2RouterWeth(chainId as number);
436
+ }
437
+ }
438
+ }
439
+
440
+ /**
441
+ * encode UNSAFE_swapExactTokensForTokens
442
+ * @param {Array<string | number>} amounts - uint256[]
443
+ * @param {[string, string, boolean, string]} routes - tuple[]
444
+ * @param {string} to - address
445
+ * @param {string | number} deadline - uint256
446
+ * @returns {string} encode data
447
+ */
448
+ export function encodeVE33V2RouterUNSAFE_swapExactTokensForTokens(amounts: Array<string | number>, routes: [string, string, boolean, string], to: string, deadline: string | number) {
449
+ const __encodeData = defaultAbiCoder.encode(["uint256[]","tuple(address, address, bool, address)[]","address","uint256"], [amounts,routes,to,deadline]);
450
+ return hexlify(concat(['0x4111d597', __encodeData]));
451
+ }
452
+
453
+ /**
454
+ * encode addLiquidity
455
+ * @param {string} tokenA - address
456
+ * @param {string} tokenB - address
457
+ * @param {boolean} stable - bool
458
+ * @param {string | number} amountADesired - uint256
459
+ * @param {string | number} amountBDesired - uint256
460
+ * @param {string | number} amountAMin - uint256
461
+ * @param {string | number} amountBMin - uint256
462
+ * @param {string} to - address
463
+ * @param {string | number} deadline - uint256
464
+ * @returns {string} encode data
465
+ */
466
+ export function encodeVE33V2RouterAddLiquidity(tokenA: string, tokenB: string, stable: boolean, amountADesired: string | number, amountBDesired: string | number, amountAMin: string | number, amountBMin: string | number, to: string, deadline: string | number) {
467
+ const __encodeData = defaultAbiCoder.encode(["address","address","bool","uint256","uint256","uint256","uint256","address","uint256"], [tokenA,tokenB,stable,amountADesired,amountBDesired,amountAMin,amountBMin,to,deadline]);
468
+ return hexlify(concat(['0x5a47ddc3', __encodeData]));
469
+ }
470
+
471
+ /**
472
+ * encode addLiquidityETH
473
+ * @param {string} token - address
474
+ * @param {boolean} stable - bool
475
+ * @param {string | number} amountTokenDesired - uint256
476
+ * @param {string | number} amountTokenMin - uint256
477
+ * @param {string | number} amountETHMin - uint256
478
+ * @param {string} to - address
479
+ * @param {string | number} deadline - uint256
480
+ * @returns {string} encode data
481
+ */
482
+ export function encodeVE33V2RouterAddLiquidityETH(token: string, stable: boolean, amountTokenDesired: string | number, amountTokenMin: string | number, amountETHMin: string | number, to: string, deadline: string | number) {
483
+ const __encodeData = defaultAbiCoder.encode(["address","bool","uint256","uint256","uint256","address","uint256"], [token,stable,amountTokenDesired,amountTokenMin,amountETHMin,to,deadline]);
484
+ return hexlify(concat(['0xb7e0d4c0', __encodeData]));
485
+ }
486
+
487
+ /**
488
+ * encode removeLiquidity
489
+ * @param {string} tokenA - address
490
+ * @param {string} tokenB - address
491
+ * @param {boolean} stable - bool
492
+ * @param {string | number} liquidity - uint256
493
+ * @param {string | number} amountAMin - uint256
494
+ * @param {string | number} amountBMin - uint256
495
+ * @param {string} to - address
496
+ * @param {string | number} deadline - uint256
497
+ * @returns {string} encode data
498
+ */
499
+ export function encodeVE33V2RouterRemoveLiquidity(tokenA: string, tokenB: string, stable: boolean, liquidity: string | number, amountAMin: string | number, amountBMin: string | number, to: string, deadline: string | number) {
500
+ const __encodeData = defaultAbiCoder.encode(["address","address","bool","uint256","uint256","uint256","address","uint256"], [tokenA,tokenB,stable,liquidity,amountAMin,amountBMin,to,deadline]);
501
+ return hexlify(concat(['0x0dede6c4', __encodeData]));
502
+ }
503
+
504
+ /**
505
+ * encode removeLiquidityETH
506
+ * @param {string} token - address
507
+ * @param {boolean} stable - bool
508
+ * @param {string | number} liquidity - uint256
509
+ * @param {string | number} amountTokenMin - uint256
510
+ * @param {string | number} amountETHMin - uint256
511
+ * @param {string} to - address
512
+ * @param {string | number} deadline - uint256
513
+ * @returns {string} encode data
514
+ */
515
+ export function encodeVE33V2RouterRemoveLiquidityETH(token: string, stable: boolean, liquidity: string | number, amountTokenMin: string | number, amountETHMin: string | number, to: string, deadline: string | number) {
516
+ const __encodeData = defaultAbiCoder.encode(["address","bool","uint256","uint256","uint256","address","uint256"], [token,stable,liquidity,amountTokenMin,amountETHMin,to,deadline]);
517
+ return hexlify(concat(['0xd7b0e0a5', __encodeData]));
518
+ }
519
+
520
+ /**
521
+ * encode removeLiquidityETHSupportingFeeOnTransferTokens
522
+ * @param {string} token - address
523
+ * @param {boolean} stable - bool
524
+ * @param {string | number} liquidity - uint256
525
+ * @param {string | number} amountTokenMin - uint256
526
+ * @param {string | number} amountETHMin - uint256
527
+ * @param {string} to - address
528
+ * @param {string | number} deadline - uint256
529
+ * @returns {string} encode data
530
+ */
531
+ export function encodeVE33V2RouterRemoveLiquidityETHSupportingFeeOnTransferTokens(token: string, stable: boolean, liquidity: string | number, amountTokenMin: string | number, amountETHMin: string | number, to: string, deadline: string | number) {
532
+ const __encodeData = defaultAbiCoder.encode(["address","bool","uint256","uint256","uint256","address","uint256"], [token,stable,liquidity,amountTokenMin,amountETHMin,to,deadline]);
533
+ return hexlify(concat(['0xfe411f14', __encodeData]));
534
+ }
535
+
536
+ /**
537
+ * encode swapExactETHForTokens
538
+ * @param {string | number} amountOutMin - uint256
539
+ * @param {[string, string, boolean, string]} routes - tuple[]
540
+ * @param {string} to - address
541
+ * @param {string | number} deadline - uint256
542
+ * @returns {string} encode data
543
+ */
544
+ export function encodeVE33V2RouterSwapExactETHForTokens(amountOutMin: string | number, routes: [string, string, boolean, string], to: string, deadline: string | number) {
545
+ const __encodeData = defaultAbiCoder.encode(["uint256","tuple(address, address, bool, address)[]","address","uint256"], [amountOutMin,routes,to,deadline]);
546
+ return hexlify(concat(['0x903638a4', __encodeData]));
547
+ }
548
+
549
+ /**
550
+ * encode swapExactETHForTokensSupportingFeeOnTransferTokens
551
+ * @param {string | number} amountOutMin - uint256
552
+ * @param {[string, string, boolean, string]} routes - tuple[]
553
+ * @param {string} to - address
554
+ * @param {string | number} deadline - uint256
555
+ * @returns {string} encode data
556
+ */
557
+ export function encodeVE33V2RouterSwapExactETHForTokensSupportingFeeOnTransferTokens(amountOutMin: string | number, routes: [string, string, boolean, string], to: string, deadline: string | number) {
558
+ const __encodeData = defaultAbiCoder.encode(["uint256","tuple(address, address, bool, address)[]","address","uint256"], [amountOutMin,routes,to,deadline]);
559
+ return hexlify(concat(['0x3da5acba', __encodeData]));
560
+ }
561
+
562
+ /**
563
+ * encode swapExactTokensForETH
564
+ * @param {string | number} amountIn - uint256
565
+ * @param {string | number} amountOutMin - uint256
566
+ * @param {[string, string, boolean, string]} routes - tuple[]
567
+ * @param {string} to - address
568
+ * @param {string | number} deadline - uint256
569
+ * @returns {string} encode data
570
+ */
571
+ export function encodeVE33V2RouterSwapExactTokensForETH(amountIn: string | number, amountOutMin: string | number, routes: [string, string, boolean, string], to: string, deadline: string | number) {
572
+ const __encodeData = defaultAbiCoder.encode(["uint256","uint256","tuple(address, address, bool, address)[]","address","uint256"], [amountIn,amountOutMin,routes,to,deadline]);
573
+ return hexlify(concat(['0xc6b7f1b6', __encodeData]));
574
+ }
575
+
576
+ /**
577
+ * encode swapExactTokensForETHSupportingFeeOnTransferTokens
578
+ * @param {string | number} amountIn - uint256
579
+ * @param {string | number} amountOutMin - uint256
580
+ * @param {[string, string, boolean, string]} routes - tuple[]
581
+ * @param {string} to - address
582
+ * @param {string | number} deadline - uint256
583
+ * @returns {string} encode data
584
+ */
585
+ export function encodeVE33V2RouterSwapExactTokensForETHSupportingFeeOnTransferTokens(amountIn: string | number, amountOutMin: string | number, routes: [string, string, boolean, string], to: string, deadline: string | number) {
586
+ const __encodeData = defaultAbiCoder.encode(["uint256","uint256","tuple(address, address, bool, address)[]","address","uint256"], [amountIn,amountOutMin,routes,to,deadline]);
587
+ return hexlify(concat(['0x12bc3aca', __encodeData]));
588
+ }
589
+
590
+ /**
591
+ * encode swapExactTokensForTokens
592
+ * @param {string | number} amountIn - uint256
593
+ * @param {string | number} amountOutMin - uint256
594
+ * @param {[string, string, boolean, string]} routes - tuple[]
595
+ * @param {string} to - address
596
+ * @param {string | number} deadline - uint256
597
+ * @returns {string} encode data
598
+ */
599
+ export function encodeVE33V2RouterSwapExactTokensForTokens(amountIn: string | number, amountOutMin: string | number, routes: [string, string, boolean, string], to: string, deadline: string | number) {
600
+ const __encodeData = defaultAbiCoder.encode(["uint256","uint256","tuple(address, address, bool, address)[]","address","uint256"], [amountIn,amountOutMin,routes,to,deadline]);
601
+ return hexlify(concat(['0xcac88ea9', __encodeData]));
602
+ }
603
+
604
+ /**
605
+ * encode swapExactTokensForTokensSupportingFeeOnTransferTokens
606
+ * @param {string | number} amountIn - uint256
607
+ * @param {string | number} amountOutMin - uint256
608
+ * @param {[string, string, boolean, string]} routes - tuple[]
609
+ * @param {string} to - address
610
+ * @param {string | number} deadline - uint256
611
+ * @returns {string} encode data
612
+ */
613
+ export function encodeVE33V2RouterSwapExactTokensForTokensSupportingFeeOnTransferTokens(amountIn: string | number, amountOutMin: string | number, routes: [string, string, boolean, string], to: string, deadline: string | number) {
614
+ const __encodeData = defaultAbiCoder.encode(["uint256","uint256","tuple(address, address, bool, address)[]","address","uint256"], [amountIn,amountOutMin,routes,to,deadline]);
615
+ return hexlify(concat(['0x88cd821e', __encodeData]));
616
+ }
617
+
618
+ /**
619
+ * encode zapIn
620
+ * @param {string} tokenIn - address
621
+ * @param {string | number} amountInA - uint256
622
+ * @param {string | number} amountInB - uint256
623
+ * @param {{tokenA: string; tokenB: string; stable: boolean; factory: string; amountOutMinA: string | number; amountOutMinB: string | number; amountAMin: string | number; amountBMin: string | number}} zapInPool - tuple
624
+ * @param {[string, string, boolean, string]} routesA - tuple[]
625
+ * @param {[string, string, boolean, string]} routesB - tuple[]
626
+ * @param {string} to - address
627
+ * @param {boolean} stake - bool
628
+ * @returns {string} encode data
629
+ */
630
+ export function encodeVE33V2RouterZapIn(tokenIn: string, amountInA: string | number, amountInB: string | number, zapInPool: {tokenA: string; tokenB: string; stable: boolean; factory: string; amountOutMinA: string | number; amountOutMinB: string | number; amountAMin: string | number; amountBMin: string | number}, routesA: [string, string, boolean, string], routesB: [string, string, boolean, string], to: string, stake: boolean) {
631
+ const __encodeData = defaultAbiCoder.encode(["address","uint256","uint256","tuple(address, address, bool, address, uint256, uint256, uint256, uint256)","tuple(address, address, bool, address)[]","tuple(address, address, bool, address)[]","address","bool"], [tokenIn,amountInA,amountInB,Object.values(zapInPool),routesA,routesB,to,stake]);
632
+ return hexlify(concat(['0xfb49bafd', __encodeData]));
633
+ }
634
+
635
+ /**
636
+ * encode zapOut
637
+ * @param {string} tokenOut - address
638
+ * @param {string | number} liquidity - uint256
639
+ * @param {{tokenA: string; tokenB: string; stable: boolean; factory: string; amountOutMinA: string | number; amountOutMinB: string | number; amountAMin: string | number; amountBMin: string | number}} zapOutPool - tuple
640
+ * @param {[string, string, boolean, string]} routesA - tuple[]
641
+ * @param {[string, string, boolean, string]} routesB - tuple[]
642
+ * @returns {string} encode data
643
+ */
644
+ export function encodeVE33V2RouterZapOut(tokenOut: string, liquidity: string | number, zapOutPool: {tokenA: string; tokenB: string; stable: boolean; factory: string; amountOutMinA: string | number; amountOutMinB: string | number; amountAMin: string | number; amountBMin: string | number}, routesA: [string, string, boolean, string], routesB: [string, string, boolean, string]) {
645
+ const __encodeData = defaultAbiCoder.encode(["address","uint256","tuple(address, address, bool, address, uint256, uint256, uint256, uint256)","tuple(address, address, bool, address)[]","tuple(address, address, bool, address)[]"], [tokenOut,liquidity,Object.values(zapOutPool),routesA,routesB]);
646
+ return hexlify(concat(['0xa81b9159', __encodeData]));
647
+ }
package/src/index.ts CHANGED
@@ -76,5 +76,8 @@ export * from './contract/UniswapV2Pair';
76
76
  export * from './contract/UniswapV2Router02';
77
77
  export * from './contract/UniswapV2Router02FixedFee';
78
78
  export * from './contract/UniswapV3Factory';
79
+ export * from './contract/VE33NonfungiblePositionManager';
80
+ export * from './contract/VE33V2Pair';
81
+ export * from './contract/VE33V2Router';
79
82
  export * from './contract/dodoTeam';
80
83
  export * from './contract/vDODOToken';