Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ebdb89

Browse files
authored
Merge pull request#390 from liquid-8/dev
typing fixes
2 parentsc1f237a +14130d1 commit0ebdb89

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

‎uniswap/types.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
fromtypingimportUnion
22
fromdataclassesimportdataclass
33
frometh_typing.evmimportAddress,ChecksumAddress
4+
fromtypingimportList,Tuple
45

56

67
AddressLike=Union[Address,ChecksumAddress]
@@ -44,7 +45,7 @@ class UniswapV4_PathKey:
4445
# Ticks that involve positions must be a multiple of tick spacing
4546
tickSpacing :int
4647
# The hooks of the pool
47-
hooks :list[Address]
48+
hooks :List[Address]
4849

49-
def__repr__(self)-> (Address,Address,int,int,list[Address]):
50+
def__repr__(self)->Tuple(Address,Address,int,int,List[Address]):
5051
return (self.currency0,self.currency1,self.fee,self.tickSpacing,self.hooks)

‎uniswap/uniswap4.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def get_quote_exact_input_single(
130130
sqrt_price_limit_x96:int=0,
131131
zero_for_one:bool=True,
132132
hooks:Union[AddressLike,str,None]=NOHOOK_ADDRESS,
133-
):
133+
)->Any:
134134
"""
135135
:if `zero_to_one` is true: given `qty` amount of the input `token0`, returns the maximum output amount of output `token1`.
136136
:if `zero_to_one` is false: returns the minimum amount of `token0` required to buy `qty` amount of `token1`.
@@ -173,7 +173,7 @@ def get_quote_exact_output_single(
173173
sqrt_price_limit_x96:int=0,
174174
zero_for_one:bool=True,
175175
hooks:Union[AddressLike,str,None]=NOHOOK_ADDRESS,
176-
):
176+
)->Any:
177177
"""
178178
:if `zero_to_one` is true: given `qty` amount of the input `token0`, returns the maximum output amount of output `token1`.
179179
:if `zero_to_one` is false: returns the minimum amount of `token0` required to buy `qty` amount of `token1`.
@@ -210,14 +210,11 @@ def get_quote_exact_input(
210210
currency:AddressLike,# input token
211211
qty:int,
212212
path :list[UniswapV4_PathKey],
213-
):
213+
)->Any:
214214
"""
215215
:path is a swap route
216216
"""
217217

218-
ifcurrency0==currency1:
219-
raiseValueError
220-
221218
quote_params= {
222219
"exactCurrency":currency,
223220
"path":path,
@@ -236,14 +233,11 @@ def get_quote_exact_output(
236233
currency:AddressLike,# input token
237234
qty:int,
238235
path :list[UniswapV4_PathKey],
239-
):
236+
)->Any:
240237
"""
241238
:path is a swap route
242239
"""
243240

244-
ifcurrency0==currency1:
245-
raiseValueError
246-
247241
quote_params= {
248242
"exactCurrency":currency,
249243
"path":path,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp