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

Commitdbe104f

Browse files
authored
Merge pull request#365 from liquid-8/dev
UniswapV4 alpha
2 parents7f7cbe9 +2f9e012 commitdbe104f

File tree

5 files changed

+296
-51
lines changed

5 files changed

+296
-51
lines changed

‎uniswap/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .importexceptions
22
from .uniswapimportUniswap,_str_to_addr
3-
from .uniswap4importUniswap4
3+
from .uniswap4importUniswap4Core
44
from .cliimportmain

‎uniswap/assets/uniswap-v4/poolmanager.abi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,17 +635,17 @@
635635
{
636636
"inputs": [
637637
{
638-
"internalType": "uint256",
639-
"name": "id",
640-
"type": "uint256"
638+
"internalType": "address",
639+
"name": "locker",
640+
"type": "address"
641641
},
642642
{
643643
"internalType": "Currency",
644644
"name": "currency",
645645
"type": "address"
646646
}
647647
],
648-
"name": "getCurrencyDelta",
648+
"name": "currencyDelta",
649649
"outputs": [
650650
{
651651
"internalType": "int256",

‎uniswap/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
137:"polygon",
3030
100:"xdai",
3131
250:"fantom",
32+
17000:"holesky",
3233
42161:"arbitrum",
3334
421611:"arbitrum_testnet",
35+
11155111:"sepolia",
3436
1666600000:"harmony_mainnet",
3537
1666700000:"harmony_testnet",
3638
}

‎uniswap/types.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
fromtypingimportUnion
2+
fromdataclassesimportdataclass
23
frometh_typing.evmimportAddress,ChecksumAddress
34

45

56
AddressLike=Union[Address,ChecksumAddress]
7+
8+
@dataclass
9+
classUniswapV4_slot0:
10+
sqrtPriceX96:int
11+
tick:int
12+
protocolFee:int
13+
14+
def__repr__(self)->str:
15+
returnf"Slot0 value (sqrtPriceX96:{self.sqrtPriceX96}; tick:{self.tick}; protocolFee:{self.protocolFee!r})"
16+
17+
@dataclass
18+
classUniswapV4_position_info:
19+
liquidity:int
20+
feeGrowthInside0LastX128:int
21+
feeGrowthInside1LastX128:int
22+
23+
def__repr__(self)->str:
24+
returnf"Position info (liquidity:{self.liquidity}; feeGrowthInside0LastX128:{self.feeGrowthInside0LastX128}; feeGrowthInside1LastX128:{self.feeGrowthInside1LastX128!r})"
25+
26+
@dataclass
27+
classUniswapV4_tick_info:
28+
liquidityGross :int
29+
liquidityNet :int
30+
feeGrowthOutside0X128 :int
31+
feeGrowthOutside1X128 :int
32+
33+
def__repr__(self)->str:
34+
returnf"Tick info (liquidityGross:{self.liquidityGross}; liquidityNet:{self.liquidityNet}; feeGrowthOutside0X128:{self.feeGrowthOutside0X128}; feeGrowthOutside1X128:{self.feeGrowthOutside1X128!r})"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp