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

typing fixes#390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
liquid-8 merged 1 commit intouniswap-python:dev/v4fromliquid-8:dev
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletionsuniswap/types.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
from typing import Union
from dataclasses import dataclass
from eth_typing.evm import Address, ChecksumAddress
from typing import List, Tuple


AddressLike = Union[Address, ChecksumAddress]
Expand DownExpand Up@@ -44,7 +45,7 @@ class UniswapV4_PathKey:
# Ticks that involve positions must be a multiple of tick spacing
tickSpacing : int
# The hooks of the pool
hooks :list[Address]
hooks :List[Address]

def __repr__(self) -> (Address, Address, int, int,list[Address]):
def __repr__(self) ->Tuple(Address, Address, int, int,List[Address]):
return (self.currency0, self.currency1, self.fee, self.tickSpacing, self.hooks)
14 changes: 4 additions & 10 deletionsuniswap/uniswap4.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -130,7 +130,7 @@ def get_quote_exact_input_single(
sqrt_price_limit_x96: int = 0,
zero_for_one: bool = True,
hooks: Union[AddressLike, str, None] = NOHOOK_ADDRESS,
):
) -> Any:
"""
:if `zero_to_one` is true: given `qty` amount of the input `token0`, returns the maximum output amount of output `token1`.
:if `zero_to_one` is false: returns the minimum amount of `token0` required to buy `qty` amount of `token1`.
Expand DownExpand Up@@ -173,7 +173,7 @@ def get_quote_exact_output_single(
sqrt_price_limit_x96: int = 0,
zero_for_one: bool = True,
hooks: Union[AddressLike, str, None] = NOHOOK_ADDRESS,
):
) -> Any:
"""
:if `zero_to_one` is true: given `qty` amount of the input `token0`, returns the maximum output amount of output `token1`.
:if `zero_to_one` is false: returns the minimum amount of `token0` required to buy `qty` amount of `token1`.
Expand DownExpand Up@@ -210,14 +210,11 @@ def get_quote_exact_input(
currency: AddressLike, # input token
qty: int,
path : list[UniswapV4_PathKey],
):
) -> Any:
"""
:path is a swap route
"""

if currency0 == currency1:
raise ValueError

quote_params = {
"exactCurrency": currency,
"path": path,
Expand All@@ -236,14 +233,11 @@ def get_quote_exact_output(
currency: AddressLike, # input token
qty: int,
path : list[UniswapV4_PathKey],
):
) -> Any:
"""
:path is a swap route
"""

if currency0 == currency1:
raise ValueError

quote_params = {
"exactCurrency": currency,
"path": path,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp